Trắc nghiệm trực tuyến

<!DOCTYPE HTML>
<!-- saved from url=(0026)https://phet.colorado.edu/ -->
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1"/>
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  <meta name="phet-sim-level" content="production"/>

  <!-- metadata for Open Graph protocol -->
  <meta property="og:title" content="&#8234;My Solar System&#8236;"/>
  <meta property="og:type" content="phet:simulation"/>
  <meta property="og:url" content="https://phet.colorado.edu/sims/html/my-solar-system/latest/my-solar-system_en.html"/>
  <meta property="og:image" content="https://phet.colorado.edu/sims/html/my-solar-system/latest/my-solar-system-600.png"/>

  <title>&#8234;My Solar System&#8236;</title>
</head>
<!--
‪My Solar System‬ 1.3.15
PhET Interactive Simulations, University of Colorado Boulder
Copyright 2002-2026 Regents of the University of Colorado

This file is licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). https://creativecommons.org/licenses/by-nc/4.0/
Attribution is required near point of use, recommended attribution is: Simulation by PhET Interactive Simulations, University of Colorado Boulder, licensed under CC BY-NC 4.0 (https://phet.colorado.edu).

COMMERCIAL USE REQUIRES A COMMERCIAL LICENSE AGREEMENT FROM THE UNIVERSITY OF COLORADO BOULDER.
For information on commercial licensing, see https://phet.colorado.edu/en/licensing

The PhET name and PhET logo are registered trademarks of The Regents of the University of Colorado. Use of the PhET name and/or PhET logo for any purpose, including but not limited to promotional, marketing, or advertising purposes, requires a separate license agreement from the University of Colorado Boulder.
For information on brand use, see https://phet.colorado.edu/en/licensing

For licenses for third-party software used by this simulation, see below
-->
<!-- body is only made black for the loading phase so that the splash screen is black -->
<body style="background-color:black;">
<script type="text/javascript">window.phet={};window.phet.chipper={};
// This simulation uses following third-party resources.  The following code block describes each resource
// and provides its licensing information.  The START and END tags make it easy to automatically parse
// and the entries are in JSON.  See getLicenseEntry.js for information about the attributes in each entry.
// ### START THIRD PARTY LICENSE ENTRIES ###
window.phet.chipper.thirdPartyLicenseEntries={
  "lib": {
    "base64-js-1.2.0.js": {
      "text": [
        "Copyright (c) 2014"
      ],
      "license": "The MIT License",
      "projectURL": "https://github.com/beatgammit/base64-js",
      "notes": "For converting typed arrays to base64 (helps converting encoded SVG data URLs)",
      "licenseText": [
        "The MIT License (MIT)",
        "",
        "Copyright (c) 2014",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy",
        "of this software and associated documentation files (the \"Software\"), to deal",
        "in the Software without restriction, including without limitation the rights",
        "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
        "copies of the Software, and to permit persons to whom the Software is",
        "furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in",
        "all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
        "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
        "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
        "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
        "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
        "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN",
        "THE SOFTWARE.",
        ""
      ]
    },
    "FileSaver-b8054a2.js": {
      "text": [
        "Copyright (c) 2015 Eli Grey. (http://eligrey.com)"
      ],
      "license": "The MIT License",
      "projectURL": "https://github.com/eligrey/FileSaver.js",
      "notes": "Used for saving screenshot images",
      "licenseText": [
        "Copyright © 2014 Eli Grey.",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
        ""
      ]
    },
    "flatqueue-1.2.1.js": {
      "text": [
        "Copyright (c) 2018, Vladimir Agafonkin"
      ],
      "license": "ISC License",
      "projectURL": "https://github.com/mourner/flatqueue",
      "notes": "Used for accelerated shape computation",
      "licenseText": [
        "ISC License",
        "",
        "Copyright (c) 2018, Vladimir Agafonkin",
        "",
        "Permission to use, copy, modify, and/or distribute this software for any purpose",
        "with or without fee is hereby granted, provided that the above copyright notice",
        "and this permission notice appear in all copies.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH",
        "REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND",
        "FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,",
        "INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS",
        "OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER",
        "TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF",
        "THIS SOFTWARE."
      ]
    },
    "font-awesome-4.5.0": {
      "text": [
        "Created by Dave Gandy"
      ],
      "license": "Font Awesome licensed under SIL OFL 1.1 · Code licensed under MIT License · Documentation licensed under CC BY 3.0",
      "projectURL": "http://fontawesome.io/",
      "notes": "Provides shapes and icons for phet-io wrappers, SVG for icons in FontAwesomeNode",
      "licenseText": [
        "Copyright (c) 2013, Dave Gandy - http://fontawesome.io",
        "with Reserved Font Name Font Awesome.",
        "",
        "This Font Software is licensed under the SIL Open Font License, Version 1.1.",
        "This license is copied below, and is also available with a FAQ at:",
        "http://scripts.sil.org/OFL",
        "",
        "",
        "-----------------------------------------------------------",
        "SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007",
        "-----------------------------------------------------------",
        "",
        "PREAMBLE",
        "The goals of the Open Font License (OFL) are to stimulate worldwide",
        "development of collaborative font projects, to support the font creation",
        "efforts of academic and linguistic communities, and to provide a free and",
        "open framework in which fonts may be shared and improved in partnership",
        "with others.",
        "",
        "The OFL allows the licensed fonts to be used, studied, modified and",
        "redistributed freely as long as they are not sold by themselves. The",
        "fonts, including any derivative works, can be bundled, embedded,",
        "redistributed and/or sold with any software provided that any reserved",
        "names are not used by derivative works. The fonts and derivatives,",
        "however, cannot be released under any other type of license. The",
        "requirement for fonts to remain under this license does not apply",
        "to any document created using the fonts or their derivatives.",
        "",
        "DEFINITIONS",
        "\"Font Software\" refers to the set of files released by the Copyright",
        "Holder(s) under this license and clearly marked as such. This may",
        "include source files, build scripts and documentation.",
        "",
        "\"Reserved Font Name\" refers to any names specified as such after the",
        "copyright statement(s).",
        "",
        "\"Original Version\" refers to the collection of Font Software components as",
        "distributed by the Copyright Holder(s).",
        "",
        "\"Modified Version\" refers to any derivative made by adding to, deleting,",
        "or substituting -- in part or in whole -- any of the components of the",
        "Original Version, by changing formats or by porting the Font Software to a",
        "new environment.",
        "",
        "\"Author\" refers to any designer, engineer, programmer, technical",
        "writer or other person who contributed to the Font Software.",
        "",
        "PERMISSION & CONDITIONS",
        "Permission is hereby granted, free of charge, to any person obtaining",
        "a copy of the Font Software, to use, study, copy, merge, embed, modify,",
        "redistribute, and sell modified and unmodified copies of the Font",
        "Software, subject to the following conditions:",
        "",
        "1) Neither the Font Software nor any of its individual components,",
        "in Original or Modified Versions, may be sold by itself.",
        "",
        "2) Original or Modified Versions of the Font Software may be bundled,",
        "redistributed and/or sold with any software, provided that each copy",
        "contains the above copyright notice and this license. These can be",
        "included either as stand-alone text files, human-readable headers or",
        "in the appropriate machine-readable metadata fields within text or",
        "binary files as long as those fields can be easily viewed by the user.",
        "",
        "3) No Modified Version of the Font Software may use the Reserved Font",
        "Name(s) unless explicit written permission is granted by the corresponding",
        "Copyright Holder. This restriction only applies to the primary font name as",
        "presented to the users.",
        "",
        "4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font",
        "Software shall not be used to promote, endorse or advertise any",
        "Modified Version, except to acknowledge the contribution(s) of the",
        "Copyright Holder(s) and the Author(s) or with their explicit written",
        "permission.",
        "",
        "5) The Font Software, modified or unmodified, in part or in whole,",
        "must be distributed entirely under this license, and must not be",
        "distributed under any other license. The requirement for fonts to",
        "remain under this license does not apply to any document created",
        "using the Font Software.",
        "",
        "TERMINATION",
        "This license becomes null and void if any of the above conditions are",
        "not met.",
        "",
        "DISCLAIMER",
        "THE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
        "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF",
        "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT",
        "OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE",
        "COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,",
        "INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL",
        "DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",
        "FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM",
        "OTHER DEALINGS IN THE FONT SOFTWARE.",
        ""
      ]
    },
    "fontawesome-free-5.15.2-desktop": {
      "text": [
        "Font Awesome Free is free, open source, and GPL friendly. You can use it for\ncommercial projects, open source projects, or really almost whatever you want.\nFull Font Awesome Free license: https://fontawesome.com/license/free."
      ],
      "license": "CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)",
      "projectURL": "https://fontawesome.com/",
      "notes": "Provides icons",
      "licenseText": [
        "Font Awesome Free License",
        "-------------------------",
        "",
        "Font Awesome Free is free, open source, and GPL friendly. You can use it for",
        "commercial projects, open source projects, or really almost whatever you want.",
        "Full Font Awesome Free license: https://fontawesome.com/license/free.",
        "",
        "# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)",
        "In the Font Awesome Free download, the CC BY 4.0 license applies to all icons",
        "packaged as SVG and JS file types.",
        "",
        "# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)",
        "In the Font Awesome Free download, the SIL OFL license applies to all icons",
        "packaged as web and desktop font files.",
        "",
        "# Code: MIT License (https://opensource.org/licenses/MIT)",
        "In the Font Awesome Free download, the MIT license applies to all non-font and",
        "non-icon files.",
        "",
        "# Attribution",
        "Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font",
        "Awesome Free files already contain embedded comments with sufficient",
        "attribution, so you shouldn't need to do anything additional when using these",
        "files normally.",
        "",
        "We've kept attribution comments terse, so we ask that you do not actively work",
        "to remove them from files, especially code. They're a great way for folks to",
        "learn about Font Awesome.",
        "",
        "# Brand Icons",
        "All brand icons are trademarks of their respective owners. The use of these",
        "trademarks does not indicate endorsement of the trademark holder by Font",
        "Awesome, nor vice versa. **Please do not use brand logos for any purpose except",
        "to represent the company, product, or service to which they refer.**",
        ""
      ]
    },
    "he-1.1.1.js": {
      "text": [
        "Copyright Mathias Bynens <https://mathiasbynens.be/>"
      ],
      "license": "MIT",
      "projectURL": "https://github.com/mathiasbynens/he",
      "notes": "Used for HTML entity parsing in simulations related to RichText or other uses",
      "licenseText": [
        "Copyright Mathias Bynens <https://mathiasbynens.be/>",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining",
        "a copy of this software and associated documentation files (the",
        "\"Software\"), to deal in the Software without restriction, including",
        "without limitation the rights to use, copy, modify, merge, publish,",
        "distribute, sublicense, and/or sell copies of the Software, and to",
        "permit persons to whom the Software is furnished to do so, subject to",
        "the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be",
        "included in all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
        "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF",
        "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND",
        "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE",
        "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION",
        "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION",
        "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
        ""
      ]
    },
    "himalaya-1.1.0.js": {
      "text": [
        "Copyright (c) 2017, Chris Andrejewski <christopher.andrejewski@gmail.com>"
      ],
      "license": "ISC License",
      "projectURL": "https://github.com/andrejewski/himalaya",
      "notes": "Used for HTML parsing in simulations, to sanitize/handle rich HTML text",
      "licenseText": [
        "Copyright (c) 2017, Chris Andrejewski <christopher.andrejewski@gmail.com>",
        "",
        "Permission to use, copy, modify, and/or distribute this software for any",
        "purpose with or without fee is hereby granted, provided that the above",
        "copyright notice and this permission notice appear in all copies.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES",
        "WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF",
        "MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR",
        "ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES",
        "WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN",
        "ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF",
        "OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.",
        ""
      ]
    },
    "jama-1.0.2": {
      "text": [
        "a basic linear algebra package for Java."
      ],
      "license": "Public Domain",
      "projectURL": "http://math.nist.gov/javanumerics/jama/",
      "notes": "A derived work (certain ported and modified files) is used in Dot, mainly for matrix decompositions. Used in assorted simulations.",
      "licenseText": [
        "Public Domain",
        "",
        "Copyright Notice This software is a cooperative product of The MathWorks and the National Institute of Standards and Technology (NIST) which has been released to the public domain. ",
        "Neither The MathWorks nor NIST assumes any responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic."
      ]
    },
    "jquery-2.1.0.js": {
      "text": [
        "Copyright (c) 2005, 2014 jQuery Foundation, Inc. and other contributors",
        "(includes Sizzle.js, http://sizzlejs.com)"
      ],
      "license": "The MIT License",
      "projectURL": "http://jquery.com",
      "notes": "Facilitates interaction with browser DOM elements, mainly used in Scenery",
      "licenseText": [
        "Copyright 2013 jQuery Foundation and other contributors",
        "http://jquery.com/",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining",
        "a copy of this software and associated documentation files (the",
        "\"Software\"), to deal in the Software without restriction, including",
        "without limitation the rights to use, copy, modify, merge, publish,",
        "distribute, sublicense, and/or sell copies of the Software, and to",
        "permit persons to whom the Software is furnished to do so, subject to",
        "the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be",
        "included in all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
        "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF",
        "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND",
        "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE",
        "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION",
        "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION",
        "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
      ]
    },
    "linebreak-1.1.0.js": {
      "text": [
        "tiny-inflate 1.0.3 (https://github.com/foliojs/tiny-inflate) Copyright (c) 2015-present Devon Govett",
        "unicode-trie 2.0.0 (https://github.com/foliojs/unicode-trie) Copyright 2018",
        "linebreak 1.1.0 (https://github.com/foliojs/linebreak) Copyright (c) 2014-present Devon Govett"
      ],
      "license": "The MIT License",
      "projectURL": "https://github.com/foliojs/linebreak",
      "notes": "Ability to find linebreak opportunities in unicode strings: Unicode Line Breaking Algorithm (UAX #14)",
      "licenseText": [
        "tiny-inflate",
        "https://github.com/foliojs/tiny-inflate",
        "",
        "MIT License",
        "",
        "Copyright (c) 2015-present Devon Govett",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy",
        "of this software and associated documentation files (the \"Software\"), to deal",
        "in the Software without restriction, including without limitation the rights",
        "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
        "copies of the Software, and to permit persons to whom the Software is",
        "furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in all",
        "copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
        "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
        "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
        "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
        "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
        "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
        "SOFTWARE.",
        "",
        "",
        "",
        "",
        "",
        "unicode-trie",
        "https://github.com/foliojs/unicode-trie",
        "",
        "Copyright 2018",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
        "",
        "",
        "",
        "",
        "linebreak",
        "https://github.com/foliojs/linebreak",
        "",
        "MIT License",
        "",
        "Copyright (c) 2014-present Devon Govett",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy",
        "of this software and associated documentation files (the \"Software\"), to deal",
        "in the Software without restriction, including without limitation the rights",
        "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
        "copies of the Software, and to permit persons to whom the Software is",
        "furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in all",
        "copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
        "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
        "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
        "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
        "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
        "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
        "SOFTWARE."
      ]
    },
    "lodash-4.17.4.js": {
      "text": [
        "Lodash <https://lodash.com/>",
        "Copyright JS Foundation and other contributors <https://js.foundation/>",
        "Released under MIT license <https://lodash.com/license>",
        "Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>",
        "Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors"
      ],
      "license": "The MIT License",
      "projectURL": "http://lodash.com",
      "notes": "Adds common data structure operations such as sorting, grouping, etc.",
      "licenseText": [
        "Copyright JS Foundation and other contributors <https://js.foundation/>",
        "",
        "Based on Underscore.js, copyright Jeremy Ashkenas,",
        "DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>",
        "",
        "This software consists of voluntary contributions made by many",
        "individuals. For exact contribution history, see the revision history",
        "available at https://github.com/lodash/lodash",
        "",
        "The following license applies to all parts of this software except as",
        "documented below:",
        "",
        "====",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining",
        "a copy of this software and associated documentation files (the",
        "\"Software\"), to deal in the Software without restriction, including",
        "without limitation the rights to use, copy, modify, merge, publish,",
        "distribute, sublicense, and/or sell copies of the Software, and to",
        "permit persons to whom the Software is furnished to do so, subject to",
        "the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be",
        "included in all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
        "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF",
        "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND",
        "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE",
        "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION",
        "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION",
        "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
        "",
        "====",
        "",
        "Copyright and related rights for sample code are waived via CC0. Sample",
        "code is defined as all source code displayed within the prose of the",
        "documentation.",
        "",
        "CC0: http://creativecommons.org/publicdomain/zero/1.0/",
        "",
        "====",
        "",
        "Files located in the node_modules and vendor directories are externally",
        "maintained libraries used by this software which have their own",
        "licenses; we recommend you read them, as their terms may differ from the",
        "terms above."
      ]
    },
    "paper-js-0.12.17.js": {
      "text": [
        "Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey, http://juerglehni.com/ & https://puckey.studio/"
      ],
      "license": "The MIT License",
      "projectURL": "https://github.com/paperjs/paper.js",
      "notes": "curve-based mathematical operations, used in kite",
      "licenseText": [
        "Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey",
        "http://juerglehni.com/ & https://puckey.studio/",
        "All rights reserved.",
        "",
        "The MIT License (MIT)",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy",
        "of this software and associated documentation files (the \"Software\"), to deal",
        "in the Software without restriction, including without limitation the rights",
        "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
        "copies of the Software, and to permit persons to whom the Software is",
        "furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in",
        "all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
        "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
        "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
        "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
        "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
        "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN",
        "THE SOFTWARE.",
        ""
      ]
    },
    "peggy-3.0.2.js": {
      "text": [
        "Copyright (c) 2010-2022 The Peggy AUTHORS"
      ],
      "license": "The MIT License",
      "projectURL": "https://peggyjs.org/",
      "notes": "Peggy is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting.",
      "licenseText": [
        "MIT License",
        "",
        "Copyright (c) 2010-2022 The Peggy AUTHORS",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy",
        "of this software and associated documentation files (the \"Software\"), to deal",
        "in the Software without restriction, including without limitation the rights",
        "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
        "copies of the Software, and to permit persons to whom the Software is",
        "furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in all",
        "copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
        "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
        "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
        "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
        "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
        "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
        "SOFTWARE."
      ]
    },
    "pegjs-0.7.0.js": {
      "text": [
        "Copyright (c) 2010-2012 David Majda"
      ],
      "license": "The MIT License",
      "projectURL": "http://pegjs.majda.cz",
      "notes": "Parser Generator for JavaScript. SVG path parsing in Kite",
      "licenseText": [
        "Copyright (c) 2010-2012 David Majda",
        "",
        "Permission is hereby granted, free of charge, to any person",
        "obtaining a copy of this software and associated documentation",
        "files (the \"Software\"), to deal in the Software without",
        "restriction, including without limitation the rights to use,",
        "copy, modify, merge, publish, distribute, sublicense, and/or sell",
        "copies of the Software, and to permit persons to whom the",
        "Software is furnished to do so, subject to the following",
        "conditions:",
        "",
        "The above copyright notice and this permission notice shall be",
        "included in all copies or substantial portions of the Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
        "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES",
        "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND",
        "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT",
        "HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,",
        "WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",
        "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR",
        "OTHER DEALINGS IN THE SOFTWARE."
      ]
    },
    "seedrandom-2.4.2.js": {
      "text": [
        "Copyright 2015 David Bau."
      ],
      "license": "MIT",
      "projectURL": "https://github.com/davidbau/seedrandom",
      "notes": "seeded random number generator for Javascript",
      "licenseText": [
        "Copyright 2015 David Bau.",
        "",
        "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated",
        "documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the",
        "rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit",
        "persons to whom the Software is furnished to do so, subject to the following conditions:",
        "",
        "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the",
        "Software.",
        "",
        "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE",
        "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR",
        "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR",
        "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
      ]
    },
    "TextEncoderLite-3c9f6f0.js": {
      "text": [
        "AJ ONeal <awesome@coolaj86.com>"
      ],
      "license": "Apache 2.0",
      "projectURL": "https://github.com/coolaj86/TextEncoderLite",
      "notes": "Used for encoding unicode strings to typed arrays, for Scenery foreign object rasterization",
      "licenseText": [
        "",
        "                                 Apache License",
        "                           Version 2.0, January 2011",
        "                        http://www.apache.org/licenses/",
        "",
        "   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION",
        "",
        "   1. Definitions.",
        "",
        "      \"License\" shall mean the terms and conditions for use, reproduction,",
        "      and distribution as defined by Sections 1 through 9 of this document.",
        "",
        "      \"Licensor\" shall mean the copyright owner or entity authorized by",
        "      the copyright owner that is granting the License.",
        "",
        "      \"Legal Entity\" shall mean the union of the acting entity and all",
        "      other entities that control, are controlled by, or are under common",
        "      control with that entity. For the purposes of this definition,",
        "      \"control\" means (i) the power, direct or indirect, to cause the",
        "      direction or management of such entity, whether by contract or",
        "      otherwise, or (ii) ownership of fifty percent (50%) or more of the",
        "      outstanding shares, or (iii) beneficial ownership of such entity.",
        "",
        "      \"You\" (or \"Your\") shall mean an individual or Legal Entity",
        "      exercising permissions granted by this License.",
        "",
        "      \"Source\" form shall mean the preferred form for making modifications,",
        "      including but not limited to software source code, documentation",
        "      source, and configuration files.",
        "",
        "      \"Object\" form shall mean any form resulting from mechanical",
        "      transformation or translation of a Source form, including but",
        "      not limited to compiled object code, generated documentation,",
        "      and conversions to other media types.",
        "",
        "      \"Work\" shall mean the work of authorship, whether in Source or",
        "      Object form, made available under the License, as indicated by a",
        "      copyright notice that is included in or attached to the work",
        "      (an example is provided in the Appendix below).",
        "",
        "      \"Derivative Works\" shall mean any work, whether in Source or Object",
        "      form, that is based on (or derived from) the Work and for which the",
        "      editorial revisions, annotations, elaborations, or other modifications",
        "      represent, as a whole, an original work of authorship. For the purposes",
        "      of this License, Derivative Works shall not include works that remain",
        "      separable from, or merely link (or bind by name) to the interfaces of,",
        "      the Work and Derivative Works thereof.",
        "",
        "      \"Contribution\" shall mean any work of authorship, including",
        "      the original version of the Work and any modifications or additions",
        "      to that Work or Derivative Works thereof, that is intentionally",
        "      submitted to Licensor for inclusion in the Work by the copyright owner",
        "      or by an individual or Legal Entity authorized to submit on behalf of",
        "      the copyright owner. For the purposes of this definition, \"submitted\"",
        "      means any form of electronic, verbal, or written communication sent",
        "      to the Licensor or its representatives, including but not limited to",
        "      communication on electronic mailing lists, source code control systems,",
        "      and issue tracking systems that are managed by, or on behalf of, the",
        "      Licensor for the purpose of discussing and improving the Work, but",
        "      excluding communication that is conspicuously marked or otherwise",
        "      designated in writing by the copyright owner as \"Not a Contribution.\"",
        "",
        "      \"Contributor\" shall mean Licensor and any individual or Legal Entity",
        "      on behalf of whom a Contribution has been received by Licensor and",
        "      subsequently incorporated within the Work.",
        "",
        "   2. Grant of Copyright License. Subject to the terms and conditions of",
        "      this License, each Contributor hereby grants to You a perpetual,",
        "      worldwide, non-exclusive, no-charge, royalty-free, irrevocable",
        "      copyright license to reproduce, prepare Derivative Works of,",
        "      publicly display, publicly perform, sublicense, and distribute the",
        "      Work and such Derivative Works in Source or Object form.",
        "",
        "   3. Grant of Patent License. Subject to the terms and conditions of",
        "      this License, each Contributor hereby grants to You a perpetual,",
        "      worldwide, non-exclusive, no-charge, royalty-free, irrevocable",
        "      (except as stated in this section) patent license to make, have made,",
        "      use, offer to sell, sell, import, and otherwise transfer the Work,",
        "      where such license applies only to those patent claims licensable",
        "      by such Contributor that are necessarily infringed by their",
        "      Contribution(s) alone or by combination of their Contribution(s)",
        "      with the Work to which such Contribution(s) was submitted. If You",
        "      institute patent litigation against any entity (including a",
        "      cross-claim or counterclaim in a lawsuit) alleging that the Work",
        "      or a Contribution incorporated within the Work constitutes direct",
        "      or contributory patent infringement, then any patent licenses",
        "      granted to You under this License for that Work shall terminate",
        "      as of the date such litigation is filed.",
        "",
        "   4. Redistribution. You may reproduce and distribute copies of the",
        "      Work or Derivative Works thereof in any medium, with or without",
        "      modifications, and in Source or Object form, provided that You",
        "      meet the following conditions:",
        "",
        "      (a) You must give any other recipients of the Work or",
        "          Derivative Works a copy of this License; and",
        "",
        "      (b) You must cause any modified files to carry prominent notices",
        "          stating that You changed the files; and",
        "",
        "      (c) You must retain, in the Source form of any Derivative Works",
        "          that You distribute, all copyright, patent, trademark, and",
        "          attribution notices from the Source form of the Work,",
        "          excluding those notices that do not pertain to any part of",
        "          the Derivative Works; and",
        "",
        "      (d) If the Work includes a \"NOTICE\" text file as part of its",
        "          distribution, then any Derivative Works that You distribute must",
        "          include a readable copy of the attribution notices contained",
        "          within such NOTICE file, excluding those notices that do not",
        "          pertain to any part of the Derivative Works, in at least one",
        "          of the following places: within a NOTICE text file distributed",
        "          as part of the Derivative Works; within the Source form or",
        "          documentation, if provided along with the Derivative Works; or,",
        "          within a display generated by the Derivative Works, if and",
        "          wherever such third-party notices normally appear. The contents",
        "          of the NOTICE file are for informational purposes only and",
        "          do not modify the License. You may add Your own attribution",
        "          notices within Derivative Works that You distribute, alongside",
        "          or as an addendum to the NOTICE text from the Work, provided",
        "          that such additional attribution notices cannot be construed",
        "          as modifying the License.",
        "",
        "      You may add Your own copyright statement to Your modifications and",
        "      may provide additional or different license terms and conditions",
        "      for use, reproduction, or distribution of Your modifications, or",
        "      for any such Derivative Works as a whole, provided Your use,",
        "      reproduction, and distribution of the Work otherwise complies with",
        "      the conditions stated in this License.",
        "",
        "   5. Submission of Contributions. Unless You explicitly state otherwise,",
        "      any Contribution intentionally submitted for inclusion in the Work",
        "      by You to the Licensor shall be under the terms and conditions of",
        "      this License, without any additional terms or conditions.",
        "      Notwithstanding the above, nothing herein shall supersede or modify",
        "      the terms of any separate license agreement you may have executed",
        "      with Licensor regarding such Contributions.",
        "",
        "   6. Trademarks. This License does not grant permission to use the trade",
        "      names, trademarks, service marks, or product names of the Licensor,",
        "      except as required for reasonable and customary use in describing the",
        "      origin of the Work and reproducing the content of the NOTICE file.",
        "",
        "   7. Disclaimer of Warranty. Unless required by applicable law or",
        "      agreed to in writing, Licensor provides the Work (and each",
        "      Contributor provides its Contributions) on an \"AS IS\" BASIS,",
        "      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or",
        "      implied, including, without limitation, any warranties or conditions",
        "      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A",
        "      PARTICULAR PURPOSE. You are solely responsible for determining the",
        "      appropriateness of using or redistributing the Work and assume any",
        "      risks associated with Your exercise of permissions under this License.",
        "",
        "   8. Limitation of Liability. In no event and under no legal theory,",
        "      whether in tort (including negligence), contract, or otherwise,",
        "      unless required by applicable law (such as deliberate and grossly",
        "      negligent acts) or agreed to in writing, shall any Contributor be",
        "      liable to You for damages, including any direct, indirect, special,",
        "      incidental, or consequential damages of any character arising as a",
        "      result of this License or out of the use or inability to use the",
        "      Work (including but not limited to damages for loss of goodwill,",
        "      work stoppage, computer failure or malfunction, or any and all",
        "      other commercial damages or losses), even if such Contributor",
        "      has been advised of the possibility of such damages.",
        "",
        "   9. Accepting Warranty or Additional Liability. While redistributing",
        "      the Work or Derivative Works thereof, You may choose to offer,",
        "      and charge a fee for, acceptance of support, warranty, indemnity,",
        "      or other liability obligations and/or rights consistent with this",
        "      License. However, in accepting such obligations, You may act only",
        "      on Your own behalf and on Your sole responsibility, not on behalf",
        "      of any other Contributor, and only if You agree to indemnify,",
        "      defend, and hold each Contributor harmless for any liability",
        "      incurred by, or claims asserted against, such Contributor by reason",
        "      of your accepting any such warranty or additional liability.",
        "",
        "   END OF TERMS AND CONDITIONS",
        "",
        "   APPENDIX: How to apply the Apache License to your work.",
        "",
        "      To apply the Apache License to your work, attach the following",
        "      boilerplate notice, with the fields enclosed by brackets \"[]\"",
        "      replaced with your own identifying information. (Don't include",
        "      the brackets!)  The text should be enclosed in the appropriate",
        "      comment syntax for the file format. We also recommend that a",
        "      file or class name and description of purpose be included on the",
        "      same \"printed page\" as the copyright notice for easier",
        "      identification within third-party archives.",
        "",
        "   Copyright [yyyy] [name of copyright owner]",
        "",
        "   Licensed under the Apache License, Version 2.0 (the \"License\");",
        "   you may not use this file except in compliance with the License.",
        "   You may obtain a copy of the License at",
        "",
        "       http://www.apache.org/licenses/LICENSE-2.0",
        "",
        "   Unless required by applicable law or agreed to in writing, software",
        "   distributed under the License is distributed on an \"AS IS\" BASIS,",
        "   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
        "   See the License for the specific language governing permissions and",
        "   limitations under the License.",
        ""
      ]
    }
  }
};
// ### END THIRD PARTY LICENSE ENTRIES ###
</script>
<script type="text/javascript">window.phet.chipper.project = 'my-solar-system';
window.phet.chipper.version = '1.3.15';
window.phet.chipper.buildTimestamp = '2026-04-11 02:24:05 UTC';
window.phet.chipper.brand = 'phet';
window.phet.chipper.locale = 'en';
window.phet.chipper.localeData = {"am":{"locale3":"amh","englishName":"Amharic","localizedName":"አማርኛ","direction":"ltr","bcp47":"am"},"ar":{"locale3":"ara","englishName":"Arabic","localizedName":"العربية","direction":"rtl","bcp47":"ar"},"ar_AE":{"englishName":"Arabic (U.A.E.)","localizedName":"العربية (الإمارات العربية المتحدة)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_BH":{"englishName":"Arabic (Bahrain)","localizedName":"العربية (البحرين)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_DJ":{"englishName":"Arabic (Djibouti)","localizedName":"العربية (جيبوتي)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_DZ":{"englishName":"Arabic (Algeria)","localizedName":"العربية (الجزائر)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_EG":{"locale3":"arz","englishName":"Arabic (Egypt)","localizedName":"العربية (مصر)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"arz"},"ar_EH":{"englishName":"Arabic (Sahrawi Republic)","localizedName":"العربية (الجمهورية الصحراوية)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_ER":{"englishName":"Arabic (Eritrea)","localizedName":"العربية (إريتريا)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_IQ":{"englishName":"Arabic (Iraq)","localizedName":"العربية (العراق)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_JO":{"englishName":"Arabic (Jordan)","localizedName":"العربية (الأردن)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_KM":{"englishName":"Arabic (Comoros)","localizedName":"العربية (جزر القمر)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_KW":{"englishName":"Arabic (Kuwait)","localizedName":"العربية (الكويت)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_LB":{"englishName":"Arabic (Lebanon)","localizedName":"العربية (لبنان)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_LY":{"englishName":"Arabic (Libya)","localizedName":"العربية (ليبيا)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_MA":{"locale3":"ary","englishName":"Arabic, Morocco","localizedName":"العربية (المغرب)","direction":"rtl","fallbackLocales":["ar"],"bcp47":"ary"},"ar_MR":{"englishName":"Arabic (Mauritania)","localizedName":"العربية (موريتانيا)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_OM":{"englishName":"Arabic (Oman)","localizedName":"العربية (عُمان)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_QA":{"englishName":"Arabic (Qatar)","localizedName":"العربية (قطر)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_SA":{"englishName":"Arabic, Saudi Arabia","localizedName":"العربية (السعودية)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_SD":{"englishName":"Arabic (Sudan)","localizedName":"العربية (السودان)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_SO":{"englishName":"Arabic (Somalia)","localizedName":"العربية (الصومال)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_SY":{"englishName":"Arabic (Syria)","localizedName":"العربية (سوريا)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_TD":{"englishName":"Arabic (Chad)","localizedName":"العربية (تشاد)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_TN":{"englishName":"Arabic (Tunisia)","localizedName":"العربية (تونس)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"ar_YE":{"englishName":"Arabic (Yemen)","localizedName":"العربية (اليمن)","direction":"rtl","fallbackLocales":["ar","ar_MA"],"bcp47":"ar"},"az":{"locale3":"aze","englishName":"Azerbaijani","localizedName":"azərbaycan dili","direction":"ltr","bcp47":"az"},"be":{"locale3":"bel","englishName":"Belarusian","localizedName":"беларуская мова","direction":"ltr","bcp47":"be"},"bg":{"locale3":"bul","englishName":"Bulgarian","localizedName":"български език","direction":"ltr","bcp47":"bg"},"bs":{"locale3":"bos","englishName":"Bosnian","localizedName":"bosanski jezik","direction":"ltr","bcp47":"bs"},"ca":{"locale3":"cat","englishName":"Catalan","localizedName":"Català","direction":"ltr","bcp47":"ca"},"cs":{"locale3":"ces","englishName":"Czech","localizedName":"čeština","direction":"ltr","bcp47":"cs"},"da":{"locale3":"dan","englishName":"Danish","localizedName":"dansk","direction":"ltr","bcp47":"da"},"de":{"locale3":"deu","englishName":"German","localizedName":"Deutsch","direction":"ltr","bcp47":"de"},"de_AT":{"englishName":"German (Austria)","localizedName":"Deutsch (Österreich)","direction":"ltr","fallbackLocales":["de"],"bcp47":"de"},"de_CH":{"englishName":"German (Switzerland)","localizedName":"Deutsch (Schweiz)","direction":"ltr","fallbackLocales":["de"],"bcp47":"de"},"de_LI":{"englishName":"German (Liechtenstein)","localizedName":"Deutsch (Liechtenstein)","direction":"ltr","fallbackLocales":["de"],"bcp47":"de"},"de_LU":{"englishName":"German (Luxembourg)","localizedName":"Deutsch (Luxemburg)","direction":"ltr","fallbackLocales":["de"],"bcp47":"de"},"el":{"locale3":"ell","englishName":"Greek","localizedName":"Ελληνικά","direction":"ltr","bcp47":"el"},"en":{"locale3":"eng","englishName":"English","localizedName":"English","direction":"ltr","bcp47":"en"},"es":{"locale3":"spa","englishName":"Spanish","localizedName":"español","direction":"ltr","bcp47":"es"},"es_AR":{"englishName":"Spanish (Argentina)","localizedName":"español (Argentina)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_BO":{"englishName":"Spanish (Bolivia)","localizedName":"español (Bolivia)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_CL":{"englishName":"Spanish (Chile)","localizedName":"español (Chile)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_CO":{"englishName":"Spanish, Colombia","localizedName":"español (Colombia)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_CR":{"englishName":"Spanish, Costa Rica","localizedName":"español (Costa Rica)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_DO":{"englishName":"Spanish (Dominican Republic)","localizedName":"español (Dominican Republic)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_EC":{"englishName":"Spanish (Ecuador)","localizedName":"español (Ecuador)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_ES":{"englishName":"Spanish, Spain","localizedName":"español (España)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_GQ":{"englishName":"Spanish (Equatorial Guinea)","localizedName":"español (Equatorial Guinea)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_GT":{"englishName":"Spanish (Guatemala)","localizedName":"español (Guatemala)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_HN":{"englishName":"Spanish (Honduras)","localizedName":"español (Honduras)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_MX":{"englishName":"Spanish, Mexico","localizedName":"español (México)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_NI":{"englishName":"Spanish (Nicaragua)","localizedName":"español (Nicaragua)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_PA":{"englishName":"Spanish (Panama)","localizedName":"español (Panama)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_PE":{"englishName":"Spanish, Peru","localizedName":"español (Perú)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_PR":{"englishName":"Spanish (Puerto Rico)","localizedName":"español (Puerto Rico)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_PY":{"englishName":"Spanish (Paraguay)","localizedName":"español (Paraguay)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_SV":{"englishName":"Spanish (El Salvador)","localizedName":"español (El Salvador)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_US":{"englishName":"Spanish (United States)","localizedName":"español (United States)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_UY":{"englishName":"Spanish (Uruguay)","localizedName":"español (Uruguay)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"es_VE":{"englishName":"Spanish (Venezuela)","localizedName":"español (Venezuela)","direction":"ltr","fallbackLocales":["es"],"bcp47":"es"},"eu":{"locale3":"eus","englishName":"Basque","localizedName":"euskara","direction":"ltr","bcp47":"eu"},"fa":{"locale3":"fas","englishName":"Persian","localizedName":"فارسی","direction":"rtl","bcp47":"fa"},"fa_DA":{"locale3":"prs","englishName":"Persian (Dari)","localizedName":"دری","direction":"rtl","bcp47":"prs"},"fr":{"locale3":"fra","englishName":"French","localizedName":"français","direction":"ltr","bcp47":"fr"},"fr_BE":{"englishName":"French (Belgium)","localizedName":"français (Belgium)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_BF":{"englishName":"French (Burkina Faso)","localizedName":"français (Burkina Faso)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_BI":{"englishName":"French (Burundi)","localizedName":"français (Burundi)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_BJ":{"englishName":"French (Benin)","localizedName":"français (Bénin)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_CA":{"englishName":"French (Canada)","localizedName":"français (Canada)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_CD":{"englishName":"French (DR Congo)","localizedName":"français (RD Congo)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_CF":{"englishName":"French (Central African Republic)","localizedName":"français (République centrafricaine)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_CG":{"englishName":"French (Congo Republic)","localizedName":"français (République du Congo)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_CH":{"englishName":"French (Switzerland)","localizedName":"français (Suisse)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_CI":{"englishName":"French (Côte d’Ivoire)","localizedName":"français (Côte d'Ivoire)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_CM":{"englishName":"French (Cameroon)","localizedName":"français (Cameroon)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_DJ":{"englishName":"French (Djibouti)","localizedName":"français (Djibouti)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_EH":{"englishName":"French (Sahrawi Republic)","localizedName":"français (République sahraouie)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_GA":{"englishName":"French (Gabon)","localizedName":"français (Gabon)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_GN":{"englishName":"French (Guinea)","localizedName":"français (Guinée)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_GQ":{"englishName":"French (Equatorial Guinea)","localizedName":"français (Guinée Équatoriale)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_KM":{"englishName":"French (Comoros)","localizedName":"français (Comores)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_LU":{"englishName":"French (Luxembourg)","localizedName":"français (Luxembourg)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_MC":{"englishName":"French (Monaco)","localizedName":"français (Monaco)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_MG":{"englishName":"French (Madagascar)","localizedName":"français (Madagascar)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_ML":{"englishName":"French (Mali)","localizedName":"français (Mali)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_NE":{"englishName":"French (Niger)","localizedName":"français (Niger)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_RW":{"englishName":"French (Rwanda)","localizedName":"français (Rwanda)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_SC":{"englishName":"French (Seychelles)","localizedName":"français (les Seychelles)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_SN":{"englishName":"French (Senegal)","localizedName":"français (Sénégal)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_TD":{"englishName":"French (Chad)","localizedName":"français (Tchad)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"fr_TG":{"englishName":"French (Togo)","localizedName":"français (Togo)","direction":"ltr","fallbackLocales":["fr"],"bcp47":"fr"},"gu":{"locale3":"guj","englishName":"Gujarati","localizedName":"ગુજરાતી","direction":"ltr","bcp47":"gu"},"ha":{"locale3":"hau","englishName":"Hausa","localizedName":"Hausa","direction":"ltr","bcp47":"ha"},"hi":{"locale3":"hin","englishName":"Hindi","localizedName":"हिन्दी","direction":"ltr","bcp47":"hi"},"hr":{"locale3":"hrv","englishName":"Croatian","localizedName":"Hrvatski","direction":"ltr","bcp47":"hr"},"hr_BA":{"englishName":"Croatian (Latin, Bosnia, and Herzegovina)","localizedName":"hrvatski (Latinica, Bosna i Hercegovina)","direction":"ltr","fallbackLocales":["hr"],"bcp47":"hr"},"ht":{"locale3":"hat","englishName":"Haitian","localizedName":"Kreyòl ayisyen","direction":"ltr","bcp47":"ht"},"hu":{"locale3":"hun","englishName":"Hungarian","localizedName":"magyar","direction":"ltr","bcp47":"hu"},"ig":{"locale3":"ibo","englishName":"Igbo","localizedName":"Asụsụ Igbo","direction":"ltr","bcp47":"ig"},"is":{"locale3":"isl","englishName":"Icelandic","localizedName":"Íslenska","direction":"ltr","bcp47":"is"},"it":{"locale3":"ita","englishName":"Italian","localizedName":"italiano","direction":"ltr","bcp47":"it"},"it_CH":{"englishName":"Italian (Switzerland)","localizedName":"italiano(Svizzera)","direction":"ltr","fallbackLocales":["it"],"bcp47":"it"},"iw":{"locale3":"heb","englishName":"Hebrew","localizedName":"עברית","direction":"rtl","bcp47":"iw"},"ki":{"locale3":"kik","englishName":"Kikuyu","localizedName":"Gĩkũyũ","direction":"ltr","bcp47":"ki"},"km":{"locale3":"khm","englishName":"Khmer","localizedName":"ខេមរភាសា","direction":"ltr","bcp47":"km"},"ko":{"locale3":"kor","englishName":"Korean","localizedName":"한국어","direction":"ltr","bcp47":"ko"},"lg":{"locale3":"lug","englishName":"Ganda","localizedName":"Luganda","direction":"ltr","bcp47":"lg"},"lt":{"locale3":"lit","englishName":"Lithuanian","localizedName":"lietuvių kalba","direction":"ltr","bcp47":"lt"},"mn":{"locale3":"mon","englishName":"Mongolian","localizedName":"Монгол хэл","direction":"ltr","bcp47":"mn"},"mr":{"locale3":"mar","englishName":"Marathi","localizedName":"मराठी","direction":"ltr","bcp47":"mr"},"ms":{"locale3":"msa","englishName":"Malay","localizedName":"Bahasa Malaysia","direction":"ltr","bcp47":"ms"},"ms_MY":{"englishName":"Malay (Standard)","localizedName":"بهاس ملايو مليسيا","direction":"rtl","fallbackLocales":["ms"],"bcp47":"ms"},"mt":{"locale3":"mlt","englishName":"Maltese","localizedName":"Malti","direction":"ltr","bcp47":"mt"},"nl":{"locale3":"nld","englishName":"Dutch","localizedName":"Nederlands","direction":"ltr","bcp47":"nl"},"nl_BE":{"englishName":"Dutch (Belgium)","localizedName":"Nederlands (België)","direction":"ltr","fallbackLocales":["nl"],"bcp47":"nl"},"ny":{"locale3":"nya","englishName":"Chichewa","localizedName":"Nyanja","direction":"ltr","bcp47":"ny"},"pl":{"locale3":"pol","englishName":"Polish","localizedName":"Polski","direction":"ltr","bcp47":"pl"},"ps":{"locale3":"pus","englishName":"Pashto","localizedName":"پښتو","direction":"rtl","bcp47":"ps"},"pt":{"locale3":"por","englishName":"Portuguese","localizedName":"Português","direction":"ltr","fallbackLocales":["pt_BR"],"bcp47":"pt"},"pt_AO":{"englishName":"Portuguese(Angola)","localizedName":"português(Angola)","direction":"ltr","fallbackLocales":["pt","pt_BR"],"bcp47":"pt"},"pt_BR":{"englishName":"Portuguese, Brazil","localizedName":"português (Brasil)","direction":"ltr","bcp47":"pt"},"pt_CV":{"englishName":"Portuguese(Cabo verde)","localizedName":"português(Cabo verde)","direction":"ltr","fallbackLocales":["pt","pt_BR"],"bcp47":"pt"},"pt_GQ":{"englishName":"Portuguese(Equatorial Guinea)","localizedName":"português(Guiné Equatorial)","direction":"ltr","fallbackLocales":["pt","pt_BR"],"bcp47":"pt"},"pt_GW":{"englishName":"Portuguese(Guinea-Bissau)","localizedName":"português(Guiné-Bissau)","direction":"ltr","fallbackLocales":["pt","pt_BR"],"bcp47":"pt"},"pt_MZ":{"englishName":"Portuguese(Mozambique)","localizedName":"português(Moçambique)","direction":"ltr","fallbackLocales":["pt","pt_BR"],"bcp47":"pt"},"pt_ST":{"englishName":"Portuguese(São Tomé and Príncipe)","localizedName":"português(São Tomé e Príncipe)","direction":"ltr","fallbackLocales":["pt","pt_BR"],"bcp47":"pt"},"ro":{"locale3":"ron","englishName":"Romanian","localizedName":"Română","direction":"ltr","bcp47":"ro"},"sk":{"locale3":"slk","englishName":"Slovak","localizedName":"slovenčina","direction":"ltr","bcp47":"sk"},"sl":{"locale3":"slv","englishName":"Slovenian","localizedName":"slovenščina","direction":"ltr","bcp47":"sl"},"sr":{"locale3":"srp","englishName":"Serbian","localizedName":"српски језик","direction":"ltr","bcp47":"sr"},"sr_BA":{"englishName":"Serbian (Bosnia and Herzegovina)","localizedName":"Српски (Босна и Херцеговина)","direction":"ltr","fallbackLocales":["sr"],"bcp47":"sr"},"st":{"locale3":"sot","englishName":"Sotho","localizedName":"Sesotho","direction":"ltr","bcp47":"st"},"sv":{"locale3":"swe","englishName":"Swedish","localizedName":"Svenska","direction":"ltr","bcp47":"sv"},"sv_FI":{"englishName":"Swedish (Finland)","localizedName":"svenska (Finland)","direction":"ltr","fallbackLocales":["sv"],"bcp47":"sv"},"sw":{"locale3":"swa","englishName":"Swahili","localizedName":"Kiswahili","direction":"ltr","bcp47":"sw"},"te":{"locale3":"tel","englishName":"Telugu","localizedName":"తెలుగు","direction":"ltr","bcp47":"te"},"tg":{"locale3":"tgk","englishName":"Tajik","localizedName":"тоҷикӣ","direction":"ltr","bcp47":"tg"},"th":{"locale3":"tha","englishName":"Thai","localizedName":"ไทย","direction":"ltr","bcp47":"th"},"tr":{"locale3":"tur","englishName":"Turkish","localizedName":"Türkçe","direction":"ltr","bcp47":"tr"},"uz":{"locale3":"uzb","englishName":"Uzbek","localizedName":"ЎзбекЎзбек тили","direction":"ltr","bcp47":"uz"},"vi":{"locale3":"vie","englishName":"Vietnamese","localizedName":"Tiếng Việt","direction":"ltr","bcp47":"vi"},"yo":{"locale3":"yor","englishName":"Yoruba","localizedName":"Yorùbá","direction":"ltr","bcp47":"yo"},"zh_TW":{"englishName":"Chinese, Traditional","localizedName":"中文 (台灣)","direction":"ltr","bcp47":"zh"},"zu":{"locale3":"zul","englishName":"Zulu","localizedName":"isiZulu","direction":"ltr","bcp47":"zu"}};
window.phet.chipper.dependencies = {
  "comment": "# my-solar-system 1.3.15 Fri Apr 10 2026 20:24:09 GMT-0600 (Mountain Daylight Time)",
  "assert": {
    "sha": "94831413cd4dd4dc27c2a1aebbcafd3987934a99",
    "branch": "HEAD"
  },
  "axon": {
    "sha": "64f410f8e9d5dea1aa01f54de402650a23a5aeb3",
    "branch": "HEAD"
  },
  "brand": {
    "sha": "0f8207c9b02cfb644aff446c6597ae02d0be4a50",
    "branch": "HEAD"
  },
  "chipper": {
    "sha": "a4d4dbac4bfcf7cd08339e3b1556c6c39b81e7cb",
    "branch": "HEAD"
  },
  "dot": {
    "sha": "da8f04fb4ba29c460000ffedb9716350896dafa1",
    "branch": "HEAD"
  },
  "joist": {
    "sha": "e6aa7a96cfc63a5c6e562cc4746da0b195f96614",
    "branch": "HEAD"
  },
  "kite": {
    "sha": "1980d4c60a8d0c0ee9f7e133d0082bfbb9ffb24f",
    "branch": "HEAD"
  },
  "my-solar-system": {
    "sha": "431f39eef86d464ad2128aaf11eedc94722e6b7e",
    "branch": "1.3"
  },
  "perennial-alias": {
    "sha": "b1806c3148930e1c2878c53dff3ee7a3ad5ff4d5",
    "branch": "HEAD"
  },
  "phet-core": {
    "sha": "d24b34031b9b94609613c11a8b5d265dc441c0ea",
    "branch": "HEAD"
  },
  "phet-io": {
    "sha": "77c51986856f8748f069303e7fd9f27df73744d5",
    "branch": "HEAD"
  },
  "phet-io-sim-specific": {
    "sha": "311bb60d6bde24abc2d72408b7abd05fe9fe54d2",
    "branch": "HEAD"
  },
  "phet-io-wrappers": {
    "sha": "1a3aeb76a4cc406abe6aeca7b32a7b4a54b3c18a",
    "branch": "HEAD"
  },
  "phetcommon": {
    "sha": "fc849896966c8f7d1c00fff0f186ffcae121dfda",
    "branch": "HEAD"
  },
  "phetmarks": {
    "sha": "9581b8174ef3b9f26d8fb2ed661b2f5ff6b45fed",
    "branch": "HEAD"
  },
  "query-string-machine": {
    "sha": "ceb14b1e370b7c28eb1d1c867e4dae28dcea1610",
    "branch": "HEAD"
  },
  "scenery": {
    "sha": "0ee891645ec8c45bb0322f08a6f2e355a8ef64fd",
    "branch": "HEAD"
  },
  "scenery-phet": {
    "sha": "80330f8c512b7f0ef18e223a35a9459d3050ca68",
    "branch": "HEAD"
  },
  "sherpa": {
    "sha": "97cb97a3c2a5e98b0f10ae65d9578ed54765383c",
    "branch": "HEAD"
  },
  "solar-system-common": {
    "sha": "e765149f5b092ad478deb5d140b7d71844c2fbac",
    "branch": "HEAD"
  },
  "studio": {
    "sha": "ca33485bc942c1dd720d181271318ebefb93bf00",
    "branch": "HEAD"
  },
  "sun": {
    "sha": "74a98d99d9b24ff4334d0907cce71b35e7c73f7f",
    "branch": "HEAD"
  },
  "tambo": {
    "sha": "70c9c6706f368dd422d7dd0bce83c1e0038219e1",
    "branch": "HEAD"
  },
  "tandem": {
    "sha": "b11ebcba0ab00ce01161e6aed52d0ccdcd369dde",
    "branch": "HEAD"
  },
  "twixt": {
    "sha": "db87a714041ea03515fb3fb81889eba34a1711a0",
    "branch": "HEAD"
  },
  "utterance-queue": {
    "sha": "fb67b3880c0d29447d575ef97ab4f14e08b2cb34",
    "branch": "HEAD"
  }
};
window.phet.chipper.strings = {"en":{"MY_SOLAR_SYSTEM/screen.intro":"‪Intro‬","MY_SOLAR_SYSTEM/screen.lab":"‪Lab‬","MY_SOLAR_SYSTEM/a11y.introScreen.screenSummary.playAreaDescription":"‪The Play Area is an observation window showing a scene with two planetary bodies. Experiment with the mass, velocity, location and direction of the two planetary bodies.‬","MY_SOLAR_SYSTEM/a11y.introScreen.screenSummary.controlAreaDescription":"‪In the Control Area, there are options to add a grid and a measuring tape. You can also toggle on or off the path and values of your planetary bodies and also check their center of mass. The Control Area has options for how fast the action happens in the observation window including buttons to pause and step forward.‬","MY_SOLAR_SYSTEM/a11y.labScreen.screenSummary.playAreaDescription":"‪The Play Area is an observation window showing a scene with many options to set up your own experiments. Recreate our own Sun and Earth or make up your own solar system.‬","MY_SOLAR_SYSTEM/a11y.labScreen.screenSummary.controlAreaDescription":"‪In the Control Area, there are options to view and change the area of the orbit and options to adjust and view orbital information. You can choose premade planetary alignments or choose your own, along with a Zoom in and out option. The Control Area has options for how fast the action happens in the observation window including buttons to pause and step forward.‬","MY_SOLAR_SYSTEM/keyboardHelpDialog.chooseAnOrbitalSystem":"‪Choose an Orbital System‬","MY_SOLAR_SYSTEM/keyboardHelpDialog.orbitalSystem":"‪orbital system‬","MY_SOLAR_SYSTEM/keyboardHelpDialog.orbitalSystems":"‪orbital systems‬","MY_SOLAR_SYSTEM/a11y.info":"‪Info‬","MY_SOLAR_SYSTEM/followCenterOfMass":"‪Follow Center of Mass‬","MY_SOLAR_SYSTEM/returnBodies":"‪Return Bodies‬","MY_SOLAR_SYSTEM/a11y.labScreen.orbitalSystemSelector":"‪Orbital System selector‬","MY_SOLAR_SYSTEM/mode.sunAndPlanet":"‪Sun, Planet‬","MY_SOLAR_SYSTEM/mode.sunPlanetAndMoon":"‪Sun, Planet, Moon‬","MY_SOLAR_SYSTEM/mode.sunPlanetAndComet":"‪Sun, Planet, Comet‬","MY_SOLAR_SYSTEM/mode.trojanAsteroids":"‪Trojan Asteroids‬","MY_SOLAR_SYSTEM/mode.ellipses":"‪Ellipses‬","MY_SOLAR_SYSTEM/mode.hyperbolic":"‪Hyperbolic‬","MY_SOLAR_SYSTEM/mode.slingshot":"‪Slingshot‬","MY_SOLAR_SYSTEM/mode.doubleSlingshot":"‪Double Slingshot‬","MY_SOLAR_SYSTEM/mode.binaryStarPlanet":"‪Binary Star, Planet‬","MY_SOLAR_SYSTEM/mode.fourStarBallet":"‪Four Star Ballet‬","MY_SOLAR_SYSTEM/mode.doubleDouble":"‪Double Double‬","MY_SOLAR_SYSTEM/mode.orbitalSystem1":"‪Orbital System 1‬","MY_SOLAR_SYSTEM/mode.orbitalSystem2":"‪Orbital System 2‬","MY_SOLAR_SYSTEM/mode.orbitalSystem3":"‪Orbital System 3‬","MY_SOLAR_SYSTEM/mode.orbitalSystem4":"‪Orbital System 4‬","MY_SOLAR_SYSTEM/mode.custom":"‪Custom‬","MY_SOLAR_SYSTEM/dataPanel.mass":"‪Mass‬","MY_SOLAR_SYSTEM/units.kg":"‪10<sup>28</sup> kg‬","MY_SOLAR_SYSTEM/mass":"‪Mass‬","MY_SOLAR_SYSTEM/dataPanel.position":"‪Position‬","MY_SOLAR_SYSTEM/dataPanel.velocity":"‪Velocity‬","MY_SOLAR_SYSTEM/pattern.labelParenthesesUnits":"‪{{label}} ({{units}})‬","MY_SOLAR_SYSTEM/unitsInfo.content":"‪<b>Note 1:</b> An Astronomical Unit (AU) is about 150 million kilometers. This is the average distance between the Sun and the Earth.‬","MY_SOLAR_SYSTEM/unitsInfo.content2":"‪<b>Note 2:</b> The mass values in this simulation range from 1 Jupiter mass to 1.5 Solar masses. All astronomical objects show a similar behavior under a strong gravitational field, including smaller planets, comets, and asteroids.‬","MY_SOLAR_SYSTEM/unitsInfo.content3":"‪<b>Note 3:</b> Due to the large range of values in the simulation, the gravity force vectors may sometimes be too small or too large to display. The gravity force vectors can be rescaled with the zoom control.‬","MY_SOLAR_SYSTEM/unitsInfo.title":"‪Units Information‬","MY_SOLAR_SYSTEM/centerOfMass":"‪Center of Mass‬","MY_SOLAR_SYSTEM/dataPanel.moreData":"‪More Data‬","MY_SOLAR_SYSTEM/a11y.moreData":"‪More Data‬","MY_SOLAR_SYSTEM/dataPanel.bodies":"‪Bodies‬","MY_SOLAR_SYSTEM/a11y.numberOfBodies":"‪Number of Bodies‬","MY_SOLAR_SYSTEM/dataPanel.X":"‪x‬","MY_SOLAR_SYSTEM/dataPanel.Y":"‪y‬","MY_SOLAR_SYSTEM/dataPanel.Vx":"‪V<sub>x</sub>‬","MY_SOLAR_SYSTEM/dataPanel.Vy":"‪V<sub>y</sub>‬","MY_SOLAR_SYSTEM/pattern.range":"‪{{min}} to {{max}}‬","MY_SOLAR_SYSTEM/my-solar-system.title":"‪My Solar System‬","JOIST/simTitleWithScreenNamePattern":"‪{{simName}} — {{screenName}}‬","JOIST/a11y.screenNamePattern":"‪{{name}} Screen‬","JOIST/a11y.screenSimPattern":"‪{{screenName}}, {{simName}}‬","JOIST/a11y.simScreen":"‪Sim Screen‬","JOIST/a11y.home":"‪Home‬","JOIST/a11y.homeScreenDescriptionPattern":"‪Welcome to {{name}}. It has {{screens}} interactive screens that you can explore.‬","JOIST/a11y.homeScreenIntroPattern":"‪{{description}} {{hint}}‬","JOIST/a11y.homeScreenHint":"‪Choose a screen to start exploring.‬","JOIST/a11y.homeScreenButtonDetailsPattern":"‪On {{name}}, {{screenHint}}‬","JOIST/a11y.simScreens":"‪Sim Screens‬","JOIST/a11y.simResources":"‪Sim Resources‬","JOIST/queryParametersWarningDialog.invalidQueryParameters":"‪Invalid Query Parameters‬","JOIST/queryParametersWarningDialog.oneOrMoreQueryParameters":"‪One or more of these query parameters have<br>invalid values:‬","JOIST/queryParametersWarningDialog.theSimulationWillStart":"‪The simulation will start with default values for<br>those query parameters.‬","JOIST/a11y.toolbar.openToolbar":"‪Open Toolbar‬","JOIST/a11y.toolbar.closeToolbar":"‪Close Toolbar‬","JOIST/a11y.toolbar.hideToolbar":"‪Hide Toolbar‬","JOIST/a11y.toolbar.showToolbar":"‪Show Toolbar‬","JOIST/a11y.toolbar.toolbarShown":"‪Toolbar Shown.‬","JOIST/a11y.toolbar.toolbarHidden":"‪Toolbar hidden.‬","JOIST/a11y.homeScreenDescription":"‪Go to Home Screen.‬","JOIST/a11y.phetMenu":"‪PhET Menu‬","JOIST/a11y.toolbar.voicing.title":"‪Sim Voicing‬","JOIST/a11y.toolbar.voicing.quickInfo":"‪Quick Info‬","JOIST/a11y.toolbar.voicing.simVoicingOnAlert":"‪Sim Voicing on.‬","JOIST/a11y.toolbar.voicing.simVoicingOffAlert":"‪Sim Voicing off.‬","JOIST/a11y.toolbar.title":"‪Toolbar‬","JOIST/a11y.toolbar.voicing.playOverviewLabel":"‪Play Overview‬","JOIST/a11y.toolbar.voicing.playDetailsLabel":"‪Play Details‬","JOIST/a11y.toolbar.voicing.playHintLabel":"‪Play Hint‬","JOIST/a11y.toolbar.voicing.overviewLabel":"‪Overview‬","JOIST/a11y.toolbar.voicing.detailsLabel":"‪Details‬","JOIST/a11y.toolbar.voicing.hintLabel":"‪Hint‬","JOIST/a11y.keyboardHelp.keyboardShortcuts":"‪Keyboard Shortcuts‬","JOIST/a11y.soundToggle.label":"‪All Audio‬","JOIST/a11y.soundToggle.alert.simSoundOn":"‪Audio Features on.‬","JOIST/a11y.soundToggle.alert.simSoundOff":"‪Audio Features off.‬","JOIST/menuItem.phetWebsite":"‪PhET Website…‬","JOIST/menuItem.reportAProblem":"‪Report a Problem…‬","JOIST/menuItem.getUpdate":"‪Check for Updates…‬","JOIST/menuItem.screenshot":"‪Screenshot‬","JOIST/menuItem.fullscreen":"‪Full Screen‬","JOIST/menuItem.about":"‪About…‬","JOIST/preferences.title":"‪Preferences‬","JOIST/a11y.keyboardHelp.tabToGetStarted":"‪Tab to get started.‬","JOIST/keyboardShortcuts.title":"‪Keyboard Shortcuts‬","JOIST/keyboardShortcuts.toGetStarted":"‪to get started‬","JOIST/versionPattern":"‪version {0}‬","JOIST/license.title":"‪License‬","JOIST/termsPrivacyAndLicensing":"‪Terms, Privacy & Licensing‬","JOIST/privacyPolicy":"‪Privacy Policy‬","JOIST/translation.credits.link":"‪Translation Credits‬","JOIST/thirdParty.credits.link":"‪Third-party Credits‬","JOIST/donateToPhet":"‪Donate to PhET‬","JOIST/updates.checking":"‪Checking for updates…‬","JOIST/updates.upToDate":"‪This simulation is up to date.‬","JOIST/updates.outOfDate":"‪New version available‬","JOIST/updates.newVersionAvailable":"‪There is a new version available: {0}.‬","JOIST/updates.yourCurrentVersion":"‪Your current version is: {0}.‬","JOIST/updates.getUpdate":"‪Get Update…‬","JOIST/updates.noThanks":"‪No Thanks‬","JOIST/updates.offline":"‪Unable to check for updates.‬","JOIST/credits.title":"‪Credits‬","JOIST/credits.leadDesign":"‪Lead Design: {0}‬","JOIST/credits.softwareDevelopment":"‪Software Development: {0}‬","JOIST/credits.team":"‪Team: {0}‬","JOIST/credits.contributors":"‪Contributors: {0}‬","JOIST/credits.qualityAssurance":"‪Quality Assurance: {0}‬","JOIST/credits.graphicArts":"‪Graphic Arts: {0}‬","JOIST/credits.soundDesign":"‪Sound Design: {0}‬","JOIST/credits.thanks":"‪Thanks‬","JOIST/preferences.tabs.overview.title":"‪Overview‬","JOIST/preferences.tabs.simulation.title":"‪Simulation‬","JOIST/preferences.tabs.visual.title":"‪Visual‬","JOIST/preferences.tabs.audio.title":"‪Audio‬","JOIST/preferences.tabs.input.title":"‪Input‬","JOIST/preferences.tabs.localization.title":"‪Localization‬","JOIST/preferences.tabs.audio.audioFeatures.title":"‪Audio Features‬","JOIST/a11y.preferences.tabs.input.gestureControl.enabledAlert":"‪Custom taps and swipes on.‬","JOIST/a11y.preferences.tabs.input.gestureControl.disabledAlert":"‪Custom taps and swipes off.‬","JOIST/a11y.preferences.tabs.labelledDescriptionPattern":"‪{{label}}, {{description}}‬","JOIST/preferences.tabs.visual.interactiveHighlights":"‪Interactive Highlights‬","JOIST/preferences.tabs.visual.interactiveHighlightsDescription":"‪Add visual highlights for mouse and touch as you interact.‬","JOIST/a11y.preferences.tabs.visual.interactiveHighlights.enabledAlert":"‪Highlights on for all input.‬","JOIST/a11y.preferences.tabs.visual.interactiveHighlights.disabledAlert":"‪Highlights off for mouse and touch.‬","JOIST/preferences.tabs.localization.regionAndCulture.title":"‪Region and Culture‬","JOIST/preferences.tabs.localization.regionAndCulture.description":"‪Select the portrayal of people, places, or objects in the sim. Images are not intended to represent the entire diversity of a region or culture.‬","JOIST/preferences.tabs.general.accessibilityIntro":"‪We are adding features to our simulations to make them more inclusive. Some of these features support accessibility for learners with diverse needs and within diverse environments. Explore this menu to review or change the default presentation settings.‬","JOIST/preferences.tabs.general.moreAccessibility":"‪Look for Inclusive Features on the Simulations Filter page of the PhET website to find all simulations with available features.‬","JOIST/a11y.preferences.tabs.tabResponsePattern":"‪Preferences, {{title}} Tab‬","JOIST/preferences.tabs.audio.sounds.title":"‪Sounds‬","JOIST/preferences.tabs.audio.sounds.extraSounds.title":"‪Extra Sounds‬","JOIST/preferences.tabs.audio.sounds.description":"‪Play sonifications and sound effects as you interact.‬","JOIST/preferences.tabs.audio.sounds.extraSounds.description":"‪Play additional sound that may be helpful for some learners.‬","JOIST/a11y.preferences.tabs.audio.sounds.soundsOn":"‪Sounds on.‬","JOIST/a11y.preferences.tabs.audio.sounds.soundsOff":"‪Sounds off.‬","JOIST/a11y.preferences.tabs.audio.sounds.extraSounds.extraSoundsOn":"‪Extra Sounds on.‬","JOIST/a11y.preferences.tabs.audio.sounds.extraSounds.extraSoundsOff":"‪Extra Sounds off.‬","JOIST/a11y.preferences.tabs.audio.voicing.title":"‪Voicing‬","JOIST/a11y.preferences.tabs.audio.voicing.toolbar.title":"‪Toolbar‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.rate.title":"‪Rate‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.rate.labelString":"‪Voice Rate‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.pitch.title":"‪Pitch‬","JOIST/a11y.preferences.tabs.audio.voicing.voicingOn":"‪Voicing on.‬","JOIST/a11y.preferences.tabs.audio.voicing.voicingOff":"‪Voicing off.‬","JOIST/a11y.preferences.tabs.audio.voicing.voicingOffOnlyAvailableInEnglish":"‪Voicing off. Only available in English.‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.variablesPattern":"‪{{value}}x‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.title":"‪Customize Voice‬","JOIST/a11y.preferences.tabs.audio.voicing.toolbar.toolbarRemoved":"‪Toolbar removed.‬","JOIST/a11y.preferences.tabs.audio.voicing.toolbar.toolbarAdded":"‪Toolbar added to sim.‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.title":"‪Sim Voicing Options‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.description":"‪Choose details you want voiced as you interact.‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.objectDetails.label":"‪Voice object details and changes‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.contextChanges.label":"‪Voice surrounding context changes‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.helpfulHints.label":"‪Voice helpful hints‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.objectDetails.enabledAlert":"‪Voicing object details and changes.‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.objectDetails.disabledAlert":"‪Object details and changes muted.‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.contextChanges.enabledAlert":"‪Voicing surrounding context changes.‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.contextChanges.disabledAlert":"‪Surrounding context changes muted.‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.helpfulHints.enabledAlert":"‪Voicing extra help.‬","JOIST/a11y.preferences.tabs.audio.voicing.simVoicingOptions.helpfulHints.disabledAlert":"‪Extra help muted.‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.voice.title":"‪Voice‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.voice.titlePattern":"‪Voice: {{value}}‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.voice.noVoicesAvailable":"‪No voices available‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.expandedAlert":"‪Customize Voice, expanded‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.collapsedAlert":"‪Customize Voice, collapsed‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.writtenVariablesPattern":"‪{{value}} times‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.voiceRateNormal":"‪normal‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.low":"‪in low range‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.normal":"‪in normal range‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.aboveNormal":"‪above normal range‬","JOIST/a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.high":"‪in high range‬","JOIST/preferences.tabs.audio.voicing.titleEnglishOnly":"‪Voicing (English Only)‬","JOIST/preferences.tabs.audio.voicing.description":"‪Voice and highlight content as you interact.‬","JOIST/projectorMode":"‪Projector Mode‬","JOIST/preferences.tabs.visual.projectorModeDescription":"‪Increase color contrast for better visibility in classrooms.‬","JOIST/a11y.preferences.tabs.localization.languageSelection.label":"‪Languages‬","JOIST/a11y.preferences.tabs.localization.languageSelection.description":"‪Change language to translate on-screen text. Additional descriptions, when present, remain in English.‬","JOIST/a11y.preferences.tabs.localization.languageSelection.languageChangeResponsePattern":"‪On-screen text now in {{language}}.‬","SCENERY_PHET/a11y.measuringTape":"‪Measuring Tape‬","SCENERY_PHET/a11y.measuringTapeTip":"‪Measuring Tape Tip‬","SCENERY_PHET/measuringTapeReadoutPattern":"‪{{distance}} {{units}}‬","SCENERY_PHET/keyboardHelpDialog.moveToNextItemOrGroup":"‪Move to next item or group‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.tabGroupDescription":"‪Move to next item or group with Tab key.‬","SCENERY_PHET/keyboardHelpDialog.moveToPreviousItemOrGroup":"‪Move to previous item or group‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.shiftTabGroupDescription":"‪Move to previous item or group with Shift plus Tab key.‬","SCENERY_PHET/keyboardHelpDialog.moveBetweenItemsInAGroup":"‪Move between items in a group‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.groupNavigationDescription":"‪Move between items in a group with Left and Right arrow keys or Up and Down arrow keys.‬","SCENERY_PHET/keyboardHelpDialog.pressButtons":"‪Press buttons‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.pressButtonsDescription":"‪Press buttons with Space or Enter keys.‬","SCENERY_PHET/keyboardHelpDialog.resetAll":"‪Reset All‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.resetAllDescriptionPattern":"‪Reset All with {{altOrOption}} plus R.‬","SCENERY_PHET/keyboardHelpDialog.exitADialog":"‪Exit a dialog‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.exitDialogDescription":"‪Exit a dialog with Escape key.‬","SCENERY_PHET/keyboardHelpDialog.setValuesInKeypad":"‪Set values within keypad‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.setValuesInKeypadDescription":"‪Set values within keypad using number keys 0-9.‬","SCENERY_PHET/keyboardHelpDialog.toggleCheckboxes":"‪Toggle checkboxes‬","SCENERY_PHET/a11y.keyboardHelpDialog.general.toggleCheckboxesDescription":"‪Toggle checkboxes with Space key.‬","SCENERY_PHET/keyboardHelpDialog.basicActions":"‪Basic Actions‬","SCENERY_PHET/keyboardHelpDialog.sliderControls":"‪Slider Controls‬","SCENERY_PHET/keyboardHelpDialog.adjust":"‪Adjust‬","SCENERY_PHET/keyboardHelpDialog.slider":"‪slider‬","SCENERY_PHET/keyboardHelpDialog.maximum":"‪maximum‬","SCENERY_PHET/keyboardHelpDialog.minimum":"‪minimum‬","SCENERY_PHET/keyboardHelpDialog.adjustSlider":"‪Adjust slider‬","SCENERY_PHET/keyboardHelpDialog.adjustInSmallerSteps":"‪Adjust in smaller steps‬","SCENERY_PHET/keyboardHelpDialog.adjustInLargerSteps":"‪Adjust in larger steps‬","SCENERY_PHET/keyboardHelpDialog.verbSliderPattern":"‪{{verb}} {{slider}}‬","SCENERY_PHET/keyboardHelpDialog.verbInSmallerStepsPattern":"‪{{verb}} in smaller steps‬","SCENERY_PHET/keyboardHelpDialog.verbInLargerStepsPattern":"‪{{verb}} in larger steps‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.leftRightArrowKeys":"‪Left and Right arrow keys‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.upDownArrowKeys":"‪Up and Down arrow keys‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.orKeysPattern":"‪{{leftRight}}, or {{upDown}}‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.defaultStepsDescriptionPattern":"‪{{verb}} {{slider}} with {{keys}}.‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.shiftLeftRightArrowKeys":"‪Shift plus Left or Right arrow key‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.shiftUpDownArrowKeys":"‪Shift plus Up or Down arrow key‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.smallerStepsDescriptionPattern":"‪{{verb}} in smaller steps with {{keys}}.‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.largerStepsDescriptionPattern":"‪{{verb}} in larger steps with Page Up or Page Down key.‬","SCENERY_PHET/keyboardHelpDialog.jumpToMinimumPattern":"‪Jump to {{minimum}}‬","SCENERY_PHET/keyboardHelpDialog.jumpToMaximumPattern":"‪Jump to {{maximum}}‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.jumpToMinimumDescriptionPattern":"‪Jump to {{minimum}} with Home key.‬","SCENERY_PHET/a11y.keyboardHelpDialog.slider.jumpToMaximumDescriptionPattern":"‪Jump to {{maximum}} with End key.‬","SCENERY_PHET/keyboardHelpDialog.timingControls.timingControls":"‪Timing Controls‬","SCENERY_PHET/keyboardHelpDialog.timingControls.pauseOrPlayAction":"‪Pause or play action‬","SCENERY_PHET/a11y.keyboardHelpDialog.timingControls.pauseOrPlayActionDescription":"‪Pause or play action with alt key plus K.‬","SCENERY_PHET/keyboardHelpDialog.move":"‪Move‬","SCENERY_PHET/a11y.keyboardHelpDialog.draggableItems.moveDescription":"‪Move with arrow keys or W, A, S, or D keys.‬","SCENERY_PHET/keyboardHelpDialog.moveSlower":"‪Move slower‬","SCENERY_PHET/a11y.keyboardHelpDialog.draggableItems.moveSlowerDescription":"‪Move slower with shift plus arrow keys or W, A, S, or D keys.‬","SCENERY_PHET/keyboardHelpDialog.moveDraggableItems":"‪Move Draggable Items‬","SCENERY_PHET/keyboardHelpDialog.comboBox.headingString":"‪Pop open menu‬","SCENERY_PHET/keyboardHelpDialog.comboBox.option":"‪option‬","SCENERY_PHET/keyboardHelpDialog.comboBox.options":"‪options‬","SCENERY_PHET/keyboardHelpDialog.comboBox.popUpListPattern":"‪1. Pop up list of {{thingPlural}}‬","SCENERY_PHET/a11y.keyboardHelpDialog.comboBox.popUpListPatternDescription":"‪Pop up list of {{thingPlural}} with Space or Enter keys.‬","SCENERY_PHET/keyboardHelpDialog.comboBox.moveThroughPattern":"‪2. Move through {{thingPlural}}‬","SCENERY_PHET/a11y.keyboardHelpDialog.comboBox.moveThroughPatternDescription":"‪Move through {{thingPlural}} with Up and Down arrow keys.‬","SCENERY_PHET/keyboardHelpDialog.comboBox.chooseNewPattern":"‪3. Choose new {{thingSingular}}‬","SCENERY_PHET/a11y.keyboardHelpDialog.comboBox.chooseNewPatternDescription":"‪Choose new {{thingSingular}} with Enter key.‬","SCENERY_PHET/keyboardHelpDialog.comboBox.closeWithoutChanging":"‪4. Close list without changing‬","SCENERY_PHET/a11y.keyboardHelpDialog.comboBox.closeWithoutChangingDescription":"‪Close list without changing with Escape key.‬","SCENERY_PHET/a11y.simSection.controlArea":"‪Control Area‬","SCENERY_PHET/a11y.simSection.playArea":"‪Play Area‬","SCENERY_PHET/a11y.simSection.screenSummary.keyboardShortcutsHint":"‪If needed, check out keyboard shortcuts under Sim Resources.‬","SCENERY_PHET/a11y.simSection.screenSummary.multiScreenIntro":"‪The {{screen}} changes as you play with it. It has a Play Area and a Control Area.‬","SCENERY_PHET/a11y.simSection.screenSummary.singleScreenIntroPattern":"‪{{sim}} is an interactive sim. It changes as you play with it. It has a Play Area and a Control Area.‬","SCENERY_PHET/a11y.playControlButton.stop":"‪Stop‬","SCENERY_PHET/key.option":"‪Option‬","SCENERY_PHET/key.alt":"‪Alt‬","SCENERY_PHET/key.esc":"‪Esc‬","SCENERY_PHET/key.capsLock":"‪Caps Lock‬","SCENERY_PHET/key.end":"‪End‬","SCENERY_PHET/key.enter":"‪Enter‬","SCENERY_PHET/key.fn":"‪Fn‬","SCENERY_PHET/key.home":"‪Home‬","SCENERY_PHET/key.pageDown":"‪Pg Dn‬","SCENERY_PHET/key.pageUp":"‪Pg Up‬","SCENERY_PHET/key.space":"‪Space‬","SCENERY_PHET/key.shift":"‪Shift‬","SCENERY_PHET/key.tab":"‪Tab‬","SCENERY_PHET/key.a":"‪A‬","SCENERY_PHET/key.c":"‪C‬","SCENERY_PHET/key.d":"‪D‬","SCENERY_PHET/key.r":"‪R‬","SCENERY_PHET/key.s":"‪S‬","SCENERY_PHET/key.w":"‪W‬","SCENERY_PHET/key.one":"‪1‬","SCENERY_PHET/key.two":"‪2‬","SCENERY_PHET/key.three":"‪3‬","SCENERY_PHET/keyboardHelpDialog.or":"‪or‬","SCENERY_PHET/keyboardHelpDialog.hyphen":"‪-‬","SCENERY_PHET/key.k":"‪K‬","SCENERY_PHET/key.l":"‪L‬","SCENERY_PHET/a11y.close":"‪Close‬","SCENERY_PHET/a11y.zoomIn":"‪Zoom In‬","SCENERY_PHET/a11y.zoomOut":"‪Zoom Out‬","SCENERY_PHET/a11y.resetAll.label":"‪Reset All‬","SCENERY_PHET/a11y.voicing.resetAll.contextResponse":"‪Everything Reset.‬","SCENERY_PHET/a11y.resetAll.alert":"‪Sim screen restarted. Everything reset.‬","SCENERY_PHET/a11y.playControlButton.play":"‪Play‬","SCENERY_PHET/a11y.timeControlNode.label":"‪Timing Controls‬","SCENERY_PHET/speed.fast":"‪Fast‬","SCENERY_PHET/speed.normal":"‪Normal‬","SCENERY_PHET/speed.slow":"‪Slow‬","SCENERY_PHET/a11y.timeControlNode.simSpeeds":"‪Sim Speeds‬","SCENERY_PHET/a11y.timeControlNode.simSpeedDescription":"‪For closer observations Play sim on slow speed.‬","SCENERY_PHET/a11y.playPauseStepButtonGroup.playingDescription":"‪Pause sim to step forward little by little.‬","SCENERY_PHET/a11y.playPauseStepButtonGroup.pausedDescription":"‪Step forward little by little.‬","SCENERY_PHET/a11y.playControlButton.pause":"‪Pause‬","SCENERY_PHET/a11y.stepButton.stepForward":"‪Step Forward‬","SOLAR_SYSTEM_COMMON/offscaleMessage":"‪Some force vectors are too small to display.‬","SOLAR_SYSTEM_COMMON/units.AU":"‪AU‬","SOLAR_SYSTEM_COMMON/units.kms":"‪km/s‬","SOLAR_SYSTEM_COMMON/pattern.labelUnits":"‪{{value}} {{units}}‬","SOLAR_SYSTEM_COMMON/units.years":"‪years‬","SOLAR_SYSTEM_COMMON/clear":"‪Clear‬","SOLAR_SYSTEM_COMMON/path":"‪Path‬","SOLAR_SYSTEM_COMMON/pattern.velocityValueUnits":"‪|v<sub>{{index}}</sub>| = {{value}} {{units}}‬","SOLAR_SYSTEM_COMMON/V":"‪V‬","SOLAR_SYSTEM_COMMON/zoom":"‪Zoom:‬","SOLAR_SYSTEM_COMMON/a11y.scaleSlider":"‪Scale Slider‬","SOLAR_SYSTEM_COMMON/speed":"‪Speed (km/s)‬","SOLAR_SYSTEM_COMMON/velocity":"‪Velocity‬","SOLAR_SYSTEM_COMMON/gravityForce":"‪Gravity Force‬","SOLAR_SYSTEM_COMMON/grid":"‪Grid‬","SOLAR_SYSTEM_COMMON/measuringTape":"‪Measuring Tape‬","SOLAR_SYSTEM_COMMON/a11y.restart":"‪Restart‬","SOLAR_SYSTEM_COMMON/a11y.massSlider":"‪Mass Slider‬","SUN/a11y.close":"‪Close‬","SUN/a11y.closed":"‪Closed‬","SUN/a11y.titleClosePattern":"‪{{title}}, Close.‬","SUN/a11y.numberSpinnerRoleDescription":"‪number spinner‬"}};
window.phet.chipper.stringMetadata = {"JOIST/simTitleWithScreenNamePattern":{"phetioDocumentation":"This pattern is used when a multi-screen simulation is only displaying one screen."},"JOIST/versionPattern":{"phetioReadOnly":true},"JOIST/termsPrivacyAndLicensing":{"phetioReadOnly":true},"JOIST/translation.credits.link":{"phetioReadOnly":true},"JOIST/thirdParty.credits.link":{"phetioReadOnly":true},"JOIST/credits.title":{"phetioReadOnly":true},"JOIST/credits.leadDesign":{"phetioReadOnly":true},"JOIST/credits.softwareDevelopment":{"phetioReadOnly":true},"JOIST/credits.team":{"phetioReadOnly":true},"JOIST/credits.contributors":{"phetioReadOnly":true},"JOIST/credits.qualityAssurance":{"phetioReadOnly":true},"JOIST/credits.graphicArts":{"phetioReadOnly":true},"JOIST/credits.soundDesign":{"phetioReadOnly":true},"JOIST/credits.thanks":{"phetioReadOnly":true}};
window.phet.chipper.isDebugBuild = false;
window.phet.chipper.allowLocaleSwitching = false;
window.phet.chipper.packageObject = {"name":"my-solar-system","version":"1.3.15","license":"GPL-3.0","repository":{"type":"git","url":"https://github.com/phetsims/my-solar-system.git"},"devDependencies":{"grunt":"~1.5.3"},"phet":{"requirejsNamespace":"MY_SOLAR_SYSTEM","simulation":true,"runnable":true,"supportedBrands":["phet","phet-io"],"phetLibs":["solar-system-common"],"phet-io":{"compareDesignedAPIChanges":true},"supportsOutputJS":true,"simFeatures":{"supportsInteractiveDescription":true,"supportsSound":true,"colorProfiles":["default","projector"]},"screenNameKeys":["MY_SOLAR_SYSTEM/screen.intro","MY_SOLAR_SYSTEM/screen.lab"],"published":true},"eslintConfig":{"extends":"../chipper/eslint/sim_eslintrc.js"}};
// Copyright 2018-2021, University of Colorado Boulder
/**
 * Detects if the browser in use is Internet Explorer, and shows an error page if so.
 *
 * @author Chris Klusendorf (PhET Interactive Simulations)
 */// constants
var CSS_STYLING="#ie-error-container {\n    display: none;\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    height: 100vh;\n    width: 100vw;\n    background: white;\n    z-index: 1000000;\n    align-items: center;\n  }\n\n  #ie-error {\n    position: relative;\n    border-radius: 10px;\n    max-width: 550px;\n    margin: auto;\n    padding: 30px;\n    font-size: 20px;\n    font-weight: 500;\n    font-family: sans-serif;\n    text-align: center;\n  }\n\n  #ie-error .header {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    margin-bottom: 46px;\n  }\n\n  #ie-error .header .h1 {\n    font-size: 30px;\n    font-weight: 500;\n    margin: 0 0 0 10px;\n  }\n\n  #ie-error .header svg {\n    width: 36px;\n  }\n\n  #ie-error p {\n    margin: 14px 0;\n  }";var ERROR_ICON_SVG="<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"\" x=\"0px\" y=\"0px\" viewBox=\"0 0 27.75 24.44\">\n     <g>\n       <path style=\"fill:red\" d=\"M12.52,0.78L0.21,22.1c-0.6,1.04,0.15,2.34,1.35,2.34h24.62c1.2,0,1.95-1.3,1.35-2.34L15.22,0.78\n         C14.62-0.26,13.12-0.26,12.52,0.78z\"/>\n       <g>\n         <path style=\"fill:white\" d=\"M13.45,17.19c-1.13-6.12-1.7-9.42-1.7-9.9c0-0.59,0.22-1.07,0.65-1.43c0.44-0.36,0.93-0.54,1.48-0.54\n           c0.59,0,1.09,0.19,1.5,0.58C15.79,6.29,16,6.74,16,7.27c0,0.5-0.57,3.81-1.7,9.92H13.45z M15.75,20.46c0,0.52-0.18,0.97-0.55,1.34\n           c-0.37,0.37-0.81,0.55-1.32,0.55c-0.52,0-0.97-0.19-1.33-0.55c-0.37-0.37-0.55-0.81-0.55-1.34c0-0.51,0.18-0.95,0.55-1.32\n           c0.37-0.37,0.81-0.55,1.33-0.55c0.51,0,0.95,0.18,1.32,0.55C15.57,19.5,15.75,19.94,15.75,20.46z\"/>\n       </g>\n     </g>\n   </svg>";// Detect which version of IE is in use. Remains -1 if not using IE. Copied from phet-core/platform.js.
var userAgent=window.navigator.userAgent;var releaseVersion=-1;var regex=null;if(window.navigator.appName==='Microsoft Internet Explorer'){regex=new RegExp('MSIE ([0-9]{1,}[.0-9]{0,})');if(regex.exec(userAgent)!==null){releaseVersion=parseFloat(RegExp.$1);}}else if(window.navigator.appName==='Netscape'){regex=new RegExp('Trident/.*rv:([0-9]{1,}[.0-9]{0,})');if(regex.exec(userAgent)!==null){releaseVersion=parseFloat(RegExp.$1);}}// Browser is IE, so set a global to alert other scripts and show the error message. Can also be revealed with the
// flag `showInternetExplorerError`
if(releaseVersion!==-1||window.location.search.indexOf('showInternetExplorerError')>=0){// create the html elements dynamically
var ieErrorStyling=document.createElement('style');ieErrorStyling.innerHTML=CSS_STYLING;var ieErrorContainer=document.createElement('div');ieErrorContainer.id='ie-error-container';var ieError=document.createElement('div');ieError.id='ie-error';var header=document.createElement('div');header.className='header';var ieErrorHeader=document.createElement('h1');ieErrorHeader.id='ie-error-header';ieErrorHeader.className='h1';var ieErrorNotSupported=document.createElement('p');ieErrorNotSupported.id='ie-error-not-supported';var ieErrorDifferentBrowser=document.createElement('p');ieErrorDifferentBrowser.id='ie-error-header';// get the locale specified as a query parameter, if there is one
var localeRegEx=/locale=[a-z]{2}(_[A-Z]{2}){0,1}/g;var localeQueryParameterMatches=window.location.search.match(localeRegEx)||[];var localeQueryParameter=localeQueryParameterMatches.length?localeQueryParameterMatches[0]:null;var localeQueryParameterValue=localeQueryParameter?localeQueryParameter.split('=')[1]:null;// Prioritize the locale specified as a query parameter, otherwise fallback to the built locale. Then get the strings
// in that locale.
var locale=localeQueryParameterValue&&window.phet.chipper.strings[localeQueryParameterValue]?localeQueryParameterValue:window.phet.chipper.locale;var strings=window.phet.chipper.strings[locale];// fill in the translated strings
ieErrorHeader.innerText=strings['JOIST/ieErrorPage.platformError'];ieErrorNotSupported.innerText=strings['JOIST/ieErrorPage.ieIsNotSupported'];ieErrorDifferentBrowser.innerText=strings['JOIST/ieErrorPage.useDifferentBrowser'];// add the html elements to the page
header.innerHTML=ERROR_ICON_SVG;header.appendChild(ieErrorHeader);ieError.appendChild(header);ieError.appendChild(ieErrorNotSupported);ieError.appendChild(ieErrorDifferentBrowser);ieErrorContainer.appendChild(ieError);document.body.appendChild(ieErrorStyling);document.body.appendChild(ieErrorContainer);// reveal the error
document.getElementById('ie-error-container').style.display='flex';}</script>
<script type="text/javascript">window.PHET_SPLASH_DATA_URI="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMjc2cHgiIGhlaWdodD0iMTMycHgiIHZpZXdCb3g9IjAgMCAyNzYgMTMyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNzYgMTMyIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxnPg0KCQk8cmVjdCB4PSIwLjQ5OSIgeT0iMTE2Ljc4MSIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjMuNiIgaGVpZ2h0PSIxMy45ODQiLz4NCgkJPHBvbHlnb24gZmlsbD0iI0ZGRkZGRiIgcG9pbnRzPSIxNi45NDIsMTI1LjE3MiAxMS4yNjEsMTE2Ljc4MSA3LjY1MSwxMTYuNzgxIDcuNjUxLDEzMC43NjYgMTEuMjYxLDEzMC43NjYgMTEuMjYxLDEyMi40NDEgDQoJCQkxNi45ODcsMTMwLjc2NiAyMC41NTMsMTMwLjc2NiAyMC41NTMsMTE2Ljc4MSAxNi45NDIsMTE2Ljc4MSAJCSIvPg0KCQk8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjIzLjA1MSwxMjAuMDUgMjcuMDc3LDEyMC4wNSAyNy4wNzcsMTMwLjc2NiAzMC42ODMsMTMwLjc2NiAzMC42ODMsMTIwLjA1IDM0Ljc1NywxMjAuMDUgDQoJCQkzNC43NTcsMTE2Ljc4MSAyMy4wNTEsMTE2Ljc4MSAJCSIvPg0KCQk8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjM3LjAyNCwxMzAuNzY2IDQ2Ljc3NiwxMzAuNzY2IDQ2Ljc3NiwxMjcuODEyIDQwLjYyOSwxMjcuODEyIDQwLjYyOSwxMjUuMjQ4IDQ1Ljk1OSwxMjUuMjQ4IA0KCQkJNDUuOTU5LDEyMi4yOTEgNDAuNjI5LDEyMi4yOTEgNDAuNjI5LDExOS43MTUgNDYuNzc2LDExOS43MTUgNDYuNzc2LDExNi43ODEgMzcuMDI0LDExNi43ODEgCQkiLz4NCgkJPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTYwLjgyOSwxMjEuMzI5YzAtMi45NTQtMi4zMDMtNC41NTItNS42MzctNC41NTJoLTUuNTE5djEzLjk4OGgzLjYxdi00LjY3NmgxLjQ5bDIuNTk5LDQuNjc2aDQuMDI2DQoJCQlsLTMuMzc5LTUuMjE5QzU5LjY0MSwxMjUuMDE4LDYwLjgyOSwxMjMuNjM3LDYwLjgyOSwxMjEuMzI5eiBNNTUuNDIyLDEyMy4zODVoLTIuMTM4di0zLjY3aDIuMTM4DQoJCQljMC45MzcsMCwxLjgwMiwwLjcxMywxLjgwMiwxLjg0NkM1Ny4yMjQsMTIyLjY2OSw1Ni4zNTgsMTIzLjM4NSw1NS40MjIsMTIzLjM4NXoiLz4NCgkJPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTY4Ljc4OCwxMTYuNzgxbC01LjU2MiwxMy45ODRoMy44ODRsMS4wODgtMy4zNTNoNC41NzFsMS4wOTUsMy4zNTNoMy44NzlsLTUuNTU5LTEzLjk4NEg2OC43ODh6DQoJCQkgTTY5LjA2LDEyNC43NDhsMS40My00LjM0MmwxLjQwMSw0LjM0Mkg2OS4wNnoiLz4NCgkJPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTc5LjAyOCwxMjMuNzYyYzAsNS45MTEsMy41NjIsNy4xNTQsNi41NjQsNy4xNTRjMS40ODksMCwzLjAyMS0wLjM5OCw0LjQ4Ni0wLjk4OHYtMy4xMjcNCgkJCWMtMS41MzEsMC43MzctMi44MzIsMS4wMTItNC4yNzQsMS4wMTJjLTEuNjYxLDAtMy4xNzEtMC43MzYtMy4xNzEtNC4wNTFjMC0zLjMxNSwxLjUxLTQuMDQ5LDMuMTcxLTQuMDQ5DQoJCQljMS40NDIsMCwyLjc0NCwwLjI3MSw0LjI3NCwxLjAwNHYtMy4xMjNjLTEuNDYzLTAuNTg2LTIuOTk3LTAuOTg0LTQuNDg2LTAuOTg0QzgyLjU5MSwxMTYuNjA5LDc5LjAyOCwxMTcuODQ2LDc5LjAyOCwxMjMuNzYyeiIvPg0KCQk8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjkxLjk5NSwxMjAuMDUgOTYuMDIxLDEyMC4wNSA5Ni4wMjEsMTMwLjc2NiA5OS42MjksMTMwLjc2NiA5OS42MjksMTIwLjA1IDEwMy42OTYsMTIwLjA1IA0KCQkJMTAzLjY5NiwxMTYuNzgxIDkxLjk5NSwxMTYuNzgxIAkJIi8+DQoJCTxyZWN0IHg9IjEwNS45ODUiIHk9IjExNi43ODEiIGZpbGw9IiNGRkZGRkYiIHdpZHRoPSIzLjYwNyIgaGVpZ2h0PSIxMy45ODQiLz4NCgkJPHBvbHlnb24gZmlsbD0iI0ZGRkZGRiIgcG9pbnRzPSIxMTguODAyLDEyNi42NzYgMTE1LjY4MSwxMTYuNzgxIDExMS44MjMsMTE2Ljc4MSAxMTcuMTksMTMwLjc2NiAxMjAuNDYyLDEzMC43NjYgMTI1Ljc5LDExNi43ODEgDQoJCQkxMjEuOTMyLDExNi43ODEgCQkiLz4NCgkJPHBvbHlnb24gZmlsbD0iI0ZGRkZGRiIgcG9pbnRzPSIxMjcuOTU0LDEzMC43NjYgMTM3LjcwNCwxMzAuNzY2IDEzNy43MDQsMTI3LjgxMiAxMzEuNTYsMTI3LjgxMiAxMzEuNTYsMTI1LjI0OCAxMzYuODg5LDEyNS4yNDggDQoJCQkxMzYuODg5LDEyMi4yOTEgMTMxLjU2LDEyMi4yOTEgMTMxLjU2LDExOS43MTUgMTM3LjcwNCwxMTkuNzE1IDEzNy43MDQsMTE2Ljc4MSAxMjcuOTU0LDExNi43ODEgCQkiLz4NCgkJPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTE0Ny42ODYsMTIwLjQ5YzAtMS41NTEsMS4yMzgtMi4zOTMsMy40NjQtMi4zOTNjMS40MjYsMCwyLjU3NywwLjQ0MSwzLjM1NCwwLjg4NXYtMS41NTgNCgkJCWMtMC44OTktMC40NDItMi4wODEtMC44MzUtMy41MDQtMC44MzVjLTMuNTY0LDAtNC44MjQsMi4wMTQtNC44MjQsMy44OTljMCw0LjY4Myw3LjcxNywyLjYyLDcuNzE3LDYuNzENCgkJCWMwLDEuODQ3LTEuOTQ2LDIuMjI1LTMuNTY5LDIuMjI1Yy0xLjksMC0zLjIwMS0wLjU2NC00LjAyMS0xLjExMXYxLjYzOGMwLjk4NSwwLjUyOCwyLjM0OSwwLjk4Nyw0LjEzMSwwLjk4Nw0KCQkJYzMuMTI2LDAsNC45NzQtMS40MSw0Ljk3NC0zLjczN0MxNTUuNDA1LDEyMS44NTIsMTQ3LjY4NiwxMjMuNTUxLDE0Ny42ODYsMTIwLjQ5eiIvPg0KCQk8cmVjdCB4PSIxNTguNTE1IiB5PSIxMTYuNzc3IiBmaWxsPSIjRkZGRkZGIiB3aWR0aD0iMS41MSIgaGVpZ2h0PSIxMy45ODgiLz4NCgkJPHBvbHlnb24gZmlsbD0iI0ZGRkZGRiIgcG9pbnRzPSIxNzAuMDg5LDEyMy44OTEgMTY1LjI4OCwxMTYuNzgxIDE2My42NTMsMTE2Ljc4MSAxNjMuNjUzLDEzMC43NjYgMTY1LjE2MywxMzAuNzY2IA0KCQkJMTY1LjE2MywxMTkuMjUyIDE3MC4wODksMTI2LjM4NCAxNzUuMDQxLDExOS4yNTIgMTc1LjA0MSwxMzAuNzY2IDE3Ni41NTEsMTMwLjc2NiAxNzYuNTUxLDExNi43ODEgMTc0LjkxOSwxMTYuNzgxIAkJIi8+DQoJCTxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0xOTAuMTEsMTI1LjEwNGMwLDMtMS4zNjUsNC40NDktNC4xNzcsNC40NDlzLTQuMTc4LTEuNDQ5LTQuMTc4LTQuNDQ5di04LjMyMmgtMS41MDd2OC4yMzQNCgkJCWMwLDMuODI0LDIuMDE3LDUuOTIyLDUuNjg1LDUuOTIyYzMuNjczLDAsNS42ODUtMi4wOTgsNS42ODUtNS45MjJ2LTguMjM0aC0xLjUwOFYxMjUuMTA0TDE5MC4xMSwxMjUuMTA0eiIvPg0KCQk8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjE5Ni42NTcsMTE2Ljc4MSAxOTUuMTQ1LDExNi43ODEgMTk1LjE0NSwxMzAuNzY2IDIwMy44MDksMTMwLjc2NiAyMDMuODA5LDEyOS4yOTkgDQoJCQkxOTYuNjU3LDEyOS4yOTkgCQkiLz4NCgkJPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTIxMS4xMzQsMTE2Ljc4MWwtNS41OCwxMy45ODRoMS42MzNsMS42OC00LjM1NWg2LjA0M2wxLjY3OSw0LjM1NWgxLjYxbC01LjU1OC0xMy45ODRIMjExLjEzNHoNCgkJCSBNMjA5LjQyOSwxMjQuOTU5bDIuNDYtNi4zOThsMi40NTIsNi4zOThIMjA5LjQyOXoiLz4NCgkJPHBvbHlnb24gZmlsbD0iI0ZGRkZGRiIgcG9pbnRzPSIyMTcuNDg5LDExOC4yNDQgMjIyLjQzOCwxMTguMjQ0IDIyMi40MzgsMTMwLjc2NiAyMjMuOTUyLDEzMC43NjYgMjIzLjk1MiwxMTguMjQ0IA0KCQkJMjI4Ljg3OSwxMTguMjQ0IDIyOC44NzksMTE2Ljc4MSAyMTcuNDg5LDExNi43ODEgCQkiLz4NCgkJPHJlY3QgeD0iMjMxLjE2NyIgeT0iMTE2Ljc3NyIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjEuNTA5IiBoZWlnaHQ9IjEzLjk4OCIvPg0KCQk8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNMjQyLjE4MiwxMTYuNTljLTQuMjk3LDAtNi40NzksMi40MDktNi40NzksNy4xNzJjMCw0Ljc2LDIuMTgzLDcuMTc2LDYuNDc5LDcuMTc2DQoJCQljNC4zMjEsMCw2LjUwNy0yLjQxNiw2LjUwNy03LjE3NEMyNDguNjg4LDExOC45OTksMjQ2LjUwMywxMTYuNTksMjQyLjE4MiwxMTYuNTl6IE0yNDIuMTgyLDEyOS41MQ0KCQkJYy0zLjQzOCwwLTQuOTcyLTEuNzYyLTQuOTcyLTUuNzQ2YzAtMy45NjUsMS41MzMtNS43NDgsNC45NzItNS43NDhjMy40NjYsMCw0Ljk5NSwxLjc4Myw0Ljk5NSw1Ljc0OA0KCQkJQzI0Ny4xNzYsMTI3Ljc0OCwyNDUuNjQ2LDEyOS41MSwyNDIuMTgyLDEyOS41MXoiLz4NCgkJPHBvbHlnb24gZmlsbD0iI0ZGRkZGRiIgcG9pbnRzPSIyNjEuNzE1LDEyOC41NjQgMjUzLjM2OSwxMTYuNzgxIDI1MS42NDgsMTE2Ljc4MSAyNTEuNjQ4LDEzMC43NjYgMjUzLjE1OCwxMzAuNzY2IA0KCQkJMjUzLjE1OCwxMTguOTgyIDI2MS41MjQsMTMwLjc2NiAyNjMuMjI1LDEzMC43NjYgMjYzLjIyNSwxMTYuNzgxIDI2MS43MTUsMTE2Ljc4MSAJCSIvPg0KCQk8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNMjY3Ljc3OCwxMjAuNDljMC0xLjU1MSwxLjIzNi0yLjM5MywzLjQ2NS0yLjM5M2MxLjQyNSwwLDIuNTc2LDAuNDQxLDMuMzU1LDAuODg1di0xLjU1OA0KCQkJYy0wLjkwMi0wLjQ0Mi0yLjA3Ny0wLjgzNS0zLjUwNS0wLjgzNWMtMy41NjMsMC00LjgyMSwyLjAxNC00LjgyMSwzLjg5OWMwLDQuNjgzLDcuNzIyLDIuNjIsNy43MjIsNi43MQ0KCQkJYzAsMS44NDctMS45NTUsMi4yMjUtMy41NywyLjIyNWMtMS45MDcsMC0zLjIwNy0wLjU2NC00LjAyNy0xLjExMXYxLjYzOGMwLjk4NiwwLjUyOCwyLjM1NCwwLjk4Nyw0LjEzMywwLjk4Nw0KCQkJYzMuMTI1LDAsNC45NzItMS40MSw0Ljk3Mi0zLjczN0MyNzUuNDk5LDEyMS44NTIsMjY3Ljc3OCwxMjMuNTUxLDI2Ny43NzgsMTIwLjQ5eiIvPg0KCTwvZz4NCgk8Zz4NCgkJPHBhdGggZmlsbD0iIzZBQ0VGNSIgZD0iTTM0LjcyMywyNS4zNTlIMi41MTFjLTEuMTExLDAtMi4wMTIsMC45MDQtMi4wMTIsMi4wMDl2ODAuNTQyYzAsMS4xMTEsMC45LDIuMDEyLDIuMDEyLDIuMDEyaDE3Ljc3Nw0KCQkJYzEuMTE1LDAsMi4wMTYtMC45LDIuMDE2LTIuMDEyVjg2Ljg0YzAtMS4xMTksMC44OTgtMi4wMTYsMi4wMTYtMi4wMTZoMTAuNDAxYzIwLjU0NCwwLDMyLjMzNC0xMC45MDUsMzIuMzM0LTI5Ljc5OQ0KCQkJQzY3LjA1OCwzNi4yNjQsNTUuMjY3LDI1LjM1OSwzNC43MjMsMjUuMzU5IE0zMi42OTYsNjYuODIyaC04LjM3NWMtMS4xMTksMC0yLjAxNy0wLjkwNS0yLjAxNy0yLjAyVjQ1LjEyNA0KCQkJYzAtMS4xMTUsMC44OTctMi4wMTIsMi4wMTctMi4wMTJoOC4zNzVjOS42MzEsMCwxMi42ODMsNi41OTEsMTIuNjgzLDExLjkxNUM0NS4zNzgsNjAuNjExLDQyLjMyNyw2Ni44MjIsMzIuNjk2LDY2LjgyMiIvPg0KCQk8cGF0aCBmaWxsPSIjNkFDRUY1IiBkPSJNMjczLjQ4NywyNS4zNTlIMTQ5LjgzOWMtMS4xMTIsMC0yLjAxOCwwLjkwNC0yLjAxOCwyLjAwOXY4MC41NDJjMCwxLjExMSwwLjkwNCwyLjAxMiwyLjAxOCwyLjAxMmg1NC45MjgNCgkJCWMxLjExMywwLDIuMDE0LTAuOSwyLjAxNC0yLjAxMlY5NC4wNjRjMC0xLjExMy0wLjg5OS0yLjAyLTIuMDE0LTIuMDJoLTM0LjEzM2MtMC41NTUsMC0xLjAwNS0wLjQ0OS0xLjAwNS0xLjAwOFY3Ny41ODQNCgkJCWMwLTAuNTU1LDAuNDUtMS4wMSwxLjAwNS0xLjAxaDI5LjE4OGMxLjExMSwwLDIuMDEzLTAuODk2LDIuMDEzLTIuMDFWNjAuNzE5YzAtMS4xMTMtMC45LTIuMDItMi4wMTMtMi4wMmgtMjkuMTg4DQoJCQljLTAuNTU1LDAtMS4wMDUtMC40NS0xLjAwNS0xLjAwOFY0NC4xMTVjMC0wLjU1NSwwLjQ1LTEuMDA2LDEuMDA1LTEuMDA2bDU3LjQ1LDAuMDZjMC41NTgsMCwxLjAxNCwwLjQ1MywxLjAxNCwxLjAwN3Y2My43MzMNCgkJCWMwLDEuMTEsMC45MDIsMi4wMTIsMi4wMDksMi4wMTJoMTcuNzgzYzEuMTA5LDAsMi4wMTQtMC44OTksMi4wMTQtMi4wMTJWNDQuMTc4YzAtMC41NTMsMC40NS0xLjAwNywxLjAwOC0xLjAwN2gyMS41NzYNCgkJCWMxLjEwNCwwLDIuMDEzLTAuOTA1LDIuMDEzLTIuMDA5VjI3LjM2OEMyNzUuNDk5LDI2LjI2NCwyNzQuNTkyLDI1LjM1OSwyNzMuNDg3LDI1LjM1OSIvPg0KCQk8cGF0aCBmaWxsPSIjRkVFMTA1IiBkPSJNMTIxLjM3NCw0OC4xODZjLTAuODA5LDIuNTA0LTEuNTcyLDUuMDM5LTIuMjYyLDcuNjI1Yy0wLjE0NCwwLjU0My0wLjI3NywxLjA5OC0wLjQyNiwxLjY0Ng0KCQkJYy02LjQ4LDI4LjAwOC0yLjk2Nyw0Ni4zMTItMS43NDYsNTIuMjczYzAuMjkzLDAuMTI1LDAuNTg2LDAuMTkxLDAuODkxLDAuMTkxaDE2LjQzN2MxLjExMSwwLDIuMDI0LTAuOSwyLjAyNC0yLjAxMlY3Mi42NDgNCgkJCUMxMzYuMjkxLDYwLjk2MywxMzAuOTkzLDUyLjE5MywxMjEuMzc0LDQ4LjE4NiIvPg0KCQk8cGF0aCBmaWxsPSIjRkVFMTA1IiBkPSJNOTcuNDkxLDQ2LjUzM1YyNC41ODVjMC0xLjExMi0wLjkwNy0yLjAyMS0yLjAxMi0yLjAyMUg3Ny42OTRjLTEuMTExLDAtMi4wMTYsMC45MDgtMi4wMTYsMi4wMjF2ODMuMzI2DQoJCQljMCwxLjExLDAuOTA0LDIuMDEyLDIuMDE2LDIuMDEyaDExLjE4NGMwLjUxNSwwLDEuMDAyLTAuMTkyLDEuNDA2LTAuNDkzYzMuMTU2LTI1LjI0OCwxMi41ODgtNDcuMjA3LDIxLjg5Ni02My40NjcNCgkJCWMtMS4yNjQtMC4xMjUtMi41NTgtMC4xODYtMy45MTYtMC4xODZDMTA0Ljg1LDQ1Ljc3NywxMDAuNTM0LDQ2LjAyMSw5Ny40OTEsNDYuNTMzIi8+DQoJCTxwb2x5Z29uIGZpbGw9IiNGRUUxMDUiIHBvaW50cz0iMTA3LjcxMSwxNy40MjggMTIwLjE4NSwyMS45MzggMTM2LjIzMyw4LjU3MiAxMjMuODgsMjMuMTk5IDEzNy4yMjgsMjcuOTA0IDE0Mi4wNCwxLjA2MiAJCSIvPg0KCQk8cG9seWxpbmUgZmlsbD0iI0YyRTkxNiIgcG9pbnRzPSIxMjUuMTA4LDMwLjU4OCAxMjQuNTg3LDI0LjYgMTI5LjE5MiwyNi4yNiAJCSIvPg0KCTwvZz4NCgk8Zz4NCgkJPHBhdGggZmlsbD0iIzZBQ0VGNSIgZD0iTTI1Ny4zMzMsMTA5LjkyMnYtNC44NTFoLTEuODEydi0wLjY0OGg0LjM2djAuNjQ4aC0xLjgydjQuODUxSDI1Ny4zMzN6Ii8+DQoJCTxwYXRoIGZpbGw9IiM2QUNFRjUiIGQ9Ik0yNjAuNjA0LDEwOS45MjJ2LTUuNDk5aDEuMDk4bDEuMzAyLDMuODk0YzAuMTIsMC4zNjMsMC4yMDgsMC42MzYsMC4yNjMsMC44MTUNCgkJCWMwLjA2Mi0wLjIwMiwwLjE2LTAuNDkzLDAuMjkyLTAuODgxbDEuMzE3LTMuODI4aDAuOTc5djUuNDk5aC0wLjcwMXYtNC42MDJsLTEuNTk5LDQuNjAyaC0wLjY1NmwtMS41OTEtNC42ODJ2NC42ODJIMjYwLjYwNHoiLz4NCgk8L2c+DQo8L2c+DQo8L3N2Zz4NCg==";</script>
<script type="text/javascript">!function(){const t="http://www.w3.org/2000/svg";let e=0,n=0;const i=document.createElement("div");i.style.position="fixed",i.style.left="0px",i.style.top="0px",i.style.width="100%",i.style.height="100%",i.style.backgroundColor="black",i.style.zIndex=1e4,i.style["-webkit-transform-origin"]="0 0",i.style["-ms-transform-origin"]="0 0",i.style["transform-origin"]="0 0";const r=document.createElement("div");r.id="splash-container",r.style.position="fixed",r.style.left="0px",r.style.top="0px",r.style["-webkit-transform-origin"]="0 0",r.style["-ms-transform-origin"]="0 0",r.style["transform-origin"]="0 0";const s=document.createElement("img");s.style.display="block",s.alt="";const o=function(){!function(t,i){0===e&&0===n&&(e=i.width,n=i.height);const r=e,s=n,o=window.innerHeight,d=window.innerWidth,l=d/r,a=o/s,c=.2605*Math.min(l,a),p=`translate(${Math.round((d-r*c)/2)}px, ${Math.round(.435*(o-s*c))}px) scale3d(${c}, ${c}, 1)`;t.style["-webkit-transform"]=p,t.style["-ms-transform"]=p,t.style.transform=p}(r,s)};s.onload=function(){o(),window.addEventListener("resize",o),window.addEventListener("load",o);const t=document.getElementById("splash-container");t&&t.parentNode.removeChild(t),i.appendChild(r),document.body.appendChild(i)};const d=document.createElement("div");d.setAttribute("style","width:273px;height:10px"),d.style.display="block";const l=document.createElementNS(t,"svg");l.style.marginTop="25px",l.setAttribute("width",275);const a=document.createElementNS(t,"defs");l.appendChild(a);const c=document.createElementNS(t,"linearGradient");function p(e,n){const i=document.createElementNS(t,"stop");return i.offset=e,i.setAttribute("offset",e),i.setAttribute("stop-color",n),i}c.id="phetioGradient",c.setAttribute("gradientTransform","rotate(10)"),a.appendChild(c),c.appendChild(p("0%","#992995")),c.appendChild(p("50%","#e01e5a")),c.appendChild(p("100%","#f15a24"));const h=document.createElementNS(t,"clipPath");h.id="progressBarClip";const u=document.createElementNS(t,"rect");h.appendChild(u),u.id="progressBarClipArea",u.setAttribute("x","1"),u.setAttribute("y","1"),u.setAttribute("width","0"),u.setAttribute("height","10"),u.setAttribute("rx","3"),u.setAttribute("ry","3"),a.appendChild(h),l.style["margin-left"]="-1px";const m=document.createElementNS(t,"rect");m.setAttribute("id","progressBarBackground"),m.setAttribute("x","1"),m.setAttribute("y","1"),m.setAttribute("width","273"),m.setAttribute("height","10"),m.setAttribute("rx","3"),m.setAttribute("ry","3"),m.setAttribute("style","stroke: white;stroke-width:1");const w=document.createElementNS(t,"rect");w.setAttribute("id","progressBarForeground"),w.setAttribute("x","1"),w.setAttribute("y","1"),w.setAttribute("width","0"),w.setAttribute("height","10"),w.setAttribute("rx","3"),w.setAttribute("ry","3"),w.setAttribute("style","fill:#6acef5;"),l.appendChild(m),l.appendChild(w);const A=setInterval(()=>{m.style["stroke-width"]=(.55*Math.sin(Date.now()/1e3*4)+1).toFixed(2)},16);if(window.phetSplashScreenDownloadComplete=function(t){return clearInterval(A),m.style["stroke-width"]=1,"phet-io"===t&&(w.setAttribute("style","fill:url(#phetioGradient); clip-path:url(#progressBarClip);"),w.setAttribute("width","273")),"273"},r.appendChild(s),r.appendChild(l),window.PHET_SPLASH_DATA_URI)s.src=window.PHET_SPLASH_DATA_URI;else{const t=location.search.match(/brand=([^&]+)/),e=t?decodeURIComponent(t[1]):"adapted-from-phet";s.src=`../brand/${e}/images/splash.svg`}const b=t=>t.preventDefault(),y=["wheel","touchstart","gesturestart"];y.forEach(t=>window.addEventListener(t,b,{passive:!1})),window.phetSplashScreen={dispose:function(){window.PHET_SPLASH_DATA_URI&&delete window.PHET_SPLASH_DATA_URI,window.removeEventListener("resize",o),window.removeEventListener("load",o),y.forEach(t=>window.removeEventListener(t,b)),document.body.removeChild(i),delete window.phetSplashScreen}}}();</script>
<script type="text/javascript">/*!
 * jQuery JavaScript Library v2.1.0
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2014-01-23T21:10Z
 */
!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){var n=[],r=n.slice,i=n.concat,o=n.push,s=n.indexOf,a={},u=a.toString,l=a.hasOwnProperty,c="".trim,f={},p=e.document,d=function(e,t){return new d.fn.init(e,t)},h=/^-ms-/,g=/-([\da-z])/gi,m=function(e,t){return t.toUpperCase()};function v(e){var t=e.length,n=d.type(e);return"function"!==n&&!d.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}d.fn=d.prototype={jquery:"2.1.0",constructor:d,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=d.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return d.each(this,e,t)},map:function(e){return this.pushStack(d.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:o,sort:n.sort,splice:n.splice},d.extend=d.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[a]||{},a++),"object"==typeof s||d.isFunction(s)||(s={}),a===u&&(s=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],s!==(r=e[t])&&(l&&r&&(d.isPlainObject(r)||(i=d.isArray(r)))?(i?(i=!1,o=n&&d.isArray(n)?n:[]):o=n&&d.isPlainObject(n)?n:{},s[t]=d.extend(l,o,r)):void 0!==r&&(s[t]=r));return s},d.extend({expando:"jQuery"+("2.1.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===d.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return e-parseFloat(e)>=0},isPlainObject:function(e){if("object"!==d.type(e)||e.nodeType||d.isWindow(e))return!1;try{if(e.constructor&&!l.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?a[u.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=d.trim(e))&&(1===e.indexOf("use strict")?((t=p.createElement("script")).text=e,p.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(h,"ms-").replace(g,m)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,i=e.length,o=v(e);if(n){if(o)for(;r<i&&!1!==t.apply(e[r],n);r++);else for(r in e)if(!1===t.apply(e[r],n))break}else if(o)for(;r<i&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":c.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(v(Object(e))?d.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,o=0,s=e.length,a=[];if(v(e))for(;o<s;o++)null!=(r=t(e[o],o,n))&&a.push(r);else for(o in e)null!=(r=t(e[o],o,n))&&a.push(r);return i.apply([],a)},guid:1,proxy:function(e,t){var n,i,o;if("string"==typeof t&&(n=e[t],t=e,e=n),d.isFunction(e))return i=r.call(arguments,2),(o=function(){return e.apply(t||this,i.concat(r.call(arguments)))}).guid=e.guid=e.guid||d.guid++,o},now:Date.now,support:f}),d.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),(function(e,t){a["[object "+t+"]"]=t.toLowerCase()}));var y=
/*!
 * Sizzle CSS Selector Engine v1.10.16
 * http://sizzlejs.com/
 *
 * Copyright 2013 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2014-01-13
 */
function(e){var t,n,r,i,o,s,a,u,l,c,f,p,d,h,g,m,v,y="sizzle"+-new Date,x=e.document,b=0,w=0,T=te(),C=te(),N=te(),k=function(e,t){return e===t&&(l=!0),0},E={}.hasOwnProperty,D=[],j=D.pop,S=D.push,A=D.push,L=D.slice,q=D.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",P=F.replace("w","w#"),M="\\["+O+"*("+F+")"+O+"*(?:([*^$|!~]?=)"+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+P+")|)|)"+O+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+M.replace(3,8)+")*)|.*)\\)|)",W=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),$=new RegExp("^"+O+"*,"+O+"*"),B=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),I=new RegExp("="+O+"*([^\\]'\"]*?)"+O+"*\\]","g"),_=new RegExp(R),X=new RegExp("^"+P+"$"),z={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},U=/^(?:input|select|textarea|button)$/i,V=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,J=/'|\\/g,K=new RegExp("\\\\([\\da-f]{1,6}"+O+"?|("+O+")|.)","ig"),Z=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{A.apply(D=L.call(x.childNodes),x.childNodes),D[x.childNodes.length].nodeType}catch(ye){A={apply:D.length?function(e,t){S.apply(e,L.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function ee(e,t,i,o){var a,u,l,p,g,m,b,w,T,C;if((t?t.ownerDocument||t:x)!==f&&c(t),i=i||[],!e||"string"!=typeof e)return i;if(1!==(p=(t=t||f).nodeType)&&9!==p)return[];if(d&&!o){if(a=G.exec(e))if(l=a[1]){if(9===p){if(!(u=t.getElementById(l))||!u.parentNode)return i;if(u.id===l)return i.push(u),i}else if(t.ownerDocument&&(u=t.ownerDocument.getElementById(l))&&v(t,u)&&u.id===l)return i.push(u),i}else{if(a[2])return A.apply(i,t.getElementsByTagName(e)),i;if((l=a[3])&&n.getElementsByClassName&&t.getElementsByClassName)return A.apply(i,t.getElementsByClassName(l)),i}if(n.qsa&&(!h||!h.test(e))){if(w=b=y,T=t,C=9===p&&e,1===p&&"object"!==t.nodeName.toLowerCase()){for(m=fe(e),(b=t.getAttribute("id"))?w=b.replace(J,"\\$&"):t.setAttribute("id",w),w="[id='"+w+"'] ",g=m.length;g--;)m[g]=w+pe(m[g]);T=Q.test(e)&&le(t.parentNode)||t,C=m.join(",")}if(C)try{return A.apply(i,T.querySelectorAll(C)),i}catch(N){}finally{b||t.removeAttribute("id")}}}return function(e,t,i,o){var a,u,l,c,f,p=fe(e);if(!o&&1===p.length){if((u=p[0]=p[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&n.getById&&9===t.nodeType&&d&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(K,Z),t)||[])[0]))return i;e=e.slice(u.shift().value.length)}for(a=z.needsContext.test(e)?0:u.length;a--&&(l=u[a],!r.relative[c=l.type]);)if((f=r.find[c])&&(o=f(l.matches[0].replace(K,Z),Q.test(u[0].type)&&le(t.parentNode)||t))){if(u.splice(a,1),!(e=o.length&&pe(u)))return A.apply(i,o),i;break}}return s(e,p)(o,t,!d,i,Q.test(e)&&le(t.parentNode)||t),i}(e.replace(W,"$1"),t,i,o)}function te(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ne(e){return e[y]=!0,e}function re(e){var t=f.createElement("div");try{return!!e(t)}catch(ye){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ie(e,t){for(var n=e.split("|"),i=e.length;i--;)r.attrHandle[n[i]]=t}function oe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function se(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ae(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ue(e){return ne((function(t){return t=+t,ne((function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function le(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ee.support={},o=ee.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},c=ee.setDocument=function(e){var t,i=e?e.ownerDocument||e:x,s=i.defaultView;return i!==f&&9===i.nodeType&&i.documentElement?(f=i,p=i.documentElement,d=!o(i),s&&s!==s.top&&(s.addEventListener?s.addEventListener("unload",(function(){c()}),!1):s.attachEvent&&s.attachEvent("onunload",(function(){c()}))),n.attributes=re((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=re((function(e){return e.appendChild(i.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Y.test(i.getElementsByClassName)&&re((function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length})),n.getById=re((function(e){return p.appendChild(e).id=y,!i.getElementsByName||!i.getElementsByName(y).length})),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(K,Z);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(K,Z);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){if(void 0!==t.getElementsByTagName)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=Y.test(i.querySelectorAll))&&(re((function(e){e.innerHTML="<select t=''><option selected=''></option></select>",e.querySelectorAll("[t^='']").length&&h.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+O+"*(?:value|"+H+")"),e.querySelectorAll(":checked").length||h.push(":checked")})),re((function(e){var t=i.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+O+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")}))),(n.matchesSelector=Y.test(m=p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&re((function(e){n.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)})),h=h.length&&new RegExp(h.join("|")),g=g.length&&new RegExp(g.join("|")),t=Y.test(p.compareDocumentPosition),v=t||Y.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return l=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===i||e.ownerDocument===x&&v(x,e)?-1:t===i||t.ownerDocument===x&&v(x,t)?1:u?q.call(u,e)-q.call(u,t):0:4&r?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,o=e.parentNode,s=t.parentNode,a=[e],c=[t];if(!o||!s)return e===i?-1:t===i?1:o?-1:s?1:u?q.call(u,e)-q.call(u,t):0;if(o===s)return oe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;a[r]===c[r];)r++;return r?oe(a[r],c[r]):a[r]===x?-1:c[r]===x?1:0},i):f},ee.matches=function(e,t){return ee(e,null,null,t)},ee.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&c(e),t=t.replace(I,"='$1']"),n.matchesSelector&&d&&(!g||!g.test(t))&&(!h||!h.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(ye){}return ee(t,f,null,[e]).length>0},ee.contains=function(e,t){return(e.ownerDocument||e)!==f&&c(e),v(e,t)},ee.attr=function(e,t){(e.ownerDocument||e)!==f&&c(e);var i=r.attrHandle[t.toLowerCase()],o=i&&E.call(r.attrHandle,t.toLowerCase())?i(e,t,!d):void 0;return void 0!==o?o:n.attributes||!d?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ee.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ee.uniqueSort=function(e){var t,r=[],i=0,o=0;if(l=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(k),l){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return u=null,e},i=ee.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=ee.selectors={cacheLength:50,createPseudo:ne,match:z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(K,Z),e[3]=(e[4]||e[5]||"").replace(K,Z),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ee.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ee.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return z.CHILD.test(e[0])?null:(e[3]&&void 0!==e[4]?e[2]=e[4]:n&&_.test(n)&&(t=fe(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(K,Z).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&T(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=ee.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&x){for(d=(l=(c=m[y]||(m[y]={}))[e]||[])[0]===b&&l[1],p=l[0]===b&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[b,d,p];break}}else if(x&&(l=(t[y]||(t[y]={}))[e])&&l[0]===b)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++p||(x&&((f[y]||(f[y]={}))[e]=[b,p]),f!==t)););return(p-=i)===r||p%r==0&&p/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ee.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ne((function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=q.call(e,o[s])]=!(n[r]=o[s])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ne((function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[y]?ne((function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}})),has:ne((function(e){return function(t){return ee(e,t).length>0}})),contains:ne((function(e){return function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}})),lang:ne((function(e){return X.test(e||"")||ee.error("unsupported lang: "+e),e=e.replace(K,Z).toLowerCase(),function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return V.test(e.nodeName)},input:function(e){return U.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ue((function(){return[0]})),last:ue((function(e,t){return[t-1]})),eq:ue((function(e,t,n){return[n<0?n+t:n]})),even:ue((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ue((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ue((function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e})),gt:ue((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=se(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ae(t);function ce(){}function fe(e,t){var n,i,o,s,a,u,l,c=C[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],l=r.preFilter;a;){for(s in n&&!(i=$.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=B.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(W," ")}),a=a.slice(n.length)),r.filter)!(i=z[s].exec(a))||l[s]&&!(i=l[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ee.error(e):C(e,u).slice(0)}function pe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function de(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=w++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,s){var a,u,l=[b,o];if(s){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((a=(u=t[y]||(t[y]={}))[r])&&a[0]===b&&a[1]===o)return l[2]=a[2];if(u[r]=l,l[2]=e(t,n,s))return!0}}}function he(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function ge(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),l&&t.push(a)));return s}function me(e,t,n,r,i,o){return r&&!r[y]&&(r=me(r)),i&&!i[y]&&(i=me(i,o)),ne((function(o,s,a,u){var l,c,f,p=[],d=[],h=s.length,g=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)ee(e,t[r],n);return n}(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:ge(g,p,e,a,u),v=n?i||(o?e:h||r)?[]:s:m;if(n&&n(m,v,a,u),r)for(l=ge(v,d),r(l,[],a,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(m[d[c]]=f));if(o){if(i||e){if(i){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(m[c]=f);i(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=i?q.call(o,f):p[c])>-1&&(o[l]=!(s[l]=f))}}else v=ge(v===s?v.splice(h,v.length):v),i?i(null,s,v,u):A.apply(s,v)}))}function ve(e){for(var t,n,i,o=e.length,s=r.relative[e[0].type],u=s||r.relative[" "],l=s?1:0,c=de((function(e){return e===t}),u,!0),f=de((function(e){return q.call(t,e)>-1}),u,!0),p=[function(e,n,r){return!s&&(r||n!==a)||((t=n).nodeType?c(e,n,r):f(e,n,r))}];l<o;l++)if(n=r.relative[e[l].type])p=[de(he(p),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[y]){for(i=++l;i<o&&!r.relative[e[i].type];i++);return me(l>1&&he(p),l>1&&pe(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(W,"$1"),n,l<i&&ve(e.slice(l,i)),i<o&&ve(e=e.slice(i)),i<o&&pe(e))}p.push(n)}return he(p)}return ce.prototype=r.filters=r.pseudos,r.setFilters=new ce,s=ee.compile=function(e,t){var n,i=[],o=[],s=N[e+" "];if(!s){for(t||(t=fe(e)),n=t.length;n--;)(s=ve(t[n]))[y]?i.push(s):o.push(s);s=N(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,s,u,l,c){var p,d,h,g=0,m="0",v=o&&[],y=[],x=a,w=o||i&&r.find.TAG("*",c),T=b+=null==x?1:Math.random()||.1,C=w.length;for(c&&(a=s!==f&&s);m!==C&&null!=(p=w[m]);m++){if(i&&p){for(d=0;h=e[d++];)if(h(p,s,u)){l.push(p);break}c&&(b=T)}n&&((p=!h&&p)&&g--,o&&v.push(p))}if(g+=m,n&&m!==g){for(d=0;h=t[d++];)h(v,y,s,u);if(o){if(g>0)for(;m--;)v[m]||y[m]||(y[m]=j.call(l));y=ge(y)}A.apply(l,y),c&&!o&&y.length>0&&g+t.length>1&&ee.uniqueSort(l)}return c&&(b=T,a=x),v};return n?ne(o):o}(o,i))}return s},n.sortStable=y.split("").sort(k).join("")===y,n.detectDuplicates=!!l,c(),n.sortDetached=re((function(e){return 1&e.compareDocumentPosition(f.createElement("div"))})),re((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||ie("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&re((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||ie("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),re((function(e){return null==e.getAttribute("disabled")}))||ie(H,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),ee}(e);d.find=y,d.expr=y.selectors,d.expr[":"]=d.expr.pseudos,d.unique=y.uniqueSort,d.text=y.getText,d.isXMLDoc=y.isXML,d.contains=y.contains;var x=d.expr.match.needsContext,b=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function T(e,t,n){if(d.isFunction(t))return d.grep(e,(function(e,r){return!!t.call(e,r,e)!==n}));if(t.nodeType)return d.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(w.test(t))return d.filter(t,e,n);t=d.filter(t,e)}return d.grep(e,(function(e){return s.call(t,e)>=0!==n}))}d.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?d.find.matchesSelector(r,e)?[r]:[]:d.find.matches(e,d.grep(t,(function(e){return 1===e.nodeType})))},d.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(d(e).filter((function(){for(t=0;t<n;t++)if(d.contains(i[t],this))return!0})));for(t=0;t<n;t++)d.find(e,i[t],r);return(r=this.pushStack(n>1?d.unique(r):r)).selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&x.test(e)?d(e):e||[],!1).length}});var C,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(d.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:N.exec(e))||!n[1]&&t)return!t||t.jquery?(t||C).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof d?t[0]:t,d.merge(this,d.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:p,!0)),b.test(n[1])&&d.isPlainObject(t))for(n in t)d.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(r=p.getElementById(n[2]))&&r.parentNode&&(this.length=1,this[0]=r),this.context=p,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):d.isFunction(e)?void 0!==C.ready?C.ready(e):e(d):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),d.makeArray(e,this))}).prototype=d.fn,C=d(p);var k=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};function D(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}d.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&d(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),d.fn.extend({has:function(e){var t=d(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(d.contains(this,t[e]))return!0}))},closest:function(e,t){for(var n,r=0,i=this.length,o=[],s=x.test(e)||"string"!=typeof e?d(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&d.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?d.unique(o):o)},index:function(e){return e?"string"==typeof e?s.call(d(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(d.unique(d.merge(this.get(),d(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),d.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d.dir(e,"parentNode")},parentsUntil:function(e,t,n){return d.dir(e,"parentNode",n)},next:function(e){return D(e,"nextSibling")},prev:function(e){return D(e,"previousSibling")},nextAll:function(e){return d.dir(e,"nextSibling")},prevAll:function(e){return d.dir(e,"previousSibling")},nextUntil:function(e,t,n){return d.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return d.dir(e,"previousSibling",n)},siblings:function(e){return d.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return d.sibling(e.firstChild)},contents:function(e){return e.contentDocument||d.merge([],e.childNodes)}},(function(e,t){d.fn[e]=function(n,r){var i=d.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=d.filter(r,i)),this.length>1&&(E[e]||d.unique(i),k.test(e)&&i.reverse()),this.pushStack(i)}}));var j,S=/\S+/g,A={};function L(){p.removeEventListener("DOMContentLoaded",L,!1),e.removeEventListener("load",L,!1),d.ready()}d.Callbacks=function(e){e="string"==typeof e?A[e]||function(e){var t=A[e]={};return d.each(e.match(S)||[],(function(e,n){t[n]=!0})),t}(e):d.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(f){for(t=e.memory&&f,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&s<o;s++)if(!1===a[s].apply(f[0],f[1])&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;!function t(n){d.each(n,(function(n,r){var i=d.type(r);"function"===i?e.unique&&c.has(r)||a.push(r):r&&r.length&&"string"!==i&&t(r)}))}(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&d.each(arguments,(function(e,t){for(var n;(n=d.inArray(t,a,n))>-1;)a.splice(n,1),r&&(n<=o&&o--,n<=s&&s--)})),this},has:function(e){return e?d.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=void 0,this},disabled:function(){return!a},lock:function(){return u=void 0,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!a||n&&!u||(t=[e,(t=t||[]).slice?t.slice():t],r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},d.extend({Deferred:function(e){var t=[["resolve","done",d.Callbacks("once memory"),"resolved"],["reject","fail",d.Callbacks("once memory"),"rejected"],["notify","progress",d.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return d.Deferred((function(n){d.each(t,(function(t,o){var s=d.isFunction(e[t])&&e[t];i[o[1]]((function(){var e=s&&s.apply(this,arguments);e&&d.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,s?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?d.extend(e,r):r}},i={};return r.pipe=r.then,d.each(t,(function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add((function(){n=a}),t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith})),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,i,o=0,s=r.call(arguments),a=s.length,u=1!==a||e&&d.isFunction(e.promise)?a:0,l=1===u?e:d.Deferred(),c=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?r.call(arguments):o,i===t?l.notifyWith(n,i):--u||l.resolveWith(n,i)}};if(a>1)for(t=new Array(a),n=new Array(a),i=new Array(a);o<a;o++)s[o]&&d.isFunction(s[o].promise)?s[o].promise().done(c(o,i,s)).fail(l.reject).progress(c(o,n,t)):--u;return u||l.resolveWith(i,s),l.promise()}}),d.fn.ready=function(e){return d.ready.promise().done(e),this},d.extend({isReady:!1,readyWait:1,holdReady:function(e){e?d.readyWait++:d.ready(!0)},ready:function(e){(!0===e?--d.readyWait:d.isReady)||(d.isReady=!0,!0!==e&&--d.readyWait>0||(j.resolveWith(p,[d]),d.fn.trigger&&d(p).trigger("ready").off("ready")))}}),d.ready.promise=function(t){return j||(j=d.Deferred(),"complete"===p.readyState?setTimeout(d.ready):(p.addEventListener("DOMContentLoaded",L,!1),e.addEventListener("load",L,!1))),j.promise(t)},d.ready.promise();var q=d.access=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===d.type(n))for(a in i=!0,n)d.access(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,d.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(d(e),n)})),t))for(;a<u;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o};function H(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=d.expando+Math.random()}d.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},H.uid=1,H.accepts=d.acceptData,H.prototype={key:function(e){if(!H.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=H.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,d.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(d.isEmptyObject(o))d.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?void 0!==(r=this.get(e,t))?r:this.get(e,d.camelCase(t)):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),s=this.cache[o];if(void 0===t)this.cache[o]={};else{d.isArray(t)?r=t.concat(t.map(d.camelCase)):(i=d.camelCase(t),r=t in s?[t,i]:(r=i)in s?[r]:r.match(S)||[]),n=r.length;for(;n--;)delete s[r[n]]}},hasData:function(e){return!d.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var O=new H,F=new H,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,M=/([A-Z])/g;function R(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(M,"-$1").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:P.test(n)?d.parseJSON(n):n)}catch(i){}F.set(e,t,n)}else n=void 0;return n}d.extend({hasData:function(e){return F.hasData(e)||O.hasData(e)},data:function(e,t,n){return F.access(e,t,n)},removeData:function(e,t){F.remove(e,t)},_data:function(e,t,n){return O.access(e,t,n)},_removeData:function(e,t){O.remove(e,t)}}),d.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=F.get(o),1===o.nodeType&&!O.get(o,"hasDataAttrs"))){for(n=s.length;n--;)0===(r=s[n].name).indexOf("data-")&&(r=d.camelCase(r.slice(5)),R(o,r,i[r]));O.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){F.set(this,e)})):q(this,(function(t){var n,r=d.camelCase(e);if(o&&void 0===t)return void 0!==(n=F.get(o,e))||void 0!==(n=F.get(o,r))||void 0!==(n=R(o,r,void 0))?n:void 0;this.each((function(){var n=F.get(this,r);F.set(this,r,t),-1!==e.indexOf("-")&&void 0!==n&&F.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){F.remove(this,e)}))}}),d.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=O.get(e,t),n&&(!r||d.isArray(n)?r=O.access(e,t,d.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=d.queue(e,t),r=n.length,i=n.shift(),o=d._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){d.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return O.get(e,n)||O.access(e,n,{empty:d.Callbacks("once memory").add((function(){O.remove(e,[t+"queue",n])}))})}}),d.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?d.queue(this[0],e):void 0===t?this:this.each((function(){var n=d.queue(this,e,t);d._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&d.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){d.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=d.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=O.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var W,$=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,B=["Top","Right","Bottom","Left"],I=function(e,t){return e=t||e,"none"===d.css(e,"display")||!d.contains(e.ownerDocument,e)},_=/^(?:checkbox|radio)$/i;(W=p.createDocumentFragment().appendChild(p.createElement("div"))).innerHTML="<input type='radio' checked='checked' name='t'/>",f.checkClone=W.cloneNode(!0).cloneNode(!0).lastChild.checked,W.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!W.cloneNode(!0).lastChild.defaultValue;f.focusinBubbles="onfocusin"in e;var X=/^key/,z=/^(?:mouse|contextmenu)|click/,U=/^(?:focusinfocus|focusoutblur)$/,V=/^([^.]*)(?:\.(.+)|)$/;function Y(){return!0}function G(){return!1}function Q(){try{return p.activeElement}catch(e){}}d.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,h,g,m,v=O.get(e);if(v)for(n.handler&&(n=(o=n).handler,i=o.selector),n.guid||(n.guid=d.guid++),(u=v.events)||(u=v.events={}),(s=v.handle)||(s=v.handle=function(t){return void 0!==d&&d.event.triggered!==t.type?d.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(S)||[""]).length;l--;)h=m=(a=V.exec(t[l])||[])[1],g=(a[2]||"").split(".").sort(),h&&(f=d.event.special[h]||{},h=(i?f.delegateType:f.bindType)||h,f=d.event.special[h]||{},c=d.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&d.expr.match.needsContext.test(i),namespace:g.join(".")},o),(p=u[h])||((p=u[h]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,g,s)||e.addEventListener&&e.addEventListener(h,s,!1)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),d.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,h,g,m,v=O.hasData(e)&&O.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(S)||[""]).length;l--;)if(h=m=(a=V.exec(t[l])||[])[1],g=(a[2]||"").split(".").sort(),h){for(f=d.event.special[h]||{},p=u[h=(r?f.delegateType:f.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;o--;)c=p[o],!i&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));s&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,g,v.handle)||d.removeEvent(e,h,v.handle),delete u[h])}else for(h in u)d.event.remove(e,h+t[l],n,r,!0);d.isEmptyObject(u)&&(delete v.handle,O.remove(e,"events"))}},trigger:function(t,n,r,i){var o,s,a,u,c,f,h,g=[r||p],m=l.call(t,"type")?t.type:t,v=l.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||p,3!==r.nodeType&&8!==r.nodeType&&!U.test(m+d.event.triggered)&&(m.indexOf(".")>=0&&(v=m.split("."),m=v.shift(),v.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[d.expando]?t:new d.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:d.makeArray(n,[t]),h=d.event.special[m]||{},i||!h.trigger||!1!==h.trigger.apply(r,n))){if(!i&&!h.noBubble&&!d.isWindow(r)){for(u=h.delegateType||m,U.test(u+m)||(s=s.parentNode);s;s=s.parentNode)g.push(s),a=s;a===(r.ownerDocument||p)&&g.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=g[o++])&&!t.isPropagationStopped();)t.type=o>1?u:h.bindType||m,(f=(O.get(s,"events")||{})[t.type]&&O.get(s,"handle"))&&f.apply(s,n),(f=c&&s[c])&&f.apply&&d.acceptData(s)&&(t.result=f.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(g.pop(),n)||!d.acceptData(r)||c&&d.isFunction(r[m])&&!d.isWindow(r)&&((a=r[c])&&(r[c]=null),d.event.triggered=m,r[m](),d.event.triggered=void 0,a&&(r[c]=a)),t.result}},dispatch:function(e){e=d.event.fix(e);var t,n,i,o,s,a=[],u=r.call(arguments),l=(O.get(this,"events")||{})[e.type]||[],c=d.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(a=d.event.handlers.call(this,e,l),t=0;(o=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,n=0;(s=o.handlers[n++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(s.namespace)||(e.handleObj=s,e.data=s.data,void 0!==(i=((d.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,u))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(!0!==u.disabled||"click"!==e.type){for(r=[],n=0;n<a;n++)void 0===r[i=(o=t[n]).selector+" "]&&(r[i]=o.needsContext?d(i,this).index(u)>=0:d.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return a<t.length&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&&null!=t.clientX&&(r=(n=e.target.ownerDocument||p).documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[d.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=z.test(i)?this.mouseHooks:X.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new d.Event(o),t=r.length;t--;)e[n=r[t]]=o[n];return e.target||(e.target=p),3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Q()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Q()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&d.nodeName(this,"input"))return this.click(),!1},_default:function(e){return d.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=d.extend(new d.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?d.event.trigger(i,null,t):d.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},d.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},d.Event=function(e,t){if(!(this instanceof d.Event))return new d.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.getPreventDefault&&e.getPreventDefault()?Y:G):this.type=e,t&&d.extend(this,t),this.timeStamp=e&&e.timeStamp||d.now(),this[d.expando]=!0},d.Event.prototype={isDefaultPrevented:G,isPropagationStopped:G,isImmediatePropagationStopped:G,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Y,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Y,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Y,this.stopPropagation()}},d.each({mouseenter:"mouseover",mouseleave:"mouseout"},(function(e,t){d.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||d.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),f.focusinBubbles||d.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){d.event.simulate(t,e.target,d.event.fix(e),!0)};d.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=O.access(r,t);i||r.addEventListener(e,n,!0),O.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=O.access(r,t)-1;i?O.access(r,t,i):(r.removeEventListener(e,n,!0),O.remove(r,t))}}})),d.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){for(s in"string"!=typeof t&&(n=n||t,t=void 0),e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),!1===r)r=G;else if(!r)return this;return 1===i&&(o=r,(r=function(e){return d().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=d.guid++)),this.each((function(){d.event.add(this,e,r,n,t)}))},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,d(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=G),this.each((function(){d.event.remove(this,e,n,t)}))},trigger:function(e,t){return this.each((function(){d.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return d.event.trigger(e,t,n,!0)}});var J=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,K=/<([\w:]+)/,Z=/<|&#?\w+;/,ee=/<(?:script|style|link)/i,te=/checked\s*(?:[^=]|=\s*.checked.)/i,ne=/^$|\/(?:java|ecma)script/i,re=/^true\/(.*)/,ie=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,oe={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function se(e,t){return d.nodeName(e,"table")&&d.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ae(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ue(e){var t=re.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function le(e,t){for(var n=0,r=e.length;n<r;n++)O.set(e[n],"globalEval",!t||O.get(t[n],"globalEval"))}function ce(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(O.hasData(e)&&(o=O.access(e),s=O.set(t,o),l=o.events))for(i in delete s.handle,s.events={},l)for(n=0,r=l[i].length;n<r;n++)d.event.add(t,i,l[i][n]);F.hasData(e)&&(a=F.access(e),u=d.extend({},a),F.set(t,u))}}function fe(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&d.nodeName(e,t)?d.merge([e],n):n}oe.optgroup=oe.option,oe.tbody=oe.tfoot=oe.colgroup=oe.caption=oe.thead,oe.th=oe.td,d.extend({clone:function(e,t,n){var r,i,o,s,a,u,l,c=e.cloneNode(!0),p=d.contains(e.ownerDocument,e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||d.isXMLDoc(e)))for(s=fe(c),r=0,i=(o=fe(e)).length;r<i;r++)a=o[r],u=s[r],l=void 0,"input"===(l=u.nodeName.toLowerCase())&&_.test(a.type)?u.checked=a.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=a.defaultValue);if(t)if(n)for(o=o||fe(e),s=s||fe(c),r=0,i=o.length;r<i;r++)ce(o[r],s[r]);else ce(e,c);return(s=fe(c,"script")).length>0&&le(s,!p&&fe(e,"script")),c},buildFragment:function(e,t,n,r){for(var i,o,s,a,u,l,c=t.createDocumentFragment(),f=[],p=0,h=e.length;p<h;p++)if((i=e[p])||0===i)if("object"===d.type(i))d.merge(f,i.nodeType?[i]:i);else if(Z.test(i)){for(o=o||c.appendChild(t.createElement("div")),s=(K.exec(i)||["",""])[1].toLowerCase(),a=oe[s]||oe._default,o.innerHTML=a[1]+i.replace(J,"<$1></$2>")+a[2],l=a[0];l--;)o=o.lastChild;d.merge(f,o.childNodes),(o=c.firstChild).textContent=""}else f.push(t.createTextNode(i));for(c.textContent="",p=0;i=f[p++];)if((!r||-1===d.inArray(i,r))&&(u=d.contains(i.ownerDocument,i),o=fe(c.appendChild(i),"script"),u&&le(o),n))for(l=0;i=o[l++];)ne.test(i.type||"")&&n.push(i);return c},cleanData:function(e){for(var t,n,r,i,o,s,a=d.event.special,u=0;void 0!==(n=e[u]);u++){if(d.acceptData(n)&&(o=n[O.expando])&&(t=O.cache[o])){if((r=Object.keys(t.events||{})).length)for(s=0;void 0!==(i=r[s]);s++)a[i]?d.event.remove(n,i):d.removeEvent(n,i,t.handle);O.cache[o]&&delete O.cache[o]}delete F.cache[n[F.expando]]}}}),d.fn.extend({text:function(e){return q(this,(function(e){return void 0===e?d.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return this.domManip(arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||se(this,e).appendChild(e)}))},prepend:function(){return this.domManip(arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=se(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return this.domManip(arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return this.domManip(arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},remove:function(e,t){for(var n,r=e?d.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||d.cleanData(fe(n)),n.parentNode&&(t&&d.contains(n.ownerDocument,n)&&le(fe(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(d.cleanData(fe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return d.clone(this,e,t)}))},html:function(e){return q(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ee.test(e)&&!oe[(K.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(J,"<$1></$2>");try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(d.cleanData(fe(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,(function(t){e=this.parentNode,d.cleanData(fe(this)),e&&e.replaceChild(t,this)})),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=i.apply([],e);var n,r,o,s,a,u,l=0,c=this.length,p=this,h=c-1,g=e[0],m=d.isFunction(g);if(m||c>1&&"string"==typeof g&&!f.checkClone&&te.test(g))return this.each((function(n){var r=p.eq(n);m&&(e[0]=g.call(this,n,r.html())),r.domManip(e,t)}));if(c&&(r=(n=d.buildFragment(e,this[0].ownerDocument,!1,this)).firstChild,1===n.childNodes.length&&(n=r),r)){for(s=(o=d.map(fe(n,"script"),ae)).length;l<c;l++)a=n,l!==h&&(a=d.clone(a,!0,!0),s&&d.merge(o,fe(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,d.map(o,ue),l=0;l<s;l++)a=o[l],ne.test(a.type||"")&&!O.access(a,"globalEval")&&d.contains(u,a)&&(a.src?d._evalUrl&&d._evalUrl(a.src):d.globalEval(a.textContent.replace(ie,"")))}return this}}),d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){d.fn[e]=function(e){for(var n,r=[],i=d(e),s=i.length-1,a=0;a<=s;a++)n=a===s?this:this.clone(!0),d(i[a])[t](n),o.apply(r,n.get());return this.pushStack(r)}}));var pe,de={};function he(t,n){var r=d(n.createElement(t)).appendTo(n.body),i=e.getDefaultComputedStyle?e.getDefaultComputedStyle(r[0]).display:d.css(r[0],"display");return r.detach(),i}function ge(e){var t=p,n=de[e];return n||("none"!==(n=he(e,t))&&n||((t=(pe=(pe||d("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=he(e,t),pe.detach()),de[e]=n),n}var me=/^margin/,ve=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),ye=function(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)};function xe(e,t,n){var r,i,o,s,a=e.style;return(n=n||ye(e))&&(s=n.getPropertyValue(t)||n[t]),n&&(""!==s||d.contains(e.ownerDocument,e)||(s=d.style(e,t)),ve.test(s)&&me.test(t)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o)),void 0!==s?s+"":s}function be(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){var t,n,r=p.documentElement,i=p.createElement("div"),o=p.createElement("div");function s(){o.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",r.appendChild(i);var s=e.getComputedStyle(o,null);t="1%"!==s.top,n="4px"===s.width,r.removeChild(i)}o.style.backgroundClip="content-box",o.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===o.style.backgroundClip,i.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",i.appendChild(o),e.getComputedStyle&&d.extend(f,{pixelPosition:function(){return s(),t},boxSizingReliable:function(){return null==n&&s(),n},reliableMarginRight:function(){var t,n=o.appendChild(p.createElement("div"));return n.style.cssText=o.style.cssText="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",n.style.marginRight=n.style.width="0",o.style.width="1px",r.appendChild(i),t=!parseFloat(e.getComputedStyle(n,null).marginRight),r.removeChild(i),o.innerHTML="",t}})}(),d.swap=function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=s[o];return i};var we=/^(none|table(?!-c[ea]).+)/,Te=new RegExp("^("+$+")(.*)$","i"),Ce=new RegExp("^([+-])=("+$+")","i"),Ne={position:"absolute",visibility:"hidden",display:"block"},ke={letterSpacing:0,fontWeight:400},Ee=["Webkit","O","Moz","ms"];function De(e,t){if(t in e)return t;for(var n=t[0].toUpperCase()+t.slice(1),r=t,i=Ee.length;i--;)if((t=Ee[i]+n)in e)return t;return r}function je(e,t,n){var r=Te.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Se(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=d.css(e,n+B[o],!0,i)),r?("content"===n&&(s-=d.css(e,"padding"+B[o],!0,i)),"margin"!==n&&(s-=d.css(e,"border"+B[o]+"Width",!0,i))):(s+=d.css(e,"padding"+B[o],!0,i),"padding"!==n&&(s+=d.css(e,"border"+B[o]+"Width",!0,i)));return s}function Ae(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ye(e),s="border-box"===d.css(e,"boxSizing",!1,o);if(i<=0||null==i){if(((i=xe(e,t,o))<0||null==i)&&(i=e.style[t]),ve.test(i))return i;r=s&&(f.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Se(e,t,n||(s?"border":"content"),r,o)+"px"}function Le(e,t){for(var n,r,i,o=[],s=0,a=e.length;s<a;s++)(r=e[s]).style&&(o[s]=O.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&I(r)&&(o[s]=O.access(r,"olddisplay",ge(r.nodeName)))):o[s]||(i=I(r),(n&&"none"!==n||!i)&&O.set(r,"olddisplay",i?n:d.css(r,"display"))));for(s=0;s<a;s++)(r=e[s]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}function qe(e,t,n,r,i){return new qe.prototype.init(e,t,n,r,i)}d.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=xe(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=d.camelCase(t),u=e.style;if(t=d.cssProps[a]||(d.cssProps[a]=De(u,a)),s=d.cssHooks[t]||d.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:u[t];"string"===(o=typeof n)&&(i=Ce.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(d.css(e,t)),o="number"),null!=n&&n==n&&("number"!==o||d.cssNumber[a]||(n+="px"),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(u[t]="",u[t]=n))}},css:function(e,t,n,r){var i,o,s,a=d.camelCase(t);return t=d.cssProps[a]||(d.cssProps[a]=De(e.style,a)),(s=d.cssHooks[t]||d.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=xe(e,t,r)),"normal"===i&&t in ke&&(i=ke[t]),""===n||n?(o=parseFloat(i),!0===n||d.isNumeric(o)?o||0:i):i}}),d.each(["height","width"],(function(e,t){d.cssHooks[t]={get:function(e,n,r){if(n)return 0===e.offsetWidth&&we.test(d.css(e,"display"))?d.swap(e,Ne,(function(){return Ae(e,t,r)})):Ae(e,t,r)},set:function(e,n,r){var i=r&&ye(e);return je(0,n,r?Se(e,t,r,"border-box"===d.css(e,"boxSizing",!1,i),i):0)}}})),d.cssHooks.marginRight=be(f.reliableMarginRight,(function(e,t){if(t)return d.swap(e,{display:"inline-block"},xe,[e,"marginRight"])})),d.each({margin:"",padding:"",border:"Width"},(function(e,t){d.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+B[r]+t]=o[r]||o[r-2]||o[0];return i}},me.test(e)||(d.cssHooks[e+t].set=je)})),d.fn.extend({css:function(e,t){return q(this,(function(e,t,n){var r,i,o={},s=0;if(d.isArray(t)){for(r=ye(e),i=t.length;s<i;s++)o[t[s]]=d.css(e,t[s],!1,r);return o}return void 0!==n?d.style(e,t,n):d.css(e,t)}),e,t,arguments.length>1)},show:function(){return Le(this,!0)},hide:function(){return Le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){I(this)?d(this).show():d(this).hide()}))}}),d.Tween=qe,qe.prototype={constructor:qe,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(d.cssNumber[n]?"":"px")},cur:function(){var e=qe.propHooks[this.prop];return e&&e.get?e.get(this):qe.propHooks._default.get(this)},run:function(e){var t,n=qe.propHooks[this.prop];return this.options.duration?this.pos=t=d.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):qe.propHooks._default.set(this),this}},qe.prototype.init.prototype=qe.prototype,qe.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=d.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){d.fx.step[e.prop]?d.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[d.cssProps[e.prop]]||d.cssHooks[e.prop])?d.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},qe.propHooks.scrollTop=qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},d.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},d.fx=qe.prototype.init,d.fx.step={};var He,Oe,Fe,Pe,Me,Re=/^(?:toggle|show|hide)$/,We=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),$e=/queueHooks$/,Be=[function(e,t,n){var r,i,o,s,a,u,l,c=this,f={},p=e.style,h=e.nodeType&&I(e),g=O.get(e,"fxshow");n.queue||(null==(a=d._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,c.always((function(){c.always((function(){a.unqueued--,d.queue(e,"fx").length||a.empty.fire()}))})));1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"none"===(l=d.css(e,"display"))&&(l=ge(e.nodeName)),"inline"===l&&"none"===d.css(e,"float")&&(p.display="inline-block"));n.overflow&&(p.overflow="hidden",c.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})));for(r in t)if(i=t[r],Re.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(h?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;h=!0}f[r]=g&&g[r]||d.style(e,r)}if(!d.isEmptyObject(f))for(r in g?"hidden"in g&&(h=g.hidden):g=O.access(e,"fxshow",{}),o&&(g.hidden=!h),h?d(e).show():c.done((function(){d(e).hide()})),c.done((function(){var t;for(t in O.remove(e,"fxshow"),f)d.style(e,t,f[t])})),f)s=ze(h?g[r]:0,r,c),r in g||(g[r]=s.start,h&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}],Ie={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=We.exec(t),o=i&&i[3]||(d.cssNumber[e]?"":"px"),s=(d.cssNumber[e]||"px"!==o&&+r)&&We.exec(d.css(n.elem,e)),a=1,u=20;if(s&&s[3]!==o){o=o||s[3],i=i||[],s=+r||1;do{s/=a=a||".5",d.style(n.elem,e,s+o)}while(a!==(a=n.cur()/r)&&1!==a&&--u)}return i&&(s=n.start=+s||+r||0,n.unit=o,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};function _e(){return setTimeout((function(){He=void 0})),He=d.now()}function Xe(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=B[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ze(e,t,n){for(var r,i=(Ie[t]||[]).concat(Ie["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function Ue(e,t,n){var r,i,o=0,s=Be.length,a=d.Deferred().always((function(){delete u.elem})),u=function(){if(i)return!1;for(var t=He||_e(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,s=l.tweens.length;o<s;o++)l.tweens[o].run(r);return a.notifyWith(e,[l,r,n]),r<1&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:d.extend({},t),opts:d.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:He||_e(),duration:n.duration,tweens:[],createTween:function(t,n){var r=d.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=d.camelCase(n)],o=e[n],d.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=d.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<s;o++)if(r=Be[o].call(l,e,c,l.opts))return r;return d.map(c,ze,l),d.isFunction(l.opts.start)&&l.opts.start.call(e,l),d.fx.timer(d.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}d.Animation=d.extend(Ue,{tweener:function(e,t){d.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;r<i;r++)n=e[r],Ie[n]=Ie[n]||[],Ie[n].unshift(t)},prefilter:function(e,t){t?Be.unshift(e):Be.push(e)}}),d.speed=function(e,t,n){var r=e&&"object"==typeof e?d.extend({},e):{complete:n||!n&&t||d.isFunction(e)&&e,duration:e,easing:n&&t||t&&!d.isFunction(t)&&t};return r.duration=d.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in d.fx.speeds?d.fx.speeds[r.duration]:d.fx.speeds._default,null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){d.isFunction(r.old)&&r.old.call(this),r.queue&&d.dequeue(this,r.queue)},r},d.fn.extend({fadeTo:function(e,t,n,r){return this.filter(I).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=d.isEmptyObject(e),o=d.speed(t,n,r),s=function(){var t=Ue(this,d.extend({},e),o);(i||O.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=d.timers,s=O.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&$e.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||d.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=O.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=d.timers,s=r?r.length:0;for(n.finish=!0,d.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),d.each(["toggle","show","hide"],(function(e,t){var n=d.fn[t];d.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(Xe(t,!0),e,r,i)}})),d.each({slideDown:Xe("show"),slideUp:Xe("hide"),slideToggle:Xe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){d.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),d.timers=[],d.fx.tick=function(){var e,t=0,n=d.timers;for(He=d.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||d.fx.stop(),He=void 0},d.fx.timer=function(e){d.timers.push(e),e()?d.fx.start():d.timers.pop()},d.fx.interval=13,d.fx.start=function(){Oe||(Oe=setInterval(d.fx.tick,d.fx.interval))},d.fx.stop=function(){clearInterval(Oe),Oe=null},d.fx.speeds={slow:600,fast:200,_default:400},d.fn.delay=function(e,t){return e=d.fx&&d.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}}))},Fe=p.createElement("input"),Pe=p.createElement("select"),Me=Pe.appendChild(p.createElement("option")),Fe.type="checkbox",f.checkOn=""!==Fe.value,f.optSelected=Me.selected,Pe.disabled=!0,f.optDisabled=!Me.disabled,(Fe=p.createElement("input")).value="t",Fe.type="radio",f.radioValue="t"===Fe.value;var Ve,Ye=d.expr.attrHandle;d.fn.extend({attr:function(e,t){return q(this,d.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){d.removeAttr(this,e)}))}}),d.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?d.prop(e,t,n):(1===o&&d.isXMLDoc(e)||(t=t.toLowerCase(),r=d.attrHooks[t]||(d.expr.match.bool.test(t)?Ve:void 0)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=d.find.attr(e,t))?void 0:i:null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void d.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(S);if(o&&1===e.nodeType)for(;n=o[i++];)r=d.propFix[n]||n,d.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&d.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),Ve={set:function(e,t,n){return!1===t?d.removeAttr(e,n):e.setAttribute(n,n),n}},d.each(d.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=Ye[t]||d.find.attr;Ye[t]=function(e,t,r){var i,o;return r||(o=Ye[t],Ye[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,Ye[t]=o),i}}));var Ge=/^(?:input|select|textarea|button)$/i;d.fn.extend({prop:function(e,t){return q(this,d.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[d.propFix[e]||e]}))}}),d.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return(1!==o||!d.isXMLDoc(e))&&(t=d.propFix[t]||t,i=d.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||Ge.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),f.optSelected||(d.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),d.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){d.propFix[this.toLowerCase()]=this}));var Qe=/[\t\r\n\f]/g;d.fn.extend({addClass:function(e){var t,n,r,i,o,s,a="string"==typeof e&&e,u=0,l=this.length;if(d.isFunction(e))return this.each((function(t){d(this).addClass(e.call(this,t,this.className))}));if(a)for(t=(e||"").match(S)||[];u<l;u++)if(r=1===(n=this[u]).nodeType&&(n.className?(" "+n.className+" ").replace(Qe," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");s=d.trim(r),n.className!==s&&(n.className=s)}return this},removeClass:function(e){var t,n,r,i,o,s,a=0===arguments.length||"string"==typeof e&&e,u=0,l=this.length;if(d.isFunction(e))return this.each((function(t){d(this).removeClass(e.call(this,t,this.className))}));if(a)for(t=(e||"").match(S)||[];u<l;u++)if(r=1===(n=this[u]).nodeType&&(n.className?(" "+n.className+" ").replace(Qe," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");s=e?d.trim(r):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):d.isFunction(e)?this.each((function(n){d(this).toggleClass(e.call(this,n,this.className,t),t)})):this.each((function(){if("string"===n)for(var t,r=0,i=d(this),o=e.match(S)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else"undefined"!==n&&"boolean"!==n||(this.className&&O.set(this,"__className__",this.className),this.className=this.className||!1===e?"":O.get(this,"__className__")||"")}))},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;n<r;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Qe," ").indexOf(t)>=0)return!0;return!1}});var Je=/\r/g;d.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=d.isFunction(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,d(this).val()):e)?i="":"number"==typeof i?i+="":d.isArray(i)&&(i=d.map(i,(function(e){return null==e?"":e+""}))),(t=d.valHooks[this.type]||d.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=d.valHooks[i.type]||d.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Je,""):null==n?"":n:void 0}}),d.extend({valHooks:{select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,s=o?null:[],a=o?i+1:r.length,u=i<0?a:o?i:0;u<a;u++)if(((n=r[u]).selected||u===i)&&(f.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!d.nodeName(n.parentNode,"optgroup"))){if(t=d(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=d.makeArray(t),s=i.length;s--;)((r=i[s]).selected=d.inArray(d(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),d.each(["radio","checkbox"],(function(){d.valHooks[this]={set:function(e,t){if(d.isArray(t))return e.checked=d.inArray(d(e).val(),t)>=0}},f.checkOn||(d.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){d.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),d.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Ke=d.now(),Ze=/\?/;d.parseJSON=function(e){return JSON.parse(e+"")},d.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new DOMParser).parseFromString(e,"text/xml")}catch(n){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||d.error("Invalid XML: "+e),t};var et,tt,nt=/#.*$/,rt=/([?&])_=[^&]*/,it=/^(.*?):[ \t]*([^\r\n]*)$/gm,ot=/^(?:GET|HEAD)$/,st=/^\/\//,at=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,ut={},lt={},ct="*/".concat("*");try{tt=location.href}catch(Lt){(tt=p.createElement("a")).href="",tt=tt.href}function ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(S)||[];if(d.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function pt(e,t,n,r){var i={},o=e===lt;function s(a){var u;return i[a]=!0,d.each(e[a]||[],(function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),s(l),!1)})),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function dt(e,t){var n,r,i=d.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&d.extend(!0,e,r),e}et=at.exec(tt.toLowerCase())||[],d.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tt,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(et[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ct,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?dt(dt(e,d.ajaxSettings),t):dt(d.ajaxSettings,e)},ajaxPrefilter:ft(ut),ajaxTransport:ft(lt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,i,o,s,a,u,l,c=d.ajaxSetup({},t),f=c.context||c,p=c.context&&(f.nodeType||f.jquery)?d(f):d.event,h=d.Deferred(),g=d.Callbacks("once memory"),m=c.statusCode||{},v={},y={},x=0,b="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!o)for(o={};t=it.exec(i);)o[t[1].toLowerCase()]=t[2];t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(x<2)for(t in e)m[t]=[m[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),T(0,t),this}};if(h.promise(w).complete=g.add,w.success=w.done,w.error=w.fail,c.url=((e||c.url||tt)+"").replace(nt,"").replace(st,et[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=d.trim(c.dataType||"*").toLowerCase().match(S)||[""],null==c.crossDomain&&(a=at.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===et[1]&&a[2]===et[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(et[3]||("http:"===et[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=d.param(c.data,c.traditional)),pt(ut,c,t,w),2===x)return w;for(l in(u=c.global)&&0==d.active++&&d.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!ot.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Ze.test(r)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=rt.test(r)?r.replace(rt,"$1_="+Ke++):r+(Ze.test(r)?"&":"?")+"_="+Ke++)),c.ifModified&&(d.lastModified[r]&&w.setRequestHeader("If-Modified-Since",d.lastModified[r]),d.etag[r]&&w.setRequestHeader("If-None-Match",d.etag[r])),(c.data&&c.hasContent&&!1!==c.contentType||t.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+ct+"; q=0.01":""):c.accepts["*"]),c.headers)w.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(!1===c.beforeSend.call(f,w,c)||2===x))return w.abort();for(l in b="abort",{success:1,error:1,complete:1})w[l](c[l]);if(n=pt(lt,c,t,w)){w.readyState=1,u&&p.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(s=setTimeout((function(){w.abort("timeout")}),c.timeout));try{x=1,n.send(v,T)}catch(Lt){if(!(x<2))throw Lt;T(-1,Lt)}}else T(-1,"No Transport");function T(e,t,o,a){var l,v,y,b,T,C=t;2!==x&&(x=2,s&&clearTimeout(s),n=void 0,i=a||"",w.readyState=e>0?4:0,l=e>=200&&e<300||304===e,o&&(b=function(e,t,n){for(var r,i,o,s,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]}(c,w,o)),b=function(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(i in l)if((a=i.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[i]:!0!==l[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(Lt){return{state:"parsererror",error:s?Lt:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(c,b,w,l),l?(c.ifModified&&((T=w.getResponseHeader("Last-Modified"))&&(d.lastModified[r]=T),(T=w.getResponseHeader("etag"))&&(d.etag[r]=T)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=b.state,v=b.data,l=!(y=b.error))):(y=C,!e&&C||(C="error",e<0&&(e=0))),w.status=e,w.statusText=(t||C)+"",l?h.resolveWith(f,[v,C,w]):h.rejectWith(f,[w,C,y]),w.statusCode(m),m=void 0,u&&p.trigger(l?"ajaxSuccess":"ajaxError",[w,c,l?v:y]),g.fireWith(f,[w,C]),u&&(p.trigger("ajaxComplete",[w,c]),--d.active||d.event.trigger("ajaxStop")))}return w},getJSON:function(e,t,n){return d.get(e,t,n,"json")},getScript:function(e,t){return d.get(e,void 0,t,"script")}}),d.each(["get","post"],(function(e,t){d[t]=function(e,n,r,i){return d.isFunction(n)&&(i=i||r,r=n,n=void 0),d.ajax({url:e,type:t,dataType:i,data:n,success:r})}})),d.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){d.fn[t]=function(e){return this.on(t,e)}})),d._evalUrl=function(e){return d.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},d.fn.extend({wrapAll:function(e){var t;return d.isFunction(e)?this.each((function(t){d(this).wrapAll(e.call(this,t))})):(this[0]&&(t=d(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this)},wrapInner:function(e){return d.isFunction(e)?this.each((function(t){d(this).wrapInner(e.call(this,t))})):this.each((function(){var t=d(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=d.isFunction(e);return this.each((function(n){d(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)})).end()}}),d.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},d.expr.filters.visible=function(e){return!d.expr.filters.hidden(e)};var ht=/%20/g,gt=/\[\]$/,mt=/\r?\n/g,vt=/^(?:submit|button|image|reset|file)$/i,yt=/^(?:input|select|textarea|keygen)/i;function xt(e,t,n,r){var i;if(d.isArray(t))d.each(t,(function(t,i){n||gt.test(e)?r(e,i):xt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)}));else if(n||"object"!==d.type(t))r(e,t);else for(i in t)xt(e+"["+i+"]",t[i],n,r)}d.param=function(e,t){var n,r=[],i=function(e,t){t=d.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=d.ajaxSettings&&d.ajaxSettings.traditional),d.isArray(e)||e.jquery&&!d.isPlainObject(e))d.each(e,(function(){i(this.name,this.value)}));else for(n in e)xt(n,e[n],t,i);return r.join("&").replace(ht,"+")},d.fn.extend({serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=d.prop(this,"elements");return e?d.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!d(this).is(":disabled")&&yt.test(this.nodeName)&&!vt.test(e)&&(this.checked||!_.test(e))})).map((function(e,t){var n=d(this).val();return null==n?null:d.isArray(n)?d.map(n,(function(e){return{name:t.name,value:e.replace(mt,"\r\n")}})):{name:t.name,value:n.replace(mt,"\r\n")}})).get()}}),d.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(Lt){}};var bt=0,wt={},Tt={0:200,1223:204},Ct=d.ajaxSettings.xhr();e.ActiveXObject&&d(e).on("unload",(function(){for(var e in wt)wt[e]()})),f.cors=!!Ct&&"withCredentials"in Ct,f.ajax=Ct=!!Ct,d.ajaxTransport((function(e){var t;if(f.cors||Ct&&!e.crossDomain)return{send:function(n,r){var i,o=e.xhr(),s=++bt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];for(i in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete wt[s],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Tt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=wt[s]=t("abort"),o.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}})),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return d.globalEval(e),e}}}),d.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),d.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain)return{send:function(r,i){t=d("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),p.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Nt=[],kt=/(=)\?(?=&|$)|\?\?/;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Nt.pop()||d.expando+"_"+Ke++;return this[e]=!0,e}}),d.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(kt.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&kt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=d.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(kt,"$1"+i):!1!==t.jsonp&&(t.url+=(Ze.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||d.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always((function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Nt.push(i)),s&&d.isFunction(o)&&o(s[0]),s=o=void 0})),"script"})),d.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||p;var r=b.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=d.buildFragment([e],t,i),i&&i.length&&d(i).remove(),d.merge([],r.childNodes))};var Et=d.fn.load;d.fn.load=function(e,t,n){if("string"!=typeof e&&Et)return Et.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),d.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&d.ajax({url:e,type:i,dataType:"html",data:t}).done((function(e){o=arguments,s.html(r?d("<div>").append(d.parseHTML(e)).find(r):e)})).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},d.expr.filters.animated=function(e){return d.grep(d.timers,(function(t){return e===t.elem})).length};var Dt=e.document.documentElement;function jt(e){return d.isWindow(e)?e:9===e.nodeType&&e.defaultView}d.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l=d.css(e,"position"),c=d(e),f={};"static"===l&&(e.style.position="relative"),a=c.offset(),o=d.css(e,"top"),u=d.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),d.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+i),"using"in t?t.using.call(e,f):c.css(f)}},d.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){d.offset.setOffset(this,e,t)}));var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;return o?(t=o.documentElement,d.contains(t,r)?(void 0!==r.getBoundingClientRect&&(i=r.getBoundingClientRect()),n=jt(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===d.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),d.nodeName(e[0],"html")||(r=e.offset()),r.top+=d.css(e[0],"borderTopWidth",!0),r.left+=d.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-d.css(n,"marginTop",!0),left:t.left-r.left-d.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent||Dt;e&&!d.nodeName(e,"html")&&"static"===d.css(e,"position");)e=e.offsetParent;return e||Dt}))}}),d.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,n){var r="pageYOffset"===n;d.fn[t]=function(i){return q(this,(function(t,i,o){var s=jt(t);if(void 0===o)return s?s[n]:t[i];s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o}),t,i,arguments.length,null)}})),d.each(["top","left"],(function(e,t){d.cssHooks[t]=be(f.pixelPosition,(function(e,n){if(n)return n=xe(e,t),ve.test(n)?d(e).position()[t]+"px":n}))})),d.each({Height:"height",Width:"width"},(function(e,t){d.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){d.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===i?"margin":"border");return q(this,(function(t,n,r){var i;return d.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?d.css(t,n,s):d.style(t,n,r,s)}),t,o?r:void 0,o,null)}}))})),d.fn.size=function(){return this.length},d.fn.andSelf=d.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return d}));var St=e.jQuery,At=e.$;return d.noConflict=function(t){return e.$===d&&(e.$=At),t&&e.jQuery===d&&(e.jQuery=St),d},void 0===t&&(e.jQuery=e.$=d),d}));</script>
<script type="text/javascript">/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright JS Foundation and other contributors <https://js.foundation/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */
(function(){var n="Expected a function",t="__lodash_placeholder__",r=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],e="[object Arguments]",u="[object Array]",i="[object Boolean]",o="[object Date]",f="[object Error]",a="[object Function]",c="[object GeneratorFunction]",l="[object Map]",s="[object Number]",v="[object Object]",h="[object RegExp]",p="[object Set]",d="[object String]",_="[object Symbol]",g="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",m="[object Float64Array]",x="[object Int8Array]",j="[object Int16Array]",A="[object Int32Array]",k="[object Uint8Array]",O="[object Uint16Array]",I="[object Uint32Array]",R=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,E=/(__e\(.*?\)|\b__t\)) \+\n'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,W=RegExp(S.source),C=RegExp(L.source),U=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,T=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,D=/^\w*$/,N=/^\./,M=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,F=/[\\^$.*+?()[\]{}|]/g,P=RegExp(F.source),q=/^\s+|\s+$/g,Z=/^\s+/,K=/\s+$/,V=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\n\/\* \[wrapped with (.+)\] \*/,H=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Y=/\\(\\)?/g,Q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,X=/\w*$/,nn=/^[-+]0x[0-9a-f]+$/i,tn=/^0b[01]+$/i,rn=/^\[object .+?Constructor\]$/,en=/^0o[0-7]+$/i,un=/^(?:0|[1-9]\d*)$/,on=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fn=/($^)/,an=/['\n\r\u2028\u2029\\]/g,cn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ln="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sn="[\\ud800-\\udfff]",vn="["+ln+"]",hn="["+cn+"]",pn="\\d+",dn="[\\u2700-\\u27bf]",_n="[a-z\\xdf-\\xf6\\xf8-\\xff]",gn="[^\\ud800-\\udfff"+ln+pn+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",yn="\\ud83c[\\udffb-\\udfff]",bn="[^\\ud800-\\udfff]",wn="(?:\\ud83c[\\udde6-\\uddff]){2}",mn="[\\ud800-\\udbff][\\udc00-\\udfff]",xn="[A-Z\\xc0-\\xd6\\xd8-\\xde]",jn="(?:"+_n+"|"+gn+")",An="(?:"+xn+"|"+gn+")",kn="(?:"+hn+"|"+yn+")"+"?",On="[\\ufe0e\\ufe0f]?"+kn+("(?:\\u200d(?:"+[bn,wn,mn].join("|")+")[\\ufe0e\\ufe0f]?"+kn+")*"),In="(?:"+[dn,wn,mn].join("|")+")"+On,Rn="(?:"+[bn+hn+"?",hn,wn,mn,sn].join("|")+")",zn=RegExp("['’]","g"),En=RegExp(hn,"g"),Sn=RegExp(yn+"(?="+yn+")|"+Rn+On,"g"),Ln=RegExp([xn+"?"+_n+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[vn,xn,"$"].join("|")+")",An+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[vn,xn+jn,"$"].join("|")+")",xn+"?"+jn+"+(?:['’](?:d|ll|m|re|s|t|ve))?",xn+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",pn,In].join("|"),"g"),Wn=RegExp("[\\u200d\\ud800-\\udfff"+cn+"\\ufe0e\\ufe0f]"),Cn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Un=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Bn=-1,Tn={};Tn[w]=Tn[m]=Tn[x]=Tn[j]=Tn[A]=Tn[k]=Tn["[object Uint8ClampedArray]"]=Tn[O]=Tn[I]=!0,Tn[e]=Tn[u]=Tn[y]=Tn[i]=Tn[b]=Tn[o]=Tn[f]=Tn[a]=Tn[l]=Tn[s]=Tn[v]=Tn[h]=Tn[p]=Tn[d]=Tn[g]=!1;var $n={};$n[e]=$n[u]=$n[y]=$n[b]=$n[i]=$n[o]=$n[w]=$n[m]=$n[x]=$n[j]=$n[A]=$n[l]=$n[s]=$n[v]=$n[h]=$n[p]=$n[d]=$n[_]=$n[k]=$n["[object Uint8ClampedArray]"]=$n[O]=$n[I]=!0,$n[f]=$n[a]=$n[g]=!1;var Dn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Nn=parseFloat,Mn=parseInt,Fn="object"==typeof global&&global&&global.Object===Object&&global,Pn="object"==typeof self&&self&&self.Object===Object&&self,qn=Fn||Pn||Function("return this")(),Zn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kn=Zn&&"object"==typeof module&&module&&!module.nodeType&&module,Vn=Kn&&Kn.exports===Zn,Gn=Vn&&Fn.process,Hn=function(){try{return Gn&&Gn.binding&&Gn.binding("util")}catch(n){}}(),Jn=Hn&&Hn.isArrayBuffer,Yn=Hn&&Hn.isDate,Qn=Hn&&Hn.isMap,Xn=Hn&&Hn.isRegExp,nt=Hn&&Hn.isSet,tt=Hn&&Hn.isTypedArray;function rt(n,t){return n.set(t[0],t[1]),n}function et(n,t){return n.add(t),n}function ut(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function it(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function ot(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function ft(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function at(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function ct(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function lt(n,t){return!!(null==n?0:n.length)&&wt(n,t,0)>-1}function st(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function vt(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function ht(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function pt(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function dt(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function _t(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}var gt=At("length");function yt(n,t,r){var e;return r(n,(function(n,r,u){if(t(n,r,u))return e=r,!1})),e}function bt(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function wt(n,t,r){return t==t?function(n,t,r){var e=r-1,u=n.length;for(;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):bt(n,xt,r)}function mt(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function xt(n){return n!=n}function jt(n,t){var r=null==n?0:n.length;return r?It(n,t)/r:NaN}function At(n){return function(t){return null==t?void 0:t[n]}}function kt(n){return function(t){return null==n?void 0:n[t]}}function Ot(n,t,r,e,u){return u(n,(function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)})),r}function It(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);void 0!==i&&(r=void 0===r?i:r+i)}return r}function Rt(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function zt(n){return function(t){return n(t)}}function Et(n,t){return vt(t,(function(t){return n[t]}))}function St(n,t){return n.has(t)}function Lt(n,t){for(var r=-1,e=n.length;++r<e&&wt(t,n[r],0)>-1;);return r}function Wt(n,t){for(var r=n.length;r--&&wt(t,n[r],0)>-1;);return r}function Ct(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}var Ut=kt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Bt=kt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Tt(n){return"\\"+Dn[n]}function $t(n){return Wn.test(n)}function Dt(n){var t=-1,r=Array(n.size);return n.forEach((function(n,e){r[++t]=[e,n]})),r}function Nt(n,t){return function(r){return n(t(r))}}function Mt(n,r){for(var e=-1,u=n.length,i=0,o=[];++e<u;){var f=n[e];f!==r&&f!==t||(n[e]=t,o[i++]=e)}return o}function Ft(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=n})),r}function Pt(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=[n,n]})),r}function qt(n){return $t(n)?function(n){var t=Sn.lastIndex=0;for(;Sn.test(n);)++t;return t}(n):gt(n)}function Zt(n){return $t(n)?function(n){return n.match(Sn)||[]}(n):function(n){return n.split("")}(n)}var Kt=kt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Vt=function cn(ln){var sn,vn=(ln=null==ln?qn:Vt.defaults(qn.Object(),ln,Vt.pick(qn,Un))).Array,hn=ln.Date,pn=ln.Error,dn=ln.Function,_n=ln.Math,gn=ln.Object,yn=ln.RegExp,bn=ln.String,wn=ln.TypeError,mn=vn.prototype,xn=dn.prototype,jn=gn.prototype,An=ln["__core-js_shared__"],kn=xn.toString,On=jn.hasOwnProperty,In=0,Rn=(sn=/[^.]+$/.exec(An&&An.keys&&An.keys.IE_PROTO||""))?"Symbol(src)_1."+sn:"",Sn=jn.toString,Wn=kn.call(gn),Dn=qn._,Fn=yn("^"+kn.call(On).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pn=Vn?ln.Buffer:void 0,Zn=ln.Symbol,Kn=ln.Uint8Array,Gn=Pn?Pn.allocUnsafe:void 0,Hn=Nt(gn.getPrototypeOf,gn),gt=gn.create,kt=jn.propertyIsEnumerable,Gt=mn.splice,Ht=Zn?Zn.isConcatSpreadable:void 0,Jt=Zn?Zn.iterator:void 0,Yt=Zn?Zn.toStringTag:void 0,Qt=function(){try{var n=ri(gn,"defineProperty");return n({},"",{}),n}catch(t){}}(),Xt=ln.clearTimeout!==qn.clearTimeout&&ln.clearTimeout,nr=hn&&hn.now!==qn.Date.now&&hn.now,tr=ln.setTimeout!==qn.setTimeout&&ln.setTimeout,rr=_n.ceil,er=_n.floor,ur=gn.getOwnPropertySymbols,ir=Pn?Pn.isBuffer:void 0,or=ln.isFinite,fr=mn.join,ar=Nt(gn.keys,gn),cr=_n.max,lr=_n.min,sr=hn.now,vr=ln.parseInt,hr=_n.random,pr=mn.reverse,dr=ri(ln,"DataView"),_r=ri(ln,"Map"),gr=ri(ln,"Promise"),yr=ri(ln,"Set"),br=ri(ln,"WeakMap"),wr=ri(gn,"create"),mr=br&&new br,xr={},jr=Ri(dr),Ar=Ri(_r),kr=Ri(gr),Or=Ri(yr),Ir=Ri(br),Rr=Zn?Zn.prototype:void 0,zr=Rr?Rr.valueOf:void 0,Er=Rr?Rr.toString:void 0;function Sr(n){if(Ko(n)&&!Uo(n)&&!(n instanceof Ur)){if(n instanceof Cr)return n;if(On.call(n,"__wrapped__"))return zi(n)}return new Cr(n)}var Lr=function(){function n(){}return function(t){if(!Zo(t))return{};if(gt)return gt(t);n.prototype=t;var r=new n;return n.prototype=void 0,r}}();function Wr(){}function Cr(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ur(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Br(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Tr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function $r(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Dr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new $r;++t<r;)this.add(n[t])}function Nr(n){var t=this.__data__=new Tr(n);this.size=t.size}function Mr(n,t){var r=Uo(n),e=!r&&Co(n),u=!r&&!e&&Do(n),i=!r&&!e&&!u&&nf(n),o=r||e||u||i,f=o?Rt(n.length,bn):[],a=f.length;for(var c in n)!t&&!On.call(n,c)||o&&("length"==c||u&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ci(c,a))||f.push(c);return f}function Fr(n){var t=n.length;return t?n[De(0,t-1)]:void 0}function Pr(n,t){return ki(wu(n),Qr(t,0,n.length))}function qr(n){return ki(wu(n))}function Zr(n,t,r){(void 0!==r&&!So(n[t],r)||void 0===r&&!(t in n))&&Jr(n,t,r)}function Kr(n,t,r){var e=n[t];On.call(n,t)&&So(e,r)&&(void 0!==r||t in n)||Jr(n,t,r)}function Vr(n,t){for(var r=n.length;r--;)if(So(n[r][0],t))return r;return-1}function Gr(n,t,r,e){return ee(n,(function(n,u,i){t(e,n,r(n),i)})),e}function Hr(n,t){return n&&mu(t,jf(t),n)}function Jr(n,t,r){"__proto__"==t&&Qt?Qt(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function Yr(n,t){for(var r=-1,e=t.length,u=vn(e),i=null==n;++r<e;)u[r]=i?void 0:yf(n,t[r]);return u}function Qr(n,t,r){return n==n&&(void 0!==r&&(n=n<=r?n:r),void 0!==t&&(n=n>=t?n:t)),n}function Xr(n,t,r,u,f,g){var R,z=1&t,E=2&t,S=4&t;if(r&&(R=f?r(n,u,f,g):r(n)),void 0!==R)return R;if(!Zo(n))return n;var L=Uo(n);if(L){if(R=function(n){var t=n.length,r=n.constructor(t);t&&"string"==typeof n[0]&&On.call(n,"index")&&(r.index=n.index,r.input=n.input);return r}(n),!z)return wu(n,R)}else{var W=ii(n),C=W==a||W==c;if(Do(n))return pu(n,z);if(W==v||W==e||C&&!f){if(R=E||C?{}:fi(n),!z)return E?function(n,t){return mu(n,ui(n),t)}(n,function(n,t){return n&&mu(t,Af(t),n)}(R,n)):function(n,t){return mu(n,ei(n),t)}(n,Hr(R,n))}else{if(!$n[W])return f?n:{};R=function(n,t,r,e){var u=n.constructor;switch(t){case y:return du(n);case i:case o:return new u(+n);case b:return function(n,t){var r=t?du(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}(n,e);case w:case m:case x:case j:case A:case k:case"[object Uint8ClampedArray]":case O:case I:return _u(n,e);case l:return function(n,t,r){return pt(t?r(Dt(n),1):Dt(n),rt,new n.constructor)}(n,e,r);case s:case d:return new u(n);case h:return function(n){var t=new n.constructor(n.source,X.exec(n));return t.lastIndex=n.lastIndex,t}(n);case p:return function(n,t,r){return pt(t?r(Ft(n),1):Ft(n),et,new n.constructor)}(n,e,r);case _:return f=n,zr?gn(zr.call(f)):{}}var f}(n,W,Xr,z)}}g||(g=new Nr);var U=g.get(n);if(U)return U;g.set(n,R);var B=L?void 0:(S?E?Hu:Gu:E?Af:jf)(n);return ot(B||n,(function(e,u){B&&(e=n[u=e]),Kr(R,u,Xr(e,t,r,u,n,g))})),R}function ne(n,t,r){var e=r.length;if(null==n)return!e;for(n=gn(n);e--;){var u=r[e],i=t[u],o=n[u];if(void 0===o&&!(u in n)||!i(o))return!1}return!0}function te(t,r,e){if("function"!=typeof t)throw new wn(n);return mi((function(){t.apply(void 0,e)}),r)}function re(n,t,r,e){var u=-1,i=lt,o=!0,f=n.length,a=[],c=t.length;if(!f)return a;r&&(t=vt(t,zt(r))),e?(i=st,o=!1):t.length>=200&&(i=St,o=!1,t=new Dr(t));n:for(;++u<f;){var l=n[u],s=null==r?l:r(l);if(l=e||0!==l?l:0,o&&s==s){for(var v=c;v--;)if(t[v]===s)continue n;a.push(l)}else i(t,s,e)||a.push(l)}return a}Sr.templateSettings={escape:U,evaluate:B,interpolate:T,variable:"",imports:{_:Sr}},Sr.prototype=Wr.prototype,Sr.prototype.constructor=Sr,Cr.prototype=Lr(Wr.prototype),Cr.prototype.constructor=Cr,Ur.prototype=Lr(Wr.prototype),Ur.prototype.constructor=Ur,Br.prototype.clear=function(){this.__data__=wr?wr(null):{},this.size=0},Br.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Br.prototype.get=function(n){var t=this.__data__;if(wr){var r=t[n];return"__lodash_hash_undefined__"===r?void 0:r}return On.call(t,n)?t[n]:void 0},Br.prototype.has=function(n){var t=this.__data__;return wr?void 0!==t[n]:On.call(t,n)},Br.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=wr&&void 0===t?"__lodash_hash_undefined__":t,this},Tr.prototype.clear=function(){this.__data__=[],this.size=0},Tr.prototype.delete=function(n){var t=this.__data__,r=Vr(t,n);return!(r<0)&&(r==t.length-1?t.pop():Gt.call(t,r,1),--this.size,!0)},Tr.prototype.get=function(n){var t=this.__data__,r=Vr(t,n);return r<0?void 0:t[r][1]},Tr.prototype.has=function(n){return Vr(this.__data__,n)>-1},Tr.prototype.set=function(n,t){var r=this.__data__,e=Vr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new Br,map:new(_r||Tr),string:new Br}},$r.prototype.delete=function(n){var t=ni(this,n).delete(n);return this.size-=t?1:0,t},$r.prototype.get=function(n){return ni(this,n).get(n)},$r.prototype.has=function(n){return ni(this,n).has(n)},$r.prototype.set=function(n,t){var r=ni(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Dr.prototype.add=Dr.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},Dr.prototype.has=function(n){return this.__data__.has(n)},Nr.prototype.clear=function(){this.__data__=new Tr,this.size=0},Nr.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},Nr.prototype.get=function(n){return this.__data__.get(n)},Nr.prototype.has=function(n){return this.__data__.has(n)},Nr.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tr){var e=r.__data__;if(!_r||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new $r(e)}return r.set(n,t),this.size=r.size,this};var ee=Au(se),ue=Au(ve,!0);function ie(n,t){var r=!0;return ee(n,(function(n,e,u){return r=!!t(n,e,u)})),r}function oe(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(void 0===f?o==o&&!Xo(o):r(o,f)))var f=o,a=i}return a}function fe(n,t){var r=[];return ee(n,(function(n,e,u){t(n,e,u)&&r.push(n)})),r}function ae(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=ai),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?ae(f,t-1,r,e,u):ht(u,f):e||(u[u.length]=f)}return u}var ce=ku(),le=ku(!0);function se(n,t){return n&&ce(n,t,jf)}function ve(n,t){return n&&le(n,t,jf)}function he(n,t){return ct(t,(function(t){return Fo(n[t])}))}function pe(n,t){for(var r=0,e=(t=lu(t,n)).length;null!=n&&r<e;)n=n[Ii(t[r++])];return r&&r==e?n:void 0}function de(n,t,r){var e=t(n);return Uo(n)?e:ht(e,r(n))}function _e(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":Yt&&Yt in gn(n)?function(n){var t=On.call(n,Yt),r=n[Yt];try{n[Yt]=void 0;var e=!0}catch(i){}var u=Sn.call(n);e&&(t?n[Yt]=r:delete n[Yt]);return u}(n):function(n){return Sn.call(n)}(n)}function ge(n,t){return n>t}function ye(n,t){return null!=n&&On.call(n,t)}function be(n,t){return null!=n&&t in gn(n)}function we(n,t,r){for(var e=r?st:lt,u=n[0].length,i=n.length,o=i,f=vn(i),a=1/0,c=[];o--;){var l=n[o];o&&t&&(l=vt(l,zt(t))),a=lr(l.length,a),f[o]=!r&&(t||u>=120&&l.length>=120)?new Dr(o&&l):void 0}l=n[0];var s=-1,v=f[0];n:for(;++s<u&&c.length<a;){var h=l[s],p=t?t(h):h;if(h=r||0!==h?h:0,!(v?St(v,p):e(c,p,r))){for(o=i;--o;){var d=f[o];if(!(d?St(d,p):e(n[o],p,r)))continue n}v&&v.push(p),c.push(h)}}return c}function me(n,t,r){var e=null==(n=yi(n,t=lu(t,n)))?n:n[Ii(Ni(t))];return null==e?void 0:ut(e,n,r)}function xe(n){return Ko(n)&&_e(n)==e}function je(n,t,r,a,c){return n===t||(null==n||null==t||!Ko(n)&&!Ko(t)?n!=n&&t!=t:function(n,t,r,a,c,g){var w=Uo(n),m=Uo(t),x=w?u:ii(n),j=m?u:ii(t),A=(x=x==e?v:x)==v,k=(j=j==e?v:j)==v,O=x==j;if(O&&Do(n)){if(!Do(t))return!1;w=!0,A=!1}if(O&&!A)return g||(g=new Nr),w||nf(n)?Ku(n,t,r,a,c,g):function(n,t,r,e,u,a,c){switch(r){case b:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case y:return!(n.byteLength!=t.byteLength||!a(new Kn(n),new Kn(t)));case i:case o:case s:return So(+n,+t);case f:return n.name==t.name&&n.message==t.message;case h:case d:return n==t+"";case l:var v=Dt;case p:var g=1&e;if(v||(v=Ft),n.size!=t.size&&!g)return!1;var w=c.get(n);if(w)return w==t;e|=2,c.set(n,t);var m=Ku(v(n),v(t),e,u,a,c);return c.delete(n),m;case _:if(zr)return zr.call(n)==zr.call(t)}return!1}(n,t,x,r,a,c,g);if(!(1&r)){var I=A&&On.call(n,"__wrapped__"),R=k&&On.call(t,"__wrapped__");if(I||R){var z=I?n.value():n,E=R?t.value():t;return g||(g=new Nr),c(z,E,r,a,g)}}if(!O)return!1;return g||(g=new Nr),function(n,t,r,e,u,i){var o=1&r,f=Gu(n),a=f.length,c=Gu(t).length;if(a!=c&&!o)return!1;var l=a;for(;l--;){var s=f[l];if(!(o?s in t:On.call(t,s)))return!1}var v=i.get(n);if(v&&i.get(t))return v==t;var h=!0;i.set(n,t),i.set(t,n);var p=o;for(;++l<a;){s=f[l];var d=n[s],_=t[s];if(e)var g=o?e(_,d,s,t,n,i):e(d,_,s,n,t,i);if(!(void 0===g?d===_||u(d,_,r,e,i):g)){h=!1;break}p||(p="constructor"==s)}if(h&&!p){var y=n.constructor,b=t.constructor;y==b||!("constructor"in n)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(n),i.delete(t),h}(n,t,r,a,c,g)}(n,t,r,a,je,c))}function Ae(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=gn(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++u<i;){var a=(f=r[u])[0],c=n[a],l=f[1];if(o&&f[2]){if(void 0===c&&!(a in n))return!1}else{var s=new Nr;if(e)var v=e(c,l,a,n,t,s);if(!(void 0===v?je(l,c,3,e,s):v))return!1}}return!0}function ke(n){return!(!Zo(n)||(t=n,Rn&&Rn in t))&&(Fo(n)?Fn:rn).test(Ri(n));var t}function Oe(n){return"function"==typeof n?n:null==n?Hf:"object"==typeof n?Uo(n)?Le(n[0],n[1]):Se(n):ua(n)}function Ie(n){if(!pi(n))return ar(n);var t=[];for(var r in gn(n))On.call(n,r)&&"constructor"!=r&&t.push(r);return t}function Re(n){if(!Zo(n))return function(n){var t=[];if(null!=n)for(var r in gn(n))t.push(r);return t}(n);var t=pi(n),r=[];for(var e in n)("constructor"!=e||!t&&On.call(n,e))&&r.push(e);return r}function ze(n,t){return n<t}function Ee(n,t){var r=-1,e=To(n)?vn(n.length):[];return ee(n,(function(n,u,i){e[++r]=t(n,u,i)})),e}function Se(n){var t=ti(n);return 1==t.length&&t[0][2]?_i(t[0][0],t[0][1]):function(r){return r===n||Ae(r,n,t)}}function Le(n,t){return si(n)&&di(t)?_i(Ii(n),t):function(r){var e=yf(r,n);return void 0===e&&e===t?bf(r,n):je(t,e,3)}}function We(n,t,r,e,u){n!==t&&ce(t,(function(i,o){if(Zo(i))u||(u=new Nr),function(n,t,r,e,u,i,o){var f=n[r],a=t[r],c=o.get(a);if(c)return void Zr(n,r,c);var l=i?i(f,a,r+"",n,t,o):void 0,s=void 0===l;if(s){var v=Uo(a),h=!v&&Do(a),p=!v&&!h&&nf(a);l=a,v||h||p?Uo(f)?l=f:$o(f)?l=wu(f):h?(s=!1,l=pu(a,!0)):p?(s=!1,l=_u(a,!0)):l=[]:Ho(a)||Co(a)?(l=f,Co(f)?l=cf(f):(!Zo(f)||e&&Fo(f))&&(l=fi(a))):s=!1}s&&(o.set(a,l),u(l,a,e,i,o),o.delete(a));Zr(n,r,l)}(n,t,o,r,We,e,u);else{var f=e?e(n[o],i,o+"",n,t,u):void 0;void 0===f&&(f=i),Zr(n,o,f)}}),Af)}function Ce(n,t){var r=n.length;if(r)return ci(t+=t<0?r:0,r)?n[t]:void 0}function Ue(n,t,r){var e=-1;return t=vt(t.length?t:[Hf],zt(Xu())),function(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}(Ee(n,(function(n,r,u){return{criteria:vt(t,(function(t){return t(n)})),index:++e,value:n}})),(function(n,t){return function(n,t,r){var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;for(;++e<o;){var a=gu(u[e],i[e]);if(a){if(e>=f)return a;var c=r[e];return a*("desc"==c?-1:1)}}return n.index-t.index}(n,t,r)}))}function Be(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=pe(n,o);r(f,o)&&qe(i,lu(o,n),f)}return i}function Te(n,t,r,e){var u=e?mt:wt,i=-1,o=t.length,f=n;for(n===t&&(t=wu(t)),r&&(f=vt(n,zt(r)));++i<o;)for(var a=0,c=t[i],l=r?r(c):c;(a=u(f,l,a,e))>-1;)f!==n&&Gt.call(f,a,1),Gt.call(n,a,1);return n}function $e(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;ci(u)?Gt.call(n,u,1):ru(n,u)}}return n}function De(n,t){return n+er(hr()*(t-n+1))}function Ne(n,t){var r="";if(!n||t<1||t>9007199254740991)return r;do{t%2&&(r+=n),(t=er(t/2))&&(n+=n)}while(t);return r}function Me(n,t){return xi(gi(n,t,Hf),n+"")}function Fe(n){return Fr(Lf(n))}function Pe(n,t){var r=Lf(n);return ki(r,Qr(t,0,r.length))}function qe(n,t,r,e){if(!Zo(n))return n;for(var u=-1,i=(t=lu(t,n)).length,o=i-1,f=n;null!=f&&++u<i;){var a=Ii(t[u]),c=r;if(u!=o){var l=f[a];void 0===(c=e?e(l,a,f):void 0)&&(c=Zo(l)?l:ci(t[u+1])?[]:{})}Kr(f,a,c),f=f[a]}return n}var Ze=mr?function(n,t){return mr.set(n,t),n}:Hf,Ke=Qt?function(n,t){return Qt(n,"toString",{configurable:!0,enumerable:!1,value:Kf(t),writable:!0})}:Hf;function Ve(n){return ki(Lf(n))}function Ge(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=vn(u);++e<u;)i[e]=n[e+t];return i}function He(n,t){var r;return ee(n,(function(n,e,u){return!(r=t(n,e,u))})),!!r}function Je(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t==t&&u<=2147483647){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!Xo(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return Ye(n,t,Hf,r)}function Ye(n,t,r,e){t=r(t);for(var u=0,i=null==n?0:n.length,o=t!=t,f=null===t,a=Xo(t),c=void 0===t;u<i;){var l=er((u+i)/2),s=r(n[l]),v=void 0!==s,h=null===s,p=s==s,d=Xo(s);if(o)var _=e||p;else _=c?p&&(e||v):f?p&&v&&(e||!h):a?p&&v&&!h&&(e||!d):!h&&!d&&(e?s<=t:s<t);_?u=l+1:i=l}return lr(i,4294967294)}function Qe(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!So(f,a)){var a=f;i[u++]=0===o?0:o}}return i}function Xe(n){return"number"==typeof n?n:Xo(n)?NaN:+n}function nu(n){if("string"==typeof n)return n;if(Uo(n))return vt(n,nu)+"";if(Xo(n))return Er?Er.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function tu(n,t,r){var e=-1,u=lt,i=n.length,o=!0,f=[],a=f;if(r)o=!1,u=st;else if(i>=200){var c=t?null:Nu(n);if(c)return Ft(c);o=!1,u=St,a=new Dr}else a=t?[]:f;n:for(;++e<i;){var l=n[e],s=t?t(l):l;if(l=r||0!==l?l:0,o&&s==s){for(var v=a.length;v--;)if(a[v]===s)continue n;t&&a.push(s),f.push(l)}else u(a,s,r)||(a!==f&&a.push(s),f.push(l))}return f}function ru(n,t){return null==(n=yi(n,t=lu(t,n)))||delete n[Ii(Ni(t))]}function eu(n,t,r,e){return qe(n,t,r(pe(n,t)),e)}function uu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?Ge(n,e?0:i,e?i+1:u):Ge(n,e?i+1:0,e?u:i)}function iu(n,t){var r=n;return r instanceof Ur&&(r=r.value()),pt(t,(function(n,t){return t.func.apply(t.thisArg,ht([n],t.args))}),r)}function ou(n,t,r){var e=n.length;if(e<2)return e?tu(n[0]):[];for(var u=-1,i=vn(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=re(i[u]||o,n[f],t,r));return tu(ae(i,1),t,r)}function fu(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;){var f=e<i?t[e]:void 0;r(o,n[e],f)}return o}function au(n){return $o(n)?n:[]}function cu(n){return"function"==typeof n?n:Hf}function lu(n,t){return Uo(n)?n:si(n,t)?[n]:Oi(lf(n))}var su=Me;function vu(n,t,r){var e=n.length;return r=void 0===r?e:r,!t&&r>=e?n:Ge(n,t,r)}var hu=Xt||function(n){return qn.clearTimeout(n)};function pu(n,t){if(t)return n.slice();var r=n.length,e=Gn?Gn(r):new n.constructor(r);return n.copy(e),e}function du(n){var t=new n.constructor(n.byteLength);return new Kn(t).set(new Kn(n)),t}function _u(n,t){var r=t?du(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function gu(n,t){if(n!==t){var r=void 0!==n,e=null===n,u=n==n,i=Xo(n),o=void 0!==t,f=null===t,a=t==t,c=Xo(t);if(!f&&!c&&!i&&n>t||i&&o&&a&&!f&&!c||e&&o&&a||!r&&a||!u)return 1;if(!e&&!i&&!c&&n<t||c&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!a)return-1}return 0}function yu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,a=t.length,c=cr(i-o,0),l=vn(a+c),s=!e;++f<a;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;c--;)l[f++]=n[u++];return l}function bu(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,a=-1,c=t.length,l=cr(i-f,0),s=vn(l+c),v=!e;++u<l;)s[u]=n[u];for(var h=u;++a<c;)s[h+a]=t[a];for(;++o<f;)(v||u<i)&&(s[h+r[o]]=n[u++]);return s}function wu(n,t){var r=-1,e=n.length;for(t||(t=vn(e));++r<e;)t[r]=n[r];return t}function mu(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],a=e?e(r[f],n[f],f,r,n):void 0;void 0===a&&(a=n[f]),u?Jr(r,f,a):Kr(r,f,a)}return r}function xu(n,t){return function(r,e){var u=Uo(r)?it:Gr,i=t?t():{};return u(r,n,Xu(e,2),i)}}function ju(n){return Me((function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:void 0,o=u>2?r[2]:void 0;for(i=n.length>3&&"function"==typeof i?(u--,i):void 0,o&&li(r[0],r[1],o)&&(i=u<3?void 0:i,u=1),t=gn(t);++e<u;){var f=r[e];f&&n(t,f,e,i)}return t}))}function Au(n,t){return function(r,e){if(null==r)return r;if(!To(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=gn(r);(t?i--:++i<u)&&!1!==e(o[i],i,o););return r}}function ku(n){return function(t,r,e){for(var u=-1,i=gn(t),o=e(t),f=o.length;f--;){var a=o[n?f:++u];if(!1===r(i[a],a,i))break}return t}}function Ou(n){return function(t){var r=$t(t=lf(t))?Zt(t):void 0,e=r?r[0]:t.charAt(0),u=r?vu(r,1).join(""):t.slice(1);return e[n]()+u}}function Iu(n){return function(t){return pt(Pf(Uf(t).replace(zn,"")),n,"")}}function Ru(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Lr(n.prototype),e=n.apply(r,t);return Zo(e)?e:r}}function zu(n){return function(t,r,e){var u=gn(t);if(!To(t)){var i=Xu(r,3);t=jf(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:void 0}}function Eu(t){return Vu((function(r){var e=r.length,u=e,i=Cr.prototype.thru;for(t&&r.reverse();u--;){var o=r[u];if("function"!=typeof o)throw new wn(n);if(i&&!f&&"wrapper"==Yu(o))var f=new Cr([],!0)}for(u=f?u:e;++u<e;){var a=Yu(o=r[u]),c="wrapper"==a?Ju(o):void 0;f=c&&vi(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?f[Yu(c[0])].apply(f,c[3]):1==o.length&&vi(o)?f[a]():f.thru(o)}return function(){var n=arguments,t=n[0];if(f&&1==n.length&&Uo(t))return f.plant(t).value();for(var u=0,i=e?r[u].apply(this,n):t;++u<e;)i=r[u].call(this,i);return i}}))}function Su(n,t,r,e,u,i,o,f,a,c){var l=128&t,s=1&t,v=2&t,h=24&t,p=512&t,d=v?void 0:Ru(n);return function _(){for(var g=arguments.length,y=vn(g),b=g;b--;)y[b]=arguments[b];if(h)var w=Qu(_),m=Ct(y,w);if(e&&(y=yu(y,e,u,h)),i&&(y=bu(y,i,o,h)),g-=m,h&&g<c){var x=Mt(y,w);return $u(n,t,Su,_.placeholder,r,y,x,f,a,c-g)}var j=s?r:this,A=v?j[n]:n;return g=y.length,f?y=bi(y,f):p&&g>1&&y.reverse(),l&&a<g&&(y.length=a),this&&this!==qn&&this instanceof _&&(A=d||Ru(A)),A.apply(j,y)}}function Lu(n,t){return function(r,e){return function(n,t,r,e){return se(n,(function(n,u,i){t(e,r(n),u,i)})),e}(r,n,t(e),{})}}function Wu(n,t){return function(r,e){var u;if(void 0===r&&void 0===e)return t;if(void 0!==r&&(u=r),void 0!==e){if(void 0===u)return e;"string"==typeof r||"string"==typeof e?(r=nu(r),e=nu(e)):(r=Xe(r),e=Xe(e)),u=n(r,e)}return u}}function Cu(n){return Vu((function(t){return t=vt(t,zt(Xu())),Me((function(r){var e=this;return n(t,(function(n){return ut(n,e,r)}))}))}))}function Uu(n,t){var r=(t=void 0===t?" ":nu(t)).length;if(r<2)return r?Ne(t,n):t;var e=Ne(t,rr(n/qt(t)));return $t(t)?vu(Zt(e),0,n).join(""):e.slice(0,n)}function Bu(n){return function(t,r,e){return e&&"number"!=typeof e&&li(t,r,e)&&(r=e=void 0),t=uf(t),void 0===r?(r=t,t=0):r=uf(r),function(n,t,r,e){for(var u=-1,i=cr(rr((t-n)/(r||1)),0),o=vn(i);i--;)o[e?i:++u]=n,n+=r;return o}(t,r,e=void 0===e?t<r?1:-1:uf(e),n)}}function Tu(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=af(t),r=af(r)),n(t,r)}}function $u(n,t,r,e,u,i,o,f,a,c){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var s=[n,t,u,l?i:void 0,l?o:void 0,l?void 0:i,l?void 0:o,f,a,c],v=r.apply(void 0,s);return vi(n)&&wi(v,s),v.placeholder=e,ji(v,n,t)}function Du(n){var t=_n[n];return function(n,r){if(n=af(n),r=null==r?0:lr(of(r),292)){var e=(lf(n)+"e").split("e");return+((e=(lf(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return t(n)}}var Nu=yr&&1/Ft(new yr([,-0]))[1]==1/0?function(n){return new yr(n)}:na;function Mu(n){return function(t){var r=ii(t);return r==l?Dt(t):r==p?Pt(t):function(n,t){return vt(t,(function(t){return[t,n[t]]}))}(t,n(t))}}function Fu(r,e,u,i,o,f,a,c){var l=2&e;if(!l&&"function"!=typeof r)throw new wn(n);var s=i?i.length:0;if(s||(e&=-97,i=o=void 0),a=void 0===a?a:cr(of(a),0),c=void 0===c?c:of(c),s-=o?o.length:0,64&e){var v=i,h=o;i=o=void 0}var p=l?void 0:Ju(r),d=[r,e,u,i,o,v,h,f,a,c];if(p&&function(n,r){var e=n[1],u=r[1],i=e|u,o=i<131,f=128==u&&8==e||128==u&&256==e&&n[7].length<=r[8]||384==u&&r[7].length<=r[8]&&8==e;if(!o&&!f)return n;1&u&&(n[2]=r[2],i|=1&e?0:4);var a=r[3];if(a){var c=n[3];n[3]=c?yu(c,a,r[4]):a,n[4]=c?Mt(n[3],t):r[4]}(a=r[5])&&(c=n[5],n[5]=c?bu(c,a,r[6]):a,n[6]=c?Mt(n[5],t):r[6]);(a=r[7])&&(n[7]=a);128&u&&(n[8]=null==n[8]?r[8]:lr(n[8],r[8]));null==n[9]&&(n[9]=r[9]);n[0]=r[0],n[1]=i}(d,p),r=d[0],e=d[1],u=d[2],i=d[3],o=d[4],!(c=d[9]=void 0===d[9]?l?0:r.length:cr(d[9]-s,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||16==e?function(n,t,r){var e=Ru(n);return function u(){for(var i=arguments.length,o=vn(i),f=i,a=Qu(u);f--;)o[f]=arguments[f];var c=i<3&&o[0]!==a&&o[i-1]!==a?[]:Mt(o,a);if((i-=c.length)<r)return $u(n,t,Su,u.placeholder,void 0,o,c,void 0,void 0,r-i);var l=this&&this!==qn&&this instanceof u?e:n;return ut(l,this,o)}}(r,e,c):32!=e&&33!=e||o.length?Su.apply(void 0,d):function(n,t,r,e){var u=1&t,i=Ru(n);return function t(){for(var o=-1,f=arguments.length,a=-1,c=e.length,l=vn(c+f),s=this&&this!==qn&&this instanceof t?i:n;++a<c;)l[a]=e[a];for(;f--;)l[a++]=arguments[++o];return ut(s,u?r:this,l)}}(r,e,u,i);else var _=function(n,t,r){var e=1&t,u=Ru(n);return function t(){var i=this&&this!==qn&&this instanceof t?u:n;return i.apply(e?r:this,arguments)}}(r,e,u);return ji((p?Ze:wi)(_,d),r,e)}function Pu(n,t,r,e){return void 0===n||So(n,jn[r])&&!On.call(e,r)?t:n}function qu(n,t,r,e,u,i){return Zo(n)&&Zo(t)&&(i.set(t,n),We(n,t,void 0,qu,i),i.delete(t)),n}function Zu(n){return Ho(n)?void 0:n}function Ku(n,t,r,e,u,i){var o=1&r,f=n.length,a=t.length;if(f!=a&&!(o&&a>f))return!1;var c=i.get(n);if(c&&i.get(t))return c==t;var l=-1,s=!0,v=2&r?new Dr:void 0;for(i.set(n,t),i.set(t,n);++l<f;){var h=n[l],p=t[l];if(e)var d=o?e(p,h,l,t,n,i):e(h,p,l,n,t,i);if(void 0!==d){if(d)continue;s=!1;break}if(v){if(!_t(t,(function(n,t){if(!St(v,t)&&(h===n||u(h,n,r,e,i)))return v.push(t)}))){s=!1;break}}else if(h!==p&&!u(h,p,r,e,i)){s=!1;break}}return i.delete(n),i.delete(t),s}function Vu(n){return xi(gi(n,void 0,Ui),n+"")}function Gu(n){return de(n,jf,ei)}function Hu(n){return de(n,Af,ui)}var Ju=mr?function(n){return mr.get(n)}:na;function Yu(n){for(var t=n.name+"",r=xr[t],e=On.call(xr,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function Qu(n){return(On.call(Sr,"placeholder")?Sr:n).placeholder}function Xu(){var n=Sr.iteratee||Jf;return n=n===Jf?Oe:n,arguments.length?n(arguments[0],arguments[1]):n}function ni(n,t){var r,e,u=n.__data__;return("string"==(e=typeof(r=t))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==r:null===r)?u["string"==typeof t?"string":"hash"]:u.map}function ti(n){for(var t=jf(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,di(u)]}return t}function ri(n,t){var r=function(n,t){return null==n?void 0:n[t]}(n,t);return ke(r)?r:void 0}var ei=ur?function(n){return null==n?[]:(n=gn(n),ct(ur(n),(function(t){return kt.call(n,t)})))}:fa,ui=ur?function(n){for(var t=[];n;)ht(t,ei(n)),n=Hn(n);return t}:fa,ii=_e;function oi(n,t,r){for(var e=-1,u=(t=lu(t,n)).length,i=!1;++e<u;){var o=Ii(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:!!(u=null==n?0:n.length)&&qo(u)&&ci(o,u)&&(Uo(n)||Co(n))}function fi(n){return"function"!=typeof n.constructor||pi(n)?{}:Lr(Hn(n))}function ai(n){return Uo(n)||Co(n)||!!(Ht&&n&&n[Ht])}function ci(n,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof n||un.test(n))&&n>-1&&n%1==0&&n<t}function li(n,t,r){if(!Zo(r))return!1;var e=typeof t;return!!("number"==e?To(r)&&ci(t,r.length):"string"==e&&t in r)&&So(r[t],n)}function si(n,t){if(Uo(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!Xo(n))||(D.test(n)||!$.test(n)||null!=t&&n in gn(t))}function vi(n){var t=Yu(n),r=Sr[t];if("function"!=typeof r||!(t in Ur.prototype))return!1;if(n===r)return!0;var e=Ju(r);return!!e&&n===e[0]}(dr&&ii(new dr(new ArrayBuffer(1)))!=b||_r&&ii(new _r)!=l||gr&&"[object Promise]"!=ii(gr.resolve())||yr&&ii(new yr)!=p||br&&ii(new br)!=g)&&(ii=function(n){var t=_e(n),r=t==v?n.constructor:void 0,e=r?Ri(r):"";if(e)switch(e){case jr:return b;case Ar:return l;case kr:return"[object Promise]";case Or:return p;case Ir:return g}return t});var hi=An?Fo:aa;function pi(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||jn)}function di(n){return n==n&&!Zo(n)}function _i(n,t){return function(r){return null!=r&&(r[n]===t&&(void 0!==t||n in gn(r)))}}function gi(n,t,r){return t=cr(void 0===t?n.length-1:t,0),function(){for(var e=arguments,u=-1,i=cr(e.length-t,0),o=vn(i);++u<i;)o[u]=e[t+u];u=-1;for(var f=vn(t+1);++u<t;)f[u]=e[u];return f[t]=r(o),ut(n,this,f)}}function yi(n,t){return t.length<2?n:pe(n,Ge(t,0,-1))}function bi(n,t){for(var r=n.length,e=lr(t.length,r),u=wu(n);e--;){var i=t[e];n[e]=ci(i,r)?u[i]:void 0}return n}var wi=Ai(Ze),mi=tr||function(n,t){return qn.setTimeout(n,t)},xi=Ai(Ke);function ji(n,t,e){var u=t+"";return xi(n,function(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(V,"{\n/* [wrapped with "+t+"] */\n")}(u,function(n,t){return ot(r,(function(r){var e="_."+r[0];t&r[1]&&!lt(n,e)&&n.push(e)})),n.sort()}(function(n){var t=n.match(G);return t?t[1].split(H):[]}(u),e)))}function Ai(n){var t=0,r=0;return function(){var e=sr(),u=16-(e-r);if(r=e,u>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function ki(n,t){var r=-1,e=n.length,u=e-1;for(t=void 0===t?e:t;++r<t;){var i=De(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}var Oi=function(n){var t=ko(n,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}((function(n){var t=[];return N.test(n)&&t.push(""),n.replace(M,(function(n,r,e,u){t.push(e?u.replace(Y,"$1"):r||n)})),t}));function Ii(n){if("string"==typeof n||Xo(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function Ri(n){if(null!=n){try{return kn.call(n)}catch(t){}try{return n+""}catch(t){}}return""}function zi(n){if(n instanceof Ur)return n.clone();var t=new Cr(n.__wrapped__,n.__chain__);return t.__actions__=wu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var Ei=Me((function(n,t){return $o(n)?re(n,ae(t,1,$o,!0)):[]})),Si=Me((function(n,t){var r=Ni(t);return $o(r)&&(r=void 0),$o(n)?re(n,ae(t,1,$o,!0),Xu(r,2)):[]})),Li=Me((function(n,t){var r=Ni(t);return $o(r)&&(r=void 0),$o(n)?re(n,ae(t,1,$o,!0),void 0,r):[]}));function Wi(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:of(r);return u<0&&(u=cr(e+u,0)),bt(n,Xu(t,3),u)}function Ci(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return void 0!==r&&(u=of(r),u=r<0?cr(e+u,0):lr(u,e-1)),bt(n,Xu(t,3),u,!0)}function Ui(n){return(null==n?0:n.length)?ae(n,1):[]}function Bi(n){return n&&n.length?n[0]:void 0}var Ti=Me((function(n){var t=vt(n,au);return t.length&&t[0]===n[0]?we(t):[]})),$i=Me((function(n){var t=Ni(n),r=vt(n,au);return t===Ni(r)?t=void 0:r.pop(),r.length&&r[0]===n[0]?we(r,Xu(t,2)):[]})),Di=Me((function(n){var t=Ni(n),r=vt(n,au);return(t="function"==typeof t?t:void 0)&&r.pop(),r.length&&r[0]===n[0]?we(r,void 0,t):[]}));function Ni(n){var t=null==n?0:n.length;return t?n[t-1]:void 0}var Mi=Me(Fi);function Fi(n,t){return n&&n.length&&t&&t.length?Te(n,t):n}var Pi=Vu((function(n,t){var r=null==n?0:n.length,e=Yr(n,t);return $e(n,vt(t,(function(n){return ci(n,r)?+n:n})).sort(gu)),e}));function qi(n){return null==n?n:pr.call(n)}var Zi=Me((function(n){return tu(ae(n,1,$o,!0))})),Ki=Me((function(n){var t=Ni(n);return $o(t)&&(t=void 0),tu(ae(n,1,$o,!0),Xu(t,2))})),Vi=Me((function(n){var t=Ni(n);return t="function"==typeof t?t:void 0,tu(ae(n,1,$o,!0),void 0,t)}));function Gi(n){if(!n||!n.length)return[];var t=0;return n=ct(n,(function(n){if($o(n))return t=cr(n.length,t),!0})),Rt(t,(function(t){return vt(n,At(t))}))}function Hi(n,t){if(!n||!n.length)return[];var r=Gi(n);return null==t?r:vt(r,(function(n){return ut(t,void 0,n)}))}var Ji=Me((function(n,t){return $o(n)?re(n,t):[]})),Yi=Me((function(n){return ou(ct(n,$o))})),Qi=Me((function(n){var t=Ni(n);return $o(t)&&(t=void 0),ou(ct(n,$o),Xu(t,2))})),Xi=Me((function(n){var t=Ni(n);return t="function"==typeof t?t:void 0,ou(ct(n,$o),void 0,t)})),no=Me(Gi);var to=Me((function(n){var t=n.length,r=t>1?n[t-1]:void 0;return r="function"==typeof r?(n.pop(),r):void 0,Hi(n,r)}));function ro(n){var t=Sr(n);return t.__chain__=!0,t}function eo(n,t){return t(n)}var uo=Vu((function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Yr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Ur&&ci(r)?((e=e.slice(r,+r+(t?1:0))).__actions__.push({func:eo,args:[u],thisArg:void 0}),new Cr(e,this.__chain__).thru((function(n){return t&&!n.length&&n.push(void 0),n}))):this.thru(u)}));var io=xu((function(n,t,r){On.call(n,r)?++n[r]:Jr(n,r,1)}));var oo=zu(Wi),fo=zu(Ci);function ao(n,t){return(Uo(n)?ot:ee)(n,Xu(t,3))}function co(n,t){return(Uo(n)?ft:ue)(n,Xu(t,3))}var lo=xu((function(n,t,r){On.call(n,r)?n[r].push(t):Jr(n,r,[t])}));var so=Me((function(n,t,r){var e=-1,u="function"==typeof t,i=To(n)?vn(n.length):[];return ee(n,(function(n){i[++e]=u?ut(t,n,r):me(n,t,r)})),i})),vo=xu((function(n,t,r){Jr(n,r,t)}));function ho(n,t){return(Uo(n)?vt:Ee)(n,Xu(t,3))}var po=xu((function(n,t,r){n[r?0:1].push(t)}),(function(){return[[],[]]}));var _o=Me((function(n,t){if(null==n)return[];var r=t.length;return r>1&&li(n,t[0],t[1])?t=[]:r>2&&li(t[0],t[1],t[2])&&(t=[t[0]]),Ue(n,ae(t,1),[])})),go=nr||function(){return qn.Date.now()};function yo(n,t,r){return t=r?void 0:t,Fu(n,128,void 0,void 0,void 0,void 0,t=n&&null==t?n.length:t)}function bo(t,r){var e;if("function"!=typeof r)throw new wn(n);return t=of(t),function(){return--t>0&&(e=r.apply(this,arguments)),t<=1&&(r=void 0),e}}var wo=Me((function(n,t,r){var e=1;if(r.length){var u=Mt(r,Qu(wo));e|=32}return Fu(n,e,t,r,u)})),mo=Me((function(n,t,r){var e=3;if(r.length){var u=Mt(r,Qu(mo));e|=32}return Fu(t,e,n,r,u)}));function xo(t,r,e){var u,i,o,f,a,c,l=0,s=!1,v=!1,h=!0;if("function"!=typeof t)throw new wn(n);function p(n){var r=u,e=i;return u=i=void 0,l=n,f=t.apply(e,r)}function d(n){return l=n,a=mi(g,r),s?p(n):f}function _(n){var t=n-c;return void 0===c||t>=r||t<0||v&&n-l>=o}function g(){var n=go();if(_(n))return y(n);a=mi(g,function(n){var t=r-(n-c);return v?lr(t,o-(n-l)):t}(n))}function y(n){return a=void 0,h&&u?p(n):(u=i=void 0,f)}function b(){var n=go(),t=_(n);if(u=arguments,i=this,c=n,t){if(void 0===a)return d(c);if(v)return a=mi(g,r),p(c)}return void 0===a&&(a=mi(g,r)),f}return r=af(r)||0,Zo(e)&&(s=!!e.leading,o=(v="maxWait"in e)?cr(af(e.maxWait)||0,r):o,h="trailing"in e?!!e.trailing:h),b.cancel=function(){void 0!==a&&hu(a),l=0,u=c=i=a=void 0},b.flush=function(){return void 0===a?f:y(go())},b}var jo=Me((function(n,t){return te(n,1,t)})),Ao=Me((function(n,t,r){return te(n,af(t)||0,r)}));function ko(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new wn(n);var e=function(){var n=arguments,u=r?r.apply(this,n):n[0],i=e.cache;if(i.has(u))return i.get(u);var o=t.apply(this,n);return e.cache=i.set(u,o)||i,o};return e.cache=new(ko.Cache||$r),e}function Oo(t){if("function"!=typeof t)throw new wn(n);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}ko.Cache=$r;var Io=su((function(n,t){var r=(t=1==t.length&&Uo(t[0])?vt(t[0],zt(Xu())):vt(ae(t,1),zt(Xu()))).length;return Me((function(e){for(var u=-1,i=lr(e.length,r);++u<i;)e[u]=t[u].call(this,e[u]);return ut(n,this,e)}))})),Ro=Me((function(n,t){return Fu(n,32,void 0,t,Mt(t,Qu(Ro)))})),zo=Me((function(n,t){return Fu(n,64,void 0,t,Mt(t,Qu(zo)))})),Eo=Vu((function(n,t){return Fu(n,256,void 0,void 0,void 0,t)}));function So(n,t){return n===t||n!=n&&t!=t}var Lo=Tu(ge),Wo=Tu((function(n,t){return n>=t})),Co=xe(function(){return arguments}())?xe:function(n){return Ko(n)&&On.call(n,"callee")&&!kt.call(n,"callee")},Uo=vn.isArray,Bo=Jn?zt(Jn):function(n){return Ko(n)&&_e(n)==y};function To(n){return null!=n&&qo(n.length)&&!Fo(n)}function $o(n){return Ko(n)&&To(n)}var Do=ir||aa,No=Yn?zt(Yn):function(n){return Ko(n)&&_e(n)==o};function Mo(n){if(!Ko(n))return!1;var t=_e(n);return t==f||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!Ho(n)}function Fo(n){if(!Zo(n))return!1;var t=_e(n);return t==a||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Po(n){return"number"==typeof n&&n==of(n)}function qo(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991}function Zo(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function Ko(n){return null!=n&&"object"==typeof n}var Vo=Qn?zt(Qn):function(n){return Ko(n)&&ii(n)==l};function Go(n){return"number"==typeof n||Ko(n)&&_e(n)==s}function Ho(n){if(!Ko(n)||_e(n)!=v)return!1;var t=Hn(n);if(null===t)return!0;var r=On.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&kn.call(r)==Wn}var Jo=Xn?zt(Xn):function(n){return Ko(n)&&_e(n)==h};var Yo=nt?zt(nt):function(n){return Ko(n)&&ii(n)==p};function Qo(n){return"string"==typeof n||!Uo(n)&&Ko(n)&&_e(n)==d}function Xo(n){return"symbol"==typeof n||Ko(n)&&_e(n)==_}var nf=tt?zt(tt):function(n){return Ko(n)&&qo(n.length)&&!!Tn[_e(n)]};var tf=Tu(ze),rf=Tu((function(n,t){return n<=t}));function ef(n){if(!n)return[];if(To(n))return Qo(n)?Zt(n):wu(n);if(Jt&&n[Jt])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Jt]());var t=ii(n);return(t==l?Dt:t==p?Ft:Lf)(n)}function uf(n){return n?(n=af(n))===1/0||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function of(n){var t=uf(n),r=t%1;return t==t?r?t-r:t:0}function ff(n){return n?Qr(of(n),0,4294967295):0}function af(n){if("number"==typeof n)return n;if(Xo(n))return NaN;if(Zo(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=Zo(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(q,"");var r=tn.test(n);return r||en.test(n)?Mn(n.slice(2),r?2:8):nn.test(n)?NaN:+n}function cf(n){return mu(n,Af(n))}function lf(n){return null==n?"":nu(n)}var sf=ju((function(n,t){if(pi(t)||To(t))mu(t,jf(t),n);else for(var r in t)On.call(t,r)&&Kr(n,r,t[r])})),vf=ju((function(n,t){mu(t,Af(t),n)})),hf=ju((function(n,t,r,e){mu(t,Af(t),n,e)})),pf=ju((function(n,t,r,e){mu(t,jf(t),n,e)})),df=Vu(Yr);var _f=Me((function(n){return n.push(void 0,Pu),ut(hf,void 0,n)})),gf=Me((function(n){return n.push(void 0,qu),ut(Of,void 0,n)}));function yf(n,t,r){var e=null==n?void 0:pe(n,t);return void 0===e?r:e}function bf(n,t){return null!=n&&oi(n,t,be)}var wf=Lu((function(n,t,r){n[t]=r}),Kf(Hf)),mf=Lu((function(n,t,r){On.call(n,t)?n[t].push(r):n[t]=[r]}),Xu),xf=Me(me);function jf(n){return To(n)?Mr(n):Ie(n)}function Af(n){return To(n)?Mr(n,!0):Re(n)}var kf=ju((function(n,t,r){We(n,t,r)})),Of=ju((function(n,t,r,e){We(n,t,r,e)})),If=Vu((function(n,t){var r={};if(null==n)return r;var e=!1;t=vt(t,(function(t){return t=lu(t,n),e||(e=t.length>1),t})),mu(n,Hu(n),r),e&&(r=Xr(r,7,Zu));for(var u=t.length;u--;)ru(r,t[u]);return r}));var Rf=Vu((function(n,t){return null==n?{}:function(n,t){return Be(n,t,(function(t,r){return bf(n,r)}))}(n,t)}));function zf(n,t){if(null==n)return{};var r=vt(Hu(n),(function(n){return[n]}));return t=Xu(t),Be(n,r,(function(n,r){return t(n,r[0])}))}var Ef=Mu(jf),Sf=Mu(Af);function Lf(n){return null==n?[]:Et(n,jf(n))}var Wf=Iu((function(n,t,r){return t=t.toLowerCase(),n+(r?Cf(t):t)}));function Cf(n){return Ff(lf(n).toLowerCase())}function Uf(n){return(n=lf(n))&&n.replace(on,Ut).replace(En,"")}var Bf=Iu((function(n,t,r){return n+(r?"-":"")+t.toLowerCase()})),Tf=Iu((function(n,t,r){return n+(r?" ":"")+t.toLowerCase()})),$f=Ou("toLowerCase");var Df=Iu((function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}));var Nf=Iu((function(n,t,r){return n+(r?" ":"")+Ff(t)}));var Mf=Iu((function(n,t,r){return n+(r?" ":"")+t.toUpperCase()})),Ff=Ou("toUpperCase");function Pf(n,t,r){return n=lf(n),void 0===(t=r?void 0:t)?function(n){return Cn.test(n)}(n)?function(n){return n.match(Ln)||[]}(n):function(n){return n.match(J)||[]}(n):n.match(t)||[]}var qf=Me((function(n,t){try{return ut(n,void 0,t)}catch(r){return Mo(r)?r:new pn(r)}})),Zf=Vu((function(n,t){return ot(t,(function(t){t=Ii(t),Jr(n,t,wo(n[t],n))})),n}));function Kf(n){return function(){return n}}var Vf=Eu(),Gf=Eu(!0);function Hf(n){return n}function Jf(n){return Oe("function"==typeof n?n:Xr(n,1))}var Yf=Me((function(n,t){return function(r){return me(r,n,t)}})),Qf=Me((function(n,t){return function(r){return me(n,r,t)}}));function Xf(n,t,r){var e=jf(t),u=he(t,e);null!=r||Zo(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=he(t,jf(t)));var i=!(Zo(r)&&"chain"in r&&!r.chain),o=Fo(n);return ot(u,(function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__),u=r.__actions__=wu(this.__actions__);return u.push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,ht([this.value()],arguments))})})),n}function na(){}var ta=Cu(vt),ra=Cu(at),ea=Cu(_t);function ua(n){return si(n)?At(Ii(n)):function(n){return function(t){return pe(t,n)}}(n)}var ia=Bu(),oa=Bu(!0);function fa(){return[]}function aa(){return!1}var ca=Wu((function(n,t){return n+t}),0),la=Du("ceil"),sa=Wu((function(n,t){return n/t}),1),va=Du("floor");var ha,pa=Wu((function(n,t){return n*t}),1),da=Du("round"),_a=Wu((function(n,t){return n-t}),0);return Sr.after=function(t,r){if("function"!=typeof r)throw new wn(n);return t=of(t),function(){if(--t<1)return r.apply(this,arguments)}},Sr.ary=yo,Sr.assign=sf,Sr.assignIn=vf,Sr.assignInWith=hf,Sr.assignWith=pf,Sr.at=df,Sr.before=bo,Sr.bind=wo,Sr.bindAll=Zf,Sr.bindKey=mo,Sr.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Uo(n)?n:[n]},Sr.chain=ro,Sr.chunk=function(n,t,r){t=(r?li(n,t,r):void 0===t)?1:cr(of(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=vn(rr(e/t));u<e;)o[i++]=Ge(n,u,u+=t);return o},Sr.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},Sr.concat=function(){var n=arguments.length;if(!n)return[];for(var t=vn(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return ht(Uo(r)?wu(r):[r],ae(t,1))},Sr.cond=function(t){var r=null==t?0:t.length,e=Xu();return t=r?vt(t,(function(t){if("function"!=typeof t[1])throw new wn(n);return[e(t[0]),t[1]]})):[],Me((function(n){for(var e=-1;++e<r;){var u=t[e];if(ut(u[0],this,n))return ut(u[1],this,n)}}))},Sr.conforms=function(n){return function(n){var t=jf(n);return function(r){return ne(r,n,t)}}(Xr(n,1))},Sr.constant=Kf,Sr.countBy=io,Sr.create=function(n,t){var r=Lr(n);return null==t?r:Hr(r,t)},Sr.curry=function n(t,r,e){var u=Fu(t,8,void 0,void 0,void 0,void 0,void 0,r=e?void 0:r);return u.placeholder=n.placeholder,u},Sr.curryRight=function n(t,r,e){var u=Fu(t,16,void 0,void 0,void 0,void 0,void 0,r=e?void 0:r);return u.placeholder=n.placeholder,u},Sr.debounce=xo,Sr.defaults=_f,Sr.defaultsDeep=gf,Sr.defer=jo,Sr.delay=Ao,Sr.difference=Ei,Sr.differenceBy=Si,Sr.differenceWith=Li,Sr.drop=function(n,t,r){var e=null==n?0:n.length;return e?Ge(n,(t=r||void 0===t?1:of(t))<0?0:t,e):[]},Sr.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?Ge(n,0,(t=e-(t=r||void 0===t?1:of(t)))<0?0:t):[]},Sr.dropRightWhile=function(n,t){return n&&n.length?uu(n,Xu(t,3),!0,!0):[]},Sr.dropWhile=function(n,t){return n&&n.length?uu(n,Xu(t,3),!0):[]},Sr.fill=function(n,t,r,e){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&li(n,t,r)&&(r=0,e=u),function(n,t,r,e){var u=n.length;for((r=of(r))<0&&(r=-r>u?0:u+r),(e=void 0===e||e>u?u:of(e))<0&&(e+=u),e=r>e?0:ff(e);r<e;)n[r++]=t;return n}(n,t,r,e)):[]},Sr.filter=function(n,t){return(Uo(n)?ct:fe)(n,Xu(t,3))},Sr.flatMap=function(n,t){return ae(ho(n,t),1)},Sr.flatMapDeep=function(n,t){return ae(ho(n,t),1/0)},Sr.flatMapDepth=function(n,t,r){return r=void 0===r?1:of(r),ae(ho(n,t),r)},Sr.flatten=Ui,Sr.flattenDeep=function(n){return(null==n?0:n.length)?ae(n,1/0):[]},Sr.flattenDepth=function(n,t){return(null==n?0:n.length)?ae(n,t=void 0===t?1:of(t)):[]},Sr.flip=function(n){return Fu(n,512)},Sr.flow=Vf,Sr.flowRight=Gf,Sr.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},Sr.functions=function(n){return null==n?[]:he(n,jf(n))},Sr.functionsIn=function(n){return null==n?[]:he(n,Af(n))},Sr.groupBy=lo,Sr.initial=function(n){return(null==n?0:n.length)?Ge(n,0,-1):[]},Sr.intersection=Ti,Sr.intersectionBy=$i,Sr.intersectionWith=Di,Sr.invert=wf,Sr.invertBy=mf,Sr.invokeMap=so,Sr.iteratee=Jf,Sr.keyBy=vo,Sr.keys=jf,Sr.keysIn=Af,Sr.map=ho,Sr.mapKeys=function(n,t){var r={};return t=Xu(t,3),se(n,(function(n,e,u){Jr(r,t(n,e,u),n)})),r},Sr.mapValues=function(n,t){var r={};return t=Xu(t,3),se(n,(function(n,e,u){Jr(r,e,t(n,e,u))})),r},Sr.matches=function(n){return Se(Xr(n,1))},Sr.matchesProperty=function(n,t){return Le(n,Xr(t,1))},Sr.memoize=ko,Sr.merge=kf,Sr.mergeWith=Of,Sr.method=Yf,Sr.methodOf=Qf,Sr.mixin=Xf,Sr.negate=Oo,Sr.nthArg=function(n){return n=of(n),Me((function(t){return Ce(t,n)}))},Sr.omit=If,Sr.omitBy=function(n,t){return zf(n,Oo(Xu(t)))},Sr.once=function(n){return bo(2,n)},Sr.orderBy=function(n,t,r,e){return null==n?[]:(Uo(t)||(t=null==t?[]:[t]),Uo(r=e?void 0:r)||(r=null==r?[]:[r]),Ue(n,t,r))},Sr.over=ta,Sr.overArgs=Io,Sr.overEvery=ra,Sr.overSome=ea,Sr.partial=Ro,Sr.partialRight=zo,Sr.partition=po,Sr.pick=Rf,Sr.pickBy=zf,Sr.property=ua,Sr.propertyOf=function(n){return function(t){return null==n?void 0:pe(n,t)}},Sr.pull=Mi,Sr.pullAll=Fi,Sr.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?Te(n,t,Xu(r,2)):n},Sr.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Te(n,t,void 0,r):n},Sr.pullAt=Pi,Sr.range=ia,Sr.rangeRight=oa,Sr.rearg=Eo,Sr.reject=function(n,t){return(Uo(n)?ct:fe)(n,Oo(Xu(t,3)))},Sr.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=Xu(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return $e(n,u),r},Sr.rest=function(t,r){if("function"!=typeof t)throw new wn(n);return Me(t,r=void 0===r?r:of(r))},Sr.reverse=qi,Sr.sampleSize=function(n,t,r){return t=(r?li(n,t,r):void 0===t)?1:of(t),(Uo(n)?Pr:Pe)(n,t)},Sr.set=function(n,t,r){return null==n?n:qe(n,t,r)},Sr.setWith=function(n,t,r,e){return e="function"==typeof e?e:void 0,null==n?n:qe(n,t,r,e)},Sr.shuffle=function(n){return(Uo(n)?qr:Ve)(n)},Sr.slice=function(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&li(n,t,r)?(t=0,r=e):(t=null==t?0:of(t),r=void 0===r?e:of(r)),Ge(n,t,r)):[]},Sr.sortBy=_o,Sr.sortedUniq=function(n){return n&&n.length?Qe(n):[]},Sr.sortedUniqBy=function(n,t){return n&&n.length?Qe(n,Xu(t,2)):[]},Sr.split=function(n,t,r){return r&&"number"!=typeof r&&li(n,t,r)&&(t=r=void 0),(r=void 0===r?4294967295:r>>>0)?(n=lf(n))&&("string"==typeof t||null!=t&&!Jo(t))&&!(t=nu(t))&&$t(n)?vu(Zt(n),0,r):n.split(t,r):[]},Sr.spread=function(t,r){if("function"!=typeof t)throw new wn(n);return r=null==r?0:cr(of(r),0),Me((function(n){var e=n[r],u=vu(n,0,r);return e&&ht(u,e),ut(t,this,u)}))},Sr.tail=function(n){var t=null==n?0:n.length;return t?Ge(n,1,t):[]},Sr.take=function(n,t,r){return n&&n.length?Ge(n,0,(t=r||void 0===t?1:of(t))<0?0:t):[]},Sr.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?Ge(n,(t=e-(t=r||void 0===t?1:of(t)))<0?0:t,e):[]},Sr.takeRightWhile=function(n,t){return n&&n.length?uu(n,Xu(t,3),!1,!0):[]},Sr.takeWhile=function(n,t){return n&&n.length?uu(n,Xu(t,3)):[]},Sr.tap=function(n,t){return t(n),n},Sr.throttle=function(t,r,e){var u=!0,i=!0;if("function"!=typeof t)throw new wn(n);return Zo(e)&&(u="leading"in e?!!e.leading:u,i="trailing"in e?!!e.trailing:i),xo(t,r,{leading:u,maxWait:r,trailing:i})},Sr.thru=eo,Sr.toArray=ef,Sr.toPairs=Ef,Sr.toPairsIn=Sf,Sr.toPath=function(n){return Uo(n)?vt(n,Ii):Xo(n)?[n]:wu(Oi(lf(n)))},Sr.toPlainObject=cf,Sr.transform=function(n,t,r){var e=Uo(n),u=e||Do(n)||nf(n);if(t=Xu(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:Zo(n)&&Fo(i)?Lr(Hn(n)):{}}return(u?ot:se)(n,(function(n,e,u){return t(r,n,e,u)})),r},Sr.unary=function(n){return yo(n,1)},Sr.union=Zi,Sr.unionBy=Ki,Sr.unionWith=Vi,Sr.uniq=function(n){return n&&n.length?tu(n):[]},Sr.uniqBy=function(n,t){return n&&n.length?tu(n,Xu(t,2)):[]},Sr.uniqWith=function(n,t){return t="function"==typeof t?t:void 0,n&&n.length?tu(n,void 0,t):[]},Sr.unset=function(n,t){return null==n||ru(n,t)},Sr.unzip=Gi,Sr.unzipWith=Hi,Sr.update=function(n,t,r){return null==n?n:eu(n,t,cu(r))},Sr.updateWith=function(n,t,r,e){return e="function"==typeof e?e:void 0,null==n?n:eu(n,t,cu(r),e)},Sr.values=Lf,Sr.valuesIn=function(n){return null==n?[]:Et(n,Af(n))},Sr.without=Ji,Sr.words=Pf,Sr.wrap=function(n,t){return Ro(cu(t),n)},Sr.xor=Yi,Sr.xorBy=Qi,Sr.xorWith=Xi,Sr.zip=no,Sr.zipObject=function(n,t){return fu(n||[],t||[],Kr)},Sr.zipObjectDeep=function(n,t){return fu(n||[],t||[],qe)},Sr.zipWith=to,Sr.entries=Ef,Sr.entriesIn=Sf,Sr.extend=vf,Sr.extendWith=hf,Xf(Sr,Sr),Sr.add=ca,Sr.attempt=qf,Sr.camelCase=Wf,Sr.capitalize=Cf,Sr.ceil=la,Sr.clamp=function(n,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=af(r))==r?r:0),void 0!==t&&(t=(t=af(t))==t?t:0),Qr(af(n),t,r)},Sr.clone=function(n){return Xr(n,4)},Sr.cloneDeep=function(n){return Xr(n,5)},Sr.cloneDeepWith=function(n,t){return Xr(n,5,t="function"==typeof t?t:void 0)},Sr.cloneWith=function(n,t){return Xr(n,4,t="function"==typeof t?t:void 0)},Sr.conformsTo=function(n,t){return null==t||ne(n,t,jf(t))},Sr.deburr=Uf,Sr.defaultTo=function(n,t){return null==n||n!=n?t:n},Sr.divide=sa,Sr.endsWith=function(n,t,r){n=lf(n),t=nu(t);var e=n.length,u=r=void 0===r?e:Qr(of(r),0,e);return(r-=t.length)>=0&&n.slice(r,u)==t},Sr.eq=So,Sr.escape=function(n){return(n=lf(n))&&C.test(n)?n.replace(L,Bt):n},Sr.escapeRegExp=function(n){return(n=lf(n))&&P.test(n)?n.replace(F,"\\$&"):n},Sr.every=function(n,t,r){var e=Uo(n)?at:ie;return r&&li(n,t,r)&&(t=void 0),e(n,Xu(t,3))},Sr.find=oo,Sr.findIndex=Wi,Sr.findKey=function(n,t){return yt(n,Xu(t,3),se)},Sr.findLast=fo,Sr.findLastIndex=Ci,Sr.findLastKey=function(n,t){return yt(n,Xu(t,3),ve)},Sr.floor=va,Sr.forEach=ao,Sr.forEachRight=co,Sr.forIn=function(n,t){return null==n?n:ce(n,Xu(t,3),Af)},Sr.forInRight=function(n,t){return null==n?n:le(n,Xu(t,3),Af)},Sr.forOwn=function(n,t){return n&&se(n,Xu(t,3))},Sr.forOwnRight=function(n,t){return n&&ve(n,Xu(t,3))},Sr.get=yf,Sr.gt=Lo,Sr.gte=Wo,Sr.has=function(n,t){return null!=n&&oi(n,t,ye)},Sr.hasIn=bf,Sr.head=Bi,Sr.identity=Hf,Sr.includes=function(n,t,r,e){n=To(n)?n:Lf(n),r=r&&!e?of(r):0;var u=n.length;return r<0&&(r=cr(u+r,0)),Qo(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&wt(n,t,r)>-1},Sr.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:of(r);return u<0&&(u=cr(e+u,0)),wt(n,t,u)},Sr.inRange=function(n,t,r){return t=uf(t),void 0===r?(r=t,t=0):r=uf(r),function(n,t,r){return n>=lr(t,r)&&n<cr(t,r)}(n=af(n),t,r)},Sr.invoke=xf,Sr.isArguments=Co,Sr.isArray=Uo,Sr.isArrayBuffer=Bo,Sr.isArrayLike=To,Sr.isArrayLikeObject=$o,Sr.isBoolean=function(n){return!0===n||!1===n||Ko(n)&&_e(n)==i},Sr.isBuffer=Do,Sr.isDate=No,Sr.isElement=function(n){return Ko(n)&&1===n.nodeType&&!Ho(n)},Sr.isEmpty=function(n){if(null==n)return!0;if(To(n)&&(Uo(n)||"string"==typeof n||"function"==typeof n.splice||Do(n)||nf(n)||Co(n)))return!n.length;var t=ii(n);if(t==l||t==p)return!n.size;if(pi(n))return!Ie(n).length;for(var r in n)if(On.call(n,r))return!1;return!0},Sr.isEqual=function(n,t){return je(n,t)},Sr.isEqualWith=function(n,t,r){var e=(r="function"==typeof r?r:void 0)?r(n,t):void 0;return void 0===e?je(n,t,void 0,r):!!e},Sr.isError=Mo,Sr.isFinite=function(n){return"number"==typeof n&&or(n)},Sr.isFunction=Fo,Sr.isInteger=Po,Sr.isLength=qo,Sr.isMap=Vo,Sr.isMatch=function(n,t){return n===t||Ae(n,t,ti(t))},Sr.isMatchWith=function(n,t,r){return r="function"==typeof r?r:void 0,Ae(n,t,ti(t),r)},Sr.isNaN=function(n){return Go(n)&&n!=+n},Sr.isNative=function(n){if(hi(n))throw new pn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return ke(n)},Sr.isNil=function(n){return null==n},Sr.isNull=function(n){return null===n},Sr.isNumber=Go,Sr.isObject=Zo,Sr.isObjectLike=Ko,Sr.isPlainObject=Ho,Sr.isRegExp=Jo,Sr.isSafeInteger=function(n){return Po(n)&&n>=-9007199254740991&&n<=9007199254740991},Sr.isSet=Yo,Sr.isString=Qo,Sr.isSymbol=Xo,Sr.isTypedArray=nf,Sr.isUndefined=function(n){return void 0===n},Sr.isWeakMap=function(n){return Ko(n)&&ii(n)==g},Sr.isWeakSet=function(n){return Ko(n)&&"[object WeakSet]"==_e(n)},Sr.join=function(n,t){return null==n?"":fr.call(n,t)},Sr.kebabCase=Bf,Sr.last=Ni,Sr.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return void 0!==r&&(u=(u=of(r))<0?cr(e+u,0):lr(u,e-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,u):bt(n,xt,u,!0)},Sr.lowerCase=Tf,Sr.lowerFirst=$f,Sr.lt=tf,Sr.lte=rf,Sr.max=function(n){return n&&n.length?oe(n,Hf,ge):void 0},Sr.maxBy=function(n,t){return n&&n.length?oe(n,Xu(t,2),ge):void 0},Sr.mean=function(n){return jt(n,Hf)},Sr.meanBy=function(n,t){return jt(n,Xu(t,2))},Sr.min=function(n){return n&&n.length?oe(n,Hf,ze):void 0},Sr.minBy=function(n,t){return n&&n.length?oe(n,Xu(t,2),ze):void 0},Sr.stubArray=fa,Sr.stubFalse=aa,Sr.stubObject=function(){return{}},Sr.stubString=function(){return""},Sr.stubTrue=function(){return!0},Sr.multiply=pa,Sr.nth=function(n,t){return n&&n.length?Ce(n,of(t)):void 0},Sr.noConflict=function(){return qn._===this&&(qn._=Dn),this},Sr.noop=na,Sr.now=go,Sr.pad=function(n,t,r){n=lf(n);var e=(t=of(t))?qt(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return Uu(er(u),r)+n+Uu(rr(u),r)},Sr.padEnd=function(n,t,r){n=lf(n);var e=(t=of(t))?qt(n):0;return t&&e<t?n+Uu(t-e,r):n},Sr.padStart=function(n,t,r){n=lf(n);var e=(t=of(t))?qt(n):0;return t&&e<t?Uu(t-e,r)+n:n},Sr.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),vr(lf(n).replace(Z,""),t||0)},Sr.random=function(n,t,r){if(r&&"boolean"!=typeof r&&li(n,t,r)&&(t=r=void 0),void 0===r&&("boolean"==typeof t?(r=t,t=void 0):"boolean"==typeof n&&(r=n,n=void 0)),void 0===n&&void 0===t?(n=0,t=1):(n=uf(n),void 0===t?(t=n,n=0):t=uf(t)),n>t){var e=n;n=t,t=e}if(r||n%1||t%1){var u=hr();return lr(n+u*(t-n+Nn("1e-"+((u+"").length-1))),t)}return De(n,t)},Sr.reduce=function(n,t,r){var e=Uo(n)?pt:Ot,u=arguments.length<3;return e(n,Xu(t,4),r,u,ee)},Sr.reduceRight=function(n,t,r){var e=Uo(n)?dt:Ot,u=arguments.length<3;return e(n,Xu(t,4),r,u,ue)},Sr.repeat=function(n,t,r){return t=(r?li(n,t,r):void 0===t)?1:of(t),Ne(lf(n),t)},Sr.replace=function(){var n=arguments,t=lf(n[0]);return n.length<3?t:t.replace(n[1],n[2])},Sr.result=function(n,t,r){var e=-1,u=(t=lu(t,n)).length;for(u||(u=1,n=void 0);++e<u;){var i=null==n?void 0:n[Ii(t[e])];void 0===i&&(e=u,i=r),n=Fo(i)?i.call(n):i}return n},Sr.round=da,Sr.runInContext=cn,Sr.sample=function(n){return(Uo(n)?Fr:Fe)(n)},Sr.size=function(n){if(null==n)return 0;if(To(n))return Qo(n)?qt(n):n.length;var t=ii(n);return t==l||t==p?n.size:Ie(n).length},Sr.snakeCase=Df,Sr.some=function(n,t,r){var e=Uo(n)?_t:He;return r&&li(n,t,r)&&(t=void 0),e(n,Xu(t,3))},Sr.sortedIndex=function(n,t){return Je(n,t)},Sr.sortedIndexBy=function(n,t,r){return Ye(n,t,Xu(r,2))},Sr.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=Je(n,t);if(e<r&&So(n[e],t))return e}return-1},Sr.sortedLastIndex=function(n,t){return Je(n,t,!0)},Sr.sortedLastIndexBy=function(n,t,r){return Ye(n,t,Xu(r,2),!0)},Sr.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var r=Je(n,t,!0)-1;if(So(n[r],t))return r}return-1},Sr.startCase=Nf,Sr.startsWith=function(n,t,r){return n=lf(n),r=null==r?0:Qr(of(r),0,n.length),t=nu(t),n.slice(r,r+t.length)==t},Sr.subtract=_a,Sr.sum=function(n){return n&&n.length?It(n,Hf):0},Sr.sumBy=function(n,t){return n&&n.length?It(n,Xu(t,2)):0},Sr.template=function(n,t,r){var e=Sr.templateSettings;r&&li(n,t,r)&&(t=void 0),n=lf(n),t=hf({},t,e,Pu);var u,i,o=hf({},t.imports,e.imports,Pu),f=jf(o),a=Et(o,f),c=0,l=t.interpolate||fn,s="__p += '",v=yn((t.escape||fn).source+"|"+l.source+"|"+(l===T?Q:fn).source+"|"+(t.evaluate||fn).source+"|$","g"),h="//# sourceURL="+("sourceURL"in t?t.sourceURL:"lodash.templateSources["+ ++Bn+"]")+"\n";n.replace(v,(function(t,r,e,o,f,a){return e||(e=o),s+=n.slice(c,a).replace(an,Tt),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),c=a+t.length,t})),s+="';\n";var p=t.variable;p||(s="with (obj) {\n"+s+"\n}\n"),s=(i?s.replace(R,""):s).replace(z,"$1").replace(E,"$1;"),s="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";var d=qf((function(){return dn(f,h+"return "+s).apply(void 0,a)}));if(d.source=s,Mo(d))throw d;return d},Sr.times=function(n,t){if((n=of(n))<1||n>9007199254740991)return[];var r=4294967295,e=lr(n,4294967295);n-=4294967295;for(var u=Rt(e,t=Xu(t));++r<n;)t(r);return u},Sr.toFinite=uf,Sr.toInteger=of,Sr.toLength=ff,Sr.toLower=function(n){return lf(n).toLowerCase()},Sr.toNumber=af,Sr.toSafeInteger=function(n){return n?Qr(of(n),-9007199254740991,9007199254740991):0===n?n:0},Sr.toString=lf,Sr.toUpper=function(n){return lf(n).toUpperCase()},Sr.trim=function(n,t,r){if((n=lf(n))&&(r||void 0===t))return n.replace(q,"");if(!n||!(t=nu(t)))return n;var e=Zt(n),u=Zt(t);return vu(e,Lt(e,u),Wt(e,u)+1).join("")},Sr.trimEnd=function(n,t,r){if((n=lf(n))&&(r||void 0===t))return n.replace(K,"");if(!n||!(t=nu(t)))return n;var e=Zt(n);return vu(e,0,Wt(e,Zt(t))+1).join("")},Sr.trimStart=function(n,t,r){if((n=lf(n))&&(r||void 0===t))return n.replace(Z,"");if(!n||!(t=nu(t)))return n;var e=Zt(n);return vu(e,Lt(e,Zt(t))).join("")},Sr.truncate=function(n,t){var r=30,e="...";if(Zo(t)){var u="separator"in t?t.separator:u;r="length"in t?of(t.length):r,e="omission"in t?nu(t.omission):e}var i=(n=lf(n)).length;if($t(n)){var o=Zt(n);i=o.length}if(r>=i)return n;var f=r-qt(e);if(f<1)return e;var a=o?vu(o,0,f).join(""):n.slice(0,f);if(void 0===u)return a+e;if(o&&(f+=a.length-f),Jo(u)){if(n.slice(f).search(u)){var c,l=a;for(u.global||(u=yn(u.source,lf(X.exec(u))+"g")),u.lastIndex=0;c=u.exec(l);)var s=c.index;a=a.slice(0,void 0===s?f:s)}}else if(n.indexOf(nu(u),f)!=f){var v=a.lastIndexOf(u);v>-1&&(a=a.slice(0,v))}return a+e},Sr.unescape=function(n){return(n=lf(n))&&W.test(n)?n.replace(S,Kt):n},Sr.uniqueId=function(n){var t=++In;return lf(n)+t},Sr.upperCase=Mf,Sr.upperFirst=Ff,Sr.each=ao,Sr.eachRight=co,Sr.first=Bi,Xf(Sr,(ha={},se(Sr,(function(n,t){On.call(Sr.prototype,t)||(ha[t]=n)})),ha),{chain:!1}),Sr.VERSION="4.17.4",ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Sr[n].placeholder=Sr})),ot(["drop","take"],(function(n,t){Ur.prototype[n]=function(r){r=void 0===r?1:cr(of(r),0);var e=this.__filtered__&&!t?new Ur(this):this.clone();return e.__filtered__?e.__takeCount__=lr(r,e.__takeCount__):e.__views__.push({size:lr(r,4294967295),type:n+(e.__dir__<0?"Right":"")}),e},Ur.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}})),ot(["filter","map","takeWhile"],(function(n,t){var r=t+1,e=1==r||3==r;Ur.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:Xu(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}})),ot(["head","last"],(function(n,t){var r="take"+(t?"Right":"");Ur.prototype[n]=function(){return this[r](1).value()[0]}})),ot(["initial","tail"],(function(n,t){var r="drop"+(t?"":"Right");Ur.prototype[n]=function(){return this.__filtered__?new Ur(this):this[r](1)}})),Ur.prototype.compact=function(){return this.filter(Hf)},Ur.prototype.find=function(n){return this.filter(n).head()},Ur.prototype.findLast=function(n){return this.reverse().find(n)},Ur.prototype.invokeMap=Me((function(n,t){return"function"==typeof n?new Ur(this):this.map((function(r){return me(r,n,t)}))})),Ur.prototype.reject=function(n){return this.filter(Oo(Xu(n)))},Ur.prototype.slice=function(n,t){n=of(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ur(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),void 0!==t&&(r=(t=of(t))<0?r.dropRight(-t):r.take(t-n)),r)},Ur.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ur.prototype.toArray=function(){return this.take(4294967295)},se(Ur.prototype,(function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Sr[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(Sr.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ur,a=o[0],c=f||Uo(t),l=function(n){var t=u.apply(Sr,ht([n],o));return e&&s?t[0]:t};c&&r&&"function"==typeof a&&1!=a.length&&(f=c=!1);var s=this.__chain__,v=!!this.__actions__.length,h=i&&!s,p=f&&!v;if(!i&&c){t=p?t:new Ur(this);var d=n.apply(t,o);return d.__actions__.push({func:eo,args:[l],thisArg:void 0}),new Cr(d,s)}return h&&p?n.apply(this,o):(d=this.thru(l),h?e?d.value()[0]:d.value():d)})})),ot(["pop","push","shift","sort","splice","unshift"],(function(n){var t=mn[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Sr.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Uo(u)?u:[],n)}return this[r]((function(r){return t.apply(Uo(r)?r:[],n)}))}})),se(Ur.prototype,(function(n,t){var r=Sr[t];if(r){var e=r.name+"";(xr[e]||(xr[e]=[])).push({name:t,func:r})}})),xr[Su(void 0,2).name]=[{name:"wrapper",func:void 0}],Ur.prototype.clone=function(){var n=new Ur(this.__wrapped__);return n.__actions__=wu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=wu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=wu(this.__views__),n},Ur.prototype.reverse=function(){if(this.__filtered__){var n=new Ur(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Ur.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=Uo(n),e=t<0,u=r?n.length:0,i=function(n,t,r){var e=-1,u=r.length;for(;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=lr(t,n+o);break;case"takeRight":n=cr(n,t-o)}}return{start:n,end:t}}(0,u,this.__views__),o=i.start,f=i.end,a=f-o,c=e?f:o-1,l=this.__iteratees__,s=l.length,v=0,h=lr(a,this.__takeCount__);if(!r||!e&&u==a&&h==a)return iu(n,this.__actions__);var p=[];n:for(;a--&&v<h;){for(var d=-1,_=n[c+=t];++d<s;){var g=l[d],y=g.iteratee,b=g.type,w=y(_);if(2==b)_=w;else if(!w){if(1==b)continue n;break n}}p[v++]=_}return p},Sr.prototype.at=uo,Sr.prototype.chain=function(){return ro(this)},Sr.prototype.commit=function(){return new Cr(this.value(),this.__chain__)},Sr.prototype.next=function(){void 0===this.__values__&&(this.__values__=ef(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?void 0:this.__values__[this.__index__++]}},Sr.prototype.plant=function(n){for(var t,r=this;r instanceof Wr;){var e=zi(r);e.__index__=0,e.__values__=void 0,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t},Sr.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Ur){var t=n;return this.__actions__.length&&(t=new Ur(this)),(t=t.reverse()).__actions__.push({func:eo,args:[qi],thisArg:void 0}),new Cr(t,this.__chain__)}return this.thru(qi)},Sr.prototype.toJSON=Sr.prototype.valueOf=Sr.prototype.value=function(){return iu(this.__wrapped__,this.__actions__)},Sr.prototype.first=Sr.prototype.head,Jt&&(Sr.prototype[Jt]=function(){return this}),Sr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(qn._=Vt,define((function(){return Vt}))):Kn?((Kn.exports=Vt)._=Vt,Zn._=Vt):qn._=Vt}).call(this);</script>
<script type="text/javascript">/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */var saveAs=saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r=!e.externalHost&&"download"in o,i=e.webkitRequestFileSystem,a=e.requestFileSystem||i||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},c=0,s=[],d=function(){for(var e=s.length;e--;){var t=s[e];"string"==typeof t?n().revokeObjectURL(t):t.remove()}s.length=0},f=function(e,t,n){for(var o=(t=[].concat(t)).length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){u(i)}}},l=function(u,d){var l,v,p,w,y,m=this,h=u.type,E=!1,g=function(){var e=n().createObjectURL(u);return s.push(e),e},O=function(){f(m,"writestart progress write writeend".split(" "))},S=function(){!E&&l||(l=g()),v?v.location.href=l:window.open(l,"_blank"),m.readyState=m.DONE,O()},R=function(e){return function(){if(m.readyState!==m.DONE)return e.apply(this,arguments)}},b={create:!0,exclusive:!1};if(m.readyState=m.INIT,d||(d="download"),r)return l=g(),o.href=l,o.download=d,w=o,(y=t.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),w.dispatchEvent(y),m.readyState=m.DONE,void O();e.chrome&&h&&"application/octet-stream"!==h&&(p=u.slice||u.webkitSlice,u=p.call(u,0,u.size,"application/octet-stream"),E=!0),i&&"download"!==d&&(d+=".download"),("application/octet-stream"===h||i)&&(v=e),a?(c+=u.size,a(e.TEMPORARY,c,R((function(e){e.root.getDirectory("saved",b,R((function(e){var t=function(){e.getFile(d,b,R((function(e){e.createWriter(R((function(t){t.onwriteend=function(t){v.location.href=e.toURL(),s.push(e),m.readyState=m.DONE,f(m,"writeend",t)},t.onerror=function(){var e=t.error;e.code!==e.ABORT_ERR&&S()},"writestart progress write abort".split(" ").forEach((function(e){t["on"+e]=m["on"+e]})),t.write(u),m.abort=function(){t.abort(),m.readyState=m.DONE},m.readyState=m.WRITING})),S)})),S)};e.getFile(d,{create:!1},R((function(e){e.remove(),t()})),R((function(e){e.code===e.NOT_FOUND_ERR?t():S()})))})),S)})),S)):S()},v=l.prototype,p=function(e,t){return new l(e,t)};return v.abort=function(){this.readyState=this.DONE,f(this,"abort")},v.readyState=v.INIT=0,v.WRITING=1,v.DONE=2,v.error=v.onwritestart=v.onprogress=v.onwrite=v.onabort=v.onerror=v.onwriteend=null,e.addEventListener("unload",d,!1),p.unload=function(){d(),e.removeEventListener("unload",d,!1)},p}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&null!==module?module.exports=saveAs:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define([],(function(){return saveAs}));</script>
<script type="text/javascript">window.LineBreaker=(()=>{const t=(()=>{function t(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function e(e,s){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=s,this.destLen=0,this.ltree=new t,this.dtree=new t}var s=new t,r=new t,n=new Uint8Array(30),a=new Uint16Array(30),i=new Uint8Array(30),u=new Uint16Array(30),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=new t,c=new Uint8Array(320);function h(t,e,s,r){var n,a;for(n=0;n<s;++n)t[n]=0;for(n=0;n<30-s;++n)t[n+s]=n/s|0;for(a=r,n=0;n<30;++n)e[n]=a,a+=1<<t[n]}var l=new Uint16Array(16);function b(t,e,s,r){var n,a;for(n=0;n<16;++n)t.table[n]=0;for(n=0;n<r;++n)t.table[e[s+n]]++;for(t.table[0]=0,a=0,n=0;n<16;++n)l[n]=a,a+=t.table[n];for(n=0;n<r;++n)e[s+n]&&(t.trans[l[e[s+n]]++]=n)}function d(t){t.bitcount--||(t.tag=t.source[t.sourceIndex++],t.bitcount=7);var e=1&t.tag;return t.tag>>>=1,e}function v(t,e,s){if(!e)return s;for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var r=t.tag&65535>>>16-e;return t.tag>>>=e,t.bitcount-=e,r+s}function w(t,e){for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var s=0,r=0,n=0,a=t.tag;do{r=2*r+(1&a),a>>>=1,++n,s+=e.table[n],r-=e.table[n]}while(r>=0);return t.tag=a,t.bitcount-=n,e.trans[s+r]}function P(t,e,s){var r,n,a,i,u,h;for(r=v(t,5,257),n=v(t,5,1),a=v(t,4,4),i=0;i<19;++i)c[i]=0;for(i=0;i<a;++i){var l=v(t,3,0);c[o[i]]=l}for(b(f,c,0,19),u=0;u<r+n;){var d=w(t,f);switch(d){case 16:var P=c[u-1];for(h=v(t,2,3);h;--h)c[u++]=P;break;case 17:for(h=v(t,3,3);h;--h)c[u++]=0;break;case 18:for(h=v(t,7,11);h;--h)c[u++]=0;break;default:c[u++]=d}}b(e,c,0,r),b(s,c,r,n)}function X(t,e,s){for(;;){var r,o,f,c,h=w(t,e);if(256===h)return 0;if(h<256)t.dest[t.destLen++]=h;else for(r=v(t,n[h-=257],a[h]),o=w(t,s),c=f=t.destLen-v(t,i[o],u[o]);c<f+r;++c)t.dest[t.destLen++]=t.dest[c]}}function L(t){for(var e,s;t.bitcount>8;)t.sourceIndex--,t.bitcount-=8;if((e=256*(e=t.source[t.sourceIndex+1])+t.source[t.sourceIndex])!==(65535&~(256*t.source[t.sourceIndex+3]+t.source[t.sourceIndex+2])))return-3;for(t.sourceIndex+=4,s=e;s;--s)t.dest[t.destLen++]=t.source[t.sourceIndex++];return t.bitcount=0,0}return function(t,e){var s;for(s=0;s<7;++s)t.table[s]=0;for(t.table[7]=24,t.table[8]=152,t.table[9]=112,s=0;s<24;++s)t.trans[s]=256+s;for(s=0;s<144;++s)t.trans[24+s]=s;for(s=0;s<8;++s)t.trans[168+s]=280+s;for(s=0;s<112;++s)t.trans[176+s]=144+s;for(s=0;s<5;++s)e.table[s]=0;for(e.table[5]=32,s=0;s<32;++s)e.trans[s]=s}(s,r),h(n,a,4,3),h(i,u,2,1),n[28]=0,a[28]=258,function(t,n){var a,i,u=new e(t,n);do{switch(a=d(u),v(u,2,0)){case 0:i=L(u);break;case 1:i=X(u,s,r);break;case 2:P(u,u.ltree,u.dtree),i=X(u,u.ltree,u.dtree);break;default:i=-3}if(0!==i)throw new Error("Data error")}while(!a);return u.destLen<u.dest.length?"function"==typeof u.dest.slice?u.dest.slice(0,u.destLen):u.dest.subarray(0,u.destLen):u.dest}})(),e=(()=>{const t=18===new Uint8Array(new Uint32Array([305419896]).buffer)[0],e=(t,e,s)=>{let r=t[e];t[e]=t[s],t[s]=r};return s=>{t&&(t=>{const s=t.length;for(let r=0;r<s;r+=4)e(t,r,r+3),e(t,r+1,r+2)})(s)}})(),s=new class{constructor(s){const r="function"==typeof s.readUInt32BE&&"function"==typeof s.slice;if(r||s instanceof Uint8Array){let n;if(r)this.highStart=s.readUInt32LE(0),this.errorValue=s.readUInt32LE(4),n=s.readUInt32LE(8),s=s.slice(12);else{const t=new DataView(s.buffer);this.highStart=t.getUint32(0,!0),this.errorValue=t.getUint32(4,!0),n=t.getUint32(8,!0),s=s.subarray(12)}s=t(s,new Uint8Array(n)),s=t(s,new Uint8Array(n)),e(s),this.data=new Uint32Array(s.buffer)}else({data:this.data,highStart:this.highStart,errorValue:this.errorValue}=s)}get(t){let e;return t<0||t>1114111?this.errorValue:t<55296||t>56319&&t<=65535?(e=(this.data[t>>5]<<2)+(31&t),this.data[e]):t<=65535?(e=(this.data[2048+(t-55296>>5)]<<2)+(31&t),this.data[e]):t<this.highStart?(e=this.data[2080+(t>>11)],e=this.data[e+(t>>5&63)],e=(e<<2)+(31&t),this.data[e]):this.data[this.data.length-4]}}((t=>{const e=window.atob(t),s=new Uint8Array(e.length);for(var r=0;r<e.length;r++)s[r]=e.charCodeAt(r);return s})("AAgOAAAAAAAQ4QAAAQ0P8vDtnQuMXUUZx+eyu7d7797d9m5bHoWltKVUlsjLWE0VJNigQoMVqkStEoNQQUl5GIo1KKmogEgqkKbBRki72lYabZMGKoGAjQRtJJDaCCIRiiigREBQS3z+xzOTnZ3O+3HOhd5NfpkzZx7fN9988zivu2M9hGwB28F94DnwEngd/Asc1EtIs9c/bIPDwCxwLDgezHcodyo4w5C+CCwBS8FnwSXgCnA1uFbI93XwbXAbWAfWgx+CzWAb+An4KfgFeAzsYWWfYuFz4CXwGvgb+Dfo6yNkEEwGh4CZYB44FpwI3g1OY+kfBItZOo2fB84Hy8DF4HJwNbiWpV8PVoO1LH4n2NRXyN+KcAd4kNVP9XsY4aPgcfAbsBfs6SniL4K/sPjfEf6HlanXCRkCw2BGvUh/keWfXS/CY+pFXs7x9XHmM94LTmWIeU2cgbxnS/k/B3kf86jDhU8L9V2E40vAFWAlWFUfb++NOL4F3C7JX4/4GiE+hvgWsF0oS7mXldspnN+F493gyXrh9xTav0cg3EvzgVfBG6wsmVSEkxBOBgdPGpd7JI6PnqRvJ68/xlbHof53gPeA94OzwLngk+ACsAwsByvASrAK3MB0Ws3CtQjvBJvAVrADPMDSHkb4CNijaccTwvnf4fiPEs8Lxy+D18A/QU8/xjgYBjPAbDAKTgYLwOngTHAO+EQ/8wuEF4EvsPiVCFf2+9tsFStzA8LVHuXXBsi6QyqzUYiPMR/7Mc7dAx7oL8bzw/3u/Bw8Bp4Az4AXwCtgHzsmDXP5fiF9iiVvly5d0sHngar16NKlS5cuXbp06fLmYlqHXrcd3ph4P0THUY3iXh49novju4S0tzfs5d+JPKewfAsRntZb3K9ZhOMlrO6lCC8An28U9+OuovcPcPxlVu5rCL/VmHh/iHIrzn3fIPu7SN8Axmg+8AOwEWwCm7tp3bRuWjetm5Y8bSu4B9zbKO6ZVsnORrVU3f4uXTqZ2H3sLoyx3eDXjfDndE9qyj6L838CfwVvgFpzYnof4oNgOhgBc8Fos9DrZIQLmtXPP1MmF6wGj4H+KXoWguvADkXaPil+YpuQy8Am8Ey7ODdtmJDF4HowBp4De6HDTNjhfHAHeBr0DBBy0kDxfPbcgSIusgrcWhtnJ8vL+TPix7UIOQtcBq4C28Cr4KRBnANbwSuDE+s50JgyNNFuXbp06XIgsXjIvPafjvXozKY+fVFz/z0LT1uCtKVSWbrOLWPnztG8e0Xfy7ol8XtZJi7WtG+5od2UFXQ/A12vUeS7jp27yVKHjdsU9lXB869TyNvAzt0lpP2oWbwLdjiO78bx/Sz+EMJHwK9Y/LcIfw+eZ3F67/Hl5vh9xX80J+rwX8SvRDhpgL17iPAQMHNArfPrqHPewLheI+AERV6efwV418B4nOZ/H+IfYHV8GOF5LJ3eAz0fx8sM9S0fUNud39O9CulfGZhY5huI3wzWgNvBelbHZoTbNPVpfYjKQpkHwUNgl0LWblbnk0LbbDxr0OMFpL3iqWdu9nWYPlVAWkXY39LnGdCkDbeqv1YNbfcMQ3t9oe8lzm6NH9N1ZB6Ln4BwfkJZJk7RyFnYKt6b/JDQXx9p5X+eFdqOjzM9P9MB/lUlFzr20aXIdzlY4dmn9F3YqtvoO76/2hp/D/xA5Zue88nNyL8GbFbs075X0tyUig3Qd2MCnf//HjnzpbsR3g9+1kHzzVjdnE71/qVBX9rGPUh/ysNWe1neFzvIDi5zAufV1sT0N0poR22wkFUfTOPfA4N2mbZ5fSrqOHSw+IbkSBbOGSzSRgf91/GTUWYBOB2cIZQ/G8cfBZ8CFwrnL8XxF8FKcA24jqXdiPA7Qr61OF7H4mMItwzuv2/YLth1ISt3Hzu3k4W7EH5JqPdRHD/O4k+z8A8IX5Lq3y7Z4nXE9xn6kX6vQ4bKfy+ok+hH+xf3hq9dnTTHhjKd2GmDuWA242iHMq4cC7A8kJ7i8o1+skSa7Jieo38HCWnoNjKFhdSFBxzpZ7QE6lI8N4S14aASZcryaV/WWHw66f6NHuCoxuQxmvM56GX9QMd8Q4D65ywGP+ZzRJuM+zQvx/MOS2VFeqQ4IXnH26zM9Xe6/E6D+4foAzzuajPZp8Qyw5ayZVDWuH0z0BtYRkeIDqH9KO9VbH1btd/lhNqCzvl8zeLnG0S/hnU6baHfpiuO6yy0rd+DHURo/zYF5H26j03rQsip2ndzz82u1z9N4VjWKWeb68Tedpt95HRVXp7H1R6p+/Wt4FPy/PpWwscOLRJ+PVWF/+W0iVyGzs18TIvXkOJ1Wxm66vSXz+vylenrZcj1ub439W+K8RNCGTJi2p/TJ1K23VaXr35tRpnzmjxequgfcfyk6B/TGBVlyedsNgpdd/h+W1U3P99QyFPNo1X3TwpM/WLTIWYfoBqXrv6iskHZ/RFr79R6hIyHBrH3f1nrUVnjP8SnZZ+rYtzr9Exld5MNbPNErusAPg+77u/eDOPftU9yj39TH7rezxd1LvsZQJlzkWlOirG/79zjMj/mtHUKu7vKy+3/LnXr9okyKedjX5/0He9iP/j63LwOQdarEVlfy8OO/Lqw023j6xcqmwxLiOd6heM2i9cV9LJy8jMJ23yQ+rpbfu7EQ/pXE8KYvUSqvVnb4XzZa6LrHMXHR+zcLvqWbm/Bn0/HzIs6fWPHoat8XfnDKmZGxRxeMbn2UqZ5Q94nmcZRbqqUXbZ8+lcjE+cPX11t814orvvAXNcG8vqj2vvk1MGn3anlj0bIT72v47bvE+Lc98T9b6r7AKn6j+8Duf7D0nnZx/j7Zjn0j9nbpSTndaLr9WNLivP+iN23xF7L+fqv6ZouFyb78jxVXvv5jJ9YUs9/sddO8h7KNg5jrhfaJGztT6G7KF+1d6yCmD5Kdb2fan60rSc552fZr3zeQ9DpnPp+Si5cx5Ktv2QfSzF/mMbWdOm46rFI4XstnU9xeqX4NKb7TKEdcr6pZOK3ID1k/LvFHkVczEuZLEDr499YqvqBym1aEHWgcvoYOtv0M91qQl5TfpO/in6rWx8OVpT1Wedkv3f5xom3T/xeR/6Gx6V86PWAOB4bBpqWdN+yTcVxjIyGRz/FrDGu6w/3d7kPm8StX8RyPu+uuvpNju/vTLJV37GpvoM0oZPnW87VLnL/5pDno1NoW1R6yedU6TyUv3u19a3KFnIbTLYz+ZCLP4T0tU1uivFgso0pnsJ/UtXvarNY28Xq5cvkBDrQP/E5ZaiuQwwfmTlsOiQRU1fMuqrDd/3ISSuwjOwXOfTyGUMpZIXq4GpLn3pUcdfzch2x7XO1u2uZHOPb1G6b3Xg9PH1IIWeEpJlPQtqos2EKW8b0u8rnuP1UeVLoXJb9be0uG9nnbchjU+XTszT5VeNBThPHnc5OKj1U9aj0GTHIVaGy1YhEWT4ixns00DT+XEzWn/7VAsIc63Cov3OdyhwjrnaqQqZvWKXdypRdlq+k8msZ031U+Rm4fA+3TtyeR9hwfW9G9yxDN0fZMN33F+9TE6md4hwoxumfaUzI9fN3PFT3xVV2msrQ3UsnChm6Nulk8TndpS28D3zX9tTIPsF/z7Am5OkTjm1tI1JZW74+4VgsZ0N3L1yXV3WeP5uR7TGHHdvC3JQlxybfpd22tDlk/2eofRK8TzrN/qnar/K/OUTth6I/+jAnEptNbPvFHP2gs40N3+dfMWtwqvVct7/wfd8gtQ7imifial9ZJ9/3IHLYU6eDj3+4PhsNhX+vwvcWLnu6kGfEMe8DuciPfUfGZB8X/7HJy/Gefe5n+VRGFd/wyP2ta7/LO4yh/sbLV/k9lev6kfO9Dt/5U67b1/6u/epqB1U9Me23jfHY9sscAg4tkbLl+e4/U36rJ9ddxfd6sg5vq5ice42Wpk/pb9FOJ36/W9tpv4kbC79nUbZceX8Zu6/qJ+P3WvhvA8v3reh7Jbn2d6rrNC7XNZTLma4Ba0JI9efX2uLzF5scG/w9UNU1ZxW+ymUfzELeTllXlQ1rUuhzjS5fp9c964iFBOqeSz63bU065nZKdU+mDEz3qHIjjifquw0pnb/raRtvrnsYcb46ihT3taoYz6brdNW9l6rWRnE/navdPn1XlR1km7hcz1WlH/elKuSOSvLLuE8U6m8uzwRdfcGl73VyTHuyMvzJ1Sa2cWDTP/Z63Kc94n2B1PYr24dz1JlyHLlcP+S4B6vD1c9EW4q2LWstCvUjeVy63k/LMYdUNd5D1xQfvVTzX1VjkMsUv88N8VH5fReVn/Fjn++/h6X6Q8a6b1/q3g/i/ewi0/Scs8zxXeV6mWIOUPlPzBgdFerW+bZrm2P18dnjuK6HunEp+rHvPMXbr+sHVb/lnL+pTP57jPw9Cvk3PW178JD9qChfzuvTf7Htl38L1QUf/VKu9SFjwWbTWPvFEvu7Uq76y7+31g6QlYPc669pbsm9Xur2LWI9Pu8ypfDXqm3A2z8s1FWGn4ntL9NfQu2oSlftX9uetvTtv7J8Ql4zxfXGZ3zk8PeQ9w59x2uMfqI8/q5eKh/l9cb2rwsu9rSNl06ZP2Pmxtz+rNMx93yno0n2/82rVH7rQ+y9P15H6FyRun9ViH81ATmffI7nJ5r8uXXW6enbP6b/B8/l5OifVHYLnb9S39s2zcc+Ph+rh8+eQgVPS72elzGWY/tUtbbabBpDiI7yN1q6/4th2y+ErAc5+9BVvu/7KamJbWNZeuqI/R4tRf+YyD1HmOZM1bMV3/14Sn10c0Xu+Sj1nOXb5jL73ncdy02uvlXZNde65dOHYl7Vs4KYuS6FzWLn2zJlpZqPXPVPOa5yzKOyn1VhT9lmMfdbfH7D11Wf2PXN5h9y+dD287+qxgSnaYmnIrRtIb8pJe6/Uv9OVer6Whn0zfGO/BEloZI9ojmfAlUflClDd178bTmVHVTpZXOkAlk/lb42UujmI89HH5V+cl7XtowY6vTxLVWok6UrGzoGTHN+bB+6ri05687VNpvfuvRfaP2uMlNQth1D5JjGelm/8yn+9p3p/7qk9gnfeddXZmq/Sm333PJT659Kv1zjNbZ9uv2Oi//67CV8/N1nj1DmviyXDNVeJkaeaX8UsyesYg8cu2+NvdaPfb+lLDu5tvt/")),r=[[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4,4],[0,4,4,1,1,4,4,4,4,1,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,4,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[4,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,0,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,1,1,1,1,0,0,4,2,4,1,1,1,1,1,0,1,1,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,1,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,4,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,1,1,1,1,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,1,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,0,4,4,4,0,0,0,0,0,0,0,0,0,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0]],n=function(t){switch(t){case 33:return 12;case 39:case 40:case 42:return 12;case 35:return 5;default:return t}},a=function(t){switch(t){case 37:case 38:return 34;case 41:return 22;default:return t}};class i{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.position=t,this.required=e}}return class{constructor(t){this.string=t,this.pos=0,this.lastPos=0,this.curClass=null,this.nextClass=null,this.LB8a=!1,this.LB21a=!1,this.LB30a=0}nextCodePoint(){const t=this.string.charCodeAt(this.pos++),e=this.string.charCodeAt(this.pos);return 55296<=t&&t<=56319&&56320<=e&&e<=57343?(this.pos++,1024*(t-55296)+(e-56320)+65536):t}nextCharClass(){return n(s.get(this.nextCodePoint()))}getSimpleBreak(){switch(this.nextClass){case 41:return!1;case 34:case 37:case 38:return this.curClass=34,!1;case 36:return this.curClass=36,!1}return null}getPairTableBreak(t){let e=!1;switch(r[this.curClass][this.nextClass]){case 0:e=!0;break;case 1:e=41===t;break;case 2:if(e=41===t,!e)return e=!1,e;break;case 3:if(41!==t)return e}return this.LB8a&&(e=!1),!this.LB21a||16!==this.curClass&&17!==this.curClass?this.LB21a=13===this.curClass:(e=!1,this.LB21a=!1),28===this.curClass?(this.LB30a++,2==this.LB30a&&28===this.nextClass&&(e=!0,this.LB30a=0)):this.LB30a=0,this.curClass=this.nextClass,e}nextBreak(){if(null==this.curClass){let t=this.nextCharClass();this.curClass=a(t),this.nextClass=t,this.LB8a=31===t,this.LB30a=0}for(;this.pos<this.string.length;){this.lastPos=this.pos;const t=this.nextClass;if(this.nextClass=this.nextCharClass(),34===this.curClass||36===this.curClass&&37!==this.nextClass)return this.curClass=a(n(this.nextClass)),new i(this.lastPos,!0);let e=this.getSimpleBreak();if(null===e&&(e=this.getPairTableBreak(t)),this.LB8a=31===this.nextClass,e)return new i(this.lastPos)}return this.lastPos<this.string.length?(this.lastPos=this.string.length,new i(this.string.length)):null}}})();</script>
<script type="text/javascript">class FlatQueue{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(s,t){let i=this.length++;for(this.ids[i]=s,this.values[i]=t;i>0;){const s=i-1>>1,h=this.values[s];if(t>=h)break;this.ids[i]=this.ids[s],this.values[i]=h,i=s}this.ids[i]=s,this.values[i]=t}pop(){if(0===this.length)return;const s=this.ids[0];if(this.length--,this.length>0){const s=this.ids[0]=this.ids[this.length],t=this.values[0]=this.values[this.length],i=this.length>>1;let h=0;for(;h<i;){let s=1+(h<<1);const i=s+1;let e=this.ids[s],l=this.values[s];const u=this.values[i];if(i<this.length&&u<l&&(s=i,e=this.ids[i],l=u),l>=t)break;this.ids[h]=e,this.values[h]=l,h=s}this.ids[h]=s,this.values[h]=t}return s}peek(){if(0!==this.length)return this.ids[0]}peekValue(){if(0!==this.length)return this.values[0]}}window.FlatQueue=FlatQueue;</script>
<script type="text/javascript">/*!
 * Paper.js v0.12.17 - The Swiss Army Knife of Vector Graphics Scripting.
 * http://paperjs.org/
 *
 * Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
 * http://juerglehni.com/ & https://puckey.studio/
 *
 * Distributed under the MIT license. See LICENSE file for details.
 *
 * All rights reserved.
 *
 * Date: Thu Nov 3 21:15:36 2022 +0100
 *
 ***
 *
 * Straps.js - Class inheritance library with support for bean-style accessors
 *
 * Copyright (c) 2006 - 2020 Jürg Lehni
 * http://juerglehni.com/
 *
 * Distributed under the MIT license.
 *
 ***
 *
 * Acorn.js
 * https://marijnhaverbeke.nl/acorn/
 *
 * Acorn is a tiny, fast JavaScript parser written in JavaScript,
 * created by Marijn Haverbeke and released under an MIT license.
 *
 */
var paper=function(t,e){var i=(t=t||require("./node/self.js")).window,n=t.document,r=new function(){var t=/^(statics|enumerable|beans|preserve)$/,i=[],n=i.slice,r=Object.create,s=Object.getOwnPropertyDescriptor,a=Object.defineProperty,o=i.forEach||function(t,e){for(var i=0,n=this.length;i<n;i++)t.call(e,this[i],i,this)},h=function(t,e){for(var i in this)this.hasOwnProperty(i)&&t.call(e,this[i],i,this)},u=Object.assign||function(t){for(var e=1,i=arguments.length;e<i;e++){var n=arguments[e];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t},l=function(t,e,i){if(t){var n=s(t,"length");(n&&"number"==typeof n.value?o:h).call(t,e,i=i||t)}return i};function c(e,i,n,r,o){var h={};function u(t,u){"string"==typeof(u=u||(u=s(i,t))&&(u.get?u:u.value))&&"#"===u[0]&&(u=e[u.substring(1)]||u);var l,c="function"==typeof u,d=u,_=o||c&&!u.base?u&&u.get?t in e:e[t]:null;o&&_||(c&&_&&(u.base=_),c&&!1!==r&&(l=t.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(h[l[3].toLowerCase()+l[4]]=l[2]),d&&!c&&d.get&&"function"==typeof d.get&&f.isPlainObject(d)||(d={value:d,writable:!0}),(s(e,t)||{configurable:!0}).configurable&&(d.configurable=!0,d.enumerable=null!=n?n:!l),a(e,t,d))}if(i){for(var l in i)i.hasOwnProperty(l)&&!t.test(l)&&u(l);for(var l in h){var c=h[l],d=e["set"+c],_=e["get"+c]||d&&e["is"+c];!_||!0!==r&&0!==_.length||u(l,{get:_,set:d})}}return e}function f(){for(var t=0,e=arguments.length;t<e;t++){var i=arguments[t];i&&u(this,i)}return this}return c(f,{inject:function(t){if(t){var e=!0===t.statics?t:t.statics,i=t.beans,n=t.preserve;e!==t&&c(this.prototype,t,t.enumerable,i,n),c(this,e,null,i,n)}for(var r=1,s=arguments.length;r<s;r++)this.inject(arguments[r]);return this},extend:function(){for(var t,e,i,n=this,s=0,o=arguments.length;s<o&&(!t||!e);s++)i=arguments[s],t=t||i.initialize,e=e||i.prototype;return e=(t=t||function(){n.apply(this,arguments)}).prototype=e||r(this.prototype),a(e,"constructor",{value:t,writable:!0,configurable:!0}),c(t,this),arguments.length&&this.inject.apply(t,arguments),t.base=n,t}}).inject({enumerable:!1,initialize:f,set:f,inject:function(){for(var t=0,e=arguments.length;t<e;t++){var i=arguments[t];i&&c(this,i,i.enumerable,i.beans,i.preserve)}return this},extend:function(){var t=r(this);return t.inject.apply(t,arguments)},each:function(t,e){return l(this,t,e)},clone:function(){return new this.constructor(this)},statics:{set:u,each:l,create:r,define:a,describe:s,clone:function(t){return u(new t.constructor,t)},isPlainObject:function(t){var e=null!=t&&t.constructor;return e&&(e===Object||e===f||"Object"===e.name)},pick:function(t,i){return t!==e?t:i},slice:function(t,e,i){return n.call(t,e,i)}}})};"undefined"!=typeof module&&(module.exports=r),r.inject({enumerable:!1,toString:function(){return null!=this._id?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+r.each(this,(function(t,e){if(!/^_/.test(e)){var i=typeof t;this.push(e+": "+("number"===i?u.instance.number(t):"string"===i?"'"+t+"'":t))}}),[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(t){return r.importJSON(t,this)},exportJSON:function(t){return r.exportJSON(this,t)},toJSON:function(){return r.serialize(this)},set:function(t,e){return t&&r.filter(this,t,e,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function t(){var e=t.base.apply(this,arguments),i=e.prototype._class;return i&&!r.exports[i]&&(r.exports[i]=e),e},equals:function(t,e){if(t===e)return!0;if(t&&t.equals)return t.equals(e);if(e&&e.equals)return e.equals(t);if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)&&Array.isArray(e)){if((i=t.length)!==e.length)return!1;for(;i--;)if(!r.equals(t[i],e[i]))return!1}else{var i,n=Object.keys(t);if((i=n.length)!==Object.keys(e).length)return!1;for(;i--;){var s=n[i];if(!e.hasOwnProperty(s)||!r.equals(t[s],e[s]))return!1}}return!0}return!1},read:function(t,i,n,s){if(this===r){var a=this.peek(t,i);return t.__index++,a}var o=this.prototype,h=o._readIndex,u=i||h&&t.__index||0,l=t.length,c=t[u];if(s=s||l-u,c instanceof this||n&&n.readNull&&null==c&&s<=1)return h&&(t.__index=u+1),c&&n&&n.clone?c.clone():c;if(c=r.create(o),h&&(c.__read=!0),c=c.initialize.apply(c,u>0||u+s<l?r.slice(t,u,u+s):t)||c,h){t.__index=u+c.__read;var f=c.__filtered;f&&(t.__filtered=f,c.__filtered=e),c.__read=e}return c},peek:function(t,e){return t[t.__index=e||t.__index||0]},remain:function(t){return t.length-(t.__index||0)},readList:function(t,e,i,n){for(var r,s=[],a=e||0,o=n?a+n:t.length,h=a;h<o;h++)s.push(Array.isArray(r=t[h])?this.read(r,0,i):this.read(t,h,i,1));return s},readNamed:function(t,i,n,s,a){var o=this.getNamed(t,i),h=o!==e;if(h){var u=t.__filtered;if(!u){var l=this.getSource(t);(u=t.__filtered=r.create(l)).__unfiltered=l}u[i]=e}return this.read(h?[o]:t,n,s,a)},readSupported:function(t,i){var n=this.getSource(t),r=this,s=!1;return n&&Object.keys(n).forEach((function(n){if(n in i){var a=r.readNamed(t,n);a!==e&&(i[n]=a),s=!0}})),s},getSource:function(t){var i=t.__source;if(i===e){var n=1===t.length&&t[0];i=t.__source=n&&r.isPlainObject(n)?n:null}return i},getNamed:function(t,e){var i=this.getSource(t);if(i)return e?i[e]:t.__filtered||i},hasNamed:function(t,e){return!!this.getNamed(t,e)},filter:function(t,i,n,r){var s;function a(r){if(!(n&&r in n||s&&r in s)){var a=i[r];a!==e&&(t[r]=a)}}if(r){for(var o,h={},u=0,l=r.length;u<l;u++)(o=r[u])in i&&(a(o),h[o]=!0);s=h}return Object.keys(i.__unfiltered||i).forEach(a),t},isPlainValue:function(t,e){return r.isPlainObject(t)||Array.isArray(t)||e&&"string"==typeof t},serialize:function(t,e,i,n){e=e||{};var s,a=!n;if(a&&(e.formatter=new u(e.precision),n={length:0,definitions:{},references:{},add:function(t,e){var i="#"+t._id,n=this.references[i];if(!n){this.length++;var r=e.call(t),s=t._class;s&&r[0]!==s&&r.unshift(s),this.definitions[i]=r,n=this.references[i]=[i]}return n}}),t&&t._serialize){s=t._serialize(e,n);var o=t._class;!o||t._compactSerialize||!a&&i||s[0]===o||s.unshift(o)}else if(Array.isArray(t)){s=[];for(var h=0,l=t.length;h<l;h++)s[h]=r.serialize(t[h],e,i,n)}else if(r.isPlainObject(t)){s={};var c=Object.keys(t);for(h=0,l=c.length;h<l;h++){var f=c[h];s[f]=r.serialize(t[f],e,i,n)}}else s="number"==typeof t?e.formatter.number(t,e.precision):t;return a&&n.length>0?[["dictionary",n.definitions],s]:s},deserialize:function(t,e,i,n,s){var a=t,o=!i,h=o&&t&&t.length&&"dictionary"===t[0][0];if(i=i||{},Array.isArray(t)){var u=t[0],l="dictionary"===u;if(1==t.length&&/^#/.test(u))return i.dictionary[u];a=[];for(var c=(u=r.exports[u])?1:0,f=t.length;c<f;c++)a.push(r.deserialize(t[c],e,i,l,h));if(u){var d=a;a=e?e(u,d,o||s):new u(d)}}else if(r.isPlainObject(t))for(var _ in a={},n&&(i.dictionary=a),t)a[_]=r.deserialize(t[_],e,i);return h?a[1]:a},exportJSON:function(t,e){var i=r.serialize(t,e);return e&&0==e.asString?i:JSON.stringify(i)},importJSON:function(t,e){return r.deserialize("string"==typeof t?JSON.parse(t):t,(function(t,i,n){var s=n&&e&&e.constructor===t,a=s?e:r.create(t.prototype);if(1===i.length&&a instanceof x&&(s||!(a instanceof S))){var o=i[0];r.isPlainObject(o)&&(o.insert=!1,s&&(i=i.concat([x.INSERT])))}return(s?a.set:t).apply(a,i),s&&(e=null),a}))},push:function(t,e){var i=e.length;if(i<4096)t.push.apply(t,e);else{var n=t.length;t.length+=i;for(var r=0;r<i;r++)t[n+r]=e[r]}return t},splice:function(t,i,n,s){var a=i&&i.length,o=n===e;(n=o?t.length:n)>t.length&&(n=t.length);for(var h=0;h<a;h++)i[h]._index=n+h;if(o)return r.push(t,i),[];var u=[n,s];i&&r.push(u,i);for(var l=t.splice.apply(t,u),c=(h=0,l.length);h<c;h++)l[h]._index=e;for(h=n+a,c=t.length;h<c;h++)t[h]._index=h;return l},capitalize:function(t){return t.replace(/\b[a-z]/g,(function(t){return t.toUpperCase()}))},camelize:function(t){return t.replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))},hyphenate:function(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}}});var s={on:function(t,e){if("string"!=typeof t)r.each(t,(function(t,e){this.on(e,t)}),this);else{var i=this._eventTypes,n=i&&i[t],s=this._callbacks=this._callbacks||{};-1===(s=s[t]=s[t]||[]).indexOf(e)&&(s.push(e),n&&n.install&&1===s.length&&n.install.call(this,t))}return this},off:function(t,e){if("string"==typeof t){var i,n=this._eventTypes,s=n&&n[t],a=this._callbacks&&this._callbacks[t];return a&&(!e||-1!==(i=a.indexOf(e))&&1===a.length?(s&&s.uninstall&&s.uninstall.call(this,t),delete this._callbacks[t]):-1!==i&&a.splice(i,1)),this}r.each(t,(function(t,e){this.off(e,t)}),this)},once:function(t,e){return this.on(t,(function i(){e.apply(this,arguments),this.off(t,i)}))},emit:function(t,e){var i=this._callbacks&&this._callbacks[t];if(!i)return!1;var n=r.slice(arguments,1),s=e&&e.target&&!e.currentTarget;i=i.slice(),s&&(e.currentTarget=this);for(var a=0,o=i.length;a<o;a++)if(0==i[a].apply(this,n)){e&&e.stop&&e.stop();break}return s&&delete e.currentTarget,!0},responds:function(t){return!(!this._callbacks||!this._callbacks[t])},attach:"#on",detach:"#off",fire:"#emit",_installEvents:function(t){var e=this._eventTypes,i=this._callbacks,n=t?"install":"uninstall";if(e)for(var r in i)if(i[r].length>0){var s=e[r],a=s&&s[n];a&&a.call(this,r)}},statics:{inject:function t(e){var i=e._events;if(i){var n={};r.each(i,(function(t,i){var s="string"==typeof t,a=s?t:i,o=r.capitalize(a),h=a.substring(2).toLowerCase();n[h]=s?{}:t,a="_"+a,e["get"+o]=function(){return this[a]},e["set"+o]=function(t){var e=this[a];e&&this.off(h,e),t&&this.on(h,t),this[a]=t}})),e._eventTypes=n}return t.base.apply(this,arguments)}}},a=r.extend({_class:"PaperScope",initialize:function e(){st=this,this.settings=new r({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=e._id++,e._scopes[this._id]=this;var i=e.prototype;if(!this.support){var n=et.getContext(1,1)||{};i.support={nativeDash:"setLineDash"in n||"mozDash"in n,nativeBlendModes:it.nativeModes},et.release(n)}if(!this.agent){var s=t.navigator.userAgent.toLowerCase(),a=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(s)||[])[0],o="darwin"===a?"mac":a,h=i.agent=i.browser={platform:o};o&&(h[o]=!0),s.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,(function(t,e,i,n,r){if(!h.chrome){var s="opera"===e?n:/^(node|trident)$/.test(e)?r:i;h.version=s,h.versionNumber=parseFloat(s),e={trident:"msie",jsdom:"node"}[e]||e,h.name=e,h[e]=!0}})),h.chrome&&delete h.webkit,h.atom&&delete h.chrome}},version:"0.12.17",getView:function(){var t=this.project;return t&&t._view},getPaper:function(){return this},execute:function(t,e){},install:function(t){var e=this;for(var i in r.each(["project","view","tool"],(function(i){r.define(t,i,{configurable:!0,get:function(){return e[i]}})})),this)!/^_/.test(i)&&this[i]&&(t[i]=this[i])},setup:function(t){return st=this,this.project=new w(t),this},createCanvas:function(t,e){return et.getCanvas(t,e)},activate:function(){st=this},clear:function(){for(var t=this.projects,e=this.tools,i=t.length-1;i>=0;i--)t[i].remove();for(i=e.length-1;i>=0;i--)e[i].remove()},remove:function(){this.clear(),delete a._scopes[this._id]},statics:new function(){function t(t){return t+="Attribute",function(e,i){return e[t](i)||e[t]("data-paper-"+i)}}return{_scopes:{},_id:0,get:function(t){return this._scopes[t]||null},getAttribute:t("get"),hasAttribute:t("has")}}}),o=r.extend(s,{initialize:function(t){this._scope=st,this._index=this._scope[this._list].push(this)-1,!t&&this._scope[this._reference]||this.activate()},activate:function(){if(!this._scope)return!1;var t=this._scope[this._reference];return t&&t!==this&&t.emit("deactivate"),this._scope[this._reference]=this,this.emit("activate",t),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return null!=this._index&&(r.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),h={findItemBoundsCollisions:function(t,e,i){function n(t){for(var e=new Array(t.length),i=0;i<t.length;i++){var n=t[i].getBounds();e[i]=[n.left,n.top,n.right,n.bottom]}return e}var r=n(t),s=e&&e!==t?n(e):r;return this.findBoundsCollisions(r,s,i||0)},findCurveBoundsCollisions:function(t,e,i,n){function r(t){for(var e=Math.min,i=Math.max,n=new Array(t.length),r=0;r<t.length;r++){var s=t[r];n[r]=[e(s[0],s[2],s[4],s[6]),e(s[1],s[3],s[5],s[7]),i(s[0],s[2],s[4],s[6]),i(s[1],s[3],s[5],s[7])]}return n}var s=r(t),a=e&&e!==t?r(e):s;if(n){for(var o=this.findBoundsCollisions(s,a,i||0,!1,!0),h=this.findBoundsCollisions(s,a,i||0,!0,!0),u=[],l=0,c=o.length;l<c;l++)u[l]={hor:o[l],ver:h[l]};return u}return this.findBoundsCollisions(s,a,i||0)},findBoundsCollisions:function(t,e,i,n,r){var s=!e||t===e,a=s?t:t.concat(e),o=t.length,h=a.length;function u(t,e,i){for(var n=0,r=t.length;n<r;){var s=r+n>>>1;a[t[s]][e]<i?n=s+1:r=s}return n-1}for(var l=n?1:0,c=l+2,f=n?0:1,d=f+2,_=new Array(h),g=0;g<h;g++)_[g]=g;_.sort((function(t,e){return a[t][l]-a[e][l]}));var v=[],p=new Array(o);for(g=0;g<h;g++){var m=_[g],y=a[m],w=s?m:m-o,x=m<o,b=s||!x,S=x?[]:null;if(v.length){var C=u(v,c,y[l]-i)+1;if(v.splice(0,C),s&&r){S=S.concat(v);for(var P=0;P<v.length;P++){p[T=v[P]].push(w)}}else{var I=y[d],M=y[f];for(P=0;P<v.length;P++){var T=v[P],O=a[T],z=T<o,k=s||T>=o;(r||(x&&k||b&&z)&&I>=O[f]-i&&M<=O[d]+i)&&(x&&k&&S.push(s?T:T-o),b&&z&&p[T].push(w))}}}if(x&&(t===e&&S.push(m),p[m]=S),v.length){var A=u(v,c,y[c]);v.splice(A+1,0,m)}else v.push(m)}for(g=0;g<p.length;g++){var L=p[g];L&&L.sort((function(t,e){return t-e}))}return p}},u=r.extend({initialize:function(t){this.precision=r.pick(t,5),this.multiplier=Math.pow(10,this.precision)},number:function(t){return this.precision<16?Math.round(t*this.multiplier)/this.multiplier:t},pair:function(t,e,i){return this.number(t)+(i||",")+this.number(e)},point:function(t,e){return this.number(t.x)+(e||",")+this.number(t.y)},size:function(t,e){return this.number(t.width)+(e||",")+this.number(t.height)},rectangle:function(t,e){return this.point(t,e)+(e||",")+this.size(t,e)}});u.instance=new u;var l=new function(){var t=[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],e=[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]],i=Math.abs,n=Math.sqrt,r=Math.pow,s=Math.log2||function(t){return Math.log(t)*Math.LOG2E};function a(t,e,i){return t<e?e:t>i?i:t}function o(t,e,n){function r(t){var e=134217729*t,i=t-e+e;return[i,t-i]}var s=e*e-t*n,a=e*e+t*n;if(3*i(s)<a){var o=r(t),h=r(e),u=r(n),l=e*e,c=t*n;s=l-c+(h[0]*h[0]-l+2*h[0]*h[1]+h[1]*h[1]-(o[0]*u[0]-c+o[0]*u[1]+o[1]*u[0]+o[1]*u[1]))}return s}function h(){var t=Math.max.apply(Math,arguments);return t&&(t<1e-8||t>1e8)?r(2,-Math.round(s(t))):0}return{EPSILON:1e-12,MACHINE_EPSILON:112e-18,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,ANGULAR_EPSILON:1e-5,KAPPA:4*(n(2)-1)/3,isZero:function(t){return t>=-1e-12&&t<=1e-12},isMachineZero:function(t){return t>=-112e-18&&t<=112e-18},clamp:a,integrate:function(i,n,r,s){for(var a=t[s-2],o=e[s-2],h=.5*(r-n),u=h+n,l=0,c=s+1>>1,f=1&s?o[l++]*i(u):0;l<c;){var d=h*a[l];f+=o[l++]*(i(u+d)+i(u-d))}return h*f},findRoot:function(t,e,n,r,s,o,h){for(var u=0;u<o;u++){var l=t(n),c=l/e(n),f=n-c;if(i(c)<h){n=f;break}l>0?(s=n,n=f<=r?.5*(r+s):f):(r=n,n=f>=s?.5*(r+s):f)}return a(n,r,s)},solveQuadratic:function(t,e,r,s,u,l){var c,f=1/0;if(i(t)<1e-12){if(i(e)<1e-12)return i(r)<1e-12?-1:0;c=-r/e}else{var d=o(t,e*=-.5,r);if(d&&i(d)<112e-18){var _=h(i(t),i(e),i(r));_&&(d=o(t*=_,e*=_,r*=_))}if(d>=-112e-18){var g=d<0?0:n(d),v=e+(e<0?-g:g);0===v?f=-(c=r/t):(c=v/t,f=r/v)}}var p=0,m=null==u,y=u-1e-12,w=l+1e-12;return isFinite(c)&&(m||c>y&&c<w)&&(s[p++]=m?c:a(c,u,l)),f!==c&&isFinite(f)&&(m||f>y&&f<w)&&(s[p++]=m?f:a(f,u,l)),p},solveCubic:function(t,e,s,o,u,c,f){var d,_,g,v,p,m=h(i(t),i(e),i(s),i(o));function y(i){var n=t*(d=i);v=(n+(_=n+e))*d+(g=_*d+s),p=g*d+o}if(m&&(t*=m,e*=m,s*=m,o*=m),i(t)<1e-12)t=e,_=s,g=o,d=1/0;else if(i(o)<1e-12)_=e,g=s,d=0;else{y(-e/t/3);var w=p/t,x=r(i(w),1/3),b=w<0?-1:1,S=-v/t,C=S>0?1.324717957244746*Math.max(x,n(S)):x,P=d-b*C;if(P!==d){do{y(P),P=0===v?d:d-p/v/(1+112e-18)}while(b*P>b*d);i(t)*d*d>i(o/d)&&(_=((g=-o/d)-s)/d)}}var I=l.solveQuadratic(t,_,g,u,c,f),M=null==c;return isFinite(d)&&(0===I||I>0&&d!==u[0]&&d!==u[1])&&(M||d>c-1e-12&&d<f+1e-12)&&(u[I++]=M?d:a(d,c,f)),I}}},c={_id:1,_pools:{},get:function(t){if(t){var e=this._pools[t];return e||(e=this._pools[t]={_id:1}),e._id++}return this._id++}},f=r.extend({_class:"Point",_readIndex:!0,initialize:function(t,e){var i=typeof t,n=this.__read,r=0;if("number"===i){var s="number"==typeof e;this._set(t,s?e:t),n&&(r=s?2:1)}else if("undefined"===i||null===t)this._set(0,0),n&&(r=null===t?1:0);else{var a="string"===i?t.split(/[\s,]+/)||[]:t;r=1,Array.isArray(a)?this._set(+a[0],+(a.length>1?a[1]:a[0])):"x"in a?this._set(a.x||0,a.y||0):"width"in a?this._set(a.width||0,a.height||0):"angle"in a?(this._set(a.length||0,0),this.setAngle(a.angle||0)):(this._set(0,0),r=0)}return n&&(this.__read=r),this},set:"#initialize",_set:function(t,e){return this.x=t,this.y=e,this},equals:function(t){return this===t||t&&(this.x===t.x&&this.y===t.y||Array.isArray(t)&&this.x===t[0]&&this.y===t[1])||!1},clone:function(){return new f(this.x,this.y)},toString:function(){var t=u.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+" }"},_serialize:function(t){var e=t.formatter;return[e.number(this.x),e.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(t){if(this.isZero()){var e=this._angle||0;this._set(Math.cos(e)*t,Math.sin(e)*t)}else{var i=t/this.getLength();l.isZero(i)&&this.getAngle(),this._set(this.x*i,this.y*i)}},getAngle:function(){return 180*this.getAngleInRadians.apply(this,arguments)/Math.PI},setAngle:function(t){this.setAngleInRadians.call(this,t*Math.PI/180)},getAngleInDegrees:"#getAngle",setAngleInDegrees:"#setAngle",getAngleInRadians:function(){if(arguments.length){var t=f.read(arguments),e=this.getLength()*t.getLength();if(l.isZero(e))return NaN;var i=this.dot(t)/e;return Math.acos(i<-1?-1:i>1?1:i)}return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(t){if(this._angle=t,!this.isZero()){var e=this.getLength();this._set(Math.cos(t)*e,Math.sin(t)*e)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var t=f.read(arguments);return 180*Math.atan2(this.cross(t),this.dot(t))/Math.PI},getDistance:function(){var t=arguments,e=f.read(t),i=e.x-this.x,n=e.y-this.y,s=i*i+n*n,a=r.read(t);return a?s:Math.sqrt(s)},normalize:function(t){t===e&&(t=1);var i=this.getLength(),n=0!==i?t/i:0,r=new f(this.x*n,this.y*n);return n>=0&&(r._angle=this._angle),r},rotate:function(t,e){if(0===t)return this.clone();t=t*Math.PI/180;var i=e?this.subtract(e):this,n=Math.sin(t),r=Math.cos(t);return i=new f(i.x*r-i.y*n,i.x*n+i.y*r),e?i.add(e):i},transform:function(t){return t?t._transformPoint(this):this},add:function(){var t=f.read(arguments);return new f(this.x+t.x,this.y+t.y)},subtract:function(){var t=f.read(arguments);return new f(this.x-t.x,this.y-t.y)},multiply:function(){var t=f.read(arguments);return new f(this.x*t.x,this.y*t.y)},divide:function(){var t=f.read(arguments);return new f(this.x/t.x,this.y/t.y)},modulo:function(){var t=f.read(arguments);return new f(this.x%t.x,this.y%t.y)},negate:function(){return new f(-this.x,-this.y)},isInside:function(){return v.read(arguments).contains(this)},isClose:function(){var t=arguments,e=f.read(t),i=r.read(t);return this.getDistance(e)<=i},isCollinear:function(){var t=f.read(arguments);return f.isCollinear(this.x,this.y,t.x,t.y)},isColinear:"#isCollinear",isOrthogonal:function(){var t=f.read(arguments);return f.isOrthogonal(this.x,this.y,t.x,t.y)},isZero:function(){var t=l.isZero;return t(this.x)&&t(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(t){return this.x*(t>1&&t<4?-1:1)>=0&&this.y*(t>2?-1:1)>=0},dot:function(){var t=f.read(arguments);return this.x*t.x+this.y*t.y},cross:function(){var t=f.read(arguments);return this.x*t.y-this.y*t.x},project:function(){var t=f.read(arguments),e=t.isZero()?0:this.dot(t)/t.dot(t);return new f(t.x*e,t.y*e)},statics:{min:function(){var t=arguments,e=f.read(t),i=f.read(t);return new f(Math.min(e.x,i.x),Math.min(e.y,i.y))},max:function(){var t=arguments,e=f.read(t),i=f.read(t);return new f(Math.max(e.x,i.x),Math.max(e.y,i.y))},random:function(){return new f(Math.random(),Math.random())},isCollinear:function(t,e,i,n){return Math.abs(t*n-e*i)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))},isOrthogonal:function(t,e,i,n){return Math.abs(t*i+e*n)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))}}},r.each(["round","ceil","floor","abs"],(function(t){var e=Math[t];this[t]=function(){return new f(e(this.x),e(this.y))}}),{})),d=f.extend({initialize:function(t,e,i,n){this._x=t,this._y=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._x=t,this._y=e,i||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){return"setPosition"===this._setter?4:0}}),_=r.extend({_class:"Size",_readIndex:!0,initialize:function(t,e){var i=typeof t,n=this.__read,r=0;if("number"===i){var s="number"==typeof e;this._set(t,s?e:t),n&&(r=s?2:1)}else if("undefined"===i||null===t)this._set(0,0),n&&(r=null===t?1:0);else{var a="string"===i?t.split(/[\s,]+/)||[]:t;r=1,Array.isArray(a)?this._set(+a[0],+(a.length>1?a[1]:a[0])):"width"in a?this._set(a.width||0,a.height||0):"x"in a?this._set(a.x||0,a.y||0):(this._set(0,0),r=0)}return n&&(this.__read=r),this},set:"#initialize",_set:function(t,e){return this.width=t,this.height=e,this},equals:function(t){return t===this||t&&(this.width===t.width&&this.height===t.height||Array.isArray(t)&&this.width===t[0]&&this.height===t[1])||!1},clone:function(){return new _(this.width,this.height)},toString:function(){var t=u.instance;return"{ width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){var e=t.formatter;return[e.number(this.width),e.number(this.height)]},add:function(){var t=_.read(arguments);return new _(this.width+t.width,this.height+t.height)},subtract:function(){var t=_.read(arguments);return new _(this.width-t.width,this.height-t.height)},multiply:function(){var t=_.read(arguments);return new _(this.width*t.width,this.height*t.height)},divide:function(){var t=_.read(arguments);return new _(this.width/t.width,this.height/t.height)},modulo:function(){var t=_.read(arguments);return new _(this.width%t.width,this.height%t.height)},negate:function(){return new _(-this.width,-this.height)},isZero:function(){var t=l.isZero;return t(this.width)&&t(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(t,e){return new _(Math.min(t.width,e.width),Math.min(t.height,e.height))},max:function(t,e){return new _(Math.max(t.width,e.width),Math.max(t.height,e.height))},random:function(){return new _(Math.random(),Math.random())}}},r.each(["round","ceil","floor","abs"],(function(t){var e=Math[t];this[t]=function(){return new _(e(this.width),e(this.height))}}),{})),g=_.extend({initialize:function(t,e,i,n){this._width=t,this._height=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._width=t,this._height=e,i||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(t){this._width=t,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(t){this._height=t,this._owner[this._setter](this)}}),v=r.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(t,i,n,s){var a,o=arguments,h=typeof t;if("number"===h?(this._set(t,i,n,s),a=4):"undefined"===h||null===t?(this._set(0,0,0,0),a=null===t?1:0):1===o.length&&(Array.isArray(t)?(this._set.apply(this,t),a=1):t.x!==e||t.width!==e?(this._set(t.x||0,t.y||0,t.width||0,t.height||0),a=1):t.from===e&&t.to===e&&(this._set(0,0,0,0),r.readSupported(o,this)&&(a=1))),a===e){var u,l,c=f.readNamed(o,"from"),d=r.peek(o),g=c.x,v=c.y;if(d&&d.x!==e||r.hasNamed(o,"to")){var p=f.readNamed(o,"to");u=p.x-g,l=p.y-v,u<0&&(g=p.x,u=-u),l<0&&(v=p.y,l=-l)}else{var m=_.read(o);u=m.width,l=m.height}this._set(g,v,u,l),a=o.__index}var y=o.__filtered;return y&&(this.__filtered=y),this.__read&&(this.__read=a),this},set:"#initialize",_set:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},clone:function(){return new v(this.x,this.y,this.width,this.height)},equals:function(t){var e=r.isPlainValue(t)?v.read(arguments):t;return e===this||e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height||!1},toString:function(){var t=u.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+", width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){var e=t.formatter;return[e.number(this.x),e.number(this.y),e.number(this.width),e.number(this.height)]},getPoint:function(t){return new(t?f:d)(this.x,this.y,this,"setPoint")},setPoint:function(){var t=f.read(arguments);this.x=t.x,this.y=t.y},getSize:function(t){return new(t?_:g)(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var t=_.read(arguments),e=this._sx,i=this._sy,n=t.width,r=t.height;e&&(this.x+=(this.width-n)*e),i&&(this.y+=(this.height-r)*i),this.width=n,this.height=r,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(t){if(!this._fw){var e=t-this.x;this.width-=.5===this._sx?2*e:e}this.x=t,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(t){if(!this._fh){var e=t-this.y;this.height-=.5===this._sy?2*e:e}this.y=t,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(t){if(!this._fw){var e=t-this.x;this.width=.5===this._sx?2*e:e}this.x=t-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(t){if(!this._fh){var e=t-this.y;this.height=.5===this._sy?2*e:e}this.y=t-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(t){this._fw||.5===this._sx?this.x=t-this.width/2:(this._sx&&(this.x+=2*(t-this.x)*this._sx),this.width=2*(t-this.x)),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(t){this._fh||.5===this._sy?this.y=t-this.height/2:(this._sy&&(this.y+=2*(t-this.y)*this._sy),this.height=2*(t-this.y)),this._sy=.5,this._fh=0},getCenter:function(t){return new(t?f:d)(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var t=f.read(arguments);return this.setCenterX(t.x),this.setCenterY(t.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return 0===this.width||0===this.height},contains:function(t){return t&&t.width!==e||4===(Array.isArray(t)?t:arguments).length?this._containsRectangle(v.read(arguments)):this._containsPoint(f.read(arguments))},_containsPoint:function(t){var e=t.x,i=t.y;return e>=this.x&&i>=this.y&&e<=this.x+this.width&&i<=this.y+this.height},_containsRectangle:function(t){var e=t.x,i=t.y;return e>=this.x&&i>=this.y&&e+t.width<=this.x+this.width&&i+t.height<=this.y+this.height},intersects:function(){var t=v.read(arguments),e=r.read(arguments)||0;return t.x+t.width>this.x-e&&t.y+t.height>this.y-e&&t.x<this.x+this.width+e&&t.y<this.y+this.height+e},intersect:function(){var t=v.read(arguments),e=Math.max(this.x,t.x),i=Math.max(this.y,t.y),n=Math.min(this.x+this.width,t.x+t.width),r=Math.min(this.y+this.height,t.y+t.height);return new v(e,i,n-e,r-i)},unite:function(){var t=v.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width),r=Math.max(this.y+this.height,t.y+t.height);return new v(e,i,n-e,r-i)},include:function(){var t=f.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x),r=Math.max(this.y+this.height,t.y);return new v(e,i,n-e,r-i)},expand:function(){var t=_.read(arguments),e=t.width,i=t.height;return new v(this.x-e/2,this.y-i/2,this.width+e,this.height+i)},scale:function(t,i){return this.expand(this.width*t-this.width,this.height*(i===e?t:i)-this.height)}},r.each([["Top","Left"],["Top","Right"],["Bottom","Left"],["Bottom","Right"],["Left","Center"],["Top","Center"],["Right","Center"],["Bottom","Center"]],(function(t,e){var i=t.join(""),n=/^[RL]/.test(i);e>=4&&(t[1]+=n?"Y":"X");var r=t[n?0:1],s=t[n?1:0],a="get"+r,o="get"+s,h="set"+r,u="set"+s,l="set"+i;this["get"+i]=function(t){return new(t?f:d)(this[a](),this[o](),this,l)},this[l]=function(){var t=f.read(arguments);this[h](t.x),this[u](t.y)}}),{beans:!0})),p=v.extend({initialize:function(t,e,i,n,r,s){this._set(t,e,i,n,!0),this._owner=r,this._setter=s},_set:function(t,e,i,n,r){return this._x=t,this._y=e,this._width=i,this._height=n,r||this._owner[this._setter](this),this}},new function(){var t=v.prototype;return r.each(["x","y","width","height"],(function(t){var e=r.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._dontNotify||this._owner[this._setter](this)}}),r.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],(function(e){var i="set"+e;this[i]=function(){this._dontNotify=!0,t[i].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}}),{isSelected:function(){return!!(2&this._owner._selection)},setSelected:function(t){var e=this._owner;e._changeSelection&&e._changeSelection(2,t)}}))}),m=r.extend({_class:"Matrix",initialize:function t(e,i){var n=arguments,r=n.length,s=!0;if(r>=6?this._set.apply(this,n):1===r||2===r?e instanceof t?this._set(e._a,e._b,e._c,e._d,e._tx,e._ty,i):Array.isArray(e)?this._set.apply(this,i?e.concat([i]):e):s=!1:r?s=!1:this.reset(),!s)throw new Error("Unsupported matrix parameters");return this},set:"#initialize",_set:function(t,e,i,n,r,s,a){return this._a=t,this._b=e,this._c=i,this._d=n,this._tx=r,this._ty=s,a||this._changed(),this},_serialize:function(t,e){return r.serialize(this.getValues(),t,!0,e)},_changed:function(){var t=this._owner;t&&(t._applyMatrix?t.transform(null,!0):t._changed(25))},clone:function(){return new m(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(t){return t===this||t&&this._a===t._a&&this._b===t._b&&this._c===t._c&&this._d===t._d&&this._tx===t._tx&&this._ty===t._ty},toString:function(){var t=u.instance;return"[["+[t.number(this._a),t.number(this._c),t.number(this._tx)].join(", ")+"], ["+[t.number(this._b),t.number(this._d),t.number(this._ty)].join(", ")+"]]"},reset:function(t){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,t||this._changed(),this},apply:function(t,e){var i=this._owner;return!!i&&(i.transform(null,r.pick(t,!0),e),this.isIdentity())},translate:function(){var t=f.read(arguments),e=t.x,i=t.y;return this._tx+=e*this._a+i*this._c,this._ty+=e*this._b+i*this._d,this._changed(),this},scale:function(){var t=arguments,e=f.read(t),i=f.read(t,0,{readNull:!0});return i&&this.translate(i),this._a*=e.x,this._b*=e.x,this._c*=e.y,this._d*=e.y,i&&this.translate(i.negate()),this._changed(),this},rotate:function(t){t*=Math.PI/180;var e=f.read(arguments,1),i=e.x,n=e.y,r=Math.cos(t),s=Math.sin(t),a=i-i*r+n*s,o=n-i*s-n*r,h=this._a,u=this._b,l=this._c,c=this._d;return this._a=r*h+s*l,this._b=r*u+s*c,this._c=-s*h+r*l,this._d=-s*u+r*c,this._tx+=a*h+o*l,this._ty+=a*u+o*c,this._changed(),this},shear:function(){var t=arguments,e=f.read(t),i=f.read(t,0,{readNull:!0});i&&this.translate(i);var n=this._a,r=this._b;return this._a+=e.y*this._c,this._b+=e.y*this._d,this._c+=e.x*n,this._d+=e.x*r,i&&this.translate(i.negate()),this._changed(),this},skew:function(){var t=arguments,e=f.read(t),i=f.read(t,0,{readNull:!0}),n=Math.PI/180,r=new f(Math.tan(e.x*n),Math.tan(e.y*n));return this.shear(r,i)},append:function(t,e){if(t){var i=this._a,n=this._b,r=this._c,s=this._d,a=t._a,o=t._c,h=t._b,u=t._d,l=t._tx,c=t._ty;this._a=a*i+h*r,this._c=o*i+u*r,this._b=a*n+h*s,this._d=o*n+u*s,this._tx+=l*i+c*r,this._ty+=l*n+c*s,e||this._changed()}return this},prepend:function(t,e){if(t){var i=this._a,n=this._b,r=this._c,s=this._d,a=this._tx,o=this._ty,h=t._a,u=t._c,l=t._b,c=t._d,f=t._tx,d=t._ty;this._a=h*i+u*n,this._c=h*r+u*s,this._b=l*i+c*n,this._d=l*r+c*s,this._tx=h*a+u*o+f,this._ty=l*a+c*o+d,e||this._changed()}return this},appended:function(t){return this.clone().append(t)},prepended:function(t){return this.clone().prepend(t)},invert:function(){var t=this._a,e=this._b,i=this._c,n=this._d,r=this._tx,s=this._ty,a=t*n-e*i,o=null;return a&&!isNaN(a)&&isFinite(r)&&isFinite(s)&&(this._a=n/a,this._b=-e/a,this._c=-i/a,this._d=t/a,this._tx=(i*s-n*r)/a,this._ty=(e*r-t*s)/a,o=this),o},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new m(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return 1===this._a&&0===this._b&&0===this._c&&1===this._d&&0===this._tx&&0===this._ty},isInvertible:function(){var t=this._a*this._d-this._c*this._b;return t&&!isNaN(t)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(t,e,i){return arguments.length<3?this._transformPoint(f.read(arguments)):this._transformCoordinates(t,e,i)},_transformPoint:function(t,e,i){var n=t.x,r=t.y;return e||(e=new f),e._set(n*this._a+r*this._c+this._tx,n*this._b+r*this._d+this._ty,i)},_transformCoordinates:function(t,e,i){for(var n=0,r=2*i;n<r;n+=2){var s=t[n],a=t[n+1];e[n]=s*this._a+a*this._c+this._tx,e[n+1]=s*this._b+a*this._d+this._ty}return e},_transformCorners:function(t){var e=t.x,i=t.y,n=e+t.width,r=i+t.height,s=[e,i,n,i,n,r,e,r];return this._transformCoordinates(s,s,4)},_transformBounds:function(t,e,i){for(var n=this._transformCorners(t),r=n.slice(0,2),s=r.slice(),a=2;a<8;a++){var o=n[a],h=1&a;o<r[h]?r[h]=o:o>s[h]&&(s[h]=o)}return e||(e=new v),e._set(r[0],r[1],s[0]-r[0],s[1]-r[1],i)},inverseTransform:function(){return this._inverseTransform(f.read(arguments))},_inverseTransform:function(t,e,i){var n=this._a,r=this._b,s=this._c,a=this._d,o=this._tx,h=this._ty,u=n*a-r*s,l=null;if(u&&!isNaN(u)&&isFinite(o)&&isFinite(h)){var c=t.x-this._tx,d=t.y-this._ty;e||(e=new f),l=e._set((c*a-d*s)/u,(d*n-c*r)/u,i)}return l},decompose:function(){var t,e,i,n=this._a,r=this._b,s=this._c,a=this._d,o=n*a-r*s,h=Math.sqrt,u=Math.atan2,l=180/Math.PI;if(0!==n||0!==r){var c=h(n*n+r*r);t=Math.acos(n/c)*(r>0?1:-1),e=[c,o/c],i=[u(n*s+r*a,c*c),0]}else if(0!==s||0!==a){var d=h(s*s+a*a);t=Math.asin(s/d)*(a>0?1:-1),e=[o/d,d],i=[0,u(n*s+r*a,d*d)]}else t=0,i=e=[0,0];return{translation:this.getTranslation(),rotation:t*l,scaling:new f(e),skewing:new f(i[0]*l,i[1]*l)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new f(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(t){this.isIdentity()||t.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},r.each(["a","b","c","d","tx","ty"],(function(t){var e=r.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._changed()}}),{})),y=r.extend({_class:"Line",initialize:function(t,e,i,n,r){var s=!1;arguments.length>=4?(this._px=t,this._py=e,this._vx=i,this._vy=n,s=r):(this._px=t.x,this._py=t.y,this._vx=e.x,this._vy=e.y,s=i),s||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new f(this._px,this._py)},getVector:function(){return new f(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(t,e){return y.intersect(this._px,this._py,this._vx,this._vy,t._px,t._py,t._vx,t._vy,!0,e)},getSide:function(t,e){return y.getSide(this._px,this._py,this._vx,this._vy,t.x,t.y,!0,e)},getDistance:function(t){return Math.abs(this.getSignedDistance(t))},getSignedDistance:function(t){return y.getSignedDistance(this._px,this._py,this._vx,this._vy,t.x,t.y,!0)},isCollinear:function(t){return f.isCollinear(this._vx,this._vy,t._vx,t._vy)},isOrthogonal:function(t){return f.isOrthogonal(this._vx,this._vy,t._vx,t._vy)},statics:{intersect:function(t,e,i,n,r,s,a,o,h,u){h||(i-=t,n-=e,a-=r,o-=s);var c=i*o-n*a;if(!l.isMachineZero(c)){var d=t-r,_=e-s,g=(a*_-o*d)/c,v=(i*_-n*d)/c;if(u||-1e-12<g&&g<1+1e-12&&-1e-12<v&&v<1+1e-12)return u||(g=g<=0?0:g>=1?1:g),new f(t+g*i,e+g*n)}},getSide:function(t,e,i,n,r,s,a,o){a||(i-=t,n-=e);var h=r-t,u=h*n-(s-e)*i;return!o&&l.isMachineZero(u)&&(u=(h*i+h*i)/(i*i+n*n))>=0&&u<=1&&(u=0),u<0?-1:u>0?1:0},getSignedDistance:function(t,e,i,n,r,s,a){return a||(i-=t,n-=e),0===i?n>0?r-t:t-r:0===n?i<0?s-e:e-s:((r-t)*n-(s-e)*i)/(n>i?n*Math.sqrt(1+i*i/(n*n)):i*Math.sqrt(1+n*n/(i*i)))},getDistance:function(t,e,i,n,r,s,a){return Math.abs(y.getSignedDistance(t,e,i,n,r,s,a))}}}),w=o.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(t){o.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new H(null,null,this),this._view=W.create(this,t||et.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(t,e){return r.serialize(this._children,t,!0,e)},_changed:function(t,e){if(1&t){var i=this._view;i&&(i._needsUpdate=!0,!i._requested&&i._autoUpdate&&i.requestUpdate())}var n=this._changes;if(n&&e){var r=this._changesById,s=e._id,a=r[s];a?a.flags|=t:n.push(r[s]={item:e,flags:t})}},clear:function(){for(var t=this._children,e=t.length-1;e>=0;e--)t[e].remove()},isEmpty:function(){return!this._children.length},remove:function t(){return!!t.base.call(this)&&(this._view&&this._view.remove(),!0)},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(t){this._currentStyle.set(t)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new S({project:this,insert:!0})},getSymbolDefinitions:function(){var t=[],e={};return this.getItems({class:I,match:function(i){var n=i._definition,r=n._id;return e[r]||(e[r]=!0,t.push(n)),!1}}),t},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var t=this._selectionItems,e=[];for(var i in t){var n=t[i],r=n._selection;1&r&&n.isInserted()?e.push(n):r||this._updateSelection(n)}return e},_updateSelection:function(t){var e=t._id,i=this._selectionItems;t._selection?i[e]!==t&&(this._selectionCount++,i[e]=t):i[e]===t&&(this._selectionCount--,delete i[e])},selectAll:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)t[e].setFullySelected(!0)},deselectAll:function(){var t=this._selectionItems;for(var e in t)t[e].setFullySelected(!1)},addLayer:function(t){return this.insertLayer(e,t)},insertLayer:function(t,e){if(e instanceof S){e._remove(!1,!0),r.splice(this._children,[e],t,0),e._setProject(this,!0);var i=e._name;i&&e.setName(i),this._changes&&e._changed(5),this._activeLayer||(this._activeLayer=e)}else e=null;return e},_insertItem:function(t,i,n){return i=this.insertLayer(t,i)||(this._activeLayer||this._insertItem(e,new S(x.NO_INSERT),!0)).insertChild(t,i),n&&i.activate&&i.activate(),i},getItems:function(t){return x._getItems(this,t)},getItem:function(t){return x._getItems(this,t,null,null,!0)[0]||null},importJSON:function(t){this.activate();var e=this._activeLayer;return r.importJSON(t,e&&e.isEmpty()&&e)},removeOn:function(t){var e=this._removeSets;if(e){"mouseup"===t&&(e.mousedrag=null);var i=e[t];if(i){for(var n in i){var r=i[n];for(var s in e){var a=e[s];a&&a!=i&&delete a[r._id]}r.remove()}e[t]=null}}},draw:function(t,e,i){this._updateVersion++,t.save(),e.applyToContext(t);for(var n=this._children,s=new r({offset:new f(0,0),pixelRatio:i,viewMatrix:e.isIdentity()?null:e,matrices:[new m],updateMatrix:!0}),a=0,o=n.length;a<o;a++)n[a].draw(t,s);if(t.restore(),this._selectionCount>0){t.save(),t.strokeWidth=1;var h=this._selectionItems,u=this._scope.settings.handleSize,l=this._updateVersion;for(var c in h)h[c]._drawSelection(t,e,u,h,l);t.restore()}}}),x=r.extend(s,{statics:{extend:function t(e){return e._serializeFields&&(e._serializeFields=r.set({},this.prototype._serializeFields,e._serializeFields)),t.base.apply(this,arguments)},INSERT:{insert:!0},NO_INSERT:{insert:!1}},_class:"Item",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:"normal",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new m,pivot:null,visible:!0,blendMode:"normal",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:["applyMatrix"]},new function(){var t=["onMouseDown","onMouseUp","onMouseDrag","onClick","onDoubleClick","onMouseMove","onMouseEnter","onMouseLeave"];return r.each(t,(function(t){this._events[t]={install:function(t){this.getView()._countItemEvent(t,1)},uninstall:function(t){this.getView()._countItemEvent(t,-1)}}}),{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:t}})},{initialize:function(){},_initialize:function(t,i){var n=t&&r.isPlainObject(t),s=n&&!0===t.internal,a=this._matrix=new m,o=n&&t.project||st.project,h=st.settings;return this._id=s?null:c.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&h.applyMatrix,i&&a.translate(i),a._owner=this,this._style=new H(o._currentStyle,this,o),s||n&&0==t.insert||!h.insertItems&&(!n||1!=t.insert)?this._setProject(o):(n&&t.parent||o)._insertItem(e,this,!0),n&&t!==x.NO_INSERT&&t!==x.INSERT&&this.set(t,{internal:!0,insert:!0,project:!0,parent:!0}),n},_serialize:function(t,e){var i={},n=this;function s(s){for(var a in s){var o=n[a];r.equals(o,"leading"===a?1.2*s.fontSize:s[a])||(i[a]=r.serialize(o,t,"data"!==a,e))}}return s(this._serializeFields),this instanceof b||s(this._style._defaults),[this._class,i]},_changed:function(t){var i=this._symbol,n=this._parent||i,r=this._project;8&t&&(this._bounds=this._position=this._decomposed=e),16&t&&(this._globalMatrix=e),n&&72&t&&x._clearBoundsCache(n),2&t&&x._clearBoundsCache(this),r&&r._changed(t,this),i&&i._changed(t)},getId:function(){return this._id},getName:function(){return this._name},setName:function(t){if(this._name&&this._removeNamed(),t===+t+"")throw new Error("Names consisting only of numbers are not supported.");var i=this._getOwner();if(t&&i){var n=i._children,r=i._namedChildren;(r[t]=r[t]||[]).push(this),t in n||(n[t]=this)}this._name=t||e,this._changed(256)},getStyle:function(){return this._style},setStyle:function(t){this.getStyle().set(t)}},r.each(["locked","visible","blendMode","opacity","guide"],(function(t){var e=r.capitalize(t),i="_"+t,n={locked:256,visible:265};this["get"+e]=function(){return this[i]},this["set"+e]=function(e){e!=this[i]&&(this[i]=e,this._changed(n[t]||257))}}),{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(t){if(t!==this._selection){this._selection=t;var e=this._project;e&&(e._updateSelection(this),this._changed(257))}},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){if(this._selectChildren)for(var t=this._children,e=0,i=t.length;e<i;e++)if(t[e].isSelected())return!0;return!!(1&this._selection)},setSelected:function(t){if(this._selectChildren)for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setSelected(t);this._changeSelection(1,t)},isFullySelected:function(){var t=this._children,e=!!(1&this._selection);if(t&&e){for(var i=0,n=t.length;i<n;i++)if(!t[i].isFullySelected())return!1;return!0}return e},setFullySelected:function(t){var e=this._children;if(e)for(var i=0,n=e.length;i<n;i++)e[i].setFullySelected(t);this._changeSelection(1,t)},isClipMask:function(){return this._clipMask},setClipMask:function(t){this._clipMask!=(t=!!t)&&(this._clipMask=t,t&&(this.setFillColor(null),this.setStrokeColor(null)),this._changed(257),this._parent&&this._parent._changed(2048))},getData:function(){return this._data||(this._data={}),this._data},setData:function(t){this._data=t},getPosition:function(t){var e=t?f:d,i=this._position||(this._position=this._getPositionFromBounds());return new e(i.x,i.y,this,"setPosition")},setPosition:function(){this.translate(f.read(arguments).subtract(this.getPosition(!0)))},_getPositionFromBounds:function(t){return this._pivot?this._matrix._transformPoint(this._pivot):(t||this.getBounds()).getCenter(!0)},getPivot:function(){var t=this._pivot;return t?new d(t.x,t.y,this,"setPivot"):null},setPivot:function(){this._pivot=f.read(arguments,0,{clone:!0,readNull:!0}),this._position=e}},r.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},(function(t,e){this[e]=function(e){return this.getBounds(e,t)}}),{beans:!0,getBounds:function(t,e){var i=e||t instanceof m,n=r.set({},i?e:t,this._boundsOptions);n.stroke&&!this.getStrokeScaling()||(n.cacheItem=this);var s=this._getCachedBounds(i&&t,n).rect;return arguments.length?s:new p(s.x,s.y,s.width,s.height,this,"setBounds")},setBounds:function(){var t=v.read(arguments),e=this.getBounds(),i=this._matrix,n=new m,r=t.getCenter();n.translate(r),t.width==e.width&&t.height==e.height||(i.isInvertible()||(i.set(i._backup||(new m).translate(i.getTranslation())),e=this.getBounds()),n.scale(0!==e.width?t.width/e.width:0,0!==e.height?t.height/e.height:0)),r=e.getCenter(),n.translate(-r.x,-r.y),this.transform(n)},_getBounds:function(t,e){var i=this._children;return i&&i.length?(x._updateBoundsCache(this,e.cacheItem),x._getBounds(i,t,e)):new v},_getBoundsCacheKey:function(t,e){return[t.stroke?1:0,t.handle?1:0,e?1:0].join("")},_getCachedBounds:function(t,e,i){t=t&&t._orNullIfIdentity();var n=e.internal&&!i,r=e.cacheItem,s=n?null:this._matrix._orNullIfIdentity(),a=r&&(!t||t.equals(s))&&this._getBoundsCacheKey(e,n),o=this._bounds;if(x._updateBoundsCache(this._parent||this._symbol,r),a&&o&&a in o)return{rect:(f=o[a]).rect.clone(),nonscaling:f.nonscaling};var h=this._getBounds(t||s,e),u=h.rect||h,l=this._style,c=h.nonscaling||l.hasStroke()&&!l.getStrokeScaling();if(a){o||(this._bounds=o={});var f=o[a]={rect:u.clone(),nonscaling:c,internal:n}}return{rect:u,nonscaling:c}},_getStrokeMatrix:function(t,e){var i=this.getStrokeScaling()?null:e&&e.internal?this:this._parent||this._symbol&&this._symbol._item,n=i?i.getViewMatrix().invert():t;return n&&n._shiftless()},statics:{_updateBoundsCache:function(t,e){if(t&&e){var i=e._id,n=t._boundsCache=t._boundsCache||{ids:{},list:[]};n.ids[i]||(n.list.push(e),n.ids[i]=e)}},_clearBoundsCache:function(t){var i=t._boundsCache;if(i){t._bounds=t._position=t._boundsCache=e;for(var n=0,r=i.list,s=r.length;n<s;n++){var a=r[n];a!==t&&(a._bounds=a._position=e,a._boundsCache&&x._clearBoundsCache(a))}}},_getBounds:function(t,e,i){var n=1/0,r=-n,s=n,a=r,o=!1;i=i||{};for(var h=0,u=t.length;h<u;h++){var l=t[h];if(l._visible&&!l.isEmpty(!0)){var c=l._getCachedBounds(e&&e.appended(l._matrix),i,!0),f=c.rect;n=Math.min(f.x,n),s=Math.min(f.y,s),r=Math.max(f.x+f.width,r),a=Math.max(f.y+f.height,a),c.nonscaling&&(o=!0)}}return{rect:isFinite(n)?new v(n,s,r-n,a-s):new v,nonscaling:o}}}}),{beans:!0,_decompose:function(){return this._applyMatrix?null:this._decomposed||(this._decomposed=this._matrix.decompose())},getRotation:function(){var t=this._decompose();return t?t.rotation:0},setRotation:function(t){var e=this.getRotation();if(null!=e&&null!=t){var i=this._decomposed;this.rotate(t-e),i&&(i.rotation=t,this._decomposed=i)}},getScaling:function(){var t=this._decompose(),e=t&&t.scaling;return new d(e?e.x:1,e?e.y:1,this,"setScaling")},setScaling:function(){var t=this.getScaling(),e=f.read(arguments,0,{clone:!0,readNull:!0});if(t&&e&&!t.equals(e)){var i=this.getRotation(),n=this._decomposed,r=new m,s=l.isZero;if(s(t.x)||s(t.y))r.translate(n.translation),i&&r.rotate(i),r.scale(e.x,e.y),this._matrix.set(r);else{var a=this.getPosition(!0);r.translate(a),i&&r.rotate(i),r.scale(e.x/t.x,e.y/t.y),i&&r.rotate(-i),r.translate(a.negate()),this.transform(r)}n&&(n.scaling=e,this._decomposed=n)}},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.set.apply(t,arguments)},getGlobalMatrix:function(t){var e=this._globalMatrix;if(e)for(var i=this._parent,n=[];i;){if(!i._globalMatrix){e=null;for(var r=0,s=n.length;r<s;r++)n[r]._globalMatrix=null;break}n.push(i),i=i._parent}e||(e=this._globalMatrix=this._matrix.clone(),(i=this._parent)&&e.prepend(i.getGlobalMatrix(!0)));return t?e:e.clone()},getViewMatrix:function(){return this.getGlobalMatrix().prepend(this.getView()._matrix)},getApplyMatrix:function(){return this._applyMatrix},setApplyMatrix:function(t){(this._applyMatrix=this._canApplyMatrix&&!!t)&&this.transform(null,!0)},getTransformContent:"#getApplyMatrix",setTransformContent:"#setApplyMatrix"},{getProject:function(){return this._project},_setProject:function(t,e){if(this._project!==t){this._project&&this._installEvents(!1),this._project=t;for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._setProject(t);e=!0}e&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function t(e){t.base.call(this,e);for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._installEvents(e)},getLayer:function(){for(var t=this;t=t._parent;)if(t instanceof S)return t;return null},getParent:function(){return this._parent},setParent:function(t){return t.addChild(this)},_getOwner:"#getParent",getChildren:function(){return this._children},setChildren:function(t){this.removeChildren(),this.addChildren(t)},getFirstChild:function(){return this._children&&this._children[0]||null},getLastChild:function(){return this._children&&this._children[this._children.length-1]||null},getNextSibling:function(){var t=this._getOwner();return t&&t._children[this._index+1]||null},getPreviousSibling:function(){var t=this._getOwner();return t&&t._children[this._index-1]||null},getIndex:function(){return this._index},equals:function(t){return t===this||t&&this._class===t._class&&this._style.equals(t._style)&&this._matrix.equals(t._matrix)&&this._locked===t._locked&&this._visible===t._visible&&this._blendMode===t._blendMode&&this._opacity===t._opacity&&this._clipMask===t._clipMask&&this._guide===t._guide&&this._equals(t)||!1},_equals:function(t){return r.equals(this._children,t._children)},clone:function(t){var i=new this.constructor(x.NO_INSERT),n=this._children,s=r.pick(t?t.insert:e,t===e||!0===t),a=r.pick(t?t.deep:e,!0);n&&i.copyAttributes(this),n&&!a||i.copyContent(this),n||i.copyAttributes(this),s&&i.insertAbove(this);var o=this._name,h=this._parent;if(o&&h){n=h._children;for(var u=o,l=1;n[o];)o=u+" "+l++;o!==u&&i.setName(o)}return i},copyContent:function(t){for(var e=t._children,i=0,n=e&&e.length;i<n;i++)this.addChild(e[i].clone(!1),!0)},copyAttributes:function(t,e){this.setStyle(t._style);for(var i=["_locked","_visible","_blendMode","_opacity","_clipMask","_guide"],n=0,s=i.length;n<s;n++){var a=i[n];t.hasOwnProperty(a)&&(this[a]=t[a])}e||this._matrix.set(t._matrix,!0),this.setApplyMatrix(t._applyMatrix),this.setPivot(t._pivot),this.setSelection(t._selection);var o=t._data,h=t._name;this._data=o?r.clone(o):null,h&&this.setName(h)},rasterize:function(t,i){var n,s,a;r.isPlainObject(t)?(n=t.resolution,s=t.insert,a=t.raster):(n=t,s=i),a||(a=new P(x.NO_INSERT));var o=this.getStrokeBounds(),h=(n||this.getView().getResolution())/72,u=o.getTopLeft().floor(),l=o.getBottomRight().ceil(),c=new _(l.subtract(u)),f=c.multiply(h);if(a.setSize(f,!0),!f.isZero()){var d=a.getContext(!0),g=(new m).scale(h).translate(u.negate());d.save(),g.applyToContext(d),this.draw(d,new r({matrices:[g]})),d.restore()}return a._matrix.set((new m).translate(u.add(c.divide(2))).scale(1/h)),(s===e||s)&&a.insertAbove(this),a},contains:function(){var t=this._matrix;return t.isInvertible()&&!!this._contains(t._inverseTransform(f.read(arguments)))},_contains:function(t){var e=this._children;if(e){for(var i=e.length-1;i>=0;i--)if(e[i].contains(t))return!0;return!1}return t.isInside(this.getInternalBounds())},isInside:function(){return v.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new N.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(t,e){return t instanceof x&&this._asPathItem().getIntersections(t._asPathItem(),null,e,!0).length>0}},new function(){function t(){var t=arguments;return this._hitTest(f.read(t),T.getOptions(t))}function e(){var t=arguments,e=f.read(t),i=T.getOptions(t),n=[];return this._hitTest(e,new r({all:n},i)),n}function i(t,e,i,n){var r=this._children;if(r)for(var s=r.length-1;s>=0;s--){var a=r[s],o=a!==n&&a._hitTest(t,e,i);if(o&&!e.all)return o}return null}return w.inject({hitTest:t,hitTestAll:e,_hitTest:i}),{hitTest:t,hitTestAll:e,_hitTestChildren:i}},{_hitTest:function(t,e,i){if(this._locked||!this._visible||this._guide&&!e.guides||this.isEmpty())return null;var n=this._matrix,s=i?i.appended(n):this.getGlobalMatrix().prepend(this.getView()._matrix),a=Math.max(e.tolerance,1e-12),o=e._tolerancePadding=new _(N._getStrokePadding(a,n._shiftless().invert()));if(!(t=n._inverseTransform(t))||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(o.multiply(2))._containsPoint(t))return null;var h,u,l=!(e.guides&&!this._guide||e.selected&&!this.isSelected()||e.type&&e.type!==r.hyphenate(this._class)||e.class&&!(this instanceof e.class)),c=e.match,f=this;function d(t){return t&&c&&!c(t)&&(t=null),t&&e.all&&e.all.push(t),t}function g(e,i){var n=i?h["get"+i]():f.getPosition();if(t.subtract(n).divide(o).length<=1)return new T(e,f,{name:i?r.hyphenate(i):e,point:n})}var v=e.position,p=e.center,m=e.bounds;if(l&&this._parent&&(v||p||m)){if((p||m)&&(h=this.getInternalBounds()),!(u=v&&g("position")||p&&g("center","Center"))&&m)for(var y=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],w=0;w<8&&!u;w++)u=g("bounds",y[w]);u=d(u)}return u||(u=this._hitTestChildren(t,e,s)||l&&d(this._hitTestSelf(t,e,s,this.getStrokeScaling()?null:s._shiftless().invert()))||null),u&&u.point&&(u.point=n.transform(u.point)),u},_hitTestSelf:function(t,e){if(e.fill&&this.hasFill()&&this._contains(t))return new T("fill",this)},matches:function(t,e){var i=typeof t;if("object"===i){for(var n in t)if(t.hasOwnProperty(n)&&!this.matches(n,t[n]))return!1;return!0}if("function"===i)return t(this);if("match"===t)return e(this);var s=/^(empty|editable)$/.test(t)?this["is"+r.capitalize(t)]():"type"===t?r.hyphenate(this._class):this[t];if("class"===t){if("function"==typeof e)return this instanceof e;s=this._class}if("function"==typeof e)return!!e(s);if(e){if(e.test)return e.test(s);if(r.isPlainObject(e))return function t(e,i){for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],a=i[n];if(r.isPlainObject(s)&&r.isPlainObject(a)){if(!t(s,a))return!1}else if(!r.equals(s,a))return!1}return!0}(e,s)}return r.equals(s,e)},getItems:function(t){return x._getItems(this,t,this._matrix)},getItem:function(t){return x._getItems(this,t,this._matrix,null,!0)[0]||null},statics:{_getItems:function t(e,i,n,s,a){if(!s){var o="object"==typeof i&&i,h=o&&o.overlapping,u=o&&o.inside,l=(w=h||u)&&v.read([w]);s={items:[],recursive:o&&!1!==o.recursive,inside:!!u,overlapping:!!h,rect:l,path:h&&new N.Rectangle({rectangle:l,insert:!1})},o&&(i=r.filter({},i,{recursive:!0,inside:!0,overlapping:!0}))}var c=e._children,f=s.items;n=(l=s.rect)&&(n||new m);for(var d=0,_=c&&c.length;d<_;d++){var g=c[d],p=n&&n.appended(g._matrix),y=!0;if(l){var w=g.getBounds(p);if(!l.intersects(w))continue;l.contains(w)||s.overlapping&&(w.contains(l)||s.path.intersects(g,p))||(y=!1)}if(y&&g.matches(i)&&(f.push(g),a))break;if(!1!==s.recursive&&t(g,i,p,s,a),a&&f.length>0)break}return f}}},{importJSON:function(t){var e=r.importJSON(t,this);return e!==this?this.addChild(e):e},addChild:function(t){return this.insertChild(e,t)},insertChild:function(t,e){var i=e?this.insertChildren(t,[e]):null;return i&&i[0]},addChildren:function(t){return this.insertChildren(this._children.length,t)},insertChildren:function(t,e){var i=this._children;if(i&&e&&e.length>0){for(var n={},s=(e=r.slice(e)).length-1;s>=0;s--){var a=(l=e[s])&&l._id;!l||n[a]?e.splice(s,1):(l._remove(!1,!0),n[a]=!0)}r.splice(i,e,t,0);for(var o=this._project,h=o._changes,u=(s=0,e.length);s<u;s++){var l,c=(l=e[s])._name;l._parent=this,l._setProject(o,!0),c&&l.setName(c),h&&l._changed(5)}this._changed(11)}else e=null;return e},_insertItem:"#insertChild",_insertAt:function(t,e){var i=t&&t._getOwner(),n=t!==this&&i?this:null;return n&&(n._remove(!1,!0),i._insertItem(t._index+e,n)),n},insertAbove:function(t){return this._insertAt(t,1)},insertBelow:function(t){return this._insertAt(t,0)},sendToBack:function(){var t=this._getOwner();return t?t._insertItem(0,this):null},bringToFront:function(){var t=this._getOwner();return t?t._insertItem(e,this):null},appendTop:"#addChild",appendBottom:function(t){return this.insertChild(0,t)},moveAbove:"#insertAbove",moveBelow:"#insertBelow",addTo:function(t){return t._insertItem(e,this)},copyTo:function(t){return this.clone(!1).addTo(t)},reduce:function(t){var e=this._children;if(e&&1===e.length){var i=e[0].reduce(t);return this._parent?(i.insertAbove(this),this.remove()):i.remove(),i}return this},_removeNamed:function(){var t=this._getOwner();if(t){var e=t._children,i=t._namedChildren,n=this._name,r=i[n],s=r?r.indexOf(this):-1;-1!==s&&(e[n]==this&&delete e[n],r.splice(s,1),r.length?e[n]=r[0]:delete i[n])}},_remove:function(t,e){var i=this._getOwner(),n=this._project,s=this._index;return this._style&&this._style._dispose(),!!i&&(this._name&&this._removeNamed(),null!=s&&(n._activeLayer===this&&(n._activeLayer=this.getNextSibling()||this.getPreviousSibling()),r.splice(i._children,null,s,1)),this._installEvents(!1),t&&n._changes&&this._changed(5),e&&i._changed(11,this),this._parent=null,!0)},remove:function(){return this._remove(!0,!0)},replaceWith:function(t){var e=t&&t.insertBelow(this);return e&&this.remove(),e},removeChildren:function(t,e){if(!this._children)return null;t=t||0,e=r.pick(e,this._children.length);for(var i=r.splice(this._children,null,t,e-t),n=i.length-1;n>=0;n--)i[n]._remove(!0,!1);return i.length>0&&this._changed(11),i},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var t=0,e=this._children.length;t<e;t++)this._children[t]._index=t;this._changed(11)}},isEmpty:function(t){var e=this._children,i=e?e.length:0;if(t){for(var n=0;n<i;n++)if(!e[n].isEmpty(t))return!1;return!0}return!i},isEditable:function(){for(var t=this;t;){if(!t._visible||t._locked)return!1;t=t._parent}return!0},hasFill:function(){return this.getStyle().hasFill()},hasStroke:function(){return this.getStyle().hasStroke()},hasShadow:function(){return this.getStyle().hasShadow()},_getOrder:function(t){function e(t){var e=[];do{e.unshift(t)}while(t=t._parent);return e}for(var i=e(this),n=e(t),r=0,s=Math.min(i.length,n.length);r<s;r++)if(i[r]!=n[r])return i[r]._index<n[r]._index?1:-1;return 0},hasChildren:function(){return this._children&&this._children.length>0},isInserted:function(){return!!this._parent&&this._parent.isInserted()},isAbove:function(t){return-1===this._getOrder(t)},isBelow:function(t){return 1===this._getOrder(t)},isParent:function(t){return this._parent===t},isChild:function(t){return t&&t._parent===this},isDescendant:function(t){for(var e=this;e=e._parent;)if(e===t)return!0;return!1},isAncestor:function(t){return!!t&&t.isDescendant(this)},isSibling:function(t){return this._parent===t._parent},isGroupedWith:function(t){for(var e=this._parent;e;){if(e._parent&&/^(Group|Layer|CompoundPath)$/.test(e._class)&&t.isDescendant(e))return!0;e=e._parent}return!1}},r.each(["rotate","scale","shear","skew"],(function(t){var e="rotate"===t;this[t]=function(){var i=arguments,n=(e?r:f).read(i),s=f.read(i,0,{readNull:!0});return this.transform((new m)[t](n,s||this.getPosition(!0)))}}),{translate:function(){var t=new m;return this.transform(t.translate.apply(t,arguments))},transform:function(t,e,i){var n=this._matrix,r=t&&!t.isIdentity(),s=i&&this._canApplyMatrix||this._applyMatrix&&(r||!n.isIdentity()||e&&this._children);if(!r&&!s)return this;if(r){!t.isInvertible()&&n.isInvertible()&&(n._backup=n.getValues()),n.prepend(t,!0);var a=this._style,o=a.getFillColor(!0),h=a.getStrokeColor(!0);o&&o.transform(t),h&&h.transform(t)}if(s&&(s=this._transformContent(n,e,i))){var u=this._pivot;u&&n._transformPoint(u,u,!0),n.reset(!0),i&&this._canApplyMatrix&&(this._applyMatrix=!0)}var l=this._bounds,c=this._position;(r||s)&&this._changed(25);var f=r&&l&&t.decompose();if(f&&f.skewing.isZero()&&f.rotation%90==0){for(var d in l){var _=l[d];if(_.nonscaling)delete l[d];else if(s||!_.internal){var g=_.rect;t._transformBounds(g,g)}}this._bounds=l;var v=l[this._getBoundsCacheKey(this._boundsOptions||{})];v&&(this._position=this._getPositionFromBounds(v.rect))}else r&&c&&this._pivot&&(this._position=t._transformPoint(c,c));return this},_transformContent:function(t,e,i){var n=this._children;if(n){for(var r=0,s=n.length;r<s;r++)n[r].transform(t,e,i);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(f.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(f.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(f.read(arguments))},localToParent:function(){return this._matrix._transformPoint(f.read(arguments))},fitBounds:function(t,e){t=v.read(arguments);var i=this.getBounds(),n=i.height/i.width,r=t.height/t.width,s=(e?n>r:n<r)?t.width/i.width:t.height/i.height,a=new v(new f,new _(i.width*s,i.height*s));a.setCenter(t.getCenter()),this.setBounds(a)}}),{_setStyles:function(t,e,i){var n=this._style,r=this._matrix;if(n.hasFill()&&(t.fillStyle=n.getFillColor().toCanvasStyle(t,r)),n.hasStroke()){t.strokeStyle=n.getStrokeColor().toCanvasStyle(t,r),t.lineWidth=n.getStrokeWidth();var s=n.getStrokeJoin(),a=n.getStrokeCap(),o=n.getMiterLimit();if(s&&(t.lineJoin=s),a&&(t.lineCap=a),o&&(t.miterLimit=o),st.support.nativeDash){var h=n.getDashArray(),u=n.getDashOffset();h&&h.length&&("setLineDash"in t?(t.setLineDash(h),t.lineDashOffset=u):(t.mozDash=h,t.mozDashOffset=u))}}if(n.hasShadow()){var l=e.pixelRatio||1,c=i._shiftless().prepend((new m).scale(l,l)),d=c.transform(new f(n.getShadowBlur(),0)),_=c.transform(this.getShadowOffset());t.shadowColor=n.getShadowColor().toCanvasStyle(t),t.shadowBlur=d.getLength(),t.shadowOffsetX=_.x,t.shadowOffsetY=_.y}},draw:function(t,e,i){this._updateVersion=this._project._updateVersion;if(this._visible&&0!==this._opacity){var n=e.matrices,r=e.viewMatrix,s=this._matrix,a=n[n.length-1].appended(s);if(a.isInvertible()){r=r?r.appended(a):a,n.push(a),e.updateMatrix&&(this._globalMatrix=a);var o,h,u,c=this._blendMode,f=l.clamp(this._opacity,0,1),d="normal"===c,_=it.nativeModes[c],g=d&&1===f||e.dontStart||e.clip||(_||d&&f<1)&&this._canComposite(),v=e.pixelRatio||1;if(!g){var p=this.getStrokeBounds(r);if(!p.width||!p.height)return void n.pop();u=e.offset,h=e.offset=p.getTopLeft().floor(),o=t,t=et.getContext(p.getSize().ceil().add(1).multiply(v)),1!==v&&t.scale(v,v)}t.save();var m=i?i.appended(s):this._canScaleStroke&&!this.getStrokeScaling(!0)&&r,y=!g&&e.clipItem,w=!m||y;if(g?(t.globalAlpha=f,_&&(t.globalCompositeOperation=c)):w&&t.translate(-h.x,-h.y),w&&(g?s:r).applyToContext(t),y&&e.clipItem.draw(t,e.extend({clip:!0})),m){t.setTransform(v,0,0,v,0,0);var x=e.offset;x&&t.translate(-x.x,-x.y)}this._draw(t,e,r,m),t.restore(),n.pop(),e.clip&&!e.dontFinish&&t.clip(this.getFillRule()),g||(it.process(c,t,o,f,h.subtract(u).multiply(v)),et.release(t),e.offset=u)}}},_isUpdated:function(t){var e=this._parent;if(e instanceof B)return e._isUpdated(t);var i=this._updateVersion===t;return!i&&e&&e._visible&&e._isUpdated(t)&&(this._updateVersion=t,i=!0),i},_drawSelection:function(t,e,i,n,r){var s=this._selection,a=1&s,o=2&s||a&&this._selectBounds,h=4&s;if(this._drawSelected||(a=!1),(a||o||h)&&this._isUpdated(r)){var u,l=this.getSelectedColor(!0)||(u=this.getLayer())&&u.getSelectedColor(!0),c=e.appended(this.getGlobalMatrix(!0)),f=i/2;if(t.strokeStyle=t.fillStyle=l?l.toCanvasStyle(t):"#009dec",a&&this._drawSelected(t,c,n),h){var d=this.getPosition(!0),_=this._parent,g=_?_.localToGlobal(d):d,v=g.x,p=g.y;t.beginPath(),t.arc(v,p,f,0,2*Math.PI,!0),t.stroke();for(var m=[[0,-1],[1,0],[0,1],[-1,0]],y=f,w=i+1,x=0;x<4;x++){var b=m[x],S=b[0],C=b[1];t.moveTo(v+S*y,p+C*y),t.lineTo(v+S*w,p+C*w),t.stroke()}}if(o){var P=c._transformCorners(this.getInternalBounds());t.beginPath();for(x=0;x<8;x++)t[x?"lineTo":"moveTo"](P[x],P[++x]);t.closePath(),t.stroke();for(x=0;x<8;x++)t.fillRect(P[x]-f,P[++x]-f,i,i)}}},_canComposite:function(){return!1}},r.each(["down","drag","up","move"],(function(t){this["removeOn"+r.capitalize(t)]=function(){var e={};return e[t]=!0,this.removeOn(e)}}),{removeOn:function(t){for(var e in t)if(t[e]){var i="mouse"+e,n=this._project,r=n._removeSets=n._removeSets||{};r[i]=r[i]||{},r[i][this._id]=this}return this}}),{tween:function(t,e,i){i||(i=e,e=t,t=null,i||(i=e,e=null));var n=i&&i.easing,r=i&&i.start,s=null!=i&&("number"==typeof i?i:i.duration),a=new Y(this,t,e,s,n,r);return s&&this.on("frame",(function t(e){a._handleFrame(1e3*e.time),a.running||this.off("frame",t)})),a},tweenTo:function(t,e){return this.tween(null,t,e)},tweenFrom:function(t,e){return this.tween(t,null,e)}}),b=x.extend({_class:"Group",_selectBounds:!1,_selectChildren:!0,_serializeFields:{children:[]},initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||this.addChildren(Array.isArray(t)?t:arguments)},_changed:function t(i){t.base.call(this,i),2050&i&&(this._clipItem=e)},_getClipItem:function(){var t=this._clipItem;if(t===e){t=null;for(var i=this._children,n=0,r=i.length;n<r;n++)if(i[n]._clipMask){t=i[n];break}this._clipItem=t}return t},isClipped:function(){return!!this._getClipItem()},setClipped:function(t){var e=this.getFirstChild();e&&e.setClipMask(t)},_getBounds:function t(e,i){var n=this._getClipItem();return n?n._getCachedBounds(n._matrix.prepended(e),r.set({},i,{stroke:!1})):t.base.call(this,e,i)},_hitTestChildren:function t(e,i,n){var r=this._getClipItem();return(!r||r.contains(e))&&t.base.call(this,e,i,n,r)},_draw:function(t,e){var i=e.clip,n=!i&&this._getClipItem();e=e.extend({clipItem:n,clip:!1}),i?(t.beginPath(),e.dontStart=e.dontFinish=!0):n&&n.draw(t,e.extend({clip:!0}));for(var r=this._children,s=0,a=r.length;s<a;s++){var o=r[s];o!==n&&o.draw(t,e)}}}),S=b.extend({_class:"Layer",initialize:function(){b.apply(this,arguments)},_getOwner:function(){return this._parent||null!=this._index&&this._project},isInserted:function t(){return this._parent?t.base.call(this):null!=this._index},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),C=x.extend({_class:"Shape",_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function(t,e){this._initialize(t,e)},_equals:function(t){return this._type===t._type&&this._size.equals(t._size)&&r.equals(this._radius,t._radius)},copyContent:function(t){this.setType(t._type),this.setSize(t._size),this.setRadius(t._radius)},getType:function(){return this._type},setType:function(t){this._type=t},getShape:"#getType",setShape:"#setType",getSize:function(){var t=this._size;return new g(t.width,t.height,this,"setSize")},setSize:function(){var t=_.read(arguments);if(this._size){if(!this._size.equals(t)){var e=this._type,i=t.width,n=t.height;"rectangle"===e?this._radius.set(_.min(this._radius,t.divide(2).abs())):"circle"===e?(i=n=(i+n)/2,this._radius=i/2):"ellipse"===e&&this._radius._set(i/2,n/2),this._size._set(i,n),this._changed(9)}}else this._size=t.clone()},getRadius:function(){var t=this._radius;return"circle"===this._type?t:new g(t.width,t.height,this,"setRadius")},setRadius:function(t){var e=this._type;if("circle"===e){if(t===this._radius)return;var i=2*t;this._radius=t,this._size._set(i,i)}else if(t=_.read(arguments),this._radius){if(this._radius.equals(t))return;if(this._radius.set(t),"rectangle"===e){i=_.max(this._size,t.multiply(2));this._size.set(i)}else"ellipse"===e&&this._size._set(2*t.width,2*t.height)}else this._radius=t.clone();this._changed(9)},isEmpty:function(){return!1},toPath:function(t){var i=new(N[r.capitalize(this._type)])({center:new f,size:this._size,radius:this._radius,insert:!1});return i.copyAttributes(this),st.settings.applyMatrix&&i.setApplyMatrix(!0),(t===e||t)&&i.insertAbove(this),i},toShape:"#clone",_asPathItem:function(){return this.toPath(!1)},_draw:function(t,e,i,n){var r=this._style,s=r.hasFill(),a=r.hasStroke(),o=e.dontFinish||e.clip,h=!n;if(s||a||o){var u=this._type,l=this._radius,c="circle"===u;if(e.dontStart||t.beginPath(),h&&c)t.arc(0,0,l,0,2*Math.PI,!0);else{var f=c?l:l.width,d=c?l:l.height,_=this._size,g=_.width,v=_.height;if(h&&"rectangle"===u&&0===f&&0===d)t.rect(-g/2,-v/2,g,v);else{var p=g/2,m=v/2,y=.44771525016920644,w=f*y,x=d*y,b=[-p,-m+d,-p,-m+x,-p+w,-m,-p+f,-m,p-f,-m,p-w,-m,p,-m+x,p,-m+d,p,m-d,p,m-x,p-w,m,p-f,m,-p+f,m,-p+w,m,-p,m-x,-p,m-d];n&&n.transform(b,b,32),t.moveTo(b[0],b[1]),t.bezierCurveTo(b[2],b[3],b[4],b[5],b[6],b[7]),p!==f&&t.lineTo(b[8],b[9]),t.bezierCurveTo(b[10],b[11],b[12],b[13],b[14],b[15]),m!==d&&t.lineTo(b[16],b[17]),t.bezierCurveTo(b[18],b[19],b[20],b[21],b[22],b[23]),p!==f&&t.lineTo(b[24],b[25]),t.bezierCurveTo(b[26],b[27],b[28],b[29],b[30],b[31])}}t.closePath()}o||!s&&!a||(this._setStyles(t,e,i),s&&(t.fill(r.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),a&&t.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(t,e){var i=new v(this._size).setCenter(0,0),n=this._style,r=e.stroke&&n.hasStroke()&&n.getStrokeWidth();return t&&(i=t._transformBounds(i)),r?i.expand(N._getStrokePadding(r,this._getStrokeMatrix(t,e))):i}},new function(){function t(t,e,i){var n=t._radius;if(!n.isZero())for(var r=t._size.divide(2),s=1;s<=4;s++){var a=new f(s>1&&s<4?-1:1,s>2?-1:1),o=a.multiply(r),h=o.subtract(a.multiply(n));if(new v(i?o.add(a.multiply(i)):o,h).contains(e))return{point:h,quadrant:s}}}function e(t,e,i,n){var r=t.divide(e);return(!n||r.isInQuadrant(n))&&r.subtract(r.normalize()).multiply(e).divide(i).length<=1}return{_contains:function e(i){if("rectangle"===this._type){var n=t(this,i);return n?i.subtract(n.point).divide(this._radius).getLength()<=1:e.base.call(this,i)}return i.divide(this.size).getLength()<=.5},_hitTestSelf:function i(n,r,s,a){var o=!1,h=this._style,u=r.stroke&&h.hasStroke(),l=r.fill&&h.hasFill();if(u||l){var c=this._type,f=this._radius,d=u?h.getStrokeWidth()/2:0,_=r._tolerancePadding.add(N._getStrokePadding(d,!h.getStrokeScaling()&&a));if("rectangle"===c){var g=_.multiply(2),p=t(this,n,g);if(p)o=e(n.subtract(p.point),f,_,p.quadrant);else{var m=new v(this._size).setCenter(0,0),y=m.expand(g),w=m.expand(g.negate());o=y._containsPoint(n)&&!w._containsPoint(n)}}else o=e(n,f,_)}return o?new T(u?"stroke":"fill",this):i.base.apply(this,arguments)}}},{statics:new function(){function t(t,e,i,n,s){var a=r.create(C.prototype);return a._type=t,a._size=i,a._radius=n,a._initialize(r.getNamed(s),e),a}return{Circle:function(){var e=arguments,i=f.readNamed(e,"center"),n=r.readNamed(e,"radius");return t("circle",i,new _(2*n),n,e)},Rectangle:function(){var e=arguments,i=v.readNamed(e,"rectangle"),n=_.min(_.readNamed(e,"radius"),i.getSize(!0).divide(2));return t("rectangle",i.getCenter(!0),i.getSize(!0),n,e)},Ellipse:function(){var e=arguments,i=C._readEllipse(e),n=i.radius;return t("ellipse",i.center,n.multiply(2),n,e)},_readEllipse:function(t){var e,i;if(r.hasNamed(t,"radius"))e=f.readNamed(t,"center"),i=_.readNamed(t,"radius");else{var n=v.readNamed(t,"rectangle");e=n.getCenter(!0),i=n.getSize(!0).divide(2)}return{center:e,radius:i}}}}}),P=x.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],_smoothing:"low",beans:!0,initialize:function(t,i){if(!this._initialize(t,i!==e&&f.read(arguments))){var r,s=typeof t,a="string"===s?n.getElementById(t):"object"===s?t:null;if(a&&a!==x.NO_INSERT)if(a.getContext||null!=a.naturalHeight)r=a;else if(a){var o=_.read(arguments);o.isZero()||(r=et.getCanvas(o))}r?this.setImage(r):this.setSource(t)}this._size||(this._size=new _,this._loaded=!1)},_equals:function(t){return this.getSource()===t.getSource()},copyContent:function(t){var e=t._image,i=t._canvas;if(e)this._setImage(e);else if(i){var n=et.getCanvas(t._size);n.getContext("2d").drawImage(i,0,0),this._setImage(n)}this._crossOrigin=t._crossOrigin},getSize:function(){var t=this._size;return new g(t?t.width:0,t?t.height:0,this,"setSize")},setSize:function(t,e){var i=_.read(arguments);if(i.equals(this._size))e&&this.clear();else if(i.width>0&&i.height>0){var n=!e&&this.getElement();this._setImage(et.getCanvas(i)),n&&this.getContext(!0).drawImage(n,0,0,i.width,i.height)}else this._canvas&&et.release(this._canvas),this._size=i.clone()},getWidth:function(){return this._size?this._size.width:0},setWidth:function(t){this.setSize(t,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(t){this.setSize(this.getWidth(),t)},getLoaded:function(){return this._loaded},isEmpty:function(){var t=this._size;return!t||0===t.width&&0===t.height},getResolution:function(){var t=this._matrix,e=new f(0,0).transform(t),i=new f(1,0).transform(t).subtract(e),n=new f(0,1).transform(t).subtract(e);return new _(72/i.getLength(),72/n.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(t){var e=this;function i(t){var i=e.getView(),n=t&&t.type||"load";i&&e.responds(n)&&(st=i._scope,e.emit(n,new $(t)))}this._setImage(t),this._loaded?setTimeout(i,0):t&&U.add(t,{load:function(n){e._setImage(t),i(n)},error:i})},_setImage:function(t){this._canvas&&et.release(this._canvas),t&&t.getContext?(this._image=null,this._canvas=t,this._loaded=!0):(this._image=t,this._canvas=null,this._loaded=!!(t&&t.src&&t.complete)),this._size=new _(t?t.naturalWidth||t.width:0,t?t.naturalHeight||t.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var t=et.getContext(this._size);try{this._image&&t.drawImage(this._image,0,0),this._canvas=t.canvas}catch(e){et.release(t)}}return this._canvas},setCanvas:"#setImage",getContext:function(t){return this._context||(this._context=this.getCanvas().getContext("2d")),t&&(this._image=null,this._changed(1025)),this._context},setContext:function(t){this._context=t},getSource:function(){var t=this._image;return t&&t.src||this.toDataURL()},setSource:function(e){var i=new t.Image,n=this._crossOrigin;n&&(i.crossOrigin=n),e&&(i.src=e),this.setImage(i)},getCrossOrigin:function(){var t=this._image;return t&&t.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(t){this._crossOrigin=t;var e=this._image;e&&(e.crossOrigin=t)},getSmoothing:function(){return this._smoothing},setSmoothing:function(t){this._smoothing="string"==typeof t?t:t?"low":"off",this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var t=v.read(arguments),e=et.getContext(t.getSize());return e.drawImage(this.getCanvas(),t.x,t.y,t.width,t.height,0,0,t.width,t.height),e.canvas},getSubRaster:function(){var t=v.read(arguments),e=new P(x.NO_INSERT);return e._setImage(this.getSubCanvas(t)),e.translate(t.getCenter().subtract(this.getSize().divide(2))),e._matrix.prepend(this._matrix),e.insertAbove(this),e},toDataURL:function(){var t=this._image,e=t&&t.src;if(/^data:/.test(e))return e;var i=this.getCanvas();return i?i.toDataURL.apply(i,arguments):null},drawImage:function(t){var e=f.read(arguments,1);this.getContext(!0).drawImage(t,e.x,e.y)},getAverageColor:function(t){var e,i;if(t?t instanceof L?(i=t,e=t.getBounds()):"object"==typeof t&&("width"in t?e=new v(t):"x"in t&&(e=new v(t.x-.5,t.y-.5,1,1))):e=this.getBounds(),!e)return null;var n=Math.min(e.width,32),s=Math.min(e.height,32),a=P._sampleContext;a?a.clearRect(0,0,33,33):a=P._sampleContext=et.getContext(new _(32)),a.save();var o=(new m).scale(n/e.width,s/e.height).translate(-e.x,-e.y);o.applyToContext(a),i&&i.draw(a,new r({clip:!0,matrices:[o]})),this._matrix.applyToContext(a);var h=this.getElement(),u=this._size;h&&a.drawImage(h,-u.width/2,-u.height/2),a.restore();for(var l=a.getImageData(.5,.5,Math.ceil(n),Math.ceil(s)).data,c=[0,0,0],f=0,d=0,g=l.length;d<g;d+=4){var p=l[d+3];f+=p,p/=255,c[0]+=l[d]*p,c[1]+=l[d+1]*p,c[2]+=l[d+2]*p}for(d=0;d<3;d++)c[d]/=f;return f?R.read(c):null},getPixel:function(){var t=f.read(arguments),e=this.getContext().getImageData(t.x,t.y,1,1).data;return new R("rgb",[e[0]/255,e[1]/255,e[2]/255],e[3]/255)},setPixel:function(){var t=arguments,e=f.read(t),i=R.read(t),n=i._convert("rgb"),r=i._alpha,s=this.getContext(!0),a=s.createImageData(1,1),o=a.data;o[0]=255*n[0],o[1]=255*n[1],o[2]=255*n[2],o[3]=null!=r?255*r:255,s.putImageData(a,e.x,e.y)},clear:function(){var t=this._size;this.getContext(!0).clearRect(0,0,t.width+1,t.height+1)},createImageData:function(){var t=_.read(arguments);return this.getContext().createImageData(t.width,t.height)},getImageData:function(){var t=v.read(arguments);return t.isEmpty()&&(t=new v(this._size)),this.getContext().getImageData(t.x,t.y,t.width,t.height)},putImageData:function(t){var e=f.read(arguments,1);this.getContext(!0).putImageData(t,e.x,e.y)},setImageData:function(t){this.setSize(t),this.getContext(!0).putImageData(t,0,0)},_getBounds:function(t,e){var i=new v(this._size).setCenter(0,0);return t?t._transformBounds(i):i},_hitTestSelf:function(t){if(this._contains(t)){var e=this;return new T("pixel",e,{offset:t.add(e._size.divide(2)).round(),color:{get:function(){return e.getPixel(this.offset)}}})}},_draw:function(t,e,i){var n=this.getElement();if(n&&n.width>0&&n.height>0){t.globalAlpha=l.clamp(this._opacity,0,1),this._setStyles(t,e,i);var r=this._smoothing,s="off"===r;Z.setPrefixed(t,s?"imageSmoothingEnabled":"imageSmoothingQuality",!s&&r),t.drawImage(n,-this._size.width/2,-this._size.height/2)}},_canComposite:function(){return!0}}),I=x.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(t,i){this._initialize(t,i!==e&&f.read(arguments,1))||this.setDefinition(t instanceof M?t:new M(t))},_equals:function(t){return this._definition===t._definition},copyContent:function(t){this.setDefinition(t._definition)},getDefinition:function(){return this._definition},setDefinition:function(t){this._definition=t,this._changed(9)},getSymbol:"#getDefinition",setSymbol:"#setDefinition",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(t,e){var i=this._definition._item;return i._getCachedBounds(i._matrix.prepended(t),e)},_hitTestSelf:function(t,e,i){var n=e.extend({all:!1}),r=this._definition._item._hitTest(t,n,i);return r&&(r.item=this),r},_draw:function(t,e){this._definition._item.draw(t,e)}}),M=r.extend({_class:"SymbolDefinition",initialize:function(t,e){this._id=c.get(),this.project=st.project,t&&this.setItem(t,e)},_serialize:function(t,e){return e.add(this,(function(){return r.serialize([this._class,this._item],t,!1,e)}))},_changed:function(t){8&t&&x._clearBoundsCache(this),1&t&&this.project._changed(t)},getItem:function(){return this._item},setItem:function(t,e){t._symbol&&(t=t.clone()),this._item&&(this._item._symbol=null),this._item=t,t.remove(),t.setSelected(!1),e||t.setPosition(new f),t._symbol=this,this._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(t){return new I(this,t)},clone:function(){return new M(this._item.clone(!1))},equals:function(t){return t===this||t&&this._item.equals(t._item)||!1}}),T=r.extend({_class:"HitResult",initialize:function(t,e,i){this.type=t,this.item=e,i&&this.inject(i)},statics:{getOptions:function(t){var e=t&&r.read(t);return new r({type:null,tolerance:st.settings.hitTolerance,fill:!e,stroke:!e,segments:!e,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},e)}}}),O=r.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(t,i,n,r,s,a){var o,h,u,l,c=arguments.length;c>0&&(null==t||"object"==typeof t?1===c&&t&&"point"in t?(o=t.point,h=t.handleIn,u=t.handleOut,l=t.selection):(o=t,h=i,u=n,l=r):(o=[t,i],h=n!==e?[n,r]:null,u=s!==e?[s,a]:null)),new z(o,this,"_point"),new z(h,this,"_handleIn"),new z(u,this,"_handleOut"),l&&this.setSelection(l)},_serialize:function(t,e){var i=this._point,n=this._selection,s=n||this.hasHandles()?[i,this._handleIn,this._handleOut]:i;return n&&s.push(n),r.serialize(s,t,!0,e)},_changed:function(t){var e=this._path;if(e){var i,n=e._curves,r=this._index;n&&(t&&t!==this._point&&t!==this._handleIn||!(i=r>0?n[r-1]:e._closed?n[n.length-1]:null)||i._changed(),t&&t!==this._point&&t!==this._handleOut||!(i=n[r])||i._changed()),e._changed(41)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(f.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(f.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(f.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var t=this._handleIn,e=this._handleOut;return!t.isZero()&&!e.isZero()&&t.isCollinear(e)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(t){var e=this._selection,i=this._path;this._selection=t=t||0,i&&t!==e&&(i._updateSelection(this,e,t),i._changed(257))},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){return!!(7&this._selection)},setSelected:function(t){this._changeSelection(7,t)},getIndex:function(){return this._index!==e?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var t=this._path,e=this._index;return t?(e>0&&!t._closed&&e===t._segments.length-1&&e--,t.getCurves()[e]||null):null},getLocation:function(){var t=this.getCurve();return t?new A(t,this===t._segment1?0:1):null},getNext:function(){var t=this._path&&this._path._segments;return t&&(t[this._index+1]||this._path._closed&&t[0])||null},smooth:function(t,i,n){var r=t||{},s=r.type,a=r.factor,o=this.getPrevious(),h=this.getNext(),u=(o||this)._point,l=this._point,c=(h||this)._point,d=u.getDistance(l),_=l.getDistance(c);if(s&&"catmull-rom"!==s){if("geometric"!==s)throw new Error("Smoothing method '"+s+"' not supported.");if(o&&h){var g=u.subtract(c),v=a===e?.4:a,p=v*d/(d+_);i||this.setHandleIn(g.multiply(p)),n||this.setHandleOut(g.multiply(p-v))}}else{var m=a===e?.5:a,y=Math.pow(d,m),w=y*y,x=Math.pow(_,m),b=x*x;if(!i&&o){var S=2*b+3*x*y+w,C=3*x*(x+y);this.setHandleIn(0!==C?new f((b*u._x+S*l._x-w*c._x)/C-l._x,(b*u._y+S*l._y-w*c._y)/C-l._y):new f)}if(!n&&h){S=2*w+3*y*x+b,C=3*y*(y+x);this.setHandleOut(0!==C?new f((w*c._x+S*l._x-b*u._x)/C-l._x,(w*c._y+S*l._y-b*u._y)/C-l._y):new f)}}},getPrevious:function(){var t=this._path&&this._path._segments;return t&&(t[this._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var t=this._path;return t&&this._index===t._segments.length-1||!1},reverse:function(){var t=this._handleIn,e=this._handleOut,i=t.clone();t.set(e),e.set(i)},reversed:function(){return new O(this._point,this._handleOut,this._handleIn)},remove:function(){return!!this._path&&!!this._path.removeSegment(this._index)},clone:function(){return new O(this._point,this._handleIn,this._handleOut)},equals:function(t){return t===this||t&&this._class===t._class&&this._point.equals(t._point)&&this._handleIn.equals(t._handleIn)&&this._handleOut.equals(t._handleOut)||!1},toString:function(){var t=["point: "+this._point];return this._handleIn.isZero()||t.push("handleIn: "+this._handleIn),this._handleOut.isZero()||t.push("handleOut: "+this._handleOut),"{ "+t.join(", ")+" }"},transform:function(t){this._transformCoordinates(t,new Array(6),!0),this._changed()},interpolate:function(t,e,i){var n=1-i,r=i,s=t._point,a=e._point,o=t._handleIn,h=e._handleIn,u=e._handleOut,l=t._handleOut;this._point._set(n*s._x+r*a._x,n*s._y+r*a._y,!0),this._handleIn._set(n*o._x+r*h._x,n*o._y+r*h._y,!0),this._handleOut._set(n*l._x+r*u._x,n*l._y+r*u._y,!0),this._changed()},_transformCoordinates:function(t,e,i){var n=this._point,r=i&&this._handleIn.isZero()?null:this._handleIn,s=i&&this._handleOut.isZero()?null:this._handleOut,a=n._x,o=n._y,h=2;return e[0]=a,e[1]=o,r&&(e[h++]=r._x+a,e[h++]=r._y+o),s&&(e[h++]=s._x+a,e[h++]=s._y+o),t&&(t._transformCoordinates(e,e,h/2),a=e[0],o=e[1],i?(n._x=a,n._y=o,h=2,r&&(r._x=e[h++]-a,r._y=e[h++]-o),s&&(s._x=e[h++]-a,s._y=e[h++]-o)):(r||(e[h++]=a,e[h++]=o),s||(e[h++]=a,e[h++]=o))),e}}),z=f.extend({initialize:function(t,i,n){var r,s,a;if(t)if((r=t[0])!==e)s=t[1];else{var o=t;(r=o.x)===e&&(r=(o=f.read(arguments)).x),s=o.y,a=o.selected}else r=s=0;this._x=r,this._y=s,this._owner=i,i[n]=this,a&&this.setSelected(!0)},_set:function(t,e){return this._x=t,this._y=e,this._owner._changed(this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner._changed(this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner._changed(this)},isZero:function(){var t=l.isZero;return t(this._x)&&t(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){var t=this._owner;return this===t._point?1:this===t._handleIn?2:this===t._handleOut?4:0}}),k=r.extend({_class:"Curve",beans:!0,initialize:function(t,e,i,n,r,s,a,o){var h,u,l,c,f,d,_=arguments.length;3===_?(this._path=t,h=e,u=i):_?1===_?"segment1"in t?(h=new O(t.segment1),u=new O(t.segment2)):"point1"in t?(l=t.point1,f=t.handle1,d=t.handle2,c=t.point2):Array.isArray(t)&&(l=[t[0],t[1]],c=[t[6],t[7]],f=[t[2]-t[0],t[3]-t[1]],d=[t[4]-t[6],t[5]-t[7]]):2===_?(h=new O(t),u=new O(e)):4===_?(l=t,f=e,d=i,c=n):8===_&&(l=[t,e],c=[a,o],f=[i-t,n-e],d=[r-a,s-o]):(h=new O,u=new O),this._segment1=h||new O(l,null,f),this._segment2=u||new O(c,d,null)},_serialize:function(t,e){return r.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],t,!0,e)},_changed:function(){this._length=this._bounds=e},clone:function(){return new k(this._segment1,this._segment2)},toString:function(){var t=["point1: "+this._segment1._point];return this._segment1._handleOut.isZero()||t.push("handle1: "+this._segment1._handleOut),this._segment2._handleIn.isZero()||t.push("handle2: "+this._segment2._handleIn),t.push("point2: "+this._segment2._point),"{ "+t.join(", ")+" }"},classify:function(){return k.classify(this.getValues())},remove:function(){var t=!1;if(this._path){var e=this._segment2,i=e._handleOut;(t=e.remove())&&this._segment1._handleOut.set(i)}return t},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(f.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(f.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(f.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(f.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index+1]||this._path._closed&&t[0])||null},getPrevious:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var t=this._path;return t&&this._segment1._index===t._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(t){this.getPoint1().setSelected(t),this.getHandle1().setSelected(t),this.getHandle2().setSelected(t),this.getPoint2().setSelected(t)},getValues:function(t){return k.getValues(this._segment1,this._segment2,t)},getPoints:function(){for(var t=this.getValues(),e=[],i=0;i<8;i+=2)e.push(new f(t[i],t[i+1]));return e}},{getLength:function(){return null==this._length&&(this._length=k.getLength(this.getValues(),0,1)),this._length},getArea:function(){return k.getArea(this.getValues())},getLine:function(){return new y(this._segment1._point,this._segment2._point)},getPart:function(t,e){return new k(k.getPart(this.getValues(),t,e))},getPartLength:function(t,e){return k.getLength(this.getValues(),t,e)},divideAt:function(t){return this.divideAtTime(t&&t.curve===this?t.time:this.getTimeAt(t))},divideAtTime:function(t,e){var i=null;if(t>=1e-8&&t<=1-1e-8){var n=k.subdivide(this.getValues(),t),r=n[0],s=n[1],a=e||this.hasHandles(),o=this._segment1,h=this._segment2,u=this._path;a&&(o._handleOut._set(r[2]-r[0],r[3]-r[1]),h._handleIn._set(s[4]-s[6],s[5]-s[7]));var l=r[6],c=r[7],d=new O(new f(l,c),a&&new f(r[4]-l,r[5]-c),a&&new f(s[2]-l,s[3]-c));u?(u.insert(o._index+1,d),i=this.getNext()):(this._segment2=d,this._changed(),i=new k(d,h))}return i},splitAt:function(t){var e=this._path;return e?e.splitAt(t):null},splitAtTime:function(t){return this.splitAt(this.getLocationAtTime(t))},divide:function(t,i){return this.divideAtTime(t===e?.5:i?t:this.getTimeAt(t))},split:function(t,i){return this.splitAtTime(t===e?.5:i?t:this.getTimeAt(t))},reversed:function(){return new k(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(t,e,i,n){var r=t._point,s=t._handleOut,a=e._handleIn,o=e._point,h=r.x,u=r.y,l=o.x,c=o.y,f=n?[h,u,h,u,l,c,l,c]:[h,u,h+s._x,u+s._y,l+a._x,c+a._y,l,c];return i&&i._transformCoordinates(f,f,4),f},subdivide:function(t,i){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],h=t[5],u=t[6],l=t[7];i===e&&(i=.5);var c=1-i,f=c*n+i*s,d=c*r+i*a,_=c*s+i*o,g=c*a+i*h,v=c*o+i*u,p=c*h+i*l,m=c*f+i*_,y=c*d+i*g,w=c*_+i*v,x=c*g+i*p,b=c*m+i*w,S=c*y+i*x;return[[n,r,f,d,m,y,b,S],[b,S,w,x,v,p,u,l]]},getMonoCurves:function(t,e){var i=[],n=e?0:1,r=t[n+0],s=t[n+2],a=t[n+4],o=t[n+6];if(r>=s==s>=a&&s>=a==a>=o||k.isStraight(t))i.push(t);else{var h=3*(s-a)-r+o,u=2*(r+a)-4*s,c=s-r,f=[],d=l.solveQuadratic(h,u,c,f,1e-8,1-1e-8);if(d){f.sort();var _=f[0],g=k.subdivide(t,_);i.push(g[0]),d>1&&(_=(f[1]-_)/(1-_),g=k.subdivide(g[1],_),i.push(g[0])),i.push(g[1])}else i.push(t)}return i},solveCubic:function(t,e,i,n,r,s){var a=t[e],o=t[e+2],h=t[e+4],u=t[e+6],c=0;if(!(a<i&&u<i&&o<i&&h<i||a>i&&u>i&&o>i&&h>i)){var f=3*(o-a),d=3*(h-o)-f,_=u-a-f-d;c=l.solveCubic(_,d,f,a-i,n,r,s)}return c},getTimeOf:function(t,e){var i=new f(t[0],t[1]),n=new f(t[6],t[7]);if(null===(e.isClose(i,1e-12)?0:e.isClose(n,1e-12)?1:null))for(var r=[e.x,e.y],s=[],a=0;a<2;a++)for(var o=k.solveCubic(t,a,r[a],s,0,1),h=0;h<o;h++){var u=s[h];if(e.isClose(k.getPoint(t,u),1e-7))return u}return e.isClose(i,1e-7)?0:e.isClose(n,1e-7)?1:null},getNearestTime:function(t,e){if(k.isStraight(t)){var i=t[0],n=t[1],r=t[6]-i,s=t[7]-n,a=r*r+s*s;if(0===a)return 0;var o=((e.x-i)*r+(e.y-n)*s)/a;return o<1e-12?0:o>.999999999999?1:k.getTimeOf(t,new f(i+o*r,n+o*s))}var h=1/0,u=0;function l(i){if(i>=0&&i<=1){var n=e.getDistance(k.getPoint(t,i),!0);if(n<h)return h=n,u=i,!0}}for(var c=0;c<=100;c++)l(c/100);for(var d=.005;d>1e-8;)l(u-d)||l(u+d)||(d/=2);return u},getPart:function(t,e,i){var n=e>i;if(n){var r=e;e=i,i=r}return e>0&&(t=k.subdivide(t,e)[1]),i<1&&(t=k.subdivide(t,(i-e)/(1-e))[0]),n?[t[6],t[7],t[4],t[5],t[2],t[3],t[0],t[1]]:t},isFlatEnough:function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],u=t[7],l=3*r-2*i-h,c=3*s-2*n-u,f=3*a-2*h-i,d=3*o-2*u-n;return Math.max(l*l,f*f)+Math.max(c*c,d*d)<=16*e*e},getArea:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7];return 3*((h-i)*(n+s)-(o-e)*(r+a)+r*(e-s)-n*(i-a)+h*(s+e/3)-o*(a+i/3))/20},getBounds:function(t){for(var e=t.slice(0,2),i=e.slice(),n=[0,0],r=0;r<2;r++)k._addBounds(t[r],t[r+2],t[r+4],t[r+6],r,0,e,i,n);return new v(e[0],e[1],i[0]-e[0],i[1]-e[1])},_addBounds:function(t,e,i,n,r,s,a,o,h){function u(t,e){var i=t-e,n=t+e;i<a[r]&&(a[r]=i),n>o[r]&&(o[r]=n)}s/=2;var c=a[r]+s,f=o[r]-s;if(t<c||e<c||i<c||n<c||t>f||e>f||i>f||n>f)if(e<t!=e<n&&i<t!=i<n)u(t,0),u(n,0);else{var d=3*(e-i)-t+n,_=2*(t+i)-4*e,g=e-t,v=l.solveQuadratic(d,_,g,h);u(n,0);for(var p=0;p<v;p++){var m=h[p],y=1-m;1e-8<=m&&m<=1-1e-8&&u(y*y*y*t+3*y*y*m*e+3*y*m*m*i+m*m*m*n,s)}}}}},r.each(["getBounds","getStrokeBounds","getHandleBounds"],(function(t){this[t]=function(){this._bounds||(this._bounds={});var e=this._bounds[t];return e||(e=this._bounds[t]=N[t]([this._segment1,this._segment2],!1,this._path)),e.clone()}}),{}),r.each({isStraight:function(t,e,i,n){if(e.isZero()&&i.isZero())return!0;var r=n.subtract(t);if(r.isZero())return!1;if(r.isCollinear(e)&&r.isCollinear(i)){var s=new y(t,n);if(s.getDistance(t.add(e))<1e-7&&s.getDistance(n.add(i))<1e-7){var a=r.dot(r),o=r.dot(e)/a,h=r.dot(i)/a;return o>=0&&o<=1&&h<=0&&h>=-1}}return!1},isLinear:function(t,e,i,n){var r=n.subtract(t).divide(3);return e.equals(r)&&i.negate().equals(r)}},(function(t,e){this[e]=function(e){var i=this._segment1,n=this._segment2;return t(i._point,i._handleOut,n._handleIn,n._point,e)},this.statics[e]=function(e,i){var n=e[0],r=e[1],s=e[6],a=e[7];return t(new f(n,r),new f(e[2]-n,e[3]-r),new f(e[4]-s,e[5]-a),new f(s,a),i)}}),{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(t){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(t||0)},isCollinear:function(t){return t&&this.isStraight()&&t.isStraight()&&this.getLine().isCollinear(t.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(t,e){return this.getLocationAtTime(e?t:this.getTimeAt(t))},getLocationAtTime:function(t){return null!=t&&t>=0&&t<=1?new A(this,t):null},getTimeAt:function(t,e){return k.getTimeAt(this.getValues(),t,e)},getParameterAt:"#getTimeAt",getTimesWithTangent:function(){var t=f.read(arguments);return t.isZero()?[]:k.getTimesWithTangent(this.getValues(),t)},getOffsetAtTime:function(t){return this.getPartLength(0,t)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(f.read(arguments)))},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getTimeOf:function(){return k.getTimeOf(this.getValues(),f.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var t=f.read(arguments),e=this.getValues(),i=k.getNearestTime(e,t),n=k.getPoint(e,i);return new A(this,i,n,null,t.getDistance(n))},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t?t.getPoint():t}},new function(){var t=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return r.each(t,(function(t){this[t+"At"]=function(e,i){var n=this.getValues();return k[t](n,i?e:k.getTimeAt(n,e))},this[t+"AtTime"]=function(e){return k[t](this.getValues(),e)}}),{statics:{_evaluateMethods:t}})},new function(){function t(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],u=9*(n-s)+3*(o-e),l=6*(e+s)-12*n,c=3*(n-e),f=9*(r-a)+3*(h-i),d=6*(i+a)-12*r,_=3*(r-i);return function(t){var e=(u*t+l)*t+c,i=(f*t+d)*t+_;return Math.sqrt(e*e+i*i)}}function i(t,e){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(e-t))))}function n(t,e,i,n){if(null==e||e<0||e>1)return null;var r=t[0],s=t[1],a=t[2],o=t[3],h=t[4],u=t[5],c=t[6],d=t[7],_=l.isZero;_(a-r)&&_(o-s)&&(a=r,o=s),_(h-c)&&_(u-d)&&(h=c,u=d);var g,v,p=3*(a-r),m=3*(h-a)-p,y=c-r-p-m,w=3*(o-s),x=3*(u-o)-w,b=d-s-w-x;if(0===i)g=0===e?r:1===e?c:((y*e+m)*e+p)*e+r,v=0===e?s:1===e?d:((b*e+x)*e+w)*e+s;else{if(e<1e-8?(g=p,v=w):e>1-1e-8?(g=3*(c-h),v=3*(d-u)):(g=(3*y*e+2*m)*e+p,v=(3*b*e+2*x)*e+w),n){0===g&&0===v&&(e<1e-8||e>1-1e-8)&&(g=h-a,v=u-o);var S=Math.sqrt(g*g+v*v);S&&(g/=S,v/=S)}if(3===i){h=6*y*e+2*m,u=6*b*e+2*x;var C=Math.pow(g*g+v*v,1.5);g=0!==C?(g*u-v*h)/C:0,v=0}}return 2===i?new f(v,-g):new f(g,v)}return{statics:{classify:function(t){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],u=t[7],c=r*(n-u)+s*(h-i)+i*u-n*h,f=3*(a*(s-n)+o*(i-r)+r*n-s*i),d=f-c,_=d-c+(i*(u-o)+n*(a-h)+h*o-u*a),g=Math.sqrt(_*_+d*d+f*f),v=0!==g?1/g:0,p=l.isZero;function m(t,i,n){var r=i!==e,s=r&&i>0&&i<1,a=r&&n>0&&n<1;return!r||(s||a)&&("loop"!==t||s&&a)||(t="arch",s=a=!1),{type:t,roots:s||a?s&&a?i<n?[i,n]:[n,i]:[s?i:n]:null}}if(d*=v,f*=v,p(_*=v))return p(d)?m(p(f)?"line":"quadratic"):m("serpentine",f/(3*d));var y=3*d*d-4*_*f;if(p(y))return m("cusp",d/(2*_));var w=y>0?Math.sqrt(y/3):Math.sqrt(-y),x=2*_;return m(y>0?"serpentine":"loop",(d+w)/x,(d-w)/x)},getLength:function(n,r,s,a){if(r===e&&(r=0),s===e&&(s=1),k.isStraight(n)){var o=n;s<1&&(o=k.subdivide(o,s)[0],r/=s),r>0&&(o=k.subdivide(o,r)[1]);var h=o[6]-o[0],u=o[7]-o[1];return Math.sqrt(h*h+u*u)}return l.integrate(a||t(n),r,s,i(r,s))},getTimeAt:function(n,r,s){if(s===e&&(s=r<0?1:0),0===r)return s;var a=Math.abs,o=r>0,h=o?s:0,u=o?1:s,c=t(n),f=k.getLength(n,h,u,c),d=a(r)-f;if(a(d)<1e-12)return o?u:h;if(d>1e-12)return null;var _=r/f,g=0;return l.findRoot((function(t){return g+=l.integrate(c,s,t,i(s,t)),s=t,g-r}),c,s+_,h,u,32,1e-12)},getPoint:function(t,e){return n(t,e,0,!1)},getTangent:function(t,e){return n(t,e,1,!0)},getWeightedTangent:function(t,e){return n(t,e,1,!1)},getNormal:function(t,e){return n(t,e,2,!0)},getWeightedNormal:function(t,e){return n(t,e,2,!1)},getCurvature:function(t,e){return n(t,e,3,!1).x},getPeaks:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=3*n-e-3*s+t[6],h=3*e-6*n+3*s,u=-3*e+3*n,c=3*r-i-3*a+t[7],f=3*i-6*r+3*a,d=-3*i+3*r,_=[];return l.solveCubic(9*(o*o+c*c),9*(o*h+f*c),2*(h*h+f*f)+3*(u*o+d*c),u*h+f*d,_,1e-8,1-1e-8),_.sort()}}}},new function(){function t(t,e,i,n,r,s,a){var o=!a&&i.getPrevious()===r,h=!a&&i!==r&&i.getNext()===r;if(null!==n&&n>=(o?1e-8:0)&&n<=(h?1-1e-8:1)&&null!==s&&s>=(h?1e-8:0)&&s<=(o?1-1e-8:1)){var u=new A(i,n,null,a),l=new A(r,s,null,a);u._intersection=l,l._intersection=u,e&&!e(u)||A.insert(t,u,!0)}}function e(n,r,s,a,o,h,u,l,c,f,d,_,g){if(++c>=4096||++l>=40)return c;var v,p,m=r[0],w=r[1],x=r[6],b=r[7],S=y.getSignedDistance,C=S(m,w,x,b,r[2],r[3]),P=S(m,w,x,b,r[4],r[5]),I=C*P>0?3/4:4/9,M=I*Math.min(0,C,P),T=I*Math.max(0,C,P),O=S(m,w,x,b,n[0],n[1]),z=S(m,w,x,b,n[2],n[3]),A=S(m,w,x,b,n[4],n[5]),L=S(m,w,x,b,n[6],n[7]),N=function(t,e,i,n){var r,s=[0,t],a=[1/3,e],o=[2/3,i],h=[1,n],u=e-(2*t+n)/3,l=i-(t+2*n)/3;if(u*l<0)r=[[s,a,h],[s,o,h]];else{var c=u/l;r=[c>=2?[s,a,h]:c<=.5?[s,o,h]:[s,a,o,h],[s,h]]}return(u||l)<0?r.reverse():r}(O,z,A,L),B=N[0],E=N[1];if(0===C&&0===P&&0===O&&0===z&&0===A&&0===L||null==(v=i(B,E,M,T))||null==(p=i(B.reverse(),E.reverse(),M,T)))return c;var F=f+(d-f)*v,j=f+(d-f)*p;if(Math.max(g-_,j-F)<1e-9){var D=(F+j)/2,R=(_+g)/2;t(o,h,u?a:s,u?R:D,u?s:a,u?D:R)}else{n=k.getPart(n,v,p);var q=g-_;if(p-v>.8)if(j-F>q){D=(F+j)/2;c=e(r,(V=k.subdivide(n,.5))[0],a,s,o,h,!u,l,c,_,g,F,D),c=e(r,V[1],a,s,o,h,!u,l,c,_,g,D,j)}else{var V;R=(_+g)/2;c=e((V=k.subdivide(r,.5))[0],n,a,s,o,h,!u,l,c,_,R,F,j),c=e(V[1],n,a,s,o,h,!u,l,c,R,g,F,j)}else c=0===q||q>=1e-9?e(r,n,a,s,o,h,!u,l,c,_,g,F,j):e(n,r,s,a,o,h,u,l,c,F,j,_,g)}return c}function i(t,e,i,r){return t[0][1]<i?n(t,!0,i):e[0][1]>r?n(e,!1,r):t[0][0]}function n(t,e,i){for(var n=t[0][0],r=t[0][1],s=1,a=t.length;s<a;s++){var o=t[s][0],h=t[s][1];if(e?h>=i:h<=i)return h===i?o:n+(i-r)*(o-n)/(h-r);n=o,r=h}return null}function r(t,e,i,n,r){var s=l.isZero;if(s(n)&&s(r)){var a=k.getTimeOf(t,new f(e,i));return null===a?[]:[a]}for(var o=Math.atan2(-r,n),h=Math.sin(o),u=Math.cos(o),c=[],d=[],_=0;_<8;_+=2){var g=t[_]-e,v=t[_+1]-i;c.push(g*u-v*h,g*h+v*u)}return k.solveCubic(c,1,0,d,0,1),d}function s(e,i,n,s,a,o,h){for(var u=i[0],l=i[1],c=r(e,u,l,i[6]-u,i[7]-l),f=0,d=c.length;f<d;f++){var _=c[f],g=k.getPoint(e,_),v=k.getTimeOf(i,g);null!==v&&t(a,o,h?s:n,h?v:_,h?n:s,h?_:v)}}function a(e,i,n,r,s,a){var o=y.intersect(e[0],e[1],e[6],e[7],i[0],i[1],i[6],i[7]);o&&t(s,a,n,k.getTimeOf(e,o),r,k.getTimeOf(i,o))}function o(i,n,r,o,h,u){var l=Math.min,d=Math.max;if(d(i[0],i[2],i[4],i[6])+1e-12>l(n[0],n[2],n[4],n[6])&&l(i[0],i[2],i[4],i[6])-1e-12<d(n[0],n[2],n[4],n[6])&&d(i[1],i[3],i[5],i[7])+1e-12>l(n[1],n[3],n[5],n[7])&&l(i[1],i[3],i[5],i[7])-1e-12<d(n[1],n[3],n[5],n[7])){var _=c(i,n);if(_)for(var g=0;g<2;g++){var v=_[g];t(h,u,r,v[0],o,v[1],!0)}else{var p=k.isStraight(i),m=k.isStraight(n),y=p&&m,w=p&&!m,x=h.length;if((y?a:p||m?s:e)(w?n:i,w?i:n,w?o:r,w?r:o,h,u,w,0,0,0,1,0,1),!y||h.length===x)for(g=0;g<4;g++){var b=g>>1,S=1&g,C=6*b,P=6*S,I=new f(i[C],i[C+1]),M=new f(n[P],n[P+1]);I.isClose(M,1e-12)&&t(h,u,r,b,o,S)}}}return h}function u(e,i,n,r){var s=k.classify(e);if("loop"===s.type){var a=s.roots;t(n,r,i,a[0],i,a[1])}return n}function c(t,e){function i(t){var e=t[6]-t[0],i=t[7]-t[1];return e*e+i*i}var n=Math.abs,r=y.getDistance,s=k.isStraight(t),a=k.isStraight(e),o=s&&a,h=i(t)<i(e),u=h?e:t,l=h?t:e,c=u[0],d=u[1],_=u[6]-c,g=u[7]-d;if(r(c,d,_,g,l[0],l[1],!0)<1e-7&&r(c,d,_,g,l[6],l[7],!0)<1e-7)!o&&r(c,d,_,g,u[2],u[3],!0)<1e-7&&r(c,d,_,g,u[4],u[5],!0)<1e-7&&r(c,d,_,g,l[2],l[3],!0)<1e-7&&r(c,d,_,g,l[4],l[5],!0)<1e-7&&(s=a=o=!0);else if(o)return null;if(s^a)return null;for(var v=[t,e],p=[],m=0;m<4&&p.length<2;m++){var w=1&m,x=1^w,b=m>>1,S=k.getTimeOf(v[w],new f(v[x][b?6:0],v[x][b?7:1]));if(null!=S){var C=w?[b,S]:[S,b];(!p.length||n(C[0]-p[0][0])>1e-8&&n(C[1]-p[0][1])>1e-8)&&p.push(C)}if(m>2&&!p.length)break}if(2!==p.length)p=null;else if(!o){var P=k.getPart(t,p[0][0],p[1][0]),I=k.getPart(e,p[0][1],p[1][1]);(n(I[2]-P[2])>1e-7||n(I[3]-P[3])>1e-7||n(I[4]-P[4])>1e-7||n(I[5]-P[5])>1e-7)&&(p=null)}return p}return{getIntersections:function(t){var e=this.getValues(),i=t&&t!==this&&t.getValues();return i?o(e,i,this,t,[]):u(e,this,[])},statics:{getOverlaps:c,getIntersections:function(t,e,i,n,r,s){var a=!e;a&&(e=t);for(var l=t.length,c=e.length,f=new Array(l),d=a?f:new Array(c),_=[],g=0;g<l;g++)f[g]=t[g].getValues(n);if(!a)for(g=0;g<c;g++)d[g]=e[g].getValues(r);for(var v=h.findCurveBoundsCollisions(f,d,1e-7),p=0;p<l;p++){var m=t[p],y=f[p];a&&u(y,m,_,i);var w=v[p];if(w)for(var x=0;x<w.length;x++){if(s&&_.length)return _;var b=w[x];if(!a||b>p){var S=e[b];o(y,d[b],m,S,_,i)}}}return _},getCurveLineIntersections:r,getTimesWithTangent:function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],u=t[7],c=e.normalize(),f=c.x,d=c.y,_=3*h-9*a+9*r-3*i,g=3*u-9*o+9*s-3*n,v=6*a-12*r+6*i,p=6*o-12*s+6*n,m=3*r-3*i,y=3*s-3*n,w=2*_*d-2*g*f,x=[];if(Math.abs(w)<l.CURVETIME_EPSILON){if(0!=(w=_*p-g*v)){var b=-(_*y-g*m)/w;b>=0&&b<=1&&x.push(b)}}else{var S=(v*v-4*_*m)*d*d+(-2*v*p+4*g*m+4*_*y)*f*d+(p*p-4*g*y)*f*f,C=v*d-p*f;if(S>=0&&0!=w){var P=Math.sqrt(S),I=-(C+P)/w,M=(-C+P)/w;I>=0&&I<=1&&x.push(I),M>=0&&M<=1&&x.push(M)}}return x}}}}),A=r.extend({_class:"CurveLocation",initialize:function(t,e,i,n,r){if(e>=.99999999){var s=t.getNext();s&&(e=0,t=s)}this._setCurve(t),this._time=e,this._point=i||t.getPointAtTime(e),this._overlap=n,this._distance=r,this._intersection=this._next=this._previous=null},_setPath:function(t){this._path=t,this._version=t?t._version:0},_setCurve:function(t){this._setPath(t._path),this._curve=t,this._segment=null,this._segment1=t._segment1,this._segment2=t._segment2},_setSegment:function(t){var e=t.getCurve();e?this._setCurve(e):(this._setPath(t._path),this._segment1=t,this._segment2=null),this._segment=t,this._time=t===this._segment1?0:1,this._point=t._point.clone()},getSegment:function(){var t=this._segment;if(!t){var e=this.getCurve(),i=this.getTime();0===i?t=e._segment1:1===i?t=e._segment2:null!=i&&(t=e.getPartLength(0,i)<e.getPartLength(i,1)?e._segment1:e._segment2),this._segment=t}return t},getCurve:function(){var t=this._path,e=this;function i(t){var i=t&&t.getCurve();if(i&&null!=(e._time=i.getTimeOf(e._point)))return e._setCurve(i),i}return t&&t._version!==this._version&&(this._time=this._offset=this._curveOffset=this._curve=null),this._curve||i(this._segment)||i(this._segment1)||i(this._segment2.getPrevious())},getPath:function(){var t=this.getCurve();return t&&t._path},getIndex:function(){var t=this.getCurve();return t&&t.getIndex()},getTime:function(){var t=this.getCurve(),e=this._time;return t&&null==e?this._time=t.getTimeOf(this._point):e},getParameter:"#getTime",getPoint:function(){return this._point},getOffset:function(){var t=this._offset;if(null==t){t=0;var e=this.getPath(),i=this.getIndex();if(e&&null!=i)for(var n=e.getCurves(),r=0;r<i;r++)t+=n[r].getLength();this._offset=t+=this.getCurveOffset()}return t},getCurveOffset:function(){var t=this._curveOffset;if(null==t){var e=this.getCurve(),i=this.getTime();this._curveOffset=t=null!=i&&e&&e.getPartLength(0,i)}return t},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var t=this.getCurve(),e=t&&t.divideAtTime(this.getTime());return e&&this._setSegment(e._segment1),e},split:function(){var t=this.getCurve(),e=t._path,i=t&&t.splitAtTime(this.getTime());return i&&this._setSegment(e.getLastSegment()),i},equals:function(t,e){var i=this===t;if(!i&&t instanceof A){var n=this.getCurve(),r=t.getCurve(),s=n._path;if(s===r._path){var a=Math.abs,o=a(this.getOffset()-t.getOffset()),h=!e&&this._intersection,u=!e&&t._intersection;i=(o<1e-7||s&&a(s.getLength()-o)<1e-7)&&(!h&&!u||h&&u&&h.equals(u,!0))}}return i},toString:function(){var t=[],e=this.getPoint(),i=u.instance;e&&t.push("point: "+e);var n=this.getIndex();null!=n&&t.push("index: "+n);var r=this.getTime();return null!=r&&t.push("time: "+i.number(r)),null!=this._distance&&t.push("distance: "+i.number(this._distance)),"{ "+t.join(", ")+" }"},isTouching:function(){var t=this._intersection;if(t&&this.getTangent().isCollinear(t.getTangent())){var e=this.getCurve(),i=t.getCurve();return!(e.isStraight()&&i.isStraight()&&e.getLine().intersect(i.getLine()))}return!1},isCrossing:function(){var t=this._intersection;if(!t)return!1;var e=this.getTime(),i=t.getTime(),n=e>=1e-8&&e<=1-1e-8,r=i>=1e-8&&i<=1-1e-8;if(n&&r)return!this.isTouching();var s=this.getCurve(),a=s&&e<1e-8?s.getPrevious():s,o=t.getCurve(),h=o&&i<1e-8?o.getPrevious():o;if(e>1-1e-8&&(s=s.getNext()),i>1-1e-8&&(o=o.getNext()),!(a&&s&&h&&o))return!1;var u=[];function l(t,e){var i=t.getValues(),n=k.classify(i).roots||k.getPeaks(i),r=n.length,s=k.getLength(i,e&&r?n[r-1]:0,!e&&r?n[0]:1);u.push(r?s:s/32)}function c(t,e,i){return e<i?t>e&&t<i:t>e||t<i}n||(l(a,!0),l(s,!1)),r||(l(h,!0),l(o,!1));var f=this.getPoint(),d=Math.min.apply(Math,u),_=n?s.getTangentAtTime(e):s.getPointAt(d).subtract(f),g=n?_.negate():a.getPointAt(-d).subtract(f),v=r?o.getTangentAtTime(i):o.getPointAt(d).subtract(f),p=r?v.negate():h.getPointAt(-d).subtract(f),m=g.getAngle(),y=_.getAngle(),w=p.getAngle(),x=v.getAngle();return!!(n?c(m,w,x)^c(y,w,x)&&c(m,x,w)^c(y,x,w):c(w,m,y)^c(x,m,y)&&c(w,y,m)^c(x,y,m))},hasOverlap:function(){return!!this._overlap}},r.each(k._evaluateMethods,(function(t){var e=t+"At";this[t]=function(){var t=this.getCurve(),i=this.getTime();return null!=i&&t&&t[e](i,!0)}}),{preserve:!0}),new function(){function t(t,e,i){var n=t.length,r=0,s=n-1;function a(i,r){for(var s=i+r;s>=-1&&s<=n;s+=r){var a=t[(s%n+n)%n];if(!e.getPoint().isClose(a.getPoint(),1e-7))break;if(e.equals(a))return a}return null}for(;r<=s;){var o,h=r+s>>>1,u=t[h];if(i&&(o=e.equals(u)?u:a(h,-1)||a(h,1)))return e._overlap&&(o._overlap=o._intersection._overlap=!0),o;var l=e.getPath(),c=u.getPath();(l!==c?l._id-c._id:e.getIndex()+e.getTime()-(u.getIndex()+u.getTime()))<0?s=h-1:r=h+1}return t.splice(r,0,e),e}return{statics:{insert:t,expand:function(e){for(var i=e.slice(),n=e.length-1;n>=0;n--)t(i,e[n]._intersection,!1);return i}}}}),L=x.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var e,i,n;if(r.isPlainObject(t)?(i=t.segments,e=t.pathData):Array.isArray(t)?i=t:"string"==typeof t&&(e=t),i){var s=i[0];n=s&&Array.isArray(s[0])}else e&&(n=(e.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(e));return new(n?B:N)(t)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){var e,i,n,r=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),s=!1,a=new f,o=new f;function h(t,i){var n=+e[t];return s&&(n+=a[i]),n}function u(t){return new f(h(t,"x"),h(t+1,"y"))}this.clear();for(var l=0,c=r&&r.length;l<c;l++){var d=r[l],g=d[0],v=g.toLowerCase(),p=(e=d.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g))&&e.length;switch(s=g===v,"z"!==i||/[mz]/.test(v)||this.moveTo(a),v){case"m":case"l":for(var m="m"===v,y=0;y<p;y+=2)this[m?"moveTo":"lineTo"](a=u(y)),m&&(o=a,m=!1);n=a;break;case"h":case"v":var w="h"===v?"x":"y";a=a.clone();for(y=0;y<p;y++)a[w]=h(y,w),this.lineTo(a);n=a;break;case"c":for(y=0;y<p;y+=6)this.cubicCurveTo(u(y),n=u(y+2),a=u(y+4));break;case"s":for(y=0;y<p;y+=4)this.cubicCurveTo(/[cs]/.test(i)?a.multiply(2).subtract(n):a,n=u(y),a=u(y+2)),i=v;break;case"q":for(y=0;y<p;y+=4)this.quadraticCurveTo(n=u(y),a=u(y+2));break;case"t":for(y=0;y<p;y+=2)this.quadraticCurveTo(n=/[qt]/.test(i)?a.multiply(2).subtract(n):a,a=u(y)),i=v;break;case"a":for(y=0;y<p;y+=7)this.arcTo(a=u(y+5),new _(+e[y],+e[y+1]),+e[y+2],+e[y+4],+e[y+3]);break;case"z":this.closePath(1e-12),a=o}i=v}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(t){var e=t.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(t):{};return e.onPath||!!("evenodd"===this.getFillRule()?1&e.windingL||1&e.windingR:e.winding)},getIntersections:function(t,e,i,n){var r=this===t||!t,s=this._matrix._orNullIfIdentity(),a=r?s:(i||t._matrix)._orNullIfIdentity();return r||this.getBounds(s).intersects(t.getBounds(a),1e-12)?k.getIntersections(this.getCurves(),!r&&t.getCurves(),e,s,a,n):[]},getCrossings:function(t){return this.getIntersections(t,(function(t){return t.isCrossing()}))},getNearestLocation:function(){for(var t=f.read(arguments),e=this.getCurves(),i=1/0,n=null,r=0,s=e.length;r<s;r++){var a=e[r].getNearestLocation(t);a._distance<i&&(i=a._distance,n=a)}return n},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t?t.getPoint():t},interpolate:function(t,e,i){var n=!this._children,r=n?"_segments":"_children",s=t[r],a=e[r],o=this[r];if(!s||!a||s.length!==a.length)throw new Error("Invalid operands in interpolate() call: "+t+", "+e);var h=o.length,u=a.length;if(h<u)for(var l=n?O:N,c=h;c<u;c++)this.add(new l);else h>u&&this[n?"removeSegments":"removeChildren"](u,h);for(c=0;c<u;c++)o[c].interpolate(s[c],a[c],i);n&&(this.setClosed(t._closed),this._changed(9))},compare:function(t){var e=!1;if(t){var i=this._children||[this],n=t._children?t._children.slice():[t],r=i.length,s=n.length,a=[],o=0;e=!0;for(var u=h.findItemBoundsCollisions(i,n,l.GEOMETRIC_EPSILON),c=r-1;c>=0&&e;c--){var f=i[c];e=!1;var d=u[c];if(d)for(var _=d.length-1;_>=0&&!e;_--)f.compare(n[d[_]])&&(a[d[_]]||(a[d[_]]=!0,o++),e=!0)}e=e&&o===s}return e}}),N=L.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(t){this._closed=!1,this._segments=[],this._version=0;var i=arguments,n=Array.isArray(t)?"object"==typeof t[0]?t:i:!t||t.size!==e||t.x===e&&t.point===e?null:i;n&&n.length>0?this.setSegments(n):(this._curves=e,this._segmentSelection=0,n||"string"!=typeof t||(this.setPathData(t),t=null)),this._initialize(!n&&t)},_equals:function(t){return this._closed===t._closed&&r.equals(this._segments,t._segments)},copyContent:function(t){this.setSegments(t._segments),this._closed=t._closed},_changed:function t(i){if(t.base.call(this,i),8&i){if(this._length=this._area=e,32&i)this._version++;else if(this._curves)for(var n=0,r=this._curves.length;n<r;n++)this._curves[n]._changed()}else 64&i&&(this._bounds=e)},getStyle:function(){var t=this._parent;return(t instanceof B?t:this)._style},getSegments:function(){return this._segments},setSegments:function(t){var i=this.isFullySelected(),n=t&&t.length;if(this._segments.length=0,this._segmentSelection=0,this._curves=e,n){var r=t[n-1];"boolean"==typeof r&&(this.setClosed(r),n--),this._add(O.readList(t,0,{},n))}i&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var t=this._curves,e=this._segments;if(!t){var i=this._countCurves();t=this._curves=new Array(i);for(var n=0;n<i;n++)t[n]=new k(this,e[n],e[n+1]||e[0])}return t},getFirstCurve:function(){return this.getCurves()[0]},getLastCurve:function(){var t=this.getCurves();return t[t.length-1]},isClosed:function(){return this._closed},setClosed:function(t){if(this._closed!=(t=!!t)){if(this._closed=t,this._curves){var e=this._curves.length=this._countCurves();t&&(this._curves[e-1]=new k(this,this._segments[e-1],this._segments[0]))}this._changed(41)}}},{beans:!0,getPathData:function(t,e){var i,n,r,s,a,o,h,l,c=this._segments,f=c.length,d=new u(e),_=new Array(6),g=!0,v=[];function p(e,u){if(e._transformCoordinates(t,_),i=_[0],n=_[1],g)v.push("M"+d.pair(i,n)),g=!1;else if(a=_[2],o=_[3],a===i&&o===n&&h===r&&l===s){if(!u){var c=i-r,f=n-s;v.push(0===c?"v"+d.number(f):0===f?"h"+d.number(c):"l"+d.pair(c,f))}}else v.push("c"+d.pair(h-r,l-s)+" "+d.pair(a-r,o-s)+" "+d.pair(i-r,n-s));r=i,s=n,h=_[4],l=_[5]}if(!f)return"";for(var m=0;m<f;m++)p(c[m]);return this._closed&&f>0&&(p(c[0],!0),v.push("z")),v.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(t){for(var e=this._segments,i=new Array(6),n=0,r=e.length;n<r;n++)e[n]._transformCoordinates(t,i,!0);return!0},_add:function(t,e){for(var i=this._segments,n=this._curves,s=t.length,a=null==e,o=(e=a?i.length:e,0);o<s;o++){var h=t[o];h._path&&(h=t[o]=h.clone()),h._path=this,h._index=e+o,h._selection&&this._updateSelection(h,0,h._selection)}if(a)r.push(i,t);else{i.splice.apply(i,[e,0].concat(t));o=e+s;for(var u=i.length;o<u;o++)i[o]._index=o}if(n){var l=this._countCurves(),c=e>0&&e+s-1===l?e-1:e,f=c,d=Math.min(c+s,l);t._curves&&(n.splice.apply(n,[c,0].concat(t._curves)),f+=t._curves.length);for(o=f;o<d;o++)n.splice(o,0,new k(this,null,null));this._adjustCurves(c,d)}return this._changed(41),t},_adjustCurves:function(t,e){for(var i,n=this._segments,r=this._curves,s=t;s<e;s++)(i=r[s])._path=this,i._segment1=n[s],i._segment2=n[s+1]||n[0],i._changed();(i=r[this._closed&&!t?n.length-1:t-1])&&(i._segment2=n[t]||n[0],i._changed()),(i=r[e])&&(i._segment1=n[e],i._changed())},_countCurves:function(){var t=this._segments.length;return!this._closed&&t>0?t-1:t},add:function(t){var e=arguments;return e.length>1&&"number"!=typeof t?this._add(O.readList(e)):this._add([O.read(e)])[0]},insert:function(t,e){var i=arguments;return i.length>2&&"number"!=typeof e?this._add(O.readList(i,1),t):this._add([O.read(i,1)],t)[0]},addSegment:function(){return this._add([O.read(arguments)])[0]},insertSegment:function(t){return this._add([O.read(arguments,1)],t)[0]},addSegments:function(t){return this._add(O.readList(t))},insertSegments:function(t,e){return this._add(O.readList(e),t)},removeSegment:function(t){return this.removeSegments(t,t+1)[0]||null},removeSegments:function(t,e,i){t=t||0,e=r.pick(e,this._segments.length);var n=this._segments,s=this._curves,a=n.length,o=n.splice(t,e-t),h=o.length;if(!h)return o;for(var u=0;u<h;u++){var l=o[u];l._selection&&this._updateSelection(l,l._selection,0),l._index=l._path=null}u=t;for(var c=n.length;u<c;u++)n[u]._index=u;if(s){var f=t>0&&e===a+(this._closed?1:0)?t-1:t;for(u=(s=s.splice(f,h)).length-1;u>=0;u--)s[u]._path=null;i&&(o._curves=s.slice(1)),this._adjustCurves(f,f)}return this._changed(41),o},clear:"#removeSegments",hasHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)if(t[e].hasHandles())return!0;return!1},clearHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)t[e].clearHandles()},getLength:function(){if(null==this._length){for(var t=this.getCurves(),e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();this._length=e}return this._length},getArea:function(){var t=this._area;if(null==t){var e=this._segments,i=this._closed;t=0;for(var n=0,r=e.length;n<r;n++){var s=n+1===r;t+=k.getArea(k.getValues(e[n],e[s?0:n+1],null,s&&!i))}this._area=t}return t},isFullySelected:function(){var t=this._segments.length;return this.isSelected()&&t>0&&this._segmentSelection===7*t},setFullySelected:function(t){t&&this._selectSegments(!0),this.setSelected(t)},setSelection:function t(e){1&e||this._selectSegments(!1),t.base.call(this,e)},_selectSegments:function(t){var e=this._segments,i=e.length,n=t?7:0;this._segmentSelection=n*i;for(var r=0;r<i;r++)e[r]._selection=n},_updateSelection:function(t,e,i){t._selection=i,(this._segmentSelection+=i-e)>0&&this.setSelected(!0)},divideAt:function(t){var e,i=this.getLocationAt(t);return i&&(e=i.getCurve().divideAt(i.getCurveOffset()))?e._segment1:null},splitAt:function(t){var e=this.getLocationAt(t),i=e&&e.index,n=e&&e.time;n>1-1e-8&&(i++,n=0);var r=this.getCurves();if(i>=0&&i<r.length){n>=1e-8&&r[i++].divideAtTime(n);var s,a=this.removeSegments(i,this._segments.length,!0);return this._closed?(this.setClosed(!1),s=this):((s=new N(x.NO_INSERT)).insertAbove(this),s.copyAttributes(this)),s._add(a,0),this.addSegment(a[0]),s}return null},split:function(t,i){var n,r=i===e?t:(n=this.getCurves()[t])&&n.getLocationAtTime(i);return null!=r?this.splitAt(r):null},join:function(t,e){var i=e||0;if(t&&t!==this){var n=t._segments,r=this.getLastSegment(),s=t.getLastSegment();if(!s)return this;r&&r._point.isClose(s._point,i)&&t.reverse();var a=t.getFirstSegment();if(r&&r._point.isClose(a._point,i))r.setHandleOut(a._handleOut),this._add(n.slice(1));else{var o=this.getFirstSegment();o&&o._point.isClose(a._point,i)&&t.reverse(),s=t.getLastSegment(),o&&o._point.isClose(s._point,i)?(o.setHandleIn(s._handleIn),this._add(n.slice(0,n.length-1),0)):this._add(n.slice())}t._closed&&this._add([n[0]]),t.remove()}var h=this.getFirstSegment(),u=this.getLastSegment();return h!==u&&h._point.isClose(u._point,i)&&(h.setHandleIn(u._handleIn),u.remove(),this.setClosed(!0)),this},reduce:function(t){for(var e=this.getCurves(),i=t&&t.simplify,n=i?1e-7:0,r=e.length-1;r>=0;r--){var s=e[r];!s.hasHandles()&&(!s.hasLength(n)||i&&s.isCollinear(s.getNext()))&&s.remove()}return this},reverse:function(){this._segments.reverse();for(var t=0,e=this._segments.length;t<e;t++){var i=this._segments[t],n=i._handleIn;i._handleIn=i._handleOut,i._handleOut=n,i._index=t}this._curves=null,this._changed(9)},flatten:function(t){for(var e=new E(this,t||.25,256,!0).parts,i=e.length,n=[],r=0;r<i;r++)n.push(new O(e[r].curve.slice(0,2)));!this._closed&&i>0&&n.push(new O(e[i-1].curve.slice(6))),this.setSegments(n)},simplify:function(t){var e=new F(this).fit(t||2.5);return e&&this.setSegments(e),!!e},smooth:function(t){var i=this,n=t||{},r=n.type||"asymmetric",s=this._segments,a=s.length,o=this._closed;function h(t,e){var n=t&&t.index;if(null!=n){var r=t.path;if(r&&r!==i)throw new Error(t._class+" "+n+" of "+r+" is not part of "+i);e&&t instanceof k&&n++}else n="number"==typeof t?t:e;return Math.min(n<0&&o?n%a:n<0?n+a:n,a-1)}var u=o&&n.from===e&&n.to===e,l=h(n.from,0),c=h(n.to,a-1);if(l>c)if(o)l-=a;else{var f=l;l=c,c=f}if(/^(?:asymmetric|continuous)$/.test(r)){var d="asymmetric"===r,_=Math.min,g=c-l+1,v=g-1,p=u?_(g,4):1,m=p,y=p,w=[];if(o||(m=_(1,l),y=_(1,a-c-1)),(v+=m+y)<=1)return;for(var x=0,b=l-m;x<=v;x++,b++)w[x]=s[(b<0?b+a:b)%a]._point;var S=w[0]._x+2*w[1]._x,C=w[0]._y+2*w[1]._y,P=2,I=v-1,M=[S],T=[C],O=[P],z=[],A=[];for(x=1;x<v;x++){var L=x<I,N=L?4:d?2:7,B=L?4:d?3:8,E=L?2:d?0:1,F=(L||d?1:2)/P;P=O[x]=N-F,S=M[x]=B*w[x]._x+E*w[x+1]._x-F*S,C=T[x]=B*w[x]._y+E*w[x+1]._y-F*C}z[I]=M[I]/O[I],A[I]=T[I]/O[I];for(x=v-2;x>=0;x--)z[x]=(M[x]-z[x+1])/O[x],A[x]=(T[x]-A[x+1])/O[x];z[v]=(3*w[v]._x-z[I])/2,A[v]=(3*w[v]._y-A[I])/2;x=m;var j=v-y;for(b=l;x<=j;x++,b++){var D=s[b<0?b+a:b],R=D._point,q=z[x]-R._x,V=A[x]-R._y;(u||x<j)&&D.setHandleOut(q,V),(u||x>m)&&D.setHandleIn(-q,-V)}}else for(x=l;x<=c;x++)s[x<0?x+a:x].smooth(n,!u&&x===l,!u&&x===c)},toShape:function(t){if(!this._closed)return null;var i,n,r,s,a,o,h,u=this._segments;function c(t,e){var i=u[t],n=i.getNext(),r=u[e],s=r.getNext();return i._handleOut.isZero()&&n._handleIn.isZero()&&r._handleOut.isZero()&&s._handleIn.isZero()&&n._point.subtract(i._point).isCollinear(s._point.subtract(r._point))}function f(t){var e=u[t],i=e.getNext(),n=e._handleOut,r=i._handleIn,s=.5522847498307936;if(n.isOrthogonal(r)){var a=e._point,o=i._point,h=new y(a,n,!0).intersect(new y(o,r,!0),!0);return h&&l.isZero(n.getLength()/h.subtract(a).getLength()-s)&&l.isZero(r.getLength()/h.subtract(o).getLength()-s)}return!1}function d(t,e){return u[t]._point.getDistance(u[e]._point)}if(!this.hasHandles()&&4===u.length&&c(0,2)&&c(1,3)&&(a=u[1],o=a.getPrevious(),h=a.getNext(),o._handleOut.isZero()&&a._handleIn.isZero()&&a._handleOut.isZero()&&h._handleIn.isZero()&&a._point.subtract(o._point).isOrthogonal(h._point.subtract(a._point)))?(i=C.Rectangle,n=new _(d(0,3),d(0,1)),s=u[1]._point.add(u[2]._point).divide(2)):8===u.length&&f(0)&&f(2)&&f(4)&&f(6)&&c(1,5)&&c(3,7)?(i=C.Rectangle,r=(n=new _(d(1,6),d(0,3))).subtract(new _(d(0,7),d(1,2))).divide(2),s=u[3]._point.add(u[4]._point).divide(2)):4===u.length&&f(0)&&f(1)&&f(2)&&f(3)&&(l.isZero(d(0,2)-d(1,3))?(i=C.Circle,r=d(0,2)/2):(i=C.Ellipse,r=new _(d(2,0)/2,d(3,1)/2)),s=u[1]._point),i){var g=this.getPosition(!0),v=new i({center:g,size:n,radius:r,insert:!1});return v.copyAttributes(this,!0),v._matrix.prepend(this._matrix),v.rotate(s.subtract(g).getAngle()+90),(t===e||t)&&v.insertAbove(this),v}return null},toPath:"#clone",compare:function t(e){if(!e||e instanceof B)return t.base.call(this,e);var i=this.getCurves(),n=e.getCurves(),r=i.length,s=n.length;if(!r||!s)return r==s;for(var a,o,h=i[0].getValues(),u=[],l=0,c=0,f=0;f<s;f++){var d=n[f].getValues();if(u.push(d),v=k.getOverlaps(h,d)){a=!f&&v[0][0]>0?s-1:f,o=v[0][1];break}}var _,g=Math.abs;for(d=u[a];h&&d;){var v;if(v=k.getOverlaps(h,d))if(g(v[0][0]-c)<1e-8){1===(c=v[1][0])&&(h=++l<r?i[l].getValues():null,c=0);var p=v[0][1];if(g(p-o)<1e-8){if(_||(_=[a,p]),1===(o=v[1][1])&&(++a>=s&&(a=0),d=u[a]||n[a].getValues(),o=0),!h)return _[0]===a&&_[1]===o;continue}}break}return!1},_hitTestSelf:function(t,e,i,n){var r,s,a,o,h,u,l=this,c=this.getStyle(),f=this._segments,d=f.length,_=this._closed,g=e._tolerancePadding,v=g,p=e.stroke&&c.hasStroke(),m=e.fill&&c.hasFill(),y=e.curves,w=p?c.getStrokeWidth()/2:m&&e.tolerance>0||y?0:null;function x(e,i){return t.subtract(e).divide(i).length<=1}function b(t,i,n){if(!e.selected||i.isSelected()){var r=t._point;if(i!==r&&(i=i.add(r)),x(i,v))return new T(n,l,{segment:t,point:i})}}function S(t,i){return(i||e.segments)&&b(t,t._point,"segment")||!i&&e.handles&&(b(t,t._handleIn,"handle-in")||b(t,t._handleOut,"handle-out"))}function C(t){o.add(t)}function P(e){var i,h=_||e._index>0&&e._index<d-1;return"round"===(h?r:s)?x(e._point,v):(o=new N({internal:!0,closed:!0}),h?e.isSmooth()||N._addBevelJoin(e,r,w,a,null,n,C,!0):"square"===s&&N._addSquareCap(e,s,w,null,n,C,!0),o.isEmpty()?void 0:o.contains(t)||(i=o.getNearestLocation(t))&&x(i.getPoint(),g))}if(null!==w&&(w>0?(r=c.getStrokeJoin(),s=c.getStrokeCap(),a=c.getMiterLimit(),v=v.add(N._getStrokePadding(w,n))):r=s="round"),!e.ends||e.segments||_){if(e.segments||e.handles)for(var I=0;I<d;I++)if(u=S(f[I]))return u}else if(u=S(f[0],!0)||S(f[d-1],!0))return u;if(null!==w){if(h=this.getNearestLocation(t)){var M=h.getTime();0===M||1===M&&d>1?P(h.getSegment())||(h=null):x(h.getPoint(),v)||(h=null)}if(!h&&"miter"===r&&d>1)for(I=0;I<d;I++){var O=f[I];if(t.getDistance(O._point)<=a*w&&P(O)){h=O.getLocation();break}}}return!h&&m&&this._contains(t)||h&&!p&&!y?new T("fill",this):h?new T(p?"stroke":"curve",this,{location:h,point:h.getPoint()}):null}},r.each(k._evaluateMethods,(function(t){this[t+"At"]=function(e){var i=this.getLocationAt(e);return i&&i[t]()}}),{beans:!1,getLocationOf:function(){for(var t=f.read(arguments),e=this.getCurves(),i=0,n=e.length;i<n;i++){var r=e[i].getLocationOf(t);if(r)return r}return null},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getLocationAt:function(t){if("number"==typeof t){for(var e=this.getCurves(),i=0,n=0,r=e.length;n<r;n++){var s=i,a=e[n];if((i+=a.getLength())>t)return a.getLocationAt(t-s)}if(e.length>0&&t<=this.getLength())return new A(e[e.length-1],1)}else if(t&&t.getPath&&t.getPath()===this)return t;return null},getOffsetsWithTangent:function(){var t=f.read(arguments);if(t.isZero())return[];for(var e=[],i=0,n=this.getCurves(),r=0,s=n.length;r<s;r++){for(var a=n[r],o=a.getTimesWithTangent(t),h=0,u=o.length;h<u;h++){var l=i+a.getOffsetAtTime(o[h]);e.indexOf(l)<0&&e.push(l)}i+=a.length}return e}}),new function(){function t(t,e,i){var n,r,s,a,o,h,u,l,c=e._segments,f=c.length,d=new Array(6),_=!0;function g(e){if(i)e._transformCoordinates(i,d),n=d[0],r=d[1];else{var c=e._point;n=c._x,r=c._y}if(_)t.moveTo(n,r),_=!1;else{if(i)o=d[2],h=d[3];else{var f=e._handleIn;o=n+f._x,h=r+f._y}o===n&&h===r&&u===s&&l===a?t.lineTo(n,r):t.bezierCurveTo(u,l,o,h,n,r)}if(s=n,a=r,i)u=d[4],l=d[5];else{f=e._handleOut;u=s+f._x,l=a+f._y}}for(var v=0;v<f;v++)g(c[v]);e._closed&&f>0&&g(c[0])}return{_draw:function(e,i,n,r){var s=i.dontStart,a=i.dontFinish||i.clip,o=this.getStyle(),h=o.hasFill(),u=o.hasStroke(),l=o.getDashArray(),c=!st.support.nativeDash&&u&&l&&l.length;function f(t){return l[(t%c+c)%c]}if(s||e.beginPath(),(h||u&&!c||a)&&(t(e,this,r),this._closed&&e.closePath()),!a&&(h||u)&&(this._setStyles(e,i,n),h&&(e.fill(o.getFillRule()),e.shadowColor="rgba(0,0,0,0)"),u)){if(c){s||e.beginPath();for(var d,_=new E(this,.25,32,!1,r),g=_.length,v=-o.getDashOffset(),p=0;v>0;)v-=f(p--)+f(p--);for(;v<g;)d=v+f(p++),(v>0||d>0)&&_.drawPart(e,Math.max(v,0),Math.max(d,0)),v=d+f(p++)}e.stroke()}},_drawSelected:function(e,i){e.beginPath(),t(e,this,i),e.stroke(),function(t,e,i,n){if(!(n<=0))for(var r,s,a=n/2,o=n-2,h=a-1,u=new Array(6),l=0,c=e.length;l<c;l++){var f=e[l],d=f._selection;if(f._transformCoordinates(i,u),r=u[0],s=u[1],2&d&&g(2),4&d&&g(4),t.fillRect(r-a,s-a,n,n),o>0&&!(1&d)){var _=t.fillStyle;t.fillStyle="#ffffff",t.fillRect(r-h,s-h,o,o),t.fillStyle=_}}function g(e){var i=u[e],n=u[e+1];r==i&&s==n||(t.beginPath(),t.moveTo(r,s),t.lineTo(i,n),t.stroke(),t.beginPath(),t.arc(i,n,a,0,2*Math.PI,!0),t.fill())}}(e,this._segments,i,st.settings.handleSize)}}},new function(){function t(t){var e=t._segments;if(!e.length)throw new Error("Use a moveTo() command first");return e[e.length-1]}return{moveTo:function(){var t=this._segments;1===t.length&&this.removeSegment(0),t.length||this._add([new O(f.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new O(f.read(arguments))])},cubicCurveTo:function(){var e=arguments,i=f.read(e),n=f.read(e),r=f.read(e),s=t(this);s.setHandleOut(i.subtract(s._point)),this._add([new O(r,n.subtract(r))])},quadraticCurveTo:function(){var e=arguments,i=f.read(e),n=f.read(e),r=t(this)._point;this.cubicCurveTo(i.add(r.subtract(i).multiply(1/3)),i.add(n.subtract(i).multiply(1/3)),n)},curveTo:function(){var e=arguments,i=f.read(e),n=f.read(e),s=r.pick(r.read(e),.5),a=1-s,o=t(this)._point,h=i.subtract(o.multiply(a*a)).subtract(n.multiply(s*s)).divide(2*s*a);if(h.isNaN())throw new Error("Cannot put a curve through points with parameter = "+s);this.quadraticCurveTo(h,n)},arcTo:function(){var e,i,n,s,a=arguments,o=Math.abs,h=Math.sqrt,u=t(this),c=u._point,d=f.read(a),g=r.peek(a);if("boolean"==typeof(b=r.pick(g,!0)))var v=(C=c.add(d).divide(2)).add(C.subtract(c).rotate(b?-90:90));else if(r.remain(a)<=2)v=d,d=f.read(a);else if(!c.equals(d)){var p=_.read(a),w=l.isZero;if(w(p.width)||w(p.height))return this.lineTo(d);var x=r.read(a),b=!!r.read(a),S=!!r.read(a),C=c.add(d).divide(2),P=($=c.subtract(C).rotate(-x)).x,I=$.y,M=o(p.width),T=o(p.height),z=M*M,k=T*T,A=P*P,L=I*I,N=h(A/z+L/k);if(N>1&&(z=(M*=N)*M,k=(T*=N)*T),o(N=(z*k-z*L-k*A)/(z*L+k*A))<1e-12&&(N=0),N<0)throw new Error("Cannot create an arc with the given arguments");e=new f(M*I/T,-T*P/M).multiply((S===b?-1:1)*h(N)).rotate(x).add(C),i=(n=(s=(new m).translate(e).rotate(x).scale(M,T))._inverseTransform(c)).getDirectedAngle(s._inverseTransform(d)),!b&&i>0?i-=360:b&&i<0&&(i+=360)}if(v){var B=new y(c.add(v).divide(2),v.subtract(c).rotate(90),!0),E=new y(v.add(d).divide(2),d.subtract(v).rotate(90),!0),F=new y(c,d),j=F.getSide(v);if(!(e=B.intersect(E,!0))){if(!j)return this.lineTo(d);throw new Error("Cannot create an arc with the given arguments")}i=(n=c.subtract(e)).getDirectedAngle(d.subtract(e));var D=F.getSide(e,!0);0===D?i=j*o(i):j===D&&(i+=i<0?360:-360)}if(i){for(var R=1e-5,q=o(i),V=q>=360?4:Math.ceil((q-R)/90),H=i/V,Z=H*Math.PI/360,U=4/3*Math.sin(Z)/(1+Math.cos(Z)),W=[],G=0;G<=V;G++){var $=d,J=null;if(G<V&&(J=n.rotate(90).multiply(U),s?($=s._transformPoint(n),J=s._transformPoint(n.add(J)).subtract($)):$=e.add(n)),G){var K=n.rotate(-90).multiply(U);s&&(K=s._transformPoint(n.add(K)).subtract($)),W.push(new O($,K,J))}else u.setHandleOut(J);n=n.rotate(H)}this._add(W)}},lineBy:function(){var e=f.read(arguments),i=t(this)._point;this.lineTo(i.add(e))},curveBy:function(){var e=arguments,i=f.read(e),n=f.read(e),s=r.read(e),a=t(this)._point;this.curveTo(a.add(i),a.add(n),s)},cubicCurveBy:function(){var e=arguments,i=f.read(e),n=f.read(e),r=f.read(e),s=t(this)._point;this.cubicCurveTo(s.add(i),s.add(n),s.add(r))},quadraticCurveBy:function(){var e=arguments,i=f.read(e),n=f.read(e),r=t(this)._point;this.quadraticCurveTo(r.add(i),r.add(n))},arcBy:function(){var e=arguments,i=t(this)._point,n=i.add(f.read(e)),s=r.pick(r.peek(e),!0);"boolean"==typeof s?this.arcTo(n,s):this.arcTo(n,i.add(f.read(e)))},closePath:function(t){this.setClosed(!0),this.join(this,t)}}},{_getBounds:function(t,e){var i=e.handle?"getHandleBounds":e.stroke?"getStrokeBounds":"getBounds";return N[i](this._segments,this._closed,this,t,e)},statics:{getBounds:function(t,e,i,n,r,s){var a=t[0];if(!a)return new v;var o=new Array(6),h=a._transformCoordinates(n,new Array(6)),u=h.slice(0,2),l=u.slice(),c=new Array(2);function f(t){t._transformCoordinates(n,o);for(var e=0;e<2;e++)k._addBounds(h[e],h[e+4],o[e+2],o[e],e,s?s[e]:0,u,l,c);var i=h;h=o,o=i}for(var d=1,_=t.length;d<_;d++)f(t[d]);return e&&f(a),new v(u[0],u[1],l[0]-u[0],l[1]-u[1])},getStrokeBounds:function(t,e,i,n,r){var s=i.getStyle(),a=s.hasStroke(),o=s.getStrokeWidth(),h=a&&i._getStrokeMatrix(n,r),u=a&&N._getStrokePadding(o,h),l=N.getBounds(t,e,i,n,r,u);if(!a)return l;var c=o/2,f=s.getStrokeJoin(),d=s.getStrokeCap(),g=s.getMiterLimit(),p=new v(new _(u));function m(t){l=l.include(t)}function y(t){l=l.unite(p.setCenter(t._point.transform(n)))}function w(t,e){"round"===e||t.isSmooth()?y(t):N._addBevelJoin(t,e,c,g,n,h,m)}function x(t,e){"round"===e?y(t):N._addSquareCap(t,e,c,n,h,m)}var b=t.length-(e?0:1);if(b>0){for(var S=1;S<b;S++)w(t[S],f);e?w(t[0],f):(x(t[0],d),x(t[t.length-1],d))}return l},_getStrokePadding:function(t,e){if(!e)return[t,t];var i=new f(t,0).transform(e),n=new f(0,t).transform(e),r=i.getAngleInRadians(),s=i.getLength(),a=n.getLength(),o=Math.sin(r),h=Math.cos(r),u=Math.tan(r),l=Math.atan2(a*u,s),c=Math.atan2(a,u*s);return[Math.abs(s*Math.cos(l)*h+a*Math.sin(l)*o),Math.abs(a*Math.sin(c)*h+s*Math.cos(c)*o)]},_addBevelJoin:function(t,e,i,n,r,s,a,o){var h=t.getCurve(),u=h.getPrevious(),l=h.getPoint1().transform(r),c=u.getNormalAtTime(1).multiply(i).transform(s),d=h.getNormalAtTime(0).multiply(i).transform(s),_=c.getDirectedAngle(d);if((_<0||_>=180)&&(c=c.negate(),d=d.negate()),o&&a(l),a(l.add(c)),"miter"===e){var g=new y(l.add(c),new f(-c.y,c.x),!0).intersect(new y(l.add(d),new f(-d.y,d.x),!0),!0);g&&l.getDistance(g)<=n*i&&a(g)}a(l.add(d))},_addSquareCap:function(t,e,i,n,r,s,a){var o=t._point.transform(n),h=t.getLocation(),u=h.getNormal().multiply(0===h.getTime()?i:-i).transform(r);"square"===e&&(a&&(s(o.subtract(u)),s(o.add(u))),o=o.add(u.rotate(-90))),s(o.add(u)),s(o.subtract(u))},getHandleBounds:function(t,e,i,n,r){var s,a,o=i.getStyle();if(r.stroke&&o.hasStroke()){var h=i._getStrokeMatrix(n,r),u=o.getStrokeWidth()/2,l=u;"miter"===o.getStrokeJoin()&&(l=u*o.getMiterLimit()),"square"===o.getStrokeCap()&&(l=Math.max(l,u*Math.SQRT2)),s=N._getStrokePadding(u,h),a=N._getStrokePadding(l,h)}for(var c=new Array(6),f=1/0,d=-f,_=f,g=d,p=0,m=t.length;p<m;p++){t[p]._transformCoordinates(n,c);for(var y=0;y<6;y+=2){var w=y?s:a,x=w?w[0]:0,b=w?w[1]:0,S=c[y],C=c[y+1],P=S-x,I=S+x,M=C-b,T=C+b;P<f&&(f=P),I>d&&(d=I),M<_&&(_=M),T>g&&(g=T)}}return new v(f,_,d-f,g-_)}}});N.inject({statics:new function(){var t=.5522847498307936,e=[new O([-1,0],[0,t],[0,-t]),new O([0,-1],[-t,0],[t,0]),new O([1,0],[0,-t],[0,t]),new O([0,1],[t,0],[-t,0])];function i(t,e,i){var n=r.getNamed(i),s=new N(n&&(1==n.insert?x.INSERT:0==n.insert?x.NO_INSERT:null));return s._add(t),s._closed=e,s.set(n,x.INSERT)}function n(t,n,r){for(var s=new Array(4),a=0;a<4;a++){var o=e[a];s[a]=new O(o._point.multiply(n).add(t),o._handleIn.multiply(n),o._handleOut.multiply(n))}return i(s,!0,r)}return{Line:function(){var t=arguments;return i([new O(f.readNamed(t,"from")),new O(f.readNamed(t,"to"))],!1,t)},Circle:function(){var t=arguments,e=f.readNamed(t,"center"),i=r.readNamed(t,"radius");return n(e,new _(i),t)},Rectangle:function(){var e,n=arguments,r=v.readNamed(n,"rectangle"),s=_.readNamed(n,"radius",0,{readNull:!0}),a=r.getBottomLeft(!0),o=r.getTopLeft(!0),h=r.getTopRight(!0),u=r.getBottomRight(!0);if(!s||s.isZero())e=[new O(a),new O(o),new O(h),new O(u)];else{var l=(s=_.min(s,r.getSize(!0).divide(2))).width,c=s.height,f=l*t,d=c*t;e=[new O(a.add(l,0),null,[-f,0]),new O(a.subtract(0,c),[0,d]),new O(o.add(0,c),null,[0,-d]),new O(o.add(l,0),[-f,0],null),new O(h.subtract(l,0),null,[f,0]),new O(h.add(0,c),[0,-d],null),new O(u.subtract(0,c),null,[0,d]),new O(u.subtract(l,0),[f,0])]}return i(e,!0,n)},RoundRectangle:"#Rectangle",Ellipse:function(){var t=arguments,e=C._readEllipse(t);return n(e.center,e.radius,t)},Oval:"#Ellipse",Arc:function(){var t=arguments,e=f.readNamed(t,"from"),i=f.readNamed(t,"through"),n=f.readNamed(t,"to"),s=r.getNamed(t),a=new N(s&&0==s.insert&&x.NO_INSERT);return a.moveTo(e),a.arcTo(i,n),a.set(s)},RegularPolygon:function(){for(var t=arguments,e=f.readNamed(t,"center"),n=r.readNamed(t,"sides"),s=r.readNamed(t,"radius"),a=360/n,o=n%3==0,h=new f(0,o?-s:s),u=o?-1:.5,l=new Array(n),c=0;c<n;c++)l[c]=new O(e.add(h.rotate((c+u)*a)));return i(l,!0,t)},Star:function(){for(var t=arguments,e=f.readNamed(t,"center"),n=2*r.readNamed(t,"points"),s=r.readNamed(t,"radius1"),a=r.readNamed(t,"radius2"),o=360/n,h=new f(0,-1),u=new Array(n),l=0;l<n;l++)u[l]=new O(e.add(h.rotate(o*l).multiply(l%2?a:s)));return i(u,!0,t)}}}});var B=L.extend({_class:"CompoundPath",_serializeFields:{children:[]},beans:!0,initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||("string"==typeof t?this.setPathData(t):this.addChildren(Array.isArray(t)?t:arguments))},insertChildren:function t(e,i){var n=i,s=n[0];s&&"number"==typeof s[0]&&(n=[n]);for(var a=i.length-1;a>=0;a--){var o=n[a];n!==i||o instanceof N||(n=r.slice(n)),Array.isArray(o)?n[a]=new N({segments:o,insert:!1}):o instanceof B&&(n.splice.apply(n,[a,1].concat(o.removeChildren())),o.remove())}return t.base.call(this,e,n)},reduce:function t(e){for(var i=this._children,n=i.length-1;n>=0;n--){var r;(r=i[n].reduce(e)).isEmpty()&&r.remove()}return i.length?t.base.call(this):((r=new N(x.NO_INSERT)).copyAttributes(this),r.insertAbove(this),this.remove(),r)},isClosed:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)if(!t[e]._closed)return!1;return!0},setClosed:function(t){for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setClosed(t)},getFirstSegment:function(){var t=this.getFirstChild();return t&&t.getFirstSegment()},getLastSegment:function(){var t=this.getLastChild();return t&&t.getLastSegment()},getCurves:function(){for(var t=this._children,e=[],i=0,n=t.length;i<n;i++)r.push(e,t[i].getCurves());return e},getFirstCurve:function(){var t=this.getFirstChild();return t&&t.getFirstCurve()},getLastCurve:function(){var t=this.getLastChild();return t&&t.getLastCurve()},getArea:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getArea();return e},getLength:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();return e},getPathData:function(t,e){for(var i=this._children,n=[],r=0,s=i.length;r<s;r++){var a=i[r],o=a._matrix;n.push(a.getPathData(t&&!o.isIdentity()?t.appended(o):t,e))}return n.join("")},_hitTestChildren:function t(e,i,n){return t.base.call(this,e,i.class===N||"path"===i.type?i:r.set({},i,{fill:!1}),n)},_draw:function(t,e,i,n){var r=this._children;if(r.length){e=e.extend({dontStart:!0,dontFinish:!0}),t.beginPath();for(var s=0,a=r.length;s<a;s++)r[s].draw(t,e,n);if(!e.clip){this._setStyles(t,e,i);var o=this._style;o.hasFill()&&(t.fill(o.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),o.hasStroke()&&t.stroke()}}},_drawSelected:function(t,e,i){for(var n=this._children,r=0,s=n.length;r<s;r++){var a=n[r],o=a._matrix;i[a._id]||a._drawSelected(t,o.isIdentity()?e:e.appended(o))}}},new function(){function t(t,e){var i=t._children;if(e&&!i.length)throw new Error("Use a moveTo() command first");return i[i.length-1]}return r.each(["lineTo","cubicCurveTo","quadraticCurveTo","curveTo","arcTo","lineBy","cubicCurveBy","quadraticCurveBy","curveBy","arcBy"],(function(e){this[e]=function(){var i=t(this,!0);i[e].apply(i,arguments)}}),{moveTo:function(){var e=t(this),i=e&&e.isEmpty()?e:new N(x.NO_INSERT);i!==e&&this.addChild(i),i.moveTo.apply(i,arguments)},moveBy:function(){var e=t(this,!0),i=e&&e.getLastSegment(),n=f.read(arguments);this.moveTo(i?n.add(i._point):n)},closePath:function(e){t(this,!0).closePath(e)}})},r.each(["reverse","flatten","simplify","smooth"],(function(t){this[t]=function(e){for(var i,n=this._children,r=0,s=n.length;r<s;r++)i=n[r][t](e)||i;return i}}),{}));L.inject(new function(){var t=Math.min,i=Math.max,n=Math.abs,s={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};function a(t){return t._children||[t]}function o(t,e){var i=t.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);if(e){for(var n=a(i),r=0,s=n.length;r<s;r++){(t=n[r])._closed||t.isEmpty()||(t.closePath(1e-12),t.getFirstSegment().setHandleIn(0,0),t.getLastSegment().setHandleOut(0,0))}i=i.resolveCrossings().reorient("nonzero"===i.getFillRule(),!0)}return i}function u(t,e,i,n,r){var s=new B(x.NO_INSERT);return s.addChildren(t,!0),s=s.reduce({simplify:e}),r&&0==r.insert||s.insertAbove(n&&i.isSibling(n)&&i.getIndex()<n.getIndex()?n:i),s.copyAttributes(i,!0),s}function c(t){return t.hasOverlap()||t.isCrossing()}function f(t,e,i,n){if(n&&(0==n.trace||n.stroke)&&/^(subtract|intersect)$/.test(i))return d(t,e,i);var l=o(t,!0),f=e&&t!==e&&o(e,!0),_=s[i];_[i]=!0,f&&(_.subtract||_.exclude)^f.isClockwise()^l.isClockwise()&&f.reverse();var g,m=p(A.expand(l.getIntersections(f,c))),x=a(l),b=f&&a(f),S=[],C=[];function P(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];r.push(S,n._segments),r.push(C,n.getCurves()),n._overlapsOnly=!0}}function I(t){for(var e=[],i=0,n=t&&t.length;i<n;i++)e.push(C[t[i]]);return e}if(m.length){P(x),b&&P(b);for(var M=new Array(C.length),T=0,O=C.length;T<O;T++)M[T]=C[T].getValues();var z=h.findCurveBoundsCollisions(M,M,0,!0),k={};for(T=0;T<C.length;T++){var L=C[T],N=L._path._id;(k[N]=k[N]||{})[L.getIndex()]={hor:I(z[T].hor),ver:I(z[T].ver)}}for(T=0,O=m.length;T<O;T++)y(m[T]._segment,l,f,k,_);for(T=0,O=S.length;T<O;T++){var B=S[T],E=B._intersection;B._winding||y(B,l,f,k,_),E&&E._overlap||(B._path._overlapsOnly=!1)}g=w(S,_)}else g=v(b?x.concat(b):x.slice(),(function(t){return!!_[t]}));return u(g,!0,t,e,n)}function d(t,e,i){var n=o(t),r=o(e),s=n.getIntersections(r,c),a="subtract"===i,h="divide"===i,l={},f=[];function d(t){if(!l[t._id]&&(h||r.contains(t.getPointAt(t.getLength()/2))^a))return f.unshift(t),l[t._id]=!0}for(var _=s.length-1;_>=0;_--){var g=s[_].split();g&&(d(g)&&g.getFirstSegment().setHandleIn(0,0),n.getLastSegment().setHandleOut(0,0))}return d(n),u(f,!1,t,e)}function _(t,e){for(var i=t;i;){if(i===e)return;i=i._previous}for(;t._next&&t._next!==e;)t=t._next;if(!t._next){for(;e._previous;)e=e._previous;t._next=e,e._previous=t}}function g(t){for(var e=t.length-1;e>=0;e--)t[e].clearHandles()}function v(t,e,i){var s=t&&t.length;if(s){var a=r.each(t,(function(t,e){this[t._id]={container:null,winding:t.isClockwise()?1:-1,index:e}}),{}),o=t.slice().sort((function(t,e){return n(e.getArea())-n(t.getArea())})),u=o[0],c=h.findItemBoundsCollisions(o,null,l.GEOMETRIC_EPSILON);null==i&&(i=u.isClockwise());for(var f=0;f<s;f++){var d=o[f],_=a[d._id],g=0,v=c[f];if(v)for(var p=null,m=v.length-1;m>=0;m--)if(v[m]<f){p=p||d.getInteriorPoint();var y=o[v[m]];if(y.contains(p)){var w=a[y._id];g=w.winding,_.winding+=g,_.container=w.exclude?w.container:y;break}}if(e(_.winding)===e(g))_.exclude=!0,t[_.index]=null;else{var x=_.container;d.setClockwise(x?!x.isClockwise():i)}}}return t}function p(t,e,i){var n,r,s,a=e&&[],o=!1,h=i||[],u=i&&{};function l(t){return t._path._id+"."+t._segment1._index}for(var c=(i&&i.length)-1;c>=0;c--){(f=i[c])._path&&(u[l(f)]=!0)}for(c=t.length-1;c>=0;c--){var f,d,v=t[c],p=v._time,m=p,y=e&&!e(v);if((f=v._curve)&&(f!==r?(o=!f.hasHandles()||u&&u[l(f)],n=[],s=null,r=f):s>=1e-8&&(p/=s)),y)n&&n.push(v);else{if(e&&a.unshift(v),s=m,p<1e-8)d=f._segment1;else if(p>1-1e-8)d=f._segment2;else{var w=f.divideAtTime(p,!0);o&&h.push(f,w),d=w._segment1;for(var x=n.length-1;x>=0;x--){var b=n[x];b._time=(b._time-p)/(1-p)}}v._setSegment(d);var S=d._intersection,C=v._intersection;if(S){_(S,C);for(var P=S;P;)_(P._intersection,S),P=P._next}else d._intersection=C}}return i||g(h),a||t}function m(e,r,s,a,o){var h,u,l=Array.isArray(r)?r:r[s?"hor":"ver"],c=s?1:0,f=1^c,d=[e.x,e.y],_=d[c],g=d[f],v=_-1e-9,p=_+1e-9,y=0,w=0,x=0,b=0,S=!1,C=!1,P=1,I=[];function M(n){var u=n[f+0],l=n[f+6];if(!(g<t(u,l)||g>i(u,l))){var d=n[c+0],y=n[c+2],w=n[c+4],C=n[c+6];if(u!==l){var M=g===u?0:g===l||v>i(d,y,w,C)||p<t(d,y,w,C)?1:k.solveCubic(n,f,g,I,0,1)>0?I[0]:1,T=0===M?d:1===M?C:k.getPoint(n,M)[s?"y":"x"],O=u>l?1:-1,z=h[f]>h[f+6]?1:-1,A=h[c+6];return g!==u?(T<v?x+=O:T>p?b+=O:S=!0,T>_-1e-6&&T<_+1e-6&&(P/=2)):(O!==z?d<v?x+=O:d>p&&(b+=O):d!=A&&(A<p&&T>p?(b+=O,S=!0):A>v&&T<v&&(x+=O,S=!0)),P/=4),h=n,!o&&T>v&&T<p&&0===k.getTangent(n,M)[s?"x":"y"]&&m(e,r,!s,a,!0)}(d<p&&C>v||C<p&&d>v)&&(S=!0)}}function T(e){var n=e[f+0],r=e[f+2],a=e[f+4],o=e[f+6];if(g<=i(n,r,a,o)&&g>=t(n,r,a,o))for(var h,u=e[c+0],l=e[c+2],d=e[c+4],_=e[c+6],m=v>i(u,l,d,_)||p<t(u,l,d,_)?[e]:k.getMonoCurves(e,s),y=0,w=m.length;y<w;y++)if(h=M(m[y]))return h}for(var O=0,z=l.length;O<z;O++){var A,L=l[O],N=L._path,B=L.getValues();if(!(O&&l[O-1]._path===N||(h=null,N._closed||(u=k.getValues(N.getLastCurve().getSegment2(),L.getSegment1(),null,!a))[f]!==u[f+6]&&(h=u),h))){h=B;for(var E=N.getLastCurve();E&&E!==L;){var F=E.getValues();if(F[f]!==F[f+6]){h=F;break}E=E.getPrevious()}}if(A=T(B))return A;if(O+1===z||l[O+1]._path!==N){if(u&&(A=T(u)))return A;!S||x||b||(x=b=N.isClockwise(a)^s?1:-1),y+=x,w+=b,x=b=0,S&&(C=!0,S=!1),u=null}}return y=n(y),w=n(w),{winding:i(y,w),windingL:y,windingR:w,quality:P,onPath:C}}function y(t,e,i,r,s){var a=[],o=t,h=0;do{if(y=t.getCurve()){var u=y.getLength();a.push({segment:t,curve:y,length:u}),h+=u}t=t.getNext()}while(t&&!t._intersection&&t!==o);for(var c=[.5,.25,.75],f={winding:0,quality:-1},d=0;d<c.length&&f.quality<.5;d++){u=h*c[d];for(var _=0,g=a.length;_<g;_++){var v=a[_],p=v.length;if(u<=p){var y,w=(y=v.curve)._path,x=w._parent,b=x instanceof B?x:w,S=l.clamp(y.getTimeAt(u),.001,.999),C=y.getPointAtTime(S),P=n(y.getTangentAtTime(S).y)<Math.SQRT1_2,I=null;if(s.subtract&&i){var M=(b===e?i:e)._getWinding(C,P,!0);if(b===e&&M.winding||b===i&&!M.winding){if(M.quality<1)continue;I={winding:0,quality:1}}}(I=I||m(C,r[w._id][y.getIndex()],P,!0)).quality>f.quality&&(f=I);break}u-=p}}for(_=a.length-1;_>=0;_--)a[_].segment._winding=f}function w(t,e){var i,n=[];function r(t){var i;return!(!t||t._visited||e&&(!e[(i=t._winding||{}).winding]||e.unite&&2===i.winding&&i.windingL&&i.windingR))}function s(t){if(t)for(var e=0,n=i.length;e<n;e++)if(t===i[e])return!0;return!1}function a(t){for(var e=t._segments,i=0,n=e.length;i<n;i++)e[i]._visited=!0}function o(t,e){var n=t._intersection,a=n,o=[];function h(n,a){for(;n&&n!==a;){var h=n._segment,u=h&&h._path;if(u){var l=h.getNext()||u.getFirstSegment(),c=l._intersection;h!==t&&(s(h)||s(l)||l&&r(h)&&(r(l)||c&&r(c._segment)))&&o.push(h),e&&i.push(h)}n=n._next}}if(e&&(i=[t]),n){for(h(n);n&&n._previous;)n=n._previous;h(n,a)}return o}t.sort((function(t,e){var i=t._intersection,n=e._intersection,r=!(!i||!i._overlap),s=!(!n||!n._overlap),a=t._path,o=e._path;return r^s?r?1:-1:!i^!n?i?1:-1:a!==o?a._id-o._id:t._index-e._index}));for(var h=0,u=t.length;h<u;h++){var l,c,f,d=t[h],_=r(d),g=null,v=!1,p=!0,m=[];if(_&&d._path._overlapsOnly){var y=d._path,w=d._intersection._segment._path;y.compare(w)&&(y.getArea()&&n.push(y.clone(!1)),a(y),a(w),_=!1)}for(;_;){var b=!g,S=o(d,b),C=S.shift(),P=!(v=!b&&(s(d)||s(C)))&&C;if(b&&(g=new N(x.NO_INSERT),l=null),v){(d.isFirst()||d.isLast())&&(p=d._path._closed),d._visited=!0;break}if(P&&l&&(m.push(l),l=null),l||(P&&S.push(d),l={start:g._segments.length,crossings:S,visited:c=[],handleIn:f}),P&&(d=C),!r(d)){g.removeSegments(l.start);for(var I=0,M=c.length;I<M;I++)c[I]._visited=!1;c.length=0;do{(d=l&&l.crossings.shift())&&d._path||(d=null,(l=m.pop())&&(c=l.visited,f=l.handleIn))}while(l&&!r(d));if(!d)break}var T=d.getNext();g.add(new O(d._point,f,T&&d._handleOut)),d._visited=!0,c.push(d),d=T||d._path.getFirstSegment(),f=T&&T._handleIn}v&&(p&&(g.getFirstSegment().setHandleIn(f),g.setClosed(p)),0!==g.getArea()&&n.push(g))}return n}return{_getWinding:function(t,e,i){return m(t,this.getCurves(),e,i)},unite:function(t,e){return f(this,t,"unite",e)},intersect:function(t,e){return f(this,t,"intersect",e)},subtract:function(t,e){return f(this,t,"subtract",e)},exclude:function(t,e){return f(this,t,"exclude",e)},divide:function(t,e){return e&&(0==e.trace||e.stroke)?d(this,t,"divide"):u([this.subtract(t,e),this.intersect(t,e)],!0,this,t,e)},resolveCrossings:function(){var t=this._children,e=t||[this];function i(t,e){var i=t&&t._intersection;return i&&i._overlap&&i._path===e}var n=!1,s=!1,a=this.getIntersections(null,(function(t){return t.hasOverlap()&&(n=!0)||t.isCrossing()&&(s=!0)})),o=n&&s&&[];if(a=A.expand(a),n)for(var h=p(a,(function(t){return t.hasOverlap()}),o),u=h.length-1;u>=0;u--){var l=h[u],c=l._path,f=l._segment,d=f.getPrevious(),_=f.getNext();i(d,c)&&i(_,c)&&(f.remove(),d._handleOut._set(0,0),_._handleIn._set(0,0),d===f||d.getCurve().hasLength()||(_._handleIn.set(d._handleIn),d.remove()))}s&&(p(a,n&&function(t){var e=t.getCurve(),i=t.getSegment(),n=t._intersection,r=n._curve,s=n._segment;if(e&&r&&e._path&&r._path)return!0;i&&(i._intersection=null),s&&(s._intersection=null)},o),o&&g(o),e=w(r.each(e,(function(t){r.push(this,t._segments)}),[])));var v,m=e.length;return m>1&&t?(e!==t&&this.setChildren(e),v=this):1!==m||t||(e[0]!==this&&this.setSegments(e[0].removeSegments()),v=this),v||((v=new B(x.NO_INSERT)).addChildren(e),(v=v.reduce()).copyAttributes(this),this.replaceWith(v)),v},reorient:function(t,i){var n=this._children;return n&&n.length?this.setChildren(v(this.removeChildren(),(function(e){return!!(t?e:1&e)}),i)):i!==e&&this.setClockwise(i),this},getInteriorPoint:function(){var e=this.getBounds().getCenter(!0);if(!this.contains(e)){for(var n=this.getCurves(),r=e.y,s=[],a=[],o=0,h=n.length;o<h;o++){var u=n[o].getValues(),l=u[1],c=u[3],f=u[5],d=u[7];if(r>=t(l,c,f,d)&&r<=i(l,c,f,d))for(var _=k.getMonoCurves(u),g=0,v=_.length;g<v;g++){var p=_[g],m=p[1],y=p[7];if(m!==y&&(r>=m&&r<=y||r>=y&&r<=m)){var w=r===m?p[0]:r===y?p[6]:1===k.solveCubic(p,1,r,a,0,1)?k.getPoint(p,a[0]).x:(p[0]+p[6])/2;s.push(w)}}}s.length>1&&(s.sort((function(t,e){return t-e})),e.x=(s[0]+s[1])/2)}return e}}});var E=r.extend({_class:"PathFlattener",initialize:function(t,e,i,n,r){var s,a=[],o=[],h=0,u=1/(i||32),l=t._segments,c=l[0];function f(t,i){var s=k.getValues(t,i,r);a.push(s),function t(i,r,s,a){if(!(a-s>u)||n&&k.isStraight(i)||k.isFlatEnough(i,e||.25)){var l=i[6]-i[0],c=i[7]-i[1],f=Math.sqrt(l*l+c*c);f>0&&(h+=f,o.push({offset:h,curve:i,index:r,time:a}))}else{var d=k.subdivide(i,.5),_=(s+a)/2;t(d[0],r,s,_),t(d[1],r,_,a)}}(s,t._index,0,1)}for(var d=1,_=l.length;d<_;d++)f(c,s=l[d]),c=s;t._closed&&f(s||c,l[0]),this.curves=a,this.parts=o,this.length=h,this.index=0},_get:function(t){for(var e,i=this.parts,n=i.length,r=this.index;e=r,r&&!(i[--r].offset<t););for(;e<n;e++){var s=i[e];if(s.offset>=t){this.index=e;var a=i[e-1],o=a&&a.index===s.index?a.time:0,h=a?a.offset:0;return{index:s.index,time:o+(s.time-o)*(t-h)/(s.offset-h)}}}return{index:i[n-1].index,time:1}},drawPart:function(t,e,i){for(var n=this._get(e),r=this._get(i),s=n.index,a=r.index;s<=a;s++){var o=k.getPart(this.curves[s],s===n.index?n.time:0,s===r.index?r.time:1);s===n.index&&t.moveTo(o[0],o[1]),t.bezierCurveTo.apply(t,o.slice(2))}}},r.each(k._evaluateMethods,(function(t){this[t+"At"]=function(e){var i=this._get(e);return k[t](this.curves[i.index],i.time)}}),{})),F=r.extend({initialize:function(t){for(var e,i=this.points=[],n=t._segments,r=t._closed,s=0,a=n.length;s<a;s++){var o=n[s].point;e&&e.equals(o)||i.push(e=o.clone())}r&&(i.unshift(i[i.length-1]),i.push(i[1])),this.closed=r},fit:function(t){var e=this.points,i=e.length,n=null;return i>0&&(n=[new O(e[0])],i>1&&(this.fitCubic(n,t,0,i-1,e[1].subtract(e[0]),e[i-2].subtract(e[i-1])),this.closed&&(n.shift(),n.pop()))),n},fitCubic:function(t,e,i,n,r,s){var a=this.points;if(n-i!=1){for(var o,h=this.chordLengthParameterize(i,n),u=Math.max(e,e*e),l=!0,c=0;c<=4;c++){var f=this.generateBezier(i,n,h,r,s),d=this.findMaxError(i,n,f,h);if(d.error<e&&l)return void this.addCurve(t,f);if(o=d.index,d.error>=u)break;l=this.reparameterize(i,n,h,f),u=d.error}var _=a[o-1].subtract(a[o+1]);this.fitCubic(t,e,i,o,r,_),this.fitCubic(t,e,o,n,_.negate(),s)}else{var g=a[i],v=a[n],p=g.getDistance(v)/3;this.addCurve(t,[g,g.add(r.normalize(p)),v.add(s.normalize(p)),v])}},addCurve:function(t,e){t[t.length-1].setHandleOut(e[1].subtract(e[0])),t.push(new O(e[3],e[2].subtract(e[3])))},generateBezier:function(t,e,i,n,r){for(var s=Math.abs,a=this.points,o=a[t],h=a[e],u=[[0,0],[0,0]],l=[0,0],c=0,f=e-t+1;c<f;c++){var d=i[c],_=1-d,g=3*d*_,v=_*_*_,p=g*_,m=g*d,y=d*d*d,w=n.normalize(p),x=r.normalize(m),b=a[t+c].subtract(o.multiply(v+p)).subtract(h.multiply(m+y));u[0][0]+=w.dot(w),u[0][1]+=w.dot(x),u[1][0]=u[0][1],u[1][1]+=x.dot(x),l[0]+=w.dot(b),l[1]+=x.dot(b)}var S,C,P=u[0][0]*u[1][1]-u[1][0]*u[0][1];if(s(P)>1e-12){var I=u[0][0]*l[1]-u[1][0]*l[0];S=(l[0]*u[1][1]-l[1]*u[0][1])/P,C=I/P}else{var M=u[0][0]+u[0][1],T=u[1][0]+u[1][1];S=C=s(M)>1e-12?l[0]/M:s(T)>1e-12?l[1]/T:0}var O,z,k=h.getDistance(o),A=1e-12*k;if(S<A||C<A)S=C=k/3;else{var L=h.subtract(o);O=n.normalize(S),z=r.normalize(C),O.dot(L)-z.dot(L)>k*k&&(S=C=k/3,O=z=null)}return[o,o.add(O||n.normalize(S)),h.add(z||r.normalize(C)),h]},reparameterize:function(t,e,i,n){for(var r=t;r<=e;r++)i[r-t]=this.findRoot(n,this.points[r],i[r-t]);r=1;for(var s=i.length;r<s;r++)if(i[r]<=i[r-1])return!1;return!0},findRoot:function(t,e,i){for(var n=[],r=[],s=0;s<=2;s++)n[s]=t[s+1].subtract(t[s]).multiply(3);for(s=0;s<=1;s++)r[s]=n[s+1].subtract(n[s]).multiply(2);var a=this.evaluate(3,t,i),o=this.evaluate(2,n,i),h=this.evaluate(1,r,i),u=a.subtract(e),c=o.dot(o)+u.dot(h);return l.isMachineZero(c)?i:i-u.dot(o)/c},evaluate:function(t,e,i){for(var n=e.slice(),r=1;r<=t;r++)for(var s=0;s<=t-r;s++)n[s]=n[s].multiply(1-i).add(n[s+1].multiply(i));return n[0]},chordLengthParameterize:function(t,e){for(var i=[0],n=t+1;n<=e;n++)i[n-t]=i[n-t-1]+this.points[n].getDistance(this.points[n-1]);n=1;for(var r=e-t;n<=r;n++)i[n]/=i[r];return i},findMaxError:function(t,e,i,n){for(var r=Math.floor((e-t+1)/2),s=0,a=t+1;a<e;a++){var o=this.evaluate(3,i,n[a-t]).subtract(this.points[a]),h=o.x*o.x+o.y*o.y;h>=s&&(s=h,r=a)}return{error:s,index:r}}}),j=x.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(t){this._content="",this._lines=[];var i=t&&r.isPlainObject(t)&&t.x===e&&t.y===e;this._initialize(i&&t,!i&&f.read(arguments))},_equals:function(t){return this._content===t._content},copyContent:function(t){this.setContent(t._content)},getContent:function(){return this._content},setContent:function(t){this._content=""+t,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),D=j.extend({_class:"PointText",initialize:function(){j.apply(this,arguments)},getPoint:function(){var t=this._matrix.getTranslation();return new d(t.x,t.y,this,"setPoint")},setPoint:function(){var t=f.read(arguments);this.translate(t.subtract(this._matrix.getTranslation()))},_draw:function(t,e,i){if(this._content){this._setStyles(t,e,i);var n=this._lines,r=this._style,s=r.hasFill(),a=r.hasStroke(),o=r.getLeading(),h=t.shadowColor;t.font=r.getFontStyle(),t.textAlign=r.getJustification();for(var u=0,l=n.length;u<l;u++){t.shadowColor=h;var c=n[u];s&&(t.fillText(c,0,0),t.shadowColor="rgba(0,0,0,0)"),a&&t.strokeText(c,0,0),t.translate(0,o)}}},_getBounds:function(t,e){var i=this._style,n=this._lines,r=n.length,s=i.getJustification(),a=i.getLeading(),o=this.getView().getTextWidth(i.getFontStyle(),n),h=0;"left"!==s&&(h-=o/("center"===s?2:1));var u=new v(h,r?-.75*a:0,o,r*a);return t?t._transformBounds(u,u):u}}),R=r.extend(new function(){var t,e={gray:["gray"],rgb:["red","green","blue"],hsb:["hue","saturation","brightness"],hsl:["hue","saturation","lightness"],gradient:["gradient","origin","destination","highlight"]},n={},s={transparent:[0,0,0,0]};function a(e){var n,r=e.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i)||e.match(/^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i),a="rgb";if(r){var o=r[4]?4:3;n=new Array(o);for(var h=0;h<o;h++){var u=r[h+1];n[h]=parseInt(1==u.length?u+u:u,16)/255}}else if(r=e.match(/^(rgb|hsl)a?\((.*)\)$/)){a=r[1],n=r[2].trim().split(/[,\s]+/g);for(var l="hsl"===a,c=(h=0,Math.min(n.length,4));h<c;h++){var f=n[h];u=parseFloat(f);if(l)if(0===h){var d=f.match(/([a-z]*)$/)[1];u*={turn:360,rad:180/Math.PI,grad:.9}[d]||1}else h<3&&(u/=100);else h<3&&(u/=/%$/.test(f)?100:255);n[h]=u}}else{var _=s[e];if(!_)if(i){t||((t=et.getContext(1,1,{willReadFrequently:!0})).globalCompositeOperation="copy"),t.fillStyle="rgba(0,0,0,0)",t.fillStyle=e,t.fillRect(0,0,1,1);var g=t.getImageData(0,0,1,1).data;_=s[e]=[g[0]/255,g[1]/255,g[2]/255]}else _=[0,0,0];n=_.slice()}return[a,n]}var o=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],h={"rgb-hsb":function(t,e,i){var n=Math.max(t,e,i),r=n-Math.min(t,e,i);return[0===r?0:60*(n==t?(e-i)/r+(e<i?6:0):n==e?(i-t)/r+2:(t-e)/r+4),0===n?0:r/n,n]},"hsb-rgb":function(t,e,i){var n,r=(t=(t/60%6+6)%6)-(n=Math.floor(t)),s=[i,i*(1-e),i*(1-e*r),i*(1-e*(1-r))];return[s[(n=o[n])[0]],s[n[1]],s[n[2]]]},"rgb-hsl":function(t,e,i){var n=Math.max(t,e,i),r=Math.min(t,e,i),s=n-r,a=0===s,o=(n+r)/2;return[a?0:60*(n==t?(e-i)/s+(e<i?6:0):n==e?(i-t)/s+2:(t-e)/s+4),a?0:o<.5?s/(n+r):s/(2-n-r),o]},"hsl-rgb":function(t,e,i){if(0===e)return[i,i,i];for(var n=[(t=(t/360%1+1)%1)+1/3,t,t-1/3],r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[],o=0;o<3;o++){var h=n[o];h<0&&(h+=1),h>1&&(h-=1),a[o]=6*h<1?s+6*(r-s)*h:2*h<1?r:3*h<2?s+(r-s)*(2/3-h)*6:s}return a},"rgb-gray":function(t,e,i){return[.2989*t+.587*e+.114*i]},"gray-rgb":function(t){return[t,t,t]},"gray-hsb":function(t){return[0,0,t]},"gray-hsl":function(t){return[0,0,t]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return r.each(e,(function(t,i){n[i]=[],r.each(t,(function(t,s){var a=r.capitalize(t),o=/^(hue|saturation)$/.test(t),h=n[i][s]="gradient"===i?"gradient"===t?function(t){var e=this._components[0];return e!==(t=q.read(Array.isArray(t)?t:arguments,0,{readNull:!0}))&&(e&&e._removeOwner(this),t&&t._addOwner(this)),t}:function(){return f.read(arguments,0,{readNull:"highlight"===t,clone:!0})}:function(t){return null==t||isNaN(t)?0:+t};this["get"+a]=function(){return this._type===i||o&&/^hs[bl]$/.test(this._type)?this._components[s]:this._convert(i)[s]},this["set"+a]=function(t){this._type===i||o&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(i),this._properties=e[i],this._type=i),this._components[s]=h.call(this,t),this._changed()}}),this)}),{_class:"Color",_readIndex:!0,initialize:function t(i){var s,o,h,u,l=arguments,c=this.__read,f=0;Array.isArray(i)&&(i=(l=i)[0]);var d=null!=i&&typeof i;if("string"===d&&i in e&&(s=i,i=l[1],Array.isArray(i)?(o=i,h=l[2]):(c&&(f=1),l=r.slice(l,1),d=typeof i)),!o){if(u="number"===d?l:"object"===d&&null!=i.length?i:null){s||(s=u.length>=3?"rgb":"gray");var _=e[s].length;h=u[_],c&&(f+=u===arguments?_+(null!=h?1:0):1),u.length>_&&(u=r.slice(u,0,_))}else if("string"===d){var g=a(i);s=g[0],4===(o=g[1]).length&&(h=o[3],o.length--)}else if("object"===d)if(i.constructor===t){if(s=i._type,o=i._components.slice(),h=i._alpha,"gradient"===s)for(var v=1,p=o.length;v<p;v++){var m=o[v];m&&(o[v]=m.clone())}}else if(i.constructor===q)s="gradient",u=l;else{var y=e[s="hue"in i?"lightness"in i?"hsl":"hsb":"gradient"in i||"stops"in i||"radial"in i?"gradient":"gray"in i?"gray":"rgb"],w=n[s];this._components=o=[];for(v=0,p=y.length;v<p;v++){null==(x=i[y[v]])&&!v&&"gradient"===s&&"stops"in i&&(x={stops:i.stops,radial:i.radial}),null!=(x=w[v].call(this,x))&&(o[v]=x)}h=i.alpha}c&&s&&(f=1)}if(this._type=s||"rgb",!o){this._components=o=[];for(v=0,p=(w=n[this._type]).length;v<p;v++){var x;null!=(x=w[v].call(this,u&&u[v]))&&(o[v]=x)}}return this._components=o,this._properties=e[this._type],this._alpha=h,c&&(this.__read=f),this},set:"#initialize",_serialize:function(t,e){var i=this.getComponents();return r.serialize(/^(gray|rgb)$/.test(this._type)?i:[this._type].concat(i),t,!0,e)},_changed:function(){this._canvasStyle=null,this._owner&&(this._setter?this._owner[this._setter](this):this._owner._changed(129))},_convert:function(t){var e;return this._type===t?this._components.slice():(e=h[this._type+"-"+t])?e.apply(this,this._components):h["rgb-"+t].apply(this,h[this._type+"-rgb"].apply(this,this._components))},convert:function(t){return new R(t,this._convert(t),this._alpha)},getType:function(){return this._type},setType:function(t){this._components=this._convert(t),this._properties=e[t],this._type=t},getComponents:function(){var t=this._components.slice();return null!=this._alpha&&t.push(this._alpha),t},getAlpha:function(){return null!=this._alpha?this._alpha:1},setAlpha:function(t){this._alpha=null==t?null:Math.min(Math.max(t,0),1),this._changed()},hasAlpha:function(){return null!=this._alpha},equals:function(t){var e=r.isPlainValue(t,!0)?R.read(arguments):t;return e===this||e&&this._class===e._class&&this._type===e._type&&this.getAlpha()===e.getAlpha()&&r.equals(this._components,e._components)||!1},toString:function(){for(var t=this._properties,e=[],i="gradient"===this._type,n=u.instance,r=0,s=t.length;r<s;r++){var a=this._components[r];null!=a&&e.push(t[r]+": "+(i?a:n.number(a)))}return null!=this._alpha&&e.push("alpha: "+n.number(this._alpha)),"{ "+e.join(", ")+" }"},toCSS:function(t){var e=this._convert("rgb"),i=t||null==this._alpha?1:this._alpha;function n(t){return Math.round(255*(t<0?0:t>1?1:t))}return e=[n(e[0]),n(e[1]),n(e[2])],i<1&&e.push(i<0?0:i),t?"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+e[2]).toString(16).slice(1):(4==e.length?"rgba(":"rgb(")+e.join(",")+")"},toCanvasStyle:function(t,e){if(this._canvasStyle)return this._canvasStyle;if("gradient"!==this._type)return this._canvasStyle=this.toCSS();var i,n=this._components,r=n[0],s=r._stops,a=n[1],o=n[2],h=n[3],u=e&&e.inverted();if(u&&(a=u._transformPoint(a),o=u._transformPoint(o),h&&(h=u._transformPoint(h))),r._radial){var l=o.getDistance(a);if(h){var c=h.subtract(a);c.getLength()>l&&(h=a.add(c.normalize(l-.1)))}var f=h||a;i=t.createRadialGradient(f.x,f.y,0,a.x,a.y,l)}else i=t.createLinearGradient(a.x,a.y,o.x,o.y);for(var d=0,_=s.length;d<_;d++){var g=s[d],v=g._offset;i.addColorStop(null==v?d/(_-1):v,g._color.toCanvasStyle())}return this._canvasStyle=i},transform:function(t){if("gradient"===this._type){for(var e=this._components,i=1,n=e.length;i<n;i++){var r=e[i];t._transformPoint(r,r,!0)}this._changed()}},statics:{_types:e,random:function(){var t=Math.random;return new R(t(),t(),t())},_setOwner:function(t,e,i){return t&&(t._owner&&e&&t._owner!==e&&(t=t.clone()),!t._owner^!e&&(t._owner=e||null,t._setter=i||null)),t}}})},new function(){return r.each({add:function(t,e){return t+e},subtract:function(t,e){return t-e},multiply:function(t,e){return t*e},divide:function(t,e){return t/e}},(function(t,e){this[e]=function(e){e=R.read(arguments);for(var i=this._type,n=this._components,r=e._convert(i),s=0,a=n.length;s<a;s++)r[s]=t(n[s],r[s]);return new R(i,r,null!=this._alpha?t(this._alpha,e.getAlpha()):null)}}),{})}),q=r.extend({_class:"Gradient",initialize:function(t,e){this._id=c.get(),t&&r.isPlainObject(t)&&(this.set(t),t=e=null),null==this._stops&&this.setStops(t||["white","black"]),null==this._radial&&this.setRadial("string"==typeof e&&"radial"===e||e||!1)},_serialize:function(t,e){return e.add(this,(function(){return r.serialize([this._stops,this._radial],t,!0,e)}))},_changed:function(){for(var t=0,e=this._owners&&this._owners.length;t<e;t++)this._owners[t]._changed()},_addOwner:function(t){this._owners||(this._owners=[]),this._owners.push(t)},_removeOwner:function(t){var i=this._owners?this._owners.indexOf(t):-1;-1!=i&&(this._owners.splice(i,1),this._owners.length||(this._owners=e))},clone:function(){for(var t=[],e=0,i=this._stops.length;e<i;e++)t[e]=this._stops[e].clone();return new q(t,this._radial)},getStops:function(){return this._stops},setStops:function(t){if(t.length<2)throw new Error("Gradient stop list needs to contain at least two stops.");var i=this._stops;if(i)for(var n=0,r=i.length;n<r;n++)i[n]._owner=e;for(n=0,r=(i=this._stops=V.readList(t,0,{clone:!0})).length;n<r;n++)i[n]._owner=this;this._changed()},getRadial:function(){return this._radial},setRadial:function(t){this._radial=t,this._changed()},equals:function(t){if(t===this)return!0;if(t&&this._class===t._class){var e=this._stops,i=t._stops,n=e.length;if(n===i.length){for(var r=0;r<n;r++)if(!e[r].equals(i[r]))return!1;return!0}}return!1}}),V=r.extend({_class:"GradientStop",initialize:function(t,i){var n=t,r=i;"object"==typeof t&&i===e&&(Array.isArray(t)&&"number"!=typeof t[0]?(n=t[0],r=t[1]):("color"in t||"offset"in t||"rampPoint"in t)&&(n=t.color,r=t.offset||t.rampPoint||0)),this.setColor(n),this.setOffset(r)},clone:function(){return new V(this._color.clone(),this._offset)},_serialize:function(t,e){var i=this._color,n=this._offset;return r.serialize(null==n?[i]:[i,n],t,!0,e)},_changed:function(){this._owner&&this._owner._changed(129)},getOffset:function(){return this._offset},setOffset:function(t){this._offset=t,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColor:function(){return this._color},setColor:function(){R._setOwner(this._color,null),this._color=R._setOwner(R.read(arguments,0),this,"setColor"),this._changed()},equals:function(t){return t===this||t&&this._class===t._class&&this._color.equals(t._color)&&this._offset==t._offset||!1}}),H=r.extend(new function(){var t={fillColor:null,fillRule:"nonzero",strokeColor:null,strokeWidth:1,strokeCap:"butt",strokeJoin:"miter",strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:new f,selectedColor:null},i=r.set({},t,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),n=r.set({},i,{fillColor:new R}),s={strokeWidth:193,strokeCap:193,strokeJoin:193,strokeScaling:201,miterLimit:193,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},a={beans:!0},o={_class:"Style",beans:!0,initialize:function(e,r,s){this._values={},this._owner=r,this._project=r&&r._project||s||st.project,this._defaults=!r||r instanceof b?i:r instanceof j?n:t,e&&this.set(e)}};return r.each(i,(function(t,i){var n=/Color$/.test(i),h="shadowOffset"===i,u=r.capitalize(i),l=s[i],c="set"+u,d="get"+u;o[c]=function(t){var e=this._owner,r=e&&e._children,s=r&&r.length>0&&!(e instanceof B);if(s)for(var a=0,o=r.length;a<o;a++)r[a]._style[c](t);if(("selectedColor"===i||!s)&&i in this._defaults){var h=this._values[i];h!==t&&(n&&(h&&(R._setOwner(h,null),h._canvasStyle=null),t&&t.constructor===R&&(t=R._setOwner(t,e,s&&c))),this._values[i]=t,e&&e._changed(l||129))}},o[d]=function(t){var s=this._owner,a=s&&s._children,o=a&&a.length>0&&!(s instanceof B);if(o&&!t)for(var u=0,l=a.length;u<l;u++){var _=a[u]._style[d]();if(u){if(!r.equals(g,_))return e}else g=_}else if(i in this._defaults){var g;if((g=this._values[i])===e)(g=this._defaults[i])&&g.clone&&(g=g.clone());else{var v=n?R:h?f:null;!v||g&&g.constructor===v||(this._values[i]=g=v.read([g],0,{readNull:!0,clone:!0}))}}return g&&n&&(g=R._setOwner(g,s,o&&c)),g},a[d]=function(t){return this._style[d](t)},a[c]=function(t){this._style[c](t)}})),r.each({Font:"FontFamily",WindingRule:"FillRule"},(function(t,e){var i="get"+e,n="set"+e;o[i]=a[i]="#get"+t,o[n]=a[n]="#set"+t})),x.inject(a),o},{set:function(t){var e=t instanceof H,i=e?t._values:t;if(i)for(var n in i)if(n in this._defaults){var r=i[n];this[n]=r&&e&&r.clone?r.clone():r}},equals:function(t){function i(t,i,n){var s=t._values,a=i._values,o=i._defaults;for(var h in s){var u=s[h],l=a[h];if(!(n&&h in a||r.equals(u,l===e?o[h]:l)))return!1}return!0}return t===this||t&&this._class===t._class&&i(this,t)&&i(t,this,!0)||!1},_dispose:function(){var t;(t=this.getFillColor())&&(t._canvasStyle=null),(t=this.getStrokeColor())&&(t._canvasStyle=null),(t=this.getShadowColor())&&(t._canvasStyle=null)},hasFill:function(){var t=this.getFillColor();return!!t&&t.alpha>0},hasStroke:function(){var t=this.getStrokeColor();return!!t&&t.alpha>0&&this.getStrokeWidth()>0},hasShadow:function(){var t=this.getShadowColor();return!!t&&t.alpha>0&&(this.getShadowBlur()>0||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var t=this.getFontSize();return this.getFontWeight()+" "+t+(/[a-z]/i.test(t+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function t(){var e=t.base.call(this),i=this.getFontSize();return/pt|em|%|px/.test(i)&&(i=this.getView().getPixelSize(i)),null!=e?e:1.2*i}}),Z=new function(){function t(t,e,i,n){for(var r=["","webkit","moz","Moz","ms","o"],s=e[0].toUpperCase()+e.substring(1),a=0;a<6;a++){var o=r[a],h=o?o+s:e;if(h in t){if(!i)return t[h];t[h]=n;break}}}return{getStyles:function(t){var e=t&&9!==t.nodeType?t.ownerDocument:t,i=e&&e.defaultView;return i&&i.getComputedStyle(t,"")},getBounds:function(t,e){var i,n=t.ownerDocument,r=n.body,s=n.documentElement;try{i=t.getBoundingClientRect()}catch(u){i={left:0,top:0,width:0,height:0}}var a=i.left-(s.clientLeft||r.clientLeft||0),o=i.top-(s.clientTop||r.clientTop||0);if(!e){var h=n.defaultView;a+=h.pageXOffset||s.scrollLeft||r.scrollLeft,o+=h.pageYOffset||s.scrollTop||r.scrollTop}return new v(a,o,i.width,i.height)},getViewportBounds:function(t){var e=t.ownerDocument,i=e.defaultView,n=e.documentElement;return new v(0,0,i.innerWidth||n.clientWidth,i.innerHeight||n.clientHeight)},getOffset:function(t,e){return Z.getBounds(t,e).getPoint()},getSize:function(t){return Z.getBounds(t,!0).getSize()},isInvisible:function(t){return Z.getSize(t).equals(new _(0,0))},isInView:function(t){return!Z.isInvisible(t)&&Z.getViewportBounds(t).intersects(Z.getBounds(t,!0))},isInserted:function(t){return n.body.contains(t)},getPrefixed:function(e,i){return e&&t(e,i)},setPrefixed:function(e,i,n){if("object"==typeof i)for(var r in i)t(e,r,!0,i[r]);else t(e,i,!0,n)}}},U={add:function(t,e){if(t)for(var i in e)for(var r=e[i],s=i.split(/[\s,]+/g),a=0,o=s.length;a<o;a++){var h=s[a],u=t===n&&("touchstart"===h||"touchmove"===h)&&{passive:!1};t.addEventListener(h,r,u)}},remove:function(t,e){if(t)for(var i in e)for(var n=e[i],r=i.split(/[\s,]+/g),s=0,a=r.length;s<a;s++)t.removeEventListener(r[s],n,!1)},getPoint:function(t){var e=t.targetTouches?t.targetTouches.length?t.targetTouches[0]:t.changedTouches[0]:t;return new f(e.pageX||e.clientX+n.documentElement.scrollLeft,e.pageY||e.clientY+n.documentElement.scrollTop)},getTarget:function(t){return t.target||t.srcElement},getRelatedTarget:function(t){return t.relatedTarget||t.toElement},getOffset:function(t,e){return U.getPoint(t).subtract(Z.getOffset(e||U.getTarget(t)))}};U.requestAnimationFrame=new function(){var t,e=Z.getPrefixed(i,"requestAnimationFrame"),n=!1,r=[];function s(){var t=r;r=[];for(var i=0,a=t.length;i<a;i++)t[i]();(n=e&&r.length)&&e(s)}return function(i){r.push(i),e?n||(e(s),n=!0):t||(t=setInterval(s,1e3/60))}};var W=r.extend(s,{_class:"View",initialize:function t(e,r){function s(t){return r[t]||parseInt(r.getAttribute(t),10)}function o(){var t=Z.getSize(r);return t.isNaN()||t.isZero()?new _(s("width"),s("height")):t}var h;if(i&&r){this._id=r.getAttribute("id"),null==this._id&&r.setAttribute("id",this._id="paper-view-"+t._id++),U.add(r,this._viewEvents);if(Z.setPrefixed(r.style,{userDrag:"none",userSelect:"none",touchCallout:"none",contentZooming:"none",tapHighlightColor:"rgba(0,0,0,0)"}),a.hasAttribute(r,"resize")){var u=this;U.add(i,this._windowEvents={resize:function(){u.setViewSize(o())}})}if(h=o(),a.hasAttribute(r,"stats")&&"undefined"!=typeof Stats){this._stats=new Stats;var l=this._stats.domElement,c=l.style,f=Z.getOffset(r);c.position="absolute",c.left=f.x+"px",c.top=f.y+"px",n.body.appendChild(l)}}else h=new _(r),r=null;this._project=e,this._scope=e._scope,this._element=r,this._pixelRatio||(this._pixelRatio=i&&i.devicePixelRatio||1),this._setElementSize(h.width,h.height),this._viewSize=h,t._views.push(this),t._viewsById[this._id]=this,(this._matrix=new m)._owner=this,t._focused||(t._focused=this),this._frameItems={},this._frameItemCount=0,this._itemEvents={native:{},virtual:{}},this._autoUpdate=!st.agent.node,this._needsUpdate=!1},remove:function(){if(!this._project)return!1;W._focused===this&&(W._focused=null),W._views.splice(W._views.indexOf(this),1),delete W._viewsById[this._id];var t=this._project;return t._view===this&&(t._view=null),U.remove(this._element,this._viewEvents),U.remove(i,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0},_events:r.each(x._itemHandlers.concat(["onResize","onKeyDown","onKeyUp"]),(function(t){this[t]={}}),{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,getAutoUpdate:function(){return this._autoUpdate},setAutoUpdate:function(t){this._autoUpdate=t,t&&this.requestUpdate()},update:function(){},draw:function(){this.update()},requestUpdate:function(){if(!this._requested){var t=this;U.requestAnimationFrame((function(){if(t._requested=!1,t._animate){t.requestUpdate();var e=t._element;Z.getPrefixed(n,"hidden")&&"true"!==a.getAttribute(e,"keepalive")||!Z.isInView(e)||t._handleFrame()}t._autoUpdate&&t.update()})),this._requested=!0}},play:function(){this._animate=!0,this.requestUpdate()},pause:function(){this._animate=!1},_handleFrame:function(){st=this._scope;var t=Date.now()/1e3,e=this._last?t-this._last:0;this._last=t,this.emit("frame",new r({delta:e,time:this._time+=e,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(t,e){var i=this._frameItems;e?(i[t._id]={item:t,time:0,count:0},1==++this._frameItemCount&&this.on("frame",this._handleFrameItems)):(delete i[t._id],0==--this._frameItemCount&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(t){for(var e in this._frameItems){var i=this._frameItems[e];i.item.emit("frame",new r(t,{time:i.time+=t.delta,count:i.count++}))}},_changed:function(){this._project._changed(4097),this._bounds=this._decomposed=e},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return 72*this._pixelRatio},getViewSize:function(){var t=this._viewSize;return new g(t.width,t.height,this,"setViewSize")},setViewSize:function(){var t=_.read(arguments),e=t.subtract(this._viewSize);e.isZero()||(this._setElementSize(t.width,t.height),this._viewSize.set(t),this._changed(),this.emit("resize",{size:t,delta:e}),this._autoUpdate&&this.update())},_setElementSize:function(t,e){var i=this._element;i&&(i.width!==t&&(i.width=t),i.height!==e&&(i.height=e))},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new v(new f,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return Z.isInView(this._element)},isInserted:function(){return Z.isInserted(this._element)},getPixelSize:function(t){var e,i=this._element;if(i){var r=i.parentNode,s=n.createElement("div");s.style.fontSize=t,r.appendChild(s),e=parseFloat(Z.getStyles(s).fontSize),r.removeChild(s)}else e=parseFloat(e);return e},getTextWidth:function(t,e){return 0}},r.each(["rotate","scale","shear","skew"],(function(t){var e="rotate"===t;this[t]=function(){var i=arguments,n=(e?r:f).read(i),s=f.read(i,0,{readNull:!0});return this.transform((new m)[t](n,s||this.getCenter(!0)))}}),{_decompose:function(){return this._decomposed||(this._decomposed=this._matrix.decompose())},translate:function(){var t=new m;return this.transform(t.translate.apply(t,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var t=f.read(arguments);this.translate(this.getCenter().subtract(t))},getZoom:function(){var t=this._decompose().scaling;return(t.x+t.y)/2},setZoom:function(t){this.transform((new m).scale(t/this.getZoom(),this.getCenter()))},getRotation:function(){return this._decompose().rotation},setRotation:function(t){var e=this.getRotation();null!=e&&null!=t&&this.rotate(t-e)},getScaling:function(){var t=this._decompose().scaling;return new d(t.x,t.y,this,"setScaling")},setScaling:function(){var t=this.getScaling(),e=f.read(arguments,0,{clone:!0,readNull:!0});t&&e&&this.scale(e.x/t.x,e.y/t.y)},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.set.apply(t,arguments)},transform:function(t){this._matrix.append(t)},scrollBy:function(){this.translate(f.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(f.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(f.read(arguments))},getEventPoint:function(t){return this.viewToProject(U.getOffset(t,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(t,e){return n&&"string"==typeof e&&(e=n.getElementById(e)),new(i?G:W)(t,e)}}},new function(){if(i){var t,e,r,s,a,o=!1,h=!1,u=i.navigator;u.pointerEnabled||u.msPointerEnabled?(r="pointerdown MSPointerDown",s="pointermove MSPointerMove",a="pointerup pointercancel MSPointerUp MSPointerCancel"):(r="touchstart",s="touchmove",a="touchend touchcancel","ontouchstart"in i&&u.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(r+=" mousedown",s+=" mousemove",a+=" mouseup"));var l={},c={mouseout:function(t){var e=W._focused,i=U.getRelatedTarget(t);if(e&&(!i||"HTML"===i.nodeName)){var n=U.getOffset(t,e._element),r=n.x,s=Math.abs,a=s(r),o=a-(1<<25);n.x=s(o)<a?o*(r<0?-1:1):r,M(e,t,e.viewToProject(n))}},scroll:I};l[r]=function(t){var e=W._focused=P(t);o||(o=!0,e._handleMouseEvent("mousedown",t))},c[s]=function(i){var n=W._focused;if(!h){var r=P(i);r?n!==r&&(n&&M(n,i),t||(t=n),n=W._focused=e=r):e&&e===n&&(t&&!t.isInserted()&&(t=null),n=W._focused=t,t=null,I())}n&&M(n,i)},c[r]=function(){h=!0},c[a]=function(t){var e=W._focused;e&&o&&e._handleMouseEvent("mouseup",t),h=o=!1},U.add(n,c),U.add(i,{load:I});var f,d,_,g,v,p,m,y,w=!1,x=!1,b={doubleclick:"click",mousedrag:"mousemove"},S=!1,C={mousedown:{mousedown:1,mousedrag:1,click:1,doubleclick:1},mouseup:{mouseup:1,mousedrag:1,click:1,doubleclick:1},mousemove:{mousedrag:1,mousemove:1,mouseenter:1,mouseleave:1}};return{_viewEvents:l,_handleMouseEvent:function(t,e,i){var n=this._itemEvents,r=n.native[t],s="mousemove"===t,a=this._scope.tool,h=this;function u(t){return n.virtual[t]||h.responds(t)||a&&a.responds(t)}s&&o&&u("mousedrag")&&(t="mousedrag"),i||(i=this.getEventPoint(e));var l=this.getBounds().contains(i),c=r&&l&&h._project.hitTest(i,{tolerance:0,fill:!0,stroke:!0}),b=c&&c.item||null,C=!1,P={};if(P[t.substr(5)]=!0,r&&b!==g&&(g&&T(g,null,"mouseleave",e,i),b&&T(b,null,"mouseenter",e,i),g=b),S^l&&(T(this,null,l?"mouseenter":"mouseleave",e,i),l?this:null,C=!0),!l&&!P.drag||i.equals(d)||(O(this,b,s?t:"mousemove",e,i,d),C=!0),S=l,P.down&&l||P.up&&f){if(O(this,b,t,e,i,f),P.down){if(y=b===p&&Date.now()-m<300,_=p=b,!x&&b){for(var I=b;I&&!I.responds("mousedrag");)I=I._parent;I&&(v=b)}f=i}else P.up&&(x||b!==_||(m=Date.now(),O(this,b,y?"doubleclick":"click",e,i,f),y=!1),_=v=null);S=!1,C=!0}d=i,C&&a&&(w=a._handleMouseEvent(t,e,i,P)||w),!1!==e.cancelable&&(w&&!P.move||P.down&&u("mouseup"))&&e.preventDefault()},_handleKeyEvent:function(t,e,i,n){var r,s=this._scope,a=s.tool;function o(a){a.responds(t)&&(st=s,a.emit(t,r=r||new J(t,e,i,n)))}this.isVisible()&&(o(this),a&&a.responds(t)&&o(a))},_countItemEvent:function(t,e){var i=this._itemEvents,n=i.native,r=i.virtual;for(var s in C)n[s]=(n[s]||0)+(C[s][t]||0)*e;r[t]=(r[t]||0)+e},statics:{updateFocus:I,_resetState:function(){o=h=w=S=!1,t=e=f=d=_=g=v=p=m=y=null}}}}function P(t){var e=U.getTarget(t);return e.getAttribute&&W._viewsById[e.getAttribute("id")]}function I(){var t=W._focused;if(!t||!t.isVisible())for(var i=0,n=W._views.length;i<n;i++)if((t=W._views[i]).isVisible()){W._focused=e=t;break}}function M(t,e,i){t._handleMouseEvent("mousemove",e,i)}function T(t,e,i,n,r,s,a){var o,h=!1;function u(t,i){if(t.responds(i)){if(o||(o=new Q(i,n,r,e||t,s?r.subtract(s):null)),t.emit(i,o)&&(w=!0,o.prevented&&(x=!0),o.stopped))return h=!0}else{var a=b[i];if(a)return u(t,a)}}for(;t&&t!==a&&!u(t,i);)t=t._parent;return h}function O(t,e,i,n,r,s){return t._project.removeOn(i),x=w=!1,v&&T(v,null,i,n,r,s)||e&&e!==v&&!e.isDescendant(v)&&T(e,null,"mousedrag"===i?"mousemove":i,n,r,s,v)||T(t,v||e||t,i,n,r,s)}}),G=W.extend({_class:"CanvasView",initialize:function(t,e){if(!(e instanceof i.HTMLCanvasElement)){var n=_.read(arguments,1);if(n.isZero())throw new Error("Cannot create CanvasView with the provided argument: "+r.slice(arguments,1));e=et.getCanvas(n)}var s=this._context=e.getContext("2d");if(s.save(),this._pixelRatio=1,!/^off|false$/.test(a.getAttribute(e,"hidpi"))){var o=i.devicePixelRatio||1,h=Z.getPrefixed(s,"backingStorePixelRatio")||1;this._pixelRatio=o/h}W.call(this,t,e),this._needsUpdate=!0},remove:function t(){return this._context.restore(),t.base.call(this)},_setElementSize:function t(e,i){var n=this._pixelRatio;if(t.base.call(this,e*n,i*n),1!==n){var r=this._element,s=this._context;if(!a.hasAttribute(r,"resize")){var o=r.style;o.width=e+"px",o.height=i+"px"}s.restore(),s.save(),s.scale(n,n)}},getContext:function(){return this._context},getPixelSize:function t(e){var i,n=st.agent;if(n&&n.firefox)i=t.base.call(this,e);else{var r=this._context,s=r.font;r.font=e+" serif",i=parseFloat(r.font),r.font=s}return i},getTextWidth:function(t,e){var i=this._context,n=i.font,r=0;i.font=t;for(var s=0,a=e.length;s<a;s++)r=Math.max(r,i.measureText(e[s]).width);return i.font=n,r},update:function(){if(!this._needsUpdate)return!1;var t=this._project,e=this._context,i=this._viewSize;return e.clearRect(0,0,i.width+1,i.height+1),t&&t.draw(e,this._matrix,this._pixelRatio),this._needsUpdate=!1,!0}}),$=r.extend({_class:"Event",initialize:function(t){this.event=t,this.type=t&&t.type},prevented:!1,stopped:!1,preventDefault:function(){this.prevented=!0,this.event.preventDefault()},stopPropagation:function(){this.stopped=!0,this.event.stopPropagation()},stop:function(){this.stopPropagation(),this.preventDefault()},getTimeStamp:function(){return this.event.timeStamp},getModifiers:function(){return K.modifiers}}),J=$.extend({_class:"KeyEvent",initialize:function(t,e,i,n){this.type=t,this.event=e,this.key=i,this.character=n},toString:function(){return"{ type: '"+this.type+"', key: '"+this.key+"', character: '"+this.character+"', modifiers: "+this.getModifiers()+" }"}}),K=new function(){var t,s,a={"\t":"tab"," ":"space","\b":"backspace","":"delete",Spacebar:"space",Del:"delete",Win:"meta",Esc:"escape"},o={tab:"\t",space:" ",enter:"\r"},h={},u={},l=new r({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var t=st&&st.agent;return t&&t.mac?this.meta:this.control}}});function c(t){var i=t.key||t.keyIdentifier;return i=/^U\+/.test(i)?String.fromCharCode(parseInt(i.substr(2),16)):/^Arrow[A-Z]/.test(i)?i.substr(5):"Unidentified"===i||i===e?String.fromCharCode(t.keyCode):i,a[i]||(i.length>1?r.hyphenate(i):i.toLowerCase())}function f(e,i,n,s){var a,o=W._focused;if(h[i]=e,e?u[i]=n:delete u[i],i.length>1&&(a=r.camelize(i))in l){l[a]=e;var c=st&&st.agent;if("meta"===a&&c&&c.mac)if(e)t={};else{for(var d in t)d in u&&f(!1,d,t[d],s);t=null}}else e&&t&&(t[i]=n);o&&o._handleKeyEvent(e?"keydown":"keyup",s,i,n)}return U.add(n,{keydown:function(t){var e=c(t),i=st&&st.agent;e.length>1||i&&i.chrome&&(t.altKey||i.mac&&t.metaKey||!i.mac&&t.ctrlKey)?f(!0,e,o[e]||(e.length>1?"":e),t):s=e},keypress:function(t){if(s){var e=c(t),i=t.charCode,n=i>=32?String.fromCharCode(i):e.length>1?"":e;e!==s&&(e=n.toLowerCase()),f(!0,e,n,t),s=null}},keyup:function(t){var e=c(t);e in u&&f(!1,e,u[e],t)}}),U.add(i,{blur:function(t){for(var e in u)f(!1,e,u[e],t)}}),{modifiers:l,isDown:function(t){return!!h[t]}}},Q=$.extend({_class:"MouseEvent",initialize:function(t,e,i,n,r){this.type=t,this.event=e,this.point=i,this.target=n,this.delta=r},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),X=$.extend({_class:"ToolEvent",_item:null,initialize:function(t,e,i){this.tool=t,this.type=e,this.event=i},_choosePoint:function(t,e){return t||(e?e.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(t){this._point=t},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(t){this._lastPoint=t},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(t){this._downPoint=t},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(t){this._middlePoint=t},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(t){this._delta=t},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?"_downCount":"_moveCount"]},setCount:function(t){this.tool[/^mouse(down|up)$/.test(this.type)?"downCount":"count"]=t},getItem:function(){if(!this._item){var t=this.tool._scope.project.hitTest(this.getPoint());if(t){for(var e=t.item,i=e._parent;/^(Group|CompoundPath)$/.test(i._class);)e=i,i=i._parent;this._item=e}}return this._item},setItem:function(t){this._item=t},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),Y=(o.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(t){o.call(this),this._moveCount=-1,this._downCount=-1,this.set(t)},getMinDistance:function(){return this._minDistance},setMinDistance:function(t){this._minDistance=t,null!=t&&null!=this._maxDistance&&t>this._maxDistance&&(this._maxDistance=t)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(t){this._maxDistance=t,null!=this._minDistance&&null!=t&&t<this._minDistance&&(this._minDistance=t)},getFixedDistance:function(){return this._minDistance==this._maxDistance?this._minDistance:null},setFixedDistance:function(t){this._minDistance=this._maxDistance=t},_handleMouseEvent:function(t,e,i,n){st=this._scope,n.drag&&!this.responds(t)&&(t="mousemove");var r=n.move||n.drag,s=this.responds(t),a=this.minDistance,o=this.maxDistance,h=!1,u=this;function l(t,e){var s=i,a=r?u._point:u._downPoint||s;if(r){if(u._moveCount>=0&&s.equals(a))return!1;if(a&&(null!=t||null!=e)){var o=s.subtract(a),h=o.getLength();if(h<(t||0))return!1;e&&(s=a.add(o.normalize(Math.min(h,e))))}u._moveCount++}return u._point=s,u._lastPoint=a||s,n.down&&(u._moveCount=-1,u._downPoint=s,u._downCount++),!0}function c(){s&&(h=u.emit(t,new X(u,t,e))||h)}if(n.down)l(),c();else if(n.up)l(null,o),c();else if(s)for(;l(a,o);)c();return h}}),r.extend(s,{_class:"Tween",statics:{easings:new r({linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:2*(2-t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}})},initialize:function t(e,i,n,r,s,a){this.object=e;var o=typeof s,h="function"===o;this.type=h?o:"string"===o?s:"linear",this.easing=h?s:t.easings[this.type],this.duration=r,this.running=!1,this._then=null,this._startTime=null;var u=i||n;this._keys=u?Object.keys(u):[],this._parsedKeys=this._parseKeys(this._keys),this._from=u&&this._getState(i),this._to=u&&this._getState(n),!1!==a&&this.start()},then:function(t){return this._then=t,this},start:function(){return this._startTime=null,this.running=!0,this},stop:function(){return this.running=!1,this},update:function(t){if(this.running){t>=1&&(t=1,this.running=!1);for(var e=this.easing(t),i=this._keys,n=function(i){return"function"==typeof i?i(e,t):i},s=0,a=i&&i.length;s<a;s++){var o=i[s],h=n(this._from[o]),u=n(this._to[o]),l=h&&u&&h.__add&&u.__add?u.__subtract(h).__multiply(e).__add(h):(u-h)*e+h;this._setProperty(this._parsedKeys[o],l)}this.responds("update")&&this.emit("update",new r({progress:t,factor:e})),!this.running&&this._then&&this._then(this.object)}return this},_events:{onUpdate:{}},_handleFrame:function(t){var e=this._startTime,i=e?(t-e)/this.duration:0;e||(this._startTime=t),this.update(i)},_getState:function(t){for(var e=this._keys,i={},n=0,r=e.length;n<r;n++){var s,a=e[n],o=this._parsedKeys[a],h=this._getProperty(o);if(t){var u=this._resolveValue(h,t[a]);this._setProperty(o,u),s=(s=this._getProperty(o))&&s.clone?s.clone():s,this._setProperty(o,h)}else s=h&&h.clone?h.clone():h;i[a]=s}return i},_resolveValue:function(t,e){if(e){if(Array.isArray(e)&&2===e.length){var i=e[0];return i&&i.match&&i.match(/^[+\-\*\/]=/)?this._calculate(t,i[0],e[1]):e}if("string"==typeof e){var n=e.match(/^[+\-*/]=(.*)/);if(n){var r=JSON.parse(n[1].replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": '));return this._calculate(t,e[0],r)}}}return e},_calculate:function(t,e,i){return st.PaperScript.calculateBinary(t,e,i)},_parseKeys:function(t){for(var e={},i=0,n=t.length;i<n;i++){var r=t[i],s=r.replace(/\.([^.]*)/g,"/$1").replace(/\[['"]?([^'"\]]*)['"]?\]/g,"/$1");e[r]=s.split("/")}return e},_getProperty:function(t,e){for(var i=this.object,n=0,r=t.length-(e||0);n<r&&i;n++)i=i[t[n]];return i},_setProperty:function(t,e){var i=this._getProperty(t,1);i&&(i[t[t.length-1]]=e)}})),tt=function(e){var i=new t.XMLHttpRequest;return i.open((e.method||"get").toUpperCase(),e.url,r.pick(e.async,!0)),e.mimeType&&i.overrideMimeType(e.mimeType),i.onload=function(){var t=i.status;0===t||200===t?e.onLoad&&e.onLoad.call(i,i.responseText):i.onerror()},i.onerror=function(){var t=i.status,n='Could not load "'+e.url+'" (Status: '+t+")";if(!e.onError)throw new Error(n);e.onError(n,t)},i.send(null)},et=r.exports.CanvasProvider={canvases:[],getCanvas:function(t,e,r){if(!i)return null;var s,a=!0;"object"==typeof t&&(e=t.height,t=t.width),this.canvases.length?s=this.canvases.pop():(s=n.createElement("canvas"),a=!1);var o=s.getContext("2d",r||{});if(!o)throw new Error("Canvas "+s+" is unable to provide a 2D context.");return s.width===t&&s.height===e?a&&o.clearRect(0,0,t+1,e+1):(s.width=t,s.height=e),o.save(),s},getContext:function(t,e,i){var n=this.getCanvas(t,e,i);return n?n.getContext("2d",i||{}):null},release:function(t){var e=t&&t.canvas?t.canvas:t;e&&e.getContext&&(e.getContext("2d").restore(),this.canvases.push(e))}},it=new function(){var t,e,i,n,s,a,o,h,u,l,c,f=Math.min,d=Math.max,_=Math.abs;function g(t,e,i){return.2989*t+.587*e+.114*i}function v(t,e,i,n){var r=n-g(t,e,i),s=(n=g(u=t+r,l=e+r,c=i+r),f(u,l,c)),a=d(u,l,c);if(s<0){var o=n-s;u=n+(u-n)*n/o,l=n+(l-n)*n/o,c=n+(c-n)*n/o}if(a>255){var h=255-n,_=a-n;u=n+(u-n)*h/_,l=n+(l-n)*h/_,c=n+(c-n)*h/_}}function p(t,e,i){return d(t,e,i)-f(t,e,i)}function m(t,e,i,n){var r,s=[t,e,i],a=d(t,e,i),o=f(t,e,i);r=0===f(o=o===t?0:o===e?1:2,a=a===t?0:a===e?1:2)?1===d(o,a)?2:1:0,s[a]>s[o]?(s[r]=(s[r]-s[o])*n/(s[a]-s[o]),s[a]=n):s[r]=s[a]=0,s[o]=0,u=s[0],l=s[1],c=s[2]}var y={multiply:function(){u=s*t/255,l=a*e/255,c=o*i/255},screen:function(){u=s+t-s*t/255,l=a+e-a*e/255,c=o+i-o*i/255},overlay:function(){u=s<128?2*s*t/255:255-2*(255-s)*(255-t)/255,l=a<128?2*a*e/255:255-2*(255-a)*(255-e)/255,c=o<128?2*o*i/255:255-2*(255-o)*(255-i)/255},"soft-light":function(){var n=t*s/255;u=n+s*(255-(255-s)*(255-t)/255-n)/255,l=(n=e*a/255)+a*(255-(255-a)*(255-e)/255-n)/255,c=(n=i*o/255)+o*(255-(255-o)*(255-i)/255-n)/255},"hard-light":function(){u=t<128?2*t*s/255:255-2*(255-t)*(255-s)/255,l=e<128?2*e*a/255:255-2*(255-e)*(255-a)/255,c=i<128?2*i*o/255:255-2*(255-i)*(255-o)/255},"color-dodge":function(){u=0===s?0:255===t?255:f(255,255*s/(255-t)),l=0===a?0:255===e?255:f(255,255*a/(255-e)),c=0===o?0:255===i?255:f(255,255*o/(255-i))},"color-burn":function(){u=255===s?255:0===t?0:d(0,255-255*(255-s)/t),l=255===a?255:0===e?0:d(0,255-255*(255-a)/e),c=255===o?255:0===i?0:d(0,255-255*(255-o)/i)},darken:function(){u=s<t?s:t,l=a<e?a:e,c=o<i?o:i},lighten:function(){u=s>t?s:t,l=a>e?a:e,c=o>i?o:i},difference:function(){(u=s-t)<0&&(u=-u),(l=a-e)<0&&(l=-l),(c=o-i)<0&&(c=-c)},exclusion:function(){u=s+t*(255-s-s)/255,l=a+e*(255-a-a)/255,c=o+i*(255-o-o)/255},hue:function(){m(t,e,i,p(s,a,o)),v(u,l,c,g(s,a,o))},saturation:function(){m(s,a,o,p(t,e,i)),v(u,l,c,g(s,a,o))},luminosity:function(){v(s,a,o,g(t,e,i))},color:function(){v(t,e,i,g(s,a,o))},add:function(){u=f(s+t,255),l=f(a+e,255),c=f(o+i,255)},subtract:function(){u=d(s-t,0),l=d(a-e,0),c=d(o-i,0)},average:function(){u=(s+t)/2,l=(a+e)/2,c=(o+i)/2},negation:function(){u=255-_(255-t-s),l=255-_(255-e-a),c=255-_(255-i-o)}},w=this.nativeModes=r.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],(function(t){this[t]=!0}),{}),x=et.getContext(1,1,{willReadFrequently:!0});x&&(r.each(y,(function(t,e){var i="darken"===e,n=!1;x.save();try{x.fillStyle=i?"#300":"#a00",x.fillRect(0,0,1,1),x.globalCompositeOperation=e,x.globalCompositeOperation===e&&(x.fillStyle=i?"#a00":"#300",x.fillRect(0,0,1,1),n=x.getImageData(0,0,1,1).data[0]!==i?170:51)}catch(r){}x.restore(),w[e]=n})),et.release(x)),this.process=function(r,f,d,_,g){var v=f.canvas,p="normal"===r;if(p||w[r])d.save(),d.setTransform(1,0,0,1,0,0),d.globalAlpha=_,p||(d.globalCompositeOperation=r),d.drawImage(v,g.x,g.y),d.restore();else{var m=y[r];if(!m)return;for(var x=d.getImageData(g.x,g.y,v.width,v.height),b=x.data,S=f.getImageData(0,0,v.width,v.height).data,C=0,P=b.length;C<P;C+=4){t=S[C],s=b[C],e=S[C+1],a=b[C+1],i=S[C+2],o=b[C+2],n=S[C+3],h=b[C+3],m();var I=n*_/255,M=1-I;b[C]=I*u+M*s,b[C+1]=I*l+M*a,b[C+2]=I*c+M*o,b[C+3]=n*_+M*h}d.putImageData(x,g.x,g.y)}}},nt=new function(){var t="http://www.w3.org/2000/svg",e="http://www.w3.org/2000/xmlns",i="http://www.w3.org/1999/xlink",r={href:i,xlink:e,xmlns:e+"/","xmlns:xlink":e+"/"};function s(t,e,i){for(var n in e){var s=e[n],a=r[n];"number"==typeof s&&i&&(s=i.number(s)),a?t.setAttributeNS(a,n,s):t.setAttribute(n,s)}return t}return{svg:t,xmlns:e,xlink:i,create:function(e,i,r){return s(n.createElementNS(t,e),i,r)},get:function(t,e){var i=r[e],n=i?t.getAttributeNS(i,e):t.getAttribute(e);return"null"===n?null:n},set:s}},rt=r.each({fillColor:["fill","color"],fillRule:["fill-rule","string"],strokeColor:["stroke","color"],strokeWidth:["stroke-width","number"],strokeCap:["stroke-linecap","string"],strokeJoin:["stroke-linejoin","string"],strokeScaling:["vector-effect","lookup",{true:"none",false:"non-scaling-stroke"},function(t,e){return!e&&(t instanceof L||t instanceof C||t instanceof j)}],miterLimit:["stroke-miterlimit","number"],dashArray:["stroke-dasharray","array"],dashOffset:["stroke-dashoffset","number"],fontFamily:["font-family","string"],fontWeight:["font-weight","string"],fontSize:["font-size","number"],justification:["text-anchor","lookup",{left:"start",center:"middle",right:"end"}],opacity:["opacity","number"],blendMode:["mix-blend-mode","style"]},(function(t,e){var i=r.capitalize(e),n=t[2];this[e]={type:t[1],property:e,attribute:t[0],toSVG:n,fromSVG:n&&r.each(n,(function(t,e){this[t]=e}),{}),exportFilter:t[3],get:"get"+i,set:"set"+i}}),{});new function(){var e;function i(t,i,n){var s,a=new r,o=t.getTranslation();i&&(t.isInvertible()?(s=(t=t._shiftless())._inverseTransform(o),o=null):s=new f,a[n?"cx":"x"]=s.x,a[n?"cy":"y"]=s.y);if(!t.isIdentity()){var h=t.decompose();if(h){var u=[],c=h.rotation,d=h.scaling,_=h.skewing;o&&!o.isZero()&&u.push("translate("+e.point(o)+")"),c&&u.push("rotate("+e.number(c)+")"),l.isZero(d.x-1)&&l.isZero(d.y-1)||u.push("scale("+e.point(d)+")"),_.x&&u.push("skewX("+e.number(_.x)+")"),_.y&&u.push("skewY("+e.number(_.y)+")"),a.transform=u.join(" ")}else a.transform="matrix("+t.getValues().join(",")+")"}return a}function n(t,n){for(var r=i(t._matrix),s=t._children,a=nt.create("g",r,e),o=0,h=s.length;o<h;o++){var u=s[o],l=p(u,n);if(l)if(u.isClipMask()){var c=nt.create("clipPath");c.appendChild(l),_(u,c,"clip"),nt.set(a,{"clip-path":"url(#"+c.id+")"})}else a.appendChild(l)}return a}function s(t){var n=t._type,r=t._radius,s=i(t._matrix,!0,"rectangle"!==n);if("rectangle"===n){n="rect";var a=t._size,o=a.width,h=a.height;s.x-=o/2,s.y-=h/2,s.width=o,s.height=h,r.isZero()&&(r=null)}return r&&("circle"===n?s.r=r:(s.rx=r.width,s.ry=r.height)),nt.create(n,s,e)}var a,o={Group:n,Layer:n,Raster:function(t,n){var r=i(t._matrix,!0),s=t.getSize(),a=t.getImage();return r.x-=s.width/2,r.y-=s.height/2,r.width=s.width,r.height=s.height,r.href=0==n.embedImages&&a&&a.src||t.toDataURL(),nt.create("image",r,e)},Path:function(t,n){var r=n.matchShapes;if(r){var a=t.toShape(!1);if(a)return s(a)}var o,h=t._segments,u=h.length,l=i(t._matrix);if(r&&u>=2&&!t.hasHandles())if(u>2){o=t._closed?"polygon":"polyline";for(var c=[],f=0;f<u;f++)c.push(e.point(h[f]._point));l.points=c.join(" ")}else{o="line";var d=h[0]._point,_=h[1]._point;l.set({x1:d.x,y1:d.y,x2:_.x,y2:_.y})}else o="path",l.d=t.getPathData(null,n.precision);return nt.create(o,l,e)},Shape:s,CompoundPath:function(t,n){var r=i(t._matrix),s=t.getPathData(null,n.precision);return s&&(r.d=s),nt.create("path",r,e)},SymbolItem:function(t,n){var r=i(t._matrix,!0),s=t._definition,a=d(s,"symbol"),o=s._item,h=o.getStrokeBounds();return a||((a=nt.create("symbol",{viewBox:e.rectangle(h)})).appendChild(p(o,n)),_(s,a,"symbol")),r.href="#"+a.id,r.x+=h.x,r.y+=h.y,r.width=h.width,r.height=h.height,r.overflow="visible",nt.create("use",r,e)},PointText:function(t){var n=nt.create("text",i(t._matrix,!0),e);return n.textContent=t._content,n}};function h(t,i,n){var s={},a=!n&&t.getParent(),o=[];return null!=t._name&&(s.id=t._name),r.each(rt,(function(i){var n=i.get,h=i.type,u=t[n]();if(i.exportFilter?i.exportFilter(t,u):!a||!r.equals(a[n](),u)){if("color"===h&&null!=u){var l=u.getAlpha();l<1&&(s[i.attribute+"-opacity"]=l)}"style"===h?o.push(i.attribute+": "+u):s[i.attribute]=null==u?"none":"color"===h?u.gradient?function(t){var i=d(t,"color");if(!i){var n,r=t.getGradient(),s=r._radial,a=t.getOrigin(),o=t.getDestination();if(s){n={cx:a.x,cy:a.y,r:a.getDistance(o)};var h=t.getHighlight();h&&(n.fx=h.x,n.fy=h.y)}else n={x1:a.x,y1:a.y,x2:o.x,y2:o.y};n.gradientUnits="userSpaceOnUse",i=nt.create((s?"radial":"linear")+"Gradient",n,e);for(var u=r._stops,l=0,c=u.length;l<c;l++){var f=u[l],g=f._color,v=g.getAlpha(),p=f._offset;n={offset:null==p?l/(c-1):p},g&&(n["stop-color"]=g.toCSS(!0)),v<1&&(n["stop-opacity"]=v),i.appendChild(nt.create("stop",n,e))}_(t,i,"color")}return"url(#"+i.id+")"}(u):u.toCSS(!0):"array"===h?u.join(","):"lookup"===h?i.toSVG[u]:u}})),o.length&&(s.style=o.join(";")),1===s.opacity&&delete s.opacity,t._visible||(s.visibility="hidden"),nt.set(i,s,e)}function d(t,e){return a||(a={ids:{},svgs:{}}),t&&a.svgs[e+"-"+(t._id||t.__id||(t.__id=c.get("svg")))]}function _(t,e,i){a||d();var n=a.ids[i]=(a.ids[i]||0)+1;e.id=i+"-"+n,a.svgs[i+"-"+(t._id||t.__id)]=e}function g(e,i){var n=e,r=null;if(a){for(var s in n="svg"===e.nodeName.toLowerCase()&&e,a.svgs)r||(n||(n=nt.create("svg")).appendChild(e),r=n.insertBefore(nt.create("defs"),n.firstChild)),r.appendChild(a.svgs[s]);a=null}return i.asString?(new t.XMLSerializer).serializeToString(n):n}function p(t,e,i){var n=o[t._class],r=n&&n(t,e);if(r){var s=e.onExport;s&&(r=s(t,r,e)||r);var a=JSON.stringify(t._data);a&&"{}"!==a&&"null"!==a&&r.setAttribute("data-paper-data",a)}return r&&h(t,r,i)}function y(t){return t||(t={}),e=new u(t.precision),t}x.inject({exportSVG:function(t){return g(p(this,t=y(t),!0),t)}}),w.inject({exportSVG:function(t){t=y(t);var n=this._children,s=this.getView(),a=r.pick(t.bounds,"view"),o=t.matrix||"view"===a&&s._matrix,h=o&&m.read([o]),u="view"===a?new v([0,0],s.getViewSize()):"content"===a?x._getBounds(n,h,{stroke:!0}).rect:v.read([a],0,{readNull:!0}),l={version:"1.1",xmlns:nt.svg,"xmlns:xlink":nt.xlink};u&&(l.width=u.width,l.height=u.height,(u.x||0===u.x||u.y||0===u.y)&&(l.viewBox=e.rectangle(u)));var c=nt.create("svg",l,e),f=c;h&&!h.isIdentity()&&(f=c.appendChild(nt.create("g",i(h),e)));for(var d=0,_=n.length;d<_;d++)f.appendChild(p(n[d],t,!0));return g(c,t)}})},new function(){var s,a={};function o(t,e,i,n,r,a){var o=nt.get(t,e)||a,h=null==o?n?null:i?"":0:i?o:parseFloat(o);return/%\s*$/.test(o)?h/100*(r?1:s[/x|^width/.test(e)?"width":"height"]):h}function h(t,e,i,n,r,s,a){return e=o(t,e||"x",!1,n,r,s),i=o(t,i||"y",!1,n,r,a),!n||null!=e&&null!=i?new f(e,i):null}function u(t,e,i,n,r){return e=o(t,e||"width",!1,n,r),i=o(t,i||"height",!1,n,r),!n||null!=e&&null!=i?new _(e,i):null}function l(t,e,i){return"none"===t?null:"number"===e?parseFloat(t):"array"===e?t?t.split(/[\s,]+/g).map(parseFloat):[]:"color"===e?z(t)||t:"lookup"===e?i[t]:t}function c(t,e,i,n){var r=t.childNodes,s="clippath"===e,a="defs"===e,o=new b,h=o._project,u=h._currentStyle,l=[];if(s||a||(o=O(o,t,n),h._currentStyle=o._style.clone()),n)for(var c=t.querySelectorAll("defs"),f=0,d=c.length;f<d;f++)k(c[f],i,!1);for(f=0,d=r.length;f<d;f++){var _,g=r[f];1!==g.nodeType||/^defs$/i.test(g.nodeName)||!(_=k(g,i,!1))||_ instanceof M||l.push(_)}return o.addChildren(l),s&&(o=O(o.reduce(),t,n)),h._currentStyle=u,(s||a)&&(o.remove(),o=null),o}function d(t,e){for(var i=t.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),n=[],r=0,s=i.length;r<s;r+=2)n.push(new f(parseFloat(i[r]),parseFloat(i[r+1])));var a=new N(n);return"polygon"===e&&a.closePath(),a}function g(t,e){var i,n=(o(t,"href",!0)||"").substring(1),r="radialgradient"===e;if(n)(i=a[n].getGradient())._radial^r&&((i=i.clone())._radial=r);else{for(var s=t.childNodes,u=[],l=0,c=s.length;l<c;l++){var f=s[l];1===f.nodeType&&u.push(O(new V,f))}i=new q(u,r)}var d,_,g,v="userSpaceOnUse"!==o(t,"gradientUnits",!0);return r?(_=(d=h(t,"cx","cy",!1,v,"50%","50%")).add(o(t,"r",!1,!1,v,"50%"),0),g=h(t,"fx","fy",!0,v)):(d=h(t,"x1","y1",!1,v,"0%","0%"),_=h(t,"x2","y2",!1,v,"100%","0%")),O(new R(i,d,_,g),t)._scaleToBounds=v,null}var p={"#document":function(t,e,i,n){for(var r=t.childNodes,s=0,a=r.length;s<a;s++){var o=r[s];if(1===o.nodeType)return k(o,i,n)}},g:c,svg:c,clippath:c,polygon:d,polyline:d,path:function(t){return L.create(t.getAttribute("d"))},lineargradient:g,radialgradient:g,image:function(t){var e=new P(o(t,"href",!0));return e.on("load",(function(){var e=u(t);this.setSize(e);var i=h(t).add(e.divide(2));this._matrix.append((new m).translate(i))})),e},symbol:function(t,e,i,n){return new M(c(t,e,i,n),!0)},defs:c,use:function(t){var e=(o(t,"href",!0)||"").substring(1),i=a[e],n=h(t);return i?i instanceof M?i.place(n):i.clone().translate(n):null},circle:function(t){return new C.Circle(h(t,"cx","cy"),o(t,"r"))},ellipse:function(t){return new C.Ellipse({center:h(t,"cx","cy"),radius:u(t,"rx","ry")})},rect:function(t){return new C.Rectangle(new v(h(t),u(t)),u(t,"rx","ry"))},line:function(t){return new N.Line(h(t,"x1","y1"),h(t,"x2","y2"))},text:function(t){var e=new D(h(t).add(h(t,"dx","dy")));return e.setContent(t.textContent.trim()||""),e},switch:c};function y(t,e,i,n){if(t.transform){for(var r=(n.getAttribute(i)||"").split(/\)\s*/g),s=new m,a=0,o=r.length;a<o;a++){var h=r[a];if(!h)break;for(var u=h.split(/\(\s*/),l=u[0],c=u[1].split(/[\s,]+/g),f=0,d=c.length;f<d;f++)c[f]=parseFloat(c[f]);switch(l){case"matrix":s.append(new m(c[0],c[1],c[2],c[3],c[4],c[5]));break;case"rotate":s.rotate(c[0],c[1]||0,c[2]||0);break;case"translate":s.translate(c[0],c[1]||0);break;case"scale":s.scale(c);break;case"skewX":s.skew(c[0],0);break;case"skewY":s.skew(0,c[0])}}t.transform(s)}}function S(t,e,i){var n="fill-opacity"===i?"getFillColor":"getStrokeColor",r=t[n]&&t[n]();r&&r.setAlpha(parseFloat(e))}var I=r.set(r.each(rt,(function(t){this[t.attribute]=function(e,i){if(e[t.set]&&(e[t.set](l(i,t.type,t.fromSVG)),"color"===t.type)){var n=e[t.get]();if(n&&n._scaleToBounds){var r=e.getBounds();n.transform((new m).translate(r.getPoint()).scale(r.getSize()))}}}}),{}),{id:function(t,e){a[e]=t,t.setName&&t.setName(e)},"clip-path":function(t,e){var i=z(e);if(i){if((i=i.clone()).setClipMask(!0),!(t instanceof b))return new b(i,t);t.insertChild(0,i)}},gradientTransform:y,transform:y,"fill-opacity":S,"stroke-opacity":S,visibility:function(t,e){t.setVisible&&t.setVisible("visible"===e)},display:function(t,e){t.setVisible&&t.setVisible(null!==e)},"stop-color":function(t,e){t.setColor&&t.setColor(e)},"stop-opacity":function(t,e){t._color&&t._color.setAlpha(parseFloat(e))},offset:function(t,e){if(t.setOffset){var i=e.match(/(.*)%$/);t.setOffset(i?i[1]/100:parseFloat(e))}},viewBox:function(t,e,i,n,r){var s,a=new v(l(e,"array")),o=u(n,null,null,!0);if(t instanceof b){var h=o?o.divide(a.getSize()):1,c=(new m).scale(h).translate(a.getPoint().negate());s=t}else t instanceof M&&(o&&a.setSize(o),s=t._item);if(s){if("visible"!==T(n,"overflow",r)){var f=new C.Rectangle(a);f.setClipMask(!0),s.addChild(f)}c&&s.transform(c)}}});function T(t,i,n){var s=t.attributes[i],a=s&&s.value;if(!a&&t.style){var o=r.camelize(i);(a=t.style[o])||n.node[o]===n.parent[o]||(a=n.node[o])}return a?"none"===a?null:a:e}function O(t,i,n){var s=i.parentNode,a={node:Z.getStyles(i)||{},parent:!n&&!/^defs$/i.test(s.tagName)&&Z.getStyles(s)||{}};return r.each(I,(function(n,r){var s=T(i,r,a);t=s!==e&&n(t,s,r,i,a)||t})),t}function z(t){var e=t&&t.match(/\((?:["'#]*)([^"')]+)/),n=e&&e[1],r=n&&a[i?n.replace(i.location.href.split("#")[0]+"#",""):n];return r&&r._scaleToBounds&&((r=r.clone())._scaleToBounds=!0),r}function k(t,e,i){var o,h,l,c=t.nodeName.toLowerCase(),f="#document"!==c,d=n.body;i&&f&&(s=st.getView().getSize(),s=u(t,null,null,!0)||s,o=nt.create("svg",{style:"stroke-width: 1px; stroke-miterlimit: 10"}),h=t.parentNode,l=t.nextSibling,o.appendChild(t),d.appendChild(o));var _=st.settings,g=_.applyMatrix,v=_.insertItems;_.applyMatrix=!1,_.insertItems=!1;var m=p[c],y=m&&m(t,c,e,i)||null;if(_.insertItems=v,_.applyMatrix=g,y){!f||y instanceof b||(y=O(y,t,i));var w=e.onImport,x=f&&t.getAttribute("data-paper-data");w&&(y=w(t,y,e)||y),e.expandShapes&&y instanceof C&&(y.remove(),y=y.toPath()),x&&(y._data=JSON.parse(x))}return o&&(d.removeChild(o),h&&(l?h.insertBefore(t,l):h.appendChild(t))),i&&(a={},y&&r.pick(e.applyMatrix,g)&&y.matrix.apply(!0,!0)),y}function A(i,r,s){if(!i)return null;r="function"==typeof r?{onLoad:r}:r||{};var a=st,o=null;function h(n){try{var h="object"==typeof n?n:(new t.DOMParser).parseFromString(n.trim(),"image/svg+xml");if(!h.nodeName)throw h=null,new Error("Unsupported SVG source: "+i);st=a,o=k(h,r,!0),r&&!1===r.insert||s._insertItem(e,o);var l=r.onLoad;l&&l(o,n)}catch(c){u(c)}}function u(t,e){var i=r.onError;if(!i)throw new Error(t);i(t,e)}if("string"!=typeof i||/^[\s\S]*</.test(i)){if("undefined"!=typeof File&&i instanceof File){var l=new FileReader;return l.onload=function(){h(l.result)},l.onerror=function(){u(l.error)},l.readAsText(i)}h(i)}else{var c=n.getElementById(i);c?h(c):tt({url:i,async:!0,onLoad:h,onError:u})}return o}x.inject({importSVG:function(t,e){return A(t,e,this)}}),w.inject({importSVG:function(t,e){return this.activate(),A(t,e,this)}})};var st=new(a.inject(r.exports,{Base:r,Numerical:l,Key:K,DomEvent:U,DomElement:Z,document:n,window:i,Symbol:M,PlacedSymbol:I}));return st.agent.node&&require("./node/extend.js")(st),"function"==typeof define&&define.amd?define("paper",st):"object"==typeof module&&module&&(module.exports=st),st}.call(this,"object"==typeof self?self:null);</script>
<script type="text/javascript">/*! https://mths.be/he v1.1.1 by @mathias | MIT license */!function(r){var e="object"==typeof exports&&exports,a="object"==typeof module&&module&&module.exports==e&&module,u="object"==typeof global&&global;u.global!==u&&u.window!==u||(r=u);var t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,s=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,l={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"},i=/["&'<>`]/g,n={'"':"&quot;","&":"&amp;","'":"&#x27;","<":"&lt;",">":"&gt;","`":"&#x60;"},p=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,d=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)([=a-zA-Z0-9])?/g,m={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},f={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},h=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],D=String.fromCharCode,v={}.hasOwnProperty,y=function(r,e){return v.call(r,e)},q=function(r,e){if(!r)return e;var a,u={};for(a in e)u[a]=y(r,a)?r[a]:e[a];return u},A=function(r,e){var a="";return r>=55296&&r<=57343||r>1114111?(e&&x("character reference outside the permissible Unicode range"),"�"):y(b,r)?(e&&x("disallowed character reference"),b[r]):(e&&function(r,e){for(var a=-1,u=r.length;++a<u;)if(r[a]==e)return!0;return!1}(h,r)&&x("disallowed character reference"),r>65535&&(a+=D((r-=65536)>>>10&1023|55296),r=56320|1023&r),a+=D(r))},w=function(r){return"&#x"+r.toString(16).toUpperCase()+";"},E=function(r){return"&#"+r+";"},x=function(r){throw Error("Parse error: "+r)},k=function(r,e){(e=q(e,k.options)).strict&&d.test(r)&&x("forbidden code point");var a=e.encodeEverything,u=e.useNamedReferences,n=e.allowUnsafeSymbols,p=e.decimal?E:w,g=function(r){return p(r.charCodeAt(0))};return a?(r=r.replace(o,(function(r){return u&&y(l,r)?"&"+l[r]+";":g(r)})),u&&(r=r.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),u&&(r=r.replace(s,(function(r){return"&"+l[r]+";"})))):u?(n||(r=r.replace(i,(function(r){return"&"+l[r]+";"}))),r=(r=r.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;")).replace(s,(function(r){return"&"+l[r]+";"}))):n||(r=r.replace(i,g)),r.replace(t,(function(r){var e=r.charCodeAt(0),a=r.charCodeAt(1);return p(1024*(e-55296)+a-56320+65536)})).replace(c,g)};k.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var C=function(r,e){var a=(e=q(e,C.options)).strict;return a&&p.test(r)&&x("malformed character reference"),r.replace(g,(function(r,u,t,o,c,s,l,i){var n,p,d,g,b,h;return u?(d=u,p=t,a&&!p&&x("character reference was not terminated by a semicolon"),n=parseInt(d,10),A(n,a)):o?(g=o,p=c,a&&!p&&x("character reference was not terminated by a semicolon"),n=parseInt(g,16),A(n,a)):s?y(m,b=s)?m[b]:(a&&x("named character reference was not terminated by a semicolon"),r):(b=l,(h=i)&&e.isAttributeValue?(a&&"="==h&&x("`&` did not start a character reference"),r):(a&&x("named character reference was not terminated by a semicolon"),f[b]+(h||"")))}))};C.options={isAttributeValue:!1,strict:!1};var B={version:"1.1.1",encode:k,decode:C,escape:function(r){return r.replace(i,(function(r){return n[r]}))},unescape:C};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return B}));else if(e&&!e.nodeType)if(a)a.exports=B;else for(var L in B)y(B,L)&&(e[L]=B[L]);else r.he=B}(this);</script>
<script type="text/javascript">window.assertions=window.assertions||{},window.assertions.assertFunction=window.assertions.assertFunction||function(o){for(var n=arguments.length,s=new Array(n>1?n-1:0),e=1;e<n;e++)s[e-1]=arguments[e];if(!o){s=s.filter(o=>!!s),window.navigator&&"Microsoft Internet Explorer"===window.navigator.appName&&s.push("stack=\n"+(new Error).stack);const o=s.length>0?"Assertion failed: ":"Assertion failed";throw console&&console.error&&console.error(o,...s),window.phet&&phet.chipper&&phet.chipper.queryParameters&&phet.chipper.queryParameters.debugger,new Error(o+s.join("\n "))}},window.assert=window.assert||null,window.assertSlow=window.assertSlow||null,window.assertions.enableAssert=function(){window.assert=window.assertions.assertFunction,window.console&&window.console.log&&window.console.log("enabling assert")},window.assertions.disableAssert=function(){window.assert=null,window.console&&window.console.log&&window.console.log("disabling assert")},window.assertions.enableAssertSlow=function(){window.assertSlow=window.assertions.assertFunction,window.console&&window.console.log&&window.console.log("enabling assertSlow")},window.assertions.disableAssertSlow=function(){window.assertSlow=null,window.console&&window.console.log&&window.console.log("disabling assertSlow")};</script>
<script type="text/javascript">!function(e,t){"function"==typeof window.define&&window.define.amd?window.define([],t):"object"==typeof module&&module.exports?module.exports=t():e.QueryStringMachine=t()}(this,()=>{const e=e=>0===e.length||0===e.indexOf("?");return function(){const t=(e,t,a,n,i)=>{if(!e)if(n.public)if(r.addWarning(t,a,i),n.hasOwnProperty("defaultValue"))a=n.defaultValue;else{const e=s[n.type];o(e.hasOwnProperty("defaultValue"),"Type must have a default value if the provided schema does not have one."),a=e.defaultValue}else o(e,i);return a},r={warnings:[],get:function(e,t){return this.getForString(e,t,window.location.search)},getAll:function(e){return this.getAllForString(e,window.location.search)},getForString:function(r,i,o){if(!e(o))throw new Error('Query strings should be either the empty string or start with a "?": '+o);const p=i.private&&!(()=>{try{return"true"===localStorage.getItem("phetTeamMember")}catch(e){return!1}})()?[]:a(r,o);n(r,i);let d=l(r,i,p);i.hasOwnProperty("validValues")?d=t(u(d,i.validValues),r,d,i,`Invalid value supplied for key "${r}": ${d} is not a member of valid values: ${i.validValues.join(", ")}`):i.hasOwnProperty("isValidValue")&&(d=t(i.isValidValue(d),r,d,i,`Invalid value supplied for key "${r}": ${d}`));let f=s[i.type].isValidValue(d);if("array"===i.type&&Array.isArray(d)){let e=!0;for(let t=0;t<d.length;t++){const r=d[t];if(!s[i.elementSchema.type].isValidValue(r)){e=!1;break}if(i.elementSchema.hasOwnProperty("isValidValue")&&!i.elementSchema.isValidValue(r)){e=!1;break}if(i.elementSchema.hasOwnProperty("validValues")&&!u(r,i.elementSchema.validValues)){e=!1;break}}f=f&&e}return d=t(f,r,d,i,"Invalid value for type, key: "+r),d},getAllForString:function(e,t){const r={};for(const a in e)e.hasOwnProperty(a)&&(r[a]=this.getForString(a,e[a],t));return r},containsKey:function(e){return this.containsKeyForString(e,window.location.search)},containsKeyForString:function(t,r){if(!e(r))throw new Error('Query strings should be either the empty string or start with a "?": '+r);return a(t,r).length>0},deepEquals:function(e,t){if(typeof e!=typeof t)return!1;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e===t;if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;if(null===e&&void 0===t)return!1;if(void 0===e&&null===t)return!1;const a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;if(0===a.length)return e===t;for(let i=0;i<a.length;i++){if(a[i]!==n[i])return!1;const l=e[a[i]],u=t[a[i]];if(!r.deepEquals(l,u))return!1}return!0},removeKeyValuePair:function(e,t){if(0===e.indexOf("?")){const r=[],a=e.substring(1).split("&");for(let e=0;e<a.length;e++){const n=a[e],i=n.split("=");decodeURIComponent(i[0])!==t&&r.push(n)}return r.length>0?"?"+r.join("&"):""}return e},removeKeyValuePairs:function(e,t){for(let r=0;r<t.length;r++)e=this.removeKeyValuePair(e,t[r]);return e},appendQueryString:function(e,t){if(0!==t.indexOf("?")&&0!==t.indexOf("&")||(t=t.substring(1)),0===t.length)return e;const r=e.indexOf("?")>=0?"&":"?";return e+r+t},appendQueryStringArray:function(e,t){for(let r=0;r<t.length;r++)e=this.appendQueryString(e,t[r]);return e},getQueryString:function(e){const t=e.indexOf("?");return t>=0?e.substring(t):"?"},addWarning:function(e,t,r){console.warn(r),this.warnings.push({key:e,value:t,message:r})},hasWarning:function(e){let t=!1;for(let r=0;r<this.warnings.length&&!t;r++)t=this.warnings[r].key===e;return t},getQueryParametersFromString:function(e){if(0===e.indexOf("?")){return e.substring(1).split("&")}return[]},getSingleQueryParameterString:function(e,t){const r=this.getQueryString(t),a=this.getQueryParametersFromString(r);for(let n=0;n<a.length;n++){const t=a[n],r=t.split("=");if(decodeURIComponent(r[0])===e)return t}return null}},a=function(e,t){const r=[],a=t.slice(1).split("&");for(let n=0;n<a.length;n++){const t=a[n].split("="),i=t[0],l=t.slice(1).join("=");i===e&&(l?r.push(decodeURIComponent(l)):r.push(null))}return r},n=function(e,t){o(t.hasOwnProperty("type"),"type field is required for key: "+e),o(s.hasOwnProperty(t.type),`invalid type: ${t.type} for key: ${e}`),t.hasOwnProperty("parse")&&o("function"==typeof t.parse,"parse must be a function for key: "+e),o(!(t.hasOwnProperty("validValues")&&t.hasOwnProperty("isValidValue")),t,e,"validValues and isValidValue are mutually exclusive for key: "+e),t.hasOwnProperty("validValues")&&o(Array.isArray(t.validValues),"isValidValue must be an array for key: "+e),t.hasOwnProperty("isValidValue")&&o("function"==typeof t.isValidValue,"isValidValue must be a function for key: "+e),t.hasOwnProperty("defaultValue")&&o(s[t.type].isValidValue(t.defaultValue),"defaultValue incorrect type: "+e),t.hasOwnProperty("validValues")&&t.validValues.forEach(r=>o(s[t.type].isValidValue(r),"validValue incorrect type for key: "+e)),t.hasOwnProperty("defaultValue")&&t.hasOwnProperty("validValues")&&o(u(t.defaultValue,t.validValues),t,e,"defaultValue must be a member of validValues, for key: "+e),t.hasOwnProperty("public")&&t.public&&"flag"!==t.type&&o(t.hasOwnProperty("defaultValue"),"defaultValue is required when public: true for key: "+e),i(e,t,s[t.type].required,s[t.type].optional),s[t.type].validateSchema&&s[t.type].validateSchema(e,t)},i=function(e,t,r,a){const n=Object.getOwnPropertyNames(t);r.forEach(t=>{o(-1!==n.indexOf(t),`missing required property: ${t} for key: ${e}`)});const i=r.concat(a);n.forEach(t=>{o("type"===t||-1!==i.indexOf(t),`unsupported property: ${t} for key: ${e}`)})},l=function(e,t,r){let a;return o(r.length<=1,"query parameter cannot occur multiple times: "+e),"flag"===t.type?a=s[t.type].parse(e,t,r[0]):(o(void 0!==r[0]||t.hasOwnProperty("defaultValue"),"missing required query parameter: "+e),a=void 0===r[0]?t.defaultValue:s[t.type].parse(e,t,r[0])),a},u=function(e,t){let a=!1;for(let n=0;n<t.length&&!a;n++)a=r.deepEquals(t[n],e);return a},o=function(e,t){if(!e)throw console&&console.log&&console.log(t),new Error("Query String Machine Assertion failed: "+t)},s={flag:{required:[],optional:["private","public"],validateSchema:null,parse:function(e,t,r){return null===r||void 0!==r&&r},isValidValue:e=>!0===e||!1===e,defaultValue:!0},boolean:{required:[],optional:["defaultValue","private","public"],validateSchema:null,parse:function(e,t,r){return"true"===r||"false"!==r&&r},isValidValue:e=>!0===e||!1===e},number:{required:[],optional:["defaultValue","validValues","isValidValue","private","public"],validateSchema:null,parse:function(e,t,r){const a=Number(r);return null===r||isNaN(a)?r:a},isValidValue:e=>"number"==typeof e&&!isNaN(e)},string:{required:[],optional:["defaultValue","validValues","isValidValue","private","public"],validateSchema:null,parse:function(e,t,r){return r},isValidValue:e=>null===e||"string"==typeof e},array:{required:["elementSchema"],optional:["defaultValue","validValues","isValidValue","separator","validValues","private","public"],validateSchema:function(e,t){t.hasOwnProperty("separator")&&o("string"==typeof t.separator&&1===t.separator.length,`invalid separator: ${t.separator}, for key: ${e}`),o(!t.elementSchema.hasOwnProperty("public"),"Array elements should not declare public; it comes from the array schema itself."),n(e+".element",t.elementSchema)},parse:function(e,t,r){let a;return a=null===r?[]:r.split(t.separator||",").map(r=>l(e,t.elementSchema,[r])),a},isValidValue:e=>Array.isArray(e)||null===e},custom:{required:["parse"],optional:["defaultValue","validValues","isValidValue","private","public"],validateSchema:null,parse:function(e,t,r){return t.parse(r)},isValidValue:e=>!0}};return r}()});</script>
<script type="text/javascript">!function(){const e=_.hasIn(window,"phet.chipper.packageObject")?phet.chipper.packageObject:{},t=e.phet||{},a=!_.hasIn(window,"phet.chipper.allowLocaleSwitching")||phet.chipper.allowLocaleSwitching,r=t.simFeatures||{},p=r.colorProfiles||["default"],o={allowLinks:{type:"boolean",defaultValue:!0,public:!0},audio:{type:"string",defaultValue:"enabled",validValues:["enabled","disabled","muted"],public:!0},binder:{type:"flag"},brand:{type:"string",defaultValue:"adapted-from-phet"},buildCompatible:{type:"flag"},continuousTest:{type:"string",defaultValue:""},colorProfile:{type:"string",defaultValue:p[0],validValues:p,public:!0},debugger:{type:"flag"},deprecationWarnings:{type:"flag"},dev:{type:"flag"},disableModals:{type:"flag"},ea:{type:"flag"},eall:{type:"flag"},extraSoundInitiallyEnabled:{type:"flag",public:!0},fuzz:{type:"flag"},fuzzBoard:{type:"flag"},fuzzMouse:{type:"flag"},fuzzPointers:{type:"number",defaultValue:1},fuzzTouch:{type:"flag"},fuzzRate:{type:"number",defaultValue:100,isValidValue:function(e){return e>0}},ga4:{type:"string",defaultValue:null,public:!0},gameUp:{type:"flag"},gameUpTestHarness:{type:"flag"},gameUpLogging:{type:"flag"},gaPage:{type:"string",defaultValue:null},homeScreen:{type:"boolean",defaultValue:!0,public:!0},initialScreen:{type:"number",defaultValue:0,public:!0},legendsOfLearning:{type:"flag"},listenerLimit:{type:"number",defaultValue:Number.POSITIVE_INFINITY,public:!1},locale:{type:"string",defaultValue:"en"},locales:{type:"array",elementSchema:{type:"string"},defaultValue:[]},supportsDynamicLocale:{type:"boolean",defaultValue:a&&(!r.hasOwnProperty("supportsDynamicLocale")||r.supportsDynamicLocale)},log:{type:"flag"},memoryLimit:{type:"number",defaultValue:0},mobileA11yTest:{type:"flag"},parentLimit:{type:"number",defaultValue:Number.POSITIVE_INFINITY,public:!1},"phet-android-app":{type:"flag"},"phet-app":{type:"flag"},playbackMode:{type:"boolean",defaultValue:!1},postMessageOnBeforeUnload:{type:"flag"},postMessageOnError:{type:"flag"},postMessageOnLoad:{type:"flag"},postMessageOnReady:{type:"flag"},preserveDrawingBuffer:{type:"flag"},preventFullScreen:{type:"flag"},profiler:{type:"flag"},qrCode:{type:"flag"},randomSeed:{type:"number",defaultValue:Math.random()},regionAndCulture:{public:!0,type:"string",defaultValue:r.supportedRegionsAndCultures&&r.supportedRegionsAndCultures[0]?r.supportedRegionsAndCultures[0]:null},rootRenderer:{type:"string",defaultValue:null,validValues:[null,"canvas","svg","dom","webgl","vello"]},sceneryLog:{type:"array",elementSchema:{type:"string"},defaultValue:null},sceneryStringLog:{type:"flag"},screens:{type:"array",elementSchema:{type:"number",isValidValue:Number.isInteger},defaultValue:null,isValidValue:function(e){return null===e||e.length===_.uniq(e).length&&e.length>0},public:!0},showAnswers:{type:"flag",private:!0},showCanvasNodeBounds:{type:"flag"},showFittedBlockBounds:{type:"flag"},showHitAreas:{type:"flag"},showPointerAreas:{type:"flag"},showPointers:{type:"flag"},showVisibleBounds:{type:"flag"},listenerOrder:{type:"string",defaultValue:"default",isValidValue:function(e){return"default"===e||"random"===e||"reverse"===e||e.match(/random(?:%28|\()(\d+)(?:%29|\))/)}},speechSynthesisFromParent:{type:"flag"},speed:{type:"number",defaultValue:1,isValidValue:function(e){return e>0}},strings:{type:"string",defaultValue:null},stringTest:{type:"string",defaultValue:null},keyboardLocaleSwitcher:{type:"flag"},supportsInteractiveDescription:{type:"boolean",defaultValue:!!r.supportsInteractiveDescription},supportsInteractiveHighlights:{type:"boolean",defaultValue:r.hasOwnProperty("supportsInteractiveHighlights")?!!r.supportsInteractiveHighlights:!!r.supportsInteractiveDescription},interactiveHighlightsInitiallyEnabled:{type:"flag",public:!0},supportsGestureControl:{type:"boolean",defaultValue:!!r.supportsGestureControl},supportsVoicing:{type:"boolean",defaultValue:!!r.supportsVoicing},swashText:{type:"boolean",defaultValue:!0},swashTextColor:{type:"string",defaultValue:""},voicingInitiallyEnabled:{type:"flag"},preferencesStorage:{type:"flag"},printVoicingResponses:{type:"flag"},supportsPanAndZoom:{type:"boolean",public:!0,defaultValue:!r.hasOwnProperty("supportsPanAndZoom")||r.supportsPanAndZoom},supportsSound:{type:"boolean",defaultValue:!!r.supportsSound},supportsExtraSound:{type:"boolean",defaultValue:!!r.supportsExtraSound},vibrationParadigm:{type:"string",defaultValue:null},webgl:{type:"boolean",defaultValue:!0},yotta:{type:"boolean",defaultValue:!0,public:!0}};function l(e){const t=new Date;let a;do{a=new Date}while(a-t<e)}!function(){window.phet=window.phet||{},window.phet.chipper=window.phet.chipper||{},window.phet.chipper.queryParameters=QueryStringMachine.getAll(o),window.phet.chipper.colorProfiles=p,window.phet.chipper.isFuzzEnabled=()=>window.phet.chipper.queryParameters.fuzz||window.phet.chipper.queryParameters.fuzzMouse||window.phet.chipper.queryParameters.fuzzTouch||window.phet.chipper.queryParameters.fuzzBoard,window.phet.chipper.queryParameters.log&&(window.phet.log=function(e,t){t=_.assignIn({color:"#009900"},t),console.log("%c"+e,"color: "+t.color)}),window.phet.chipper.brand=window.phet.chipper.brand||phet.chipper.queryParameters.brand||"adapted-from-phet";const e="undefined"!=typeof window&&phet.chipper.queryParameters.stringTest?phet.chipper.queryParameters.stringTest:null;window.phet.chipper.mapString=function(t){return null===e?t:"double"===e?`${t}:${t}`:"long"===e?"12345678901234567890123456789012345678901234567890":"rtl"===e?"‫تست (زبان)‬":"xss"===e?t+'<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NkYGD4DwABCQEBtxmN7wAAAABJRU5ErkJggg==" onload="window.location.href=atob(\'aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==\')" />':"xss2"===e?t+"<script>alert('XSS')<\/script>":"none"===e||"dynamic"===e?t:e},phet.chipper.checkAndRemapLocale=()=>{if(!phet.chipper.localeData||!phet.chipper.locale)return;let e=phet.chipper.locale;if(e){if(e.length<5)e=e.toLowerCase();else{e=e.replace(/-/,"_");const t=e.split("_");2===t.length&&(e=t[0].toLowerCase()+"_"+t[1].toUpperCase())}if(3===e.length)for(const t of Object.keys(phet.chipper.localeData))if(phet.chipper.localeData[t].locale3===e){e=t;break}}if(!phet.chipper.localeData[e]){const t=phet.chipper.queryParameters.locale,a=/^[a-zA-Z]{2}$/.test(t),r=/^[a-zA-Z]{3}$/.test(t),p=/^[a-zA-Z]{2}[_-][a-zA-Z]{2}$/.test(t);a||r||p||QueryStringMachine.addWarning("locale",phet.chipper.queryParameters.locale,`Invalid locale format received: ${t}. ?locale query parameter accepts the following formats: "xx" for ISO-639-1, "xx_XX" for ISO-639-1 and a 2-letter country code, "xxx" for ISO-639-2`),e="en"}phet.chipper.locale=e,document.documentElement.lang=phet.chipper.localeData[e].bcp47},QueryStringMachine.containsKey("locale")?"string"==typeof phet.chipper.queryParameters.locale?(phet.chipper.locale=phet.chipper.queryParameters.locale,phet.chipper.checkAndRemapLocale()):(window.phet.chipper.locale="en",phet.chipper.queryParameters.locale="en"):window.phet.chipper.locale||(window.phet.chipper.locale="en");const t=JSON.parse(phet.chipper.queryParameters.strings||"{}");phet.chipper.getStringForBuiltSim=e=>{var a;if(t[e])return t[e];const r=[phet.chipper.locale,...(null===(a=phet.chipper.localeData[phet.chipper.locale])||void 0===a?void 0:a.fallbackLocales)||[],"en"!==phet.chipper.locale?["en"]:[]];let p=null;for(const t of r)if(p=phet.chipper.strings[t],p)break;return phet.chipper.mapString(p[e])}}(),window.phet.chipper.makeEverythingSlow=function(){window.setInterval(()=>{l(64)},16)},window.phet.chipper.makeRandomSlowness=function(){window.setInterval(()=>{l(Math.ceil(100+200*Math.random()))},Math.ceil(100+200*Math.random()))},window.phet.chipper.isProduction="production"===$("meta[name=phet-sim-level]").attr("content"),window.phet.chipper.isApp=phet.chipper.queryParameters["phet-app"]||phet.chipper.queryParameters["phet-android-app"],function(){const e=!phet.chipper.isProduction&&phet.chipper.queryParameters.eall;(e||!phet.chipper.isProduction&&phet.chipper.queryParameters.ea||phet.chipper.isDebugBuild)&&window.assertions.enableAssert(),e&&window.assertions.enableAssertSlow(),window.phet.chipper.reportContinuousTestResult=e=>{window.parent&&window.parent.postMessage(JSON.stringify(_.assignIn({continuousTest:JSON.parse(phet.chipper.queryParameters.continuousTest),url:window.location.href},e)),"*")},phet.chipper.queryParameters.continuousTest&&(window.addEventListener("error",e=>{let t="",a="";e&&e.message&&(t=e.message),e&&e.error&&e.error.stack&&(a=e.error.stack),phet.chipper.reportContinuousTestResult({type:"continuous-test-error",message:t,stack:a})}),window.addEventListener("beforeunload",e=>{phet.chipper.reportContinuousTestResult({type:"continuous-test-unload"})}),window.open=()=>({focus:()=>{},blur:()=>{}})),phet.chipper.queryParameters.postMessageOnError&&window.addEventListener("error",e=>{let t="",a="";e&&e.message&&(t=e.message),e&&e.error&&e.error.stack&&(a=e.error.stack),window.parent&&window.parent.postMessage(JSON.stringify({type:"error",url:window.location.href,message:t,stack:a}),"*")}),phet.chipper.queryParameters.postMessageOnBeforeUnload&&window.addEventListener("beforeunload",e=>{window.parent&&window.parent.postMessage(JSON.stringify({type:"beforeUnload"}),"*")})}(),(()=>{const e={supportsInteractiveDescription:{type:"boolean"},supportsVoicing:{type:"boolean"},supportsInteractiveHighlights:{type:"boolean"},supportsSound:{type:"boolean"},supportsExtraSound:{type:"boolean"},supportsDynamicLocale:{type:"boolean"},colorProfiles:{type:"array"},supportedRegionsAndCultures:{type:"array"}};if(Object.keys(e).forEach(e=>{}),t.hasOwnProperty("simFeatures")){const a=t.simFeatures;Object.keys(a).forEach(t=>{a[t];e[t]&&("boolean"===e[t.type]||e[t.type])})}})()}();</script>
<script type="text/javascript">!function(){if(!phet.chipper.queryParameters.yotta)return;const e=navigator.userAgent,t=!!(e.match(/MSIE/)||e.match(/Trident\//)||e.match(/Edge\//));if("file:"===window.location.protocol&&t)return;if("phet"!==phet.chipper.brand&&"phet-io"!==phet.chipper.brand)return;let a;function n(){let e=!1;window.addEventListener("error",t=>{t&&t.target&&t.target.src&&t.target.src.indexOf&&t.target.src.indexOf("google-analytics")>=0&&(e=!0)},!0);let t=`pingver=4&project=${encodeURIComponent(phet.chipper.project)}&brand=${encodeURIComponent(phet.chipper.brand)}&license=${encodeURIComponent("phet-io"===phet.chipper.brand?"iO":"NC")}&version=${encodeURIComponent(phet.chipper.version)}&locale=${encodeURIComponent(phet.chipper.locale)}&buildTimestamp=${encodeURIComponent(phet.chipper.buildTimestamp)}&domain=${encodeURIComponent(document.domain)}&href=${encodeURIComponent(window.location.href)}&type=html&timestamp=${encodeURIComponent(Date.now())}&loadType=${encodeURIComponent(a)}&ref=`+encodeURIComponent(document.referrer);for(const[a,p]of new URLSearchParams(window.location.search))a.startsWith("yotta")&&(t+=`&${encodeURIComponent(a)}=${encodeURIComponent(p)}`);function n(e){document.createElement("img").src=e}if(n("https://phet.colorado.edu/yotta/immediate.gif?"+t),window.addEventListener("load",a=>{n(`https://phet.colorado.edu/yotta/sanity.gif?${t}&gaError=${encodeURIComponent(e)}&gaLoaded=`+encodeURIComponent(!1))},!1),phet.chipper.queryParameters.ga4){function o(){ga4DataLayer.push(arguments)}window.ga4DataLayer=window.ga4DataLayer||[],o("js",new Date),o("consent","default",{ad_storage:"denied",analytics_storage:"granted"}),o("consent","default",{ad_storage:"denied",analytics_storage:"denied",region:["BE","BG","CZ","DK","CY","LV","LT","LU","ES","FR","HR","IT","PL","PT","RO","SI","HU","MT","NL","AT","IS","LI","NO","SK","FI","SE","DE","EE","IE","EL","GB","CH"]}),o("config",phet.chipper.queryParameters.ga4);const e=document.getElementsByTagName("script")[0],t=document.createElement("script");t.async=!0,t.src=`https://www.googletagmanager.com/gtag/js?id=${phet.chipper.queryParameters.ga4}&l=ga4DataLayer`,e.parentNode.insertBefore(t,e)}function r(){window.dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],r("consent","default",{ad_storage:"denied",analytics_storage:"granted"}),r("consent","default",{ad_storage:"denied",analytics_storage:"denied",region:["BE","BG","CZ","DK","CY","LV","LT","LU","ES","FR","HR","IT","PL","PT","RO","SI","HU","MT","NL","AT","IS","LI","NO","SK","FI","SE","DE","EE","IE","EL","GB","CH"]}),window.dataLayer.push({simBrand:phet.chipper.brand,simLicense:"phet-io"===phet.chipper.brand?"iO":"NC",simName:phet.chipper.project,simVersion:phet.chipper.version,simLocale:phet.chipper.locale,simBuildTimestamp:phet.chipper.buildTimestamp,simLoadType:a,documentReferrer:document.referrer}),function(e,t,a,n,o){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var r=t.getElementsByTagName(a)[0],p=t.createElement(a);p.async=!0,p.src="https://www.googletagmanager.com/gtm.js?id=GTM-WLNGBXD",r.parentNode.insertBefore(p,r)}(window,document,"script","dataLayer")}a=phet.chipper.queryParameters["phet-app"]?"phet-app":phet.chipper.queryParameters["phet-android-app"]?"phet-android-app":top!==self?"embedded":"default","phet-app"===a?window.addEventListener("load",()=>{setTimeout(n,0)},!1):n()}();</script>
<script type="text/javascript">!function(n,r){var t,e=this,o=r.pow(256,6),i=r.pow(2,52),u=2*i;function f(f,p,d){var g=[],y=s(function n(r,t){var e,o=[],i=typeof r;if(t&&"object"==i)for(e in r)try{o.push(n(r[e],t-1))}catch(u){}return o.length?o:"string"==i?r:r+"\0"}((p=1==p?{entropy:!0}:p||{}).entropy?[f,l(n)]:null==f?function(){try{if(t)return l(t.randomBytes(256));var r=new Uint8Array(256);return(e.crypto||e.msCrypto).getRandomValues(r),l(r)}catch(u){var o=e.navigator,i=o&&o.plugins;return[+new Date,e,i,e.screen,l(n)]}}():f,3),g),h=new a(g),m=function(){for(var n=h.g(6),r=o,t=0;n<i;)n=256*(n+t),r*=256,t=h.g(1);for(;n>=u;)n/=2,r/=2,t>>>=1;return(n+t)/r};return m.int32=function(){return 0|h.g(4)},m.quick=function(){return h.g(4)/4294967296},m.double=m,s(l(h.S),n),(p.pass||d||function(n,t,e,o){return o&&(o.S&&c(o,h),n.state=function(){return c(h,{})}),e?(r.random=n,t):n})(m,y,"global"in p?p.global:this==r,p.state)}function a(n){var r,t=n.length,e=this,o=0,i=e.i=e.j=0,u=e.S=[];for(t||(n=[t++]);o<256;)u[o]=o++;for(o=0;o<256;o++)u[o]=u[i=255&i+n[o%t]+(r=u[o])],u[i]=r;(e.g=function(n){for(var r,t=0,o=e.i,i=e.j,u=e.S;n--;)r=u[o=255&o+1],t=256*t+u[255&(u[o]=u[i=255&i+r])+(u[i]=r)];return e.i=o,e.j=i,t})(256)}function c(n,r){return r.i=n.i,r.j=n.j,r.S=n.S.slice(),r}function s(n,r){for(var t,e=n+"",o=0;o<e.length;)r[255&o]=255&(t^=19*r[255&o])+e.charCodeAt(o++);return l(r)}function l(n){return String.fromCharCode.apply(0,n)}if(r.seedrandom=f,s(r.random(),n),"object"==typeof module&&module.exports){module.exports=f;try{t=require("crypto")}catch(p){}}else"function"==typeof define&&define.amd&&define((function(){return f}))}([],Math);</script>
<script type="text/javascript">!function(){"use strict";window.byteLength=function(r){return 3*r.length/4-h(r)},window.toByteArray=function(r){var e,o,a,c,i,d,u=r.length;i=h(r),d=new n(3*u/4-i),a=i>0?u-4:u;var A=0;for(e=0,o=0;e<a;e+=4,o+=3)c=t[r.charCodeAt(e)]<<18|t[r.charCodeAt(e+1)]<<12|t[r.charCodeAt(e+2)]<<6|t[r.charCodeAt(e+3)],d[A++]=c>>16&255,d[A++]=c>>8&255,d[A++]=255&c;2===i?(c=t[r.charCodeAt(e)]<<2|t[r.charCodeAt(e+1)]>>4,d[A++]=255&c):1===i&&(c=t[r.charCodeAt(e)]<<10|t[r.charCodeAt(e+1)]<<4|t[r.charCodeAt(e+2)]>>2,d[A++]=c>>8&255,d[A++]=255&c);return d},window.fromByteArray=function(t){for(var n,e=t.length,o=e%3,a="",h=[],i=0,d=e-o;i<d;i+=16383)h.push(c(t,i,i+16383>d?d:i+16383));1===o?(n=t[e-1],a+=r[n>>2],a+=r[n<<4&63],a+="=="):2===o&&(n=(t[e-2]<<8)+t[e-1],a+=r[n>>10],a+=r[n>>4&63],a+=r[n<<2&63],a+="=");return h.push(a),h.join("")};for(var r=[],t=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=e.length;o<a;++o)r[o]=e[o],t[e.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===r[t-2]?2:"="===r[t-1]?1:0}function c(t,n,e){for(var o,a,h=[],c=n;c<e;c+=3)o=(t[c]<<16)+(t[c+1]<<8)+t[c+2],h.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return h.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63}();</script>
<script type="text/javascript">function TextEncoderLite(){}function TextDecoderLite(){}!function(){"use strict";function e(e,n){var t;n=n||1/0;for(var r=e.length,i=null,o=[],u=0;u<r;u++){if((t=e.charCodeAt(u))>55295&&t<57344){if(!i){if(t>56319){(n-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(n-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(n-=3)>-1&&o.push(239,191,189),i=t;continue}t=i-55296<<10|t-56320|65536,i=null}else i&&((n-=3)>-1&&o.push(239,191,189),i=null);if(t<128){if((n-=1)<0)break;o.push(t)}else if(t<2048){if((n-=2)<0)break;o.push(t>>6|192,63&t|128)}else if(t<65536){if((n-=3)<0)break;o.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<2097152))throw new Error("Invalid code point");if((n-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return o}function n(e){try{return decodeURIComponent(e)}catch(n){return String.fromCharCode(65533)}}TextEncoderLite.prototype.encode=function(n){return"undefined"==typeof Uint8Array?e(n):new Uint8Array(e(n))},TextDecoderLite.prototype.decode=function(e){return function(e,t,r){var i="",o="";r=Math.min(e.length,r||1/0);for(var u=t=t||0;u<r;u++)e[u]<=127?(i+=n(o)+String.fromCharCode(e[u]),o=""):o+="%"+e[u].toString(16);return i+n(o)}(e,0,e.length)}}();</script>
<script type="text/javascript">!function(){window.phetio=window.phetio||{};window.phetio.PhetioIDUtils={append:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];return t.forEach(n=>{if(""===n)return;e+=(""===e?"":".")+n}),e},getComponentName:function(e){const n=e.lastIndexOf(".");return-1===n?e:e.substring(n+1,e.length)},getParentID:function(e){const n=e.lastIndexOf(".");return-1===n?null:e.substring(0,n)},getDOMElementID:function(e){return"phetioID:"+e},getScreenID:function(e){const n=[],t=e.split(".");for(let o=0;o<t.length;o++){const e=t[o];n.push(e);const r=e.indexOf("Screen");if(r>0&&r+"Screen".length===e.length)return n.join(".")}return null},getGroupElementIndex:function(e){return Number(e.split(window.phetio.PhetioIDUtils.GROUP_SEPARATOR)[1])},isAncestor:function(e,n){const t=e.split("."),o=n.split(".");for(let r=0;r<t.length;r++)if(t[r]!==o[r])return!1;return n!==e},getArchetypalPhetioID:function(e){const n=e.split(".");for(let t=0;t<n.length;t++){const e=n[t];if(e.endsWith("Capsule")&&t<n.length-1)n[t+1]="archetype",t++;else{const o=e.split("-").map(e=>e.includes("_")?"archetype":e);n[t]=o.join("-")}}return n.join(".")},SEPARATOR:".",GROUP_SEPARATOR:"_",INTER_TERM_SEPARATOR:"-",GENERAL_COMPONENT_NAME:"general",GLOBAL_COMPONENT_NAME:"global",HOME_SCREEN_COMPONENT_NAME:"homeScreen",MODEL_COMPONENT_NAME:"model",VIEW_COMPONENT_NAME:"view",CONTROLLER_COMPONENT_NAME:"controller",COLORS_COMPONENT_NAME:"colors",STRINGS_COMPONENT_NAME:"strings",ARCHETYPE:"archetype",CAPSULE_SUFFIX:"Capsule"}}();</script>
<script type="text/javascript">!function(e){const t="undefined"!=typeof module?require("assert"):e&&e.assert,r=class{constructor(e,r,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};"string"==typeof e&&(e=Number(e)),"string"==typeof r&&(r=Number(r)),"string"==typeof i&&(i=Number(i)),"string"==typeof n.testNumber&&(n.testNumber=Number(n.testNumber));const{buildTimestamp:s=null,testType:o=null,testNumber:m=null}=n;t&&t("number"==typeof e&&e>=0&&e%1==0,"major version should be a non-negative integer: "+e),t&&t("number"==typeof r&&r>=0&&r%1==0,"minor version should be a non-negative integer: "+r),t&&t("number"==typeof i&&i>=0&&i%1==0,"maintenance version should be a non-negative integer: "+i),t&&t("string"!=typeof o||"number"==typeof m,"if testType is provided, testNumber should be a number"),this.major=e,this.minor=r,this.maintenance=i,this.testType=o,this.testNumber=m,this.buildTimestamp=s}serialize(){return{major:this.major,minor:this.minor,maintenance:this.maintenance,testType:this.testType,testNumber:this.testNumber,buildTimestamp:this.buildTimestamp}}get isSimNotPublished(){return this.major<1||1===this.major&&0===this.minor&&0===this.maintenance&&this.testType}get isSimPublished(){return!this.isSimNotPublished}static deserialize(e){let{major:t,minor:i,maintenance:n,testType:s,testNumber:o,buildTimestamp:m}=e;return new r(t,i,n,{testType:s,testNumber:o,buildTimestamp:m})}compareNumber(e){return r.comparator(this,e)}static comparator(e,t){return e.major<t.major?-1:e.major>t.major?1:e.minor<t.minor?-1:e.minor>t.minor?1:e.maintenance<t.maintenance?-1:e.maintenance>t.maintenance?1:0}isAfter(e){return 1===this.compareNumber(e)}isBeforeOrEqualTo(e){return this.compareNumber(e)<=0}toString(){let e=`${this.major}.${this.minor}.${this.maintenance}`;return"string"==typeof this.testType&&(e+=`-${this.testType}.${this.testNumber}`),e}static parse(e,t){const i=e.match(/^(\d+)\.(\d+)\.(\d+)(-(([^.-]+)\.(\d+)))?(-([^.-]+))?$/);if(!i)throw new Error("could not parse version: "+e);const n=Number(i[1]),s=Number(i[2]),o=Number(i[3]),m=i[6],a=void 0===i[7]?i[7]:Number(i[7]);return new r(n,s,o,{testType:m,testNumber:a,buildTimestamp:t})}static fromBranch(e){const i=e.split(".");t&&t(2===i.length,"Bad branch, should be {{MAJOR}}.{{MINOR}}, had: "+e);const n=Number(e.split(".")[0]),s=Number(e.split(".")[1]);return new r(n,s,0)}static ensureReleaseBranch(e){const i=r.fromBranch(e.split("-")[0]);t&&t(i.major>0,"Major version for a branch should be greater than zero"),t&&t(i.minor>=0,"Minor version for a branch should be greater than (or equal) to zero")}};"undefined"!=typeof module?module.exports=r:(window.phet=window.phet||{},window.phet.preloads=window.phet.preloads||{},window.phet.preloads.chipper=window.phet.preloads.chipper||{},window.phet.preloads.chipper.SimVersion=r)}((0,eval)("this"));</script>
<script type="text/javascript">function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:t+""}function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}phet.chipper.runWebpack=function(){(()=>{var e={9806:(e,t,i)=>{"use strict";i.d(t,{Z:()=>A});var s=i(2550),n=i(5602),r=i(7922),o=i(592);class A extends o.Z{constructor(e,t){super(e,(0,s.ZP)()({valueType:"boolean",phetioValueType:n.Z},t))}toggle(){this.value=!this.value}}r.Z.register("BooleanProperty",A)},2558:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2550),n=i(7922),r=i(2221);class o{constructor(e){const t=(0,s.ZP)()({delay:400,interval:100},e);this.delay=t.delay,this.interval=t.interval,this.callbacks=[],t.callback&&this.callbacks.push(t.callback),this.delayID=null,this.intervalID=null,this.fired=!1}isRunning(){return null!==this.delayID||null!==this.intervalID}start(){this.isRunning()||(this.fired=!1,this.delayID=r.Z.setTimeout(()=>{this.delayID=null,this.intervalID=r.Z.setInterval(()=>this.fire(),this.interval),this.fire()},this.delay))}stop(e){this.isRunning()&&(this.delayID&&(r.Z.clearTimeout(this.delayID),this.delayID=null),this.intervalID&&(r.Z.clearInterval(this.intervalID),this.intervalID=null),e&&!this.fired&&this.fire())}addCallback(e){this.callbacks.includes(e)||this.callbacks.push(e)}removeCallback(e){const t=this.callbacks.indexOf(e);-1!==t&&this.callbacks.splice(t,1)}fire(){const e=this.callbacks.slice(0);for(let t=0;t<e.length;t++)e[t]();this.fired=!0}dispose(){this.stop(!1),this.callbacks.length=0}}n.Z.register("CallbackTimer",o)},4075:(e,t,i)=>{"use strict";i.d(t,{Nt:()=>C,WZ:()=>w,ZP:()=>m,oL:()=>B});var s=i(1005),n=i(3600),r=i(538),o=i(7922),A=i(592),a=i(4869),h=i(6596),l=i(2550),g=i(1935),c=i(8664),d=i(7374);function u(e,t,i){try{return t(...i.map(e=>e.get()))}finally{}}class m extends g.Z{constructor(e,t,i){const n=(0,l.ZP)()({phetioReadOnly:!0,phetioOuterType:m.DerivedPropertyIO,phetioLinkDependencies:!0,accessNonDependencies:!1},i);super(u(n.accessNonDependencies,t,e),n),s.Z.VALIDATION&&this.isPhetioInstrumented(),this.dependencies=e,this.derivation=t,this.accessNonDependencies=n.accessNonDependencies,this.derivedPropertyListener=this.getDerivedPropertyListener.bind(this),e.forEach(e=>{if(e.lazyLink(this.derivedPropertyListener),s.Z.PHET_IO_ENABLED&&this.isPhetioInstrumented()&&e instanceof c.Z&&e.isPhetioInstrumented()&&(e instanceof g.Z&&a.Z.registerPhetioOrderDependency(e,h.Z.UNDEFER,this,h.Z.UNDEFER),n.tandem&&n.phetioLinkDependencies)){const t=n.tandem.createTandem("dependencies");this.addLinkedElement(e,{tandem:t.createTandemFromPhetioID(e.tandem.phetioID)})}})}hasDependency(e){return this.definedDependencies.includes(e)}get definedDependencies(){return this.dependencies}getDerivedPropertyListener(){this.isDisposed||(this.isDeferred?this.hasDeferredValue=!0:super.set(u(this.accessNonDependencies,this.derivation,this.definedDependencies)))}recomputeDerivation(){this.getDerivedPropertyListener()}dispose(){const e=this.definedDependencies;for(let t=0;t<e.length;t++){const i=e[t];i.hasListener(this.derivedPropertyListener)&&i.unlink(this.derivedPropertyListener)}this.dependencies=null,super.dispose()}setDeferred(e){return this.isDeferred&&!e&&(this.deferredValue=u(this.accessNonDependencies,this.derivation,this.definedDependencies)),super.setDeferred(e)}static valueEquals(e,t,i){return new m([e,t],(e,t)=>e===t,i)}static valueEqualsConstant(e,t,i){return new m([e],e=>e===t,i)}static and(e,t){return m.deriveAny(e,()=>_.reduce(e,p,!0),t)}static or(e,t){return m.deriveAny(e,()=>_.reduce(e,V,!1),t)}static not(e,t){return new m([e],e=>!e,t)}static deriveAny(e,t,i){return new m(e,t,i)}}const p=(e,t)=>e&&t.value,V=(e,t)=>e||t.value,M=new d.Z;m.DerivedPropertyIO=e=>(M.has(e)||M.set(e,new n.Z(`DerivedPropertyIO<${e.typeName}>`,{valueType:m,parameterTypes:[e],supertype:A.Z.PropertyIO(e),documentation:"Like PropertyIO, but not settable.  Instead it is derived from other DerivedPropertyIO or PropertyIO instances",applyState:_.noop,methods:{setValue:{returnType:r.Z,parameterTypes:[e],implementation:m.prototype.set,documentation:"Errors out when you try to set a derived property.",invocableForReadOnlyElements:!1}}})),M.get(e));class B extends m{}class w extends m{}class C extends m{}o.Z.register("DerivedProperty",m)},1731:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(7922),n=i(1685);class r{constructor(e){_defineProperty(this,"_disposeEmitter",new n.Z),_defineProperty(this,"_isDisposable",!0),_defineProperty(this,"_isDisposed",!1),e&&this.initializeDisposable(e)}getDisposeEmitter(){return this._disposeEmitter}get disposeEmitter(){return this.getDisposeEmitter()}get isDisposed(){return this._isDisposed}get isDisposable(){return this._isDisposable}set isDisposable(e){this._isDisposable=e}initializeDisposable(e){e&&e.hasOwnProperty("isDisposable")&&(this._isDisposable=e.isDisposable)}dispose(){this._disposeEmitter.emit(),this._disposeEmitter.dispose(),this._isDisposed=!0}static assertNotDisposable(){}}s.Z.register("Disposable",r);const o=r},1383:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(7922),n=i(1935),r=i(2550);class o extends n.Z{constructor(e,t){const i=(0,r.ZP)()({bidirectional:!1,defaultValue:null,derive:_.identity,map:_.identity,inverseMap:_.identity},t),s=i.derive,n=i.map,o=i.inverseMap,A="function"==typeof s?s:e=>e[s],a="function"==typeof n?n:e=>e[n],h="function"==typeof o?o:e=>e[o];super(null===e.value?a(i.defaultValue):a(A(e.value).value),i),this.defaultValue=i.defaultValue,this.derive=A,this.map=a,this.inverseMap=h,this.bidirectional=i.bidirectional,this.valuePropertyProperty=e,this.isExternallyChanging=!1,this.propertyPropertyListener=this.onPropertyPropertyChange.bind(this),this.propertyListener=this.onPropertyChange.bind(this),e.link(this.propertyListener),i.bidirectional&&this.lazyLink(this.onSelfChange.bind(this))}onPropertyPropertyChange(e,t,i){if(this.bidirectional&&null!==this.valuePropertyProperty.value&&i){if(this.derive(this.valuePropertyProperty.value)===i&&i.areValuesEqual(this.inverseMap(this.value),i.get()))return}super.set(this.map(e))}onPropertyChange(e,t){t&&this.derive(t).unlink(this.propertyPropertyListener),e?this.derive(e).link(this.propertyPropertyListener):this.onPropertyPropertyChange(this.defaultValue,null,null)}onSelfChange(e){if(null!==this.valuePropertyProperty.value){const t=this.derive(this.valuePropertyProperty.value);this.areValuesEqual(e,this.map(t.value))||(t.value=this.inverseMap(e))}}dispose(){this.valuePropertyProperty.unlink(this.propertyListener),null!==this.valuePropertyProperty.value&&this.derive(this.valuePropertyProperty.value).unlink(this.propertyPropertyListener),super.dispose()}reset(){if(null!==this.valuePropertyProperty.value){this.derive(this.valuePropertyProperty.value).reset()}}set(e){this.isExternallyChanging=!0,super.set(e),this.isExternallyChanging=!1}get value(){return super.value}set value(e){this.set(e)}isSettable(){return super.isSettable()||this.bidirectional}}s.Z.register("DynamicProperty",o)},3061:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>p});var n=i(2550),r=i(6292),o=i(3600),A=i(538),a=i(516),h=i(7922),l=i(1685),g=i(1005),c=i(2306),d=i(2643),u=i(0),m=i(7374);class p extends a.Z{constructor(e){const t=(0,n.ZP)()({phetioOuterType:p.EmitterIO,phetioState:!1},e);super(t),this.tinyEmitter=new l.Z(null,t.hasListenerOrderDependencies)}emit(){g.Z.PHET_IO_ENABLED&&this.isPhetioInstrumented()&&this.phetioStartEvent("emitted",{data:this.getPhetioData(...arguments)}),this.tinyEmitter.emit(...arguments),g.Z.PHET_IO_ENABLED&&this.isPhetioInstrumented()&&this.phetioEndEvent()}dispose(){this.tinyEmitter.dispose(),super.dispose()}addListener(e){this.tinyEmitter.addListener(e)}removeListener(e){this.tinyEmitter.removeListener(e)}removeAllListeners(){this.tinyEmitter.removeAllListeners()}hasListener(e){return this.tinyEmitter.hasListener(e)}hasListeners(){return this.tinyEmitter.hasListeners()}getListenerCount(){return this.tinyEmitter.getListenerCount()}debug(e){const t=function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return console.log(e,...i)};return this.addListener(t),t}}s=p,_defineProperty(p,"EmitterIO",e=>{const t=e.map(V).join(",");return M.has(t)||M.set(t,new o.Z(`EmitterIO<${e.map(V).join(", ")}>`,{valueType:s,documentation:"Emits when an event occurs and calls added listeners.",parameterTypes:e,events:["emitted"],metadataDefaults:{phetioState:!1},methods:{addListener:{returnType:A.Z,parameterTypes:[(0,r.Z)(A.Z,e)],implementation:s.prototype.addListener,documentation:"Adds a listener which will be called when the emitter emits."},removeListener:{returnType:A.Z,parameterTypes:[(0,r.Z)(A.Z,e)],implementation:s.prototype.removeListener,documentation:"Remove a listener."},emit:{returnType:A.Z,parameterTypes:e,implementation:function(){this.emit(...arguments)},documentation:"Emits a single event to all listeners.",invocableForReadOnlyElements:!1},getValidationErrors:{returnType:(0,u.Z)((0,c.Z)(d.Z)),parameterTypes:e,implementation:function(){return this.getValidationErrors(...arguments)},documentation:"Checks to see if the proposed values are valid. Returns an array of length N where each element is an error (string) or null if the value is valid."}}})),M.get(t)});const V=e=>e.typeName,M=new m.Z;h.Z.register("Emitter",p)},4317:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(6871),n=i(831),r=i(2550),o=i(1005),A=i(7922),a=i(1731);const h={enabledProperty:null,enabled:!0,enabledPropertyOptions:null,phetioEnabledPropertyInstrumented:!0,tandem:i(8664).Z.DEFAULT_OPTIONS.tandem};class l extends a.Z{constructor(e){const t=(0,r.lB)()({},h,e),i=!t.enabledProperty;super(t),this.enabledProperty=t.enabledProperty||new s.Z(t.enabled,(0,n.Z)({tandem:t.phetioEnabledPropertyInstrumented?t.tandem.createTandem(s.Z.TANDEM_NAME):o.Z.OPT_OUT},t.enabledPropertyOptions)),this.disposeEnabledComponent=()=>{i&&this.enabledProperty.dispose()}}setEnabled(e){this.enabledProperty.value=e}set enabled(e){this.setEnabled(e)}get enabled(){return this.isEnabled()}isEnabled(){return this.enabledProperty.value}dispose(){this.disposeEnabledComponent(),super.dispose()}}A.Z.register("EnabledComponent",l)},6871:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2550),n=i(7922),r=i(9806);class o extends r.Z{constructor(e,t){const i=(0,s.ZP)()({phetioDocumentation:"Determines whether the element is enabled (true) or disabled (false).",phetioFeatured:!0,checkTandemName:!0},t);super(e,i)}static get TANDEM_NAME(){return"enabledProperty"}}n.Z.register("EnabledProperty",o)},9969:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(7922);class n{constructor(e,t,i){if(this.dependencies=e,this.dependencyListeners=new Map,e.forEach(i=>{const s=()=>{if(!this.isDisposed){const i=e.map(e=>e.get());t(...i)}};this.dependencyListeners.set(i,s),i.lazyLink(s,{phetioDependencies:_.without(e,i)})}),!i){const i=e.map(e=>e.get());t(...i)}this.isDisposed=!1}get definedDependencies(){return this.dependencies}dispose(){const e=this.definedDependencies;for(let t=0;t<e.length;t++){const i=e[t],s=this.dependencyListeners.get(i);i.hasListener(s)&&i.unlink(s)}this.dependencies=null,this.dependencyListeners.clear(),this.isDisposed=!0}static multilink(e,t){return new n(e,t,!1)}static multilinkAny(e,t){return new n(e,t)}static lazyMultilink(e,t){return new n(e,t,!0)}static lazyMultilinkAny(e,t){return new n(e,t,!0)}static unmultilink(e){e.dispose()}}s.Z.register("Multilink",n)},8036:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>M});var n=i(5428),r=i(2550),o=i(1005),A=i(3600),a=i(2306),h=i(8585),l=i(2643),g=i(7922),c=i(1935),d=i(592);i(7959),i(6212);const u={valueType:"number",isValidValue:e=>e%1==0,validationMessage:"Should be a valid integer"},m={isValidValue:e=>!isNaN(e),validationMessage:"Should not be NaN"},p=n.Z.EVERYTHING,V=d.Z.PropertyIO(h.Z);class M extends d.Z{constructor(e,t){var i;const s=(0,r.ZP)()({numberType:"FloatingPoint",range:p,validators:[],phetioOuterType:()=>M.NumberPropertyIO},t);s.rangePropertyOptions=(0,r.ZP)()({phetioDocumentation:"Provides the range of possible values for the parent NumberPropertyIO",phetioValueType:n.Z.RangeIO,phetioReadOnly:!0,tandem:s.range!==p?null===(i=s.tandem)||void 0===i?void 0:i.createTandem("rangeProperty"):o.Z.OPT_OUT},s.rangePropertyOptions),s.valueType="number",s.phetioValueType=h.Z;const A=!(s.range&&s.range instanceof c.Z),a=s.range instanceof c.Z?s.range:new d.Z(s.range,s.rangePropertyOptions);s.validators.push(m),"Integer"===s.numberType&&s.validators.push(u);let l=!1;s.validators.push({isValidValue:e=>a.value.contains(e),validationMessage:()=>`Number value ${l?this.value:e} must be within rangeProperty value: ${a.value}`}),super(e,s),l=!0,this.numberType=s.numberType,this.rangeProperty=a;if(this.rangeProperty.addPhetioStateDependencies([this]),this.addPhetioStateDependencies([this.rangeProperty]),s.validValues&&this.validateNumberAndRangeProperty)for(let n=0;n<s.validValues.length;n++){const e=s.validValues[n];this.validateNumberAndRangeProperty(e)}this.disposeNumberProperty=()=>{A&&this.rangeProperty.dispose()},this.resetNumberProperty=()=>{A&&this.rangeProperty.reset()}}get range(){return this.rangeProperty.value}set range(e){this.rangeProperty.value=e}reset(){this.resetValueAndRange(),super.reset()}dispose(){this.disposeNumberProperty(),super.dispose()}setValueAndRange(e,t){this.setDeferred(!0),this.rangeProperty.setDeferred(!0),this.set(e),this.rangeProperty.set(t);const i=this.setDeferred(!1),s=this.rangeProperty.setDeferred(!1);i&&i(),s&&s()}resetValueAndRange(){this.setValueAndRange(this.initialValue,this.rangeProperty.initialValue)}toStateObject(){const e=super.toStateObject();e.numberType=this.numberType,e.range=n.Z.RangeIO.toStateObject(this.rangeProperty.value);const t=this.rangeProperty&&this.rangeProperty.isPhetioInstrumented();return e.rangePhetioID=t?this.rangeProperty.tandem.phetioID:null,e}}s=M,_defineProperty(M,"NumberPropertyIO",new A.Z("NumberPropertyIO",{valueType:s,supertype:V,parameterTypes:[h.Z],documentation:`Extends PropertyIO to add values for the numeric range ( min, max ) and numberType ( '${["FloatingPoint","Integer"].join("' | '")}' )`,toStateObject:e=>e.toStateObject(),applyState:(e,t)=>{V.applyState(e,t)},stateSchema:{numberType:l.Z,range:n.Z.RangeIO,rangePhetioID:(0,a.Z)(l.Z)}})),g.Z.register("NumberProperty",M)},592:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(1935),n=i(7922);class r extends s.Z{constructor(e,t){super(e,t),this._initialValue=e}getInitialValue(){return this._initialValue}get initialValue(){return this.getInitialValue()}setInitialValue(e){this._initialValue=e}get value(){return super.value}set value(e){super.set(e)}reset(){this.set(this._initialValue)}set(e){super.set(e)}isSettable(){return!0}}n.Z.register("Property",r)},6596:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>a});var n=i(2956),r=i(4676),o=i(7922);class A extends r.Z{}_defineProperty(A,"UNDEFER",new(s=A)),_defineProperty(A,"NOTIFY",new s),_defineProperty(A,"enumeration",new n.Z(s)),o.Z.register("PropertyStatePhase",A);const a=A},1935:(e,t,i)=>{"use strict";i.d(t,{Z:()=>q,h:()=>I});var s=i(8664),n=i(1005),r=i(0),o=i(6292),A=i(3600),a=i(2306),h=i(2643),l=i(538),g=i(4869),c=i(6596),d=i(8292),u=i(7922);const m={values:["1/(cm*M)","%","A","AMU","atm","AU","cm","cm^2","C","°","°C","F","°F","g","G","Hz","J","K","kg","kg/m^3","kg·m/s","km/s","kPa","L","L/s","m","m^3","m/s","m/s/s","m/s^2","mA","mm","mol","mol/L","mol/s","M","N","N/m","nm","nm/ps","N·s/m","Ω","Ω·cm","Pa·s","particles/ps","pm","pm/ps","pm/s","pm/s^2","pm^3","ps","radians","radians/s","radians/s^2","s","V","view-coordinates/s","W","Wb","years"],isValidUnits:function(e){return _.includes(m.values,e)}};u.Z.register("units",m);i(7959);var p=i(2550),V=i(6685),M=i(1773),B=i(4974);const w=new d.Z(!1);B.Z.register("isPhetioStateEngineManagingPropertyValuesProperty",w);const C=w;var E=i(7374);const Y={validateValidator:!1};let D=0;const y=new E.Z,I=[];class q extends s.Z{constructor(e,t){const i=(0,p.ZP)()({units:null,reentrant:!1,hasListenerOrderDependencies:!1,phetioOuterType:q.PropertyIO,phetioValueType:A.Z.ObjectIO},t);i.units&&(i.phetioEventMetadata=i.phetioEventMetadata||{},i.phetioEventMetadata.units=i.units),i.phetioOuterType&&i.phetioValueType&&(i.phetioType=i.phetioOuterType(i.phetioValueType)),V.Z.containsValidatorKey(i)||(i.isValidValue=()=>!0),super(i),this.id=D++,this.units=i.units,this.isPhetioInstrumented(),this.validValues=i.validValues,this.tinyProperty=new d.Z(e,null,i.hasListenerOrderDependencies),this.tinyProperty.useDeepEquality=i.valueComparisonStrategy&&"equalsFunction"===i.valueComparisonStrategy,this.notifying=!1,this.reentrant=i.reentrant,this.isDeferred=!1,this.deferredValue=null,this.hasDeferredValue=!1,this.phetioValueType=i.phetioValueType,this.valueValidator=_.pick(i,V.Z.VALIDATOR_KEYS),this.valueValidator.validationMessage=this.valueValidator.validationMessage||"Property value not valid",this.valueValidator.phetioType&&(this.valueValidator.phetioType=this.valueValidator.phetioType.parameterTypes[0])}isSettable(){return!1}get(){return this.tinyProperty.get()}set(e){C.value&&!M.Z.value&&this.isPhetioInstrumented()&&this.phetioState&&this.isSettable()||this.unguardedSet(e)}unguardedSet(e){if(!this.isDisposed)if(this.isDeferred)this.deferredValue=e,this.hasDeferredValue=!0;else if(!this.equalsValue(e)){const t=this.get();this.setPropertyValue(e),this._notifyListeners(t)}}setPropertyValue(e){this.tinyProperty.setPropertyValue(e)}equalsValue(e){return this.areValuesEqual(e,this.get())}areValuesEqual(e,t){return this.tinyProperty.areValuesEqual(e,t)}_notifyListeners(e){const t=this.get();n.Z.PHET_IO_ENABLED&&this.isPhetioInstrumented()&&this.phetioStartEvent(q.CHANGED_EVENT_NAME,{getData:()=>{const i=this.phetioType.parameterTypes[0];return{oldValue:(0,a.Z)(i).toStateObject(e),newValue:i.toStateObject(t)}}}),this.notifying=!0,this.tinyProperty.emit(t,e,this),this.notifying=!1,n.Z.PHET_IO_ENABLED&&this.isPhetioInstrumented()&&this.phetioEndEvent()}notifyListenersStatic(){this._notifyListeners(null)}toStateObject(){return{value:this.phetioValueType.toStateObject(this.value),validValues:(0,a.Z)((0,r.Z)(this.phetioValueType)).toStateObject(void 0===this.validValues?null:this.validValues),units:(0,a.Z)(h.Z).toStateObject(this.units)}}applyState(e){(0,a.Z)(h.Z).fromStateObject(e.units);this.unguardedSet(this.phetioValueType.fromStateObject(e.value)),e.validValues&&(this.validValues=e.validValues.map(e=>this.phetioValueType.fromStateObject(e)))}setDeferred(e){if(e)this.isDeferred=!0;else{this.isDeferred=!1;const e=this.get();if(this.hasDeferredValue&&(this.setPropertyValue(this.deferredValue),this.hasDeferredValue=!1,this.deferredValue=null),!this.equalsValue(e))return()=>!this.isDisposed&&this._notifyListeners(e)}return null}get value(){return this.get()}set value(e){this.set(e)}addPhetioStateDependencies(e){for(let t=0;t<e.length;t++){const i=e[t];i instanceof q&&i.isPhetioInstrumented()&&this.isPhetioInstrumented()&&g.Z.registerPhetioOrderDependency(i,c.Z.UNDEFER,this,c.Z.NOTIFY)}}link(e,t){t&&t.phetioDependencies&&this.addPhetioStateDependencies(t.phetioDependencies),this.tinyProperty.addListener(e),e(this.get(),null,this)}lazyLink(e,t){t&&t.phetioDependencies&&this.addPhetioStateDependencies(t.phetioDependencies),this.tinyProperty.lazyLink(e)}unlink(e){this.tinyProperty.unlink(e)}unlinkAll(){this.tinyProperty.unlinkAll()}linkAttribute(e,t){const i=i=>{e[t]=i};return this.link(i),i}toString(){return`Property#${this.id}{${this.get()}}`}debug(e){const t=t=>console.log(e,t);return this.link(t),t}isValueValid(e){return null===this.getValidationError(e)}getValidationError(e){return V.Z.getValidationError(e,this.valueValidator,Y)}dispose(){this.isPhetioInstrumented()&&g.Z.unregisterOrderDependenciesForProperty(this),super.dispose(),this.tinyProperty.dispose()}hasListener(e){return this.tinyProperty.hasListener(e)}getListenerCount(){return this.tinyProperty.getListenerCount()}forEachListener(e){this.tinyProperty.forEachListener(e)}hasListeners(){return this.tinyProperty.hasListeners()}static PropertyIO(e){return y.has(e)||y.set(e,new A.Z(`PropertyIO<${e.typeName}>`,{valueType:q,documentation:"Observable values that send out notifications when the value changes. This differs from the traditional listener pattern in that added listeners also receive a callback with the current value when the listeners are registered. This is a widely-used pattern in PhET-iO simulations.",methodOrder:["link","lazyLink"],events:[q.CHANGED_EVENT_NAME],parameterTypes:[e],toStateObject:e=>e.toStateObject(),applyState:(e,t)=>{e.applyState(t)},stateSchema:{value:e,validValues:(0,a.Z)((0,r.Z)(e)),units:(0,a.Z)(h.Z)},methods:{getValue:{returnType:e,parameterTypes:[],implementation:q.prototype.get,documentation:"Gets the current value."},getValidationError:{returnType:(0,a.Z)(h.Z),parameterTypes:[e],implementation:q.prototype.getValidationError,documentation:"Checks to see if a proposed value is valid. Returns the first validation error, or null if the value is valid."},setValue:{returnType:l.Z,parameterTypes:[e],implementation:function(e){this.set(e)},documentation:"Sets the value of the Property. If the value differs from the previous value, listeners are notified with the new value.",invocableForReadOnlyElements:!1},link:{returnType:l.Z,parameterTypes:[(0,o.Z)(l.Z,[e,(0,a.Z)(e)])],implementation:q.prototype.link,documentation:"Adds a listener which will be called when the value changes. On registration, the listener is also called with the current value. The listener takes two arguments, the new value and the previous value."},lazyLink:{returnType:l.Z,parameterTypes:[(0,o.Z)(l.Z,[e,(0,a.Z)(e)])],implementation:q.prototype.lazyLink,documentation:'Adds a listener which will be called when the value changes. This method is like "link", but without the current-value callback on registration. The listener takes two arguments, the new value and the previous value.'},unlink:{returnType:l.Z,parameterTypes:[(0,o.Z)(l.Z,[e])],implementation:q.prototype.unlink,documentation:"Removes a listener."}}})),y.get(e)}getPhetioMouseHitTarget(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"string"===phet.tandem.phetioElementSelectionProperty.value?this.getPhetioMouseHitTargetSelf():super.getPhetioMouseHitTarget(e)}}_defineProperty(q,"TANDEM_NAME_SUFFIX","Property"),_defineProperty(q,"CHANGED_EVENT_NAME","changed"),u.Z.register("ReadOnlyProperty",q)},8311:(e,t,i)=>{"use strict";i.d(t,{Z:()=>A});var s=i(2550),n=i(2643),r=i(7922),o=i(592);class A extends o.Z{constructor(e,t){super(e,(0,s.ZP)()({valueType:"string",phetioValueType:n.Z},t))}}r.Z.register("StringProperty",A)},7857:(e,t,i)=>{"use strict";i.d(t,{i:()=>r});var s=i(1935),n=i(8292);function r(e){return e instanceof s.Z||e instanceof n.Z}},5891:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(7922),n=i(1685);class r extends n.Z{setTimeout(e,t){let i=0;const s=n=>{i+=n,1e3*i>=t&&this.hasListener(s)&&(e(),this.removeListener(s))};return this.addListener(s),s}clearTimeout(e){this.hasListener(e)&&this.removeListener(e)}setInterval(e,t){let i=0;const s=n=>{for(i+=n;1e3*i>=t&&this.hasListener(s);)e(),i-=t/1e3};return this.addListener(s),s}clearInterval(e){this.hasListener(e)&&this.removeListener(e)}runOnNextTick(e){this.setTimeout(e,0)}}s.Z.register("Timer",r)},1685:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(7922),n=i(7023),r=i(6918);const o=_.hasIn(window,"phet.chipper.queryParameters")&&phet.chipper.queryParameters.listenerOrder;_.hasIn(window,"phet.chipper.queryParameters")&&phet.chipper.queryParameters.listenerLimit;let A=null;if(o&&o.startsWith("random")){const e=o.match(/random(?:%28|\()(\d+)(?:%29|\))/),t=e?Number(e[1]):r.Z.nextInt(1e6);A=new n.Z({seed:t}),console.log("listenerOrder random seed: "+A.seed)}class a{constructor(e,t){e&&(this.onBeforeNotify=e),t&&(this.hasListenerOrderDependencies=t),this.listeners=new Set,this.emitContexts=[]}dispose(){this.removeAllListeners()}emit(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(this.onBeforeNotify&&this.onBeforeNotify.apply(null,t),this.listeners.size>0){const e={index:0};this.emitContexts.push(e);for(const i of this.listeners)if(i(...t),e.index++,e.listenerArray)break;if(e.listenerArray)for(let i=e.index;i<e.listenerArray.length;i++)e.listenerArray[i](...t);this.emitContexts.pop()}}addListener(e){this.guardListeners(),this.listeners.add(e),this.changeCount&&this.changeCount(1)}removeListener(e){this.guardListeners(),this.listeners.delete(e),this.changeCount&&this.changeCount(-1)}removeAllListeners(){const e=this.listeners.size;this.guardListeners(),this.listeners.clear(),this.changeCount&&this.changeCount(-e)}guardListeners(){for(let e=this.emitContexts.length-1;e>=0&&!this.emitContexts[e].listenerArray;e--)this.emitContexts[e].listenerArray=Array.from(this.listeners)}hasListener(e){return this.listeners.has(e)}hasListeners(){return this.listeners.size>0}getListenerCount(){return this.listeners.size}forEachListener(e){this.listeners.forEach(e)}}s.Z.register("TinyEmitter",a)},8292:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(7922),n=i(1685);class r extends n.Z{constructor(e,t,i){super(t,i),this._value=e}get(){return this._value}get value(){return this.get()}set value(e){this.set(e)}set(e){if(!this.equalsValue(e)){const t=this._value;this.setPropertyValue(e),this.notifyListeners(t)}}setPropertyValue(e){this._value=e}equalsValue(e){return this.areValuesEqual(e,this._value)}areValuesEqual(e,t){if(this.useDeepEquality){const i=e,s=t;if(i&&s&&i.constructor===s.constructor)return i.equals(s)}return e===t}notifyListeners(e){this.emit(this._value,e,this)}link(e){this.addListener(e),e(this._value,null,this)}lazyLink(e){this.addListener(e)}unlink(e){this.removeListener(e)}unlinkAll(){this.removeAllListeners()}linkAttribute(e,t){const i=i=>{e[t]=i};return this.link(i),i}isSettable(){return!0}dispose(){this.unlinkAll(),super.dispose()}}s.Z.register("TinyProperty",r)},6685:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(8676),n=i(831),r=i(8378);class o{constructor(e){(0,s.Z)("EnumerationDeprecated should be exchanged for classes that extend EnumerationValue, see WilderEnumerationPatterns for examples.");e.keys,e.map;const t=e.keys||Object.keys(e.map),i=e.map||{};e=(0,n.Z)({phetioDocumentation:null,beforeFreeze:null},e),this.phetioDocumentation=e.phetioDocumentation,this.KEYS=t,this.VALUES=[],t.forEach(e=>{const t=i[e]||{};t.name=e,t.toString=()=>e,this[e]=t,this.VALUES.push(t)}),e.beforeFreeze&&e.beforeFreeze(this)}toString(){return this.KEYS.join(", ")}includes(e){return _.includes(this.VALUES,e)}getValue(e){return this[e]}getKey(e){return e.name}get values(){return this.VALUES}get keys(){return this.KEYS}get enumeration(){return this}static byKeys(e,t){return new o((0,n.Z)({keys:e},t))}static byMap(e,t){return new o((0,n.Z)({map:e},t))}}r.Z.register("EnumerationDeprecated",o);const A=o;var a=i(2550),h=i(7922);const l=["string","number","boolean","function"],g=["valueType","validValues","valueComparisonStrategy","isValidValue","phetioType","validators"];class c{static getValidatorValidationError(e){if(!(e instanceof Object))return"validator must be an Object";if(!(e.hasOwnProperty("isValidValue")||e.hasOwnProperty("valueType")||e.hasOwnProperty("validValues")||e.hasOwnProperty("valueComparisonStrategy")||e.hasOwnProperty("phetioType")||e.hasOwnProperty("validators")))return this.combineErrorMessages("validator must have at least one of: "+g.join(","),e.validationMessage);if(e.hasOwnProperty("valueType")){const t=c.getValueOrElementTypeValidationError(e.valueType);if(t)return this.combineErrorMessages(`Invalid valueType: ${e.valueType}, error: ${t}`,e.validationMessage)}if(e.hasOwnProperty("isValidValue")&&"function"!=typeof e.isValidValue&&null!==e.isValidValue&&void 0!==e.isValidValue)return this.combineErrorMessages("isValidValue must be a function: "+e.isValidValue,e.validationMessage);if(e.hasOwnProperty("valueComparisonStrategy")&&"reference"!==e.valueComparisonStrategy&&"lodashDeep"!==e.valueComparisonStrategy&&"equalsFunction"!==e.valueComparisonStrategy&&"function"!=typeof e.isValidValue)return this.combineErrorMessages('valueComparisonStrategy must be "reference", "lodashDeep", \n        "equalsFunction", or a comparison function: '+e.valueComparisonStrategy,e.validationMessage);if(void 0!==e.validValues&&null!==e.validValues){if(!Array.isArray(e.validValues))return this.combineErrorMessages("validValues must be an array: "+e.validValues,e.validationMessage);const t=_.omit(e,"validValues");if(c.containsValidatorKey(t))for(let i=0;i<e.validValues.length;i++){const s=e.validValues[i],n=c.getValidationError(s,t);if(n)return this.combineErrorMessages(`Item not valid in validValues: ${s}, error: ${n}`,e.validationMessage)}}if(e.hasOwnProperty("phetioType")){if(!e.phetioType)return this.combineErrorMessages("falsey phetioType provided",e.validationMessage);if(!e.phetioType.validator)return this.combineErrorMessages("validator needed for phetioType: "+e.phetioType.typeName,e.validationMessage);const t=c.getValidatorValidationError(e.phetioType.validator);if(t)return this.combineErrorMessages(t,e.validationMessage)}if(e.hasOwnProperty("validators")){const t=e.validators;for(let i=0;i<t.length;i++){const s=t[i],n=c.getValidatorValidationError(s);if(n)return this.combineErrorMessages(`validators[${i}] invalid: ${n}`,e.validationMessage)}}return null}static getValueTypeValidatorValidationError(e){return"function"==typeof e||"string"==typeof e||e instanceof A||null==e?"string"!=typeof e||_.includes(l,e)?null:"valueType not a supported primitive types: "+e:"valueType must be {function|string|EnumerationDeprecated|null|undefined}, valueType="+e}static validateValidator(e){0}static containsValidatorKey(e){if(!(e instanceof Object))return!1;for(let t=0;t<g.length;t++)if(e.hasOwnProperty(g[t]))return!0;return!1}static combineErrorMessages(e,t){return t&&(e=`${"function"==typeof t?t():t}: ${e}`),e}static isValueValid(e,t,i){return null===this.getValidationError(e,t,i)}static getValidationError(e,t,i){const s=(0,a.ZP)()({validateValidator:!0},i);if(s.validateValidator){const e=c.getValidatorValidationError(t);if(e)return e}if(t.hasOwnProperty("valueType")){const i=t.valueType;if(Array.isArray(i)){if(!_.some(i.map(i=>!c.getValueTypeValidationError(e,i,t.validationMessage))))return this.combineErrorMessages(`value not valid for any valueType in ${i.toString().substring(0,100)}, value: ${e}`,t.validationMessage)}else if(i){const s=c.getValueTypeValidationError(e,i,t.validationMessage);if(s)return s}}if(t.validValues){const i=t.valueComparisonStrategy||"reference";if(!t.validValues.some(t=>{if("reference"===i)return t===e;if("equalsFunction"===i){const i=t;return i.equals(e)}return"lodashDeep"===i?_.isEqual(t,e):i(t,e)}))return this.combineErrorMessages("value not in validValues: "+e,t.validationMessage)}if(t.hasOwnProperty("isValidValue")&&!t.isValidValue(e))return this.combineErrorMessages("value failed isValidValue: "+e,t.validationMessage);if(t.hasOwnProperty("phetioType")){const i=c.getValidationError(e,t.phetioType.validator,s);if(i)return this.combineErrorMessages(`value failed phetioType validator: ${e}, error: ${i}`,t.validationMessage)}if(t.hasOwnProperty("validators")){const i=t.validators;for(let n=0;n<i.length;n++){const r=i[n],o=c.getValidationError(e,r,s);if(o)return this.combineErrorMessages(`Failed validation for validators[${n}]: ${o}`,t.validationMessage)}}return null}static getValueTypeValidationError(e,t,i){return"string"==typeof t&&typeof e!==t?this.combineErrorMessages(`value should have typeof ${t}, value=${e}`,i):t!==Array||Array.isArray(e)?t instanceof A&&!t.includes(e)?this.combineErrorMessages("value is not a member of EnumerationDeprecated "+t,i):"function"!=typeof t||e instanceof t?null===t&&null!==e?this.combineErrorMessages("value should be null, value="+e,i):null:this.combineErrorMessages(`value should be instanceof ${t.name}, value=${e}`,i):this.combineErrorMessages("value should have been an array, value="+e,i)}static getValueOrElementTypeValidationError(e){if(Array.isArray(e))for(let t=0;t<e.length;t++){const i=e[t],s=c.getValueTypeValidatorValidationError(i);if(s)return"Array value invalid: "+s}else if(e){const t=c.getValueTypeValidatorValidationError(e);if(t)return"Value type invalid: "+t}return null}}_defineProperty(c,"VALIDATOR_KEYS",g),_defineProperty(c,"STRING_WITHOUT_TEMPLATE_VARS_VALIDATOR",{valueType:"string",isValidValue:e=>!/\{\{\w*\}\}/.test(e)}),h.Z.register("Validation",c)},732:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(7922);const n=new(i(5891).Z);s.Z.register("animationFrameTimer",n);const r=n},7922:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s=new(i(2492).Z)("axon")},1453:(e,t,i)=>{"use strict";i.d(t,{Z:()=>w});var s=i(9059),n=i(6212),r=i(831),o=i(2550),A=i(8664),a=i(0),h=i(3600),l=i(7922),g=i(3061),c=i(8036),d=i(6685),u=(i(8047),i(7374));const m=e=>{var t,i,s,A;(0,n.Z)(e,["length"],["elements"]);const a=(0,o.ZP)()({hasListenerOrderDependencies:!1,length:0,elements:[],elementAddedEmitterOptions:{},elementRemovedEmitterOptions:{},lengthPropertyOptions:{}},e);let h=null;if(a.phetioType)h={name:"value",phetioType:a.phetioType.parameterTypes[0]};else if(d.Z.getValidatorValidationError(a))h=(0,r.Z)({name:"value"},{isValidValue:_.stubTrue});else{const e=_.pick(a,d.Z.VALIDATOR_KEYS);h=(0,r.Z)({name:"value"},e)}const l=new g.Z((0,o.JA)({tandem:null===(t=a.tandem)||void 0===t?void 0:t.createTandem("elementAddedEmitter"),parameters:[h],phetioReadOnly:!0,hasListenerOrderDependencies:a.hasListenerOrderDependencies},a.elementAddedEmitterOptions)),u=new g.Z((0,o.JA)({tandem:null===(i=a.tandem)||void 0===i?void 0:i.createTandem("elementRemovedEmitter"),parameters:[h],phetioReadOnly:!0,hasListenerOrderDependencies:a.hasListenerOrderDependencies},a.elementRemovedEmitterOptions)),m=new c.Z(0,(0,o.JA)({numberType:"Integer",tandem:null===(s=a.tandem)||void 0===s?void 0:s.createTandem("lengthProperty"),phetioReadOnly:!0,hasListenerOrderDependencies:a.hasListenerOrderDependencies},a.lengthPropertyOptions)),M=[],B=new Proxy(M,{get:function(e,t,i){return V.hasOwnProperty(t)?V[t]:Reflect.get(e,t,i)},set:function(e,t,i){const s=e[t];let n=null;"length"===t&&(n=e.slice(i));const r=Reflect.set(e,t,i),o=Number(t);return Number.isInteger(o)&&o>=0&&s!==i?(m.value=e.length,void 0!==s&&u.emit(e[t]),void 0!==i&&l.emit(i)):"length"===t&&(m.value=i,n&&n.forEach(e=>u.emit(e))),r},deleteProperty:function(e,t){const i=Number(t);let s;Number.isInteger(i)&&i>=0&&(s=e[t]);const n=Reflect.deleteProperty(e,t);return void 0!==s&&u.emit(s),n}});B.targetArray=M,B.elementAddedEmitter=l,B.elementRemovedEmitter=u,B.lengthProperty=m;const w=()=>{a.length>=0&&(B.length=a.length),a.elements.length>0&&Array.prototype.push.apply(B,a.elements)};return w(),B.reset=()=>{B.length=0,w()},null!==(A=a.tandem)&&void 0!==A&&A.supplied&&(B.phetioElementType=a.phetioType.parameterTypes[0],B._observableArrayPhetioObject=new p(B,a)),B};class p extends A.Z{constructor(e,t){super(t),this.observableArray=e}}const V={pop(){const e=this.targetArray.length;for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Array.prototype.pop.apply(this.targetArray,i);return this.lengthProperty.value=this.length,e>0&&this.elementRemovedEmitter.emit(n),n},shift(){const e=this.targetArray.length;for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Array.prototype.shift.apply(this.targetArray,i);return this.lengthProperty.value=this.length,e>0&&this.elementRemovedEmitter.emit(n),n},push(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const s=this,n=Array.prototype.push.apply(s.targetArray,t);s.lengthProperty.value=s.length;for(let r=0;r<arguments.length;r++)s.elementAddedEmitter.emit(t[r]);return n},unshift(){const e=this;for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Array.prototype.unshift.apply(e.targetArray,i);e.lengthProperty.value=e.length;for(let r=0;r<i.length;r++)e.elementAddedEmitter.emit(i[r]);return n},splice(){const e=this;for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Array.prototype.splice.apply(e.targetArray,i);e.lengthProperty.value=e.length;const r=n;for(let o=2;o<i.length;o++)e.elementAddedEmitter.emit(i[o]);return r.forEach(t=>e.elementRemovedEmitter.emit(t)),n},copyWithin(){const e=this.targetArray.slice();for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Array.prototype.copyWithin.apply(this.targetArray,i);return M(e,this),n},fill(){const e=this.targetArray.slice();for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Array.prototype.fill.apply(this.targetArray,i);return M(e,this),n},get:function(e){return this[e]},addItemAddedListener:function(e){this.elementAddedEmitter.addListener(e)},removeItemAddedListener:function(e){this.elementAddedEmitter.removeListener(e)},addItemRemovedListener:function(e){this.elementRemovedEmitter.addListener(e)},removeItemRemovedListener:function(e){this.elementRemovedEmitter.removeListener(e)},add:function(e){this.push(e)},addAll:function(e){this.push(...e)},remove:function(e){(0,s.Z)(this,e)},removeAll:function(e){e.forEach(e=>(0,s.Z)(this,e))},clear:function(){for(;this.length>0;)this.pop()},count:function(e){let t=0;for(let i=0;i<this.length;i++)e(this[i])&&t++;return t},find:function(e,t){return _.find(this,e,t)},shuffle:function(e){const t=e.shuffle(this);this.targetArray.length=0,Array.prototype.push.apply(this.targetArray,t)},getArrayCopy:function(){return this.slice()},dispose:function(){this.elementAddedEmitter.dispose(),this.elementRemovedEmitter.dispose(),this.lengthProperty.dispose(),this._observableArrayPhetioObject&&this._observableArrayPhetioObject.dispose()},toStateObject:function(){return{array:this.map(e=>this.phetioElementType.toStateObject(e))}},applyState:function(e){this.length=0;const t=e.array.map(e=>this.phetioElementType.fromStateObject(e));this.push(...t)}},M=(e,t)=>{const i=e,s=t.targetArray.slice();for(let n=0;n<i.length;n++){const e=i[n],t=s.indexOf(e);t>=0&&(i.splice(n,1),s.splice(t,1),n--)}i.forEach(e=>t.elementRemovedEmitter.emit(e)),s.forEach(e=>t.elementAddedEmitter.emit(e))},B=new u.Z;m.ObservableArrayIO=e=>(B.has(e)||B.set(e,new h.Z(`ObservableArrayIO<${e.typeName}>`,{valueType:p,parameterTypes:[e],toStateObject:e=>e.observableArray.toStateObject(),applyState:(e,t)=>e.observableArray.applyState(t),stateSchema:{array:(0,a.Z)(e)}})),B.get(e)),l.Z.register("createObservableArray",m);const w=m},4869:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(7922),n=i(1005),r=i(6596),o=i(1935);class A{constructor(){_defineProperty(this,"initialized",!1),this.phaseCallbackSets=new l,this.undeferBeforeUndeferMapPair=new h(r.Z.UNDEFER,r.Z.UNDEFER),this.undeferBeforeNotifyMapPair=new h(r.Z.UNDEFER,r.Z.NOTIFY),this.notifyBeforeUndeferMapPair=new h(r.Z.NOTIFY,r.Z.UNDEFER),this.notifyBeforeNotifyMapPair=new h(r.Z.NOTIFY,r.Z.NOTIFY),this.mapPairs=[this.undeferBeforeUndeferMapPair,this.undeferBeforeNotifyMapPair,this.notifyBeforeUndeferMapPair,this.notifyBeforeNotifyMapPair]}initialize(e){e.onBeforeApplyStateEmitter.addListener(e=>{if(e instanceof o.Z&&!e.isDeferred){e.setDeferred(!0);const t=e.tandem.phetioID,i=()=>{const i=e.setDeferred(!1);this.phaseCallbackSets.addNotifyPhaseCallback(new a(t,r.Z.NOTIFY,i||_.noop))};this.phaseCallbackSets.addUndeferPhaseCallback(new a(t,r.Z.UNDEFER,i))}}),e.undeferEmitter.addListener(e=>{this.undeferAndNotifyProperties(new Set(Object.keys(e)))}),e.isSettingStateProperty.lazyLink(e=>{}),this.initialized=!0}static validateInstrumentedProperty(e){}validatePropertyPhasePair(e,t){A.validateInstrumentedProperty(e)}getMapPairFromPhases(e,t){const i=this.mapPairs.filter(i=>e===i.beforePhase&&t===i.afterPhase);return i[0]}registerPhetioOrderDependency(e,t,i,s){if(n.Z.PHET_IO_ENABLED){this.validatePropertyPhasePair(e,t),this.validatePropertyPhasePair(i,s),this.getMapPairFromPhases(t,s).addOrderDependency(e.tandem.phetioID,i.tandem.phetioID)}}propertyInAnOrderDependency(e){return A.validateInstrumentedProperty(e),_.some(this.mapPairs,t=>t.usesPhetioID(e.tandem.phetioID))}unregisterOrderDependenciesForProperty(e){n.Z.PHET_IO_ENABLED&&(A.validateInstrumentedProperty(e),this.propertyInAnOrderDependency(e)&&this.mapPairs.forEach(t=>t.unregisterOrderDependenciesForProperty(e)))}undeferAndNotifyProperties(e){const t={};let i=0;for(;this.phaseCallbackSets.size>0;)i++,i>5e3&&this.errorInUndeferAndNotifyStep(t),this.attemptToApplyPhases(r.Z.UNDEFER,t,e),this.attemptToApplyPhases(r.Z.NOTIFY,t,e)}errorInUndeferAndNotifyStep(e){const t=[];this.phaseCallbackSets.forEach(e=>t.push(e.getTerm()));const i=[];this.mapPairs.forEach(e=>{const s=e.beforeMap;for(const[n,r]of s)r.forEach(e=>{const r=n+s.beforePhase,o=e+s.afterPhase;(t.includes(r)||t.includes(o))&&i.push({beforeTerm:r,afterTerm:o})})});let s="";console.log("still to be undeferred",this.phaseCallbackSets.undeferSet),console.log("still to be notified",this.phaseCallbackSets.notifySet),console.log("order dependencies that apply to the still todos",i),i.forEach(e=>{s+=`${e.beforeTerm}\t${e.afterTerm}\n`}),console.log("\n\nin graphable form:\n\n",s);const n="Impossible set state: from undeferAndNotifyProperties; ordering constraints cannot be satisfied";throw new Error(n)}getNumberOfOrderDependencies(){let e=0;return this.mapPairs.forEach(t=>{t.afterMap.forEach(t=>{e+=t.size})}),e}attemptToApplyPhases(e,t,i){const s=this.phaseCallbackSets.getSetFromPhase(e);for(const n of s)this.phetioIDCanApplyPhase(n.phetioID,e,t,i)&&(n.listener(),s.delete(n),t[n.getTerm()]=!0)}phetioIDCanApplyPhase(e,t,i,s){if(t===r.Z.NOTIFY&&!i[e+r.Z.UNDEFER])return!1;const n=[];this.mapPairs.forEach(e=>{e.afterPhase===t&&n.push(e.afterMap)});for(let r=0;r<n.length;r++){const t=n[r];if(!t.has(e))return!0;const o=t.get(e);for(const n of o)if(!i[n+t.beforePhase]&&s.has(n)&&s.has(e))return!1}return!0}}class a{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_.noop;this.phetioID=e,this.phase=t,this.listener=i}getTerm(){return this.phetioID+this.phase}}class h{constructor(e,t){this.beforeMap=new Map,this.beforeMap.beforePhase=e,this.beforeMap.afterPhase=t,this.afterMap=new Map,this.afterMap.beforePhase=e,this.afterMap.afterPhase=t,this.beforeMap.otherMap=this.afterMap,this.afterMap.otherMap=this.beforeMap,this.beforePhase=e,this.afterPhase=t}addOrderDependency(e,t){this.beforeMap.has(e)||this.beforeMap.set(e,new Set),this.beforeMap.get(e).add(t),this.afterMap.has(t)||this.afterMap.set(t,new Set),this.afterMap.get(t).add(e)}unregisterOrderDependenciesForProperty(e){const t=e.tandem.phetioID;[this.beforeMap,this.afterMap].forEach(e=>{e.has(t)&&e.get(t).forEach(i=>{const s=e.otherMap.get(i);s&&s.delete(t),0===s.size&&e.otherMap.delete(i)}),e.delete(t)})}usesPhetioID(e){return this.beforeMap.has(e)||this.afterMap.has(e)}}class l{constructor(){_defineProperty(this,"undeferSet",new Set),_defineProperty(this,"notifySet",new Set)}get size(){return this.undeferSet.size+this.notifySet.size}forEach(e){this.undeferSet.forEach(e),this.notifySet.forEach(e)}addUndeferPhaseCallback(e){this.undeferSet.add(e)}addNotifyPhaseCallback(e){this.notifySet.add(e)}getSetFromPhase(e){return e===r.Z.NOTIFY?this.notifySet:this.undeferSet}}s.Z.register("PropertyStateHandler",A);const g=new A;s.Z.register("propertyStateHandlerSingleton",g);const c=g},2221:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(7922);const n=new(i(5891).Z);s.Z.register("stepTimer",n);const r=n},7959:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(7922);i(6685);const n=(e,t,i)=>{0};s.Z.register("validate",n);const r=n},9599:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>M});const s=new(i(2492).Z)("brand");var n=i(7055);n.Z.termsPrivacyAndLicensingStringProperty;const r=n.Z.privacyPolicyStringProperty,o=n.Z.translation.credits.linkStringProperty,A=n.Z.thirdParty.credits.linkStringProperty,a=n.Z.donateToPhetStringProperty,h=(e,t)=>[{textStringProperty:r,url:"https://phet.colorado.edu/en/privacy-policy"},{textStringProperty:o,url:`https://phet.colorado.edu/translation-credits?simName=${encodeURIComponent(e)}&locale=${encodeURIComponent(t)}`},{textStringProperty:A,url:`https://phet.colorado.edu/third-party-credits?simName=${encodeURIComponent(e)}&locale=${encodeURIComponent(t)}#${e}`},{textStringProperty:a,url:"https://giveto.colorado.edu/phet-interactive-simulations/?a=12323626"}];s.register("getLinks",h);const l=h;var g=i(2530);const c=new Image,d=g.Z.createLock(c);c.onload=d,c.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAREAAABsCAYAAABNX4YlAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAXEgAAFxIBZ5/SUgAAActpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+QWRvYmUgSW1hZ2VSZWFkeTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KKS7NPQAAM3RJREFUeAHtfQuYHEd9Z1V3z8zO7K5kyZJthC3JDn6gxfghGYg47DVHwpfc8UYmOHzgBMfBMlwgcNwdHzmNknC55OP7gIttGR1w5IAPsCDByQcOx0Myr2BjyRZG8ku29bBkWw/rsbvz7O6636+6e7Zndnp2Zqd3Zx9d0k5317v+VfWrf/2r6l9CJCahQAsKqO3C4l/Yi1JChr+T94QCCQUSCkyggAYPJczAQR0ROfuZ9LvVfmt9zS4Bk4AUC/pZN8IsaEokhRdKgMPYDuA4JpS8XtgkiXpMDIps+i2qqm4yDPVqIcwbBZwSbiRpMAkFEgrUKEBA8DkPI7AceVIsVwdSt+DvR+6BVEWV0kodTJ1QhzIvox919ziXEoRJnguTAgknsjDrXZfa5yYIHG6N8ziUfalw7XfA7d3gS14jBsCeFODjtBLKFY9IWT6xgEmWFL0JBRIQaUKU+W4VgIeUwkFZ+SfUM32rhWHfoBz7D2VKvFJmYVmC/Yio4s2VgyKjiuJZY5U4Sf9ig/5NfhIK1EvdE3rMXwpoeUcevMUmIevA46nMJSKl3qNc510yJS+RGdDAAw9br8FITFuUSGkokerJGoW21d6SlwVOgWSpbp43AJ/rkGIbwOMGj+tgkdXB9CuEq/4Y4PJ2AMcqkYZlEfYO4ELin6oNMK40hCcrUfJGubLydR0echSAEYInZqFTIJnOzNMWUAMPlA+d3Q2KCeHoNXh/n1LuW2W/fCncPPCo6NUYBcBIkQMBmNB4IIFWoqpi1K6qfdpSCSMcp/aZ/CxYCiQgMs+qvgYemwEe+TB4WK9zXQnwEG+R/WKZdIEU5Dz0eq03cZFpbCyrIIwUFJ6eRUCBfwc8iSEq4lCqz3pe6HmN9j/PKJcUZ6oUSEBkqpSbZeFUHh19je7cbsAlAABMcdAaBpz8EcHDGMBaCzkMrLb44MFpCjeUOQAWS41BGiLlDkxzLoJwdbnCdhC4CfAmCCAPCLd4XH8nPwkFQhRIQCREjLn4CnAgEATCUl0EiD8zTsp8gzoo/wRObwRA9ElsHQNI0BBGOIlh3RMkHLkIAHIGi7hK3mFId41Iy0u8rWbaXctDlKGeMi4g75KYhAL1FEhApJ4ec+arKXhga7qopv8DdnTcgp4/TO6Csw+AB8GCchGCh8kfxeVd2MqzACCnxCGg0Mdhf6Ww5Ftpj/8EGwN2kqs1sHgCv4FhfIlJKKApoEeZhBZzhwLcKcppCqcs+NPiT/WiWAyB6U2qkvoeAORuOSDeIC0ASAETk4r2w07PaYvHVUjuW0ccZyGuk+LXUom3ukotxtd/oQ9MY7Q7/Os1GlUWruEqDSJIW2PQ3KFYktPppkDCiUw3hWOOP7xMO/q0OLffSr0dU5H3AjReA87DE5aOauEo8ESDRuNAYUNgaoFnwS5U+f3RcuU9gxnzVVIY/0tgjwi4Fi7xUgpCHkSDiLTlUUDOs9qO3IkPXv538ljgFEhAZA42ALVfvMQVqbejM79f9ImrJHkMCkvH9BSFnAK7fyN4kBtxsCdE17l7RnzJXF15v9qfugpTm38A95JWo1iDkXrHiBcDORHAiSqrA2OV6tE5SKokyzNAgQREZoDI3SSBng+sQGeGUYczl7q2ep+S6j1Gv7iAwk9sReeUhsuy3FlaO7rfkCblIa6/AmMDYf7aXG1vVoezF6iq/XW5WCyDXIQcCLeceUaniFe0EKS/f+C3cLaXZgc/E5NQYJwCjaPVuEvyNjsoEHRm5MaxxSWGUNcBLF6it2ug9sBZEDhSsHPQvXl8PxRCF0HLTXD2hUu4L2B7yJ/IVQCQJ8UiAMhXIBe5FNMhbnGfMKAgIlOnI+STQDIv3uEJ8etEkp+FS4EERGZ53dc6L/JprSr/i6hUX4/py+vcsvxLTGF+AaFngbIQgEQKezsIBJSF8NAcwcNGeBNLuAamKo9IU91orax+mSs7bjp1OziQ69Rp7Z/toJHDUIYBu7KO8XH8Bqa2+zWwSJ4LmwKNDWdhU6PN0mt1gedMkDm0GTrkbY0e1R109Cl1TPWMOEsY5r9zlfF7iOM6dPlLIduwdKw8vk9ooLC0IP9VOuIj8sLKY0zd2Z/+lJFVn4AEhMf7CTbNpkEuQMnAdvcimJDfAffyc64MhQW7jCsxCQUSEOmwDXBnqMxPrdNHJUXOoF0goV/Ewz+CT23qop7KrhSWc60r1BtRqeuxhf0inV5FbBVG9b/JC8SL/FaHUu9HqC9Q+gEuhtOfCdMYHQ5TI5nTU6AnpWH8vrygvA9pc2lZT4+0n+QnoQAokIBIm80AHah2alU9CBnESnG28HaAthlDyFsO3bgIILBERZ6vz6lodYNhUAj5bvrK/MCBYMJ8EQxqRh1ID7nC/Y8QpVaM1dXb4c7pjVD70zdi5+lWTIf6ccCugFxQa0hUG6hCXpKCwPWHMlt9mzxHjCJNqzGtWqLJy4KlwIRRaINS5pKdbJw7QZS1PSSMl/6KrJBHikKtGBFqD3R/3r2Bm6ywPWoGjd9hdYq6gyr1SWj7WgMqOeyBYfe6bGnHOhvvo4Tuy+P1jqioA+rb0CT2OXTOEuPBs62y+f40V+Cnb2LlRFBDmVxV2YOE+FczmPqch1WdP5JLRT95CWyDz0FOgswDYCj78FZ2AkBhHiDDpbN4ygCA6Ih26N+mP3mljCM7OS3qdbtpmr3EsisKjNfpybXC3SYxOQ6ZehDB4QnfQ52nkP+ev7KVjzdYIVasFU5eyinJFDoozPgGK6n+3Hip/AOMy94YjgwFPa+D+DyxZx9CHJfXYInlUSHK/4wvCUAAkrDvtm98/5obQXgD/dgE/rMOGY+X9wExJsfcz4gT8oewXAfr18p+9RJwQymthIg7W8G+oDDkbvjnrcwob6cqvoUYbj6Ny+eV4dfBdNeDzkby01sK6PrOj/c5H0Sw3QjtF61XfWSPWloqj14uDctwq7ayrHqcmZns22A3LHDdasxxzBHsuS66TnX0ZPbQmW1DQ5XGBhuAyjQCisYJ9RS2lytxiTyDBZARPZmhELNzDPFC2GJEZKCG0BQF96K46ApAYUfGLnbUJsAITw1IcrkYsZ8x06ahlgMpvmW64htiTL0C3n4X/tdiBQciWOSF6gGqFLliKlMQEIeY+7S2gLwGlonghoGH9XHLgyplyuJaHODrd4Vp44BO53RBoomZfRRw0IbANmMqa5Ry2eyv85fJkTCQaITIoyXl0eA+/ODYS0rlwl1YFXy9cN2SYaJJQHw/8wactHLJM1WltMs4t3HGMIwTy8urj23cNXoEmXoKIr5HZcXet+zezx4Ig0p+u7L2DAvVyHJ1VYYddaG5q5OGfAQFjbqX0ircw7R9nQWDwMDOD2Ni+7lJfsFVutN67jH9EkB0VNBoFkQJVF4nlomPGsfcZ7F++wj6/3cM03qXY1euMM8Yb8RQci1CXY7l4jRLp45BGKvcwzr8Jg1KdY2B4E3a5/eo9NFK8a9QaX8KgMIUz3VRplq6Qfp8oj0ia950NPwe9hPHexxxh+OIep9KXqPiCttPJd7JwjB++gnoP5l/uvt5YnWCS1aZ0bGxb33ol+rP8q+RZzbcrcxtN0jHggNGLI81KUv17zP9/W/mmONW1IDkGc5eGuSDHU43x6Dz4VktlNG2ndMqnTp09M0f37PxTR+735H2T++6avFOlEWz9ZTtQCWgYCFjLkIwxupO6vVUjQ11yYADqDeh7zo3j8TTR+i9PpggN4DmfQIaQeS5xvmYjp0Puc535fnFZ+GEP+e76kh2pVN21psj6jrIS94J+wNCpp6LUkS0xweo48WxS9GK/lPu7FxfdQwwgg0miZlHFEDrxKxEZBZZYuxE4X12unA3Snfvkot2sqIda3Oti+JTGkvschVyvmoVbV7PcXpJCiImlizR+DVfzgxzxg6uyjKsbG6xYYrFsHmFXai8CyLOI7c9VPjFrTtH7xEp+7tbpNRaycmZbBrmcujMCmN7Sbe6tDeBP/C4CAUG4ZjIgYxH+So+aK6u3gFAM8RerLoMYaVoRfEgwvLvG5X9qa0pQw2KCwredne0o7p48TG0ARwfntIysuAOZfFFbk7R29NYV4mZLxTwuMpq8aSdRT+qoPUsYdFWjKzVQ2ODwAOzYTKbhpFCK6MHYBAHydAwqr8ZRQcmiIJPGj0UB5a0CBz8V50cGCl+ki+nf98LXrHB23bsoh00akzbLTOVy63A9OCdldHC24Sdun/jzrEv2yr3tfw6WcgjHnImsU5xdN501kKZh+UsM5p83kVTDkSsNs7aYHBQm3F25o4gqwQQfRnVBgAKRhaEcdOrqw8F7qA5qyGgd2Bde9qOIkg7ZjotnGqZW/AJ9aF6rnmNfiEVg2YWfg+HqNnrlhFyYftgeiGrmt+QXfh1Mvew38b3pmH9PNW5hewYR5A/7cd3a4y79j2Ze81j+y9B3oJnuyHZKtAIzFRG2BUqlzH0loEgeN2IgQ9WRdBp/SIHJQ+C8LvDP4IAw/Cp3xkX7QLjuwd+am5h/55f5I9ZxFIi9lN6ivsM17adaqFQBYC4Zjpjpgdy6zEV22oZhXtu+9Xo7zAkAYRcCd/jMigK8zL7DZbFdSZdeQwI8lGx0v5LfiP/3Peh3bgTFe+QQUFEsx2bzLAXBu66fcAuXFkTyovzOJwvGxrsA5919RyqXx1Vk2/t37cPv4f91+x17lkC/4+P4H2SOIIwjf4D+3aeTcP6eapzC9mF7fW77xaZ3mTuDeWNjCfkL8hD8GwnDP1o/1w4RIOH+ANSjrp236JT0R8zMFtNLW8sErdt8085lbLtYG3BSKWtVMZ6Q2Wk+OqNu8Y+mym9+Df59bKoORKy5gtoelMDgVXVR7Bqsos1ihZBoXDdJjXa03CviffW2W9dy+osaOJ7tlMA4BGVxTpOJOyJAtfw9xx5Z54JjJZbrdiVkYJjZfsGrb7cX5QzS795267iKnIkG7ZhhJ2b5euqGgAa3s5VcBh4j1XgjOlMDdW7ymQSeBZSYBwKms1pI0FkHjQKCxyKYZeKVQfzuMyi3JsgENoGwesruWKzYdu2BQck4D7Ik7Z9TmcWtuYkSz2hwPj40AwwmtnpbM5RTqSRxITQlHKVXR4puH2Lc9cAHL+ycWf55dtuuMHJ79BToMYw8/ab0xr8NRtM5m2Zk4LFS4FmjScSROJNutexUaAqVelUwQGQvFIYzh03/3L03Pz10o5b2NrrkibpJxSYaQosEBAhWbH5DMNw6XTBzQxmr0+n5afy3HGZAMlMt7kkvTlMgWaA0cxuDhdxsqwDSLj5bqzC1Zv3v7CrcDNDaCABoEwWOnGPpsA8mf5GFzBxiaRAZMeZB4LVqEJbynEqVgZyVyk/dtvDpUu0xx3enoioQIl9QoGEAs0pEAkivR1ZxpeUmme7O1tsmklhY5qDac3Frmv/KWMjN6LP23QXdRI6ocD8owDEAMH2MqzTYJ2ifgNZ5GYzzYnEt5eCQl1e2ziODnwbXzkaJzx3RzJdT68FfY2HGffV7ZtOHdrTIW6VN258aPQrd1418HC3kSbhY6aA1mCPw6FR7TCqDYWz0Y6fsP/peG/MA7/R8tAB+IP9fzG3ca7A8V9gGtMP7Dt6yip2hhMvDGS6DjfqPjqKs13PKBDwwDAzfTxH5wGHJmJEBBrqoB/HrgLyXG6Iwu5SLMX6W7AjQk3F2rSLRQf7R84rjYz9ASJ4WG9E8483TyXChRxmOqa/OItjGpZlNhtr5jqtdVfAKUi7AnX6YPtRnla9opPiYhkf/S2bMVAnTcfpTiKjX2bMAYBkBnAz60nbMgxo04E5MrhT5zkSRDidiaFU2GgPpSQ4GWeXCjhViwN+3vEc5qGZAa8CNT1CDOCwjzTThgkYQWcvkMjcih2Z32aRTWKH4qGUwGsg61tuefDFO7euW3pwaLmQPJk6kwYn55v2E24OC+Uj/K79x9RGQklM/TXu6S87gF2plGS1cga5Cpd96pmcTSHJLSjZj4MoAx7tPM6kyyyy//AcE/sb6CahYioWWZ9ub8UXy32I/59SqvIz5vPk02s1txPZKfXIEsVGtlNSciBARAgxgbfO50Gw/2uQe4NuUZd8RcgYDq6HNS1lc3rhOlkQ9ny7WrrMKat1eF+HE7pLXduxeC4GwbjCEk+jAotULZaEYaUuSznGesR7kLIRVqoufyiP0/mKOaZXD/ugqvA0DsDdjQaGY/ZBmuhPrKzatw8upEHNLvA7D54uuA8eqixJU34CrefHJrSlSWUpthvXbyssZ9T7ZG5hGoXjCNs3xhF2C4cJ3oNns3B0oz3bOIdCE8qoMNsYQ72uQm1vTmVzV+AAqcdxhxPq7J0AoqxMH9R4lbbjaNRmE2mgE6ax7jg+tUGc4bw2JtHoxr4pTMt1XGHh4F1l9OjI3i1vPG8s7ymk0kcnIkGkMfIOv7XoxezrE3ZhbK+1qP+//v3FkiNKR4Yas46VR19TGRu7CZ36RoBJhsRmz0GtdA8kIDunTOnFfWb5dOH1iPYbzOANHnrHeraE8daZEKeJ8nDEEPJirYujzluzD58D0QBCQPG/m3mdMbsYQVcZJrQJOPZpxPmdO68eeGbGCjHzCT0MlRVvheKNK9CadX12kQWGx0IJuoVSP9tyde6+LuJqGTSkU1f7iwQRPRq3jGoSR/ZylkeK4yO4GoG+CQriaD0qNsZyZFDIFSM7VH54mAqYGe4n/Nu4q/ADu1D4n1BGtBLTmwBZkUJXBgJccH+ACzBJr7oF6iG3ruuHJq8ZMOj8OhVUPSRrYGnBYR1Kvxxj7Vlw6ReuMQCIG6AfoCaeigqY2FAwsEDhEnXFC3k/SPQI/USBCexZx5ybTisoeiw5c9K1AbtK2Tr0LFZACxi2myPFndD47ynB6TqFHkewX+y3vnz9haWP/EJlS3IsjbKihlC73bZmlouRSVyuCsPd2F5/6hqgGJ1nhoWLfhn0P20XCSJ6ZOlmOsPodXmklSvohixwyYKdH6rPgJezJr9IOw+Wac/evRaVM995de7rH3iocFAVC18D+7eqWiywU3CJukvSK8Ou8Cpa42LLtC9EfM8NIeczIBfxmEzAJOr9ZnEw9Q68vQQNYBB0ywFAchIzUJZOa6kkItOw1JAaqZPQ/6GcN+MLulJBh4aRTJMe3hCMU0DxIPSDrH0aU0zoDeH3LDbsUtpAg52XV7SbrXJdXcMN/MzFJ7YS6DKOpYVtSUzyp6kQnJqjcemBcpqS0NGyE06fIXUwxOfsF2oNo+3EwCEQ8bR29+3bLQLKXVflfo74/rxaLBbNVFrvPm07vhYeKYzBPDyH7qo3njFdsmwtgsThpCVpaE4KouQ1uA/mtbgC8yIAx3LcXtcveQaZ9+BSkRQ1sOOiLPwpVQIIoDuBtF+Uq53v+RnRTF84U3BnU5XqaXEuFQytWweFQwAQffFW2GNM7zFOZ1g239Qp0Aos59czbmgk8SCFnEnToqN03u+nK+P566+3A6XAd67N/SNa2f9Bp0dy0F8OknWTLkqJ+YzrWn1QlOaKlwdx7VkTasuBZdxPb0ojobLQUSegonBUVAEStsIdMAq3ZiBv3p+WMGmWtIqrLU11Wh1GXrcwOwAKaier4y5g59Xrs2KJsKwt7vLUV9VB61r6lwATqkKs+aFlYnpHgRY9sHeZ6izlFkUYHw86i3J6fGsdINTgTlN1/zemM0fNjJ76dYV2XimlC6XPYESMFTp+/BxbvmMmCYDDgbwdF6szngxD5wbvXPxlHQV5wRXbBA7jy/LCqrc5bpsGlyDbBBUpNnufWNq/HNOjtxnLxA2w/rY6kPqs2t93oa8KUatBrAXs8iVGmUiXOUmCzzQFIkFkNjaKoc1eh7nzVQMPo1fdZ1o6+5QHdMWNoOdhZRmkd9U5H9ut+lkJy4eHuwKn2CsSi4OQlkhwK48bpvwHxs+pSRMZh5R5jx4gz3WURqnjkJ9kcOPMgPgzZTj34E5eyF+ATFCDSE6G792aOKczs4vw3VJm/oePBJE4G0VcZNy0CSDiC3vx+Denqu84gUiR4oUuDBAJnYnj/aKyMwrZCMwMSFZ1Ou39uNivl6JyQxT2S/KC8pM6mHdVZtMYUJ4MaHSd5m8QDNMkTpcUbrq7HOT6qnPQ+gQDUvAaF5B0VwlNi5FYzgEKRILIbORE0NdFfjP6kTbuo9hUgw1JHEi7ar5efOBl8LLISZm82W62GVsMopRFsRvXYei9LOj4KQBANAf2bPpSTH0u97Sq6uJwuqTUadwv0yf6DOhTUQdTn0Y8GC+6BxK2F79iuqadjieuyLrOTRLBZBSIBJHJAvbEPdSwcFXvUYzK2PUXTxHQCQhFOVMY7GyzyWDTIfgJHrEQ6qvyt/QFU8yfXroNZ1TltfzEQ1RX/TZWeJZrEAGhfH8kVppciYafPvFR90D6b+mmgWR7PFMbP63uHkGOu4slCT0DFIinB85ARr0kgCKbvDdVxqkXLAMHfEksWWB8XFadRQbY5mgupCR2G+kUry/k1ItcyMRuBtoE9mBR1vOKbn2F4EQqpfWl3ZADGWn1n51nUh9mvL6MZEptIs7pb1Aw3mfDfGnjT2ODz+Q5eygQi1CtF8XB8OzxIEGLiyMTWPbAbdTjDTeOOLuLg6tGKZ8L+ZqBay45/UCUE7iQcDLqiFiGJeKr/MkOKdSsTGksJVewZJyWVbFJHbB+I1fZPxQ7NDcTPU0KJxR6j336ixxjicrLN/K04ZhQQ2QXZ8DkyfRxQElMWxSYWyDCNrTZK5dpqqWo6SyH2lgMhnC02WKqD11rthhyIQPCgBxjt+GkvqmxYyf2hWCvR2MWfXDxrB0Lm27FhRpqyLEE+0YaA3FqUwCQnCXOEqfkf1dPit04v3NMr/o0SWNi8HGbODkRjeO43wMHaEaZgt55ieeMyrrJ+SRAMl7BLd7mFIjooWGTUPk8hgopL8JBrX7Xqdtn1aKokU5aGEIMQX87Uz7lcI9o7w02kOkVGeQG+foaZSFtcCHe6OnKq7CkOzARapoUi7paTsM+K14HTQs3A6j+Rm9IA/CAJjEhdJN0o62w3K4ZrUXYS7geWvlHDMseMFWfMr1TJtEhu3SRVWm4/ZlTd7xcntAAkgBJWxSdUyCyebOQ+bx/9sYV680cVj0LWteIx/a2VeTmnjg3ApqMLDp7QJ+oxVH83hpqplrM3ani1zLdmgvxM8pVFt3psc31cgM1qzz5TkvagGmn0p8KhLBpcHZ/jD0k35GrK4+KnVrlQtsgEuN0BmoAeK+8kQMz8lncEX4C2ixxeJ6KqlBSSmyYqyjJTdgteA9K0Rg2bI+tQlBSkRI4UnHrrrHPbbm6/64ESPyWNcljToHInk0YlPNCfHB38UIoOBjm6Vv0fDYFbyfrJIWNdAbbqnesSuPo310mtdamYzt2tOx8kXHF4+DtCwEIIGv/KCkLIUOytrUshEmrozgRXBKvAF1oSJuW5dDeJK4dRamNfvEyUXDfjjCf6jE3AuGxK3A5+xLDNJewIDNhoMNE9J1libFjhb+47eGRn95x5eCeWzB93Io90jOR/lxNY86AyAaqLcQ9uiS067rvM9N9q52ynnm07CSTVQw7EaYLhrdj1T0c+F9+bNjrhoHFTD4DWcioeBqni7+lk35Qn5GZvDGX0xeiB0LZjQ7FMkSN2eMl4tQF3AgWeNPKlW9S+8WX5GrxXKfcyHiE8bxBCZXjeBUUT4RRsXhpsB2VyyMmzkjLxThNtYzeV2Rbg3BUlAvJfvIG1i01MK98ocs4qBdhyNf09cGHCq/FKHsbZRgYrQgqXZUB8VASbzhlRiX3BVkN0gu+Z/BJDVcpggDa9r/IVZU9Ou0WXEhYqAoNVJch/LL6I3lt5J6yEZwURthrIG9dr0NAdUAbIafTC88Ukcuc3j+dBnToUbULGxauJsLkRg9YHvGns4hzP+5ITkRL27tdmyfCw6Qy53bU0Tm/vmGbMKjvdA+W9gLp/Id2ldfgeOud0CeyDAfweMJVq9rwUpniLyPBiWCnWq4ahvE4Y9Gam3QfniROAhAgaBJfnTo7WHY1sGpyFMsTekFCr5bISVlqTW2oxHuZ6MPp5k73u4AbwbKwg23xpntGXYtMf1urDoDMBP1Kd6jJCuJX92TeZqc7a5GaPXRtosSRPWN2Zr+XuYokFTty172DdWJIe6XjNekjENZhWtIyWnIAADCOgE54Se/WXaU3OML+LFQkDvkAwvy1jKstwgIGzDQG/mrlqYpbfJphtOylQXtT07jiBxD2Q2yaJZclfpRabf9cp9vijIx2h8A5OHSHt0tJFX/luxP6EBK1nk8IW1+lnhfnyPOgh26n5vTaApFOEmtKz15azmkEDBGuB+WIBJGuOREUBh0Bf2rpqQo0dWHOvXUdtjVNYsLA8aHvPZlxz1kxpEz5XvSKm8GB9Ps6VuMBEGQPHU5xJQMzml9tXbv0ILM3BKFqOB+TZDlOZ562tXBQrmgYEvtCNA2pL6Tl5jK9izcPv0dA56q4xIdWAnFn/ZobNLhLRoqLRDV1IeSJR8UIaLQQDCnFBjvXTWc1HktpI0GE/asLw+aofMHn5WVV+B+3PTj2BVhVobHbhLBsQuSGtpMpsC4DhlLnulJdBj3T12BUfG06l13iQIVhoBIRdIqFVMwEwNKyS7xXS91XK+99w+yAM210dnjqFpplHxCFyo/9DEygVVTGyoXMinTKXeHvtWS4jqaR2j9XhExxDhQpXoTv+8UwFCRQakQ+pYXRg04L97nhFEuz6m1RW9bS9GQtEkR0w+kmTcyxXVy4h2t0pJVK31otFd6DhjaKaoINIg4VlmwF0kMInPZQ7iJhmVjdy0BWga1P6OAVqtOnfyxV4BlfTYN9T2WzJuI/aNjOT1ncYapipG7KmTbcXGZiJo5dKhAX32NeJkaogQy0aTmVAFkktnJqmpgpZzU+l7YO0bJg0H6P6SRURItRF3EhNuw9Qd0QjFgDkSbGfSKRaSQObVAgvt7RRmKel0gQ0SNLl4JVlEfiRgalykVhpfsGpWlACTHbYvOScm8ANBXqP3Rs7jtmB+LASgHqJGNh22UOPFL2oqCunzF/945XL3qCDj1TRkSyQAkBpjL7qqbxz8wLzuA2J5R29H8Yzp97QS3rS9HdBzWIkFp069RwwxpWK1yFuMbNpPmY85zIVGg1Tp8F/RYJIrEIVkFa3fnRN7D64WK+PklVsa0SO3Sd4FerQySjEr8BF2Jm0lbp9Bi2WZlfZwIb7r67thcl/gRbxsjj/hYXVFH67/etLD+lfQ+3yVNsYEhwMEKthp4Q7vhARG0AkE6k7seDHi6oSrE8dIZmWqqgLuXZ8jFJC50t2ZxN+eh0zjzVvLMRMq1J1vs1aGi9ogjAMNPXeNFdUllsQ5By25a1WT2VGVq+YfrSa005Vx/bHxMjkAf9E70q6PYAsLTVpGv+lFxJik1hZSacO2z/1oRfIlZgvwrNzsnrYd5MZ3rVAsI1MMfeIzmROVaODrMrq1ZfNlU6XTiOqxq3MjDuAjHzsgeyEPIMBFjWhBS/wgERb1kXAk3mqw3DZo8+jDgOigs0TJMp6RaAueGN2mtp1urfBfDTFmYvADp0VsSZ4kQ6y9X0+uakIcUDd+ghn7vjitz9OrltPVrURYeHQNXg/TJAgnvlhaLUjiBzAon2i0UId65vz97Q3ZjKPSMLyWhqBSQD+XAIMDHtUWChcSLsXE7f4pwBLuRfbbf89yQTt9X3ZEWGiXPKgmVdVVSHDWncSysYzLLa7MT+ygy2qp8HEfSiNkN5qbT+DXpUa1/T6+qJ4SEAb3e6RAFvu36DrOvpIBYR0Dgg22cTkQqbJBfiABuQpKPnQgIRrsZU04PZNABkH9afP7513dLTPZzGsKK4fIqbFDVq/ESu9M/JeNOR9ipyg+/NdM+BVHaxP5GZ2spMeynOlC8PQLjIrMnTJqbpPS1t+g1K4ocBgkBFDXb2lQjrZsKKBPSZ5LkgQIQjDJqVnerPpstnCs+jh916+7qBRzDuSCgthSrPHhlwG9gLY/CKTMwdNBfCvSHITftTiR3BtMXAkXlcAM6QHEy7NXHEMfU86G6d7uOBWkSimYNQZEHewm6Bn3aejCoclkkgHKyw2ZEf4vvGoqx39m5PmytkjHOBmoUAIlCbKlRmUS5VPl143jDVTbdfOfBD1nce7Qam/Q4bZyPxFlMpvhQ4DPBYpWJt12or9Nmh9mAADT/oCsJx1dlmCrGFO1Gc+Z0kLj2NmMRPO87IPjYoGtj0Bv1mxcJX8f1TFBIqCrAKbmBf8zQZNAJOYSxZVAXXqPz4zov7z3BaBNNys980ZWdORTufQYQNzkbDS2UG+wT2g+zBrPe2268cvI81lIdSZqzG9AZAmAFvwsGj7mQe7stdXHyW1jCddhRdBogClusteWzyHrjoyKb8Q3jqwOgO14H/KK8kh2GlTadSOuWY7qfvumLwN1F+p9XeA5BO62JaszRbI48EEY4sZPdna8Zb5Ivdk7suRao/l3Jx5qZ0agyH2axPblnbt4/hqOAIANLrEUbhpBBuzsHl3Ur+gPkCZ0FhXkcNN9gjYghMZ7RoEDGw1jqKBf4bTbfhG+Pr4FtLQTAAQG+jzkUeRxHE8LC7CaXavHnzNLXJTYI3LG4G9Xh5fKAAq4NsL1ivkSAS18gyA5T1mjunB9iyiQ4krWzOBGsvyqPFpyGr//SxvgNf3DY0VCH3wfzMBgDRHR15xO7SJ8qi8ouATgEoBN/tPlH0JUYAQXFwIu0mHLu/2g477LsjzEI1A7TMQXbljWibNk0bvOWZmE6+hxwq8zDHTCSIzFJORDcg/ujO5jUn/AI5pGFaAxnai8po4Xm7JL9mu/YXtq5b9BjrRB+sw/IuPHiheltRHGP1VAY94yf9q6CKkAbDYCeGiqvhX5cHh4sGycdwhZI08Gw7ia3BL+PoiakhII9S6ana0F4AyOyot55QZLYnGgkiMWecDd3rvEEDD55BQo3fgX2Tp27fEINRIxkVClHJcmWsJKqjY4+gB30HB/u//fmr+3cHQXu6DyTIRP1TQbs6pzJgjeSP6aTygACw0yJf77HV1yY4Bt4xag+ynwFAPH6sVcB23Lzaasen9jOtnTxc0LZzlHicKQpEgkiM0xkOLRx50V909yfj4JngGZSW32y8eIKz0LZonNgUzqD4w5OAQSen4mI9v1Ry7Orj8PFL2P5Q9PX/7M4h+XwQHfeADLF/9mY7e5CNxqc31JJRt8UzJcfwdsyio6ConXVdv3NBlmKqg2qxT1efgo3JdvjNuujAsL104D3xOo8oEAkiMU1ndIO2MjmNBdDSXsOPZjT0Wj96EvnYKo78UjUANZ9LqOkR0Doq1DGEO4Tu9jTsHoXTLmUOPr7lCnk0HB8Fp/ymcKxnm9nDGap/9wCVYCjF/dmLSgfqnaf85XViEjExCQVmkAKRINItJ4K2zKGJkgphlws/w+s9uOsBgIBNAHALlxESUd0BdBgqHhIGEMQ9CQyBciAJ8JAnZNo8jtvuzgzI7KlPXyGxPWuiIedB3Rrbbuj5ysvEzAU2wEiAh0Gts5jw/4TWAEqWv44mgfe2nqcgD+EdduMxaHq2FTbK03hcUT4S+4QCmgKRINItfdCKXSuTNe1y8YBynJu3XLNIa1LvNt5weGpl37MGHRBbv/XO094v24azF/2OqQxu/D2OeyqDVRnqUOm82wbnZk4DQCS1wkUn2bFL9zDUcZJJgLlJgekCETZniWP2eKgDjnziaZJHczcdS9mxRQyxbUZ8e7ZtQ4RADBhqhc9z9PY3jM2RNs+pjL6OQJbFI+JoRe9bYXmQ/84hADRgWPwy1s7D68Bz5UcztvO8jHOlLurzGQkiXctE2Ku9Kpd2aRUU/4nq5h3CzFPQ0Y7B+uUmf0+ABoiG3aWzUNbRTqlIES0xhnTofnOdwFQtRhMnks6i7roJLSmvd9LFSKskqtgoEAki3cpEajmEBGDp4DIPOO4TLo7ctwciiCCfz9eimS8vemm3gF2qLleU0Du6lYeECdPDjq8HnXBeungPioGrQrSAfPNekbrlQaVW8PqK4S4i7jToDiGODO6UT4yMqB3XD2OH86zYY9RpKabdfySIdM2JMOscGfX05QWvIBhSRN57XYC/Xt8AxaE/7RD0EAX7WLhy1TawNqVbDsLasp7SNHWeCcs4l3gpIIKBlNzRAvT8EFfnemz0EjamVB1Px3uc7xlIXrPWM5BOkkRAAQpVhXpErC4d1laBcDRw7+QZhC1CnUDcUpEOp0axciLejLfPceT5JIcGqF7tQwnS9XbycSDokDKdVOjc9BvJicQ2nZmbdJmOXLMBGtROgVa4E9xHVScSCEenkqIfdgyo1E/11nGaDmOLkRMxnAoYDykXY2vhZzbuHH30tocK5kZSbVfTlf04S10fF+VwDxUySPd5Yau77nzVwMMoJ7KW4EiYUJEgEst0JpxS8o6TgRhVi7ikSpi7uF01LnlIvyVOK0cU/E2+pHT3I2bv+glSBmXQV3Hv8iutjHhlr5oOcqEpmeoXYuRIYflN25/5Q/SL0iw8RtErEul0I0Gkp7mar4lTTGjjqmxD6EOB+OKg1p08hLQ6H1vXDk5yXy/9dWI65ET0oNNJ/K39agirjhWcaiEG+rROq5UrZSAl180OwNPLc/3nLsfzEC4ZTcQAIapFgkgynQlRqftXT2IBzZ2iLB8VZtmTh8Q7vy75E5qe8BAxTmfGqQ2WDR96hWbccsbefG4ONwOQorjO1Ix3O9+MFWS6E4pEVBCuw7FourM6h+MnLQkjaIyg6yNyRUz7QzZ7NPG4GXUqAJGk4mJpK6wtb8pJEElMJAUiQSTeQTIy/YXhgF6Njm7wsm60yz2hQnfX3zeNAz0wajQAEbT57uJlBpOOE6omvHIQmC+GK07N/oLyBStSwXf42cStBYiEQybvXVOAQlVbjNmO2su4ILQj7bvv7H7GcKrxBKUHACsCQGzx+tEnj/lCAYAAG0ezPw0svhvPpTUWmVPWZg0rUiYSY/tuzMtC+/bkIaA0tLofsuzUs1yZgYlFqMoVHgAHpksKIAIEYdXHoT22WWtZaDXnVRKnovPDkIvAfpfJWCpfSI5S06uPGwjr23u08OPiRySI6MY5P0jX+1KwEXKTWVE+LTPF4zFnSMOGo+RRk+s8/KJus/nS8GMmVqfRaYGx7nUk6GTdr9PYZ8q/DwYAkA/uKrwD2nquRUMpKOmeAU5AcC0HsM0ohxZ6T9V1D1vSfAfUXP3qzivl/9Pcib/RbuPDxeuV4/62cJ1vb5HycXIr+bx0I0FEow7RJjFdUwDND+RkE1RPyQu0ZKTrOBkBORC13WvZpiGPK1tVZdq/eyaWFJJI5gUFQvjnKnclWsyVaDkjYEuuQ/kAJOoheFmM5vQzXMd4Xvbs3F8XXiw8gPNK27fi1kjSgHtjXnDHPpld0v/60qniE7B6XFznDVkT5j0MkJgYKYCagbxCX9gNRuHJUMys2u7NsM9zuO4xRHaa1YqIE/DvnrINMcxhkpKT8E3mnP67zlnS/8bC0tw7YfUYWNYfHevb//ZMOfe7d6wdvBvtJ1V8scBm9LKUUVwXhHtu8dgQQOfV5TPYSaDXGQOXltMZKuDqwtSy3UUc8yEo6QCGEUqIcO+uq/WHcKoI27go5MWTtg6LqnMKtb+sq3qbIs3r5stTjGM2BvM4cuaMZO4FZTukyiSt6jMXSK4RanPrztEiFA2O8DqVwA5l5MQb2/shYZPiTbD/N7rhCMK1GA9P4CbC/XjiftNxE8mJdN0oAnov8CmRrlNv0njSdM3g0B2UmsUGIl5tOqWjiPEEhxC/rU/SnMYbQdO3oP6aOk60nJbNZhOT6Y2NpkWHBOlNToO6j0wdUxSABIwnKMW1q4q6fsaNlLx35RgUo/8AnDNkJ0J8+CF1Fkr/WrxuR8AXwVrXhWkKIiRX943CJzr0kvmKAJifuW+Crtlmm4I3pcXXrnhWpMwTmgAbYiTDZi8uylpwdma/3iTOO226N0FJJ40JN+SSbW3b/6QRzhYPrLxgEGT5amN4jBmE8vK4jG6SqAUAQGRdfH6tfzzCm+KA4ag/VoCJj4VCcw7+fYDDwMYHTl9TdouXgRJngxY/QOzZxtW/OsEqL02GRxKOgxnvQWoKMpMVmrRnJN6JbkOci3/zwixBKc7gj/XOFRBD/+q6iygf6AA/Jju1PCzsogciO2LkizchhbyfuiufYq1xHoq6w/U7UwIT5rkjAy2YOO7KpgPCsObnCaBQL6cuWtDP65j4jkhU5/nYjh26zZyEZtzlFayLkN48MYzVV6/r1Xmf9ENHRrpr4geZbR4sfOEZfEyoaY0BuGYetyHvtV1jj7Sst6Gxo9XLx1xX7caVLf2YpdRtIqgHCWni+mvN7eiGxNGloz9kyh+RmDm9eISHeQa625sXaY7YDvv5dAAI1JBK6PUuiaKDLmvEk+4aijE4PCcvFCXPIt5f3DHpcR6GepJa5DX0E+Q80yp/jW4MobfBoWGmEY9un3v3ek8/vgkP27HRjhROBsF7p20mTv/IREfttVXaXr1qeujT0UrVDbgTiNCBxfLhYV03Q0e9oUjfpcT0YKvz30k54FdHhrIgC8qwdFPwpixt5Mnvr+M+DQO7jWRmidF/0jXkvYj0RjSot8DfvcKyRpHDFGpZJxkEsvLMhDc/IgjutouFsezSXL9dFiYCTsmwVJowCF9V6hdb1/HaB5jNU4puNgTSRJPLxYhzUDyAlfXXyUFfu3orGjEUJFIiA8RRmM4E5lh9JQTWU3myEfCiWm1c9QTqsIp8prAJPuVDS6sc1ifJ/ErRJyzmV/3aPEeg0QixZk0jA+sF48XXfMv0LTpQrRZ+nV2auroylrKm2m68WGfRr651kTXYJaXx4PPWM/p+I9wwUDcSd5pj6AfW7AJUhdrQlfKAUxXvzizOpvHUF7N1Gh/9gwm0UuCUCscLyJv7AO14/9KEi8k3wSFPVxglBoFcUHQwbsCJpA2Jy+HXoAnsVttRwSvhMX37lbl7P7Rz7BUAlkXIPI+S1owF6EM83n6QLWuzP924s/BeLPG8BfYmwIASWr8RBmxSwLwE30Fcnj1jow02tKTAnf3GVu7n+e0DVWMgOs16Axo4RFh2WKNS/TtxwnoRM7/LsXRb5ewhoFCTgpAaKeO0eg6D+jdr7hu8RlT77vYliG+RvUedSf+tOKouRSWUWCMgeFsgQlaClYMyWWLEfdywUl/EEEANyRQCN+002/x0P3e5fOEDDxduHT1auAnlXIx4HHDnSLexrTT71ql6Oa3z3+g3ikj0xzgaTWAfPJu50y4iLGQVnJahPacro3KfaxhfCC6Fzzew840xT/qNPpfH5fKIxy1ms1/MFIrs+OuRlo3bYclNgXZBvsL5D979pyadng4hn65Rhc4mbFb/wblXDgCncI0K6qex8vPwEuQPspNvIZ3DwTefGCB3K1dtO7Jzp9y6bt3hW3eN5ZGdMS60fOCh4oihnK8gikfpd8+xbbW4+A17D0i8jybfNYcpvDTGPYUoZkMQAslsyEezPPQwb7OWJs3oNKvsprNfTGfcDUT8/1NYI0FrAWPaAAAAAElFTkSuQmCC";const u=c,m=new Image,p=g.Z.createLock(m);m.onload=p,m.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAREAAABsCAYAAABNX4YlAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAXEgAAFxIBZ5/SUgAAActpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+QWRvYmUgSW1hZ2VSZWFkeTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KKS7NPQAAM3RJREFUeAHtfQuYHEd9Z1V3z8zO7K5kyZJthC3JDn6gxfghGYg47DVHwpfc8UYmOHzgBMfBMlwgcNwdHzmNknC55OP7gIttGR1w5IAPsCDByQcOx0Myr2BjyRZG8ku29bBkWw/rsbvz7O6636+6e7Zndnp2Zqd3Zx9d0k5317v+VfWrf/2r6l9CJCahQAsKqO3C4l/Yi1JChr+T94QCCQUSCkyggAYPJczAQR0ROfuZ9LvVfmt9zS4Bk4AUC/pZN8IsaEokhRdKgMPYDuA4JpS8XtgkiXpMDIps+i2qqm4yDPVqIcwbBZwSbiRpMAkFEgrUKEBA8DkPI7AceVIsVwdSt+DvR+6BVEWV0kodTJ1QhzIvox919ziXEoRJnguTAgknsjDrXZfa5yYIHG6N8ziUfalw7XfA7d3gS14jBsCeFODjtBLKFY9IWT6xgEmWFL0JBRIQaUKU+W4VgIeUwkFZ+SfUM32rhWHfoBz7D2VKvFJmYVmC/Yio4s2VgyKjiuJZY5U4Sf9ig/5NfhIK1EvdE3rMXwpoeUcevMUmIevA46nMJSKl3qNc510yJS+RGdDAAw9br8FITFuUSGkokerJGoW21d6SlwVOgWSpbp43AJ/rkGIbwOMGj+tgkdXB9CuEq/4Y4PJ2AMcqkYZlEfYO4ELin6oNMK40hCcrUfJGubLydR0echSAEYInZqFTIJnOzNMWUAMPlA+d3Q2KCeHoNXh/n1LuW2W/fCncPPCo6NUYBcBIkQMBmNB4IIFWoqpi1K6qfdpSCSMcp/aZ/CxYCiQgMs+qvgYemwEe+TB4WK9zXQnwEG+R/WKZdIEU5Dz0eq03cZFpbCyrIIwUFJ6eRUCBfwc8iSEq4lCqz3pe6HmN9j/PKJcUZ6oUSEBkqpSbZeFUHh19je7cbsAlAABMcdAaBpz8EcHDGMBaCzkMrLb44MFpCjeUOQAWS41BGiLlDkxzLoJwdbnCdhC4CfAmCCAPCLd4XH8nPwkFQhRIQCREjLn4CnAgEATCUl0EiD8zTsp8gzoo/wRObwRA9ElsHQNI0BBGOIlh3RMkHLkIAHIGi7hK3mFId41Iy0u8rWbaXctDlKGeMi4g75KYhAL1FEhApJ4ec+arKXhga7qopv8DdnTcgp4/TO6Csw+AB8GCchGCh8kfxeVd2MqzACCnxCGg0Mdhf6Ww5Ftpj/8EGwN2kqs1sHgCv4FhfIlJKKApoEeZhBZzhwLcKcppCqcs+NPiT/WiWAyB6U2qkvoeAORuOSDeIC0ASAETk4r2w07PaYvHVUjuW0ccZyGuk+LXUom3ukotxtd/oQ9MY7Q7/Os1GlUWruEqDSJIW2PQ3KFYktPppkDCiUw3hWOOP7xMO/q0OLffSr0dU5H3AjReA87DE5aOauEo8ESDRuNAYUNgaoFnwS5U+f3RcuU9gxnzVVIY/0tgjwi4Fi7xUgpCHkSDiLTlUUDOs9qO3IkPXv538ljgFEhAZA42ALVfvMQVqbejM79f9ImrJHkMCkvH9BSFnAK7fyN4kBtxsCdE17l7RnzJXF15v9qfugpTm38A95JWo1iDkXrHiBcDORHAiSqrA2OV6tE5SKokyzNAgQREZoDI3SSBng+sQGeGUYczl7q2ep+S6j1Gv7iAwk9sReeUhsuy3FlaO7rfkCblIa6/AmMDYf7aXG1vVoezF6iq/XW5WCyDXIQcCLeceUaniFe0EKS/f+C3cLaXZgc/E5NQYJwCjaPVuEvyNjsoEHRm5MaxxSWGUNcBLF6it2ug9sBZEDhSsHPQvXl8PxRCF0HLTXD2hUu4L2B7yJ/IVQCQJ8UiAMhXIBe5FNMhbnGfMKAgIlOnI+STQDIv3uEJ8etEkp+FS4EERGZ53dc6L/JprSr/i6hUX4/py+vcsvxLTGF+AaFngbIQgEQKezsIBJSF8NAcwcNGeBNLuAamKo9IU91orax+mSs7bjp1OziQ69Rp7Z/toJHDUIYBu7KO8XH8Bqa2+zWwSJ4LmwKNDWdhU6PN0mt1gedMkDm0GTrkbY0e1R109Cl1TPWMOEsY5r9zlfF7iOM6dPlLIduwdKw8vk9ooLC0IP9VOuIj8sLKY0zd2Z/+lJFVn4AEhMf7CTbNpkEuQMnAdvcimJDfAffyc64MhQW7jCsxCQUSEOmwDXBnqMxPrdNHJUXOoF0goV/Ewz+CT23qop7KrhSWc60r1BtRqeuxhf0inV5FbBVG9b/JC8SL/FaHUu9HqC9Q+gEuhtOfCdMYHQ5TI5nTU6AnpWH8vrygvA9pc2lZT4+0n+QnoQAokIBIm80AHah2alU9CBnESnG28HaAthlDyFsO3bgIILBERZ6vz6lodYNhUAj5bvrK/MCBYMJ8EQxqRh1ID7nC/Y8QpVaM1dXb4c7pjVD70zdi5+lWTIf6ccCugFxQa0hUG6hCXpKCwPWHMlt9mzxHjCJNqzGtWqLJy4KlwIRRaINS5pKdbJw7QZS1PSSMl/6KrJBHikKtGBFqD3R/3r2Bm6ywPWoGjd9hdYq6gyr1SWj7WgMqOeyBYfe6bGnHOhvvo4Tuy+P1jqioA+rb0CT2OXTOEuPBs62y+f40V+Cnb2LlRFBDmVxV2YOE+FczmPqch1WdP5JLRT95CWyDz0FOgswDYCj78FZ2AkBhHiDDpbN4ygCA6Ih26N+mP3mljCM7OS3qdbtpmr3EsisKjNfpybXC3SYxOQ6ZehDB4QnfQ52nkP+ev7KVjzdYIVasFU5eyinJFDoozPgGK6n+3Hip/AOMy94YjgwFPa+D+DyxZx9CHJfXYInlUSHK/4wvCUAAkrDvtm98/5obQXgD/dgE/rMOGY+X9wExJsfcz4gT8oewXAfr18p+9RJwQymthIg7W8G+oDDkbvjnrcwob6cqvoUYbj6Ny+eV4dfBdNeDzkby01sK6PrOj/c5H0Sw3QjtF61XfWSPWloqj14uDctwq7ayrHqcmZns22A3LHDdasxxzBHsuS66TnX0ZPbQmW1DQ5XGBhuAyjQCisYJ9RS2lytxiTyDBZARPZmhELNzDPFC2GJEZKCG0BQF96K46ApAYUfGLnbUJsAITw1IcrkYsZ8x06ahlgMpvmW64htiTL0C3n4X/tdiBQciWOSF6gGqFLliKlMQEIeY+7S2gLwGlonghoGH9XHLgyplyuJaHODrd4Vp44BO53RBoomZfRRw0IbANmMqa5Ry2eyv85fJkTCQaITIoyXl0eA+/ODYS0rlwl1YFXy9cN2SYaJJQHw/8wactHLJM1WltMs4t3HGMIwTy8urj23cNXoEmXoKIr5HZcXet+zezx4Ig0p+u7L2DAvVyHJ1VYYddaG5q5OGfAQFjbqX0ircw7R9nQWDwMDOD2Ni+7lJfsFVutN67jH9EkB0VNBoFkQJVF4nlomPGsfcZ7F++wj6/3cM03qXY1euMM8Yb8RQci1CXY7l4jRLp45BGKvcwzr8Jg1KdY2B4E3a5/eo9NFK8a9QaX8KgMIUz3VRplq6Qfp8oj0ia950NPwe9hPHexxxh+OIep9KXqPiCttPJd7JwjB++gnoP5l/uvt5YnWCS1aZ0bGxb33ol+rP8q+RZzbcrcxtN0jHggNGLI81KUv17zP9/W/mmONW1IDkGc5eGuSDHU43x6Dz4VktlNG2ndMqnTp09M0f37PxTR+735H2T++6avFOlEWz9ZTtQCWgYCFjLkIwxupO6vVUjQ11yYADqDeh7zo3j8TTR+i9PpggN4DmfQIaQeS5xvmYjp0Puc535fnFZ+GEP+e76kh2pVN21psj6jrIS94J+wNCpp6LUkS0xweo48WxS9GK/lPu7FxfdQwwgg0miZlHFEDrxKxEZBZZYuxE4X12unA3Snfvkot2sqIda3Oti+JTGkvschVyvmoVbV7PcXpJCiImlizR+DVfzgxzxg6uyjKsbG6xYYrFsHmFXai8CyLOI7c9VPjFrTtH7xEp+7tbpNRaycmZbBrmcujMCmN7Sbe6tDeBP/C4CAUG4ZjIgYxH+So+aK6u3gFAM8RerLoMYaVoRfEgwvLvG5X9qa0pQw2KCwredne0o7p48TG0ARwfntIysuAOZfFFbk7R29NYV4mZLxTwuMpq8aSdRT+qoPUsYdFWjKzVQ2ODwAOzYTKbhpFCK6MHYBAHydAwqr8ZRQcmiIJPGj0UB5a0CBz8V50cGCl+ki+nf98LXrHB23bsoh00akzbLTOVy63A9OCdldHC24Sdun/jzrEv2yr3tfw6WcgjHnImsU5xdN501kKZh+UsM5p83kVTDkSsNs7aYHBQm3F25o4gqwQQfRnVBgAKRhaEcdOrqw8F7qA5qyGgd2Bde9qOIkg7ZjotnGqZW/AJ9aF6rnmNfiEVg2YWfg+HqNnrlhFyYftgeiGrmt+QXfh1Mvew38b3pmH9PNW5hewYR5A/7cd3a4y79j2Ze81j+y9B3oJnuyHZKtAIzFRG2BUqlzH0loEgeN2IgQ9WRdBp/SIHJQ+C8LvDP4IAw/Cp3xkX7QLjuwd+am5h/55f5I9ZxFIi9lN6ivsM17adaqFQBYC4Zjpjpgdy6zEV22oZhXtu+9Xo7zAkAYRcCd/jMigK8zL7DZbFdSZdeQwI8lGx0v5LfiP/3Peh3bgTFe+QQUFEsx2bzLAXBu66fcAuXFkTyovzOJwvGxrsA5919RyqXx1Vk2/t37cPv4f91+x17lkC/4+P4H2SOIIwjf4D+3aeTcP6eapzC9mF7fW77xaZ3mTuDeWNjCfkL8hD8GwnDP1o/1w4RIOH+ANSjrp236JT0R8zMFtNLW8sErdt8085lbLtYG3BSKWtVMZ6Q2Wk+OqNu8Y+mym9+Df59bKoORKy5gtoelMDgVXVR7Bqsos1ihZBoXDdJjXa03CviffW2W9dy+osaOJ7tlMA4BGVxTpOJOyJAtfw9xx5Z54JjJZbrdiVkYJjZfsGrb7cX5QzS795267iKnIkG7ZhhJ2b5euqGgAa3s5VcBh4j1XgjOlMDdW7ymQSeBZSYBwKms1pI0FkHjQKCxyKYZeKVQfzuMyi3JsgENoGwesruWKzYdu2BQck4D7Ik7Z9TmcWtuYkSz2hwPj40AwwmtnpbM5RTqSRxITQlHKVXR4puH2Lc9cAHL+ycWf55dtuuMHJ79BToMYw8/ab0xr8NRtM5m2Zk4LFS4FmjScSROJNutexUaAqVelUwQGQvFIYzh03/3L03Pz10o5b2NrrkibpJxSYaQosEBAhWbH5DMNw6XTBzQxmr0+n5afy3HGZAMlMt7kkvTlMgWaA0cxuDhdxsqwDSLj5bqzC1Zv3v7CrcDNDaCABoEwWOnGPpsA8mf5GFzBxiaRAZMeZB4LVqEJbynEqVgZyVyk/dtvDpUu0xx3enoioQIl9QoGEAs0pEAkivR1ZxpeUmme7O1tsmklhY5qDac3Frmv/KWMjN6LP23QXdRI6ocD8owDEAMH2MqzTYJ2ifgNZ5GYzzYnEt5eCQl1e2ziODnwbXzkaJzx3RzJdT68FfY2HGffV7ZtOHdrTIW6VN258aPQrd1418HC3kSbhY6aA1mCPw6FR7TCqDYWz0Y6fsP/peG/MA7/R8tAB+IP9fzG3ca7A8V9gGtMP7Dt6yip2hhMvDGS6DjfqPjqKs13PKBDwwDAzfTxH5wGHJmJEBBrqoB/HrgLyXG6Iwu5SLMX6W7AjQk3F2rSLRQf7R84rjYz9ASJ4WG9E8483TyXChRxmOqa/OItjGpZlNhtr5jqtdVfAKUi7AnX6YPtRnla9opPiYhkf/S2bMVAnTcfpTiKjX2bMAYBkBnAz60nbMgxo04E5MrhT5zkSRDidiaFU2GgPpSQ4GWeXCjhViwN+3vEc5qGZAa8CNT1CDOCwjzTThgkYQWcvkMjcih2Z32aRTWKH4qGUwGsg61tuefDFO7euW3pwaLmQPJk6kwYn55v2E24OC+Uj/K79x9RGQklM/TXu6S87gF2plGS1cga5Cpd96pmcTSHJLSjZj4MoAx7tPM6kyyyy//AcE/sb6CahYioWWZ9ub8UXy32I/59SqvIz5vPk02s1txPZKfXIEsVGtlNSciBARAgxgbfO50Gw/2uQe4NuUZd8RcgYDq6HNS1lc3rhOlkQ9ny7WrrMKat1eF+HE7pLXduxeC4GwbjCEk+jAotULZaEYaUuSznGesR7kLIRVqoufyiP0/mKOaZXD/ugqvA0DsDdjQaGY/ZBmuhPrKzatw8upEHNLvA7D54uuA8eqixJU34CrefHJrSlSWUpthvXbyssZ9T7ZG5hGoXjCNs3xhF2C4cJ3oNns3B0oz3bOIdCE8qoMNsYQ72uQm1vTmVzV+AAqcdxhxPq7J0AoqxMH9R4lbbjaNRmE2mgE6ax7jg+tUGc4bw2JtHoxr4pTMt1XGHh4F1l9OjI3i1vPG8s7ymk0kcnIkGkMfIOv7XoxezrE3ZhbK+1qP+//v3FkiNKR4Yas46VR19TGRu7CZ36RoBJhsRmz0GtdA8kIDunTOnFfWb5dOH1iPYbzOANHnrHeraE8daZEKeJ8nDEEPJirYujzluzD58D0QBCQPG/m3mdMbsYQVcZJrQJOPZpxPmdO68eeGbGCjHzCT0MlRVvheKNK9CadX12kQWGx0IJuoVSP9tyde6+LuJqGTSkU1f7iwQRPRq3jGoSR/ZylkeK4yO4GoG+CQriaD0qNsZyZFDIFSM7VH54mAqYGe4n/Nu4q/ADu1D4n1BGtBLTmwBZkUJXBgJccH+ACzBJr7oF6iG3ruuHJq8ZMOj8OhVUPSRrYGnBYR1Kvxxj7Vlw6ReuMQCIG6AfoCaeigqY2FAwsEDhEnXFC3k/SPQI/USBCexZx5ybTisoeiw5c9K1AbtK2Tr0LFZACxi2myPFndD47ynB6TqFHkewX+y3vnz9haWP/EJlS3IsjbKihlC73bZmlouRSVyuCsPd2F5/6hqgGJ1nhoWLfhn0P20XCSJ6ZOlmOsPodXmklSvohixwyYKdH6rPgJezJr9IOw+Wac/evRaVM995de7rH3iocFAVC18D+7eqWiywU3CJukvSK8Ou8Cpa42LLtC9EfM8NIeczIBfxmEzAJOr9ZnEw9Q68vQQNYBB0ywFAchIzUJZOa6kkItOw1JAaqZPQ/6GcN+MLulJBh4aRTJMe3hCMU0DxIPSDrH0aU0zoDeH3LDbsUtpAg52XV7SbrXJdXcMN/MzFJ7YS6DKOpYVtSUzyp6kQnJqjcemBcpqS0NGyE06fIXUwxOfsF2oNo+3EwCEQ8bR29+3bLQLKXVflfo74/rxaLBbNVFrvPm07vhYeKYzBPDyH7qo3njFdsmwtgsThpCVpaE4KouQ1uA/mtbgC8yIAx3LcXtcveQaZ9+BSkRQ1sOOiLPwpVQIIoDuBtF+Uq53v+RnRTF84U3BnU5XqaXEuFQytWweFQwAQffFW2GNM7zFOZ1g239Qp0Aos59czbmgk8SCFnEnToqN03u+nK+P566+3A6XAd67N/SNa2f9Bp0dy0F8OknWTLkqJ+YzrWn1QlOaKlwdx7VkTasuBZdxPb0ojobLQUSegonBUVAEStsIdMAq3ZiBv3p+WMGmWtIqrLU11Wh1GXrcwOwAKaier4y5g59Xrs2KJsKwt7vLUV9VB61r6lwATqkKs+aFlYnpHgRY9sHeZ6izlFkUYHw86i3J6fGsdINTgTlN1/zemM0fNjJ76dYV2XimlC6XPYESMFTp+/BxbvmMmCYDDgbwdF6szngxD5wbvXPxlHQV5wRXbBA7jy/LCqrc5bpsGlyDbBBUpNnufWNq/HNOjtxnLxA2w/rY6kPqs2t93oa8KUatBrAXs8iVGmUiXOUmCzzQFIkFkNjaKoc1eh7nzVQMPo1fdZ1o6+5QHdMWNoOdhZRmkd9U5H9ut+lkJy4eHuwKn2CsSi4OQlkhwK48bpvwHxs+pSRMZh5R5jx4gz3WURqnjkJ9kcOPMgPgzZTj34E5eyF+ATFCDSE6G792aOKczs4vw3VJm/oePBJE4G0VcZNy0CSDiC3vx+Denqu84gUiR4oUuDBAJnYnj/aKyMwrZCMwMSFZ1Ou39uNivl6JyQxT2S/KC8pM6mHdVZtMYUJ4MaHSd5m8QDNMkTpcUbrq7HOT6qnPQ+gQDUvAaF5B0VwlNi5FYzgEKRILIbORE0NdFfjP6kTbuo9hUgw1JHEi7ar5efOBl8LLISZm82W62GVsMopRFsRvXYei9LOj4KQBANAf2bPpSTH0u97Sq6uJwuqTUadwv0yf6DOhTUQdTn0Y8GC+6BxK2F79iuqadjieuyLrOTRLBZBSIBJHJAvbEPdSwcFXvUYzK2PUXTxHQCQhFOVMY7GyzyWDTIfgJHrEQ6qvyt/QFU8yfXroNZ1TltfzEQ1RX/TZWeJZrEAGhfH8kVppciYafPvFR90D6b+mmgWR7PFMbP63uHkGOu4slCT0DFIinB85ARr0kgCKbvDdVxqkXLAMHfEksWWB8XFadRQbY5mgupCR2G+kUry/k1ItcyMRuBtoE9mBR1vOKbn2F4EQqpfWl3ZADGWn1n51nUh9mvL6MZEptIs7pb1Aw3mfDfGnjT2ODz+Q5eygQi1CtF8XB8OzxIEGLiyMTWPbAbdTjDTeOOLuLg6tGKZ8L+ZqBay45/UCUE7iQcDLqiFiGJeKr/MkOKdSsTGksJVewZJyWVbFJHbB+I1fZPxQ7NDcTPU0KJxR6j336ixxjicrLN/K04ZhQQ2QXZ8DkyfRxQElMWxSYWyDCNrTZK5dpqqWo6SyH2lgMhnC02WKqD11rthhyIQPCgBxjt+GkvqmxYyf2hWCvR2MWfXDxrB0Lm27FhRpqyLEE+0YaA3FqUwCQnCXOEqfkf1dPit04v3NMr/o0SWNi8HGbODkRjeO43wMHaEaZgt55ieeMyrrJ+SRAMl7BLd7mFIjooWGTUPk8hgopL8JBrX7Xqdtn1aKokU5aGEIMQX87Uz7lcI9o7w02kOkVGeQG+foaZSFtcCHe6OnKq7CkOzARapoUi7paTsM+K14HTQs3A6j+Rm9IA/CAJjEhdJN0o62w3K4ZrUXYS7geWvlHDMseMFWfMr1TJtEhu3SRVWm4/ZlTd7xcntAAkgBJWxSdUyCyebOQ+bx/9sYV680cVj0LWteIx/a2VeTmnjg3ApqMLDp7QJ+oxVH83hpqplrM3ani1zLdmgvxM8pVFt3psc31cgM1qzz5TkvagGmn0p8KhLBpcHZ/jD0k35GrK4+KnVrlQtsgEuN0BmoAeK+8kQMz8lncEX4C2ixxeJ6KqlBSSmyYqyjJTdgteA9K0Rg2bI+tQlBSkRI4UnHrrrHPbbm6/64ESPyWNcljToHInk0YlPNCfHB38UIoOBjm6Vv0fDYFbyfrJIWNdAbbqnesSuPo310mtdamYzt2tOx8kXHF4+DtCwEIIGv/KCkLIUOytrUshEmrozgRXBKvAF1oSJuW5dDeJK4dRamNfvEyUXDfjjCf6jE3AuGxK3A5+xLDNJewIDNhoMNE9J1libFjhb+47eGRn95x5eCeWzB93Io90jOR/lxNY86AyAaqLcQ9uiS067rvM9N9q52ynnm07CSTVQw7EaYLhrdj1T0c+F9+bNjrhoHFTD4DWcioeBqni7+lk35Qn5GZvDGX0xeiB0LZjQ7FMkSN2eMl4tQF3AgWeNPKlW9S+8WX5GrxXKfcyHiE8bxBCZXjeBUUT4RRsXhpsB2VyyMmzkjLxThNtYzeV2Rbg3BUlAvJfvIG1i01MK98ocs4qBdhyNf09cGHCq/FKHsbZRgYrQgqXZUB8VASbzhlRiX3BVkN0gu+Z/BJDVcpggDa9r/IVZU9Ou0WXEhYqAoNVJch/LL6I3lt5J6yEZwURthrIG9dr0NAdUAbIafTC88Ukcuc3j+dBnToUbULGxauJsLkRg9YHvGns4hzP+5ITkRL27tdmyfCw6Qy53bU0Tm/vmGbMKjvdA+W9gLp/Id2ldfgeOud0CeyDAfweMJVq9rwUpniLyPBiWCnWq4ahvE4Y9Gam3QfniROAhAgaBJfnTo7WHY1sGpyFMsTekFCr5bISVlqTW2oxHuZ6MPp5k73u4AbwbKwg23xpntGXYtMf1urDoDMBP1Kd6jJCuJX92TeZqc7a5GaPXRtosSRPWN2Zr+XuYokFTty172DdWJIe6XjNekjENZhWtIyWnIAADCOgE54Se/WXaU3OML+LFQkDvkAwvy1jKstwgIGzDQG/mrlqYpbfJphtOylQXtT07jiBxD2Q2yaJZclfpRabf9cp9vijIx2h8A5OHSHt0tJFX/luxP6EBK1nk8IW1+lnhfnyPOgh26n5vTaApFOEmtKz15azmkEDBGuB+WIBJGuOREUBh0Bf2rpqQo0dWHOvXUdtjVNYsLA8aHvPZlxz1kxpEz5XvSKm8GB9Ps6VuMBEGQPHU5xJQMzml9tXbv0ILM3BKFqOB+TZDlOZ562tXBQrmgYEvtCNA2pL6Tl5jK9izcPv0dA56q4xIdWAnFn/ZobNLhLRoqLRDV1IeSJR8UIaLQQDCnFBjvXTWc1HktpI0GE/asLw+aofMHn5WVV+B+3PTj2BVhVobHbhLBsQuSGtpMpsC4DhlLnulJdBj3T12BUfG06l13iQIVhoBIRdIqFVMwEwNKyS7xXS91XK+99w+yAM210dnjqFpplHxCFyo/9DEygVVTGyoXMinTKXeHvtWS4jqaR2j9XhExxDhQpXoTv+8UwFCRQakQ+pYXRg04L97nhFEuz6m1RW9bS9GQtEkR0w+kmTcyxXVy4h2t0pJVK31otFd6DhjaKaoINIg4VlmwF0kMInPZQ7iJhmVjdy0BWga1P6OAVqtOnfyxV4BlfTYN9T2WzJuI/aNjOT1ncYapipG7KmTbcXGZiJo5dKhAX32NeJkaogQy0aTmVAFkktnJqmpgpZzU+l7YO0bJg0H6P6SRURItRF3EhNuw9Qd0QjFgDkSbGfSKRaSQObVAgvt7RRmKel0gQ0SNLl4JVlEfiRgalykVhpfsGpWlACTHbYvOScm8ANBXqP3Rs7jtmB+LASgHqJGNh22UOPFL2oqCunzF/945XL3qCDj1TRkSyQAkBpjL7qqbxz8wLzuA2J5R29H8Yzp97QS3rS9HdBzWIkFp069RwwxpWK1yFuMbNpPmY85zIVGg1Tp8F/RYJIrEIVkFa3fnRN7D64WK+PklVsa0SO3Sd4FerQySjEr8BF2Jm0lbp9Bi2WZlfZwIb7r67thcl/gRbxsjj/hYXVFH67/etLD+lfQ+3yVNsYEhwMEKthp4Q7vhARG0AkE6k7seDHi6oSrE8dIZmWqqgLuXZ8jFJC50t2ZxN+eh0zjzVvLMRMq1J1vs1aGi9ogjAMNPXeNFdUllsQ5By25a1WT2VGVq+YfrSa005Vx/bHxMjkAf9E70q6PYAsLTVpGv+lFxJik1hZSacO2z/1oRfIlZgvwrNzsnrYd5MZ3rVAsI1MMfeIzmROVaODrMrq1ZfNlU6XTiOqxq3MjDuAjHzsgeyEPIMBFjWhBS/wgERb1kXAk3mqw3DZo8+jDgOigs0TJMp6RaAueGN2mtp1urfBfDTFmYvADp0VsSZ4kQ6y9X0+uakIcUDd+ghn7vjitz9OrltPVrURYeHQNXg/TJAgnvlhaLUjiBzAon2i0UId65vz97Q3ZjKPSMLyWhqBSQD+XAIMDHtUWChcSLsXE7f4pwBLuRfbbf89yQTt9X3ZEWGiXPKgmVdVVSHDWncSysYzLLa7MT+ygy2qp8HEfSiNkN5qbT+DXpUa1/T6+qJ4SEAb3e6RAFvu36DrOvpIBYR0Dgg22cTkQqbJBfiABuQpKPnQgIRrsZU04PZNABkH9afP7513dLTPZzGsKK4fIqbFDVq/ESu9M/JeNOR9ipyg+/NdM+BVHaxP5GZ2spMeynOlC8PQLjIrMnTJqbpPS1t+g1K4ocBgkBFDXb2lQjrZsKKBPSZ5LkgQIQjDJqVnerPpstnCs+jh916+7qBRzDuSCgthSrPHhlwG9gLY/CKTMwdNBfCvSHITftTiR3BtMXAkXlcAM6QHEy7NXHEMfU86G6d7uOBWkSimYNQZEHewm6Bn3aejCoclkkgHKyw2ZEf4vvGoqx39m5PmytkjHOBmoUAIlCbKlRmUS5VPl143jDVTbdfOfBD1nce7Qam/Q4bZyPxFlMpvhQ4DPBYpWJt12or9Nmh9mAADT/oCsJx1dlmCrGFO1Gc+Z0kLj2NmMRPO87IPjYoGtj0Bv1mxcJX8f1TFBIqCrAKbmBf8zQZNAJOYSxZVAXXqPz4zov7z3BaBNNys980ZWdORTufQYQNzkbDS2UG+wT2g+zBrPe2268cvI81lIdSZqzG9AZAmAFvwsGj7mQe7stdXHyW1jCddhRdBogClusteWzyHrjoyKb8Q3jqwOgO14H/KK8kh2GlTadSOuWY7qfvumLwN1F+p9XeA5BO62JaszRbI48EEY4sZPdna8Zb5Ivdk7suRao/l3Jx5qZ0agyH2axPblnbt4/hqOAIANLrEUbhpBBuzsHl3Ur+gPkCZ0FhXkcNN9gjYghMZ7RoEDGw1jqKBf4bTbfhG+Pr4FtLQTAAQG+jzkUeRxHE8LC7CaXavHnzNLXJTYI3LG4G9Xh5fKAAq4NsL1ivkSAS18gyA5T1mjunB9iyiQ4krWzOBGsvyqPFpyGr//SxvgNf3DY0VCH3wfzMBgDRHR15xO7SJ8qi8ouATgEoBN/tPlH0JUYAQXFwIu0mHLu/2g477LsjzEI1A7TMQXbljWibNk0bvOWZmE6+hxwq8zDHTCSIzFJORDcg/ujO5jUn/AI5pGFaAxnai8po4Xm7JL9mu/YXtq5b9BjrRB+sw/IuPHiheltRHGP1VAY94yf9q6CKkAbDYCeGiqvhX5cHh4sGycdwhZI08Gw7ia3BL+PoiakhII9S6ana0F4AyOyot55QZLYnGgkiMWecDd3rvEEDD55BQo3fgX2Tp27fEINRIxkVClHJcmWsJKqjY4+gB30HB/u//fmr+3cHQXu6DyTIRP1TQbs6pzJgjeSP6aTygACw0yJf77HV1yY4Bt4xag+ynwFAPH6sVcB23Lzaasen9jOtnTxc0LZzlHicKQpEgkiM0xkOLRx50V909yfj4JngGZSW32y8eIKz0LZonNgUzqD4w5OAQSen4mI9v1Ry7Orj8PFL2P5Q9PX/7M4h+XwQHfeADLF/9mY7e5CNxqc31JJRt8UzJcfwdsyio6ConXVdv3NBlmKqg2qxT1efgo3JdvjNuujAsL104D3xOo8oEAkiMU1ndIO2MjmNBdDSXsOPZjT0Wj96EvnYKo78UjUANZ9LqOkR0Doq1DGEO4Tu9jTsHoXTLmUOPr7lCnk0HB8Fp/ymcKxnm9nDGap/9wCVYCjF/dmLSgfqnaf85XViEjExCQVmkAKRINItJ4K2zKGJkgphlws/w+s9uOsBgIBNAHALlxESUd0BdBgqHhIGEMQ9CQyBciAJ8JAnZNo8jtvuzgzI7KlPXyGxPWuiIedB3Rrbbuj5ysvEzAU2wEiAh0Gts5jw/4TWAEqWv44mgfe2nqcgD+EdduMxaHq2FTbK03hcUT4S+4QCmgKRINItfdCKXSuTNe1y8YBynJu3XLNIa1LvNt5weGpl37MGHRBbv/XO094v24azF/2OqQxu/D2OeyqDVRnqUOm82wbnZk4DQCS1wkUn2bFL9zDUcZJJgLlJgekCETZniWP2eKgDjnziaZJHczcdS9mxRQyxbUZ8e7ZtQ4RADBhqhc9z9PY3jM2RNs+pjL6OQJbFI+JoRe9bYXmQ/84hADRgWPwy1s7D68Bz5UcztvO8jHOlLurzGQkiXctE2Ku9Kpd2aRUU/4nq5h3CzFPQ0Y7B+uUmf0+ABoiG3aWzUNbRTqlIES0xhnTofnOdwFQtRhMnks6i7roJLSmvd9LFSKskqtgoEAki3cpEajmEBGDp4DIPOO4TLo7ctwciiCCfz9eimS8vemm3gF2qLleU0Du6lYeECdPDjq8HnXBeungPioGrQrSAfPNekbrlQaVW8PqK4S4i7jToDiGODO6UT4yMqB3XD2OH86zYY9RpKabdfySIdM2JMOscGfX05QWvIBhSRN57XYC/Xt8AxaE/7RD0EAX7WLhy1TawNqVbDsLasp7SNHWeCcs4l3gpIIKBlNzRAvT8EFfnemz0EjamVB1Px3uc7xlIXrPWM5BOkkRAAQpVhXpErC4d1laBcDRw7+QZhC1CnUDcUpEOp0axciLejLfPceT5JIcGqF7tQwnS9XbycSDokDKdVOjc9BvJicQ2nZmbdJmOXLMBGtROgVa4E9xHVScSCEenkqIfdgyo1E/11nGaDmOLkRMxnAoYDykXY2vhZzbuHH30tocK5kZSbVfTlf04S10fF+VwDxUySPd5Yau77nzVwMMoJ7KW4EiYUJEgEst0JpxS8o6TgRhVi7ikSpi7uF01LnlIvyVOK0cU/E2+pHT3I2bv+glSBmXQV3Hv8iutjHhlr5oOcqEpmeoXYuRIYflN25/5Q/SL0iw8RtErEul0I0Gkp7mar4lTTGjjqmxD6EOB+OKg1p08hLQ6H1vXDk5yXy/9dWI65ET0oNNJ/K39agirjhWcaiEG+rROq5UrZSAl180OwNPLc/3nLsfzEC4ZTcQAIapFgkgynQlRqftXT2IBzZ2iLB8VZtmTh8Q7vy75E5qe8BAxTmfGqQ2WDR96hWbccsbefG4ONwOQorjO1Ix3O9+MFWS6E4pEVBCuw7FourM6h+MnLQkjaIyg6yNyRUz7QzZ7NPG4GXUqAJGk4mJpK6wtb8pJEElMJAUiQSTeQTIy/YXhgF6Njm7wsm60yz2hQnfX3zeNAz0wajQAEbT57uJlBpOOE6omvHIQmC+GK07N/oLyBStSwXf42cStBYiEQybvXVOAQlVbjNmO2su4ILQj7bvv7H7GcKrxBKUHACsCQGzx+tEnj/lCAYAAG0ezPw0svhvPpTUWmVPWZg0rUiYSY/tuzMtC+/bkIaA0tLofsuzUs1yZgYlFqMoVHgAHpksKIAIEYdXHoT22WWtZaDXnVRKnovPDkIvAfpfJWCpfSI5S06uPGwjr23u08OPiRySI6MY5P0jX+1KwEXKTWVE+LTPF4zFnSMOGo+RRk+s8/KJus/nS8GMmVqfRaYGx7nUk6GTdr9PYZ8q/DwYAkA/uKrwD2nquRUMpKOmeAU5AcC0HsM0ohxZ6T9V1D1vSfAfUXP3qzivl/9Pcib/RbuPDxeuV4/62cJ1vb5HycXIr+bx0I0FEow7RJjFdUwDND+RkE1RPyQu0ZKTrOBkBORC13WvZpiGPK1tVZdq/eyaWFJJI5gUFQvjnKnclWsyVaDkjYEuuQ/kAJOoheFmM5vQzXMd4Xvbs3F8XXiw8gPNK27fi1kjSgHtjXnDHPpld0v/60qniE7B6XFznDVkT5j0MkJgYKYCagbxCX9gNRuHJUMys2u7NsM9zuO4xRHaa1YqIE/DvnrINMcxhkpKT8E3mnP67zlnS/8bC0tw7YfUYWNYfHevb//ZMOfe7d6wdvBvtJ1V8scBm9LKUUVwXhHtu8dgQQOfV5TPYSaDXGQOXltMZKuDqwtSy3UUc8yEo6QCGEUqIcO+uq/WHcKoI27go5MWTtg6LqnMKtb+sq3qbIs3r5stTjGM2BvM4cuaMZO4FZTukyiSt6jMXSK4RanPrztEiFA2O8DqVwA5l5MQb2/shYZPiTbD/N7rhCMK1GA9P4CbC/XjiftNxE8mJdN0oAnov8CmRrlNv0njSdM3g0B2UmsUGIl5tOqWjiPEEhxC/rU/SnMYbQdO3oP6aOk60nJbNZhOT6Y2NpkWHBOlNToO6j0wdUxSABIwnKMW1q4q6fsaNlLx35RgUo/8AnDNkJ0J8+CF1Fkr/WrxuR8AXwVrXhWkKIiRX943CJzr0kvmKAJifuW+Crtlmm4I3pcXXrnhWpMwTmgAbYiTDZi8uylpwdma/3iTOO226N0FJJ40JN+SSbW3b/6QRzhYPrLxgEGT5amN4jBmE8vK4jG6SqAUAQGRdfH6tfzzCm+KA4ag/VoCJj4VCcw7+fYDDwMYHTl9TdouXgRJngxY/QOzZxtW/OsEqL02GRxKOgxnvQWoKMpMVmrRnJN6JbkOci3/zwixBKc7gj/XOFRBD/+q6iygf6AA/Jju1PCzsogciO2LkizchhbyfuiufYq1xHoq6w/U7UwIT5rkjAy2YOO7KpgPCsObnCaBQL6cuWtDP65j4jkhU5/nYjh26zZyEZtzlFayLkN48MYzVV6/r1Xmf9ENHRrpr4geZbR4sfOEZfEyoaY0BuGYetyHvtV1jj7Sst6Gxo9XLx1xX7caVLf2YpdRtIqgHCWni+mvN7eiGxNGloz9kyh+RmDm9eISHeQa625sXaY7YDvv5dAAI1JBK6PUuiaKDLmvEk+4aijE4PCcvFCXPIt5f3DHpcR6GepJa5DX0E+Q80yp/jW4MobfBoWGmEY9un3v3ek8/vgkP27HRjhROBsF7p20mTv/IREfttVXaXr1qeujT0UrVDbgTiNCBxfLhYV03Q0e9oUjfpcT0YKvz30k54FdHhrIgC8qwdFPwpixt5Mnvr+M+DQO7jWRmidF/0jXkvYj0RjSot8DfvcKyRpHDFGpZJxkEsvLMhDc/IgjutouFsezSXL9dFiYCTsmwVJowCF9V6hdb1/HaB5jNU4puNgTSRJPLxYhzUDyAlfXXyUFfu3orGjEUJFIiA8RRmM4E5lh9JQTWU3myEfCiWm1c9QTqsIp8prAJPuVDS6sc1ifJ/ErRJyzmV/3aPEeg0QixZk0jA+sF48XXfMv0LTpQrRZ+nV2auroylrKm2m68WGfRr651kTXYJaXx4PPWM/p+I9wwUDcSd5pj6AfW7AJUhdrQlfKAUxXvzizOpvHUF7N1Gh/9gwm0UuCUCscLyJv7AO14/9KEi8k3wSFPVxglBoFcUHQwbsCJpA2Jy+HXoAnsVttRwSvhMX37lbl7P7Rz7BUAlkXIPI+S1owF6EM83n6QLWuzP924s/BeLPG8BfYmwIASWr8RBmxSwLwE30Fcnj1jow02tKTAnf3GVu7n+e0DVWMgOs16Axo4RFh2WKNS/TtxwnoRM7/LsXRb5ewhoFCTgpAaKeO0eg6D+jdr7hu8RlT77vYliG+RvUedSf+tOKouRSWUWCMgeFsgQlaClYMyWWLEfdywUl/EEEANyRQCN+002/x0P3e5fOEDDxduHT1auAnlXIx4HHDnSLexrTT71ql6Oa3z3+g3ikj0xzgaTWAfPJu50y4iLGQVnJahPacro3KfaxhfCC6Fzzew840xT/qNPpfH5fKIxy1ms1/MFIrs+OuRlo3bYclNgXZBvsL5D979pyadng4hn65Rhc4mbFb/wblXDgCncI0K6qex8vPwEuQPspNvIZ3DwTefGCB3K1dtO7Jzp9y6bt3hW3eN5ZGdMS60fOCh4oihnK8gikfpd8+xbbW4+A17D0i8jybfNYcpvDTGPYUoZkMQAslsyEezPPQwb7OWJs3oNKvsprNfTGfcDUT8/1NYI0FrAWPaAAAAAElFTkSuQmCC";const V={id:"phet",name:"PhET™ Interactive Simulations, University of Colorado Boulder",copyright:"Copyright © 2002-{{year}} Regents of the University of Colorado",license:'This simulation file is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (<a href="https://creativecommons.org/licenses/by-nc/4.0/"><u>CC BY-NC 4.0</u></a>).<br><b>COMMERCIAL USE WITHOUT A COMMERCIAL LICENSE AGREEMENT IS STRICTLY PROHIBITED.</b><br>For information on commercial and/or brand licensing, see <a href="https://phet.colorado.edu/en/licensing"><u>Licensing</u></a>.',licenseWithoutLinks:"This simulation file is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). https://creativecommons.org/licenses/by-nc/4.0/<br><b>COMMERCIAL USE WITHOUT A COMMERCIAL LICENSE AGREEMENT IS STRICTLY PROHIBITED.</b><br>For information on commercial and/or brand licensing, see Licensing. https://phet.colorado.edu/en/licensing",accessibleLicense:"This simulation file is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). https://creativecommons.org/licenses/by-nc/4.0/ COMMERCIAL USE WITHOUT A COMMERCIAL LICENSE AGREEMENT IS STRICTLY PROHIBITED. For information on commercial and/or brand licensing, see Licensing. https://phet.colorado.edu/en/licensing",getLinks:l,logoOnBlackBackground:m,logoOnWhiteBackground:u};s.register("Brand",V);const M=V},163:(e,t,i)=>{var s={"./phet/js/Brand.js":9599};function n(e){return r(e).then(i)}function r(e){return Promise.resolve().then(()=>{if(!i.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]})}n.keys=()=>Object.keys(s),n.resolve=r,n.id=163,e.exports=n},2434:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(1383),n=i(8588),r=i(2643),o=i(8681),A=i(1091);class a extends s.Z{constructor(e,t,i){const s=i&&"boolean"==typeof i.phetioReadOnly?i.phetioReadOnly:A.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioReadOnly,o=!i||"boolean"!=typeof i.phetioFeatured||i.phetioFeatured,a=i&&"string"==typeof i.phetioDocumentation?i.phetioDocumentation:A.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioDocumentation;super(n.ZP,{derive:t=>e.getLocaleSpecificProperty(t),bidirectional:!0,phetioValueType:r.Z,phetioState:!1,tandem:t,phetioFeatured:o,phetioReadOnly:s,phetioDocumentation:a}),this.localizedString=e}get stringKey(){return this.localizedString.stringKey}}o.Z.register("LocalizedStringProperty",a);const h=a},8681:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s=new(i(2492).Z)("chipper")},9119:(e,t,i)=>{"use strict";i.d(t,{Z:()=>E,j:()=>w});var s=i(8664),n=i(1005),r=i(7298),o=i(3600),A=i(170),a=i(8292),h=i(8681),l=i(9059),g=i(2434),c=i(592),d=i(0),u=i(2643),m=i(9362);const p=new c.Z([],{tandem:n.Z.GENERAL_MODEL.createTandem("fallbackLocalesProperty"),phetioDocumentation:'[deprecated, please just use localeProperty] An ordered list of locales to "fall back" on when a translation is missing for the selected locale, for example: ["es", "de" ]. "en" will always be added to the end of this, because it has guaranteed full coverage of all translated keys.',phetioFeatured:!1,isValidValue:e=>_.every(e,e=>!!phet.chipper.localeData[e]),phetioValueType:(0,d.Z)(u.Z)});m.Z.register("fallbackLocalesProperty",p);const V=phet.chipper.localeData;class M{constructor(e,t,i,s){_defineProperty(this,"localePropertyMap",new Map),_defineProperty(this,"initialValues",{}),this.stringKey=e,this.localeToTranslationMap=t,this.property=new g.Z(this,i,s),w.push(this)}getStateDelta(){const e={};return this.usedLocales.forEach(t=>{const i=this.initialValues[t],s=this.getLocaleSpecificProperty(t).value;s!==i&&(e[t]=s)}),e}setStateDelta(e){Object.keys(e).forEach(e=>this.getLocaleSpecificProperty(e)),this.usedLocales.forEach(t=>{const i=this.getLocaleSpecificProperty(t),s=this.initialValues[t],n=void 0!==e[t]?e[t]:null;i.value=null!=n?n:s})}get usedLocales(){return[...this.localePropertyMap.keys()]}getLocaleSpecificProperty(e){if(!this.localePropertyMap.has(e)){const t=[e,...V[e].fallbackLocales||[],"en"];let i=null;for(const e of t)if(void 0!==this.localeToTranslationMap[e]){i=this.localeToTranslationMap[e];break}this.initialValues[e]=i,this.localePropertyMap.set(e,new a.Z(i))}return this.localePropertyMap.get(e)}dispose(){this.property.dispose(),(0,l.Z)(w,this)}restoreInitialValue(e){this.property.value=this.initialValues[e]}}h.Z.register("LocalizedString",M);const B=M,w=[];window.phet.chipper.localizedStrings=w,window.phet.chipper.setAllStrings=e=>{w.forEach(t=>{t.property.value=e})};const C=new o.Z("StringStateIO",{valueType:s.Z,toStateObject:()=>{const e={};return w.forEach(t=>{const i=t.getStateDelta();Object.keys(i).length>0&&(e[t.property.tandem.phetioID]=i)}),{data:e}},stateSchema:{data:A.Z},applyState:(e,t)=>{Object.keys(t.data).forEach(e=>{if(!w.find(t=>t.property.tandem.phetioID===e))throw new r.Z}),w.forEach(e=>{e.setStateDelta(t.data[e.property.tandem.phetioID]||{})})}});s.Z.create({phetioType:C,tandem:n.Z.GENERAL_MODEL.createTandem("stringsState"),phetioDocumentation:"Strings that have changed from their initial values. Each string value is specific to the locale it changed in.",phetioState:!0});const E=e=>{const t=e+"/";let i=Object.keys(phet.chipper.strings.en).filter(e=>e.startsWith(t));phet.chipper.usedStringsEN&&(i=i.filter(e=>phet.chipper.usedStringsEN.hasOwnProperty(e)));const s={},r={};return i.forEach(i=>{const o=i.slice(t.length).split("."),A=o[o.length-1],a=o.slice(0,o.length-1);let h=r,l=t;if(a.forEach((e,t)=>{l+=`${t>0?".":""}${e}`,h[e]||(h[e]={}),h=h[e]}),"string"!=typeof h){let t=n.Z.STRINGS.createTandem(_.camelCase(e));for(let e=0;e<o.length;e++){let i=o[e].replace(/(?:[-_\s]\w)/g,e=>e[1].toUpperCase());if(e===o.length-1){let e=i,s=0,n=!0;for(;n;)s++,e=`${i}${1===s?"":s}StringProperty`,n=t.hasChild(e);i=e}t=t.createTandem(i)}t.phetioID.includes(".a11y.")&&(t=n.Z.OPT_OUT);const r={};Object.keys(phet.chipper.strings).forEach(e=>{const t=phet.chipper.strings[e][i];("en"===e||"string"==typeof t&&""!==t)&&(r[e]=phet.chipper.mapString(t))});const a=new B(i,r,t,phet.chipper.stringMetadata[i]);s[i]=a,h[A+"StringProperty"]=a.property,a.property.link(e=>{h[A]=e})}}),r}},1603:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>c});var n=i(3600),r=i(4792),o=i(668),A=i(7464),a=i(5428),h=i(7232),l=i(2473);const g=new o.Z(0,0);class c{constructor(e,t,i,s){this.minX=e,this.minY=t,this.maxX=i,this.maxY=s}getWidth(){return this.maxX-this.minX}get width(){return this.getWidth()}getHeight(){return this.maxY-this.minY}get height(){return this.getHeight()}getX(){return this.minX}get x(){return this.getX()}getY(){return this.minY}get y(){return this.getY()}getMinX(){return this.minX}getMinY(){return this.minY}getMaxX(){return this.maxX}getMaxY(){return this.maxY}getLeft(){return this.minX}get left(){return this.minX}getTop(){return this.minY}get top(){return this.minY}getRight(){return this.maxX}get right(){return this.maxX}getBottom(){return this.maxY}get bottom(){return this.maxY}getCenterX(){return(this.maxX+this.minX)/2}get centerX(){return this.getCenterX()}getCenterY(){return(this.maxY+this.minY)/2}get centerY(){return this.getCenterY()}getLeftTop(){return new o.Z(this.minX,this.minY)}get leftTop(){return this.getLeftTop()}getCenterTop(){return new o.Z(this.getCenterX(),this.minY)}get centerTop(){return this.getCenterTop()}getRightTop(){return new o.Z(this.maxX,this.minY)}get rightTop(){return this.getRightTop()}getLeftCenter(){return new o.Z(this.minX,this.getCenterY())}get leftCenter(){return this.getLeftCenter()}getCenter(){return new o.Z(this.getCenterX(),this.getCenterY())}get center(){return this.getCenter()}getRightCenter(){return new o.Z(this.maxX,this.getCenterY())}get rightCenter(){return this.getRightCenter()}getLeftBottom(){return new o.Z(this.minX,this.maxY)}get leftBottom(){return this.getLeftBottom()}getCenterBottom(){return new o.Z(this.getCenterX(),this.maxY)}get centerBottom(){return this.getCenterBottom()}getRightBottom(){return new o.Z(this.maxX,this.maxY)}get rightBottom(){return this.getRightBottom()}isEmpty(){return this.getWidth()<0||this.getHeight()<0}isFinite(){return isFinite(this.minX)&&isFinite(this.minY)&&isFinite(this.maxX)&&isFinite(this.maxY)}hasNonzeroArea(){return this.getWidth()>0&&this.getHeight()>0}isValid(){return!this.isEmpty()&&this.isFinite()}closestPointTo(e){return this.containsCoordinates(e.x,e.y)?e:this.getConstrainedPoint(e)}closestBoundaryPointTo(e){if(this.containsCoordinates(e.x,e.y)){const t=e.x<this.centerX?this.minX:this.maxX,i=e.y<this.centerY?this.minY:this.maxY;return Math.abs(t-e.x)<Math.abs(i-e.y)?new o.Z(t,e.y):new o.Z(e.x,i)}return this.getConstrainedPoint(e)}getConstrainedPoint(e){const t=Math.max(Math.min(e.x,this.maxX),this.x),i=Math.max(Math.min(e.y,this.maxY),this.y);return new o.Z(t,i)}containsCoordinates(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}containsPoint(e){return this.containsCoordinates(e.x,e.y)}containsBounds(e){return this.minX<=e.minX&&this.maxX>=e.maxX&&this.minY<=e.minY&&this.maxY>=e.maxY}intersectsBounds(e){const t=Math.max(this.minX,e.minX),i=Math.max(this.minY,e.minY),s=Math.min(this.maxX,e.maxX),n=Math.min(this.maxY,e.maxY);return s-t>=0&&n-i>=0}minimumDistanceToPointSquared(e){const t=e.x<this.minX?this.minX:e.x>this.maxX?this.maxX:null,i=e.y<this.minY?this.minY:e.y>this.maxY?this.maxY:null;let s;if(null===t&&null===i)return 0;if(null===t)return s=i-e.y,s*s;if(null===i)return s=t-e.x,s*s;{const s=t-e.x,n=i-e.y;return s*s+n*n}}maximumDistanceToPointSquared(e){let t=e.x>this.getCenterX()?this.minX:this.maxX,i=e.y>this.getCenterY()?this.minY:this.maxY;return t-=e.x,i-=e.y,t*t+i*i}toString(){return`[x:(${this.minX},${this.maxX}),y:(${this.minY},${this.maxY})]`}equals(e){return this.minX===e.minX&&this.minY===e.minY&&this.maxX===e.maxX&&this.maxY===e.maxY}equalsEpsilon(e,t){t=void 0!==t?t:0;const i=this.isFinite(),s=e.isFinite();return i&&s?Math.abs(this.minX-e.minX)<t&&Math.abs(this.minY-e.minY)<t&&Math.abs(this.maxX-e.maxX)<t&&Math.abs(this.maxY-e.maxY)<t:i===s&&(this===e||(isFinite(this.minX+e.minX)?Math.abs(this.minX-e.minX)<t:this.minX===e.minX)&&(isFinite(this.minY+e.minY)?Math.abs(this.minY-e.minY)<t:this.minY===e.minY)&&(isFinite(this.maxX+e.maxX)?Math.abs(this.maxX-e.maxX)<t:this.maxX===e.maxX)&&(isFinite(this.maxY+e.maxY)?Math.abs(this.maxY-e.maxY)<t:this.maxY===e.maxY))}copy(e){return e?e.set(this):d(this.minX,this.minY,this.maxX,this.maxY)}union(e){return d(Math.min(this.minX,e.minX),Math.min(this.minY,e.minY),Math.max(this.maxX,e.maxX),Math.max(this.maxY,e.maxY))}intersection(e){return d(Math.max(this.minX,e.minX),Math.max(this.minY,e.minY),Math.min(this.maxX,e.maxX),Math.min(this.maxY,e.maxY))}withCoordinates(e,t){return d(Math.min(this.minX,e),Math.min(this.minY,t),Math.max(this.maxX,e),Math.max(this.maxY,t))}withPoint(e){return this.withCoordinates(e.x,e.y)}withX(e){return this.copy().addX(e)}withY(e){return this.copy().addY(e)}withMinX(e){return d(e,this.minY,this.maxX,this.maxY)}withMinY(e){return d(this.minX,e,this.maxX,this.maxY)}withMaxX(e){return d(this.minX,this.minY,e,this.maxY)}withMaxY(e){return d(this.minX,this.minY,this.maxX,e)}roundedOut(){return d(Math.floor(this.minX),Math.floor(this.minY),Math.ceil(this.maxX),Math.ceil(this.maxY))}roundedIn(){return d(Math.ceil(this.minX),Math.ceil(this.minY),Math.floor(this.maxX),Math.floor(this.maxY))}transformed(e){return this.copy().transform(e)}dilated(e){return this.dilatedXY(e,e)}dilatedX(e){return d(this.minX-e,this.minY,this.maxX+e,this.maxY)}dilatedY(e){return d(this.minX,this.minY-e,this.maxX,this.maxY+e)}dilatedXY(e,t){return d(this.minX-e,this.minY-t,this.maxX+e,this.maxY+t)}eroded(e){return this.dilated(-e)}erodedX(e){return this.dilatedX(-e)}erodedY(e){return this.dilatedY(-e)}erodedXY(e,t){return this.dilatedXY(-e,-t)}withOffsets(e,t,i,s){return d(this.minX-e,this.minY-t,this.maxX+i,this.maxY+s)}shiftedX(e){return d(this.minX+e,this.minY,this.maxX+e,this.maxY)}shiftedY(e){return d(this.minX,this.minY+e,this.maxX,this.maxY+e)}shiftedXY(e,t){return d(this.minX+e,this.minY+t,this.maxX+e,this.maxY+t)}shifted(e){return this.shiftedXY(e.x,e.y)}blend(e,t){const i=1-t;return d(i*this.minX+t*e.minX,i*this.minY+t*e.minY,i*this.maxX+t*e.maxX,i*this.maxY+t*e.maxY)}setMinMax(e,t,i,s){return this.minX=e,this.minY=t,this.maxX=i,this.maxY=s,this}setMinX(e){return this.minX=e,this}setMinY(e){return this.minY=e,this}setMaxX(e){return this.maxX=e,this}setMaxY(e){return this.maxY=e,this}set(e){return this.setMinMax(e.minX,e.minY,e.maxX,e.maxY)}includeBounds(e){return this.setMinMax(Math.min(this.minX,e.minX),Math.min(this.minY,e.minY),Math.max(this.maxX,e.maxX),Math.max(this.maxY,e.maxY))}constrainBounds(e){return this.setMinMax(Math.max(this.minX,e.minX),Math.max(this.minY,e.minY),Math.min(this.maxX,e.maxX),Math.min(this.maxY,e.maxY))}addCoordinates(e,t){return this.setMinMax(Math.min(this.minX,e),Math.min(this.minY,t),Math.max(this.maxX,e),Math.max(this.maxY,t))}addPoint(e){return this.addCoordinates(e.x,e.y)}addX(e){return this.minX=Math.min(e,this.minX),this.maxX=Math.max(e,this.maxX),this}addY(e){return this.minY=Math.min(e,this.minY),this.maxY=Math.max(e,this.maxY),this}roundOut(){return this.setMinMax(Math.floor(this.minX),Math.floor(this.minY),Math.ceil(this.maxX),Math.ceil(this.maxY))}roundIn(){return this.setMinMax(Math.ceil(this.minX),Math.ceil(this.minY),Math.floor(this.maxX),Math.floor(this.maxY))}transform(e){if(this.isEmpty())return this;if(e.isIdentity())return this;const t=this.minX,i=this.minY,s=this.maxX,n=this.maxY;return this.set(c.NOTHING),this.addPoint(e.multiplyVector2(g.setXY(t,i))),this.addPoint(e.multiplyVector2(g.setXY(t,n))),this.addPoint(e.multiplyVector2(g.setXY(s,i))),this.addPoint(e.multiplyVector2(g.setXY(s,n))),this}dilate(e){return this.dilateXY(e,e)}dilateX(e){return this.setMinMax(this.minX-e,this.minY,this.maxX+e,this.maxY)}dilateY(e){return this.setMinMax(this.minX,this.minY-e,this.maxX,this.maxY+e)}dilateXY(e,t){return this.setMinMax(this.minX-e,this.minY-t,this.maxX+e,this.maxY+t)}erode(e){return this.dilate(-e)}erodeX(e){return this.dilateX(-e)}erodeY(e){return this.dilateY(-e)}erodeXY(e,t){return this.dilateXY(-e,-t)}offset(e,t,i,s){return d(this.minX-e,this.minY-t,this.maxX+i,this.maxY+s)}shiftX(e){return this.setMinMax(this.minX+e,this.minY,this.maxX+e,this.maxY)}shiftY(e){return this.setMinMax(this.minX,this.minY+e,this.maxX,this.maxY+e)}shiftXY(e,t){return this.setMinMax(this.minX+e,this.minY+t,this.maxX+e,this.maxY+t)}shift(e){return this.shiftXY(e.x,e.y)}getXRange(){return new a.Z(this.minX,this.maxX)}setXRange(e){return this.setMinMax(e.min,this.minY,e.max,this.maxY)}get xRange(){return this.getXRange()}set xRange(e){this.setXRange(e)}getYRange(){return new a.Z(this.minY,this.maxY)}setYRange(e){return this.setMinMax(this.minX,e.min,this.maxX,e.max)}get yRange(){return this.getYRange()}set yRange(e){this.setYRange(e)}getClosestPoint(e,t,i){return i?i.setXY(e,t):i=new o.Z(e,t),i.x<this.minX&&(i.x=this.minX),i.x>this.maxX&&(i.x=this.maxX),i.y<this.minY&&(i.y=this.minY),i.y>this.maxY&&(i.y=this.maxY),i}freeToPool(){c.pool.freeToPool(this)}static rect(e,t,i,s){return d(e,t,e+i,t+s)}static oriented(e,t,i,s,n){return e===l.Z.HORIZONTAL?new c(t,i,s,n):new c(i,t,n,s)}static point(e,t){if(e instanceof o.Z){const t=e;return d(t.x,t.y,t.x,t.y)}return d(e,t,e,t)}}s=c,_defineProperty(c,"pool",new h.Z(s,{maxSize:1e3,initialize:s.prototype.setMinMax,defaultArguments:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY]})),_defineProperty(c,"NOTHING",new s(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)),_defineProperty(c,"EVERYTHING",new s(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)),_defineProperty(c,"Bounds2IO",new n.Z("Bounds2IO",{valueType:s,documentation:"a 2-dimensional bounds rectangle",toStateObject:e=>({minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY}),fromStateObject:e=>new s(r.Z.fromStateObject(e.minX),r.Z.fromStateObject(e.minY),r.Z.fromStateObject(e.maxX),r.Z.fromStateObject(e.maxY)),stateSchema:{minX:r.Z,maxX:r.Z,minY:r.Z,maxY:r.Z}})),A.Z.register("Bounds2",c);const d=c.pool.create.bind(c.pool);A.Z.register("b2",d),c.prototype.isBounds=!0,c.prototype.dimension=2},6243:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>h});var n=i(1603),r=i(7464),o=i(4792),A=i(3600);const a={width:o.Z,height:o.Z};class h{constructor(e,t){this.width=e,this.height=t}toString(){return`[${this.width}w, ${this.height}h]`}set(e){return this.width=e.width,this.height=e.height,this}setWidth(e){return this.width=e,this}setHeight(e){return this.height=e,this}copy(e){return e?e.set(this):new h(this.width,this.height)}swapped(){return new h(this.height,this.width)}toBounds(e,t){return e=void 0!==e?e:0,t=void 0!==t?t:0,new n.Z(e,t,this.width+e,this.height+t)}equals(e){return this.width===e.width&&this.height===e.height}toStateObject(){return{width:o.Z.toStateObject(this.width),height:o.Z.toStateObject(this.height)}}static fromStateObject(e){return new h(o.Z.fromStateObject(e.width),o.Z.fromStateObject(e.height))}}s=h,_defineProperty(h,"Dimension2IO",new A.Z("Dimension2IO",{valueType:s,documentation:'A dimension with "width" and "height" members.',stateSchema:a,toStateObject:e=>e.toStateObject(),fromStateObject:e=>s.fromStateObject(e)})),r.Z.register("Dimension2",h)},3286:(e,t,i)=>{"use strict";function s(e){return"[object Array]"===Object.prototype.toString.call(e)}i.d(t,{Z:()=>w}),i(8378).Z.register("isArray",s);const n=s;var r=i(7464);const o=window.Float64Array||Array;class A{constructor(e){let t,i;const s=e.entries;this.n=e.getColumnDimension();const n=this.n;for(this.V=new o(n*n),this.d=new o(n),this.e=new o(n),this.issymmetric=!0,i=0;i<n&&this.issymmetric;i++)for(t=0;t<n&&this.issymmetric;t++)this.issymmetric=s[t*this.n+i]===s[i*this.n+t];if(this.issymmetric){for(t=0;t<n;t++)for(i=0;i<n;i++)this.V[t*this.n+i]=s[t*this.n+i];this.tred2(),this.tql2()}else{for(this.H=new o(n*n),this.ort=new o(n),i=0;i<n;i++)for(t=0;t<n;t++)this.H[t*this.n+i]=s[t*this.n+i];this.orthes(),this.hqr2()}}getV(){return this.V.copy()}getRealEigenvalues(){return this.d}getImagEigenvalues(){return this.e}getD(){const e=this.n,t=this.d,i=this.e,s=new w(e,e),n=s.entries;for(let r=0;r<e;r++){for(let t=0;t<e;t++)n[r*this.n+t]=0;n[r*this.n+r]=t[r],i[r]>0?n[r*this.n+r+1]=i[r]:i[r]<0&&(n[r*this.n+r-1]=i[r])}return s}tred2(){const e=this.n,t=this.V,i=this.d,s=this.e;let n,r,o,A,a,h;for(r=0;r<e;r++)i[r]=t[(e-1)*e+r];for(n=e-1;n>0;n--){let l=0;for(h=0,o=0;o<n;o++)l+=Math.abs(i[o]);if(0===l)for(s[n]=i[n-1],r=0;r<n;r++)i[r]=t[(n-1)*e+r],t[n*this.n+r]=0,t[r*this.n+n]=0;else{for(o=0;o<n;o++)i[o]/=l,h+=i[o]*i[o];for(A=i[n-1],a=Math.sqrt(h),A>0&&(a=-a),s[n]=l*a,h-=A*a,i[n-1]=A-a,r=0;r<n;r++)s[r]=0;for(r=0;r<n;r++){for(A=i[r],t[r*this.n+n]=A,a=s[r]+t[r*e+r]*A,o=r+1;o<=n-1;o++)a+=t[o*e+r]*i[o],s[o]+=t[o*e+r]*A;s[r]=a}for(A=0,r=0;r<n;r++)s[r]/=h,A+=s[r]*i[r];const g=A/(h+h);for(r=0;r<n;r++)s[r]-=g*i[r];for(r=0;r<n;r++){for(A=i[r],a=s[r],o=r;o<=n-1;o++)t[o*e+r]-=A*s[o]+a*i[o];i[r]=t[(n-1)*e+r],t[n*this.n+r]=0}}i[n]=h}for(n=0;n<e-1;n++){if(t[(e-1)*e+n]=t[n*e+n],t[n*e+n]=1,h=i[n+1],0!==h){for(o=0;o<=n;o++)i[o]=t[o*e+(n+1)]/h;for(r=0;r<=n;r++){for(a=0,o=0;o<=n;o++)a+=t[o*e+(n+1)]*t[o*e+r];for(o=0;o<=n;o++)t[o*e+r]-=a*i[o]}}for(o=0;o<=n;o++)t[o*e+(n+1)]=0}for(r=0;r<e;r++)i[r]=t[(e-1)*e+r],t[(e-1)*e+r]=0;t[(e-1)*e+(e-1)]=1,s[0]=0}tql2(){const e=this.n,t=this.V,i=this.d,s=this.e;let n,r,o,A,a,h,l;for(n=1;n<e;n++)s[n-1]=s[n];s[e-1]=0;let g=0,c=0;const d=Math.pow(2,-52);for(A=0;A<e;A++){c=Math.max(c,Math.abs(i[A])+Math.abs(s[A]));let r=A;for(;r<e&&!(Math.abs(s[r])<=d*c);)r++;if(r>A){l=0;do{l+=1,a=i[A],h=(i[A+1]-a)/(2*s[A]);let c=w.hypot(h,1);h<0&&(c=-c),i[A]=s[A]/(h+c),i[A+1]=s[A]*(h+c);const d=i[A+1];let u=a-i[A];for(n=A+2;n<e;n++)i[n]-=u;g+=u,h=i[r];let m=1,p=m,V=m;const M=s[A+1];let B=0,C=0;for(n=r-1;n>=A;n--)for(V=p,p=m,C=B,a=m*s[n],u=m*h,c=w.hypot(h,s[n]),s[n+1]=B*c,B=s[n]/c,m=h/c,h=m*i[n]-B*a,i[n+1]=u+B*(m*a+B*i[n]),o=0;o<e;o++)u=t[o*e+(n+1)],t[o*e+(n+1)]=B*t[o*e+n]+m*u,t[o*e+n]=m*t[o*e+n]-B*u;h=-B*C*V*M*s[A]/d,s[A]=B*h,i[A]=m*h}while(Math.abs(s[A])>d*c)}i[A]=i[A]+g,s[A]=0}for(n=0;n<e-1;n++){for(o=n,h=i[n],r=n+1;r<e;r++)i[r]<h&&(o=r,h=i[r]);if(o!==n)for(i[o]=i[n],i[n]=h,r=0;r<e;r++)h=t[r*this.n+n],t[r*this.n+n]=t[r*e+o],t[r*e+o]=h}}orthes(){const e=this.n,t=this.V,i=this.H,s=this.ort;let n,r,o,A,a;const h=e-1;for(o=1;o<=h-1;o++){let t=0;for(n=o;n<=h;n++)t+=Math.abs(i[n*e+(o-1)]);if(0!==t){let l=0;for(n=h;n>=o;n--)s[n]=i[n*e+(o-1)]/t,l+=s[n]*s[n];for(a=Math.sqrt(l),s[o]>0&&(a=-a),l-=s[o]*a,s[o]=s[o]-a,r=o;r<e;r++){for(A=0,n=h;n>=o;n--)A+=s[n]*i[n*this.n+r];for(A/=l,n=o;n<=h;n++)i[n*this.n+r]-=A*s[n]}for(n=0;n<=h;n++){for(A=0,r=h;r>=o;r--)A+=s[r]*i[n*this.n+r];for(A/=l,r=o;r<=h;r++)i[n*this.n+r]-=A*s[r]}s[o]=t*s[o],i[o*e+(o-1)]=t*a}}for(n=0;n<e;n++)for(r=0;r<e;r++)t[n*this.n+r]=n===r?1:0;for(o=h-1;o>=1;o--)if(0!==i[o*e+(o-1)]){for(n=o+1;n<=h;n++)s[n]=i[n*e+(o-1)];for(r=o;r<=h;r++){for(a=0,n=o;n<=h;n++)a+=s[n]*t[n*this.n+r];for(a=a/s[o]/i[o*e+(o-1)],n=o;n<=h;n++)t[n*this.n+r]+=a*s[n]}}}cdiv(e,t,i,s){let n,r;Math.abs(i)>Math.abs(s)?(n=s/i,r=i+n*s,this.cdivr=(e+n*t)/r,this.cdivi=(t-n*e)/r):(n=i/s,r=s+n*i,this.cdivr=(n*e+t)/r,this.cdivi=(n*t-e)/r)}hqr2(){let e;const t=this.V,i=this.d,s=this.e,n=this.H;let r,o,A,a,h,l;const g=this.n;e=g-1;const c=g-1,d=Math.pow(2,-52);let u,m,p,V,M=0,B=0,w=0,C=0,E=0,Y=0,D=0;for(r=0;r<g;r++)for((r<0||r>c)&&(i[r]=n[r*e+r],s[r]=0),o=Math.max(r-1,0);o<g;o++)D+=Math.abs(n[r*this.n+o]);for(l=0;e>=0;){for(a=e;a>0&&(E=Math.abs(n[(a-1)*e+(a-1)])+Math.abs(n[a*e+a]),0===E&&(E=D),!(Math.abs(n[a*e+(a-1)])<d*E));)a--;if(a===e)n[e*e+e]=n[e*e+e]+M,i[e]=n[e*e+e],s[e]=0,e--,l=0;else if(a===e-1){if(m=n[e*e+e-1]*n[(e-1)*e+e],B=(n[(e-1)*e+(e-1)]-n[e*e+e])/2,w=B*B+m,Y=Math.sqrt(Math.abs(w)),n[e*e+e]=n[e*e+e]+M,n[(e-1)*e+(e-1)]=n[(e-1)*e+(e-1)]+M,p=n[e*e+e],w>=0){for(Y=B>=0?B+Y:B-Y,i[e-1]=p+Y,i[e]=i[e-1],0!==Y&&(i[e]=p-m/Y),s[e-1]=0,s[e]=0,p=n[e*e+e-1],E=Math.abs(p)+Math.abs(Y),B=p/E,w=Y/E,C=Math.sqrt(B*B+w*w),B/=C,w/=C,o=e-1;o<g;o++)Y=n[(e-1)*e+o],n[(e-1)*e+o]=w*Y+B*n[e*e+o],n[e*e+o]=w*n[e*e+o]-B*Y;for(r=0;r<=e;r++)Y=n[r*e+e-1],n[r*e+e-1]=w*Y+B*n[r*e+e],n[r*e+e]=w*n[r*e+e]-B*Y;for(r=0;r<=c;r++)Y=t[r*e+e-1],t[r*e+e-1]=w*Y+B*t[r*e+e],t[r*e+e]=w*t[r*e+e]-B*Y}else i[e-1]=p+B,i[e]=p+B,s[e-1]=Y,s[e]=-Y;e-=2,l=0}else{if(p=n[e*e+e],V=0,m=0,a<e&&(V=n[(e-1)*e+(e-1)],m=n[e*e+e-1]*n[(e-1)*e+e]),10===l){for(M+=p,r=0;r<=e;r++)n[r*e+r]-=p;E=Math.abs(n[e*e+e-1])+Math.abs(n[(e-1)*e+e-2]),p=V=.75*E,m=-.4375*E*E}if(30===l&&(E=(V-p)/2,E=E*E+m,E>0)){for(E=Math.sqrt(E),V<p&&(E=-E),E=p-m/((V-p)/2+E),r=0;r<=e;r++)n[r*e+r]-=E;M+=E,p=V=m=.964}for(l+=1,h=e-2;h>=a&&(Y=n[h*e+h],C=p-Y,E=V-Y,B=(C*E-m)/n[(h+1)*e+h]+n[h*e+h+1],w=n[(h+1)*e+h+1]-Y-C-E,C=n[(h+2)*e+h+1],E=Math.abs(B)+Math.abs(w)+Math.abs(C),B/=E,w/=E,C/=E,h!==a)&&!(Math.abs(n[h*e+(h-1)])*(Math.abs(w)+Math.abs(C))<d*(Math.abs(B)*(Math.abs(n[(h-1)*e+h-1])+Math.abs(Y)+Math.abs(n[(h+1)*e+h+1]))));)h--;for(r=h+2;r<=e;r++)n[r*e+r-2]=0,r>h+2&&(n[r*e+r-3]=0);for(A=h;A<=e-1;A++){const i=A!==e-1;if(A!==h&&(B=n[A*e+A-1],w=n[(A+1)*e+A-1],C=i?n[(A+2)*e+A-1]:0,p=Math.abs(B)+Math.abs(w)+Math.abs(C),0!==p&&(B/=p,w/=p,C/=p)),0===p)break;if(E=Math.sqrt(B*B+w*w+C*C),B<0&&(E=-E),0!==E){for(A!==h?n[A*e+A-1]=-E*p:a!==h&&(n[A*e+A-1]=-n[A*e+A-1]),B+=E,p=B/E,V=w/E,Y=C/E,w/=B,C/=B,o=A;o<g;o++)B=n[A*e+o]+w*n[(A+1)*e+o],i&&(B+=C*n[(A+2)*e+o],n[(A+2)*e+o]=n[(A+2)*e+o]-B*Y),n[A*e+o]=n[A*e+o]-B*p,n[(A+1)*e+o]=n[(A+1)*e+o]-B*V;for(r=0;r<=Math.min(e,A+3);r++)B=p*n[r*e+A]+V*n[r*e+A+1],i&&(B+=Y*n[r*e+A+2],n[r*e+A+2]=n[r*e+A+2]-B*C),n[r*e+A]=n[r*e+A]-B,n[r*e+A+1]=n[r*e+A+1]-B*w;for(r=0;r<=c;r++)B=p*t[r*e+A]+V*t[r*e+A+1],i&&(B+=Y*t[r*e+A+2],t[r*e+A+2]=t[r*e+A+2]-B*C),t[r*e+A]=t[r*e+A]-B,t[r*e+A+1]=t[r*e+A+1]-B*w}}}}if(0!==D){for(e=g-1;e>=0;e--)if(B=i[e],w=s[e],0===w)for(a=e,n[e*e+e]=1,r=e-1;r>=0;r--){for(m=n[r*e+r]-B,C=0,o=a;o<=e;o++)C+=n[r*this.n+o]*n[o*e+e];if(s[r]<0)Y=m,E=C;else if(a=r,0===s[r]?n[r*e+e]=0!==m?-C/m:-C/(d*D):(p=n[r*e+r+1],V=n[(r+1)*e+r],w=(i[r]-B)*(i[r]-B)+s[r]*s[r],u=(p*E-Y*C)/w,n[r*e+e]=u,Math.abs(p)>Math.abs(Y)?n[(r+1)*e+e]=(-C-m*u)/p:n[(r+1)*e+e]=(-E-V*u)/Y),u=Math.abs(n[r*e+e]),d*u*u>1)for(o=r;o<=e;o++)n[o*e+e]=n[o*e+e]/u}else if(w<0)for(a=e-1,Math.abs(n[e*e+e-1])>Math.abs(n[(e-1)*e+e])?(n[(e-1)*e+(e-1)]=w/n[e*e+e-1],n[(e-1)*e+e]=-(n[e*e+e]-B)/n[e*e+e-1]):(this.cdiv(0,-n[(e-1)*e+e],n[(e-1)*e+(e-1)]-B,w),n[(e-1)*e+(e-1)]=this.cdivr,n[(e-1)*e+e]=this.cdivi),n[e*e+e-1]=0,n[e*e+e]=1,r=e-2;r>=0;r--){let t,A,h,l;for(t=0,A=0,o=a;o<=e;o++)t+=n[r*this.n+o]*n[o*e+e-1],A+=n[r*this.n+o]*n[o*e+e];if(m=n[r*e+r]-B,s[r]<0)Y=m,C=t,E=A;else if(a=r,0===s[r]?(this.cdiv(-t,-A,m,w),n[r*e+e-1]=this.cdivr,n[r*e+e]=this.cdivi):(p=n[r*e+r+1],V=n[(r+1)*e+r],h=(i[r]-B)*(i[r]-B)+s[r]*s[r]-w*w,l=2*(i[r]-B)*w,0===h&&0===l&&(h=d*D*(Math.abs(m)+Math.abs(w)+Math.abs(p)+Math.abs(V)+Math.abs(Y))),this.cdiv(p*C-Y*t+w*A,p*E-Y*A-w*t,h,l),n[r*e+e-1]=this.cdivr,n[r*e+e]=this.cdivi,Math.abs(p)>Math.abs(Y)+Math.abs(w)?(n[(r+1)*e+e-1]=(-t-m*n[r*e+e-1]+w*n[r*e+e])/p,n[(r+1)*e+e]=(-A-m*n[r*e+e]-w*n[r*e+e-1])/p):(this.cdiv(-C-V*n[r*e+e-1],-E-V*n[r*e+e],Y,w),n[(r+1)*e+e-1]=this.cdivr,n[(r+1)*e+e]=this.cdivi)),u=Math.max(Math.abs(n[r*e+e-1]),Math.abs(n[r*e+e])),d*u*u>1)for(o=r;o<=e;o++)n[o*e+e-1]=n[o*e+e-1]/u,n[o*e+e]=n[o*e+e]/u}for(r=0;r<g;r++)if(r<0||r>c)for(o=r;o<g;o++)t[r*this.n+o]=n[r*this.n+o];for(o=g-1;o>=0;o--)for(r=0;r<=c;r++){for(Y=0,A=0;A<=Math.min(o,c);A++)Y+=t[r*e+A]*n[A*e+o];t[r*this.n+o]=Y}}}}r.Z.register("EigenvalueDecomposition",A);const a=window.Float64Array||Array;class h{constructor(e){let t,i,s;this.matrix=e,this.LU=e.getArrayCopy();const n=this.LU;this.m=e.getRowDimension();const r=this.m;this.n=e.getColumnDimension();const o=this.n;for(this.piv=new Uint32Array(r),t=0;t<r;t++)this.piv[t]=t;this.pivsign=1;const A=new a(r);for(i=0;i<o;i++){for(t=0;t<r;t++)A[t]=n[e.index(t,i)];for(t=0;t<r;t++){const r=Math.min(t,i);let o=0;for(s=0;s<r;s++){o+=n[e.index(t,s)]*A[s]}A[t]-=o,n[e.index(t,i)]=A[t]}let a=i;for(t=i+1;t<r;t++)Math.abs(A[t])>Math.abs(A[a])&&(a=t);if(a!==i){for(s=0;s<o;s++){const t=e.index(a,s),r=e.index(i,s),o=n[t];n[t]=n[r],n[r]=o}s=this.piv[a],this.piv[a]=this.piv[i],this.piv[i]=s,this.pivsign=-this.pivsign}if(i<r&&0!==n[this.matrix.index(i,i)])for(t=i+1;t<r;t++)n[e.index(t,i)]/=n[e.index(i,i)]}}isNonsingular(){for(let e=0;e<this.n;e++){const t=this.matrix.index(e,e);if(0===this.LU[t])return!1}return!0}getL(){const e=new w(this.m,this.n);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++)e.entries[e.index(t,i)]=t>i?this.LU[this.matrix.index(t,i)]:t===i?1:0;return e}getU(){const e=new w(this.n,this.n);for(let t=0;t<this.n;t++)for(let i=0;i<this.n;i++)e.entries[e.index(t,i)]=t<=i?this.LU[this.matrix.index(t,i)]:0;return e}getPivot(){const e=new Uint32Array(this.m);for(let t=0;t<this.m;t++)e[t]=this.piv[t];return e}getDoublePivot(){const e=new a(this.m);for(let t=0;t<this.m;t++)e[t]=this.piv[t];return e}det(){if(this.m!==this.n)throw new Error("Matrix must be square.");let e=this.pivsign;for(let t=0;t<this.n;t++)e*=this.LU[this.matrix.index(t,t)];return e}solve(e){let t,i,s;if(e.getRowDimension()!==this.m)throw new Error("Matrix row dimensions must agree.");if(!this.isNonsingular())throw new Error("Matrix is singular.");const n=e.getColumnDimension(),r=e.getArrayRowMatrix(this.piv,0,n-1);for(s=0;s<this.n;s++)for(t=s+1;t<this.n;t++)for(i=0;i<n;i++)r.entries[r.index(t,i)]-=r.entries[r.index(s,i)]*this.LU[this.matrix.index(t,s)];for(s=this.n-1;s>=0;s--){for(i=0;i<n;i++)r.entries[r.index(s,i)]/=this.LU[this.matrix.index(s,s)];for(t=0;t<s;t++)for(i=0;i<n;i++)r.entries[r.index(t,i)]-=r.entries[r.index(s,i)]*this.LU[this.matrix.index(t,s)]}return r}}r.Z.register("LUDecomposition",h);const l=h,g=window.Float64Array||Array;class c{constructor(e){this.matrix=e,this.QR=e.getArrayCopy();const t=this.QR;this.m=e.getRowDimension();const i=this.m;this.n=e.getColumnDimension();const s=this.n;let n,r,o;for(this.Rdiag=new g(s),o=0;o<s;o++){let e=0;for(n=o;n<i;n++)e=w.hypot(e,t[this.matrix.index(n,o)]);if(0!==e){for(t[this.matrix.index(o,o)]<0&&(e=-e),n=o;n<i;n++)t[this.matrix.index(n,o)]/=e;for(t[this.matrix.index(o,o)]+=1,r=o+1;r<s;r++){let e=0;for(n=o;n<i;n++)e+=t[this.matrix.index(n,o)]*t[this.matrix.index(n,r)];for(e=-e/t[this.matrix.index(o,o)],n=o;n<i;n++)t[this.matrix.index(n,r)]+=e*t[this.matrix.index(n,o)]}}this.Rdiag[o]=-e}}isFullRank(){for(let e=0;e<this.n;e++)if(0===this.Rdiag[e])return!1;return!0}getH(){const e=new w(this.m,this.n);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++)e.entries[e.index(t,i)]=t>=i?this.QR[this.matrix.index(t,i)]:0;return e}getR(){const e=new w(this.n,this.n);for(let t=0;t<this.n;t++)for(let i=0;i<this.n;i++)e.entries[e.index(t,i)]=t<i?this.QR[this.matrix.index(t,i)]:t===i?this.Rdiag[t]:0;return e}getQ(){let e,t,i;const s=new w(this.m,this.n);for(i=this.n-1;i>=0;i--){for(e=0;e<this.m;e++)s.entries[s.index(e,i)]=0;for(s.entries[s.index(i,i)]=1,t=i;t<this.n;t++)if(0!==this.QR[this.matrix.index(i,i)]){let n=0;for(e=i;e<this.m;e++)n+=this.QR[this.matrix.index(e,i)]*s.entries[s.index(e,t)];for(n=-n/this.QR[this.matrix.index(i,i)],e=i;e<this.m;e++)s.entries[s.index(e,t)]+=n*this.QR[this.matrix.index(e,i)]}}return s}solve(e){if(e.getRowDimension()!==this.m)throw new Error("Matrix row dimensions must agree.");if(!this.isFullRank())throw new Error("Matrix is rank deficient.");let t,i,s;const n=e.getColumnDimension(),r=e.getArrayCopy();for(s=0;s<this.n;s++)for(i=0;i<n;i++){let n=0;for(t=s;t<this.m;t++)n+=this.QR[this.matrix.index(t,s)]*r[e.index(t,i)];for(n=-n/this.QR[this.matrix.index(s,s)],t=s;t<this.m;t++)r[e.index(t,i)]+=n*this.QR[this.matrix.index(t,s)]}for(s=this.n-1;s>=0;s--){for(i=0;i<n;i++)r[e.index(s,i)]/=this.Rdiag[s];for(t=0;t<s;t++)for(i=0;i<n;i++)r[e.index(t,i)]-=r[e.index(s,i)]*this.QR[this.matrix.index(t,s)]}return new w(this.n,n,r,!0).getMatrix(0,this.n-1,0,n-1)}}r.Z.register("QRDecomposition",c);const d=c;var u=i(1063),m=i(668),p=i(8002),V=i(1319);const M=window.Float64Array||Array;class B{constructor(e,t,i,s){this.m=e,this.n=t;const r=e*t;let o;if(this.size=r,s)this.entries=i;else if(i||(i=0),this.entries=new M(r),n(i))for(o=0;o<r;o++)this.entries[o]=i[o];else for(o=0;o<r;o++)this.entries[o]=i}copy(){const e=new B(this.m,this.n);for(let t=0;t<this.size;t++)e.entries[t]=this.entries[t];return e}getArray(){return this.entries}getArrayCopy(){return new M(this.entries)}getRowDimension(){return this.m}getColumnDimension(){return this.n}index(e,t){return e*this.n+t}get(e,t){return this.entries[this.index(e,t)]}set(e,t,i){this.entries[this.index(e,t)]=i}getMatrix(e,t,i,s){const n=new B(t-e+1,s-i+1);for(let r=e;r<=t;r++)for(let t=i;t<=s;t++)n.entries[n.index(r-e,t-i)]=this.entries[this.index(r,t)];return n}getArrayRowMatrix(e,t,i){const s=new B(e.length,i-t+1);for(let n=0;n<e.length;n++)for(let r=t;r<=i;r++)s.entries[s.index(n,r-t)]=this.entries[this.index(e[n],r)];return s}transpose(e){e=e||new B(this.n,this.m);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++)e.entries[e.index(i,t)]=this.entries[this.index(t,i)];return e}norm1(){let e=0;for(let t=0;t<this.n;t++){let i=0;for(let e=0;e<this.m;e++)i+=Math.abs(this.entries[this.index(e,t)]);e=Math.max(e,i)}return e}norm2(){return new u.Z(this).norm2()}normInf(){let e=0;for(let t=0;t<this.m;t++){let i=0;for(let e=0;e<this.n;e++)i+=Math.abs(this.entries[this.index(t,e)]);e=Math.max(e,i)}return e}normF(){let e=0;for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++)e=B.hypot(e,this.entries[this.index(t,i)]);return e}uminus(){const e=new B(this.m,this.n);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++)e.entries[e.index(t,i)]=-this.entries[this.index(t,i)];return e}plus(e){this.checkMatrixDimensions(e);const t=new B(this.m,this.n);for(let i=0;i<this.m;i++)for(let s=0;s<this.n;s++){const n=t.index(i,s);t.entries[n]=this.entries[n]+e.entries[n]}return t}plusEquals(e){this.checkMatrixDimensions(e);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++){const s=this.index(t,i);this.entries[s]=this.entries[s]+e.entries[s]}return this}blendEquals(e,t){this.checkMatrixDimensions(e);for(let i=0;i<this.m;i++)for(let s=0;s<this.n;s++){const n=this.index(i,s),r=this.entries[n],o=e.entries[n];this.entries[n]=r+(o-r)*t}return this}minus(e){this.checkMatrixDimensions(e);const t=new B(this.m,this.n);for(let i=0;i<this.m;i++)for(let s=0;s<this.n;s++){const n=this.index(i,s);t.entries[n]=this.entries[n]-e.entries[n]}return t}minusEquals(e){this.checkMatrixDimensions(e);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++){const s=this.index(t,i);this.entries[s]=this.entries[s]-e.entries[s]}return this}arrayTimes(e){this.checkMatrixDimensions(e);const t=new B(this.m,this.n);for(let i=0;i<this.m;i++)for(let s=0;s<this.n;s++){const n=t.index(i,s);t.entries[n]=this.entries[n]*e.entries[n]}return t}arrayTimesEquals(e){this.checkMatrixDimensions(e);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++){const s=this.index(t,i);this.entries[s]=this.entries[s]*e.entries[s]}return this}arrayRightDivide(e){this.checkMatrixDimensions(e);const t=new B(this.m,this.n);for(let i=0;i<this.m;i++)for(let s=0;s<this.n;s++){const n=this.index(i,s);t.entries[n]=this.entries[n]/e.entries[n]}return t}arrayRightDivideEquals(e){this.checkMatrixDimensions(e);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++){const s=this.index(t,i);this.entries[s]=this.entries[s]/e.entries[s]}return this}arrayLeftDivide(e){this.checkMatrixDimensions(e);const t=new B(this.m,this.n);for(let i=0;i<this.m;i++)for(let s=0;s<this.n;s++){const n=this.index(i,s);t.entries[n]=e.entries[n]/this.entries[n]}return t}arrayLeftDivideEquals(e){this.checkMatrixDimensions(e);for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++){const s=this.index(t,i);this.entries[s]=e.entries[s]/this.entries[s]}return this}times(e){let t,i,s,n,r,o;if(e.isMatrix){if(o=e,o.m!==this.n)throw new Error("Matrix inner dimensions must agree.");t=new B(this.m,o.n);const A=new M(this.n);for(s=0;s<o.n;s++){for(n=0;n<this.n;n++)A[n]=o.entries[o.index(n,s)];for(i=0;i<this.m;i++){for(r=0,n=0;n<this.n;n++)r+=this.entries[this.index(i,n)]*A[n];t.entries[t.index(i,s)]=r}}return t}for(r=e,t=new B(this.m,this.n),i=0;i<this.m;i++)for(s=0;s<this.n;s++)t.entries[t.index(i,s)]=r*this.entries[this.index(i,s)];return t}timesEquals(e){for(let t=0;t<this.m;t++)for(let i=0;i<this.n;i++){const s=this.index(t,i);this.entries[s]=e*this.entries[s]}return this}solve(e){return this.m===this.n?new l(this).solve(e):new d(this).solve(e)}solveTranspose(e){return this.transpose().solve(e.transpose())}inverse(){return this.solve(B.identity(this.m,this.m))}det(){return new l(this).det()}rank(){return new u.Z(this).rank()}cond(){return new u.Z(this).cond()}trace(){let e=0;for(let t=0;t<Math.min(this.m,this.n);t++)e+=this.entries[this.index(t,t)];return e}checkMatrixDimensions(e){if(e.m!==this.m||e.n!==this.n)throw new Error("Matrix dimensions must agree.")}toString(){let e="";e+=`dim: ${this.getRowDimension()}x${this.getColumnDimension()}\n`;for(let t=0;t<this.getRowDimension();t++){for(let i=0;i<this.getColumnDimension();i++)e+=this.get(t,i)+" ";e+="\n"}return e}extractVector2(e){return new m.Z(this.get(0,e),this.get(1,e))}extractVector3(e){return new p.Z(this.get(0,e),this.get(1,e),this.get(2,e))}extractVector4(e){return new V.Z(this.get(0,e),this.get(1,e),this.get(2,e),this.get(3,e))}setVectors3(e){const t=e.length;for(let i=0;i<t;i++){const s=e[i];this.entries[i]=s.x,this.entries[i+t]=s.y,this.entries[i+2*t]=s.z}return this}static hypot(e,t){let i;return Math.abs(e)>Math.abs(t)?(i=t/e,i=Math.abs(e)*Math.sqrt(1+i*i)):0!==t?(i=e/t,i=Math.abs(t)*Math.sqrt(1+i*i)):i=0,i}static identity(e,t){const i=new B(e,t);for(let s=0;s<e;s++)for(let e=0;e<t;e++)i.entries[i.index(s,e)]=s===e?1:0;return i}static diagonalMatrix(e){const t=e.length,i=new B(t,t);for(let s=0;s<t;s++)i.entries[i.index(s,s)]=e[s];return i}static rowVector2(e){return new B(1,2,[e.x,e.y])}static rowVector3(e){return new B(1,3,[e.x,e.y,e.z])}static rowVector4(e){return new B(1,4,[e.x,e.y,e.z,e.w])}static rowVector(e){if(e.isVector2)return B.rowVector2(e);if(e.isVector3)return B.rowVector3(e);if(e.isVector4)return B.rowVector4(e);throw new Error("undetected type of vector: "+e.toString())}static columnVector2(e){return new B(2,1,[e.x,e.y])}static columnVector3(e){return new B(3,1,[e.x,e.y,e.z])}static columnVector4(e){return new B(4,1,[e.x,e.y,e.z,e.w])}static columnVector(e){if(e.isVector2)return B.columnVector2(e);if(e.isVector3)return B.columnVector3(e);if(e.isVector4)return B.columnVector4(e);throw new Error("undetected type of vector: "+e.toString())}static fromVectors2(e){const t=e.length,i=new M(2*t);for(let s=0;s<t;s++){const n=e[s];i[s]=n.x,i[s+t]=n.y}return new B(2,t,i,!0)}static fromVectors3(e){const t=e.length,i=new M(3*t);for(let s=0;s<t;s++){const n=e[s];i[s]=n.x,i[s+t]=n.y,i[s+2*t]=n.z}return new B(3,t,i,!0)}static fromVectors4(e){const t=e.length,i=new M(4*t);for(let s=0;s<t;s++){const n=e[s];i[s]=n.x,i[s+t]=n.y,i[s+2*t]=n.z,i[s+3*t]=n.w}return new B(4,t,i,!0)}}B.prototype.isMatrix=!0,r.Z.register("Matrix",B);const w=B},9972:(e,t,i)=>{"use strict";var s,n,r;i.d(t,{h:()=>E,Z:()=>Y,m3:()=>y});var o=i(3409),A=i(0),a=i(3600),h=i(8585),l=i(7464),g=i(2956),c=i(4676),d=i(8002),u=i(1319);const m=window.Float32Array||Array;class p{constructor(e,t,i,s,n,r,o,A,a,h,l,g,c,d,u,p,M){this.entries=new m(16),this.type=V.OTHER,this.rowMajor(void 0!==e?e:1,void 0!==t?t:0,void 0!==i?i:0,void 0!==s?s:0,void 0!==n?n:0,void 0!==r?r:1,void 0!==o?o:0,void 0!==A?A:0,void 0!==a?a:0,void 0!==h?h:0,void 0!==l?l:1,void 0!==g?g:0,void 0!==c?c:0,void 0!==d?d:0,void 0!==u?u:0,void 0!==p?p:1,M)}rowMajor(e,t,i,s,n,r,o,A,a,h,l,g,c,d,u,m,p){return this.entries[0]=e,this.entries[1]=n,this.entries[2]=a,this.entries[3]=c,this.entries[4]=t,this.entries[5]=r,this.entries[6]=h,this.entries[7]=d,this.entries[8]=i,this.entries[9]=o,this.entries[10]=l,this.entries[11]=u,this.entries[12]=s,this.entries[13]=A,this.entries[14]=g,this.entries[15]=m,this.type=void 0===p?0===c&&0===d&&0===u&&1===m?V.AFFINE:V.OTHER:p,this}columnMajor(e,t,i,s,n,r,o,A,a,h,l,g,c,d,u,m,p){return this.rowMajor(e,n,a,c,t,r,h,d,i,o,l,u,s,A,g,m,p)}set(e){return this.rowMajor(e.m00(),e.m01(),e.m02(),e.m03(),e.m10(),e.m11(),e.m12(),e.m13(),e.m20(),e.m21(),e.m22(),e.m23(),e.m30(),e.m31(),e.m32(),e.m33(),e.type)}m00(){return this.entries[0]}m01(){return this.entries[4]}m02(){return this.entries[8]}m03(){return this.entries[12]}m10(){return this.entries[1]}m11(){return this.entries[5]}m12(){return this.entries[9]}m13(){return this.entries[13]}m20(){return this.entries[2]}m21(){return this.entries[6]}m22(){return this.entries[10]}m23(){return this.entries[14]}m30(){return this.entries[3]}m31(){return this.entries[7]}m32(){return this.entries[11]}m33(){return this.entries[15]}isFinite(){return isFinite(this.m00())&&isFinite(this.m01())&&isFinite(this.m02())&&isFinite(this.m03())&&isFinite(this.m10())&&isFinite(this.m11())&&isFinite(this.m12())&&isFinite(this.m13())&&isFinite(this.m20())&&isFinite(this.m21())&&isFinite(this.m22())&&isFinite(this.m23())&&isFinite(this.m30())&&isFinite(this.m31())&&isFinite(this.m32())&&isFinite(this.m33())}getTranslation(){return new d.Z(this.m03(),this.m13(),this.m23())}get translation(){return this.getTranslation()}getScaleVector(){const e=this.m00()+this.m03(),t=this.m10()+this.m13(),i=this.m20()+this.m23(),s=this.m30()+this.m33(),n=this.m01()+this.m03(),r=this.m11()+this.m13(),o=this.m21()+this.m23(),A=this.m31()+this.m33(),a=this.m02()+this.m03(),h=this.m12()+this.m13(),l=this.m22()+this.m23(),g=this.m32()+this.m33();return new d.Z(Math.sqrt(e*e+t*t+i*i+s*s),Math.sqrt(n*n+r*r+o*o+A*A),Math.sqrt(a*a+h*h+l*l+g*g))}get scaleVector(){return this.getScaleVector()}getCSSTransform(){return`matrix3d(${this.entries[0].toFixed(20)},${this.entries[1].toFixed(20)},${this.entries[2].toFixed(20)},${this.entries[3].toFixed(20)},${this.entries[4].toFixed(20)},${this.entries[5].toFixed(20)},${this.entries[6].toFixed(20)},${this.entries[7].toFixed(20)},${this.entries[8].toFixed(20)},${this.entries[9].toFixed(20)},${this.entries[10].toFixed(20)},${this.entries[11].toFixed(20)},${this.entries[12].toFixed(20)},${this.entries[13].toFixed(20)},${this.entries[14].toFixed(20)},${this.entries[15].toFixed(20)})`}get cssTransform(){return this.getCSSTransform()}equals(e){return this.m00()===e.m00()&&this.m01()===e.m01()&&this.m02()===e.m02()&&this.m03()===e.m03()&&this.m10()===e.m10()&&this.m11()===e.m11()&&this.m12()===e.m12()&&this.m13()===e.m13()&&this.m20()===e.m20()&&this.m21()===e.m21()&&this.m22()===e.m22()&&this.m23()===e.m23()&&this.m30()===e.m30()&&this.m31()===e.m31()&&this.m32()===e.m32()&&this.m33()===e.m33()}equalsEpsilon(e,t){return Math.abs(this.m00()-e.m00())<t&&Math.abs(this.m01()-e.m01())<t&&Math.abs(this.m02()-e.m02())<t&&Math.abs(this.m03()-e.m03())<t&&Math.abs(this.m10()-e.m10())<t&&Math.abs(this.m11()-e.m11())<t&&Math.abs(this.m12()-e.m12())<t&&Math.abs(this.m13()-e.m13())<t&&Math.abs(this.m20()-e.m20())<t&&Math.abs(this.m21()-e.m21())<t&&Math.abs(this.m22()-e.m22())<t&&Math.abs(this.m23()-e.m23())<t&&Math.abs(this.m30()-e.m30())<t&&Math.abs(this.m31()-e.m31())<t&&Math.abs(this.m32()-e.m32())<t&&Math.abs(this.m33()-e.m33())<t}copy(){return new p(this.m00(),this.m01(),this.m02(),this.m03(),this.m10(),this.m11(),this.m12(),this.m13(),this.m20(),this.m21(),this.m22(),this.m23(),this.m30(),this.m31(),this.m32(),this.m33(),this.type)}plus(e){return new p(this.m00()+e.m00(),this.m01()+e.m01(),this.m02()+e.m02(),this.m03()+e.m03(),this.m10()+e.m10(),this.m11()+e.m11(),this.m12()+e.m12(),this.m13()+e.m13(),this.m20()+e.m20(),this.m21()+e.m21(),this.m22()+e.m22(),this.m23()+e.m23(),this.m30()+e.m30(),this.m31()+e.m31(),this.m32()+e.m32(),this.m33()+e.m33())}minus(e){return new p(this.m00()-e.m00(),this.m01()-e.m01(),this.m02()-e.m02(),this.m03()-e.m03(),this.m10()-e.m10(),this.m11()-e.m11(),this.m12()-e.m12(),this.m13()-e.m13(),this.m20()-e.m20(),this.m21()-e.m21(),this.m22()-e.m22(),this.m23()-e.m23(),this.m30()-e.m30(),this.m31()-e.m31(),this.m32()-e.m32(),this.m33()-e.m33())}transposed(){return new p(this.m00(),this.m10(),this.m20(),this.m30(),this.m01(),this.m11(),this.m21(),this.m31(),this.m02(),this.m12(),this.m22(),this.m32(),this.m03(),this.m13(),this.m23(),this.m33())}negated(){return new p(-this.m00(),-this.m01(),-this.m02(),-this.m03(),-this.m10(),-this.m11(),-this.m12(),-this.m13(),-this.m20(),-this.m21(),-this.m22(),-this.m23(),-this.m30(),-this.m31(),-this.m32(),-this.m33())}inverted(){let e;switch(this.type){case V.IDENTITY:return this;case V.TRANSLATION_3D:return new p(1,0,0,-this.m03(),0,1,0,-this.m13(),0,0,1,-this.m23(),0,0,0,1,V.TRANSLATION_3D);case V.SCALING:return new p(1/this.m00(),0,0,0,0,1/this.m11(),0,0,0,0,1/this.m22(),0,0,0,0,1/this.m33(),V.SCALING);case V.AFFINE:case V.OTHER:if(e=this.getDeterminant(),0!==e)return new p((-this.m31()*this.m22()*this.m13()+this.m21()*this.m32()*this.m13()+this.m31()*this.m12()*this.m23()-this.m11()*this.m32()*this.m23()-this.m21()*this.m12()*this.m33()+this.m11()*this.m22()*this.m33())/e,(this.m31()*this.m22()*this.m03()-this.m21()*this.m32()*this.m03()-this.m31()*this.m02()*this.m23()+this.m01()*this.m32()*this.m23()+this.m21()*this.m02()*this.m33()-this.m01()*this.m22()*this.m33())/e,(-this.m31()*this.m12()*this.m03()+this.m11()*this.m32()*this.m03()+this.m31()*this.m02()*this.m13()-this.m01()*this.m32()*this.m13()-this.m11()*this.m02()*this.m33()+this.m01()*this.m12()*this.m33())/e,(this.m21()*this.m12()*this.m03()-this.m11()*this.m22()*this.m03()-this.m21()*this.m02()*this.m13()+this.m01()*this.m22()*this.m13()+this.m11()*this.m02()*this.m23()-this.m01()*this.m12()*this.m23())/e,(this.m30()*this.m22()*this.m13()-this.m20()*this.m32()*this.m13()-this.m30()*this.m12()*this.m23()+this.m10()*this.m32()*this.m23()+this.m20()*this.m12()*this.m33()-this.m10()*this.m22()*this.m33())/e,(-this.m30()*this.m22()*this.m03()+this.m20()*this.m32()*this.m03()+this.m30()*this.m02()*this.m23()-this.m00()*this.m32()*this.m23()-this.m20()*this.m02()*this.m33()+this.m00()*this.m22()*this.m33())/e,(this.m30()*this.m12()*this.m03()-this.m10()*this.m32()*this.m03()-this.m30()*this.m02()*this.m13()+this.m00()*this.m32()*this.m13()+this.m10()*this.m02()*this.m33()-this.m00()*this.m12()*this.m33())/e,(-this.m20()*this.m12()*this.m03()+this.m10()*this.m22()*this.m03()+this.m20()*this.m02()*this.m13()-this.m00()*this.m22()*this.m13()-this.m10()*this.m02()*this.m23()+this.m00()*this.m12()*this.m23())/e,(-this.m30()*this.m21()*this.m13()+this.m20()*this.m31()*this.m13()+this.m30()*this.m11()*this.m23()-this.m10()*this.m31()*this.m23()-this.m20()*this.m11()*this.m33()+this.m10()*this.m21()*this.m33())/e,(this.m30()*this.m21()*this.m03()-this.m20()*this.m31()*this.m03()-this.m30()*this.m01()*this.m23()+this.m00()*this.m31()*this.m23()+this.m20()*this.m01()*this.m33()-this.m00()*this.m21()*this.m33())/e,(-this.m30()*this.m11()*this.m03()+this.m10()*this.m31()*this.m03()+this.m30()*this.m01()*this.m13()-this.m00()*this.m31()*this.m13()-this.m10()*this.m01()*this.m33()+this.m00()*this.m11()*this.m33())/e,(this.m20()*this.m11()*this.m03()-this.m10()*this.m21()*this.m03()-this.m20()*this.m01()*this.m13()+this.m00()*this.m21()*this.m13()+this.m10()*this.m01()*this.m23()-this.m00()*this.m11()*this.m23())/e,(this.m30()*this.m21()*this.m12()-this.m20()*this.m31()*this.m12()-this.m30()*this.m11()*this.m22()+this.m10()*this.m31()*this.m22()+this.m20()*this.m11()*this.m32()-this.m10()*this.m21()*this.m32())/e,(-this.m30()*this.m21()*this.m02()+this.m20()*this.m31()*this.m02()+this.m30()*this.m01()*this.m22()-this.m00()*this.m31()*this.m22()-this.m20()*this.m01()*this.m32()+this.m00()*this.m21()*this.m32())/e,(this.m30()*this.m11()*this.m02()-this.m10()*this.m31()*this.m02()-this.m30()*this.m01()*this.m12()+this.m00()*this.m31()*this.m12()+this.m10()*this.m01()*this.m32()-this.m00()*this.m11()*this.m32())/e,(-this.m20()*this.m11()*this.m02()+this.m10()*this.m21()*this.m02()+this.m20()*this.m01()*this.m12()-this.m00()*this.m21()*this.m12()-this.m10()*this.m01()*this.m22()+this.m00()*this.m11()*this.m22())/e);throw new Error("Matrix could not be inverted, determinant === 0");default:throw new Error("Matrix4.inverted with unknown type: "+this.type)}}timesMatrix(e){if(this.type===V.IDENTITY||e.type===V.IDENTITY)return this.type===V.IDENTITY?e:this;if(this.type===e.type){if(this.type===V.TRANSLATION_3D)return new p(1,0,0,this.m03()+e.m02(),0,1,0,this.m13()+e.m12(),0,0,1,this.m23()+e.m23(),0,0,0,1,V.TRANSLATION_3D);if(this.type===V.SCALING)return new p(this.m00()*e.m00(),0,0,0,0,this.m11()*e.m11(),0,0,0,0,this.m22()*e.m22(),0,0,0,0,1,V.SCALING)}return this.type!==V.OTHER&&e.type!==V.OTHER?new p(this.m00()*e.m00()+this.m01()*e.m10()+this.m02()*e.m20(),this.m00()*e.m01()+this.m01()*e.m11()+this.m02()*e.m21(),this.m00()*e.m02()+this.m01()*e.m12()+this.m02()*e.m22(),this.m00()*e.m03()+this.m01()*e.m13()+this.m02()*e.m23()+this.m03(),this.m10()*e.m00()+this.m11()*e.m10()+this.m12()*e.m20(),this.m10()*e.m01()+this.m11()*e.m11()+this.m12()*e.m21(),this.m10()*e.m02()+this.m11()*e.m12()+this.m12()*e.m22(),this.m10()*e.m03()+this.m11()*e.m13()+this.m12()*e.m23()+this.m13(),this.m20()*e.m00()+this.m21()*e.m10()+this.m22()*e.m20(),this.m20()*e.m01()+this.m21()*e.m11()+this.m22()*e.m21(),this.m20()*e.m02()+this.m21()*e.m12()+this.m22()*e.m22(),this.m20()*e.m03()+this.m21()*e.m13()+this.m22()*e.m23()+this.m23(),0,0,0,1,V.AFFINE):new p(this.m00()*e.m00()+this.m01()*e.m10()+this.m02()*e.m20()+this.m03()*e.m30(),this.m00()*e.m01()+this.m01()*e.m11()+this.m02()*e.m21()+this.m03()*e.m31(),this.m00()*e.m02()+this.m01()*e.m12()+this.m02()*e.m22()+this.m03()*e.m32(),this.m00()*e.m03()+this.m01()*e.m13()+this.m02()*e.m23()+this.m03()*e.m33(),this.m10()*e.m00()+this.m11()*e.m10()+this.m12()*e.m20()+this.m13()*e.m30(),this.m10()*e.m01()+this.m11()*e.m11()+this.m12()*e.m21()+this.m13()*e.m31(),this.m10()*e.m02()+this.m11()*e.m12()+this.m12()*e.m22()+this.m13()*e.m32(),this.m10()*e.m03()+this.m11()*e.m13()+this.m12()*e.m23()+this.m13()*e.m33(),this.m20()*e.m00()+this.m21()*e.m10()+this.m22()*e.m20()+this.m23()*e.m30(),this.m20()*e.m01()+this.m21()*e.m11()+this.m22()*e.m21()+this.m23()*e.m31(),this.m20()*e.m02()+this.m21()*e.m12()+this.m22()*e.m22()+this.m23()*e.m32(),this.m20()*e.m03()+this.m21()*e.m13()+this.m22()*e.m23()+this.m23()*e.m33(),this.m30()*e.m00()+this.m31()*e.m10()+this.m32()*e.m20()+this.m33()*e.m30(),this.m30()*e.m01()+this.m31()*e.m11()+this.m32()*e.m21()+this.m33()*e.m31(),this.m30()*e.m02()+this.m31()*e.m12()+this.m32()*e.m22()+this.m33()*e.m32(),this.m30()*e.m03()+this.m31()*e.m13()+this.m32()*e.m23()+this.m33()*e.m33())}timesVector4(e){const t=this.m00()*e.x+this.m01()*e.y+this.m02()*e.z+this.m03()*e.w,i=this.m10()*e.x+this.m11()*e.y+this.m12()*e.z+this.m13()*e.w,s=this.m20()*e.x+this.m21()*e.y+this.m22()*e.z+this.m23()*e.w,n=this.m30()*e.x+this.m31()*e.y+this.m32()*e.z+this.m33()*e.w;return new u.Z(t,i,s,n)}timesVector3(e){return this.timesVector4(e.toVector4()).toVector3()}timesTransposeVector4(e){const t=this.m00()*e.x+this.m10()*e.y+this.m20()*e.z+this.m30()*e.w,i=this.m01()*e.x+this.m11()*e.y+this.m21()*e.z+this.m31()*e.w,s=this.m02()*e.x+this.m12()*e.y+this.m22()*e.z+this.m32()*e.w,n=this.m03()*e.x+this.m13()*e.y+this.m23()*e.z+this.m33()*e.w;return new u.Z(t,i,s,n)}timesTransposeVector3(e){return this.timesTransposeVector4(e.toVector4()).toVector3()}timesRelativeVector3(e){const t=this.m00()*e.x+this.m10()*e.y+this.m20()*e.z,i=this.m01()*e.y+this.m11()*e.y+this.m21()*e.z,s=this.m02()*e.z+this.m12()*e.y+this.m22()*e.z;return new d.Z(t,i,s)}getDeterminant(){return this.m03()*this.m12()*this.m21()*this.m30()-this.m02()*this.m13()*this.m21()*this.m30()-this.m03()*this.m11()*this.m22()*this.m30()+this.m01()*this.m13()*this.m22()*this.m30()+this.m02()*this.m11()*this.m23()*this.m30()-this.m01()*this.m12()*this.m23()*this.m30()-this.m03()*this.m12()*this.m20()*this.m31()+this.m02()*this.m13()*this.m20()*this.m31()+this.m03()*this.m10()*this.m22()*this.m31()-this.m00()*this.m13()*this.m22()*this.m31()-this.m02()*this.m10()*this.m23()*this.m31()+this.m00()*this.m12()*this.m23()*this.m31()+this.m03()*this.m11()*this.m20()*this.m32()-this.m01()*this.m13()*this.m20()*this.m32()-this.m03()*this.m10()*this.m21()*this.m32()+this.m00()*this.m13()*this.m21()*this.m32()+this.m01()*this.m10()*this.m23()*this.m32()-this.m00()*this.m11()*this.m23()*this.m32()-this.m02()*this.m11()*this.m20()*this.m33()+this.m01()*this.m12()*this.m20()*this.m33()+this.m02()*this.m10()*this.m21()*this.m33()-this.m00()*this.m12()*this.m21()*this.m33()-this.m01()*this.m10()*this.m22()*this.m33()+this.m00()*this.m11()*this.m22()*this.m33()}get determinant(){return this.getDeterminant()}toString(){return`${this.m00()} ${this.m01()} ${this.m02()} ${this.m03()}\n${this.m10()} ${this.m11()} ${this.m12()} ${this.m13()}\n${this.m20()} ${this.m21()} ${this.m22()} ${this.m23()}\n${this.m30()} ${this.m31()} ${this.m32()} ${this.m33()}`}makeImmutable(){return this}copyToArray(e){return e[0]=this.m00(),e[1]=this.m10(),e[2]=this.m20(),e[3]=this.m30(),e[4]=this.m01(),e[5]=this.m11(),e[6]=this.m21(),e[7]=this.m31(),e[8]=this.m02(),e[9]=this.m12(),e[10]=this.m22(),e[11]=this.m32(),e[12]=this.m03(),e[13]=this.m13(),e[14]=this.m23(),e[15]=this.m33(),e}static identity(){return new p(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,V.IDENTITY)}static translation(e,t,i){return new p(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1,V.TRANSLATION_3D)}static translationFromVector(e){return p.translation(e.x,e.y,e.z)}static scaling(e,t,i){return new p(e,0,0,0,0,t=void 0===t?e:t,0,0,0,0,i=void 0===i?e:i,0,0,0,0,1,V.SCALING)}static rotationAxisAngle(e,t){const i=Math.cos(t),s=Math.sin(t),n=1-i;return new p(e.x*e.x*n+i,e.x*e.y*n-e.z*s,e.x*e.z*n+e.y*s,0,e.y*e.x*n+e.z*s,e.y*e.y*n+i,e.y*e.z*n-e.x*s,0,e.z*e.x*n-e.y*s,e.z*e.y*n+e.x*s,e.z*e.z*n+i,0,0,0,0,1,V.AFFINE)}static rotationX(e){const t=Math.cos(e),i=Math.sin(e);return new p(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1,V.AFFINE)}static rotationY(e){const t=Math.cos(e),i=Math.sin(e);return new p(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1,V.AFFINE)}static rotationZ(e){const t=Math.cos(e),i=Math.sin(e);return new p(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1,V.AFFINE)}static gluPerspective(e,t,i,s){const n=Math.cos(e)/Math.sin(e);return new p(n/t,0,0,0,0,n,0,0,0,0,(s+i)/(i-s),2*s*i/(i-s),0,0,-1,0)}}l.Z.register("Matrix4",p);class V extends c.Z{}_defineProperty(V,"OTHER",new(s=V)),_defineProperty(V,"IDENTITY",new s),_defineProperty(V,"TRANSLATION_3D",new s),_defineProperty(V,"SCALING",new s),_defineProperty(V,"AFFINE",new s),_defineProperty(V,"enumeration",new g.Z(s)),p.Types=V,p.IDENTITY=(new p).makeImmutable();const M=p;var B=i(5870),w=i(668),C=i(7232);class E extends c.Z{}_defineProperty(E,"OTHER",new(n=E)),_defineProperty(E,"IDENTITY",new n),_defineProperty(E,"TRANSLATION_2D",new n),_defineProperty(E,"SCALING",new n),_defineProperty(E,"AFFINE",new n),_defineProperty(E,"enumeration",new g.Z(n));class Y{constructor(){this.entries=[1,0,0,0,1,0,0,0,1],this.type=E.IDENTITY}initialize(){return this}m00(){return this.entries[0]}m01(){return this.entries[3]}m02(){return this.entries[6]}m10(){return this.entries[1]}m11(){return this.entries[4]}m12(){return this.entries[7]}m20(){return this.entries[2]}m21(){return this.entries[5]}m22(){return this.entries[8]}isIdentity(){return this.type===E.IDENTITY||this.equals(Y.IDENTITY)}isFastIdentity(){return this.type===E.IDENTITY}isTranslation(){return this.type===E.TRANSLATION_2D||1===this.m00()&&1===this.m11()&&1===this.m22()&&0===this.m01()&&0===this.m10()&&0===this.m20()&&0===this.m21()}isAffine(){return this.type===E.AFFINE||0===this.m20()&&0===this.m21()&&1===this.m22()}isAligned(){return this.isAffine()&&0===this.m01()&&0===this.m10()}isAxisAligned(){return this.isAffine()&&(0===this.m01()&&0===this.m10()||0===this.m00()&&0===this.m11())}isFinite(){return isFinite(this.m00())&&isFinite(this.m01())&&isFinite(this.m02())&&isFinite(this.m10())&&isFinite(this.m11())&&isFinite(this.m12())&&isFinite(this.m20())&&isFinite(this.m21())&&isFinite(this.m22())}getDeterminant(){return this.m00()*this.m11()*this.m22()+this.m01()*this.m12()*this.m20()+this.m02()*this.m10()*this.m21()-this.m02()*this.m11()*this.m20()-this.m01()*this.m10()*this.m22()-this.m00()*this.m12()*this.m21()}get determinant(){return this.getDeterminant()}getTranslation(){return new w.Z(this.m02(),this.m12())}get translation(){return this.getTranslation()}getScaleVector(){return new w.Z(Math.sqrt(this.m00()*this.m00()+this.m10()*this.m10()),Math.sqrt(this.m01()*this.m01()+this.m11()*this.m11()))}get scaleVector(){return this.getScaleVector()}getSignedScale(){return this.m00()*this.m11()-this.m10()*this.m01()}getRotation(){return Math.atan2(this.m10(),this.m00())}get rotation(){return this.getRotation()}toMatrix4(){return new M(this.m00(),this.m01(),this.m02(),0,this.m10(),this.m11(),this.m12(),0,this.m20(),this.m21(),this.m22(),0,0,0,0,1)}toAffineMatrix4(){return new M(this.m00(),this.m01(),0,this.m02(),this.m10(),this.m11(),0,this.m12(),0,0,1,0,0,0,0,1)}toString(){return`${this.m00()} ${this.m01()} ${this.m02()}\n${this.m10()} ${this.m11()} ${this.m12()}\n${this.m20()} ${this.m21()} ${this.m22()}`}toSVGMatrix(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix();return e.a=this.m00(),e.b=this.m10(),e.c=this.m01(),e.d=this.m11(),e.e=this.m02(),e.f=this.m12(),e}getCSSTransform(){return`matrix(${this.entries[0].toFixed(20)},${this.entries[1].toFixed(20)},${this.entries[3].toFixed(20)},${this.entries[4].toFixed(20)},${this.entries[6].toFixed(20)},${this.entries[7].toFixed(20)})`}get cssTransform(){return this.getCSSTransform()}getSVGTransform(){switch(this.type){case E.IDENTITY:return"";case E.TRANSLATION_2D:return`translate(${(0,B.Z)(this.entries[6])},${(0,B.Z)(this.entries[7])})`;case E.SCALING:return`scale(${(0,B.Z)(this.entries[0])}${this.entries[0]===this.entries[4]?"":","+(0,B.Z)(this.entries[4])})`;default:return`matrix(${(0,B.Z)(this.entries[0])},${(0,B.Z)(this.entries[1])},${(0,B.Z)(this.entries[3])},${(0,B.Z)(this.entries[4])},${(0,B.Z)(this.entries[6])},${(0,B.Z)(this.entries[7])})`}}get svgTransform(){return this.getSVGTransform()}getCSSTransformStyles(){const e=this.getCSSTransform();return{"-webkit-perspective":"1000","-webkit-backface-visibility":"hidden","-webkit-transform":e+" translateZ(0)","-moz-transform":e+" translateZ(0)","-ms-transform":e,"-o-transform":e,transform:e,"transform-origin":"top left","-ms-transform-origin":"top left"}}get cssTransformStyles(){return this.getCSSTransformStyles()}equals(e){return this.m00()===e.m00()&&this.m01()===e.m01()&&this.m02()===e.m02()&&this.m10()===e.m10()&&this.m11()===e.m11()&&this.m12()===e.m12()&&this.m20()===e.m20()&&this.m21()===e.m21()&&this.m22()===e.m22()}equalsEpsilon(e,t){return Math.abs(this.m00()-e.m00())<t&&Math.abs(this.m01()-e.m01())<t&&Math.abs(this.m02()-e.m02())<t&&Math.abs(this.m10()-e.m10())<t&&Math.abs(this.m11()-e.m11())<t&&Math.abs(this.m12()-e.m12())<t&&Math.abs(this.m20()-e.m20())<t&&Math.abs(this.m21()-e.m21())<t&&Math.abs(this.m22()-e.m22())<t}copy(){return y(this.m00(),this.m01(),this.m02(),this.m10(),this.m11(),this.m12(),this.m20(),this.m21(),this.m22(),this.type)}plus(e){return y(this.m00()+e.m00(),this.m01()+e.m01(),this.m02()+e.m02(),this.m10()+e.m10(),this.m11()+e.m11(),this.m12()+e.m12(),this.m20()+e.m20(),this.m21()+e.m21(),this.m22()+e.m22())}minus(e){return y(this.m00()-e.m00(),this.m01()-e.m01(),this.m02()-e.m02(),this.m10()-e.m10(),this.m11()-e.m11(),this.m12()-e.m12(),this.m20()-e.m20(),this.m21()-e.m21(),this.m22()-e.m22())}transposed(){return y(this.m00(),this.m10(),this.m20(),this.m01(),this.m11(),this.m21(),this.m02(),this.m12(),this.m22(),this.type===E.IDENTITY||this.type===E.SCALING?this.type:void 0)}negated(){return y(-this.m00(),-this.m01(),-this.m02(),-this.m10(),-this.m11(),-this.m12(),-this.m20(),-this.m21(),-this.m22())}inverted(){let e;switch(this.type){case E.IDENTITY:return this;case E.TRANSLATION_2D:return y(1,0,-this.m02(),0,1,-this.m12(),0,0,1,E.TRANSLATION_2D);case E.SCALING:return y(1/this.m00(),0,0,0,1/this.m11(),0,0,0,1/this.m22(),E.SCALING);case E.AFFINE:if(e=this.getDeterminant(),0!==e)return y((-this.m12()*this.m21()+this.m11()*this.m22())/e,(this.m02()*this.m21()-this.m01()*this.m22())/e,(-this.m02()*this.m11()+this.m01()*this.m12())/e,(this.m12()*this.m20()-this.m10()*this.m22())/e,(-this.m02()*this.m20()+this.m00()*this.m22())/e,(this.m02()*this.m10()-this.m00()*this.m12())/e,0,0,1,E.AFFINE);throw new Error("Matrix could not be inverted, determinant === 0");case E.OTHER:if(e=this.getDeterminant(),0!==e)return y((-this.m12()*this.m21()+this.m11()*this.m22())/e,(this.m02()*this.m21()-this.m01()*this.m22())/e,(-this.m02()*this.m11()+this.m01()*this.m12())/e,(this.m12()*this.m20()-this.m10()*this.m22())/e,(-this.m02()*this.m20()+this.m00()*this.m22())/e,(this.m02()*this.m10()-this.m00()*this.m12())/e,(-this.m11()*this.m20()+this.m10()*this.m21())/e,(this.m01()*this.m20()-this.m00()*this.m21())/e,(-this.m01()*this.m10()+this.m00()*this.m11())/e,E.OTHER);throw new Error("Matrix could not be inverted, determinant === 0");default:throw new Error("Matrix3.inverted with unknown type: "+this.type)}}timesMatrix(e){if(this.type===E.IDENTITY||e.type===E.IDENTITY)return this.type===E.IDENTITY?e:this;if(this.type===e.type){if(this.type===E.TRANSLATION_2D)return y(1,0,this.m02()+e.m02(),0,1,this.m12()+e.m12(),0,0,1,E.TRANSLATION_2D);if(this.type===E.SCALING)return y(this.m00()*e.m00(),0,0,0,this.m11()*e.m11(),0,0,0,1,E.SCALING)}return this.type!==E.OTHER&&e.type!==E.OTHER?y(this.m00()*e.m00()+this.m01()*e.m10(),this.m00()*e.m01()+this.m01()*e.m11(),this.m00()*e.m02()+this.m01()*e.m12()+this.m02(),this.m10()*e.m00()+this.m11()*e.m10(),this.m10()*e.m01()+this.m11()*e.m11(),this.m10()*e.m02()+this.m11()*e.m12()+this.m12(),0,0,1,E.AFFINE):y(this.m00()*e.m00()+this.m01()*e.m10()+this.m02()*e.m20(),this.m00()*e.m01()+this.m01()*e.m11()+this.m02()*e.m21(),this.m00()*e.m02()+this.m01()*e.m12()+this.m02()*e.m22(),this.m10()*e.m00()+this.m11()*e.m10()+this.m12()*e.m20(),this.m10()*e.m01()+this.m11()*e.m11()+this.m12()*e.m21(),this.m10()*e.m02()+this.m11()*e.m12()+this.m12()*e.m22(),this.m20()*e.m00()+this.m21()*e.m10()+this.m22()*e.m20(),this.m20()*e.m01()+this.m21()*e.m11()+this.m22()*e.m21(),this.m20()*e.m02()+this.m21()*e.m12()+this.m22()*e.m22())}timesVector2(e){const t=this.m00()*e.x+this.m01()*e.y+this.m02(),i=this.m10()*e.x+this.m11()*e.y+this.m12();return new w.Z(t,i)}timesVector3(e){const t=this.m00()*e.x+this.m01()*e.y+this.m02()*e.z,i=this.m10()*e.x+this.m11()*e.y+this.m12()*e.z,s=this.m20()*e.x+this.m21()*e.y+this.m22()*e.z;return new d.Z(t,i,s)}timesTransposeVector2(e){const t=this.m00()*e.x+this.m10()*e.y,i=this.m01()*e.x+this.m11()*e.y;return new w.Z(t,i)}timesRelativeVector2(e){const t=this.m00()*e.x+this.m01()*e.y,i=this.m10()*e.y+this.m11()*e.y;return new w.Z(t,i)}rowMajor(e,t,i,s,n,r,o,A,a,h){return this.entries[0]=e,this.entries[1]=s,this.entries[2]=o,this.entries[3]=t,this.entries[4]=n,this.entries[5]=A,this.entries[6]=i,this.entries[7]=r,this.entries[8]=a,this.type=void 0===h?0===o&&0===A&&1===a?E.AFFINE:E.OTHER:h,this}set(e){return this.rowMajor(e.m00(),e.m01(),e.m02(),e.m10(),e.m11(),e.m12(),e.m20(),e.m21(),e.m22(),e.type)}setArray(e){return this.rowMajor(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])}set00(e){return this.entries[0]=e,this}set01(e){return this.entries[3]=e,this}set02(e){return this.entries[6]=e,this}set10(e){return this.entries[1]=e,this}set11(e){return this.entries[4]=e,this}set12(e){return this.entries[7]=e,this}set20(e){return this.entries[2]=e,this}set21(e){return this.entries[5]=e,this}set22(e){return this.entries[8]=e,this}makeImmutable(){return this}columnMajor(e,t,i,s,n,r,o,A,a,h){return this.rowMajor(e,s,o,t,n,A,i,r,a,h)}add(e){return this.rowMajor(this.m00()+e.m00(),this.m01()+e.m01(),this.m02()+e.m02(),this.m10()+e.m10(),this.m11()+e.m11(),this.m12()+e.m12(),this.m20()+e.m20(),this.m21()+e.m21(),this.m22()+e.m22())}subtract(e){return this.rowMajor(this.m00()-e.m00(),this.m01()-e.m01(),this.m02()-e.m02(),this.m10()-e.m10(),this.m11()-e.m11(),this.m12()-e.m12(),this.m20()-e.m20(),this.m21()-e.m21(),this.m22()-e.m22())}transpose(){return this.rowMajor(this.m00(),this.m10(),this.m20(),this.m01(),this.m11(),this.m21(),this.m02(),this.m12(),this.m22(),this.type===E.IDENTITY||this.type===E.SCALING?this.type:void 0)}negate(){return this.rowMajor(-this.m00(),-this.m01(),-this.m02(),-this.m10(),-this.m11(),-this.m12(),-this.m20(),-this.m21(),-this.m22())}invert(){let e;switch(this.type){case E.IDENTITY:return this;case E.TRANSLATION_2D:return this.rowMajor(1,0,-this.m02(),0,1,-this.m12(),0,0,1,E.TRANSLATION_2D);case E.SCALING:return this.rowMajor(1/this.m00(),0,0,0,1/this.m11(),0,0,0,1/this.m22(),E.SCALING);case E.AFFINE:if(e=this.getDeterminant(),0!==e)return this.rowMajor((-this.m12()*this.m21()+this.m11()*this.m22())/e,(this.m02()*this.m21()-this.m01()*this.m22())/e,(-this.m02()*this.m11()+this.m01()*this.m12())/e,(this.m12()*this.m20()-this.m10()*this.m22())/e,(-this.m02()*this.m20()+this.m00()*this.m22())/e,(this.m02()*this.m10()-this.m00()*this.m12())/e,0,0,1,E.AFFINE);throw new Error("Matrix could not be inverted, determinant === 0");case E.OTHER:if(e=this.getDeterminant(),0!==e)return this.rowMajor((-this.m12()*this.m21()+this.m11()*this.m22())/e,(this.m02()*this.m21()-this.m01()*this.m22())/e,(-this.m02()*this.m11()+this.m01()*this.m12())/e,(this.m12()*this.m20()-this.m10()*this.m22())/e,(-this.m02()*this.m20()+this.m00()*this.m22())/e,(this.m02()*this.m10()-this.m00()*this.m12())/e,(-this.m11()*this.m20()+this.m10()*this.m21())/e,(this.m01()*this.m20()-this.m00()*this.m21())/e,(-this.m01()*this.m10()+this.m00()*this.m11())/e,E.OTHER);throw new Error("Matrix could not be inverted, determinant === 0");default:throw new Error("Matrix3.inverted with unknown type: "+this.type)}}multiplyMatrix(e){if(e.type===E.IDENTITY)return this;if(this.type===E.IDENTITY)return this.set(e);if(this.type===e.type){if(this.type===E.TRANSLATION_2D)return this.rowMajor(1,0,this.m02()+e.m02(),0,1,this.m12()+e.m12(),0,0,1,E.TRANSLATION_2D);if(this.type===E.SCALING)return this.rowMajor(this.m00()*e.m00(),0,0,0,this.m11()*e.m11(),0,0,0,1,E.SCALING)}return this.type!==E.OTHER&&e.type!==E.OTHER?this.rowMajor(this.m00()*e.m00()+this.m01()*e.m10(),this.m00()*e.m01()+this.m01()*e.m11(),this.m00()*e.m02()+this.m01()*e.m12()+this.m02(),this.m10()*e.m00()+this.m11()*e.m10(),this.m10()*e.m01()+this.m11()*e.m11(),this.m10()*e.m02()+this.m11()*e.m12()+this.m12(),0,0,1,E.AFFINE):this.rowMajor(this.m00()*e.m00()+this.m01()*e.m10()+this.m02()*e.m20(),this.m00()*e.m01()+this.m01()*e.m11()+this.m02()*e.m21(),this.m00()*e.m02()+this.m01()*e.m12()+this.m02()*e.m22(),this.m10()*e.m00()+this.m11()*e.m10()+this.m12()*e.m20(),this.m10()*e.m01()+this.m11()*e.m11()+this.m12()*e.m21(),this.m10()*e.m02()+this.m11()*e.m12()+this.m12()*e.m22(),this.m20()*e.m00()+this.m21()*e.m10()+this.m22()*e.m20(),this.m20()*e.m01()+this.m21()*e.m11()+this.m22()*e.m21(),this.m20()*e.m02()+this.m21()*e.m12()+this.m22()*e.m22())}prependTranslation(e,t){return this.set02(this.m02()+e),this.set12(this.m12()+t),this.type===E.IDENTITY||this.type===E.TRANSLATION_2D?this.type=E.TRANSLATION_2D:this.type===E.OTHER?this.type=E.OTHER:this.type=E.AFFINE,this}setToIdentity(){return this.rowMajor(1,0,0,0,1,0,0,0,1,E.IDENTITY)}setToTranslation(e,t){return this.rowMajor(1,0,e,0,1,t,0,0,1,E.TRANSLATION_2D)}setToScale(e,t){return t=void 0===t?e:t,this.rowMajor(e,0,0,0,t,0,0,0,1,E.SCALING)}setToAffine(e,t,i,s,n,r){return this.rowMajor(e,t,i,s,n,r,0,0,1,E.AFFINE)}setToRotationAxisAngle(e,t){let i=Math.cos(t),s=Math.sin(t);Math.abs(i)<1e-15&&(i=0),Math.abs(s)<1e-15&&(s=0);const n=1-i;return this.rowMajor(e.x*e.x*n+i,e.x*e.y*n-e.z*s,e.x*e.z*n+e.y*s,e.y*e.x*n+e.z*s,e.y*e.y*n+i,e.y*e.z*n-e.x*s,e.z*e.x*n-e.y*s,e.z*e.y*n+e.x*s,e.z*e.z*n+i,E.OTHER)}setToRotationX(e){let t=Math.cos(e),i=Math.sin(e);return Math.abs(t)<1e-15&&(t=0),Math.abs(i)<1e-15&&(i=0),this.rowMajor(1,0,0,0,t,-i,0,i,t,E.OTHER)}setToRotationY(e){let t=Math.cos(e),i=Math.sin(e);return Math.abs(t)<1e-15&&(t=0),Math.abs(i)<1e-15&&(i=0),this.rowMajor(t,0,i,0,1,0,-i,0,t,E.OTHER)}setToRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return Math.abs(t)<1e-15&&(t=0),Math.abs(i)<1e-15&&(i=0),this.rowMajor(t,-i,0,i,t,0,0,0,1,E.AFFINE)}setToTranslationRotation(e,t,i){let s=Math.cos(i),n=Math.sin(i);return Math.abs(s)<1e-15&&(s=0),Math.abs(n)<1e-15&&(n=0),this.rowMajor(s,-n,e,n,s,t,0,0,1,E.AFFINE)}setToTranslationRotationPoint(e,t){return this.setToTranslationRotation(e.x,e.y,t)}setToSVGMatrix(e){return this.rowMajor(e.a,e.c,e.e,e.b,e.d,e.f,0,0,1,E.AFFINE)}setRotationAToB(e,t){const i=e,s=t;let n=i.cross(s);const r=i.dot(s);if((r<0?-r:r)>.9999){let e=new d.Z(i.x>0?i.x:-i.x,i.y>0?i.y:-i.y,i.z>0?i.z:-i.z);e=e.x<e.y?e.x<e.z?d.Z.X_UNIT:d.Z.Z_UNIT:e.y<e.z?d.Z.Y_UNIT:d.Z.Z_UNIT;const t=e.minus(i);n=e.minus(s);const r=2/t.dot(t),o=2/n.dot(n),A=r*o*t.dot(n);return this.rowMajor(-r*t.x*t.x-o*n.x*n.x+A*n.x*t.x+1,-r*t.x*t.y-o*n.x*n.y+A*n.x*t.y,-r*t.x*t.z-o*n.x*n.z+A*n.x*t.z,-r*t.y*t.x-o*n.y*n.x+A*n.y*t.x,-r*t.y*t.y-o*n.y*n.y+A*n.y*t.y+1,-r*t.y*t.z-o*n.y*n.z+A*n.y*t.z,-r*t.z*t.x-o*n.z*n.x+A*n.z*t.x,-r*t.z*t.y-o*n.z*n.y+A*n.z*t.y,-r*t.z*t.z-o*n.z*n.z+A*n.z*t.z+1)}{const e=1/(1+r),t=e*n.x,i=e*n.z,s=t*n.y,o=t*n.z,A=i*n.y;return this.rowMajor(r+t*n.x,s-n.z,o+n.y,s+n.z,r+e*n.y*n.y,A-n.x,o-n.y,A+n.x,r+i*n.z)}}multiplyVector2(e){return e.setXY(this.m00()*e.x+this.m01()*e.y+this.m02(),this.m10()*e.x+this.m11()*e.y+this.m12())}multiplyVector3(e){return e.setXYZ(this.m00()*e.x+this.m01()*e.y+this.m02()*e.z,this.m10()*e.x+this.m11()*e.y+this.m12()*e.z,this.m20()*e.x+this.m21()*e.y+this.m22()*e.z)}multiplyTransposeVector2(e){return e.setXY(this.m00()*e.x+this.m10()*e.y,this.m01()*e.x+this.m11()*e.y)}multiplyRelativeVector2(e){return e.setXY(this.m00()*e.x+this.m01()*e.y,this.m10()*e.y+this.m11()*e.y)}canvasSetTransform(e){e.setTransform(this.entries[0],this.entries[1],this.entries[3],this.entries[4],this.entries[6],this.entries[7])}canvasAppendTransform(e){this.type!==E.IDENTITY&&e.transform(this.entries[0],this.entries[1],this.entries[3],this.entries[4],this.entries[6],this.entries[7])}copyToArray(e){return e[0]=this.m00(),e[1]=this.m10(),e[2]=this.m20(),e[3]=this.m01(),e[4]=this.m11(),e[5]=this.m21(),e[6]=this.m02(),e[7]=this.m12(),e[8]=this.m22(),e}freeToPool(){Y.pool.freeToPool(this)}static identity(){return D().setToIdentity()}static translation(e,t){return D().setToTranslation(e,t)}static translationFromVector(e){return Y.translation(e.x,e.y)}static scaling(e,t){return D().setToScale(e,t)}static scale(e,t){return Y.scaling(e,t)}static affine(e,t,i,s,n,r){return D().setToAffine(e,t,i,s,n,r)}static rowMajor(e,t,i,s,n,r,o,A,a,h){return D().rowMajor(e,t,i,s,n,r,o,A,a,h)}static rotationAxisAngle(e,t){return D().setToRotationAxisAngle(e,t)}static rotationX(e){return D().setToRotationX(e)}static rotationY(e){return D().setToRotationY(e)}static rotationZ(e){return D().setToRotationZ(e)}static translationRotation(e,t,i){return D().setToTranslationRotation(e,t,i)}static rotation2(e){return D().setToRotationZ(e)}static rotationAround(e,t,i){return Y.translation(t,i).timesMatrix(Y.rotation2(e)).timesMatrix(Y.translation(-t,-i))}static rotationAroundPoint(e,t){return Y.rotationAround(e,t.x,t.y)}static fromSVGMatrix(e){return D().setToSVGMatrix(e)}static rotateAToB(e,t){return D().setRotationAToB(e,t)}static translationTimesMatrix(e,t,i){let s;return i.type===E.IDENTITY||i.type===E.TRANSLATION_2D?y(1,0,i.m02()+e,0,1,i.m12()+t,0,0,1,E.TRANSLATION_2D):(s=i.type===E.OTHER?E.OTHER:E.AFFINE,y(i.m00(),i.m01(),i.m02()+e,i.m10(),i.m11(),i.m12()+t,i.m20(),i.m21(),i.m22(),s))}static toStateObject(e){return{entries:e.entries,type:e.type.name}}static fromStateObject(e){const t=Y.identity();return t.entries=e.entries,t.type=E.enumeration.getValue(e.type),t}}r=Y,_defineProperty(Y,"pool",new C.Z(r,{initialize:r.prototype.initialize,useDefaultConstruction:!0,maxSize:300})),l.Z.register("Matrix3",Y);const D=Y.pool.fetch.bind(Y.pool),y=(e,t,i,s,n,r,o,A,a,h)=>D().rowMajor(e,t,i,s,n,r,o,A,a,h);l.Z.register("m3",y),Y.IDENTITY=Y.identity().makeImmutable(),Y.X_REFLECTION=y(-1,0,0,0,1,0,0,0,1,E.AFFINE).makeImmutable(),Y.Y_REFLECTION=y(1,0,0,0,-1,0,0,0,1,E.AFFINE).makeImmutable(),Y.Matrix3IO=new a.Z("Matrix3IO",{valueType:Y,documentation:"A 3x3 matrix often used for holding transform data.",toStateObject:e=>Y.toStateObject(e),fromStateObject:Y.fromStateObject,stateSchema:{entries:(0,A.Z)(h.Z),type:(0,o.Z)(E)}})},2238:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(7464),n=i(8964);class r{constructor(e){this.indices=e}size(){return this.indices.length}apply(e){if("number"==typeof e)return this.indices[e];{if(e.length!==this.size())throw new Error(`Permutation length ${this.size()} not equal to list length ${e.length}`);const t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[this.indices[i]];return t}}inverted(){const e=new Array(this.size());for(let t=0;t<this.size();t++)e[this.indices[t]]=t;return new r(e)}withIndicesPermuted(e){const t=[];return r.forEachPermutation(e,i=>{const s=this.indices,n=s.slice(0);for(let t=0;t<e.length;t++)n[e[t]]=s[i[t]];t.push(new r(n))}),t}toString(){return`P[${this.indices.join(", ")}]`}equals(e){return this.indices.length===e.indices.length&&_.isEqual(this.indices,e.indices)}static identity(e){const t=new Array(e);for(let i=0;i<e;i++)t[i]=i;return new r(t)}static permutations(e){const t=[];return r.forEachPermutation(n.Z.rangeInclusive(0,e-1),e=>{t.push(new r(e.slice()))}),t}static forEachPermutation(e,t){!function e(t,i,s){if(0===t.length)s(i);else for(let n=0;n<t.length;n++){const r=t[n],o=t.slice(0);o.splice(n,1);const A=i.slice(0);A.push(r),e(o,A,s)}}(e,[],t)}static permutationsOf(e){const t=[];return r.forEachPermutation(e,e=>{t.push(e.slice())}),t}}s.Z.register("Permutation",r);const o=r},7023:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(831),n=(i(1603),i(7464)),r=(i(5428),i(8964)),o=i(668);class A{constructor(e){e=(0,s.Z)({seed:null},e),this.seed=null,this.seedrandom=null,this.setSeed(e.seed),this.numberOfCalls=0,A.allRandomInstances.add(this)}dispose(){A.allRandomInstances.delete(this)}getSeed(){return this.seed}nextBoolean(){return this.nextDouble()>=.5}nextInt(e){const t=this.nextDouble()*e;return Math.floor(t)}nextIntBetween(e,t){const i=t-e;return this.nextInt(i+1)+e}sample(e){return e[this.nextIntBetween(0,e.length-1)]}shuffle(e){let t=-1;const i=new Array(e.length);return _.forEach(e,e=>{const s=this.nextIntBetween(0,++t);i[t]=i[s],i[s]=e}),i}nextDouble(){return this.numberOfCalls++,this.seedrandom()}nextDoubleBetween(e,t){const i=e+this.nextDouble()*(t-e);return i}nextGaussian(){return r.Z.boxMullerTransform(0,1,this)}nextDoubleInRange(e){return e.min<e.max?this.nextDoubleBetween(e.min,e.max):e.min}nextPointInBounds(e){return new o.Z(this.nextDoubleBetween(e.minX,e.maxX),this.nextDoubleBetween(e.minY,e.maxY))}setSeed(e){"number"==typeof e||(e=Math.random()),this.seed=e,this.seedrandom=Math.seedrandom?new Math.seedrandom(""+e):()=>Math.random()}sampleProbabilities(e){const t=_.sum(e)*this.nextDouble();let i=0;for(let s=0;s<e.length;s++)if(i+=e[s],i>=t)return s;return e.length-1}}A.allRandomInstances=new Set,A.isNormalized=e=>{},n.Z.register("Random",A);const a=A},5428:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>h});var n=i(3600),r=i(4792),o=i(7464);const A={min:r.Z,max:r.Z};class a{constructor(e,t){this._min=e,this._max=t}getMin(){return this._min}get min(){return this.getMin()}set min(e){this.setMin(e)}setMin(e){this._min=e}getMax(){return this._max}get max(){return this.getMax()}set max(e){this.setMax(e)}setMax(e){this._max=e}setMinMax(e,t){return this._min=e,this._max=t,this}addValue(e){this._min=Math.min(this._min,e),this._max=Math.max(this._max,e)}withValue(e){return new a(Math.min(this._min,e),Math.max(this._max,e))}copy(){return new a(this._min,this._max)}getLength(){return this._max-this._min}getCenter(){return(this._max+this._min)/2}contains(e){return e>=this._min&&e<=this._max}containsRange(e){return this._min<=e.min&&this._max>=e.max}intersects(e){return this._max>=e.min&&e.max>=this._min}intersectsExclusive(e){return this._max>e.min&&e.max>this._min}union(e){return new a(Math.min(this.min,e.min),Math.max(this.max,e.max))}intersection(e){return new a(Math.max(this.min,e.min),Math.min(this.max,e.max))}includeRange(e){return this.setMinMax(Math.min(this.min,e.min),Math.max(this.max,e.max))}constrainRange(e){return this.setMinMax(Math.max(this.min,e.min),Math.min(this.max,e.max))}shifted(e){return new a(this.min+e,this.max+e)}toString(){return`[Range (min:${this._min} max:${this._max})]`}constrainValue(e){return Math.min(Math.max(e,this._min),this._max)}equals(e){return this.constructor===e.constructor&&this._min===e.min&&this._max===e.max}equalsEpsilon(e,t){return this.constructor===e.constructor&&Math.abs(this._min-e.min)<=t&&Math.abs(this._max-e.max)<=t}getNormalizedValue(e){return(e-this.min)/this.getLength()}expandNormalizedValue(e){return e*this.getLength()+this.min}get defaultValue(){throw new Error("defaultValue is undefined, did you mean to use RangeWithValue?")}toStateObject(){return{min:r.Z.toStateObject(this.min),max:r.Z.toStateObject(this.max)}}static fromStateObject(e){return new a(r.Z.fromStateObject(e.min),r.Z.fromStateObject(e.max))}}s=a,_defineProperty(a,"RangeIO",new n.Z("RangeIO",{valueType:s,documentation:'A range with "min" and "max" members.',stateSchema:A,toStateObject:e=>e.toStateObject(),fromStateObject:e=>s.fromStateObject(e)})),_defineProperty(a,"EVERYTHING",new s(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY)),_defineProperty(a,"NOTHING",new s(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)),o.Z.register("Range",a);const h=a},7840:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(7464);class n{constructor(e,t){this.position=e,this.direction=t}shifted(e){return new n(this.pointAtDistance(e),this.direction)}pointAtDistance(e){return this.position.plus(this.direction.timesScalar(e))}toString(){return`${this.position.toString()} => ${this.direction.toString()}`}}s.Z.register("Ray2",n)},1063:(e,t,i)=>{"use strict";i.d(t,{Z:()=>A});var s=i(7464),n=i(3286);const r=window.Float64Array||Array;class o{constructor(e){this.matrix=e;const t=e,i=t.getArrayCopy();this.m=t.getRowDimension(),this.n=t.getColumnDimension();const s=this.m,o=this.n,A=Math.min,a=Math.max,h=Math.pow,l=Math.abs,g=A(s,o);this.s=new r(A(s+1,o));const c=this.s;this.U=new r(s*g);const d=this.U;this.V=new r(o*o);const u=this.V,m=new r(o),p=new r(s);let V,M,B,w,C,E,Y;const D=n.Z.hypot,y=A(s-1,o),I=a(0,A(o-2,s));for(B=0;B<a(y,I);B++){if(B<y){for(c[B]=0,V=B;V<s;V++)c[B]=D(c[B],i[V*o+B]);if(0!==c[B]){for(i[B*o+B]<0&&(c[B]=-c[B]),V=B;V<s;V++)i[V*o+B]/=c[B];i[B*o+B]+=1}c[B]=-c[B]}for(M=B+1;M<o;M++){if(B<y&&0!==c[B]){for(w=0,V=B;V<s;V++)w+=i[V*o+B]*i[V*o+M];for(w=-w/i[B*o+B],V=B;V<s;V++)i[V*o+M]+=w*i[V*o+B]}m[M]=i[B*o+M]}if(B<y)for(V=B;V<s;V++)d[V*g+B]=i[V*o+B];if(B<I){for(m[B]=0,V=B+1;V<o;V++)m[B]=D(m[B],m[V]);if(0!==m[B]){for(m[B+1]<0&&(m[B]=-m[B]),V=B+1;V<o;V++)m[V]/=m[B];m[B+1]+=1}if(m[B]=-m[B],B+1<s&&0!==m[B]){for(V=B+1;V<s;V++)p[V]=0;for(M=B+1;M<o;M++)for(V=B+1;V<s;V++)p[V]+=m[M]*i[V*o+M];for(M=B+1;M<o;M++)for(w=-m[M]/m[B+1],V=B+1;V<s;V++)i[V*o+M]+=w*p[V]}for(V=B+1;V<o;V++)u[V*o+B]=m[V]}}let q=A(o,s+1);for(y<o&&(c[y]=i[y*o+y]),s<q&&(c[q-1]=0),I+1<q&&(m[I]=i[I*o+q-1]),m[q-1]=0,M=y;M<g;M++){for(V=0;V<s;V++)d[V*g+M]=0;d[M*g+M]=1}for(B=y-1;B>=0;B--)if(0!==c[B]){for(M=B+1;M<g;M++){for(w=0,V=B;V<s;V++)w+=d[V*g+B]*d[V*g+M];for(w=-w/d[B*g+B],V=B;V<s;V++)d[V*g+M]+=w*d[V*g+B]}for(V=B;V<s;V++)d[V*g+B]=-d[V*g+B];for(d[B*g+B]=1+d[B*g+B],V=0;V<B-1;V++)d[V*g+B]=0}else{for(V=0;V<s;V++)d[V*g+B]=0;d[B*g+B]=1}for(B=o-1;B>=0;B--){if(B<I&&0!==m[B])for(M=B+1;M<g;M++){for(w=0,V=B+1;V<o;V++)w+=u[V*o+B]*u[V*o+M];for(w=-w/u[(B+1)*o+B],V=B+1;V<o;V++)u[V*o+M]+=w*u[V*o+B]}for(V=0;V<o;V++)u[V*o+B]=0;u[B*o+B]=1}const G=q-1;let Q=0;const S=h(2,-52),T=h(2,-966);for(;q>0;){let e;if(Q>500)break;for(B=q-2;B>=-1&&-1!==B;B--)if(l(m[B])<=T+S*(l(c[B])+l(c[B+1]))){m[B]=0;break}if(B===q-2)e=4;else{let t;for(t=q-1;t>=B&&t!==B;t--)if(w=(t!==q?l(m[t]):0)+(t!==B+1?l(m[t-1]):0),l(c[t])<=T+S*w){c[t]=0;break}t===B?e=3:t===q-1?e=1:(e=2,B=t)}switch(B++,e){case 1:for(C=m[q-2],m[q-2]=0,M=q-2;M>=B;M--)for(w=D(c[M],C),E=c[M]/w,Y=C/w,c[M]=w,M!==B&&(C=-Y*m[M-1],m[M-1]=E*m[M-1]),V=0;V<o;V++)w=E*u[V*o+M]+Y*u[V*o+q-1],u[V*o+q-1]=-Y*u[V*o+M]+E*u[V*o+q-1],u[V*o+M]=w;break;case 2:for(C=m[B-1],m[B-1]=0,M=B;M<q;M++)for(w=D(c[M],C),E=c[M]/w,Y=C/w,c[M]=w,C=-Y*m[M],m[M]=E*m[M],V=0;V<s;V++)w=E*d[V*g+M]+Y*d[V*g+B-1],d[V*g+B-1]=-Y*d[V*g+M]+E*d[V*g+B-1],d[V*g+M]=w;break;case 3:{const e=a(a(a(a(l(c[q-1]),l(c[q-2])),l(m[q-2])),l(c[B])),l(m[B])),t=c[q-1]/e,i=c[q-2]/e,n=m[q-2]/e,r=c[B]/e,A=m[B]/e,h=((i+t)*(i-t)+n*n)/2,p=t*n*(t*n);let y=0;0===h&&0===p||(y=Math.sqrt(h*h+p),h<0&&(y=-y),y=p/(h+y)),C=(r+t)*(r-t)+y;let I=r*A;for(M=B;M<q-1;M++){for(w=D(C,I),E=C/w,Y=I/w,M!==B&&(m[M-1]=w),C=E*c[M]+Y*m[M],m[M]=E*m[M]-Y*c[M],I=Y*c[M+1],c[M+1]=E*c[M+1],V=0;V<o;V++)w=E*u[V*o+M]+Y*u[V*o+M+1],u[V*o+M+1]=-Y*u[V*o+M]+E*u[V*o+M+1],u[V*o+M]=w;if(w=D(C,I),E=C/w,Y=I/w,c[M]=w,C=E*m[M]+Y*c[M+1],c[M+1]=-Y*m[M]+E*c[M+1],I=Y*m[M+1],m[M+1]=E*m[M+1],M<s-1)for(V=0;V<s;V++)w=E*d[V*g+M]+Y*d[V*g+M+1],d[V*g+M+1]=-Y*d[V*g+M]+E*d[V*g+M+1],d[V*g+M]=w}m[q-2]=C,Q+=1}break;case 4:if(c[B]<=0)for(c[B]=c[B]<0?-c[B]:0,V=0;V<=G;V++)u[V*o+B]=-u[V*o+B];for(;B<G&&!(c[B]>=c[B+1]);){if(w=c[B],c[B]=c[B+1],c[B+1]=w,B<o-1)for(V=0;V<o;V++)w=u[V*o+B+1],u[V*o+B+1]=u[V*o+B],u[V*o+B]=w;if(B<s-1)for(V=0;V<s;V++)w=d[V*g+B+1],d[V*g+B+1]=d[V*g+B],d[V*g+B]=w;B++}Q=0,q--;break;default:throw new Error("invalid kase: "+e)}}}getU(){return new n.Z(this.m,Math.min(this.m+1,this.n),this.U,!0)}getV(){return new n.Z(this.n,this.n,this.V,!0)}getSingularValues(){return this.s}getS(){const e=new n.Z(this.n,this.n);for(let t=0;t<this.n;t++){for(let i=0;i<this.n;i++)e.entries[e.index(t,i)]=0;e.entries[e.index(t,t)]=this.s[t]}return e}norm2(){return this.s[0]}cond(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}rank(){const e=Math.pow(2,-23),t=Math.max(this.m,this.n)*this.s[0]*e;let i=0;for(let s=0;s<this.s.length;s++)this.s[s]>t&&i++;return i}static pseudoinverse(e){const t=new o(e),i=n.Z.diagonalMatrix(t.getSingularValues().map(e=>Math.abs(e)<1e-300?0:1/e));return t.getV().times(i).times(t.getU().transpose())}}s.Z.register("SingularValueDecomposition",o);const A=o},7320:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(1685),n=i(7464),r=i(9972),o=i(7840),A=i(668);const a=new r.Z;class h{constructor(e){this.matrix=r.Z.IDENTITY.copy(),this.inverse=r.Z.IDENTITY.copy(),this.matrixTransposed=r.Z.IDENTITY.copy(),this.inverseTransposed=r.Z.IDENTITY.copy(),this.inverseValid=!0,this.transposeValid=!0,this.inverseTransposeValid=!0,this.changeEmitter=new s.Z,e&&this.setMatrix(e)}setMatrix(e){this.matrix.set(e),this.invalidate()}validateMatrix(e){}invalidate(){this.inverseValid=!1,this.transposeValid=!1,this.inverseTransposeValid=!1,this.changeEmitter.emit()}prepend(e){a.set(this.matrix),this.matrix.set(e),this.matrix.multiplyMatrix(a),this.invalidate()}prependTranslation(e,t){this.matrix.prependTranslation(e,t),this.invalidate()}append(e){this.matrix.multiplyMatrix(e),this.invalidate()}prependTransform(e){this.prepend(e.matrix)}appendTransform(e){this.append(e.matrix)}applyToCanvasContext(e){e.setTransform(this.matrix.m00(),this.matrix.m10(),this.matrix.m01(),this.matrix.m11(),this.matrix.m02(),this.matrix.m12())}copy(){const e=new h(this.matrix);e.inverse=this.inverse,e.matrixTransposed=this.matrixTransposed,e.inverseTransposed=this.inverseTransposed,e.inverseValid=this.inverseValid,e.transposeValid=this.transposeValid,e.inverseTransposeValid=this.inverseTransposeValid}getMatrix(){return this.matrix}getInverse(){return this.inverseValid||(this.inverseValid=!0,this.inverse.set(this.matrix),this.inverse.invert()),this.inverse}getMatrixTransposed(){return this.transposeValid||(this.transposeValid=!0,this.matrixTransposed.set(this.matrix),this.matrixTransposed.transpose()),this.matrixTransposed}getInverseTransposed(){return this.inverseTransposeValid||(this.inverseTransposeValid=!0,this.inverseTransposed.set(this.getInverse()),this.inverseTransposed.transpose()),this.inverseTransposed}isIdentity(){return this.matrix.isFastIdentity()}isFinite(){return this.matrix.isFinite()}transformPosition2(e){return this.matrix.timesVector2(e)}transformDelta2(e){const t=this.getMatrix();return new A.Z(t.m00()*e.x+t.m01()*e.y,t.m10()*e.x+t.m11()*e.y)}transformNormal2(e){return this.getInverse().timesTransposeVector2(e).normalize()}transformX(e){const t=this.getMatrix();return t.m00()*e+t.m02()}transformY(e){const t=this.getMatrix();return t.m11()*e+t.m12()}transformDeltaX(e){return this.getMatrix().m00()*e}transformDeltaY(e){return this.getMatrix().m11()*e}transformBounds2(e){return e.transformed(this.matrix)}transformShape(e){return e.transformed(this.matrix)}transformRay2(e){return new o.Z(this.transformPosition2(e.position),this.transformDelta2(e.direction).normalized())}inversePosition2(e){return this.getInverse().timesVector2(e)}inverseDelta2(e){const t=this.getInverse();return new A.Z(t.m00()*e.x+t.m01()*e.y,t.m10()*e.x+t.m11()*e.y)}inverseNormal2(e){return this.matrix.timesTransposeVector2(e).normalize()}inverseX(e){const t=this.getInverse();return t.m00()*e+t.m02()}inverseY(e){const t=this.getInverse();return t.m11()*e+t.m12()}inverseDeltaX(e){const t=this.getInverse();return t.m00()*e}inverseDeltaY(e){const t=this.getInverse();return t.m11()*e}inverseBounds2(e){return e.transformed(this.getInverse())}inverseShape(e){return e.transformed(this.getInverse())}inverseRay2(e){return new o.Z(this.inversePosition2(e.position),this.inverseDelta2(e.direction).normalized())}}n.Z.register("Transform3",h);const l=h},8964:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(7464),n=i(668),r=i(8002);const o=Number.MIN_VALUE,A=2*Math.PI;let a,h,l;const g={clamp:(e,t,i)=>e<t?t:e>i?i:e,moduloBetweenDown(e,t,i){const s=i-t;let n=(e-t)%s;return n<0&&(n+=s),n+t},moduloBetweenUp:(e,t,i)=>-g.moduloBetweenDown(-e,-i,-t),rangeInclusive(e,t){if(t<e)return[];const i=new Array(t-e+1);for(let s=e;s<=t;s++)i[s-e]=s;return i},rangeExclusive:(e,t)=>g.rangeInclusive(e+1,t-1),toRadians:e=>Math.PI*e/180,toDegrees:e=>180*e/Math.PI,mod:(e,t)=>e/t%1==0?0:e%t,gcd(e,t){return Math.abs(0===t?e:this.gcd(t,g.mod(e,t)))},lcm:(e,t)=>g.roundSymmetric(Math.abs(e*t)/g.gcd(e,t)),lineLineIntersection(e,t,i,s){if(e.equals(t)||i.equals(s))return null;const r=e.x-t.x,o=i.x-s.x,A=e.y-t.y,a=i.y-s.y,h=r*a-A*o;if(Math.abs(h)<1e-10)return null;const l=e.x*t.y-e.y*t.x,g=i.x*s.y-i.y*s.x;return new n.Z((l*o-r*g)/h,(l*a-A*g)/h)},circleCenterFromPoints(e,t,i){const s=new n.Z((e.x+t.x)/2,(e.y+t.y)/2),r=new n.Z((t.x+i.x)/2,(t.y+i.y)/2),o=new n.Z(s.x+(t.y-e.y),s.y-(t.x-e.x)),A=new n.Z(r.x+(i.y-t.y),r.y-(i.x-t.x));return g.lineLineIntersection(s,o,r,A)},pointInCircleFromPoints(e,t,i,s){const n=e.x-s.x,r=e.y-s.y,o=(e.x-s.x)*(e.x-s.x)+(e.y-s.y)*(e.y-s.y),A=t.x-s.x,a=t.y-s.y,h=(t.x-s.x)*(t.x-s.x)+(t.y-s.y)*(t.y-s.y),l=i.x-s.x,g=i.y-s.y,c=(i.x-s.x)*(i.x-s.x)+(i.y-s.y)*(i.y-s.y);return n*a*c+r*h*l+o*A*g-o*a*l-r*A*c-n*h*g>0},sphereRayIntersection(e,t,i){i=void 0===i?1e-5:i;const s=new r.Z(0,0,0),n=t.direction,o=t.position,A=o.minus(s),a=n.dot(A),h=4*a*a-4*(A.magnitudeSquared-e*e);if(h<i)return null;const l=n.dot(s)-n.dot(o),g=Math.sqrt(h)/2,c=l-g,d=l+g;if(d<i)return null;const u=t.pointAtDistance(d),m=u.minus(s).normalized();if(c<i)return{distance:d,hitPoint:u,normal:m.negated(),fromOutside:!1};{const e=t.pointAtDistance(c),i=e.minus(s).normalized();return{distance:c,hitPoint:e,normal:i,fromOutside:!0}}},solveLinearRootsReal:(e,t)=>0===e?0===t?null:[]:[-t/e],solveQuadraticRootsReal(e,t,i){if(0===e||Math.abs(t/e)>1e7||Math.abs(i/e)>1e7)return g.solveLinearRootsReal(t,i);const s=t*t-4*e*i;if(s<0)return[];const n=Math.sqrt(s);return[(-t-n)/(2*e),(-t+n)/(2*e)]},solveCubicRootsReal(e,t,i,s){let n,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e-7;if(0===e)n=g.solveQuadraticRootsReal(t,i,s);else{const o=1e7;if(0===e||Math.abs(t/e)>o||Math.abs(i/e)>o||Math.abs(s/e)>o)n=g.solveQuadraticRootsReal(t,i,s);else if(0===s||Math.abs(e/s)>o||Math.abs(t/s)>o||Math.abs(i/s)>o)n=[0].concat(g.solveQuadraticRootsReal(e,t,i));else{const o=(3*(i/=e)-(t/=e)*t)/9,A=(-27*(s/=e)+t*(9*i-t*t*2))/54,a=o*o*o+A*A,h=t/3;if(a>r){const e=Math.sqrt(a);n=[g.cubeRoot(A+e)+g.cubeRoot(A-e)-h]}else if(a>-r){const e=g.cubeRoot(A),t=-h-e;n=[2*e-h,t,t]}else{let e=-o*o*o;e=Math.acos(A/Math.sqrt(e));const t=2*Math.sqrt(-o);n=[-h+t*Math.cos(e/3),-h+t*Math.cos((e+2*Math.PI)/3),-h+t*Math.cos((e+4*Math.PI)/3)]}}}return n},cubeRoot:e=>e>=0?Math.pow(e,1/3):-Math.pow(-e,1/3),linear:(e,t,i,s,n)=>(s-i)/(t-e)*(n-e)+i,roundSymmetric:e=>(e<0?-1:1)*Math.round(Math.abs(e)),toFixed(e,t){const i=Math.pow(10,t);return(g.roundSymmetric(e*i)/i).toFixed(t)},toFixedNumber:(e,t)=>parseFloat(g.toFixed(e,t)),equalsEpsilon:(e,t,i)=>Math.abs(e-t)<=i,lineSegmentIntersection(e,t,i,s,r,o,A,a){const h=(e,t,i,s,n,r)=>(r-t)*(i-e)-(s-t)*(n-e);if(h(e,t,r,o,A,a)*h(i,s,r,o,A,a)>0||h(r,o,e,t,i,s)*h(A,a,e,t,i,s)>0)return null;const l=(e-i)*(o-a)-(t-s)*(r-A);if(Math.abs(l)<1e-10)return null;if(e===r&&t===o||e===A&&t===a)return new n.Z(e,t);if(i===r&&s===o||i===A&&s===a)return new n.Z(i,s);const g=((e*s-t*i)*(r-A)-(e-i)*(r*a-o*A))/l,c=((e*s-t*i)*(o-a)-(t-s)*(r*a-o*A))/l;return new n.Z(g,c)},distToSegmentSquared(e,t,i){const s=t.distanceSquared(i);if(0===s)return e.distanceSquared(t);const r=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/s;let o;return o=r<0?e.distanceSquared(t):r>1?e.distanceSquared(i):e.distanceSquared(new n.Z(t.x+r*(i.x-t.x),t.y+r*(i.y-t.y))),o},distToSegment(e,t,i){return Math.sqrt(this.distToSegmentSquared(e,t,i))},arePointsCollinear:(e,t,i,s)=>(void 0===s&&(s=0),g.triangleArea(e,t,i)<=s),triangleArea:(e,t,i)=>Math.abs(g.triangleAreaSigned(e,t,i)),triangleAreaSigned:(e,t,i)=>e.x*(t.y-i.y)+t.x*(i.y-e.y)+i.x*(e.y-t.y),centroidOfPolygon(e){const t=new n.Z(0,0);let i=0;return e.forEach((s,n)=>{const r=e[(n+1)%e.length],o=s.x*r.y-r.x*s.y;i+=o/2,t.addXY((s.x+r.x)*o,(s.y+r.y)*o)}),t.divideScalar(6*i),t},cosh:e=>(Math.exp(e)+Math.exp(-e))/2,sinh:e=>(Math.exp(e)-Math.exp(-e))/2,log10:e=>Math.log(e)/Math.LN10,boxMullerTransform(e,t,i){if(a=!a,!a)return l*t+e;let s,n;do{s=i.nextDouble(),n=i.nextDouble()}while(s<=o);return h=Math.sqrt(-2*Math.log(s))*Math.cos(A*n),l=Math.sqrt(-2*Math.log(s))*Math.sin(A*n),h*t+e},numberOfDecimalPlaces(e){if(Math.floor(e)===e)return 0;{const t=e.toString();if(t.includes("e")){const e=t.split("e"),i=e[0],s=Number(e[1]),n=i.includes(".")?i.split(".")[1].length:0;return Math.max(n-s,0)}return t.split(".")[1].length}},roundToInterval:(e,t)=>g.toFixedNumber(g.roundSymmetric(e/t)*t,g.numberOfDecimalPlaces(t))};s.Z.register("Utils",g),s.Z.clamp=g.clamp,s.Z.moduloBetweenDown=g.moduloBetweenDown,s.Z.moduloBetweenUp=g.moduloBetweenUp,s.Z.rangeInclusive=g.rangeInclusive,s.Z.rangeExclusive=g.rangeExclusive,s.Z.toRadians=g.toRadians,s.Z.toDegrees=g.toDegrees,s.Z.lineLineIntersection=g.lineLineIntersection,s.Z.lineSegmentIntersection=g.lineSegmentIntersection,s.Z.sphereRayIntersection=g.sphereRayIntersection,s.Z.solveQuadraticRootsReal=g.solveQuadraticRootsReal,s.Z.solveCubicRootsReal=g.solveCubicRootsReal,s.Z.cubeRoot=g.cubeRoot,s.Z.linear=g.linear,s.Z.boxMullerTransform=g.boxMullerTransform;const c=g},668:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>g,v2:()=>c});var n=i(7232),r=i(3600),o=i(8585),A=i(7464),a=i(8964),h=i(8002);const l=(e,t)=>e.add(t);class g{constructor(e,t){this.x=e,this.y=t}getMagnitude(){return Math.sqrt(this.magnitudeSquared)}get magnitude(){return this.getMagnitude()}getMagnitudeSquared(){return this.x*this.x+this.y*this.y}get magnitudeSquared(){return this.getMagnitudeSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceXY(e,t){const i=this.x-e,s=this.y-t;return Math.sqrt(i*i+s*s)}distanceSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}distanceSquaredXY(e,t){const i=this.x-e,s=this.y-t;return i*i+s*s}dot(e){return this.x*e.x+this.y*e.y}dotXY(e,t){return this.x*e+this.y*t}getAngle(){return Math.atan2(this.y,this.x)}get angle(){return this.getAngle()}angleBetween(e){const t=this.magnitude,i=e.magnitude;return Math.acos(A.Z.clamp((this.x*e.x+this.y*e.y)/(t*i),-1,1))}equals(e){return this.x===e.x&&this.y===e.y}equalsEpsilon(e,t){return t||(t=0),Math.max(Math.abs(this.x-e.x),Math.abs(this.y-e.y))<=t}isFinite(){return isFinite(this.x)&&isFinite(this.y)}copy(e){return e?e.set(this):c(this.x,this.y)}crossScalar(e){return this.x*e.y-this.y*e.x}normalized(){const e=this.magnitude;if(0===e)throw new Error("Cannot normalize a zero-magnitude vector");return c(this.x/e,this.y/e)}roundedSymmetric(){return this.copy().roundSymmetric()}withMagnitude(e){return this.copy().setMagnitude(e)}timesScalar(e){return c(this.x*e,this.y*e)}times(e){return this.timesScalar(e)}componentTimes(e){return c(this.x*e.x,this.y*e.y)}plus(e){return c(this.x+e.x,this.y+e.y)}plusXY(e,t){return c(this.x+e,this.y+t)}plusScalar(e){return c(this.x+e,this.y+e)}minus(e){return c(this.x-e.x,this.y-e.y)}minusXY(e,t){return c(this.x-e,this.y-t)}minusScalar(e){return c(this.x-e,this.y-e)}dividedScalar(e){return c(this.x/e,this.y/e)}negated(){return c(-this.x,-this.y)}getPerpendicular(){return c(this.y,-this.x)}get perpendicular(){return this.getPerpendicular()}rotated(e){const t=this.angle+e,i=this.magnitude;return c(i*Math.cos(t),i*Math.sin(t))}rotateAboutXY(e,t,i){const s=this.x-e,n=this.y-t,r=Math.cos(i),o=Math.sin(i);return this.x=e+s*r-n*o,this.y=t+s*o+n*r,this}rotateAboutPoint(e,t){return this.rotateAboutXY(e.x,e.y,t)}rotatedAboutXY(e,t,i){return c(this.x,this.y).rotateAboutXY(e,t,i)}rotatedAboutPoint(e,t){return this.rotatedAboutXY(e.x,e.y,t)}blend(e,t){return c(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)}average(e){return this.blend(e,.5)}static average(e){return _.reduce(e,l,new g(0,0)).divideScalar(e.length)}toString(){return`Vector2(${this.x}, ${this.y})`}toVector3(){return new h.Z(this.x,this.y,0)}setXY(e,t){return this.x=e,this.y=t,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}set(e){return this.setXY(e.x,e.y)}setMagnitude(e){const t=e/this.magnitude;return this.multiplyScalar(t)}add(e){return this.setXY(this.x+e.x,this.y+e.y)}addXY(e,t){return this.setXY(this.x+e,this.y+t)}addScalar(e){return this.setXY(this.x+e,this.y+e)}subtract(e){return this.setXY(this.x-e.x,this.y-e.y)}subtractXY(e,t){return this.setXY(this.x-e,this.y-t)}subtractScalar(e){return this.setXY(this.x-e,this.y-e)}multiplyScalar(e){return this.setXY(this.x*e,this.y*e)}multiply(e){return this.multiplyScalar(e)}componentMultiply(e){return this.setXY(this.x*e.x,this.y*e.y)}divideScalar(e){return this.setXY(this.x/e,this.y/e)}negate(){return this.setXY(-this.x,-this.y)}normalize(){const e=this.magnitude;if(0===e)throw new Error("Cannot normalize a zero-magnitude vector");return this.divideScalar(e)}roundSymmetric(){return this.setXY(a.Z.roundSymmetric(this.x),a.Z.roundSymmetric(this.y))}rotate(e){const t=this.angle+e,i=this.magnitude;return this.setXY(i*Math.cos(t),i*Math.sin(t))}setPolar(e,t){return this.setXY(e*Math.cos(t),e*Math.sin(t))}toStateObject(){return{x:this.x,y:this.y}}freeToPool(){g.pool.freeToPool(this)}static createPolar(e,t){return new g(0,0).setPolar(e,t)}static fromStateObject(e){return c(e.x,e.y)}static getAngleBetweenVectors(e,t){const i=t.x-e.x,s=t.y-e.y;return Math.atan2(s,i)}static getDistanceBetweenVectors(e,t){const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}}s=g,_defineProperty(g,"pool",new n.Z(s,{maxSize:1e3,initialize:s.prototype.setXY,defaultArguments:[0,0]})),g.prototype.isVector2=!0,g.prototype.dimension=2,A.Z.register("Vector2",g);const c=g.pool.create.bind(g.pool);A.Z.register("v2",c);class d extends g{static mutableOverrideHelper(e){d.prototype[e]=()=>{throw new Error(`Cannot call mutable method '${e}' on immutable Vector2`)}}}d.mutableOverrideHelper("setXY"),d.mutableOverrideHelper("setX"),d.mutableOverrideHelper("setY"),g.ZERO=new g(0,0),g.X_UNIT=new g(1,0),g.Y_UNIT=new g(0,1);const u={x:o.Z,y:o.Z};g.Vector2IO=new r.Z("Vector2IO",{valueType:g,stateSchema:u,toStateObject:e=>e.toStateObject(),fromStateObject:e=>g.fromStateObject(e),documentation:"A numerical object with x and y properties, like {x:3,y:4}"})},2560:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(592),n=i(668),r=i(7464),o=i(2550);const A={isValidValue:e=>!isNaN(e.x)&&!isNaN(e.y),validationMessage:"Vector2 x/y should not be NaN"};class a extends s.Z{constructor(e,t){const i=(0,o.ZP)()({valueType:n.Z,validBounds:null,validators:[],phetioValueType:n.Z.Vector2IO},t);i.validators.push(A),i.validBounds&&i.validators.push({validationMessage:"Vector2 is not within validBounds",isValidValue:e=>i.validBounds.containsPoint(e)}),super(e,i),this.validBounds=i.validBounds}}r.Z.register("Vector2Property",a);const h=a},8002:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>c});var n=i(7232),r=i(3600),o=i(8585),A=i(7464),a=i(8964),h=i(668),l=i(1319);const g=(e,t)=>e.add(t);class c{constructor(e,t,i){this.x=e,this.y=t,this.z=i}getMagnitude(){return Math.sqrt(this.magnitudeSquared)}get magnitude(){return this.getMagnitude()}getMagnitudeSquared(){return this.dot(this)}get magnitudeSquared(){return this.getMagnitudeSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceXYZ(e,t,i){const s=this.x-e,n=this.y-t,r=this.z-i;return Math.sqrt(s*s+n*n+r*r)}distanceSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}distanceSquaredXYZ(e,t,i){const s=this.x-e,n=this.y-t,r=this.z-i;return s*s+n*n+r*r}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}dotXYZ(e,t,i){return this.x*e+this.y*t+this.z*i}angleBetween(e){return Math.acos(a.Z.clamp(this.normalized().dot(e.normalized()),-1,1))}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}equalsEpsilon(e,t){return t||(t=0),Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)<=t}isFinite(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.z)}copy(e){return e?e.set(this):d(this.x,this.y,this.z)}cross(e){return d(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}normalized(){const e=this.magnitude;if(0===e)throw new Error("Cannot normalize a zero-magnitude vector");return d(this.x/e,this.y/e,this.z/e)}roundedSymmetric(){return this.copy().roundSymmetric()}withMagnitude(e){return this.copy().setMagnitude(e)}timesScalar(e){return d(this.x*e,this.y*e,this.z*e)}times(e){return this.timesScalar(e)}componentTimes(e){return d(this.x*e.x,this.y*e.y,this.z*e.z)}plus(e){return d(this.x+e.x,this.y+e.y,this.z+e.z)}plusXYZ(e,t,i){return d(this.x+e,this.y+t,this.z+i)}plusScalar(e){return d(this.x+e,this.y+e,this.z+e)}minus(e){return d(this.x-e.x,this.y-e.y,this.z-e.z)}minusXYZ(e,t,i){return d(this.x-e,this.y-t,this.z-i)}minusScalar(e){return d(this.x-e,this.y-e,this.z-e)}dividedScalar(e){return d(this.x/e,this.y/e,this.z/e)}negated(){return d(-this.x,-this.y,-this.z)}blend(e,t){return this.plus(e.minus(this).times(t))}average(e){return this.blend(e,.5)}static average(e){return _.reduce(e,g,new c(0,0,0)).divideScalar(e.length)}toString(){return`Vector3(${this.x}, ${this.y}, ${this.z})`}toVector2(){return(0,h.v2)(this.x,this.y)}toVector4(){return(0,l.v4)(this.x,this.y,this.z,1)}toVector4Zero(){return(0,l.v4)(this.x,this.y,this.z,0)}setXYZ(e,t,i){return this.x=e,this.y=t,this.z=i,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}set(e){return this.setXYZ(e.x,e.y,e.z)}setMagnitude(e){const t=e/this.magnitude;return this.multiplyScalar(t)}add(e){return this.setXYZ(this.x+e.x,this.y+e.y,this.z+e.z)}addXYZ(e,t,i){return this.setXYZ(this.x+e,this.y+t,this.z+i)}addScalar(e){return this.setXYZ(this.x+e,this.y+e,this.z+e)}subtract(e){return this.setXYZ(this.x-e.x,this.y-e.y,this.z-e.z)}subtractXYZ(e,t,i){return this.setXYZ(this.x-e,this.y-t,this.z-i)}subtractScalar(e){return this.setXYZ(this.x-e,this.y-e,this.z-e)}multiplyScalar(e){return this.setXYZ(this.x*e,this.y*e,this.z*e)}multiply(e){return this.multiplyScalar(e)}componentMultiply(e){return this.setXYZ(this.x*e.x,this.y*e.y,this.z*e.z)}divideScalar(e){return this.setXYZ(this.x/e,this.y/e,this.z/e)}negate(){return this.setXYZ(-this.x,-this.y,-this.z)}setCross(e){return this.setXYZ(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}normalize(){const e=this.magnitude;if(0===e)throw new Error("Cannot normalize a zero-magnitude vector");return this.divideScalar(e)}roundSymmetric(){return this.setXYZ(a.Z.roundSymmetric(this.x),a.Z.roundSymmetric(this.y),a.Z.roundSymmetric(this.z))}toStateObject(){return{x:this.x,y:this.y,z:this.z}}freeToPool(){c.pool.freeToPool(this)}static slerp(e,t,i){return A.Z.Quaternion.slerp(new A.Z.Quaternion,A.Z.Quaternion.getRotationQuaternion(e,t),i).timesVector3(e)}static fromStateObject(e){return d(e.x,e.y,e.z)}}s=c,_defineProperty(c,"pool",new n.Z(s,{maxSize:1e3,initialize:s.prototype.setXYZ,defaultArguments:[0,0,0]})),c.prototype.isVector3=!0,c.prototype.dimension=3,A.Z.register("Vector3",c);const d=c.pool.create.bind(c.pool);A.Z.register("v3",d);class u extends c{static mutableOverrideHelper(e){u.prototype[e]=()=>{throw new Error(`Cannot call mutable method '${e}' on immutable Vector3`)}}}u.mutableOverrideHelper("setXYZ"),u.mutableOverrideHelper("setX"),u.mutableOverrideHelper("setY"),u.mutableOverrideHelper("setZ"),c.ZERO=new c(0,0,0),c.X_UNIT=new c(1,0,0),c.Y_UNIT=new c(0,1,0),c.Z_UNIT=new c(0,0,1),c.Vector3IO=new r.Z("Vector3IO",{valueType:c,documentation:"Basic 3-dimensional vector, represented as (x,y,z)",toStateObject:e=>e.toStateObject(),fromStateObject:c.fromStateObject,stateSchema:{x:o.Z,y:o.Z,z:o.Z}})},1319:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>a,v4:()=>h});var n=i(8964),r=i(8002),o=i(7464),A=i(7232);class a{constructor(e,t,i,s){this.x=e,this.y=t,this.z=i,this.w=s}getMagnitude(){return Math.sqrt(this.magnitudeSquared)}get magnitude(){return this.getMagnitude()}getMagnitudeSquared(){return this.dot(this)}get magnitudeSquared(){return this.getMagnitudeSquared()}distance(e){return this.minus(e).magnitude}distanceXYZW(e,t,i,s){const n=this.x-e,r=this.y-t,o=this.z-i,A=this.w-s;return Math.sqrt(n*n+r*r+o*o+A*A)}distanceSquared(e){return this.minus(e).magnitudeSquared}distanceSquaredXYZW(e,t,i,s){const n=this.x-e,r=this.y-t,o=this.z-i,A=this.w-s;return n*n+r*r+o*o+A*A}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}dotXYZW(e,t,i,s){return this.x*e+this.y*t+this.z*i+this.w*s}angleBetween(e){return Math.acos(o.Z.clamp(this.normalized().dot(e.normalized()),-1,1))}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w}equalsEpsilon(e,t){return t||(t=0),Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)+Math.abs(this.w-e.w)<=t}isFinite(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.z)&&isFinite(this.w)}copy(e){return e?e.set(this):h(this.x,this.y,this.z,this.w)}normalized(){const e=this.magnitude;return this.dividedScalar(e)}roundedSymmetric(){return this.copy().roundSymmetric()}withMagnitude(e){return this.copy().setMagnitude(e)}timesScalar(e){return h(this.x*e,this.y*e,this.z*e,this.w*e)}times(e){return this.timesScalar(e)}componentTimes(e){return h(this.x*e.x,this.y*e.y,this.z*e.z,this.w*e.w)}plus(e){return h(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)}plusXYZW(e,t,i,s){return h(this.x+e,this.y+t,this.z+i,this.w+s)}plusScalar(e){return h(this.x+e,this.y+e,this.z+e,this.w+e)}minus(e){return h(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)}minusXYZW(e,t,i,s){return h(this.x-e,this.y-t,this.z-i,this.w-s)}minusScalar(e){return h(this.x-e,this.y-e,this.z-e,this.w-e)}dividedScalar(e){return h(this.x/e,this.y/e,this.z/e,this.w/e)}negated(){return h(-this.x,-this.y,-this.z,-this.w)}blend(e,t){return this.plus(e.minus(this).times(t))}average(e){return this.blend(e,.5)}toString(){return`Vector4(${this.x}, ${this.y}, ${this.z}, ${this.w})`}toVector3(){return new r.Z(this.x,this.y,this.z)}setXYZW(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}set(e){return this.setXYZW(e.x,e.y,e.z,e.w)}setMagnitude(e){const t=e/this.magnitude;return this.multiplyScalar(t)}add(e){return this.setXYZW(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)}addXYZW(e,t,i,s){return this.setXYZW(this.x+e,this.y+t,this.z+i,this.w+s)}addScalar(e){return this.setXYZW(this.x+e,this.y+e,this.z+e,this.w+e)}subtract(e){return this.setXYZW(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)}subtractXYZW(e,t,i,s){return this.setXYZW(this.x-e,this.y-t,this.z-i,this.w-s)}subtractScalar(e){return this.setXYZW(this.x-e,this.y-e,this.z-e,this.w-e)}multiplyScalar(e){return this.setXYZW(this.x*e,this.y*e,this.z*e,this.w*e)}multiply(e){return this.multiplyScalar(e)}componentMultiply(e){return this.setXYZW(this.x*e.x,this.y*e.y,this.z*e.z,this.w*e.w)}divideScalar(e){return this.setXYZW(this.x/e,this.y/e,this.z/e,this.w/e)}negate(){return this.setXYZW(-this.x,-this.y,-this.z,-this.w)}normalize(){const e=this.magnitude;if(0===e)throw new Error("Cannot normalize a zero-magnitude vector");return this.divideScalar(e)}roundSymmetric(){return this.setXYZW(n.Z.roundSymmetric(this.x),n.Z.roundSymmetric(this.y),n.Z.roundSymmetric(this.z),n.Z.roundSymmetric(this.w))}freeToPool(){a.pool.freeToPool(this)}}s=a,_defineProperty(a,"pool",new A.Z(s,{maxSize:1e3,initialize:s.prototype.setXYZW,defaultArguments:[0,0,0,0]})),a.prototype.isVector4=!0,a.prototype.dimension=4,o.Z.register("Vector4",a);const h=a.pool.create.bind(a.pool);o.Z.register("v4",h);class l extends a{static mutableOverrideHelper(e){l.prototype[e]=()=>{throw new Error(`Cannot call mutable method '${e}' on immutable Vector3`)}}}l.mutableOverrideHelper("setXYZW"),l.mutableOverrideHelper("setX"),l.mutableOverrideHelper("setY"),l.mutableOverrideHelper("setZ"),l.mutableOverrideHelper("setW"),a.ZERO=new a(0,0,0,0),a.X_UNIT=new a(1,0,0,0),a.Y_UNIT=new a(0,1,0,0),a.Z_UNIT=new a(0,0,1,0),a.W_UNIT=new a(0,0,0,1)},7464:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});const s=new(i(2492).Z)("dot");s.register("FastArray",window.Float64Array?window.Float64Array:window.Array);const n=s},6918:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(7464);const n=new(i(7023).Z)({seed:_.hasIn(window,"phet.chipper.queryParameters.randomSeed")?window.phet.chipper.queryParameters.randomSeed:null});s.Z.register("dotRandom",n);const r=n},5870:(e,t,i)=>{"use strict";function s(e){return e.toFixed(20)}i.d(t,{Z:()=>n}),i(7464).Z.register("toSVGNumber",s);const n=s},7055:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(9119),n=i(9362);const r=(0,s.Z)("JOIST");n.Z.register("JoistStrings",r);const o=r},8588:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>d});var s=i(592),n=i(6114),r=i(6278),o=i(1005),A=i(2643),a=i(9362);const h=e=>{var t;if(!phet.chipper.localeData||null===(t=phet.chipper.strings)||void 0===t||!t.hasOwnProperty("en")||!e)return e;const i=(e=>{var t,i;const s=[e,...null!==(t=null===(i=phet.chipper.localeData[e])||void 0===i?void 0:i.fallbackLocales)&&void 0!==t?t:[],"en"].find(e=>!!phet.chipper.strings[e]);return s})((e=>{const t=e;if(e.length<5)e=e.toLowerCase();else{const t=(e=e.replace(/-/,"_")).split("_");2===t.length&&(e=t[0].toLowerCase()+"_"+t[1].toUpperCase())}if(3===e.length)for(const r of Object.keys(phet.chipper.localeData))if(phet.chipper.localeData[r].locale3===e){e=r;break}const i=/^[a-zA-Z]{2}$/,s=/^[a-zA-Z]{3}$/,n=/^[a-zA-Z]{2}[_-][a-zA-Z]{2}$/;if(!phet.chipper.localeData[e]){const r=t;!i.test(r)&&!s.test(r)&&n.test(r),e="en"}return e})(e));return phet.chipper.locale=i,i},l=_.sortBy(Object.keys(phet.chipper.strings),e=>n.Z.localeToLocalizedName(e).toLowerCase());class g extends s.Z{constructor(){super(...arguments),_defineProperty(this,"availableRuntimeLocales",l)}unguardedSet(e){super.unguardedSet(h(e))}toStateObject(){const e=super.toStateObject();return e.validValues=this.availableRuntimeLocales,e}applyState(e){e.validValues=null,super.applyState(e)}}const c=new g("en",{tandem:o.Z.GENERAL_MODEL.createTandem("localeProperty"),phetioFeatured:!0,phetioValueType:A.Z,phetioDocumentation:"Specifies language currently displayed in the simulation"});if(c.value=phet.chipper.locale,c.link(e=>{document.documentElement.lang=phet.chipper.localeData[e].bcp47}),phet.chipper.queryParameters.keyboardLocaleSwitcher){const e=r.ntP.KEY_I,t=r.ntP.KEY_U;r.MMl.keydownEmitter.addListener(i=>{const s=e=>{i.preventDefault();const t=(l.indexOf(c.value)+e+l.length)%l.length;c.value=l[t],console.log(c.value)};!i.ctrlKey||i.shiftKey||i.metaKey||i.altKey||(r.ntP.isKeyEvent(i,e)?s(1):r.ntP.isKeyEvent(i,t)&&s(-1))})}a.Z.register("localeProperty",c);const d=c},9362:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s=new(i(2492).Z)("joist")},8445:(e,t,i)=>{"use strict";var s,n,r,o,A,a,h,l,g,c;i.d(t,{wN:()=>de,EW:()=>He,tj:()=>We,Ll:()=>ge,kS:()=>be,R0:()=>tt,d:()=>Be,LR:()=>Ze,kJ:()=>ot,I3:()=>xe,$:()=>V,x1:()=>X,Ob:()=>M,rN:()=>Je,dC:()=>B,Ab:()=>se,Gz:()=>w,XX:()=>H,dA:()=>C,Io:()=>$e,bn:()=>Ge,zx:()=>Ee,Xz:()=>Ue,V0:()=>it,FK:()=>d,bd:()=>Y,Wu:()=>K});const d=new(i(2492).Z)("kite");var u=i(8964),m=i(831);const p=u.Z.lineLineIntersection,V={lineWidth:1,lineCap:"butt",lineJoin:"miter",lineDash:[],lineDashOffset:0,miterLimit:10};class M{constructor(e){const t=(0,m.Z)({},V,e);this.lineWidth=t.lineWidth,this.lineCap=t.lineCap,this.lineJoin=t.lineJoin,this.lineDash=t.lineDash,this.lineDashOffset=t.lineDashOffset,this.miterLimit=t.miterLimit}equals(e){if(!(this.lineWidth===e.lineWidth&&this.lineCap===e.lineCap&&this.lineJoin===e.lineJoin&&this.miterLimit===e.miterLimit&&this.lineDashOffset===e.lineDashOffset))return!1;if(this.lineDash.length!==e.lineDash.length)return!1;for(let t=0;t<this.lineDash.length;t++)if(this.lineDash[t]!==e.lineDash[t])return!1;return!0}copy(){return new M({lineWidth:this.lineWidth,lineCap:this.lineCap,lineJoin:this.lineJoin,lineDash:this.lineDash,lineDashOffset:this.lineDashOffset,miterLimit:this.miterLimit})}leftJoin(e,t,i){t=t.normalized(),i=i.normalized();const s=e.plus(t.perpendicular.negated().times(this.lineWidth/2)),n=e.plus(i.perpendicular.negated().times(this.lineWidth/2)),r=s.equals(n)?[]:[new X(s,n)];let o,A,a;if(!(t.perpendicular.dot(i)>1e-12))return r;switch(this.lineJoin){case"round":return o=t.angle+Math.PI/2,A=i.angle+Math.PI/2,[new de(e,this.lineWidth/2,o,A,!0)];case"miter":if(a=t.angleBetween(i.negated()),1/Math.sin(a/2)<=this.miterLimit&&a<Math.PI-1e-5){const e=p(s,s.plus(t),n,n.plus(i));return e?[new X(s,e),new X(e,n)]:[new X(s,n)]}return r;case"bevel":return r;default:throw new Error("invalid lineJoin: "+this.lineJoin)}}rightJoin(e,t,i){return this.leftJoin(e,i.negated(),t.negated())}cap(e,t){t=t.normalized();const i=e.plus(t.perpendicular.times(-this.lineWidth/2)),s=e.plus(t.perpendicular.times(this.lineWidth/2));let n,r,o,A,a,h;switch(this.lineCap){case"butt":return[new X(i,s)];case"round":return n=t.angle,[new de(e,this.lineWidth/2,n+Math.PI/2,n-Math.PI/2,!0)];case"square":return r=t.perpendicular.negated().times(this.lineWidth/2),o=t.perpendicular.times(this.lineWidth/2),A=t.times(this.lineWidth/2),a=e.plus(r).plus(A),h=e.plus(o).plus(A),[new X(i,a),new X(a,h),new X(h,s)];default:throw new Error("invalid lineCap: "+this.lineCap)}}}d.register("LineStyles",M);class B{constructor(e,t){this.a=e,this.b=t;let i=0,s=1,n=this.apply(i),r=this.apply(s);n>1&&(n=1,i=this.applyInverse(n)),n<0&&(n=0,i=this.applyInverse(n)),r>1&&(r=1,s=this.applyInverse(r)),r<0&&(r=0,s=this.applyInverse(r)),this.t0=i,this.t1=s,e>0?(this.qt0=n,this.qt1=r):(this.qt0=r,this.qt1=n),this.t0<0&&this.t0>-1e-8&&(this.t0=0),this.t0>1&&this.t0<1+1e-8&&(this.t0=1),this.t1<0&&this.t1>-1e-8&&(this.t1=0),this.t1>1&&this.t1<1+1e-8&&(this.t1=1),this.qt0<0&&this.qt0>-1e-8&&(this.qt0=0),this.qt0>1&&this.qt0<1+1e-8&&(this.qt0=1),this.qt1<0&&this.qt1>-1e-8&&(this.qt1=0),this.qt1>1&&this.qt1<1+1e-8&&(this.qt1=1)}apply(e){return this.a*e+this.b}applyInverse(e){return(e-this.b)/this.a}static createLinear(e,t,i,s){const n=(s-t)/(i-e);return new B(n,t-e*n)}}d.register("Overlap",B);class w{constructor(e,t,i,s,n){this.point=t,this.normal=i,this.distance=e,this.wind=s,this.t=u.Z.clamp(n,0,1)}}d.register("RayIntersection",w);class C{constructor(e,t,i){this.point=e,this.aT=u.Z.clamp(t,0,1),this.bT=u.Z.clamp(i,0,1)}getSwapped(){return new C(this.point,this.bT,this.aT)}}d.register("SegmentIntersection",C);const E=e=>e.toFixed(20);d.register("svgNumber",E);const Y=E;var D=i(1063),y=i(3286),I=i(668),q=i(7464);class G{constructor(e,t){this.real=e,this.imaginary=t}copy(e){return e?e.set(this):new G(this.real,this.imaginary)}phase(){return Math.atan2(this.imaginary,this.real)}getMagnitude(){return Math.sqrt(this.magnitudeSquared)}get magnitude(){return this.getMagnitude()}getMagnitudeSquared(){return this.real*this.real+this.imaginary*this.imaginary}get magnitudeSquared(){return this.getMagnitudeSquared()}getArgument(){return Math.atan2(this.imaginary,this.real)}get argument(){return this.getArgument()}equals(e){return this.real===e.real&&this.imaginary===e.imaginary}equalsEpsilon(e,t){return t||(t=0),Math.max(Math.abs(this.real-e.real),Math.abs(this.imaginary-e.imaginary))<=t}plus(e){return new G(this.real+e.real,this.imaginary+e.imaginary)}minus(e){return new G(this.real-e.real,this.imaginary-e.imaginary)}times(e){return new G(this.real*e.real-this.imaginary*e.imaginary,this.real*e.imaginary+this.imaginary*e.real)}dividedBy(e){const t=e.magnitudeSquared;return new G((this.real*e.real+this.imaginary*e.imaginary)/t,(this.imaginary*e.real-this.real*e.imaginary)/t)}negated(){return new G(-this.real,-this.imaginary)}sqrtOf(){const e=this.magnitude;return new G(Math.sqrt((e+this.real)/2),(this.imaginary>=0?1:-1)*Math.sqrt((e-this.real)/2))}powerByReal(e){const t=Math.pow(this.magnitude,e),i=e*this.phase();return new G(t*Math.cos(i),t*Math.sin(i))}sinOf(){return new G(Math.sin(this.real)*u.Z.cosh(this.imaginary),Math.cos(this.real)*u.Z.sinh(this.imaginary))}cosOf(){return new G(Math.cos(this.real)*u.Z.cosh(this.imaginary),-Math.sin(this.real)*u.Z.sinh(this.imaginary))}squared(){return this.times(this)}conjugated(){return new G(this.real,-this.imaginary)}exponentiated(){return G.createPolar(Math.exp(this.real),this.imaginary)}setRealImaginary(e,t){return this.real=e,this.imaginary=t,this}setReal(e){return this.real=e,this}setImaginary(e){return this.imaginary=e,this}set(e){return this.setRealImaginary(e.real,e.imaginary)}setPolar(e,t){return this.setRealImaginary(e*Math.cos(t),e*Math.sin(t))}add(e){return this.setRealImaginary(this.real+e.real,this.imaginary+e.imaginary)}subtract(e){return this.setRealImaginary(this.real-e.real,this.imaginary-e.imaginary)}multiply(e){return this.setRealImaginary(this.real*e.real-this.imaginary*e.imaginary,this.real*e.imaginary+this.imaginary*e.real)}divide(e){const t=e.magnitudeSquared;return this.setRealImaginary((this.real*e.real+this.imaginary*e.imaginary)/t,(this.imaginary*e.real-this.real*e.imaginary)/t)}negate(){return this.setRealImaginary(-this.real,-this.imaginary)}exponentiate(){return this.setPolar(Math.exp(this.real),this.imaginary)}square(){return this.multiply(this)}sqrt(){const e=this.magnitude;return this.setRealImaginary(Math.sqrt((e+this.real)/2),(this.imaginary>=0?1:-1)*Math.sqrt((e-this.real)/2))}sin(){return this.setRealImaginary(Math.sin(this.real)*u.Z.cosh(this.imaginary),Math.cos(this.real)*u.Z.sinh(this.imaginary))}cos(){return this.setRealImaginary(Math.cos(this.real)*u.Z.cosh(this.imaginary),-Math.sin(this.real)*u.Z.sinh(this.imaginary))}conjugate(){return this.setRealImaginary(this.real,-this.imaginary)}getCubeRoots(){const e=this.argument/3,t=this.magnitude,i=G.real(Math.cbrt(t));return[i.times(G.imaginary(e).exponentiate()),i.times(G.imaginary(e+2*Math.PI/3).exponentiate()),i.times(G.imaginary(e-2*Math.PI/3).exponentiate())]}toString(){return`Complex(${this.real}, ${this.imaginary})`}static real(e){return new G(e,0)}static imaginary(e){return new G(0,e)}static createPolar(e,t){return new G(e*Math.cos(t),e*Math.sin(t))}static solveLinearRoots(e,t){return e.equals(G.ZERO)?t.equals(G.ZERO)?null:[]:[t.dividedBy(e).negate()]}static solveQuadraticRoots(e,t,i){if(e.equals(G.ZERO))return G.solveLinearRoots(t,i);const s=G.real(2).multiply(e),n=t.times(t),r=G.real(4).multiply(e).multiply(i),o=n.subtract(r).sqrt();return[o.minus(t).divide(s),o.negated().subtract(t).divide(s)]}static solveCubicRoots(e,t,i,s){if(e.equals(G.ZERO))return G.solveQuadraticRoots(t,i,s);const n=e.times(G.real(3)).negate(),r=e.times(e),o=t.times(t),A=o.times(t),a=i.times(i),h=a.times(i),l=e.times(t).times(i),g=o,c=e.times(i).times(G.real(3)),d=A.times(G.real(2)).add(r.times(s).multiply(G.real(27))),u=l.times(G.real(9));if(g.equals(c)&&d.equals(u)){const e=t.divide(n);return[e,e,e]}const m=g.minus(c),p=d.minus(u),V=l.times(s).multiply(G.real(18)).add(o.times(a)),M=A.times(s).multiply(G.real(4)).add(h.times(e).multiply(G.real(4))).add(r.times(s).multiply(s).multiply(G.real(27)));if(V.equals(M)){const n=l.times(G.real(4)).subtract(A.plus(r.times(s).multiply(G.real(9)))).divide(e.times(m)),o=e.times(s).multiply(G.real(9)).subtract(t.times(i)).divide(m.times(G.real(2)));return[n,o,o]}let B;return B=g.equals(c)?p:p.plus(p.times(p).subtract(m.times(m).multiply(m).multiply(G.real(4))).sqrt()).divide(G.real(2)),B.getCubeRoots().map(e=>t.plus(e).add(m.dividedBy(e)).divide(n))}}q.Z.register("Complex",G),G.ZERO=new G(0,0),G.ONE=new G(1,0),G.I=G.imaginary(1);const Q=G;var S=i(7840),T=i(1319);const x=(e,t,i,s)=>e.times(s).minus(t.times(i)),k=e=>[e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]],F=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return _.sortBy([e.slice(0,3),e.slice(3,6),e.slice(6,9)],e=>-(e[0].magnitude+e[1].magnitude+(t?e[2].magnitude:0)))[0]},R=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return F(k(e),t)},U=e=>{const t=(e=>{const t=e[0],i=e[1],s=e[2],n=e[3],r=e[4],o=e[5],A=e[6],a=e[7],h=e[8];return[x(r,o,a,h),x(i,s,a,h).negate(),x(i,s,r,o),x(n,o,A,h).negate(),x(t,s,A,h),x(t,s,n,o).negate(),x(n,r,A,a),x(t,i,A,a).negate(),x(t,i,n,r)]})(e),i=F(t);return[Q.ZERO,i[2],i[1].negated(),i[2].negated(),Q.ZERO,i[0],i[1],i[0].negated(),Q.ZERO]},L=e=>{const t=U(e),i=((e,t)=>{const i=e[0],s=e[1],n=e[3],r=e[4],o=t[0],A=t[1],a=t[3],h=t[4],l=A.times(a).minus(o.times(h)),g=h.negated().times(i).plus(a.times(s)).plus(A.times(n)).minus(o.times(r)),c=s.times(n).minus(i.times(r)),d=Q.solveQuadraticRoots(l,g,c);return null===d?null:d[0]})(e,t);return null===i?e:[e[0].plus(i.times(t[0])),e[1].plus(i.times(t[1])),e[2].plus(i.times(t[2])),e[3].plus(i.times(t[3])),e[4].plus(i.times(t[4])),e[5].plus(i.times(t[5])),e[6].plus(i.times(t[6])),e[7].plus(i.times(t[7])),e[8].plus(i.times(t[8]))]},P=e=>{const t=[],i=e[0],s=e[1].times(Q.real(2)),n=e[4],r=e[2].times(Q.real(2)),o=e[5].times(Q.real(2)),A=e[8];let a=[];const h=new Q(-2.51653525696959,1.5292850284402),l=n,g=s.times(h).plus(o),c=i.times(h).times(h).plus(r.times(h)).plus(A),d=Q.solveQuadraticRoots(l,g,c);if(d&&d.length>=2)a=[[h,d[0]],[h,d[1]]];else{const e=i,t=s.times(h).plus(r),l=n.times(h).times(h).plus(o.times(h)).plus(A),g=Q.solveQuadraticRoots(e,t,l);if(g&&g.length>=2)a=[[g[0],h],[g[1],h]];else if(d&&1===d.length)a=[[h,d[0]]];else{if(!g||1!==g.length)throw new Error("Implement more advanced initialization to find two solutions");a=[[g[0],h]]}}return a.forEach(e=>{const A=e[0].real,a=e[1].real,h=e[0].imaginary,l=e[1].imaginary,g=i.real,c=s.real,d=n.real,u=r.real,m=o.real,p=i.imaginary,V=s.imaginary,M=n.imaginary,B=r.imaginary,w=o.imaginary,C=new T.Z(-2*p*h-V*l+u+2*g*A+c*a,-V*h-2*M*l+m+c*A+2*d*a,-B-2*h*g-l*c-2*p*A-V*a,-w-h*c-2*l*d-V*A-2*M*a),E=new T.Z(B+2*h*g+l*c+2*p*A+V*a,w+h*c+2*l*d+V*A+2*M*a,-2*p*h-V*l+u+2*g*A+c*a,-V*h-2*M*l+m+c*A+2*d*a),Y=new T.Z(6.1951068548253,-1.159268950386,.1602918829294,3.205818692048202),q=new T.Z(-5.420628549296924,-15.2069583028685,.159590602048868,5.10688288040682),G=(e,t)=>t.timesScalar(e.dot(t)/t.dot(t)),Q=C,x=E.minus(G(E,Q)),k=Y.minus(G(Y,Q)).minus(G(Y,x)),F=q.minus(G(q,Q)).minus(G(q,x)).minus(G(q,k)),R=new y.Z(2,2,[k.z,F.z,k.w,F.w]),U=new D.Z(R).getSingularValues();let L=null;if(Math.abs(h)<1e-10&&Math.abs(l)<1e-10)L=new I.Z(A,a);else{if(Math.abs(U[1])>1e-10){const e=R.solve(new y.Z(2,1,[-h,-l])).extractVector2(0);L=new I.Z(A+e.x*k.z+e.y*F.z,a+e.x*k.w+e.y*F.w)}else if(Math.abs(U[0])>1e-10){const e=Math.abs(k.z)+Math.abs(k.w)>Math.abs(F.z)+Math.abs(F.w)?k:F,t=new I.Z(e.z,e.w),i=new I.Z(h,l).dot(t)/t.dot(t),s=new T.Z(A,a,h,l).minus(e.timesScalar(i));Math.abs(s.z)<1e-8&&Math.abs(s.w)<1e-8&&(L=new I.Z(s.x,s.y))}else L=null;if(L)if(Math.abs(U[1])>1e-10)t.push(L);else if(Math.abs(U[0])>1e-10){const e=Math.abs(k.z)+Math.abs(k.w)>Math.abs(F.z)+Math.abs(F.w),i=e?F:k,s=e?k:F,n=Math.abs(s.z)>Math.abs(s.w)?i.z/s.z:i.w/s.w,r=s.timesScalar(n).minus(i);t.push(new S.Z(L,new I.Z(r.x,r.y).normalized()))}}}),t},b=e=>{const t=L(e);return[F(t),R(t)]},O=(e,t)=>{const i=e[0],s=e[1],n=e[2],r=t[0],o=t[1],A=t[2],a=r.times(s).minus(i.times(o));if(a.equalsEpsilon(Q.ZERO,1e-8))return null;{const e=o.times(n).minus(s.times(A)).dividedBy(a);let t;if(s.equalsEpsilon(Q.ZERO,1e-8)){if(o.equalsEpsilon(Q.ZERO,1e-8))return null;t=r.negated().times(e).minus(A).dividedBy(o)}else t=i.negated().times(e).minus(n).dividedBy(s);return Math.abs(e.imaginary)<1e-8&&Math.abs(t.imaginary)<1e-8?new I.Z(e.real,t.real):null}},f=(e,t)=>{const i=e.m00(),s=e.m01(),n=e.m02(),r=e.m10(),o=e.m11(),A=e.m12(),a=e.m20(),h=e.m21(),l=e.m22(),g=t.m00(),c=t.m01(),d=t.m02(),u=t.m10(),m=t.m11(),p=t.m12(),V=t.m20(),M=t.m21(),B=t.m22(),w=-n*o*a+s*A*a+n*r*h-i*A*h-s*r*l+i*o*l,C=-r*l*c+r*h*d+n*h*u-s*l*u-n*a*m+i*l*m+s*a*p-i*h*p+n*r*M+A*(-h*g+a*c+s*V-i*M)-s*r*B+o*(l*g-a*d-n*V+i*B),E=-l*c*u+h*d*u+l*g*m-a*d*m-h*g*p+a*c*p+A*c*V-o*d*V-n*m*V+s*p*V-A*g*M+r*d*M+n*u*M-i*p*M+o*g*B-r*c*B-s*u*B+i*m*B,Y=-d*m*V+c*p*V+d*u*M-g*p*M-c*u*B+g*m*B,D=Q.solveCubicRoots(Q.real(w),Q.real(C),Q.real(E),Q.real(Y));if(!D||0===D.length)return{degenerateConicMatrices:[],intersectionCollections:[],points:[],lines:[]};const y=_.uniqWith(D,(e,t)=>e.equals(t)).map(e=>[Q.real(i).multiply(e).add(Q.real(g)),Q.real(s).multiply(e).add(Q.real(c)),Q.real(n).multiply(e).add(Q.real(d)),Q.real(r).multiply(e).add(Q.real(u)),Q.real(o).multiply(e).add(Q.real(m)),Q.real(A).multiply(e).add(Q.real(p)),Q.real(a).multiply(e).add(Q.real(V)),Q.real(h).multiply(e).add(Q.real(M)),Q.real(l).multiply(e).add(Q.real(B))]);console.log("determinant magnitudes",y.map(e=>(e=>{const t=e[0],i=e[1],s=e[2],n=e[3],r=e[4],o=e[5],A=e[6],a=e[7],h=e[8];return t.times(r).times(h).plus(i.times(o).times(A)).plus(s.times(n).times(a)).minus(s.times(r).times(A)).minus(i.times(n).times(h)).minus(t.times(o).times(a))})(e).magnitude));const I=[],q=y.map(b);console.log(q);const G=y.map(P);console.log(G);for(let Q=0;Q<q.length;Q++){const e=q[Q],t=O(e[0],e[1]);t&&I.push(t);for(let i=Q+1;i<q.length;i++){const t=q[i],s=[O(e[0],t[0]),O(e[0],t[1]),O(e[1],t[0]),O(e[1],t[1])];for(let e=0;e<4;e++){const t=s[e];t&&I.push(t)}}}return{points:I,degenerateConicMatrices:y,lines:_.flatten(q),intersectionCollections:G}};function Z(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}d.register("intersectConicMatrices",f);const N={parse:function(e,t){const i={svgPath:function(){let e,t,i,n,r,o;r=s,o=s,e=[],t=v();for(;null!==t;)e.push(t),t=v();if(null!==e)if(t=A(),t=null!==t?t:"",null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?e=[e,t,i]:(e=null,s=o)}else e=null,s=o;else e=null,s=o;null!==e&&(a=e[1],e=a||[]);var a;null===e&&(s=r);return e},movetoDrawtoCommandGroups:A,movetoDrawtoCommandGroup:a,drawtoCommands:h,drawtoCommand:l,moveto:g,movetoArgumentSequence:c,closepath:d,lineto:u,linetoArgumentSequence:m,horizontalLineto:p,horizontalLinetoArgumentSequence:V,verticalLineto:M,verticalLinetoArgumentSequence:B,curveto:w,curvetoArgumentSequence:C,curvetoArgument:E,smoothCurveto:Y,smoothCurvetoArgumentSequence:D,smoothCurvetoArgument:y,quadraticBezierCurveto:I,quadraticBezierCurvetoArgumentSequence:q,quadraticBezierCurvetoArgument:G,smoothQuadraticBezierCurveto:Q,smoothQuadraticBezierCurvetoArgumentSequence:S,ellipticalArc:T,ellipticalArcArgumentSequence:x,ellipticalArcArgument:k,coordinatePair:F,nonnegativeNumber:R,number:U,flag:L,commaWsp:P,comma:b,floatingPointConstant:O,fractionalConstant:f,exponent:N,sign:K,digitSequence:J,digit:j,wsp:v};if(void 0!==t){if(void 0===i[t])throw new Error("Invalid rule name: "+Z(t)+".")}else t="svgPath";let s=0;let n=0,r=[];function o(e){s<n||(s>n&&(n=s,r=[]),r.push(e))}function A(){let e,t,i,n,r;if(n=s,r=s,e=a(),null!==e){for(t=[],i=v();null!==i;)t.push(i),i=v();null!==t?(i=A(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)}else e=null,s=r;var o,h;return null!==e&&(o=e[0],h=e[2],e=o.concat(h)),null===e&&(s=n),null===e&&(n=s,e=a(),null!==e&&(e=function(e,t){return t}(0,e)),null===e&&(s=n)),e}function a(){let e,t,i,n,r;if(n=s,r=s,e=g(),null!==e){for(t=[],i=v();null!==i;)t.push(i),i=v();null!==t?(i=h(),i=null!==i?i:"",null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)}else e=null,s=r;var o,A;return null!==e&&(o=e[0],e=(A=e[2]).length?o.concat(A):o),null===e&&(s=n),e}function h(){let e,t,i,n,r;if(n=s,r=s,e=l(),null!==e){for(t=[],i=v();null!==i;)t.push(i),i=v();null!==t?(i=h(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)}else e=null,s=r;var o,A;return null!==e&&(o=e[0],A=e[2],e=o.concat(A)),null===e&&(s=n),null===e&&(n=s,e=l(),null!==e&&(e=function(e,t){return t}(0,e)),null===e&&(s=n)),e}function l(){let e;return e=d(),null===e&&(e=u(),null===e&&(e=p(),null===e&&(e=M(),null===e&&(e=w(),null===e&&(e=Y(),null===e&&(e=I(),null===e&&(e=Q(),null===e&&(e=T())))))))),e}function g(){let t,i,n,r,A;if(r=s,A=s,77===e.charCodeAt(s)?(t="M",s++):(t=null,o('"M"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=c(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=H(t[2],!1)),null===t&&(s=r),null===t){if(r=s,A=s,109===e.charCodeAt(s)?(t="m",s++):(t=null,o('"m"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=c(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return H(t,!0)}(0,t[2])),null===t&&(s=r)}return t}function c(){let e,t,i,n,r;var o,A;return n=s,r=s,e=F(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=m(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=F(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function d(){let t,i;return i=s,90===e.charCodeAt(s)?(t="Z",s++):(t=null,o('"Z"')),null===t&&(122===e.charCodeAt(s)?(t="z",s++):(t=null,o('"z"'))),null!==t&&(t={cmd:"close"}),null===t&&(s=i),t}function u(){let t,i,n,r,A;if(r=s,A=s,76===e.charCodeAt(s)?(t="L",s++):(t=null,o('"L"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=m(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>({cmd:"lineTo",args:[e.x,e.y]}))),null===t&&(s=r),null===t){if(r=s,A=s,108===e.charCodeAt(s)?(t="l",s++):(t=null,o('"l"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=m(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>({cmd:"lineToRelative",args:[e.x,e.y]}))}(0,t[2])),null===t&&(s=r)}return t}function m(){let e,t,i,n,r;var o,A;return n=s,r=s,e=F(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=m(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=F(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function p(){let t,i,n,r,A;if(r=s,A=s,72===e.charCodeAt(s)?(t="H",s++):(t=null,o('"H"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=V(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>({cmd:"horizontalLineTo",args:[e]}))),null===t&&(s=r),null===t){if(r=s,A=s,104===e.charCodeAt(s)?(t="h",s++):(t=null,o('"h"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=V(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>({cmd:"horizontalLineToRelative",args:[e]}))}(0,t[2])),null===t&&(s=r)}return t}function V(){let e,t,i,n,r;var o,A;return n=s,r=s,e=U(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=V(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=U(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function M(){let t,i,n,r,A;if(r=s,A=s,86===e.charCodeAt(s)?(t="V",s++):(t=null,o('"V"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=B(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>({cmd:"verticalLineTo",args:[e]}))),null===t&&(s=r),null===t){if(r=s,A=s,118===e.charCodeAt(s)?(t="v",s++):(t=null,o('"v"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=B(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>({cmd:"verticalLineToRelative",args:[e]}))}(0,t[2])),null===t&&(s=r)}return t}function B(){let e,t,i,n,r;var o,A;return n=s,r=s,e=U(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=B(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=U(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function w(){let t,i,n,r,A;if(r=s,A=s,67===e.charCodeAt(s)?(t="C",s++):(t=null,o('"C"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=C(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>({cmd:"cubicCurveTo",args:e}))),null===t&&(s=r),null===t){if(r=s,A=s,99===e.charCodeAt(s)?(t="c",s++):(t=null,o('"c"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=C(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>({cmd:"cubicCurveToRelative",args:e}))}(0,t[2])),null===t&&(s=r)}return t}function C(){let e,t,i,n,r;var o,A;return n=s,r=s,e=E(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=C(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=E(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function E(){let e,t,i,n,r,o,A;var a,h,l;return o=s,A=s,e=F(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=F(),null!==i?(n=P(),n=null!==n?n:"",null!==n?(r=F(),null!==r?e=[e,t,i,n,r]:(e=null,s=A)):(e=null,s=A)):(e=null,s=A)):(e=null,s=A)):(e=null,s=A),null!==e&&(a=e[0],h=e[2],l=e[4],e=[a.x,a.y,h.x,h.y,l.x,l.y]),null===e&&(s=o),e}function Y(){let t,i,n,r,A;if(r=s,A=s,83===e.charCodeAt(s)?(t="S",s++):(t=null,o('"S"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=D(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>({cmd:"smoothCubicCurveTo",args:e}))),null===t&&(s=r),null===t){if(r=s,A=s,115===e.charCodeAt(s)?(t="s",s++):(t=null,o('"s"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=D(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>({cmd:"smoothCubicCurveToRelative",args:e}))}(0,t[2])),null===t&&(s=r)}return t}function D(){let e,t,i,n,r;var o,A;return n=s,r=s,e=y(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=D(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=y(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function y(){let e,t,i,n,r;var o,A;return n=s,r=s,e=F(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=F(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o.x,o.y,A.x,A.y]),null===e&&(s=n),e}function I(){let t,i,n,r,A;if(r=s,A=s,81===e.charCodeAt(s)?(t="Q",s++):(t=null,o('"Q"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=q(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>({cmd:"quadraticCurveTo",args:e}))),null===t&&(s=r),null===t){if(r=s,A=s,113===e.charCodeAt(s)?(t="q",s++):(t=null,o('"q"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=q(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>({cmd:"quadraticCurveToRelative",args:e}))}(0,t[2])),null===t&&(s=r)}return t}function q(){let e,t,i,n,r;var o,A;return n=s,r=s,e=G(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=q(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=G(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function G(){let e,t,i,n,r;var o,A;return n=s,r=s,e=F(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=F(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o.x,o.y,A.x,A.y]),null===e&&(s=n),e}function Q(){let t,i,n,r,A;if(r=s,A=s,84===e.charCodeAt(s)?(t="T",s++):(t=null,o('"T"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=S(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>({cmd:"smoothQuadraticCurveTo",args:[e.x,e.y]}))),null===t&&(s=r),null===t){if(r=s,A=s,116===e.charCodeAt(s)?(t="t",s++):(t=null,o('"t"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=S(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>({cmd:"smoothQuadraticCurveToRelative",args:[e.x,e.y]}))}(0,t[2])),null===t&&(s=r)}return t}function S(){let e,t,i,n,r;var o,A;return n=s,r=s,e=F(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=S(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=F(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function T(){let t,i,n,r,A;if(r=s,A=s,65===e.charCodeAt(s)?(t="A",s++):(t=null,o('"A"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=x(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;if(null!==t&&(t=t[2].map(e=>(e[2]*=Math.PI/180,{cmd:"ellipticalArcTo",args:e}))),null===t&&(s=r),null===t){if(r=s,A=s,97===e.charCodeAt(s)?(t="a",s++):(t=null,o('"a"')),null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?(n=x(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)}else t=null,s=A;null!==t&&(t=function(e,t){return t.map(e=>(e[2]*=Math.PI/180,{cmd:"ellipticalArcToRelative",args:e}))}(0,t[2])),null===t&&(s=r)}return t}function x(){let e,t,i,n,r;var o,A;return n=s,r=s,e=k(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=x(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e=[o].concat(A)),null===e&&(s=n),null===e&&(n=s,e=k(),null!==e&&(e=function(e,t){return[t]}(0,e)),null===e&&(s=n)),e}function k(){let e,t,i,n,r,o,A,a,h,l,g,c,d;var u,m,p,V,M,B;return c=s,d=s,e=R(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=R(),null!==i?(n=P(),n=null!==n?n:"",null!==n?(r=U(),null!==r?(o=P(),null!==o?(A=L(),null!==A?(a=P(),a=null!==a?a:"",null!==a?(h=L(),null!==h?(l=P(),l=null!==l?l:"",null!==l?(g=F(),null!==g?e=[e,t,i,n,r,o,A,a,h,l,g]:(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d)):(e=null,s=d),null!==e&&(u=e[0],m=e[2],p=e[4],V=e[6],M=e[8],B=e[10],e=[u,m,p,V,M,B.x,B.y]),null===e&&(s=c),e}function F(){let e,t,i,n,r;var o,A;return n=s,r=s,e=U(),null!==e?(t=P(),t=null!==t?t:"",null!==t?(i=U(),null!==i?e=[e,t,i]:(e=null,s=r)):(e=null,s=r)):(e=null,s=r),null!==e&&(o=e[0],A=e[2],e={x:o,y:A}),null===e&&(s=n),e}function R(){let e,t;return t=s,e=O(),null!==e&&(e=parseFloat(e)),null===e&&(s=t),null===e&&(t=s,e=J(),null!==e&&(e=function(e,t){return Number(t)}(0,e)),null===e&&(s=t)),e}function U(){let e,t,i,n;var r,o;return i=s,n=s,e=K(),e=null!==e?e:"",null!==e?(t=O(),null!==t?e=[e,t]:(e=null,s=n)):(e=null,s=n),null!==e&&(r=e[0],o=e[1],e=parseFloat(r+o)),null===e&&(s=i),null===e&&(i=s,n=s,e=K(),e=null!==e?e:"",null!==e?(t=J(),null!==t?e=[e,t]:(e=null,s=n)):(e=null,s=n),null!==e&&(e=function(e,t,i){return Number(t+i)}(0,e[0],e[1])),null===e&&(s=i)),e}function L(){let t,i;return i=s,48===e.charCodeAt(s)?(t="0",s++):(t=null,o('"0"')),null!==t&&(t=!1),null===t&&(s=i),null===t&&(i=s,49===e.charCodeAt(s)?(t="1",s++):(t=null,o('"1"')),null!==t&&(t=!0),null===t&&(s=i)),t}function P(){let e,t,i,n,r;if(r=s,t=v(),null!==t)for(e=[];null!==t;)e.push(t),t=v();else e=null;if(null!==e)if(t=b(),t=null!==t?t:"",null!==t){for(i=[],n=v();null!==n;)i.push(n),n=v();null!==i?e=[e,t,i]:(e=null,s=r)}else e=null,s=r;else e=null,s=r;if(null===e)if(r=s,e=b(),null!==e){for(t=[],i=v();null!==i;)t.push(i),i=v();null!==t?e=[e,t]:(e=null,s=r)}else e=null,s=r;return e}function b(){let t;return 44===e.charCodeAt(s)?(t=",",s++):(t=null,o('","')),t}function O(){let e,t,i,n;var r,o;return i=s,n=s,e=f(),null!==e?(t=N(),t=null!==t?t:"",null!==t?e=[e,t]:(e=null,s=n)):(e=null,s=n),null!==e&&(r=e[0],o=e[1],e=r+o),null===e&&(s=i),null===e&&(i=s,n=s,e=J(),null!==e?(t=N(),null!==t?e=[e,t]:(e=null,s=n)):(e=null,s=n),null!==e&&(e=function(e,t,i){return t+i}(0,e[0],e[1])),null===e&&(s=i)),e}function f(){let t,i,n,r,A;var a,h;return r=s,A=s,t=J(),t=null!==t?t:"",null!==t?(46===e.charCodeAt(s)?(i=".",s++):(i=null,o('"."')),null!==i?(n=J(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)):(t=null,s=A),null!==t&&(a=t[0],h=t[2],t=a+"."+h),null===t&&(s=r),null===t&&(r=s,A=s,t=J(),null!==t?(46===e.charCodeAt(s)?(i=".",s++):(i=null,o('"."')),null!==i?t=[t,i]:(t=null,s=A)):(t=null,s=A),null!==t&&(t=function(e,t){return t}(0,t[0])),null===t&&(s=r)),t}function N(){let t,i,n,r,A;var a,h,l;return r=s,A=s,101===e.charCodeAt(s)?(t="e",s++):(t=null,o('"e"')),null===t&&(69===e.charCodeAt(s)?(t="E",s++):(t=null,o('"E"'))),null!==t?(i=K(),i=null!==i?i:"",null!==i?(n=J(),null!==n?t=[t,i,n]:(t=null,s=A)):(t=null,s=A)):(t=null,s=A),null!==t&&(a=t[0],h=t[1],l=t[2],t=a+h+l),null===t&&(s=r),t}function K(){let t;return 43===e.charCodeAt(s)?(t="+",s++):(t=null,o('"+"')),null===t&&(45===e.charCodeAt(s)?(t="-",s++):(t=null,o('"-"'))),t}function J(){let e,t,i,n;var r,o;return i=s,n=s,e=j(),null!==e?(t=J(),null!==t?e=[e,t]:(e=null,s=n)):(e=null,s=n),null!==e&&(r=e[0],o=e[1],e=r+o),null===e&&(s=i),null===e&&(e=j()),e}function j(){let t;return/^[0-9]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,o("[0-9]")),t}function v(){let t;return 32===e.charCodeAt(s)?(t=" ",s++):(t=null,o('" "')),null===t&&(9===e.charCodeAt(s)?(t="\t",s++):(t=null,o('"\\t"')),null===t&&(13===e.charCodeAt(s)?(t="\r",s++):(t=null,o('"\\r"')),null===t&&(10===e.charCodeAt(s)?(t="\n",s++):(t=null,o('"\\n"'))))),t}function H(e,t){const i=[{cmd:t?"moveToRelative":"moveTo",args:[e[0].x,e[0].y]}];if(e.length>1)for(let s=1;s<e.length;s++)i.push({cmd:t?"lineToRelative":"lineTo",args:[e[s].x,e[s].y]});return i}const W=i[t]();if(null===W||s!==e.length){const t=Math.max(s,n),i=t<e.length?e.charAt(t):null,o=function(){let t=1,i=1,r=!1;for(let o=0;o<Math.max(s,n);o++){const s=e.charAt(o);"\n"===s?(r||t++,i=1,r=!1):"\r"===s||"\u2028"===s||"\u2029"===s?(t++,i=1,r=!0):(i++,r=!1)}return{line:t,column:i}}();throw new this.SyntaxError(function(e){e.sort();let t=null;const i=[];for(let s=0;s<e.length;s++)e[s]!==t&&(i.push(e[s]),t=e[s]);return i}(r),i,t,o.line,o.column)}return W},toSource:function(){return this._source},SyntaxError:function(e,t,i,s,n){this.name="SyntaxError",this.expected=e,this.found=t,this.message=function(e,t){let i,s;switch(e.length){case 0:i="end of input";break;case 1:i=e[0];break;default:i=e.slice(0,e.length-1).join(", ")+" or "+e[e.length-1]}return s=t?Z(t):"end of input","Expected "+i+" but "+s+" found."}(e,t),this.offset=i,this.line=s,this.column=n}};N.SyntaxError.prototype=Error.prototype,d.register("svgPath",N);const K=d.svgPath;var J=i(1685),j=i(1603),v=i(2550);class H{constructor(){this.invalidationEmitter=new J.Z}areStrokedBoundsDilated(){return Math.abs(this.startTangent.x*this.startTangent.y)<1e-7&&Math.abs(this.endTangent.x*this.endTangent.y)<1e-7}getBoundsWithTransform(e){return this.transformed(e).getBounds()}slice(e,t){let i=this;return t<1&&(i=i.subdivided(t)[0]),e>0&&(i=i.subdivided(u.Z.linear(0,t,0,1,e))[1]),i}subdivisions(e){let t=this;const i=[];for(let s=0;s<e.length;s++){const n=e[s],r=t.subdivided(n);i.push(r[0]),t=r[1];for(let t=s+1;t<e.length;t++)e[t]=u.Z.linear(n,1,0,1,e[t])}return i.push(t),i}subdividedIntoMonotone(){return this.subdivisions(this.getInteriorExtremaTs())}isSufficientlyFlat(e,t){const i=this.start,s=this.positionAt(.5),n=this.end;return H.isSufficientlyFlat(e,t,i,s,n)}getArcLength(e,t,i){if(e=void 0===e?1e-10:e,t=void 0===t?1e-8:t,(i=void 0===i?15:i)<=0||this.isSufficientlyFlat(e,t))return this.start.distance(this.end);{const s=this.subdivided(.5);return s[0].getArcLength(e,t,i-1)+s[1].getArcLength(e,t,i-1)}}getDashValues(e,t,i,s){const n=this,r=[];let o=0;const A=_.sum(e);(t%=A)<0&&(t+=A);let a=0,h=0,l=!0;function g(){a=(a+1)%e.length,l=!l}for(;t>0;)t>=e[a]?(t-=e[a],g()):(h=t,t=0);const c=l;return function t(A,l,c,d,m){const p=(A+l)/2,V=n.positionAt(p);if(m>14||H.isSufficientlyFlat(i,s,c,V,d)){const t=c.distance(V)+V.distance(d);o+=t;let i=t;for(;h+i>=e[a];){const s=u.Z.linear(0,t,A,l,t-i+e[a]-h);r.push(s),i-=e[a]-h,h=0,g()}h+=i}else t(A,p,c,V,m+1),t(p,l,V,d,m+1)}(0,1,this.start,this.end,0),{values:r,arcLength:o,initiallyInside:c}}toPiecewiseLinearSegments(e,t,i,s,n,r){t=void 0===t?e.minLevels:t,i=void 0===i?e.maxLevels:i,s=s||[];const o=e.pointMap||_.identity;n=n||o(this.start),r=r||o(this.end);const A=o(this.positionAt(.5));let a=0===i;if(!a&&t<=0&&(a=this.isSufficientlyFlat(null===e.distanceEpsilon||void 0===e.distanceEpsilon?Number.POSITIVE_INFINITY:e.distanceEpsilon,null===e.curveEpsilon||void 0===e.curveEpsilon?Number.POSITIVE_INFINITY:e.curveEpsilon)),a)s.push(new X(n,r));else{const o=this.subdivided(.5);o[0].toPiecewiseLinearSegments(e,t-1,i-1,s,n,A),o[1].toPiecewiseLinearSegments(e,t-1,i-1,s,A,r)}return s}toPiecewiseLinearOrArcSegments(e){const t=(0,v.ZP)()({minLevels:2,maxLevels:7,curvatureThreshold:.02,errorThreshold:10,errorPoints:[.25,.75]},e),i=[];return this.toPiecewiseLinearOrArcRecursion(t,t.minLevels,t.maxLevels,i,0,1,this.positionAt(0),this.positionAt(1),this.curvatureAt(0),this.curvatureAt(1)),i}toPiecewiseLinearOrArcRecursion(e,t,i,s,n,r,o,A,a,h){const l=(n+r)/2,g=this.positionAt(l),c=this.curvatureAt(l);if(i<=0||t<=0&&Math.abs(a-c)+Math.abs(c-h)<2*e.curvatureThreshold){const t=de.createFromPoints(o,g,A);let i=!1;if(t instanceof de){const s=t.radius*t.radius;for(let o=0;o<e.errorPoints.length;o++){const A=e.errorPoints[o],a=this.positionAt(n*(1-A)+r*A);if(Math.abs(a.distanceSquared(t.center)-s)>e.errorThreshold){i=!0;break}}}if(!i)return void s.push(t)}this.toPiecewiseLinearOrArcRecursion(e,t-1,i-1,s,n,l,o,g,a,c),this.toPiecewiseLinearOrArcRecursion(e,t-1,i-1,s,l,r,g,A,c,h)}toShape(){return new Ge([new Ee([this])])}getClosestPoints(e){return H.closestToPoint([this],e,1e-7)}static closestToPoint(e,t,i){const s=i*i;let n=[],r=[],o=Number.POSITIVE_INFINITY,A=!1;for(_.each(e,e=>{if(e instanceof X){const i=e.explicitClosestToPoint(t);_.each(i,e=>{e.distanceSquared<o?(r=[e],o=e.distanceSquared):e.distanceSquared===o&&r.push(e)})}else{const i=[0].concat(e.getInteriorExtremaTs()).concat([1]);for(let s=0;s<i.length-1;s++){const A=i[s],a=i[s+1],h=e.positionAt(A),l=e.positionAt(a),g=j.Z.point(h).addPoint(l),c=g.minimumDistanceToPointSquared(t);if(c<=o){const i=g.maximumDistanceToPointSquared(t);i<o&&(o=i,r=[]),n.push({ta:A,tb:a,pa:h,pb:l,segment:e,bounds:g,min:c,max:i})}}}});n.length&&!A;){const e=n;n=[],A=!0;for(const i of e){if(i.min>o)continue;A&&i.pa.distanceSquared(i.pb)>s&&(A=!1);const e=(i.ta+i.tb)/2,a=i.segment.positionAt(e),h=j.Z.point(i.pa).addPoint(a),l=j.Z.point(i.pb).addPoint(a),g=h.minimumDistanceToPointSquared(t),c=l.minimumDistanceToPointSquared(t);if(g<=o){const s=h.maximumDistanceToPointSquared(t);s<o&&(o=s,r=[]),n.push({ta:i.ta,tb:e,pa:i.pa,pb:a,segment:i.segment,bounds:h,min:g,max:s})}if(c<=o){const s=l.maximumDistanceToPointSquared(t);s<o&&(o=s,r=[]),n.push({ta:e,tb:i.tb,pa:a,pb:i.pb,segment:i.segment,bounds:l,min:c,max:s})}}}return _.each(n,e=>{const i=(e.ta+e.tb)/2,s=e.segment.positionAt(i);r.push({segment:e.segment,t:i,closestPoint:s,distanceSquared:t.distanceSquared(s)})}),r}static polynomialGetOverlapCubic(e,t,i,s,n,r,o,A){if(0===A)return H.polynomialGetOverlapQuadratic(e,t,i,n,r,o);const a=Math.sign(s/A)*Math.pow(Math.abs(s/A),1/3);return 0===a?null:{a:a,b:(i-a*a*o)/(3*a*a*A)}}static polynomialGetOverlapQuadratic(e,t,i,s,n,r){if(0===r)return H.polynomialGetOverlapLinear(e,t,s,n);if(i/r<0)return null;const o=Math.sqrt(i/r);return 0===o?null:{a:o,b:(t-o*n)/(2*o*r)}}static polynomialGetOverlapLinear(e,t,i,s){if(0===s)return e===i||null;const n=t/s;return 0===n?null:{a:n,b:(e-i)/s}}static intersect(e,t){if(X&&e instanceof X&&t instanceof X)return X.intersect(e,t);if(X&&e instanceof X)return X.intersectOther(e,t);if(X&&t instanceof X)return X.intersectOther(t,e).map(W);if(de&&e instanceof de&&t instanceof de)return de.intersect(e,t);if(Be&&e instanceof Be&&t instanceof Be)return Be.intersect(e,t);if(se&&ge&&(e instanceof se||e instanceof ge)&&(t instanceof se||t instanceof ge)){const i=e instanceof ge?e:e.degreeElevated(),s=t instanceof ge?t:t.degreeElevated(),n=new paper.Curve(i.start.x,i.start.y,i.control1.x,i.control1.y,i.control2.x,i.control2.y,i.end.x,i.end.y),r=new paper.Curve(s.start.x,s.start.y,s.control1.x,s.control1.y,s.control2.x,s.control2.y,s.end.x,s.end.y);return n.getIntersections(r).map(e=>{const t=new I.Z(e.point.x,e.point.y);return new C(t,e.time,e.intersection.time)})}return We.intersect(e,t)}static deserialize(e){return d[e.type].deserialize(e)}static isSufficientlyFlat(e,t,i,s,n){return!(u.Z.distToSegmentSquared(s,i,n)/i.distanceSquared(n)>t)&&!(u.Z.distToSegmentSquared(s,i,n)>e)}static filterClosestToPointResult(e){if(0===e.length)return[];const t=_.minBy(e,e=>e.distanceSquared).distanceSquared;return _.uniqWith(e.filter(e=>Math.abs(e.distanceSquared-t)<1e-11),(e,t)=>e.closestPoint.distanceSquared(t.closestPoint)<1e-11)}}function W(e){return e.getSwapped()}d.register("Segment",H);const z=new I.Z(0,0);class X extends H{constructor(e,t){super(),this._start=e,this._end=t,this.invalidate()}setStart(e){return this._start.equals(e)||(this._start=e,this.invalidate()),this}set start(e){this.setStart(e)}get start(){return this.getStart()}getStart(){return this._start}setEnd(e){return this._end.equals(e)||(this._end=e,this.invalidate()),this}set end(e){this.setEnd(e)}get end(){return this.getEnd()}getEnd(){return this._end}positionAt(e){return this._start.plus(this._end.minus(this._start).times(e))}tangentAt(e){return this.getStartTangent()}curvatureAt(e){return 0}subdivided(e){if(0===e||1===e)return[this];const t=this.positionAt(e);return[new X(this._start,t),new X(t,this._end)]}invalidate(){this._tangent=null,this._bounds=null,this._svgPathFragment=null,this.invalidationEmitter.emit()}getStartTangent(){return null===this._tangent&&(this._tangent=this._end.minus(this._start).normalized()),this._tangent}get startTangent(){return this.getStartTangent()}getEndTangent(){return this.getStartTangent()}get endTangent(){return this.getEndTangent()}getBounds(){return null===this._bounds&&(this._bounds=j.Z.NOTHING.copy().addPoint(this._start).addPoint(this._end)),this._bounds}get bounds(){return this.getBounds()}getBoundsWithTransform(e){const t=j.Z.NOTHING.copy();return t.addPoint(e.multiplyVector2(z.set(this._start))),t.addPoint(e.multiplyVector2(z.set(this._end))),t}getNondegenerateSegments(){return this._start.equals(this._end)?[]:[this]}getSVGPathFragment(){return this._svgPathFragment||(this._svgPathFragment=`L ${Y(this._end.x)} ${Y(this._end.y)}`),this._svgPathFragment}strokeLeft(e){const t=this.getEndTangent().perpendicular.negated().times(e/2);return[new X(this._start.plus(t),this._end.plus(t))]}strokeRight(e){const t=this.getStartTangent().perpendicular.times(e/2);return[new X(this._end.plus(t),this._start.plus(t))]}getInteriorExtremaTs(){return[]}intersection(e){const t=[],i=this._start,s=this._end.minus(i);if(0===s.magnitudeSquared)return t;const n=e.direction.y*s.x-e.direction.x*s.y;if(0===n)return t;const r=(e.direction.x*(i.y-e.position.y)-e.direction.y*(i.x-e.position.x))/n;if(r<0||r>=1)return t;const o=(s.x*(i.y-e.position.y)-s.y*(i.x-e.position.x))/n;if(o<1e-8)return t;const A=s.perpendicular,a=i.plus(s.times(r)),h=(A.dot(e.direction)>0?A.negated():A).normalized(),l=e.direction.perpendicular.dot(s)<0?1:-1;return t.push(new w(o,a,h,l,r)),t}windingIntersection(e){const t=this.intersection(e);return t.length?t[0].wind:0}writeToContext(e){e.lineTo(this._end.x,this._end.y)}transformed(e){return new X(e.timesVector2(this._start),e.timesVector2(this._end))}explicitClosestToPoint(e){const t=this._end.minus(this._start);let i=e.minus(this._start).dot(t)/t.magnitudeSquared;i=u.Z.clamp(i,0,1);const s=this.positionAt(i);return[{segment:this,t:i,closestPoint:s,distanceSquared:e.distanceSquared(s)}]}getSignedAreaFragment(){return.5*(this._start.x*this._end.y-this._start.y*this._end.x)}reparameterized(e,t){return new X(this.positionAt(t),this.positionAt(e+t))}reversed(){return new X(this._end,this._start)}polarToCartesian(e){return this._start.x===this._end.x?[new X(I.Z.createPolar(this._start.y,this._start.x),I.Z.createPolar(this._end.y,this._end.x))]:this._start.y===this._end.y?[new de(I.Z.ZERO,this._start.y,this._start.x,this._end.x,this._start.x>this._end.x)]:this.toPiecewiseLinearSegments(e)}getArcLength(){return this.start.distance(this.end)}toPiecewiseLinearOrArcSegments(){return[this]}serialize(){return{type:"Line",startX:this._start.x,startY:this._start.y,endX:this._end.x,endY:this._end.y}}getOverlaps(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e instanceof X?X.getOverlaps(this,e):null}getClosestPoints(e){const t=this._end.minus(this._start),i=t.normalized(),s=e.minus(this._start).dot(i),n=u.Z.clamp(s/t.magnitude,0,1),r=this.positionAt(n);return[{segment:this,t:n,closestPoint:r,distanceSquared:r.distanceSquared(e)}]}static deserialize(e){return new X(new I.Z(e.startX,e.startY),new I.Z(e.endX,e.endY))}static getOverlaps(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6;const s=[],n=e._start.x,r=-1*e._start.x+e._end.x,o=e._start.y,A=-1*e._start.y+e._end.y,a=t._start.x,h=-1*t._start.x+t._end.x,l=t._start.y,g=-1*t._start.y+t._end.y,c=Math.abs(Math.max(e._start.x,e._end.x,t._start.x,t._end.x)-Math.min(e._start.x,e._end.x,t._start.x,t._end.x)),d=Math.abs(Math.max(e._start.y,e._end.y,t._start.y,t._end.y)-Math.min(e._start.y,e._end.y,t._start.y,t._end.y)),u=H.polynomialGetOverlapLinear(n,r,a,h),m=H.polynomialGetOverlapLinear(o,A,l,g);let p;if(p=c>d?null===u||!0===u?m:u:null===m||!0===m?u:m,null===p||!0===p)return s;const V=p.a,M=p.b,w=a+M*h-n,C=V*h-r,E=l+M*g-o,Y=V*g-A;if(Math.abs(w)>i||Math.abs(C+w)>i||Math.abs(E)>i||Math.abs(Y+E)>i)return s;const D=V+M;return M>1&&D>1||M<0&&D<0?s:[new B(V,M)]}static intersect(e,t){const i=u.Z.lineSegmentIntersection(e.start.x,e.start.y,e.end.x,e.end.y,t.start.x,t.start.y,t.end.x,t.end.y);if(null!==i){const s=e.explicitClosestToPoint(i)[0].t,n=t.explicitClosestToPoint(i)[0].t;return[new C(i,s,n)]}return[]}static intersectOther(e,t){const i=e.end.minus(e.start),s=i.magnitude,n=new S.Z(e.start,i.normalize()),r=t.intersection(n),o=[];for(let A=0;A<r.length;A++){const e=r[A],t=e.distance/s;t>1e-8&&t<1-1e-8&&o.push(new C(e.point,t,e.t))}return o}}d.register("Line",X);var $=i(9972);const ee=u.Z.solveQuadraticRootsReal,te=u.Z.arePointsCollinear;function ie(e){return e>=0&&e<=1}class se extends H{constructor(e,t,i){super(),this._start=e,this._control=t,this._end=i,this.invalidate()}setStart(e){return this._start.equals(e)||(this._start=e,this.invalidate()),this}set start(e){this.setStart(e)}get start(){return this.getStart()}getStart(){return this._start}setControl(e){return this._control.equals(e)||(this._control=e,this.invalidate()),this}set control(e){this.setControl(e)}get control(){return this.getControl()}getControl(){return this._control}setEnd(e){return this._end.equals(e)||(this._end=e,this.invalidate()),this}set end(e){this.setEnd(e)}get end(){return this.getEnd()}getEnd(){return this._end}positionAt(e){const t=1-e;return this._start.times(t*t).plus(this._control.times(2*t*e)).plus(this._end.times(e*e))}tangentAt(e){return this._control.minus(this._start).times(2*(1-e)).plus(this._end.minus(this._control).times(2*e))}curvatureAt(e){if(Math.abs(e-.5)>.5-1e-7){const t=e<.5,i=t?this._start:this._end,s=this._control,n=t?this._end:this._start,r=s.minus(i),o=r.magnitude;return(t?-1:1)*r.perpendicular.normalized().dot(n.minus(s))*(this.degree-1)/(this.degree*o*o)}return this.subdivided(e)[0].curvatureAt(1)}subdivided(e){if(0===e||1===e)return[this];const t=this._start.blend(this._control,e),i=this._control.blend(this._end,e),s=t.blend(i,e);return[new se(this._start,t,s),new se(s,i,this._end)]}invalidate(){this._startTangent=null,this._endTangent=null,this._tCriticalX=null,this._tCriticalY=null,this._bounds=null,this._svgPathFragment=null,this.invalidationEmitter.emit()}getStartTangent(){if(null===this._startTangent){const e=this._start.equals(this._control);this._startTangent=e?this._end.minus(this._start).normalized():this._control.minus(this._start).normalized()}return this._startTangent}get startTangent(){return this.getStartTangent()}getEndTangent(){if(null===this._endTangent){const e=this._end.equals(this._control);this._endTangent=e?this._end.minus(this._start).normalized():this._end.minus(this._control).normalized()}return this._endTangent}get endTangent(){return this.getEndTangent()}getTCriticalX(){return null===this._tCriticalX&&(this._tCriticalX=se.extremaT(this._start.x,this._control.x,this._end.x)),this._tCriticalX}get tCriticalX(){return this.getTCriticalX()}getTCriticalY(){return null===this._tCriticalY&&(this._tCriticalY=se.extremaT(this._start.y,this._control.y,this._end.y)),this._tCriticalY}get tCriticalY(){return this.getTCriticalY()}getNondegenerateSegments(){const e=this._start,t=this._control,i=this._end,s=e.equals(i),n=e.equals(t),r=e.equals(t);if(s&&n)return[];if(s){const t=this.positionAt(.5);return[new X(e,t),new X(t,i)]}if(te(e,t,i)){if(n||r)return[new X(e,i)];const s=i.minus(e),o=t.minus(e).dot(s.normalized())/s.magnitude,A=se.extremaT(0,o,1);if(!isNaN(A)&&A>0&&A<1){const t=this.positionAt(A);return _.flatten([new X(e,t).getNondegenerateSegments(),new X(t,i).getNondegenerateSegments()])}return[new X(e,i)]}return[this]}getBounds(){if(null===this._bounds){this._bounds=new j.Z(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y),Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y));const e=this.getTCriticalX(),t=this.getTCriticalY();!isNaN(e)&&e>0&&e<1&&(this._bounds=this._bounds.withPoint(this.positionAt(e))),!isNaN(t)&&t>0&&t<1&&(this._bounds=this._bounds.withPoint(this.positionAt(t)))}return this._bounds}get bounds(){return this.getBounds()}offsetTo(e,t){let i=[this];for(let n=0;n<5;n++)i=_.flatten(_.map(i,e=>e.subdivided(.5)));let s=_.map(i,t=>t.approximateOffset(e));return t&&(s.reverse(),s=_.map(s,e=>e.reversed())),s}degreeElevated(){return new ge(this._start,this._start.plus(this._control.timesScalar(2)).dividedScalar(3),this._end.plus(this._control.timesScalar(2)).dividedScalar(3),this._end)}approximateOffset(e){return new se(this._start.plus((this._start.equals(this._control)?this._end.minus(this._start):this._control.minus(this._start)).perpendicular.normalized().times(e)),this._control.plus(this._end.minus(this._start).perpendicular.normalized().times(e)),this._end.plus((this._end.equals(this._control)?this._end.minus(this._start):this._end.minus(this._control)).perpendicular.normalized().times(e)))}getSVGPathFragment(){return this._svgPathFragment||(this._svgPathFragment=`Q ${Y(this._control.x)} ${Y(this._control.y)} ${Y(this._end.x)} ${Y(this._end.y)}`),this._svgPathFragment}strokeLeft(e){return this.offsetTo(-e/2,!1)}strokeRight(e){return this.offsetTo(e/2,!0)}getInteriorExtremaTs(){const e=[],t=this.getTCriticalX(),i=this.getTCriticalY();return!isNaN(t)&&t>1e-10&&t<1-1e-10&&e.push(this.tCriticalX),!isNaN(i)&&i>1e-10&&i<1-1e-10&&e.push(this.tCriticalY),e.sort()}intersection(e){const t=[],i=$.Z.rotation2(-e.direction.angle).timesMatrix($.Z.translation(-e.position.x,-e.position.y)),s=i.timesVector2(this._start),n=i.timesVector2(this._control),r=i.timesVector2(this._end),o=s.y-2*n.y+r.y,A=-2*s.y+2*n.y,a=s.y,h=ee(o,A,a);return _.each(h,i=>{if(i>=0&&i<=1){const s=this.positionAt(i),n=this.tangentAt(i).normalized(),r=n.perpendicular,o=s.minus(e.position);if(o.dot(e.direction)>0){const A=r.dot(e.direction)>0?r.negated():r,a=e.direction.perpendicular.dot(n)<0?1:-1;t.push(new w(o.magnitude,s,A,a,i))}}}),t}windingIntersection(e){let t=0;const i=this.intersection(e);return _.each(i,e=>{t+=e.wind}),t}writeToContext(e){e.quadraticCurveTo(this._control.x,this._control.y,this._end.x,this._end.y)}transformed(e){return new se(e.timesVector2(this._start),e.timesVector2(this._control),e.timesVector2(this._end))}getSignedAreaFragment(){return 1/6*(this._start.x*(2*this._control.y+this._end.y)+this._control.x*(-2*this._start.y+2*this._end.y)+this._end.x*(-this._start.y-2*this._control.y))}reparameterized(e,t){const i=this._start.plus(this._end.plus(this._control.timesScalar(-2))),s=this._control.minus(this._start).timesScalar(2),n=this._start,r=i.timesScalar(e*e),o=i.timesScalar(e*t).timesScalar(2).plus(s.timesScalar(e)),A=i.timesScalar(t*t).plus(s.timesScalar(t)).plus(n);return new se(A,o.timesScalar(.5).plus(A),r.plus(o).plus(A))}reversed(){return new se(this._end,this._control,this._start)}serialize(){return{type:"Quadratic",startX:this._start.x,startY:this._start.y,controlX:this._control.x,controlY:this._control.y,endX:this._end.x,endY:this._end.y}}getOverlaps(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e instanceof se?se.getOverlaps(this,e):null}static deserialize(e){return new se(new I.Z(e.startX,e.startY),new I.Z(e.controlX,e.controlY),new I.Z(e.endX,e.endY))}static extremaT(e,t,i){const s=2*(i-2*t+e);return 0!==s?-2*(t-e)/s:NaN}static getOverlaps(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6;const s=[],n=e._start.x,r=-2*e._start.x+2*e._control.x,o=e._start.x-2*e._control.x+e._end.x,A=e._start.y,a=-2*e._start.y+2*e._control.y,h=e._start.y-2*e._control.y+e._end.y,l=t._start.x,g=-2*t._start.x+2*t._control.x,c=t._start.x-2*t._control.x+t._end.x,d=t._start.y,m=-2*t._start.y+2*t._control.y,p=t._start.y-2*t._control.y+t._end.y,V=Math.abs(Math.max(e._start.x,e._control.x,e._end.x,t._start.x,t._control.x,t._end.x)-Math.min(e._start.x,e._control.x,e._end.x,t._start.x,t._control.x,t._end.x)),M=Math.abs(Math.max(e._start.y,e._control.y,e._end.y,t._start.y,t._control.y,t._end.y)-Math.min(e._start.y,e._control.y,e._end.y,t._start.y,t._control.y,t._end.y)),w=H.polynomialGetOverlapQuadratic(n,r,o,l,g,c),C=H.polynomialGetOverlapQuadratic(A,a,h,d,m,p);let E;if(E=V>M?null===w||!0===w?C:w:null===C||!0===C?w:C,null===E||!0===E)return s;const Y=E.a,D=E.b,y=Y*Y,I=D*D,q=2*Y*D,G=l+D*g+I*c-n,Q=Y*g+q*c-r,S=y*c-o,T=d+D*m+I*p-A,x=Y*m+q*p-a,k=y*p-h,F=u.Z.solveLinearRootsReal(2*S,Q),R=u.Z.solveLinearRootsReal(2*k,x),U=_.uniq([0,1].concat(F?F.filter(ie):[])),L=_.uniq([0,1].concat(R?R.filter(ie):[]));for(let u=0;u<U.length;u++){const e=U[u];if(Math.abs((S*e+Q)*e+G)>i)return s}for(let u=0;u<L.length;u++){const e=L[u];if(Math.abs((k*e+x)*e+T)>i)return s}const P=Y+D;return D>1&&P>1||D<0&&P<0?s:[new B(Y,D)]}}se.prototype.degree=2,d.register("Quadratic",se);const ne=u.Z.solveQuadraticRootsReal,re=u.Z.solveCubicRootsReal,oe=u.Z.arePointsCollinear,Ae=new I.Z(0,0),ae=new I.Z(0,0),he=new I.Z(0,0);function le(e){return e>=0&&e<=1}class ge extends H{constructor(e,t,i,s){super(),this._start=e,this._control1=t,this._control2=i,this._end=s,this.invalidate()}setStart(e){return this._start.equals(e)||(this._start=e,this.invalidate()),this}set start(e){this.setStart(e)}get start(){return this.getStart()}getStart(){return this._start}setControl1(e){return this._control1.equals(e)||(this._control1=e,this.invalidate()),this}set control1(e){this.setControl1(e)}get control1(){return this.getControl1()}getControl1(){return this._control1}setControl2(e){return this._control2.equals(e)||(this._control2=e,this.invalidate()),this}set control2(e){this.setControl2(e)}get control2(){return this.getControl2()}getControl2(){return this._control2}setEnd(e){return this._end.equals(e)||(this._end=e,this.invalidate()),this}set end(e){this.setEnd(e)}get end(){return this.getEnd()}getEnd(){return this._end}positionAt(e){const t=1-e,i=t*t*t,s=3*t*t*e,n=3*t*e*e,r=e*e*e;return new I.Z(this._start.x*i+this._control1.x*s+this._control2.x*n+this._end.x*r,this._start.y*i+this._control1.y*s+this._control2.y*n+this._end.y*r)}tangentAt(e){const t=1-e;return new I.Z(0,0).set(this._start).multiplyScalar(-3*t*t).add(Ae.set(this._control1).multiplyScalar(3*t*t-6*t*e)).add(Ae.set(this._control2).multiplyScalar(6*t*e-3*e*e)).add(Ae.set(this._end).multiplyScalar(3*e*e))}curvatureAt(e){if(Math.abs(e-.5)>.5-1e-7){const t=e<.5,i=t?this._start:this._end,s=t?this._control1:this._control2,n=t?this._control2:this._control1,r=s.minus(i),o=r.magnitude;return(t?-1:1)*r.perpendicular.normalized().dot(n.minus(s))*(this.degree-1)/(this.degree*o*o)}return this.subdivided(e)[0].curvatureAt(1)}subdivided(e){if(0===e||1===e)return[this];const t=this._start.blend(this._control1,e),i=this._control2.blend(this._end,e),s=this._control1.blend(this._control2,e),n=t.blend(s,e),r=s.blend(i,e),o=n.blend(r,e);return[new ge(this._start,t,n,o),new ge(o,r,i,this._end)]}invalidate(){this._startTangent=null,this._endTangent=null,this._r=null,this._s=null,this._tCusp=null,this._tDeterminant=null,this._tInflection1=null,this._tInflection2=null,this._quadratics=null,this._xExtremaT=null,this._yExtremaT=null,this._bounds=null,this._svgPathFragment=null,this.invalidationEmitter.emit()}getStartTangent(){return null===this._startTangent&&(this._startTangent=this.tangentAt(0).normalized()),this._startTangent}get startTangent(){return this.getStartTangent()}getEndTangent(){return null===this._endTangent&&(this._endTangent=this.tangentAt(1).normalized()),this._endTangent}get endTangent(){return this.getEndTangent()}getR(){return null===this._r&&(this._r=this._control1.minus(this._start).normalized()),this._r}get r(){return this.getR()}getS(){return null===this._s&&(this._s=this.getR().perpendicular),this._s}get s(){return this.getS()}getTCusp(){return null===this._tCusp&&this.computeCuspInfo(),this._tCusp}get tCusp(){return this.getTCusp()}getTDeterminant(){return null===this._tDeterminant&&this.computeCuspInfo(),this._tDeterminant}get tDeterminant(){return this.getTDeterminant()}getTInflection1(){return null===this._tInflection1&&this.computeCuspInfo(),this._tInflection1}get tInflection1(){return this.getTInflection1()}getTInflection2(){return null===this._tInflection2&&this.computeCuspInfo(),this._tInflection2}get tInflection2(){return this.getTInflection2()}getQuadratics(){return null===this._quadratics&&this.computeCuspSegments(),this._quadratics}getXExtremaT(){return null===this._xExtremaT&&(this._xExtremaT=ge.extremaT(this._start.x,this._control1.x,this._control2.x,this._end.x)),this._xExtremaT}get xExtremaT(){return this.getXExtremaT()}getYExtremaT(){return null===this._yExtremaT&&(this._yExtremaT=ge.extremaT(this._start.y,this._control1.y,this._control2.y,this._end.y)),this._yExtremaT}get yExtremaT(){return this.getYExtremaT()}getBounds(){return null===this._bounds&&(this._bounds=j.Z.NOTHING,this._bounds=this._bounds.withPoint(this._start),this._bounds=this._bounds.withPoint(this._end),_.each(this.getXExtremaT(),e=>{e>=0&&e<=1&&(this._bounds=this._bounds.withPoint(this.positionAt(e)))}),_.each(this.getYExtremaT(),e=>{e>=0&&e<=1&&(this._bounds=this._bounds.withPoint(this.positionAt(e)))}),this.hasCusp()&&(this._bounds=this._bounds.withPoint(this.positionAt(this.getTCusp())))),this._bounds}get bounds(){return this.getBounds()}computeCuspInfo(){const e=this._start.times(-1).plus(this._control1.times(3)).plus(this._control2.times(-3)).plus(this._end),t=this._start.times(3).plus(this._control1.times(-6)).plus(this._control2.times(3)),i=this._start.times(-3).plus(this._control1.times(3)),s=e.perpendicular,n=t.perpendicular,r=s.dot(t);if(this._tCusp=s.dot(i)/r*-.5,this._tDeterminant=this._tCusp*this._tCusp-1/3*(n.dot(i)/r),this._tDeterminant>=0){const e=Math.sqrt(this._tDeterminant);this._tInflection1=this._tCusp-e,this._tInflection2=this._tCusp+e}else this._tInflection1=NaN,this._tInflection2=NaN}computeCuspSegments(){if(this.hasCusp()){this._quadratics=[];const e=this.getTCusp();if(0===e)this._quadratics.push(new se(this.start,this.control2,this.end));else if(1===e)this._quadratics.push(new se(this.start,this.control1,this.end));else{const t=this.subdivided(e);this._quadratics.push(new se(t[0].start,t[0].control1,t[0].end)),this._quadratics.push(new se(t[1].start,t[1].control2,t[1].end))}}else this._quadratics=null}getNondegenerateSegments(){const e=this._start,t=this._control1,i=this._control2,s=this._end,n=this.degreeReduced(1e-9);if(e.equals(s)&&e.equals(t)&&e.equals(i))return[];if(this.hasCusp())return _.flatten(this.getQuadratics().map(e=>e.getNondegenerateSegments()));if(n)return n.getNondegenerateSegments();if(oe(e,t,s)&&oe(e,i,s)&&!e.equalsEpsilon(s,1e-7)){const t=this.getXExtremaT().concat(this.getYExtremaT()).sort().map(e=>this.positionAt(e)),i=[];let n=e;t.length&&(i.push(new X(e,t[0])),n=t[0]);for(let e=1;e<t.length;e++)i.push(new X(t[e-1],t[e])),n=t[e];return i.push(new X(n,s)),_.flatten(i.map(e=>e.getNondegenerateSegments()))}return[this]}hasCusp(){const e=this.getTCusp();return e>=0&&e<=1&&this.tangentAt(e).magnitude<1e-7}toRS(e){const t=e.minus(this._start);return new I.Z(t.dot(this.getR()),t.dot(this.getS()))}offsetTo(e,t){const i=[],s=[];for(let n=0;n<32;n++){let r=n/31;t&&(r=1-r),i.push(this.positionAt(r).plus(this.tangentAt(r).perpendicular.normalized().times(e))),n>0&&s.push(new X(i[n-1],i[n]))}return s}getSVGPathFragment(){return this._svgPathFragment||(this._svgPathFragment=`C ${Y(this._control1.x)} ${Y(this._control1.y)} ${Y(this._control2.x)} ${Y(this._control2.y)} ${Y(this._end.x)} ${Y(this._end.y)}`),this._svgPathFragment}strokeLeft(e){return this.offsetTo(-e/2,!1)}strokeRight(e){return this.offsetTo(e/2,!0)}getInteriorExtremaTs(){const e=this.getXExtremaT().concat(this.getYExtremaT()),t=[];return _.each(e,e=>{e>1e-10&&e<1-1e-10&&_.every(t,t=>Math.abs(e-t)>1e-10)&&t.push(e)}),t.sort()}intersection(e){const t=[],i=$.Z.rotation2(-e.direction.angle).timesMatrix($.Z.translation(-e.position.x,-e.position.y)),s=i.timesVector2(this._start),n=i.timesVector2(this._control1),r=i.timesVector2(this._control2),o=i.timesVector2(this._end),A=-s.y+3*n.y-3*r.y+o.y,a=3*s.y-6*n.y+3*r.y,h=-3*s.y+3*n.y,l=s.y,g=re(A,a,h,l);return _.each(g,i=>{if(i>=0&&i<=1){const s=this.positionAt(i),n=this.tangentAt(i).normalized(),r=n.perpendicular,o=s.minus(e.position);if(o.dot(e.direction)>0){const A=r.dot(e.direction)>0?r.negated():r,a=e.direction.perpendicular.dot(n)<0?1:-1;t.push(new w(o.magnitude,s,A,a,i))}}}),t}windingIntersection(e){let t=0;const i=this.intersection(e);return _.each(i,e=>{t+=e.wind}),t}writeToContext(e){e.bezierCurveTo(this._control1.x,this._control1.y,this._control2.x,this._control2.y,this._end.x,this._end.y)}transformed(e){return new ge(e.timesVector2(this._start),e.timesVector2(this._control1),e.timesVector2(this._control2),e.timesVector2(this._end))}degreeReduced(e){e=e||0;const t=Ae.set(this._control1).multiplyScalar(3).subtract(this._start).divideScalar(2),i=ae.set(this._control2).multiplyScalar(3).subtract(this._end).divideScalar(2);return he.set(t).subtract(i).magnitude<=e?new se(this._start,t.average(i),this._end):null}getSignedAreaFragment(){return.05*(this._start.x*(6*this._control1.y+3*this._control2.y+this._end.y)+this._control1.x*(-6*this._start.y+3*this._control2.y+3*this._end.y)+this._control2.x*(-3*this._start.y-3*this._control1.y+6*this._end.y)+this._end.x*(-this._start.y-3*this._control1.y-6*this._control2.y))}reversed(){return new ge(this._end,this._control2,this._control1,this._start)}getSelfIntersection(){const e=this.getInteriorExtremaTs(),t=[0].concat(e).concat([1]),i=this.subdivisions(e);if(i.length<3)return null;for(let s=0;s<i.length;s++){const e=i[s];for(let n=s+1;n<i.length;n++){const r=i[n],o=We.intersect(e,r);if(o.length){const e=o[0];if(e.aT>1e-7&&e.aT<1-1e-7&&e.bT>1e-7&&e.bT<1-1e-7){const i=t[s]+e.aT*(t[s+1]-t[s]),r=t[n]+e.bT*(t[n+1]-t[n]);return new C(e.point,i,r)}}}}return null}serialize(){return{type:"Cubic",startX:this._start.x,startY:this._start.y,control1X:this._control1.x,control1Y:this._control1.y,control2X:this._control2.x,control2Y:this._control2.y,endX:this._end.x,endY:this._end.y}}getOverlaps(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e instanceof ge?ge.getOverlaps(this,e):null}static deserialize(e){return new ge(new I.Z(e.startX,e.startY),new I.Z(e.control1X,e.control1Y),new I.Z(e.control2X,e.control2Y),new I.Z(e.endX,e.endY))}static extremaT(e,t,i,s){if(e===t&&e===i&&e===s)return[];const n=-3*e+9*t-9*i+3*s,r=6*e-12*t+6*i,o=-3*e+3*t;return _.filter(ne(n,r,o),le)}static getOverlaps(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6;const s=[],n=e._start.x,r=-3*e._start.x+3*e._control1.x,o=3*e._start.x-6*e._control1.x+3*e._control2.x,A=-1*e._start.x+3*e._control1.x-3*e._control2.x+e._end.x,a=e._start.y,h=-3*e._start.y+3*e._control1.y,l=3*e._start.y-6*e._control1.y+3*e._control2.y,g=-1*e._start.y+3*e._control1.y-3*e._control2.y+e._end.y,c=t._start.x,d=-3*t._start.x+3*t._control1.x,m=3*t._start.x-6*t._control1.x+3*t._control2.x,p=-1*t._start.x+3*t._control1.x-3*t._control2.x+t._end.x,V=t._start.y,M=-3*t._start.y+3*t._control1.y,w=3*t._start.y-6*t._control1.y+3*t._control2.y,C=-1*t._start.y+3*t._control1.y-3*t._control2.y+t._end.y,E=Math.abs(Math.max(e._start.x,e._control1.x,e._control2.x,e._end.x,e._start.x,e._control1.x,e._control2.x,e._end.x)-Math.min(e._start.x,e._control1.x,e._control2.x,e._end.x,e._start.x,e._control1.x,e._control2.x,e._end.x)),Y=Math.abs(Math.max(e._start.y,e._control1.y,e._control2.y,e._end.y,e._start.y,e._control1.y,e._control2.y,e._end.y)-Math.min(e._start.y,e._control1.y,e._control2.y,e._end.y,e._start.y,e._control1.y,e._control2.y,e._end.y)),D=H.polynomialGetOverlapCubic(n,r,o,A,c,d,m,p),y=H.polynomialGetOverlapCubic(a,h,l,g,V,M,w,C);let I;if(I=E>Y?null===D||!0===D?y:D:null===y||!0===y?D:y,null===I||!0===I)return s;const q=I.a,G=I.b,Q=q*q,S=q*q*q,T=G*G,x=G*G*G,k=2*q*G,F=3*q*T,R=3*Q*G,U=c+G*d+T*m+x*p-n,L=q*d+k*m+F*p-r,P=Q*m+R*p-o,b=S*p-A,O=V+G*M+T*w+x*C-a,f=q*M+k*w+F*C-h,Z=Q*w+R*C-l,N=S*C-g,K=u.Z.solveQuadraticRootsReal(3*b,2*P,L),J=u.Z.solveQuadraticRootsReal(3*N,2*Z,f),j=_.uniq([0,1].concat(null!==K?K.filter(le):[])),v=_.uniq([0,1].concat(null!==J?J.filter(le):[]));for(let u=0;u<j.length;u++){const e=j[u];if(Math.abs(((b*e+P)*e+L)*e+U)>i)return s}for(let u=0;u<v.length;u++){const e=v[u];if(Math.abs(((N*e+Z)*e+f)*e+O)>i)return s}const W=q+G;return G>1&&W>1||G<0&&W<0?s:[new B(q,G)]}}ge.prototype.degree=3,d.register("Cubic",ge);const ce=2*Math.PI;class de extends H{constructor(e,t,i,s,n){super(),this._center=e,this._radius=t,this._startAngle=i,this._endAngle=s,this._anticlockwise=n,this.invalidate()}setCenter(e){return this._center.equals(e)||(this._center=e,this.invalidate()),this}set center(e){this.setCenter(e)}get center(){return this.getCenter()}getCenter(){return this._center}setRadius(e){return this._radius!==e&&(this._radius=e,this.invalidate()),this}set radius(e){this.setRadius(e)}get radius(){return this.getRadius()}getRadius(){return this._radius}setStartAngle(e){return this._startAngle!==e&&(this._startAngle=e,this.invalidate()),this}set startAngle(e){this.setStartAngle(e)}get startAngle(){return this.getStartAngle()}getStartAngle(){return this._startAngle}setEndAngle(e){return this._endAngle!==e&&(this._endAngle=e,this.invalidate()),this}set endAngle(e){this.setEndAngle(e)}get endAngle(){return this.getEndAngle()}getEndAngle(){return this._endAngle}setAnticlockwise(e){return this._anticlockwise!==e&&(this._anticlockwise=e,this.invalidate()),this}set anticlockwise(e){this.setAnticlockwise(e)}get anticlockwise(){return this.getAnticlockwise()}getAnticlockwise(){return this._anticlockwise}positionAt(e){return this.positionAtAngle(this.angleAt(e))}tangentAt(e){return this.tangentAtAngle(this.angleAt(e))}curvatureAt(e){return(this._anticlockwise?-1:1)/this._radius}subdivided(e){if(0===e||1===e)return[this];const t=this.angleAt(0),i=this.angleAt(e),s=this.angleAt(1);return[new de(this._center,this._radius,t,i,this._anticlockwise),new de(this._center,this._radius,i,s,this._anticlockwise)]}invalidate(){this._start=null,this._end=null,this._startTangent=null,this._endTangent=null,this._actualEndAngle=null,this._isFullPerimeter=null,this._angleDifference=null,this._bounds=null,this._svgPathFragment=null,this._radius<0&&(this._radius=-this._radius,this._startAngle+=Math.PI,this._endAngle+=Math.PI),this.invalidationEmitter.emit()}getStart(){return null===this._start&&(this._start=this.positionAtAngle(this._startAngle)),this._start}get start(){return this.getStart()}getEnd(){return null===this._end&&(this._end=this.positionAtAngle(this._endAngle)),this._end}get end(){return this.getEnd()}getStartTangent(){return null===this._startTangent&&(this._startTangent=this.tangentAtAngle(this._startAngle)),this._startTangent}get startTangent(){return this.getStartTangent()}getEndTangent(){return null===this._endTangent&&(this._endTangent=this.tangentAtAngle(this._endAngle)),this._endTangent}get endTangent(){return this.getEndTangent()}getActualEndAngle(){return null===this._actualEndAngle&&(this._actualEndAngle=de.computeActualEndAngle(this._startAngle,this._endAngle,this._anticlockwise)),this._actualEndAngle}get actualEndAngle(){return this.getActualEndAngle()}getIsFullPerimeter(){return null===this._isFullPerimeter&&(this._isFullPerimeter=!this._anticlockwise&&this._endAngle-this._startAngle>=2*Math.PI||this._anticlockwise&&this._startAngle-this._endAngle>=2*Math.PI),this._isFullPerimeter}get isFullPerimeter(){return this.getIsFullPerimeter()}getAngleDifference(){return null===this._angleDifference&&(this._angleDifference=this._anticlockwise?this._startAngle-this._endAngle:this._endAngle-this._startAngle,this._angleDifference<0&&(this._angleDifference+=2*Math.PI)),this._angleDifference}get angleDifference(){return this.getAngleDifference()}getBounds(){return null===this._bounds&&(this._bounds=j.Z.NOTHING.copy().withPoint(this.getStart()).withPoint(this.getEnd()),this._startAngle!==this._endAngle&&(this.includeBoundsAtAngle(0),this.includeBoundsAtAngle(Math.PI/2),this.includeBoundsAtAngle(Math.PI),this.includeBoundsAtAngle(3*Math.PI/2))),this._bounds}get bounds(){return this.getBounds()}getNondegenerateSegments(){return this._radius<=0||this._startAngle===this._endAngle?[]:[this]}includeBoundsAtAngle(e){this.containsAngle(e)&&(this._bounds=this._bounds.withPoint(this._center.plus(I.Z.createPolar(this._radius,e))))}mapAngle(e){return Math.abs(u.Z.moduloBetweenDown(e-this._startAngle,-Math.PI,Math.PI))<1e-8?this._startAngle:Math.abs(u.Z.moduloBetweenDown(e-this.getActualEndAngle(),-Math.PI,Math.PI))<1e-8?this.getActualEndAngle():this._startAngle>this.getActualEndAngle()?u.Z.moduloBetweenUp(e,this._startAngle-2*Math.PI,this._startAngle):u.Z.moduloBetweenDown(e,this._startAngle,this._startAngle+2*Math.PI)}tAtAngle(e){const t=(this.mapAngle(e)-this._startAngle)/(this.getActualEndAngle()-this._startAngle);return t}angleAt(e){return this._startAngle+(this.getActualEndAngle()-this._startAngle)*e}positionAtAngle(e){return this._center.plus(I.Z.createPolar(this._radius,e))}tangentAtAngle(e){const t=I.Z.createPolar(1,e);return this._anticlockwise?t.perpendicular:t.perpendicular.negated()}containsAngle(e){const t=this._anticlockwise?e-this._endAngle:e-this._startAngle;return u.Z.moduloBetweenDown(t,0,2*Math.PI)<=this.angleDifference}getSVGPathFragment(){if(!this._svgPathFragment){const e=.01,t=this._anticlockwise?"0":"1";let i;if(this.angleDifference<2*Math.PI-e)i=this.angleDifference<Math.PI?"0":"1",this._svgPathFragment=`A ${Y(this._radius)} ${Y(this._radius)} 0 ${i} ${t} ${Y(this.end.x)} ${Y(this.end.y)}`;else{const e=(this._startAngle+this._endAngle)/2,s=this._center.plus(I.Z.createPolar(this._radius,e));i="0";const n=`A ${Y(this._radius)} ${Y(this._radius)} 0 ${i} ${t} ${Y(s.x)} ${Y(s.y)}`,r=`A ${Y(this._radius)} ${Y(this._radius)} 0 ${i} ${t} ${Y(this.end.x)} ${Y(this.end.y)}`;this._svgPathFragment=`${n} ${r}`}}return this._svgPathFragment}strokeLeft(e){return[new de(this._center,this._radius+(this._anticlockwise?1:-1)*e/2,this._startAngle,this._endAngle,this._anticlockwise)]}strokeRight(e){return[new de(this._center,this._radius+(this._anticlockwise?-1:1)*e/2,this._endAngle,this._startAngle,!this._anticlockwise)]}getInteriorExtremaTs(){const e=[];return _.each([0,Math.PI/2,Math.PI,3*Math.PI/2],t=>{if(this.containsAngle(t)){const i=this.tAtAngle(t),s=1e-10;i>s&&i<1-s&&e.push(i)}}),e.sort()}intersection(e){const t=[],i=e.position.minus(this._center),s=e.direction.dot(i),n=4*s*s-4*(i.magnitudeSquared-this._radius*this._radius);if(n<0)return t;const r=e.direction.dot(this._center)-e.direction.dot(e.position),o=Math.sqrt(n)/2,A=r-o,a=r+o;if(a<0)return t;const h=e.pointAtDistance(a),l=h.minus(this._center).normalized(),g=l.angle;if(A<0)this.containsAngle(g)&&t.push(new w(a,h,l.negated(),this._anticlockwise?-1:1,this.tAtAngle(g)));else{const i=e.pointAtDistance(A),s=i.minus(this._center).normalized(),n=s.angle;this.containsAngle(n)&&t.push(new w(A,i,s,this._anticlockwise?1:-1,this.tAtAngle(n))),this.containsAngle(g)&&t.push(new w(a,h,l.negated(),this._anticlockwise?-1:1,this.tAtAngle(g)))}return t}windingIntersection(e){let t=0;const i=this.intersection(e);return _.each(i,e=>{t+=e.wind}),t}writeToContext(e){e.arc(this._center.x,this._center.y,this._radius,this._startAngle,this._endAngle,this._anticlockwise)}transformed(e){const t=e.timesVector2(I.Z.createPolar(1,this._startAngle)).minus(e.timesVector2(I.Z.ZERO)).angle;let i=e.timesVector2(I.Z.createPolar(1,this._endAngle)).minus(e.timesVector2(I.Z.ZERO)).angle;const s=e.getDeterminant()>=0?this._anticlockwise:!this._anticlockwise;Math.abs(this._endAngle-this._startAngle)===2*Math.PI&&(i=s?t-2*Math.PI:t+2*Math.PI);const n=e.getScaleVector();if(n.x!==n.y){const r=n.x*this._radius,o=n.y*this._radius;return new Be(e.timesVector2(this._center),r,o,0,t,i,s)}{const r=n.x*this._radius;return new de(e.timesVector2(this._center),r,t,i,s)}}getSignedAreaFragment(){const e=this._startAngle,t=this.getActualEndAngle();return.5*this._radius*(this._radius*(t-e)+this._center.x*(Math.sin(t)-Math.sin(e))-this._center.y*(Math.cos(t)-Math.cos(e)))}reversed(){return new de(this._center,this._radius,this._endAngle,this._startAngle,!this._anticlockwise)}getArcLength(){return this.getAngleDifference()*this._radius}toPiecewiseLinearOrArcSegments(){return[this]}serialize(){return{type:"Arc",centerX:this._center.x,centerY:this._center.y,radius:this._radius,startAngle:this._startAngle,endAngle:this._endAngle,anticlockwise:this._anticlockwise}}getOverlaps(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e instanceof de?de.getOverlaps(this,e):null}getConicMatrix(){const e=this.center.x,t=this.center.y,i=-2*e,s=-2*t,n=e*e+t*t-this.radius*this.radius;return $.Z.rowMajor(1,0,i/2,0,1,s/2,i/2,s/2,n)}static deserialize(e){return new de(new I.Z(e.centerX,e.centerY),e.radius,e.startAngle,e.endAngle,e.anticlockwise)}static computeActualEndAngle(e,t,i){return i?e>t?t:e<t?t-2*Math.PI:e:e<t?t:e>t?t+2*Math.PI:e}static getPartialOverlap(e,t,i,s,n){const r=i<t,o=r?t:i,A=r?i:t,a=Math.min(e,o);return a<A+1e-8?[]:[B.createLinear(u.Z.clamp(u.Z.linear(0,e,0,1,A),0,1),u.Z.clamp(u.Z.linear(t,i,s,n,A),0,1),u.Z.clamp(u.Z.linear(0,e,0,1,a),0,1),u.Z.clamp(u.Z.linear(t,i,s,n,a),0,1))]}static getAngularOverlaps(e,t,i,s){let n=t-e;const r=n<0?-1:1;n*=r;const o=u.Z.moduloBetweenDown(r*(i-e),0,ce),A=r*(s-i)+o;let a;return A<-1e-10?(a=-o/(A-o),de.getPartialOverlap(n,o,0,0,a).concat(de.getPartialOverlap(n,ce,A+ce,a,1))):A>ce+1e-10?(a=(ce-o)/(A-o),de.getPartialOverlap(n,o,ce,0,a).concat(de.getPartialOverlap(n,0,A-ce,a,1))):de.getPartialOverlap(n,o,A,0,1)}static getOverlaps(e,t){return e._center.distance(t._center)>1e-4||Math.abs(e._radius-t._radius)>1e-4?[]:de.getAngularOverlaps(e._startAngle,e.getActualEndAngle(),t._startAngle,t.getActualEndAngle())}static getCircleIntersectionPoint(e,t,i,s){const n=i.minus(e),r=n.magnitude;let o=[];if(r<1e-10||r>t+s+1e-10);else if(r>t+s-1e-10)o=[e.blend(i,t/r)];else{const A=.5*(r*r-s*s+t*t)/r,a=r*r-s*s+t*t,h=4*r*r*t*t-a*a,l=e.blend(i,A/r);if(h>=1e-10){const e=Math.sqrt(h)/r/2,t=n.perpendicular.setMagnitude(e);o=[l.plus(t),l.minus(t)]}else h>-1e-10&&(o=[l])}return o}static intersect(e,t){const i=[];if(e._center.equalsEpsilon(t._center,1e-8)&&Math.abs(e._radius-t._radius)<1e-8){const s=e.positionAt(0),n=e.positionAt(1),r=t.positionAt(0),o=t.positionAt(1);s.equalsEpsilon(r,1e-8)&&i.push(new C(s.average(r),0,0)),s.equalsEpsilon(o,1e-8)&&i.push(new C(s.average(o),0,1)),n.equalsEpsilon(r,1e-8)&&i.push(new C(n.average(r),1,0)),n.equalsEpsilon(o,1e-8)&&i.push(new C(n.average(o),1,1))}else{const s=de.getCircleIntersectionPoint(e._center,e._radius,t._center,t._radius);for(let n=0;n<s.length;n++){const r=s[n],o=r.minus(e._center).angle,A=r.minus(t._center).angle;e.containsAngle(o)&&t.containsAngle(A)&&i.push(new C(r,e.tAtAngle(o),t.tAtAngle(A)))}}return i}static createFromPoints(e,t,i){const s=u.Z.circleCenterFromPoints(e,t,i);if(null===s)return new X(e,i);{const n=e.minus(s),r=t.minus(s),o=i.minus(s),A=n.angle,a=r.angle,h=o.angle,l=(n.magnitude+r.magnitude+o.magnitude)/3,g=new de(s,l,A,h,!1);return g.containsAngle(a)?g:new de(s,l,A,h,!0)}}}d.register("Arc",de);var ue=i(7320),me=i(2956),pe=i(4676);const Ve=u.Z.toDegrees,Me=$.Z.rowMajor(1,0,0,0,1,0,0,0,-1);class Be extends H{constructor(e,t,i,s,n,r,o){super(),this._center=e,this._radiusX=t,this._radiusY=i,this._rotation=s,this._startAngle=n,this._endAngle=r,this._anticlockwise=o,this.invalidate()}setCenter(e){return this._center.equals(e)||(this._center=e,this.invalidate()),this}set center(e){this.setCenter(e)}get center(){return this.getCenter()}getCenter(){return this._center}setRadiusX(e){return this._radiusX!==e&&(this._radiusX=e,this.invalidate()),this}set radiusX(e){this.setRadiusX(e)}get radiusX(){return this.getRadiusX()}getRadiusX(){return this._radiusX}setRadiusY(e){return this._radiusY!==e&&(this._radiusY=e,this.invalidate()),this}set radiusY(e){this.setRadiusY(e)}get radiusY(){return this.getRadiusY()}getRadiusY(){return this._radiusY}setRotation(e){return this._rotation!==e&&(this._rotation=e,this.invalidate()),this}set rotation(e){this.setRotation(e)}get rotation(){return this.getRotation()}getRotation(){return this._rotation}setStartAngle(e){return this._startAngle!==e&&(this._startAngle=e,this.invalidate()),this}set startAngle(e){this.setStartAngle(e)}get startAngle(){return this.getStartAngle()}getStartAngle(){return this._startAngle}setEndAngle(e){return this._endAngle!==e&&(this._endAngle=e,this.invalidate()),this}set endAngle(e){this.setEndAngle(e)}get endAngle(){return this.getEndAngle()}getEndAngle(){return this._endAngle}setAnticlockwise(e){return this._anticlockwise!==e&&(this._anticlockwise=e,this.invalidate()),this}set anticlockwise(e){this.setAnticlockwise(e)}get anticlockwise(){return this.getAnticlockwise()}getAnticlockwise(){return this._anticlockwise}positionAt(e){return this.positionAtAngle(this.angleAt(e))}tangentAt(e){return this.tangentAtAngle(this.angleAt(e))}curvatureAt(e){const t=this.angleAt(e),i=this._radiusX*Math.sin(t),s=this._radiusY*Math.cos(t),n=Math.pow(s*s+i*i,1.5);return(this._anticlockwise?-1:1)*this._radiusX*this._radiusY/n}subdivided(e){if(0===e||1===e)return[this];const t=this.angleAt(0),i=this.angleAt(e),s=this.angleAt(1);return[new Be(this._center,this._radiusX,this._radiusY,this._rotation,t,i,this._anticlockwise),new Be(this._center,this._radiusX,this._radiusY,this._rotation,i,s,this._anticlockwise)]}invalidate(){if(this._unitTransform=null,this._start=null,this._end=null,this._startTangent=null,this._endTangent=null,this._actualEndAngle=null,this._isFullPerimeter=null,this._angleDifference=null,this._unitArcSegment=null,this._bounds=null,this._svgPathFragment=null,this._radiusX<0&&(this._radiusX=-this._radiusX,this._startAngle=Math.PI-this._startAngle,this._endAngle=Math.PI-this._endAngle,this._anticlockwise=!this._anticlockwise),this._radiusY<0&&(this._radiusY=-this._radiusY,this._startAngle=-this._startAngle,this._endAngle=-this._endAngle,this._anticlockwise=!this._anticlockwise),this._radiusX<this._radiusY){this._rotation+=Math.PI/2,this._startAngle-=Math.PI/2,this._endAngle-=Math.PI/2;const e=this._radiusX;this._radiusX=this._radiusY,this._radiusY=e}if(this._radiusX<this._radiusY)throw new Error("Not verified to work if radiusX < radiusY");this.invalidationEmitter.emit()}getUnitTransform(){return null===this._unitTransform&&(this._unitTransform=Be.computeUnitTransform(this._center,this._radiusX,this._radiusY,this._rotation)),this._unitTransform}get unitTransform(){return this.getUnitTransform()}getStart(){return null===this._start&&(this._start=this.positionAtAngle(this._startAngle)),this._start}get start(){return this.getStart()}getEnd(){return null===this._end&&(this._end=this.positionAtAngle(this._endAngle)),this._end}get end(){return this.getEnd()}getStartTangent(){return null===this._startTangent&&(this._startTangent=this.tangentAtAngle(this._startAngle)),this._startTangent}get startTangent(){return this.getStartTangent()}getEndTangent(){return null===this._endTangent&&(this._endTangent=this.tangentAtAngle(this._endAngle)),this._endTangent}get endTangent(){return this.getEndTangent()}getActualEndAngle(){return null===this._actualEndAngle&&(this._actualEndAngle=de.computeActualEndAngle(this._startAngle,this._endAngle,this._anticlockwise)),this._actualEndAngle}get actualEndAngle(){return this.getActualEndAngle()}getIsFullPerimeter(){return null===this._isFullPerimeter&&(this._isFullPerimeter=!this._anticlockwise&&this._endAngle-this._startAngle>=2*Math.PI||this._anticlockwise&&this._startAngle-this._endAngle>=2*Math.PI),this._isFullPerimeter}get isFullPerimeter(){return this.getIsFullPerimeter()}getAngleDifference(){return null===this._angleDifference&&(this._angleDifference=this._anticlockwise?this._startAngle-this._endAngle:this._endAngle-this._startAngle,this._angleDifference<0&&(this._angleDifference+=2*Math.PI)),this._angleDifference}get angleDifference(){return this.getAngleDifference()}getUnitArcSegment(){return null===this._unitArcSegment&&(this._unitArcSegment=new de(I.Z.ZERO,1,this._startAngle,this._endAngle,this._anticlockwise)),this._unitArcSegment}get unitArcSegment(){return this.getUnitArcSegment()}getBounds(){if(null===this._bounds&&(this._bounds=j.Z.NOTHING.withPoint(this.getStart()).withPoint(this.getEnd()),this._startAngle!==this._endAngle)){const e=Math.atan(-this._radiusY/this._radiusX*Math.tan(this._rotation)),t=Math.atan(this._radiusY/this._radiusX/Math.tan(this._rotation));this.possibleExtremaAngles=[e,e+Math.PI,t,t+Math.PI],_.each(this.possibleExtremaAngles,this.includeBoundsAtAngle.bind(this))}return this._bounds}get bounds(){return this.getBounds()}getNondegenerateSegments(){if(this._radiusX<=0||this._radiusY<=0||this._startAngle===this._endAngle)return[];if(this._radiusX===this._radiusY){const e=this._startAngle+this._rotation;let t=this._endAngle+this._rotation;return Math.abs(this._endAngle-this._startAngle)===2*Math.PI&&(t=this._anticlockwise?e-2*Math.PI:e+2*Math.PI),[new de(this._center,this._radiusX,e,t,this._anticlockwise)]}return[this]}includeBoundsAtAngle(e){this.unitArcSegment.containsAngle(e)&&(this._bounds=this._bounds.withPoint(this.positionAtAngle(e)))}mapAngle(e){return Math.abs(u.Z.moduloBetweenDown(e-this._startAngle,-Math.PI,Math.PI))<1e-8?this._startAngle:Math.abs(u.Z.moduloBetweenDown(e-this.getActualEndAngle(),-Math.PI,Math.PI))<1e-8?this.getActualEndAngle():this._startAngle>this.getActualEndAngle()?u.Z.moduloBetweenUp(e,this._startAngle-2*Math.PI,this._startAngle):u.Z.moduloBetweenDown(e,this._startAngle,this._startAngle+2*Math.PI)}tAtAngle(e){return(this.mapAngle(e)-this._startAngle)/(this.getActualEndAngle()-this._startAngle)}angleAt(e){return this._startAngle+(this.getActualEndAngle()-this._startAngle)*e}positionAtAngle(e){return this.getUnitTransform().transformPosition2(I.Z.createPolar(1,e))}tangentAtAngle(e){const t=this.getUnitTransform().transformNormal2(I.Z.createPolar(1,e));return this._anticlockwise?t.perpendicular:t.perpendicular.negated()}offsetTo(e,t){const i=[],s=[];for(let n=0;n<32;n++){let r=n/31;t&&(r=1-r);const o=this.angleAt(r);i.push(this.positionAtAngle(o).plus(this.tangentAtAngle(o).perpendicular.normalized().times(e))),n>0&&s.push(new X(i[n-1],i[n]))}return s}getSVGPathFragment(){if(!this._svgPathFragment){const e=.01,t=this._anticlockwise?"0":"1";let i;const s=Ve(this._rotation);if(this.getAngleDifference()<2*Math.PI-e)i=this.getAngleDifference()<Math.PI?"0":"1",this._svgPathFragment=`A ${Y(this._radiusX)} ${Y(this._radiusY)} ${s} ${i} ${t} ${Y(this.getEnd().x)} ${Y(this.getEnd().y)}`;else{const e=(this._startAngle+this._endAngle)/2,n=this.positionAtAngle(e);i="0";const r=`A ${Y(this._radiusX)} ${Y(this._radiusY)} ${s} ${i} ${t} ${Y(n.x)} ${Y(n.y)}`,o=`A ${Y(this._radiusX)} ${Y(this._radiusY)} ${s} ${i} ${t} ${Y(this.getEnd().x)} ${Y(this.getEnd().y)}`;this._svgPathFragment=`${r} ${o}`}}return this._svgPathFragment}strokeLeft(e){return this.offsetTo(-e/2,!1)}strokeRight(e){return this.offsetTo(e/2,!0)}getInteriorExtremaTs(){const e=[];return _.each(this.possibleExtremaAngles,t=>{if(this.unitArcSegment.containsAngle(t)){const i=this.tAtAngle(t),s=1e-10;i>s&&i<1-s&&e.push(i)}}),e.sort()}intersection(e){const t=this.getUnitTransform(),i=t.inverseRay2(e),s=this.getUnitArcSegment().intersection(i);return _.map(s,i=>{const s=t.transformPosition2(i.point),n=e.position.distance(s),r=t.inverseNormal2(i.normal);return new w(n,s,r,i.wind,i.t)})}windingIntersection(e){const t=this.getUnitTransform().inverseRay2(e);return this.getUnitArcSegment().windingIntersection(t)}writeToContext(e){e.ellipse?e.ellipse(this._center.x,this._center.y,this._radiusX,this._radiusY,this._rotation,this._startAngle,this._endAngle,this._anticlockwise):(this.getUnitTransform().getMatrix().canvasAppendTransform(e),e.arc(0,0,1,this._startAngle,this._endAngle,this._anticlockwise),this.getUnitTransform().getInverse().canvasAppendTransform(e))}transformed(e){const t=e.timesVector2(I.Z.createPolar(this._radiusX,this._rotation)).minus(e.timesVector2(I.Z.ZERO)),i=e.timesVector2(I.Z.createPolar(this._radiusY,this._rotation+Math.PI/2)).minus(e.timesVector2(I.Z.ZERO)),s=t.angle,n=t.magnitude,r=i.magnitude,o=e.getDeterminant()<0,A=o?!this._anticlockwise:this._anticlockwise,a=o?-this._startAngle:this._startAngle;let h=o?-this._endAngle:this._endAngle;return Math.abs(this._endAngle-this._startAngle)===2*Math.PI&&(h=A?a-2*Math.PI:a+2*Math.PI),new Be(e.timesVector2(this._center),n,r,s,a,h,A)}getSignedAreaFragment(){const e=this._startAngle,t=this.getActualEndAngle(),i=Math.sin(e),s=Math.sin(t),n=Math.cos(e),r=Math.cos(t);return.5*(this._radiusX*this._radiusY*(t-e)+Math.cos(this._rotation)*(this._radiusX*this._center.y*(n-r)+this._radiusY*this._center.x*(s-i))+Math.sin(this._rotation)*(this._radiusX*this._center.x*(r-n)+this._radiusY*this._center.y*(s-i)))}reversed(){return new Be(this._center,this._radiusX,this._radiusY,this._rotation,this._endAngle,this._startAngle,!this._anticlockwise)}serialize(){return{type:"EllipticalArc",centerX:this._center.x,centerY:this._center.y,radiusX:this._radiusX,radiusY:this._radiusY,rotation:this._rotation,startAngle:this._startAngle,endAngle:this._endAngle,anticlockwise:this._anticlockwise}}getOverlaps(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e instanceof Be?Be.getOverlaps(this,e):null}getConicMatrix(){const e=Be.computeUnitMatrix(this._center,this._radiusX,this._radiusY,this._rotation).inverted();return e.transposed().multiplyMatrix(Me).multiplyMatrix(e)}static deserialize(e){return new Be(new I.Z(e.centerX,e.centerY),e.radiusX,e.radiusY,e.rotation,e.startAngle,e.endAngle,e.anticlockwise)}static getOverlapType(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-4;if(e._center.distance(t._center)<i){const s=Math.abs(e._radiusX-t._radiusX)<i&&Math.abs(e._radiusY-t._radiusY)<i,n=Math.abs(e._radiusX-t._radiusY)<i&&Math.abs(e._radiusY-t._radiusX)<i;if(s&&Math.abs(u.Z.moduloBetweenDown(e._rotation-t._rotation+Math.PI/2,0,Math.PI)-Math.PI/2)<i)return we.MATCHING_OVERLAP;if(n&&Math.abs(u.Z.moduloBetweenDown(e._rotation-t._rotation,0,Math.PI)-Math.PI/2)<i)return we.OPPOSITE_OVERLAP}return we.NONE}static getOverlaps(e,t){return Be.getOverlapType(e,t)===we.NONE?[]:de.getAngularOverlaps(e._startAngle+e._rotation,e.getActualEndAngle()+e._rotation,t._startAngle+t._rotation,t.getActualEndAngle()+t._rotation)}static intersect(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-10;if(Be.getOverlapType(e,t,i)===we.NONE)return We.intersect(e,t);{const s=[],n=e.positionAt(0),r=e.positionAt(1),o=t.positionAt(0),A=t.positionAt(1);return n.equalsEpsilon(o,i)&&s.push(new C(n.average(o),0,0)),n.equalsEpsilon(A,i)&&s.push(new C(n.average(A),0,1)),r.equalsEpsilon(o,i)&&s.push(new C(r.average(o),1,0)),r.equalsEpsilon(A,i)&&s.push(new C(r.average(A),1,1)),s}}static computeUnitMatrix(e,t,i,s){return $.Z.translationFromVector(e).timesMatrix($.Z.rotation2(s)).timesMatrix($.Z.scaling(t,i))}static computeUnitTransform(e,t,i,s){return new ue.Z(Be.computeUnitMatrix(e,t,i,s))}}class we extends pe.Z{}_defineProperty(we,"MATCHING_OVERLAP",new(s=we)),_defineProperty(we,"OPPOSITE_OVERLAP",new s),_defineProperty(we,"NONE",new s),_defineProperty(we,"enumeration",new me.Z(s)),d.register("EllipticalArc",Be);class Ce{constructor(e,t,i){if(_defineProperty(this,"segments",[]),_defineProperty(this,"invalidatedEmitter",new J.Z),_defineProperty(this,"_bounds",null),_defineProperty(this,"_strokedSubpaths",null),_defineProperty(this,"_strokedSubpathsComputed",!1),_defineProperty(this,"_strokedStyles",null),_defineProperty(this,"_invalidatingPoints",!1),this.points=t||(e&&e.length?_.map(e,e=>e.start).concat(e[e.length-1].end):[]),this.closed=!!i,this._invalidateListener=this.invalidate.bind(this),e)for(let s=0;s<e.length;s++)_.each(e[s].getNondegenerateSegments(),e=>{this.addSegmentDirectly(e)})}getBounds(){if(null===this._bounds){const e=j.Z.NOTHING.copy();_.each(this.segments,t=>{e.includeBounds(t.getBounds())}),this._bounds=e}return this._bounds}get bounds(){return this.getBounds()}getArcLength(e,t,i){let s=0;for(let n=0;n<this.segments.length;n++)s+=this.segments[n].getArcLength(e,t,i);return s}copy(){return new Ce(this.segments.slice(0),this.points.slice(0),this.closed)}invalidatePoints(){this._invalidatingPoints=!0;const e=this.segments.length;for(let t=0;t<e;t++)this.segments[t].invalidate();this._invalidatingPoints=!1,this.invalidate()}invalidate(){this._invalidatingPoints||(this._bounds=null,this._strokedSubpathsComputed=!1,this.invalidatedEmitter.emit())}addPoint(e){return this.points.push(e),this}addSegmentDirectly(e){return this.segments.push(e),e.invalidationEmitter.addListener(this._invalidateListener),this}addSegment(e){const t=e.getNondegenerateSegments().length;for(let i=0;i<t;i++)this.addSegmentDirectly(e);return this.invalidate(),this}addClosingSegment(){if(this.hasClosingSegment()){const e=this.getClosingSegment();this.addSegmentDirectly(e),this.invalidate(),this.addPoint(this.getFirstPoint()),this.closed=!0}}close(){this.closed=!0,this.addClosingSegment()}getLength(){return this.points.length}getFirstPoint(){return _.first(this.points)}getLastPoint(){return _.last(this.points)}getFirstSegment(){return _.first(this.segments)}getLastSegment(){return _.last(this.segments)}getFillSegments(){const e=this.segments.slice();return this.hasClosingSegment()&&e.push(this.getClosingSegment()),e}isDrawable(){return this.segments.length>0}isClosed(){return this.closed}hasClosingSegment(){return!this.getFirstPoint().equalsEpsilon(this.getLastPoint(),1e-9)}getClosingSegment(){return new X(this.getLastPoint(),this.getFirstPoint())}getClosestPoints(e){return H.filterClosestToPointResult(_.flatten(this.segments.map(t=>t.getClosestPoints(e))))}writeToContext(e){if(this.isDrawable()){const t=this.getFirstSegment().start;e.moveTo(t.x,t.y);let i=this.segments.length;this.closed&&i>=2&&this.segments[i-1]instanceof X&&i--;for(let s=0;s<i;s++)this.segments[s].writeToContext(e);this.closed&&e.closePath()}}toPiecewiseLinear(e){return new Ce(_.flatten(_.map(this.segments,t=>t.toPiecewiseLinearSegments(e))),void 0,this.closed)}transformed(e){return new Ce(_.map(this.segments,t=>t.transformed(e)),_.map(this.points,t=>e.timesVector2(t)),this.closed)}nonlinearTransformed(e){return new Ce(_.flatten(_.map(this.segments,t=>e.methodName&&t[e.methodName]?t[e.methodName](e):t.toPiecewiseLinearSegments(e))),void 0,this.closed)}getBoundsWithTransform(e){const t=j.Z.NOTHING.copy(),i=this.segments.length;for(let s=0;s<i;s++)t.includeBounds(this.segments[s].getBoundsWithTransform(e));return t}offset(e){if(!this.isDrawable())return new Ce([],void 0,this.closed);if(0===e)return new Ce(this.segments.slice(),void 0,this.closed);let t;const i=this.segments.slice(),s=[];for(t=0;t<i.length;t++)s.push(i[t].strokeLeft(2*e));let n=[];for(t=0;t<i.length;t++){if(this.closed||t>0){const s=(t>0?t:i.length)-1,r=i[t].start,o=i[s].endTangent,A=i[t].startTangent,a=o.perpendicular.negated().times(e).angle,h=A.perpendicular.negated().times(e).angle,l=o.perpendicular.dot(A)>0;n.push(new de(r,Math.abs(e),a,h,l))}n=n.concat(s[t])}return new Ce(n,void 0,this.closed)}stroked(e){if(!this.isDrawable())return[];if(void 0===e&&(e=new M),this._strokedSubpathsComputed&&this._strokedStyles.equals(e))return this._strokedSubpaths;const t=e.lineWidth;let i,s=[],n=[];const r=this.getFirstSegment(),o=this.getLastSegment(),A=e=>{s=s.concat(e)},a=e=>{n=n.concat(e)},h=o.end.equals(r.start),l=h?null:new X(this.segments[this.segments.length-1].end,this.segments[0].start);for(i=0;i<this.segments.length;i++)i>0&&A(e.leftJoin(this.segments[i].start,this.segments[i-1].endTangent,this.segments[i].startTangent)),A(this.segments[i].strokeLeft(t));for(i=this.segments.length-1;i>=0;i--)i<this.segments.length-1&&a(e.rightJoin(this.segments[i].end,this.segments[i].endTangent,this.segments[i+1].startTangent)),a(this.segments[i].strokeRight(t));let g;return this.closed?(h?(A(e.leftJoin(o.end,o.endTangent,r.startTangent)),a(e.rightJoin(o.end,o.endTangent,r.startTangent))):(A(e.leftJoin(l.start,o.endTangent,l.startTangent)),A(l.strokeLeft(t)),A(e.leftJoin(l.end,l.endTangent,r.startTangent)),a(e.rightJoin(l.end,l.endTangent,r.startTangent)),a(l.strokeRight(t)),a(e.rightJoin(l.start,o.endTangent,l.startTangent))),g=[new Ce(s,void 0,!0),new Ce(n,void 0,!0)]):g=[new Ce(s.concat(e.cap(o.end,o.endTangent)).concat(n).concat(e.cap(r.start,r.startTangent.negated())),void 0,!0)],this._strokedSubpaths=g,this._strokedSubpathsComputed=!0,this._strokedStyles=e.copy(),g}dashed(e,t,i,s){const n=(e,t)=>{const i=e[e.length-1].concat(t[0]),s=e.slice(0,e.length-1).concat([i]).concat(t.slice(1));return s},r=(e,t)=>{if(!e.hasRightFilled||!t.hasLeftFilled)return!1;const i=_.last(_.last(e.segmentArrays)),s=t.segmentArrays[0][0];return i.end.distance(s.start)<1e-5},o=[];for(let A=0;A<this.segments.length;A++){const n=this.segments[A],r=n.getDashValues(e,t,i,s);o.push(r),t+=r.arcLength;const a=[0].concat(r.values).concat([1]),h=r.initiallyInside;r.hasLeftFilled=h,r.hasRightFilled=a.length%2==0?h:!h,r.segmentArrays=[];for(let e=h?0:1;e<a.length-1;e+=2)a[e]!==a[e+1]&&r.segmentArrays.push([n.slice(a[e],a[e+1])])}for(let A=o.length-1;A>=1;A--){const e=o[A-1],t=o[A];r(e,t)&&o.splice(A-1,2,{segmentArrays:n(e.segmentArrays,t.segmentArrays),hasLeftFilled:e.hasLeftFilled,hasRightFilled:t.hasRightFilled})}if(o.length>1&&r(o[o.length-1],o[0])){const e=o.pop(),t=o.shift();o.push({segmentArrays:n(e.segmentArrays,t.segmentArrays),hasLeftFilled:e.hasLeftFilled,hasRightFilled:t.hasRightFilled})}return this.closed&&1===o.length&&1===o[0].segmentArrays.length&&o[0].hasLeftFilled&&o[0].hasRightFilled?[new Ce(o[0].segmentArrays[0],void 0,!0)]:_.flatten(o.map(e=>e.segmentArrays)).map(e=>new Ce(e))}serialize(){return{type:"Subpath",segments:this.segments.map(e=>e.serialize()),points:this.points.map(e=>({x:e.x,y:e.y})),closed:this.closed}}static deserialize(e){return new Ce(e.segments.map(H.deserialize),e.points.map(e=>new I.Z(e.x,e.y)),e.closed)}}d.register("Subpath",Ce);const Ee=Ce;var Ye=i(6918);const De=Math.random,ye=(e,t)=>new I.Z(e,t),Ie=(e,t,i,s)=>i.copy().subtract(e).multiplyScalar((1-s)/6).add(t);class qe{constructor(e,t){if(_defineProperty(this,"subpaths",[]),_defineProperty(this,"_invalidatingPoints",!1),_defineProperty(this,"_immutable",!1),_defineProperty(this,"invalidatedEmitter",new J.Z),_defineProperty(this,"lastQuadraticControlPoint",null),_defineProperty(this,"lastCubicControlPoint",null),this._bounds=t?t.copy():null,this.resetControlPoints(),this._invalidateListener=this.invalidate.bind(this),"object"==typeof e)for(let i=0;i<e.length;i++)this.addSubpath(e[i]);e&&"object"!=typeof e&&_.each(K.parse(e),e=>{this[e.cmd].apply(this,e.args)}),this.invalidate()}resetControlPoints(){this.lastQuadraticControlPoint=null,this.lastCubicControlPoint=null}setQuadraticControlPoint(e){this.lastQuadraticControlPoint=e,this.lastCubicControlPoint=null}setCubicControlPoint(e){this.lastQuadraticControlPoint=null,this.lastCubicControlPoint=e}moveTo(e,t){return this.moveToPoint(ye(e,t))}moveToRelative(e,t){return this.moveToPointRelative(ye(e,t))}moveToPointRelative(e){return this.moveToPoint(this.getRelativePoint().plus(e))}moveToPoint(e){return this.addSubpath((new Ee).addPoint(e)),this.resetControlPoints(),this}lineTo(e,t){return this.lineToPoint(ye(e,t))}lineToRelative(e,t){return this.lineToPointRelative(ye(e,t))}lineToPointRelative(e){return this.lineToPoint(this.getRelativePoint().plus(e))}lineToPoint(e){if(this.hasSubpaths()){const t=this.getLastSubpath().getLastPoint(),i=e,s=new X(t,i);this.getLastSubpath().addPoint(i),this.addSegmentAndBounds(s)}else this.ensure(e);return this.resetControlPoints(),this}horizontalLineTo(e){return this.lineTo(e,this.getRelativePoint().y)}horizontalLineToRelative(e){return this.lineToRelative(e,0)}verticalLineTo(e){return this.lineTo(this.getRelativePoint().x,e)}verticalLineToRelative(e){return this.lineToRelative(0,e)}zigZagTo(e,t,i,s,n){return this.zigZagToPoint(new I.Z(e,t),i,s,n)}zigZagToPoint(e,t,i,s){this.ensure(e);const n=this.getLastPoint(),r=e.minus(n),o=r.normalized(),A=o.perpendicular.times(t);let a;a=s?r.magnitude/(i+.5):r.magnitude/i;for(let h=0;h<i;h++){const e=o.times(h*a).plus(n),t=e.plus(o.times(a/4)).plus(A),i=e.plus(o.times(3*a/4)).minus(A);this.lineToPoint(t),this.lineToPoint(i)}if(s){const e=o.times(i*a).plus(n).plus(o.times(a/4)).plus(A);this.lineToPoint(e)}return this.lineToPoint(e)}quadraticCurveTo(e,t,i,s){return this.quadraticCurveToPoint(ye(e,t),ye(i,s))}quadraticCurveToRelative(e,t,i,s){return this.quadraticCurveToPointRelative(ye(e,t),ye(i,s))}quadraticCurveToPointRelative(e,t){const i=this.getRelativePoint();return this.quadraticCurveToPoint(i.plus(e),i.plus(t))}smoothQuadraticCurveTo(e,t){return this.quadraticCurveToPoint(this.getSmoothQuadraticControlPoint(),ye(e,t))}smoothQuadraticCurveToRelative(e,t){return this.quadraticCurveToPoint(this.getSmoothQuadraticControlPoint(),ye(e,t).plus(this.getRelativePoint()))}quadraticCurveToPoint(e,t){this.ensure(e);const i=this.getLastSubpath().getLastPoint(),s=new se(i,e,t);this.getLastSubpath().addPoint(t);const n=s.getNondegenerateSegments();return _.each(n,e=>{this.addSegmentAndBounds(e)}),this.setQuadraticControlPoint(e),this}cubicCurveTo(e,t,i,s,n,r){return this.cubicCurveToPoint(ye(e,t),ye(i,s),ye(n,r))}cubicCurveToRelative(e,t,i,s,n,r){return this.cubicCurveToPointRelative(ye(e,t),ye(i,s),ye(n,r))}cubicCurveToPointRelative(e,t,i){const s=this.getRelativePoint();return this.cubicCurveToPoint(s.plus(e),s.plus(t),s.plus(i))}smoothCubicCurveTo(e,t,i,s){return this.cubicCurveToPoint(this.getSmoothCubicControlPoint(),ye(e,t),ye(i,s))}smoothCubicCurveToRelative(e,t,i,s){return this.cubicCurveToPoint(this.getSmoothCubicControlPoint(),ye(e,t).plus(this.getRelativePoint()),ye(i,s).plus(this.getRelativePoint()))}cubicCurveToPoint(e,t,i){this.ensure(e);const s=this.getLastSubpath().getLastPoint(),n=new ge(s,e,t,i).getNondegenerateSegments();return _.each(n,e=>{this.addSegmentAndBounds(e)}),this.getLastSubpath().addPoint(i),this.setCubicControlPoint(t),this}arc(e,t,i,s,n,r){return this.arcPoint(ye(e,t),i,s,n,r)}arcPoint(e,t,i,s,n){void 0===n&&(n=!1);const r=new de(e,t,i,s,n),o=r.getStart(),A=r.getEnd();return this.hasSubpaths()&&this.getLastSubpath().getLength()>0&&!o.equals(this.getLastSubpath().getLastPoint())&&this.addSegmentAndBounds(new X(this.getLastSubpath().getLastPoint(),o)),this.hasSubpaths()||this.addSubpath(new Ee),this.getLastSubpath().addPoint(o),this.getLastSubpath().addPoint(A),this.addSegmentAndBounds(r),this.resetControlPoints(),this}ellipticalArc(e,t,i,s,n,r,o,A){return this.ellipticalArcPoint(ye(e,t),i,s,n,r,o,A)}ellipticalArcPoint(e,t,i,s,n,r,o){void 0===o&&(o=!1);const A=new Be(e,t,i,s,n,r,o),a=A.start,h=A.end;return this.hasSubpaths()&&this.getLastSubpath().getLength()>0&&!a.equals(this.getLastSubpath().getLastPoint())&&this.addSegmentAndBounds(new X(this.getLastSubpath().getLastPoint(),a)),this.hasSubpaths()||this.addSubpath(new Ee),this.getLastSubpath().addPoint(a),this.getLastSubpath().addPoint(h),this.addSegmentAndBounds(A),this.resetControlPoints(),this}close(){if(this.hasSubpaths()){const e=this.getLastSubpath(),t=new Ee;e.close(),this.addSubpath(t),t.addPoint(e.getFirstPoint())}return this.resetControlPoints(),this}newSubpath(){return this.addSubpath(new Ee),this.resetControlPoints(),this}makeImmutable(){return this._immutable=!0,this.notifyInvalidationListeners(),this}isImmutable(){return this._immutable}ellipticalArcToRelative(e,t,i,s,n,r,o){const A=this.getRelativePoint();return this.ellipticalArcTo(e,t,i,s,n,r+A.x,o+A.y)}ellipticalArcTo(e,t,i,s,n,r,o){const A=new I.Z(r,o);this.ensure(A);const a=this.getLastSubpath().getLastPoint();this.getLastSubpath().addPoint(A),e<0&&(e*=-1),t<0&&(t*=-1);let h=e*e,l=t*t;const g=a.minus(A).dividedScalar(2).rotated(-i),c=g.x*g.x,d=g.y*g.y;let u=new I.Z(e*g.y/t,-t*g.x/e);const m=c/h+d/l;m>1&&(h=(e*=Math.sqrt(m))*e,l=(t*=Math.sqrt(m))*t,u=new I.Z(e*g.y/t,-t*g.x/e)),u.multiplyScalar(Math.sqrt(Math.max(0,(h*l-h*d-l*c)/(h*d+l*c)))),s===n&&u.multiplyScalar(-1);const p=a.blend(A,.5).plus(u.rotated(i)),V=(e,t)=>(e.x*t.y-e.y*t.x>0?1:-1)*e.angleBetween(t),M=new I.Z((g.x-u.x)/e,(g.y-u.y)/t),B=new I.Z((-g.x-u.x)/e,(-g.y-u.y)/t),w=V(I.Z.X_UNIT,M);let C=V(M,B)%(2*Math.PI);!n&&C>0&&(C-=2*Math.PI),n&&C<0&&(C+=2*Math.PI);const E=new Be(p,e,t,i,w,w+C,!n).getNondegenerateSegments();return _.each(E,e=>{this.addSegmentAndBounds(e)}),this}circle(e,t,i){if("object"==typeof e){const s=e;return i=t,this.arcPoint(s,i,0,2*Math.PI,!1).close()}return this.arcPoint(ye(e,t),i,0,2*Math.PI,!1).close()}ellipse(e,t,i,s,n){if("object"==typeof e){const r=e;return n=s,s=i,i=t,this.ellipticalArcPoint(r,i,s,n||0,0,2*Math.PI,!1).close()}return this.ellipticalArcPoint(ye(e,t),i,s,n||0,0,2*Math.PI,!1).close()}rect(e,t,i,s){const n=new Ee;return this.addSubpath(n),n.addPoint(ye(e,t)),n.addPoint(ye(e+i,t)),n.addPoint(ye(e+i,t+s)),n.addPoint(ye(e,t+s)),this.addSegmentAndBounds(new X(n.points[0],n.points[1])),this.addSegmentAndBounds(new X(n.points[1],n.points[2])),this.addSegmentAndBounds(new X(n.points[2],n.points[3])),n.close(),this.addSubpath(new Ee),this.getLastSubpath().addPoint(ye(e,t)),this.resetControlPoints(),this}roundRect(e,t,i,s,n,r){const o=e+n,A=e+i-n,a=t+r,h=t+s-r;return n===r?this.arc(A,a,n,-Math.PI/2,0,!1).arc(A,h,n,0,Math.PI/2,!1).arc(o,h,n,Math.PI/2,Math.PI,!1).arc(o,a,n,Math.PI,3*Math.PI/2,!1).close():this.ellipticalArc(A,a,n,r,0,-Math.PI/2,0,!1).ellipticalArc(A,h,n,r,0,0,Math.PI/2,!1).ellipticalArc(o,h,n,r,0,Math.PI/2,Math.PI,!1).ellipticalArc(o,a,n,r,0,Math.PI,3*Math.PI/2,!1).close(),this}polygon(e){const t=e.length;if(t>0){this.moveToPoint(e[0]);for(let i=1;i<t;i++)this.lineToPoint(e[i])}return this.close()}cardinalSpline(e,t){const i=(0,v.ZP)()({tension:0,isClosedLineSegments:!1},t),s=e.length,n=i.isClosedLineSegments?s:s-1;for(let r=0;r<n;r++){let t;t=0!==r||i.isClosedLineSegments?r!==n-1||i.isClosedLineSegments?[e[(r-1+s)%s],e[r%s],e[(r+1)%s],e[(r+2)%s]]:[e[r-1],e[r],e[r+1],e[r+1]]:[e[0],e[0],e[1],e[2]];const o=[t[1],Ie(t[0],t[1],t[2],i.tension),Ie(t[3],t[2],t[1],i.tension),t[2]];0===r&&(this.ensure(o[0]),this.getLastSubpath().addPoint(o[0])),this.cubicCurveToPoint(o[1],o[2],o[3])}return this}copy(){return new qe(_.map(this.subpaths,e=>e.copy()),this.bounds)}writeToContext(e){const t=this.subpaths.length;for(let i=0;i<t;i++)this.subpaths[i].writeToContext(e)}getSVGPath(){let e="";const t=this.subpaths.length;for(let i=0;i<t;i++){const t=this.subpaths[i];if(t.isDrawable()){const i=t.segments[0].start;e+=`M ${Y(i.x)} ${Y(i.y)} `;for(let s=0;s<t.segments.length;s++)e+=t.segments[s].getSVGPathFragment()+" ";t.isClosed()&&(e+="Z ")}}return e}transformed(e){const t=_.map(this.subpaths,t=>t.transformed(e)),i=_.reduce(t,(e,t)=>e.union(t.bounds),j.Z.NOTHING);return new qe(t,i)}nonlinearTransformed(e){const t=(0,v.JA)({minLevels:0,maxLevels:7,distanceEpsilon:.16,curveEpsilon:e&&e.includeCurvature?.002:null},e),i=_.map(this.subpaths,e=>e.nonlinearTransformed(t)),s=_.reduce(i,(e,t)=>e.union(t.bounds),j.Z.NOTHING);return new qe(i,s)}polarToCartesian(e){return this.nonlinearTransformed((0,v.JA)({pointMap:e=>I.Z.createPolar(e.y,e.x),methodName:"polarToCartesian"},e))}toPiecewiseLinear(e){return this.nonlinearTransformed(e)}containsPoint(e){const t=I.Z.X_UNIT.copy();let i=0;for(;i<5;){if(i++,!_.some(this.subpaths,i=>_.some(i.segments,i=>{const s=i.start.minus(e),n=s.magnitude;return 0!==n&&(s.divideScalar(n),s.subtract(t),s.magnitudeSquared<1e-9)})))break;t.rotate(Ye.Z.nextDouble())}return 0!==this.windingIntersection(new S.Z(e,t))}intersection(e){let t=[];const i=this.subpaths.length;for(let s=0;s<i;s++){const i=this.subpaths[s];if(i.isDrawable()){const s=i.segments.length;for(let n=0;n<s;n++){const s=i.segments[n];t=t.concat(s.intersection(e))}i.hasClosingSegment()&&(t=t.concat(i.getClosingSegment().intersection(e)))}}return _.sortBy(t,e=>e.distance)}interiorIntersectsLineSegment(e,t){const i=e.blend(t,.5);if(this.containsPoint(i))return!0;const s=t.minus(e),n=s.magnitude;if(0===n)return!1;s.normalize();const r=this.intersection(new S.Z(e,s));for(let o=0;o<r.length;o++)if(r[o].distance<=n)return!0;return!1}windingIntersection(e){let t=0;const i=this.subpaths.length;for(let s=0;s<i;s++){const i=this.subpaths[s];if(i.isDrawable()){const s=i.segments.length;for(let n=0;n<s;n++)t+=i.segments[n].windingIntersection(e);i.hasClosingSegment()&&(t+=i.getClosingSegment().windingIntersection(e))}}return t}intersectsBounds(e){if(this.bounds.intersection(e).equals(this.bounds))return!0;const t=new S.Z(new I.Z(e.minX,e.minY),new I.Z(1,0)),i=new S.Z(new I.Z(e.minX,e.minY),new I.Z(0,1)),s=new S.Z(new I.Z(e.maxX,e.maxY),new I.Z(-1,0)),n=new S.Z(new I.Z(e.maxX,e.maxY),new I.Z(0,-1));let r,o;const A=this.intersection(t).concat(this.intersection(s));for(o=0;o<A.length;o++)if(r=A[o].point,r.x>=e.minX&&r.x<=e.maxX)return!0;const a=this.intersection(i).concat(this.intersection(n));for(o=0;o<a.length;o++)if(r=a[o].point,r.y>=e.minY&&r.y<=e.maxY)return!0;return!1}getStrokedShape(e){let t=[];const i=j.Z.NOTHING.copy();let s=this.subpaths.length;for(let n=0;n<s;n++){const i=this.subpaths[n].stroked(e);t=t.concat(i)}s=t.length;for(let n=0;n<s;n++)i.includeBounds(t[n].bounds);return new qe(t,i)}getOffsetShape(e){const t=[],i=j.Z.NOTHING.copy();let s=this.subpaths.length;for(let n=0;n<s;n++)t.push(this.subpaths[n].offset(e));s=t.length;for(let n=0;n<s;n++)i.includeBounds(t[n].bounds);return new qe(t,i)}getDashedShape(e,t,i){const s=(0,v.ZP)()({distanceEpsilon:1e-10,curveEpsilon:1e-8},i);return new qe(_.flatten(this.subpaths.map(i=>i.dashed(e,t,s.distanceEpsilon,s.curveEpsilon))))}getBounds(){if(null===this._bounds){const e=j.Z.NOTHING.copy();_.each(this.subpaths,t=>{e.includeBounds(t.getBounds())}),this._bounds=e}return this._bounds}get bounds(){return this.getBounds()}getStrokedBounds(e){let t=!0;for(let i=0;i<this.subpaths.length;i++){const e=this.subpaths[i];if(e.isDrawable()&&!e.isClosed()){t=!1;break}for(let i=0;i<e.segments.length;i++){if(!e.segments[i].areStrokedBoundsDilated()){t=!1;break}}}if(t)return this.bounds.dilated(e.lineWidth/2);{const t=this.bounds.copy();for(let i=0;i<this.subpaths.length;i++){const s=this.subpaths[i].stroked(e);for(let e=0;e<s.length;e++)t.includeBounds(s[e].bounds)}return t}}getSimplifiedAreaShape(){return ot.simplifyNonZero(this)}getBoundsWithTransform(e,t){const i=j.Z.NOTHING.copy(),s=this.subpaths.length;for(let n=0;n<s;n++){const t=this.subpaths[n];i.includeBounds(t.getBoundsWithTransform(e))}return t&&i.includeBounds(this.getStrokedShape(t).getBoundsWithTransform(e)),i}getApproximateArea(e){const t=this.bounds.minX,i=this.bounds.minY,s=this.bounds.width,n=this.bounds.height,r=s*n;let o=0;const A=new I.Z(0,0);for(let a=0;a<e;a++)A.x=t+De()*s,A.y=i+De()*n,this.containsPoint(A)&&o++;return r*o/e}getNonoverlappingArea(){return Math.abs(_.sum(this.subpaths.map(e=>_.sum(e.getFillSegments().map(e=>e.getSignedAreaFragment())))))}getArea(){return this.getSimplifiedAreaShape().getNonoverlappingArea()}getApproximateCentroid(e){const t=this.bounds.minX,i=this.bounds.minY,s=this.bounds.width,n=this.bounds.height;let r=0;const o=new I.Z(0,0),A=new I.Z(0,0);for(let a=0;a<e;a++)A.x=t+De()*s,A.y=i+De()*n,this.containsPoint(A)&&(o.add(A),r++);return o.dividedScalar(r)}getClosestPoints(e){return H.filterClosestToPointResult(_.flatten(this.subpaths.map(t=>t.getClosestPoints(e))))}getClosestPoint(e){return this.getClosestPoints(e)[0].closestPoint}invalidatePoints(){this._invalidatingPoints=!0;const e=this.subpaths.length;for(let t=0;t<e;t++)this.subpaths[t].invalidatePoints();this._invalidatingPoints=!1,this.invalidate()}toString(){return`new phet.kite.Shape( '${this.getSVGPath()}' )`}invalidate(){this._invalidatingPoints||(this._bounds=null,this.notifyInvalidationListeners())}notifyInvalidationListeners(){this.invalidatedEmitter.emit()}addSegmentAndBounds(e){this.getLastSubpath().addSegment(e),this.invalidate()}ensure(e){this.hasSubpaths()||(this.addSubpath(new Ee),this.getLastSubpath().addPoint(e))}addSubpath(e){return this.subpaths.push(e),e.invalidatedEmitter.addListener(this._invalidateListener),this.invalidate(),this}hasSubpaths(){return this.subpaths.length>0}getLastSubpath(){return _.last(this.subpaths)}getLastPoint(){return this.getLastSubpath().getLastPoint()}getLastSegment(){if(!this.hasSubpaths())return null;const e=this.getLastSubpath();return e.isDrawable()?e.getLastSegment():null}getSmoothQuadraticControlPoint(){const e=this.getLastPoint();return this.lastQuadraticControlPoint?e.plus(e.minus(this.lastQuadraticControlPoint)):e}getSmoothCubicControlPoint(){const e=this.getLastPoint();return this.lastCubicControlPoint?e.plus(e.minus(this.lastCubicControlPoint)):e}getRelativePoint(){let e=I.Z.ZERO;if(this.hasSubpaths()){const t=this.getLastSubpath();t.points.length&&(e=t.getLastPoint())}return e}shapeUnion(e){return ot.binaryResult(this,e,ot.BINARY_NONZERO_UNION)}shapeIntersection(e){return ot.binaryResult(this,e,ot.BINARY_NONZERO_INTERSECTION)}shapeDifference(e){return ot.binaryResult(this,e,ot.BINARY_NONZERO_DIFFERENCE)}shapeXor(e){return ot.binaryResult(this,e,ot.BINARY_NONZERO_XOR)}shapeClip(e,t){return ot.clipShape(e,this,t)}getArcLength(e,t,i){let s=0;for(let n=0;n<this.subpaths.length;n++)s+=this.subpaths[n].getArcLength(e,t,i);return s}serialize(){return{type:"Shape",subpaths:this.subpaths.map(e=>e.serialize())}}static deserialize(e){return new qe(e.subpaths.map(Ee.deserialize))}static rectangle(e,t,i,s){return(new qe).rect(e,t,i,s)}static roundRect(e,t,i,s,n,r){return(new qe).roundRect(e,t,i,s,n,r)}static roundedRectangleWithRadii(e,t,i,s,n){let r=n&&n.topLeft||0,o=n&&n.topRight||0,A=n&&n.bottomLeft||0,a=n&&n.bottomRight||0;const h=r+o;h>i&&h>0&&(r=r/h*i,o=o/h*i);const l=A+a;l>i&&l>0&&(A=A/l*i,a=a/l*i);const g=r+A;g>s&&g>0&&(r=r/g*s,A=A/g*s);const c=o+a;c>s&&c>0&&(o=o/c*s,a=a/c*s);const d=new qe,u=e+i,m=t+s;return a>0?d.arc(u-a,m-a,a,0,Math.PI/2,!1):d.moveTo(u,m),A>0?d.arc(e+A,m-A,A,Math.PI/2,Math.PI,!1):d.lineTo(e,m),r>0?d.arc(e+r,t+r,r,Math.PI,3*Math.PI/2,!1):d.lineTo(e,t),o>0?d.arc(u-o,t+o,o,3*Math.PI/2,2*Math.PI,!1):d.lineTo(u,t),d.close(),d}static boundsOffsetWithRadii(e,t,i){const s=e.withOffsets(t.left,t.top,t.right,t.bottom);return qe.roundedRectangleWithRadii(s.minX,s.minY,s.width,s.height,i)}static polygon(e){return(new qe).polygon(e)}static bounds(e){return(new qe).rect(e.minX,e.minY,e.maxX-e.minX,e.maxY-e.minY)}static lineSegment(e,t,i,s){return"number"==typeof e?(new qe).moveTo(e,t).lineTo(i,s):(new qe).moveToPoint(e).lineToPoint(t)}static regularPolygon(e,t){const i=new qe;return _.each(_.range(e),s=>{const n=I.Z.createPolar(t,2*Math.PI*s/e);0===s?i.moveToPoint(n):i.lineToPoint(n)}),i.close()}static circle(e,t,i){return void 0===t?(new qe).circle(0,0,e):(new qe).circle(e,t,i)}static ellipse(e,t,i,s,n){return void 0===s?(new qe).ellipse(0,0,e,t,i):(new qe).ellipse(e,t,i,s,n)}static arc(e,t,i,s,n,r){return(new qe).arc(e,t,i,s,n,r)}static union(e){return ot.unionNonZero(e)}static intersection(e){return ot.intersectionNonZero(e)}static xor(e){return ot.xorNonZero(e)}static segments(e,t){return new qe([new Ee(e,void 0,!!t)])}}_defineProperty(qe,"rect",(n=qe).rectangle),_defineProperty(qe,"roundRectangle",n.roundRect),d.register("Shape",qe);const Ge=qe;var Qe=i(7232);let Se=0;class Te{constructor(e,t){this.id=++Se,this.initialize(e,t)}initialize(e,t){return this.edge=e,this.face=null,this.isReversed=t,this.signedAreaFragment=e.signedAreaFragment*(t?-1:1),this.startVertex=null,this.endVertex=null,this.sortVector=this.sortVector||new I.Z(0,0),this.data=null,this.updateReferences(),this}serialize(){return{type:"HalfEdge",id:this.id,edge:this.edge.id,face:null===this.face?null:this.face.id,isReversed:this.isReversed,signedAreaFragment:this.signedAreaFragment,startVertex:null===this.startVertex?null:this.startVertex.id,endVertex:null===this.endVertex?null:this.endVertex.id,sortVector:I.Z.Vector2IO.toStateObject(this.sortVector),data:this.data}}dispose(){this.edge=null,this.face=null,this.startVertex=null,this.endVertex=null,this.data=null,this.freeToPool()}getNext(e){for(let t=1;;t++){let i=this.endVertex.incidentHalfEdges.indexOf(this)-t;i<0&&(i+=this.endVertex.incidentHalfEdges.length);const s=this.endVertex.incidentHalfEdges[i].getReversed();if(!e||e(s.edge))return s}}updateReferences(){this.startVertex=this.isReversed?this.edge.endVertex:this.edge.startVertex,this.endVertex=this.isReversed?this.edge.startVertex:this.edge.endVertex}getEndTangent(){return this.isReversed?this.edge.segment.startTangent:this.edge.segment.endTangent.negated()}getEndCurvature(){return this.isReversed?-this.edge.segment.curvatureAt(0):this.edge.segment.curvatureAt(1)}getReversed(){return this.isReversed?this.edge.forwardHalf:this.edge.reversedHalf}getDirectionalSegment(){return this.isReversed?this.edge.segment.reversed():this.edge.segment}freeToPool(){Te.pool.freeToPool(this)}}r=Te,_defineProperty(Te,"pool",new Qe.Z(r)),d.register("HalfEdge",Te);const xe=Te;var ke=i(5853);let Fe=0;class Re{constructor(e){this.id=++Fe,this.initialize(e)}initialize(e){return this.point=e,this.incidentHalfEdges=(0,ke.Z)(this.incidentHalfEdges),this.visited=!1,this.visitIndex=0,this.lowIndex=0,this.data=null,this.internalData={},this}serialize(){return{type:"Vertex",id:this.id,point:I.Z.Vector2IO.toStateObject(this.point),incidentHalfEdges:this.incidentHalfEdges.map(e=>e.id),visited:this.visited,visitIndex:this.visitIndex,lowIndex:this.lowIndex}}dispose(){this.point=I.Z.ZERO,(0,ke.Z)(this.incidentHalfEdges),this.freeToPool()}sortEdges(){const e=[];for(let s=0;s<this.incidentHalfEdges.length;s++){const t=this.incidentHalfEdges[s];e.push(t.sortVector.setXY(t.getEndTangent().angle,t.getEndCurvature()))}const t=1e-4-Math.PI;let i=!1;for(;!i;){i=!0;for(let s=0;s<e.length;s++)e[s].x<t&&(i=!1);if(!i)for(let t=0;t<e.length;t++){const i=e[t];i.x-=1.62594024516,i.x<-Math.PI-1e-4&&(i.x+=2*Math.PI)}}this.incidentHalfEdges.sort(Re.edgeComparison)}static edgeComparison(e,t){const i=e.sortVector.x,s=t.sortVector.x;if(Math.abs(i-s)>1e-5||i!==s&&e.edge.segment instanceof X&&t.edge.segment instanceof X)return i<s?-1:1;{const i=e.sortVector.y,s=t.sortVector.y;if(Math.abs(i-s)>1e-5)return i<s?1:-1;{const i=.999;return e.getDirectionalSegment().subdivided(i)[1].curvatureAt(0)<t.getDirectionalSegment().subdivided(i)[1].curvatureAt(0)?1:-1}}}freeToPool(){Re.pool.freeToPool(this)}}o=Re,_defineProperty(Re,"pool",new Qe.Z(o)),d.register("Vertex",Re);const Ue=Re;let Le=0;class Pe{constructor(e,t,i){this.id=++Le,this.initialize(e,t,i)}initialize(e,t,i){return this.segment=e,this.startVertex=t,this.endVertex=i,this.signedAreaFragment=e.getSignedAreaFragment(),this.forwardHalf=xe.pool.create(this,!1),this.reversedHalf=xe.pool.create(this,!0),this.visited=!1,this.data=null,this.internalData={},this}serialize(){return{type:"Edge",id:this.id,segment:this.segment.serialize(),startVertex:null===this.startVertex?null:this.startVertex.id,endVertex:null===this.endVertex?null:this.endVertex.id,signedAreaFragment:this.signedAreaFragment,forwardHalf:this.forwardHalf.serialize(),reversedHalf:this.reversedHalf.serialize(),visited:this.visited,data:this.data}}dispose(){this.segment=null,this.startVertex=null,this.endVertex=null,this.forwardHalf.dispose(),this.reversedHalf.dispose(),this.forwardHalf=null,this.reversedHalf=null,this.data=null,this.freeToPool()}getOtherVertex(e){return this.startVertex===e?this.endVertex:this.startVertex}updateReferences(){this.forwardHalf.updateReferences(),this.reversedHalf.updateReferences()}freeToPool(){Pe.pool.freeToPool(this)}}A=Pe,_defineProperty(Pe,"pool",new Qe.Z(A)),d.register("Edge",Pe);const be=Pe;let Oe=0;class fe{constructor(e){this.id=++Oe,this.initialize(e)}initialize(e){return this.boundary=e,this.holes=(0,ke.Z)(this.holes),this.windingMap=null,this.filled=null,e&&this.addBoundaryFaceReferences(e),this}serialize(){return{type:"Face",id:this.id,boundary:null===this.boundary?null:this.boundary.id,holes:this.holes.map(e=>e.id),windingMap:this.windingMap,filled:this.filled}}dispose(){this.boundary=null,(0,ke.Z)(this.holes),this.windingMap=null,this.filled=null,this.freeToPool()}addBoundaryFaceReferences(e){for(let t=0;t<e.halfEdges.length;t++)e.halfEdges[t].face=this}recursivelyAddHoles(e){this.holes.push(e),this.addBoundaryFaceReferences(e);for(let t=0;t<e.childBoundaries.length;t++)this.recursivelyAddHoles(e.childBoundaries[t])}freeToPool(){fe.pool.freeToPool(this)}}a=fe,_defineProperty(fe,"pool",new Qe.Z(a)),d.register("Face",fe);const Ze=fe;let Ne=0;class Ke{constructor(e,t){this.id=++Ne,this.initialize(e,t)}initialize(e,t){return this.shapeId=e,this.closed=t,this.halfEdges=(0,ke.Z)(this.halfEdges),this}serialize(){return{type:"Loop",id:this.id,shapeId:this.shapeId,closed:this.closed,halfEdges:this.halfEdges.map(e=>e.id)}}toSubpath(){const e=[];for(let t=0;t<this.halfEdges.length;t++)e.push(this.halfEdges[t].getDirectionalSegment());return new Ee(e,void 0,this.closed)}dispose(){(0,ke.Z)(this.halfEdges),this.freeToPool()}freeToPool(){Ke.pool.freeToPool(this)}}h=Ke,_defineProperty(Ke,"pool",new Qe.Z(h)),d.register("Loop",Ke);const Je=Ke;let je=0;class ve{constructor(e){this.id=++je,this.initialize(e)}initialize(e){return this.halfEdges=e,this.signedArea=this.computeSignedArea(),this.bounds=this.computeBounds(),this.childBoundaries=(0,ke.Z)(this.childBoundaries),this}serialize(){return{type:"Boundary",id:this.id,halfEdges:this.halfEdges.map(e=>e.id),signedArea:this.signedArea,bounds:j.Z.Bounds2IO.toStateObject(this.bounds),childBoundaries:this.childBoundaries.map(e=>e.id)}}dispose(){this.halfEdges=[],(0,ke.Z)(this.childBoundaries),this.freeToPool()}isInner(){return this.signedArea>0}computeSignedArea(){let e=0;for(let t=0;t<this.halfEdges.length;t++)e+=this.halfEdges[t].signedAreaFragment;return e}computeBounds(){const e=j.Z.NOTHING.copy();for(let t=0;t<this.halfEdges.length;t++)e.includeBounds(this.halfEdges[t].edge.segment.getBounds());return e}computeExtremePoint(e){const t=[];for(let s=0;s<this.halfEdges.length;s++)t.push(this.halfEdges[s].edge.segment.transformed(e.getMatrix()));const i=j.Z.NOTHING.copy();for(let s=0;s<t.length;s++)i.includeBounds(t[s].getBounds());for(let s=0;s<t.length;s++){const n=t[s];if(n.getBounds().top===i.top){let t=new I.Z(0,Number.POSITIVE_INFINITY);const i=[0,1].concat(n.getInteriorExtremaTs());for(let e=0;e<i.length;e++){const s=n.positionAt(i[e]);s.y<t.y&&(t=s)}return e.inversePosition2(t)}}throw new Error("Should not reach here if we have segments")}computeExtremeRay(e){const t=this.computeExtremePoint(e),i=e.inverseDelta2(new I.Z(0,-1)).normalized();return new S.Z(t.plus(i.timesScalar(1e-4)),i)}hasHalfEdge(e){for(let t=0;t<this.halfEdges.length;t++)if(this.halfEdges[t]===e)return!0;return!1}toSubpath(){const e=[];for(let t=0;t<this.halfEdges.length;t++)e.push(this.halfEdges[t].getDirectionalSegment());return new Ee(e,null,!0)}freeToPool(){ve.pool.freeToPool(this)}}l=ve,_defineProperty(ve,"pool",new Qe.Z(l)),d.register("Boundary",ve);const He=ve;class We{constructor(e,t,i,s,n,r,o,A,a,h){this.initialize(e,t,i,s,n,r,o,A,a,h)}initialize(e,t,i,s,n,r,o,A,a,h){return this.a=e,this.b=t,this.atMin=i,this.atMax=s,this.btMin=n,this.btMax=r,this.aMin=o,this.aMax=A,this.bMin=a,this.bMax=h,this}pushSubdivisions(e){const t=this,i=(t.atMax+t.atMin)/2,s=(t.btMax+t.btMin)/2;if(i===this.atMin||i===this.atMax||s===this.btMin||s===this.btMax)return void e.push(this);const n=t.a.positionAt(i),r=t.b.positionAt(s);We.boxIntersects(t.aMin,n,t.bMin,r)&&e.push(We.pool.create(t.a,t.b,t.atMin,i,t.btMin,s,t.aMin,n,t.bMin,r)),We.boxIntersects(n,t.aMax,t.bMin,r)&&e.push(We.pool.create(t.a,t.b,i,t.atMax,t.btMin,s,n,t.aMax,t.bMin,r)),We.boxIntersects(t.aMin,n,r,t.bMax)&&e.push(We.pool.create(t.a,t.b,t.atMin,i,s,t.btMax,t.aMin,n,r,t.bMax)),We.boxIntersects(n,t.aMax,r,t.bMax)&&e.push(We.pool.create(t.a,t.b,i,t.atMax,s,t.btMax,n,t.aMax,r,t.bMax)),this.freeToPool()}distance(e){const t=this.atMin-e.atMin,i=this.atMax-e.atMax,s=this.btMin-e.btMin,n=this.btMax-e.btMax;return t*t+i*i+s*s+n*n}clean(){this.a=null,this.b=null,this.aMin=null,this.aMax=null,this.bMin=null,this.bMax=null}static intersect(e,t){if(!e.bounds.intersectsBounds(t.bounds))return[];const i=We.getIntersectionRanges(e,t),s=[];for(let r=0;r<i.length;r++){const e=i[r];let t=!1;e:for(let i=0;i<s.length;i++){const n=s[i];for(let i=0;i<n.length;i++){const s=n[i];if(e.distance(s)<1e-13){n.push(e),t=!0;break e}}}t||s.push([e])}const n=[];for(let r=0;r<s.length;r++){const i=s[r];let o=0,A=0;for(let e=0;e<i.length;e++)o+=i[e].atMin+i[e].atMax,A+=i[e].btMin+i[e].btMax;o/=2*i.length,A/=2*i.length;const a=e.positionAt(o),h=t.positionAt(A);n.push(new C(a.average(h),o,A))}for(let r=0;r<i.length;r++)i[r].freeToPool();return We.cleanPool(),n}static getIntersectionRanges(e,t){const i=e.getInteriorExtremaTs(),s=t.getInteriorExtremaTs(),n=_.zip([0].concat(i),i.concat([1])),r=_.zip([0].concat(s),s.concat([1]));let o=[];for(let A=0;A<n.length;A++)for(let i=0;i<r.length;i++){const s=n[A][0],a=n[A][1],h=r[i][0],l=r[i][1],g=e.positionAt(s),c=e.positionAt(a),d=t.positionAt(h),u=t.positionAt(l);We.boxIntersects(g,c,d,u)&&o.push(We.pool.create(e,t,s,a,h,l,g,c,d,u))}for(let A=0;A<50;A++){const e=[];for(let t=o.length-1;t>=0;t--)o[t].pushSubdivisions(e);o=e}return o}static boxIntersects(e,t,i,s){const n=Math.max(Math.min(e.x,t.x),Math.min(i.x,s.x)),r=Math.max(Math.min(e.y,t.y),Math.min(i.y,s.y)),o=Math.min(Math.max(e.x,t.x),Math.max(i.x,s.x)),A=Math.min(Math.max(e.y,t.y),Math.max(i.y,s.y));return o-n>=0&&A-r>=0}static cleanPool(){We.pool.forEach(e=>e.clean())}freeToPool(){We.pool.freeToPool(this)}}g=We,_defineProperty(We,"pool",new Qe.Z(g)),d.register("BoundsIntersection",We);var ze=i(9059);let Xe=1;const _e=[];class $e{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e-6;this.rootNode=et.pool.create(this,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY),this.rootNode.isBlack=!0,this.epsilon=e,this.items=new Set}query(e,t){const i=Xe++;return!!this.rootNode&&this.rootNode.query(e,this.getMinX(e,this.epsilon),this.getMaxX(e,this.epsilon),i,t)}addItem(e){const t=this.getMinX(e,this.epsilon),i=this.getMaxX(e,this.epsilon);this.rootNode.split(t,this),this.rootNode.split(i,this),this.rootNode.addItem(e,t,i),this.items.add(e)}removeItem(e){this.rootNode.removeItem(e,this.getMinX(e,this.epsilon),this.getMaxX(e,this.epsilon)),this.items.delete(e)}audit(){this.rootNode.audit(this.epsilon,this.items,[])}toString(){let e=0,t="";return function i(s){t+=`${_.repeat("  ",e)}${s.toString()}\n`,e++,s.hasChildren()&&(i(s.left),i(s.right)),e--}(this.rootNode),t}}class et{constructor(e,t,i){this.items=[],this.initialize(e,t,i)}initialize(e,t,i){return this.min=t,this.max=i,this.splitValue=null,this.left=null,this.right=null,this.parent=null,this.tree=e,this.isBlack=!1,(0,ke.Z)(this.items),this}contains(e){return e>=this.min&&e<=this.max}hasChildren(){return null!==this.splitValue}query(e,t,i,s,n){let r=!1;if(this.min<=i&&this.max>=t){for(let e=0;e<this.items.length;e++){var o,A;const t=this.items[e];if((null===(o=t.internalData)||void 0===o||!o.segmentId||(null===(A=t.internalData)||void 0===A?void 0:A.segmentId)<s)&&(t.internalData.segmentId=s,r=n(t),r))return!0}this.hasChildren()&&(r||(r=this.left.query(e,t,i,s,n)),r||(r=this.right.query(e,t,i,s,n)))}return r}swapChild(e,t){this.left===e?this.left=t:this.right=t}hasChild(e){return this.left===e||this.right===e}otherChild(e){return this.left===e?this.right:this.left}leftRotate(e){if(this.right.hasChildren()){const t=this.right,i=this.left,s=t.left,n=t.right;t.parent=this.parent,this.parent?this.parent.swapChild(this,t):e.rootNode=t,this.parent=t,s.parent=this,t.left=this,this.left=i,this.right=s,this.max=s.max,this.splitValue=i.max,t.min=this.min,t.splitValue=this.max;const r=(0,ke.Z)(_e);r.push(...this.items),(0,ke.Z)(this.items);for(let e=i.items.length-1;e>=0;e--){const t=i.items[e],n=s.items.indexOf(t);n>=0&&(i.items.splice(e,1),s.items.splice(n,1),this.items.push(t))}s.items.push(...t.items),n.items.push(...t.items),(0,ke.Z)(t.items),t.items.push(...r)}}rightRotate(e){const t=this.left,i=this.right,s=t.left,n=t.right;t.parent=this.parent,this.parent?this.parent.swapChild(this,t):e.rootNode=t,this.parent=t,n.parent=this,t.right=this,this.left=n,this.right=i,this.min=n.min,this.splitValue=i.min,t.max=this.max,t.splitValue=this.min;const r=(0,ke.Z)(_e);r.push(...this.items),(0,ke.Z)(this.items);for(let o=i.items.length-1;o>=0;o--){const e=i.items[o],t=n.items.indexOf(e);t>=0&&(i.items.splice(o,1),n.items.splice(t,1),this.items.push(e))}s.items.push(...t.items),n.items.push(...t.items),(0,ke.Z)(t.items),t.items.push(...r)}fixRedBlack(e){if(this.parent){const t=this.parent;if(!t.isBlack){const i=t.parent,s=i.otherChild(t);s.isBlack?t===i.left?this===t.right?(t.leftRotate(e),t.parent.isBlack=!0,t.parent.parent.isBlack=!1,t.parent.parent.rightRotate(e)):(t.isBlack=!0,i.isBlack=!1,i.rightRotate(e)):this===t.left?(t.rightRotate(e),t.parent.isBlack=!0,t.parent.parent.isBlack=!1,t.parent.parent.leftRotate(e)):(t.isBlack=!0,i.isBlack=!1,i.leftRotate(e)):(t.isBlack=!0,s.isBlack=!0,i.isBlack=!1,i.fixRedBlack(e))}}else this.isBlack=!0}split(e,t){if(e!==this.min&&e!==this.max)if(this.hasChildren())this.splitValue!==e&&(e>this.splitValue?this.right:this.left).split(e,t);else{this.splitValue=e;const i=et.pool.create(this.tree,this.min,e);i.parent=this,this.left=i;const s=et.pool.create(this.tree,e,this.max);if(s.parent=this,this.right=s,!this.isBlack&&this.parent){const e=this.parent,n=e.otherChild(this);n.isBlack?(this===e.left?(e.rightRotate(t),i.isBlack=!0):(e.leftRotate(t),s.isBlack=!0),this.fixRedBlack(t)):(this.isBlack=!0,n.isBlack=!0,e.isBlack=!1,e.fixRedBlack(t))}}}addItem(e,t,i){this.min>i||this.max<t||(this.min>=t&&this.max<=i?this.items.push(e):this.hasChildren()&&(this.left.addItem(e,t,i),this.right.addItem(e,t,i)))}removeItem(e,t,i){this.min>i||this.max<t||(this.min>=t&&this.max<=i?(0,ze.Z)(this.items,e):this.hasChildren()&&(this.left.removeItem(e,t,i),this.right.removeItem(e,t,i)))}audit(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]}toString(){return`[${this.min} ${this.max}] split:${this.splitValue} ${this.isBlack?"black":"red"} ${this.items}`}freeToPool(){et.pool.freeToPool(this)}}c=et,_defineProperty(et,"pool",new Qe.Z(c)),d.register("SegmentTree",$e);class tt extends $e{getMinX(e,t){return e.segment.bounds.left-t}getMaxX(e,t){return e.segment.bounds.right+t}}d.register("EdgeSegmentTree",tt);class it extends $e{getMinX(e,t){return e.point.x-t}getMaxX(e,t){return e.point.x+t}}d.register("VertexSegmentTree",it);let st=0,nt=0;class rt{constructor(){this.vertices=[],this.edges=[],this.innerBoundaries=[],this.outerBoundaries=[],this.boundaries=[],this.shapeIds=[],this.loops=[],this.unboundedFace=Ze.pool.create(null),this.faces=[this.unboundedFace]}serialize(){return{type:"Graph",vertices:this.vertices.map(e=>e.serialize()),edges:this.edges.map(e=>e.serialize()),boundaries:this.boundaries.map(e=>e.serialize()),innerBoundaries:this.innerBoundaries.map(e=>e.id),outerBoundaries:this.outerBoundaries.map(e=>e.id),shapeIds:this.shapeIds,loops:this.loops.map(e=>e.serialize()),unboundedFace:this.unboundedFace.id,faces:this.faces.map(e=>e.serialize())}}static deserialize(e){const t=new rt,i={},s={},n={},r={},o={},A={};return t.vertices=e.vertices.map(e=>{const t=new Ue(I.Z.Vector2IO.fromStateObject(e.point));return i[e.id]=t,t.visited=e.visited,t.visitIndex=e.visitIndex,t.lowIndex=e.lowIndex,t}),t.edges=e.edges.map(e=>{const t=new be(H.deserialize(e.segment),i[e.startVertex],i[e.endVertex]);s[e.id]=t,t.signedAreaFragment=e.signedAreaFragment;const r=(e,t)=>{n[t.id]=e,e.isReversed=t.isReversed,e.signedAreaFragment=t.signedAreaFragment,e.startVertex=i[t.startVertex.id],e.endVertex=i[t.endVertex.id],e.sortVector=I.Z.Vector2IO.fromStateObject(t.sortVector),e.data=t.data};return r(t.forwardHalf,e.forwardHalf),r(t.reversedHalf,e.reversedHalf),t.visited=e.visited,t.data=e.data,t}),e.vertices.forEach((e,i)=>{t.vertices[i].incidentHalfEdges=e.incidentHalfEdges.map(e=>n[e])}),t.boundaries=e.boundaries.map(e=>{const t=He.pool.create(e.halfEdges.map(e=>n[e]));return r[e.id]=t,t.signedArea=e.signedArea,t.bounds=j.Z.Bounds2IO.fromStateObject(e.bounds),t}),e.boundaries.forEach((e,i)=>{t.boundaries[i].childBoundaries=e.childBoundaries.map(e=>r[e])}),t.innerBoundaries=e.innerBoundaries.map(e=>r[e]),t.outerBoundaries=e.outerBoundaries.map(e=>r[e]),t.shapeIds=e.shapeIds,t.loops=e.loops.map(e=>{const t=new Je(e.shapeId,e.closed);return o[e.id]=t,t.halfEdges=e.halfEdges.map(e=>n[e]),t}),t.faces=e.faces.map((e,i)=>{const s=0===i?t.unboundedFace:new Ze(r[e.boundary]);return A[e.id]=s,s.holes=e.holes.map(e=>r[e]),s.windingMap=e.windingMap,s.filled=e.filled,s}),e.edges.forEach((e,i)=>{const s=t.edges[i];s.forwardHalf.face=null===e.forwardHalf.face?null:A[e.forwardHalf.face],s.reversedHalf.face=null===e.reversedHalf.face?null:A[e.reversedHalf.face]}),t}addShape(e,t,i){for(let s=0;s<t.subpaths.length;s++)this.addSubpath(e,t.subpaths[s],i)}addSubpath(e,t,i){if(i=(0,m.Z)({ensureClosed:!0},i),this.shapeIds.indexOf(e)<0&&this.shapeIds.push(e),0===t.segments.length)return;const s=t.closed||i.ensureClosed,n=i.ensureClosed?t.getFillSegments():t.segments;let r;const o=[];for(r=0;r<n.length;r++){let e=r-1;e<0&&(e=n.length-1);let t=n[e].end;const i=n[r].start;s||0!==r||(t=i),i.equals(t)?o.push(Ue.pool.create(i)):o.push(Ue.pool.create(i.average(t)))}s||o.push(Ue.pool.create(n[n.length-1].end));const A=Je.pool.create(e,s);for(r=0;r<n.length;r++){let e=r+1;s&&e===n.length&&(e=0);const t=be.pool.create(n[r],o[r],o[e]);A.halfEdges.push(t.forwardHalf),this.addEdge(t)}this.loops.push(A),this.vertices.push(...o)}computeSimplifiedFaces(){this.eliminateOverlap(),this.eliminateSelfIntersection(),this.eliminateIntersection(),this.collapseVertices(),this.removeBridges(),this.removeLowOrderVertices(),this.orderVertexEdges(),this.extractFaces(),this.computeBoundaryTree(),this.computeWindingMap()}computeFaceInclusion(e){for(let t=0;t<this.faces.length;t++){const i=this.faces[t];i.filled=e(i.windingMap)}}createFilledSubGraph(){const e=new rt,t={};for(let i=0;i<this.edges.length;i++){const s=this.edges[i];if(s.forwardHalf.face.filled!==s.reversedHalf.face.filled){if(!t[s.startVertex.id]){const i=Ue.pool.create(s.startVertex.point);e.vertices.push(i),t[s.startVertex.id]=i}if(!t[s.endVertex.id]){const i=Ue.pool.create(s.endVertex.point);e.vertices.push(i),t[s.endVertex.id]=i}const i=t[s.startVertex.id],n=t[s.endVertex.id];e.addEdge(be.pool.create(s.segment,i,n))}}return e.collapseAdjacentEdges(),e.orderVertexEdges(),e.extractFaces(),e.computeBoundaryTree(),e.fillAlternatingFaces(),e}facesToShape(){const e=[];for(let t=0;t<this.faces.length;t++){const i=this.faces[t];if(i.filled){e.push(i.boundary.toSubpath());for(let t=0;t<i.holes.length;t++)e.push(i.holes[t].toSubpath())}}return new d.Shape(e)}dispose(){for(;this.boundaries.length;)this.boundaries.pop().dispose();for((0,ke.Z)(this.innerBoundaries),(0,ke.Z)(this.outerBoundaries);this.loops.length;)this.loops.pop().dispose();for(;this.faces.length;)this.faces.pop().dispose();for(;this.vertices.length;)this.vertices.pop().dispose();for(;this.edges.length;)this.edges.pop().dispose()}addEdge(e){this.edges.push(e),e.startVertex.incidentHalfEdges.push(e.reversedHalf),e.endVertex.incidentHalfEdges.push(e.forwardHalf)}removeEdge(e){(0,ze.Z)(this.edges,e),(0,ze.Z)(e.startVertex.incidentHalfEdges,e.reversedHalf),(0,ze.Z)(e.endVertex.incidentHalfEdges,e.forwardHalf)}replaceEdgeInLoops(e,t){const i=[];for(let s=0;s<t.length;s++)i.push(t[t.length-1-s].getReversed());for(let s=0;s<this.loops.length;s++){const n=this.loops[s];for(let s=n.halfEdges.length-1;s>=0;s--){const r=n.halfEdges[s];if(r.edge===e){const o=r===e.forwardHalf?t:i;Array.prototype.splice.apply(n.halfEdges,[s,1].concat(o))}}}}collapseAdjacentEdges(){let e=!0;for(;e;){e=!1;for(let t=0;t<this.vertices.length;t++){const i=this.vertices[t];if(2===i.incidentHalfEdges.length){const t=i.incidentHalfEdges[0].edge,s=i.incidentHalfEdges[1].edge;let n=t.segment,r=s.segment;const o=t.getOtherVertex(i),A=s.getOtherVertex(i);if(t.startVertex===i&&(n=n.reversed()),s.endVertex===i&&(r=r.reversed()),n instanceof X&&r instanceof X&&n.tangentAt(0).normalized().distance(r.tangentAt(0).normalized())<1e-6){this.removeEdge(t),this.removeEdge(s),t.dispose(),s.dispose(),(0,ze.Z)(this.vertices,i),i.dispose();const n=new X(o.point,A.point);this.addEdge(new be(n,o,A)),e=!0;break}}}}}eliminateOverlap(){const e=new window.FlatQueue,t=new tt(1e-4),i=nt++,s=t=>{const i=t.segment.bounds;e.push({start:!0,edge:t},i.minY-1e-4),e.push({start:!1,edge:t},i.maxY+1e-4)},n=e=>{e.internalData.removedId=i};for(let o=0;o<this.edges.length;o++)s(this.edges[o]);const r=[];for(;e.length;){const o=e.pop(),A=o.edge;if(A.internalData.removedId!==i)if(o.start){let e,i,o=!1;if(t.query(A,t=>{const s=A.segment.getOverlaps(t.segment);if(null!==s&&s.length)for(let n=0;n<s.length;n++){const r=s[n];if(Math.abs(r.t1-r.t0)>1e-5&&Math.abs(r.qt1-r.qt0)>1e-5)return i=this.splitOverlap(A,t,r),o=!0,e=t,!0}return!1}),o){t.removeItem(e),n(e),n(A);for(let e=0;e<i.length;e++)s(i[e]);r.push(A),r.push(e)}else t.addItem(A)}else t.removeItem(A)}for(let o=0;o<r.length;o++)r[o].dispose()}splitOverlap(e,t,i){const s=[],n=e.segment,r=t.segment;this.removeEdge(e),this.removeEdge(t);let o=i.t0,A=i.t1,a=i.qt0,h=i.qt1;o<1e-5&&(o=0),A>.99999&&(A=1),a<1e-5&&(a=0),h>.99999&&(h=1);const l=o>0?n.subdivided(o)[0]:null,g=a>0?r.subdivided(a)[0]:null,c=A<1?n.subdivided(A)[1]:null,d=h<1?r.subdivided(h)[1]:null;let m,p,V=n;o>0&&(V=V.subdivided(o)[1]),A<1&&(V=V.subdivided(u.Z.linear(o,1,0,1,A))[0]),l&&g?(m=Ue.pool.create(V.start),this.vertices.push(m)):m=l?i.a>0?t.startVertex:t.endVertex:e.startVertex,c&&d?(p=Ue.pool.create(V.end),this.vertices.push(p)):p=c?i.a>0?t.endVertex:t.startVertex:e.endVertex;const M=be.pool.create(V,m,p);let B,w,C,E;s.push(M),l&&(B=be.pool.create(l,e.startVertex,m),s.push(B)),c&&(w=be.pool.create(c,p,e.endVertex),s.push(w)),g&&(C=be.pool.create(g,t.startVertex,i.a>0?m:p),s.push(C)),d&&(E=be.pool.create(d,i.a>0?p:m,t.endVertex),s.push(E));for(let u=0;u<s.length;u++)this.addEdge(s[u]);const Y=(l?[B]:[]).concat([M]).concat(c?[w]:[]),D=(g?[C]:[]).concat([M]).concat(d?[E]:[]),y=[],I=[];for(let u=0;u<Y.length;u++)y.push(Y[u].forwardHalf);for(let u=0;u<D.length;u++){const e=D[u]!==M||i.a>0;I.push(e?D[u].forwardHalf:D[u].reversedHalf)}return this.replaceEdgeInLoops(e,y),this.replaceEdgeInLoops(t,I),s}eliminateSelfIntersection(){for(let e=this.edges.length-1;e>=0;e--){const t=this.edges[e],i=t.segment;if(i instanceof ge){const e=i.getSelfIntersection();if(e){const s=i.subdivisions([e.aT,e.bT]),n=Ue.pool.create(e.point);this.vertices.push(n);const r=be.pool.create(s[0],t.startVertex,n),o=be.pool.create(s[1],n,n),A=be.pool.create(s[2],n,t.endVertex);this.removeEdge(t),this.addEdge(r),this.addEdge(o),this.addEdge(A),this.replaceEdgeInLoops(t,[r.forwardHalf,o.forwardHalf,A.forwardHalf]),t.dispose()}}}}eliminateIntersection(){const e=new window.FlatQueue,t=new tt(1e-4),i=nt++,s=t=>{const i=t.segment.bounds;e.push({start:!0,edge:t},i.minY-1e-4),e.push({start:!1,edge:t},i.maxY+1e-4)},n=e=>{e.internalData.removedId=i};for(let o=0;o<this.edges.length;o++)s(this.edges[o]);const r=[];for(;e.length;){const o=e.pop(),A=o.edge;if(A.internalData.removedId!==i)if(o.start){let e,i,o,a=!1;if(t.query(A,t=>{const s=A.segment,n=t.segment;let r=H.intersect(s,n);if(r=r.filter(e=>{const t=e.point;return rt.isInternal(t,e.aT,s,.1*1e-5,1e-6)||rt.isInternal(t,e.bT,n,.1*1e-5,1e-6)}),r.length){const s=r[0],n=this.simpleSplit(A,t,s.aT,s.bT,s.point);if(n)return a=!0,e=t,i=n.addedEdges,o=n.removedEdges,!0}return!1}),a){o.includes(A)?(n(A),r.push(A)):t.addItem(A),o.includes(e)&&(t.removeItem(e),n(e),r.push(e));for(let e=0;e<i.length;e++)s(i[e])}else t.addItem(A)}else t.removeItem(A)}for(let o=0;o<r.length;o++)r[o].dispose()}simpleSplit(e,t,i,s,n){const r=rt.isInternal(n,i,e.segment,.01*1e-5,1e-6),o=rt.isInternal(n,s,t.segment,.01*1e-5,1e-6);let A=null;r?o?(A=Ue.pool.create(n),this.vertices.push(A)):A=s<.5?t.startVertex:t.endVertex:A=i<.5?e.startVertex:e.endVertex;let a=!1;const h=[],l=[];return r&&A!==e.startVertex&&A!==e.endVertex&&(h.push(...this.splitEdge(e,i,A)),l.push(e),a=!0),o&&A!==t.startVertex&&A!==t.endVertex&&(h.push(...this.splitEdge(t,s,A)),l.push(t),a=!0),a?{addedEdges:h,removedEdges:l}:null}splitEdge(e,t,i){const s=e.segment.subdivided(t),n=be.pool.create(s[0],e.startVertex,i),r=be.pool.create(s[1],i,e.endVertex);return this.removeEdge(e),this.addEdge(n),this.addEdge(r),this.replaceEdgeInLoops(e,[n.forwardHalf,r.forwardHalf]),[n,r]}collapseVertices(){const e=new window.FlatQueue,t=new it(1e-4),i=nt++,s=t=>{e.push({start:!0,vertex:t},t.point.y-1e-4),e.push({start:!1,vertex:t},t.point.y+1e-4)},n=e=>{e.internalData.removedId=i};for(let o=0;o<this.vertices.length;o++)s(this.vertices[o]);const r=[];for(;e.length;){const o=e.pop(),A=o.vertex;if(A.internalData.removedId!==i)if(o.start){let e,i,o=!1;if(t.query(A,t=>{const s=A.point.distance(t.point);if(s<1e-5){const n=Ue.pool.create(0===s?A.point:A.point.average(t.point));this.vertices.push(n),(0,ze.Z)(this.vertices,A),(0,ze.Z)(this.vertices,t);for(let e=this.edges.length-1;e>=0;e--){const i=this.edges[e],s=i.startVertex===A||i.startVertex===t,r=i.endVertex===A||i.endVertex===t;if(s&&r){if((i.segment.bounds.width>1e-5||i.segment.bounds.height>1e-5)&&(i.segment instanceof ge||i.segment instanceof de||i.segment instanceof Be)){const e=be.pool.create(i.segment,n,n);this.addEdge(e),this.replaceEdgeInLoops(i,[e.forwardHalf])}else this.replaceEdgeInLoops(i,[]);this.removeEdge(i),i.dispose()}else s?(i.startVertex=n,n.incidentHalfEdges.push(i.reversedHalf),i.updateReferences()):r&&(i.endVertex=n,n.incidentHalfEdges.push(i.forwardHalf),i.updateReferences())}return i=[n],o=!0,e=t,!0}return!1}),o){t.removeItem(e),n(e),n(A);for(let e=0;e<i.length;e++)s(i[e]);r.push(A),r.push(e)}else t.addItem(A)}else t.removeItem(A)}for(let o=0;o<r.length;o++)r[o].dispose()}markBridges(e,t){t.visited=!0,t.visitIndex=t.lowIndex=st++;for(let i=0;i<t.incidentHalfEdges.length;i++){const s=t.incidentHalfEdges[i].edge,n=t.incidentHalfEdges[i].startVertex;n.visited?s.visited||(t.lowIndex=Math.min(t.lowIndex,n.visitIndex)):(s.visited=!0,n.parent=t,this.markBridges(e,n),t.lowIndex=Math.min(t.lowIndex,n.lowIndex),n.lowIndex>t.visitIndex&&e.push(s))}}removeBridges(){const e=[];for(let t=0;t<this.vertices.length;t++){const i=this.vertices[t];i.visited||this.markBridges(e,i)}for(let t=0;t<e.length;t++){const i=e[t];this.removeEdge(i),this.replaceEdgeInLoops(i,[]),i.dispose()}}removeLowOrderVertices(){let e=!0;for(;e;){e=!1;for(let t=this.vertices.length-1;t>=0;t--){const i=this.vertices[t];if(i.incidentHalfEdges.length<2){for(let e=0;e<i.incidentHalfEdges.length;e++){const t=i.incidentHalfEdges[e].edge;this.removeEdge(t),this.replaceEdgeInLoops(t,[]),t.dispose()}this.vertices.splice(t,1),i.dispose(),e=!0;break}}}}orderVertexEdges(){for(let e=0;e<this.vertices.length;e++)this.vertices[e].sortEdges()}extractFaces(){const e=[];for(let t=0;t<this.edges.length;t++)e.push(this.edges[t].forwardHalf),e.push(this.edges[t].reversedHalf);for(;e.length;){const t=[];let i=e[0];const s=i;for(;i&&((0,ze.Z)(e,i),t.push(i),i=i.getNext(),i!==s););const n=He.pool.create(t);(n.signedArea>0?this.innerBoundaries:this.outerBoundaries).push(n),this.boundaries.push(n)}for(let t=0;t<this.innerBoundaries.length;t++)this.faces.push(Ze.pool.create(this.innerBoundaries[t]))}computeBoundaryTree(){const e=[],t=new ue.Z($.Z.rotation2(1.5729657));for(let i=0;i<this.outerBoundaries.length;i++){const s=this.outerBoundaries[i],n=s.computeExtremeRay(t);let r=null,o=Number.POSITIVE_INFINITY,A=!1;for(let e=0;e<this.edges.length;e++){const t=this.edges[e],i=t.segment.intersection(n);for(let e=0;e<i.length;e++){const s=i[e];s.distance<o&&(r=t,o=s.distance,A=s.wind)}}if(null===r)e.push(s);else{const e=A<0?r.reversedHalf:r.forwardHalf;this.getBoundaryOfHalfEdge(e).childBoundaries.push(s)}}e.forEach(this.unboundedFace.recursivelyAddHoles.bind(this.unboundedFace));for(let i=0;i<this.faces.length;i++){const e=this.faces[i];null!==e.boundary&&e.boundary.childBoundaries.forEach(e.recursivelyAddHoles.bind(e))}}computeWindingMap(){const e=this.edges.slice(),t={};for(let i=0;i<this.shapeIds.length;i++)t[this.shapeIds[i]]=0;for(this.unboundedFace.windingMap=t;e.length;)for(let t=e.length-1;t>=0;t--){const i=e[t],s=i.forwardHalf,n=i.reversedHalf,r=s.face,o=n.face,A=null!==r.windingMap,a=null!==o.windingMap;if(A&&a)e.splice(t,1);else{if(!A&&!a)continue;{const e=A?r:o,t=A?o:r,s={};for(let n=0;n<this.shapeIds.length;n++){const t=this.shapeIds[n],r=this.computeDifferential(i,t);s[t]=e.windingMap[t]+r*(A?-1:1)}t.windingMap=s}}}}computeDifferential(e,t){let i=0;for(let s=0;s<this.loops.length;s++){const n=this.loops[s];if(n.shapeId===t)for(let t=0;t<n.halfEdges.length;t++){const s=n.halfEdges[t];s===e.forwardHalf?i++:s===e.reversedHalf&&i--}}return i}fillAlternatingFaces(){let e=0;for(let t=0;t<this.faces.length;t++)this.faces[t].filled=null,e++;for(this.unboundedFace.filled=!1,e--;e;)for(let t=0;t<this.edges.length;t++){const i=this.edges[t],s=i.forwardHalf.face,n=i.reversedHalf.face,r=null===s.filled,o=null===n.filled;r&&!o?(s.filled=!n.filled,e--):!r&&o&&(n.filled=!s.filled,e--)}}getBoundaryOfHalfEdge(e){for(let t=0;t<this.boundaries.length;t++){const i=this.boundaries[t];if(i.hasHalfEdge(e))return i}throw new Error("Could not find boundary")}static isInternal(e,t,i,s,n){return t>n&&t<1-n&&e.distance(i.start)>s&&e.distance(i.end)>s}static BINARY_NONZERO_UNION(e){return 0!==e[0]||0!==e[1]}static BINARY_NONZERO_INTERSECTION(e){return 0!==e[0]&&0!==e[1]}static BINARY_NONZERO_DIFFERENCE(e){return 0!==e[0]&&0===e[1]}static BINARY_NONZERO_XOR(e){return 1==(0!==e[0]^0!==e[1])}static binaryResult(e,t,i){const s=new rt;s.addShape(0,e),s.addShape(1,t),s.computeSimplifiedFaces(),s.computeFaceInclusion(i);const n=s.createFilledSubGraph(),r=n.facesToShape();return s.dispose(),n.dispose(),r}static unionNonZero(e){const t=new rt;for(let n=0;n<e.length;n++)t.addShape(n,e[n]);t.computeSimplifiedFaces(),t.computeFaceInclusion(t=>{for(let i=0;i<e.length;i++)if(0!==t[i])return!0;return!1});const i=t.createFilledSubGraph(),s=i.facesToShape();return t.dispose(),i.dispose(),s}static intersectionNonZero(e){const t=new rt;for(let n=0;n<e.length;n++)t.addShape(n,e[n]);t.computeSimplifiedFaces(),t.computeFaceInclusion(t=>{for(let i=0;i<e.length;i++)if(0===t[i])return!1;return!0});const i=t.createFilledSubGraph(),s=i.facesToShape();return t.dispose(),i.dispose(),s}static xorNonZero(e){const t=new rt;for(let n=0;n<e.length;n++)t.addShape(n,e[n]);t.computeSimplifiedFaces(),t.computeFaceInclusion(t=>{let i=!1;for(let s=0;s<e.length;s++)0!==t[s]&&(i=!i);return i});const i=t.createFilledSubGraph(),s=i.facesToShape();return t.dispose(),i.dispose(),s}static simplifyNonZero(e){const t=new rt;t.addShape(0,e),t.computeSimplifiedFaces(),t.computeFaceInclusion(e=>0!==e[0]);const i=t.createFilledSubGraph(),s=i.facesToShape();return t.dispose(),i.dispose(),s}static clipShape(e,t,i){let s,n,r;i=(0,m.Z)({includeExterior:!1,includeBoundary:!0,includeInterior:!0},i);const o=rt.simplifyNonZero(e),A=new rt;for(A.addShape(0,t,{ensureClosed:!1}),A.addShape(1,o),A.eliminateOverlap(),A.eliminateSelfIntersection(),A.eliminateIntersection(),A.collapseVertices(),s=0;s<A.loops.length;s++)if(r=A.loops[s],1===r.shapeId)for(n=0;n<r.halfEdges.length;n++)r.halfEdges[n].edge.data=!0;const a=[];for(s=0;s<A.loops.length;s++)if(r=A.loops[s],0===r.shapeId){let e=[];for(n=0;n<r.halfEdges.length;n++){const t=r.halfEdges[n];(t.edge.data?i.includeBoundary:o.containsPoint(t.edge.segment.positionAt(.5))?i.includeInterior:i.includeExterior)?e.push(t.getDirectionalSegment()):e.length&&(a.push(new Ee(e,void 0,r.closed)),e=[])}e.length&&a.push(new Ee(e,void 0,r.closed))}return A.dispose(),new d.Shape(a)}}d.register("Graph",rt);const ot=rt},2956:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8378),n=i(4676),r=i(1243),o=i(2550);class A{constructor(e,t){const i=(0,o.ZP)()({phetioDocumentation:"",instanceType:e},t);this.phetioDocumentation=i.phetioDocumentation;const s=i.instanceType,A=_.reverse((0,r.Z)(e));this.keys=[],this.values=[],A.forEach(t=>{Object.keys(t).forEach(i=>{const n=t[i];n instanceof s&&(this.keys.push(i),this.values.push(n),n instanceof e&&(n.name=i,n.enumeration=this))})}),this.Enumeration=e,n.Z.sealedCache.add(e)}getKey(e){return e.name}getValue(e){return this.Enumeration[e]}includes(e){return this.values.includes(e)}}s.Z.register("Enumeration",A);const a=A},4676:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(8378);class n{toString(){return this.name}isEnumerationValue(){return!0}constructor(){this.constructor;this._name=null,this._enumeration=null}set name(e){this._name=e}get name(){return this._name}set enumeration(e){this._enumeration=e}get enumeration(){return this._enumeration}}_defineProperty(n,"sealedCache",new Set),s.Z.register("EnumerationValue",n);const r=n},2492:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(8897);const n=class{constructor(e){if(this.name=e,window.phet){if("chipper"===e)return window.phet.chipper.name="chipper",window.phet.chipper.register=this.register.bind(window.phet.chipper),window.phet.chipper;_.hasIn(window,"phet.chipper.brand");window.phet[e]=this}}register(e,t){if(e.indexOf(".")<0)s.Z,this[e]=t;else{const i=e.split(".");let n=this;for(let e=0;e<i.length-1;e++)s.Z,n=n[i[e]];const r=i[i.length-1];s.Z,n[r]=t}return t}}},2473:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>a});var n=i(8378),r=i(2956),o=i(4676);class A extends o.Z{static fromLayoutOrientation(e){return"horizontal"===e?A.HORIZONTAL:A.VERTICAL}constructor(e,t,i,s,n,r,o,A,a,h,l,g,c,d,u,m,p,V,M){super(),this.coordinate=e,this.centerCoordinate=t,this.minCoordinate=i,this.maxCoordinate=s,this.minSide=n,this.maxSide=r,this.minSize=o,this.maxSize=A,this.rectCoordinate=a,this.rectSize=h,this.flowBoxOrientation=l,this.size=g,this.line=c,this.preferredSize=d,this.localPreferredSize=u,this.sizable=m,this.ariaOrientation=l,this.modelToView=p,this.viewToModel=V,this.toVector=M}}_defineProperty(A,"HORIZONTAL",new(s=A)("x","centerX","minX","maxX","left","right","minWidth","maxWidth","rectX","rectWidth","horizontal","width","column","preferredWidth","localPreferredWidth","widthSizable",(e,t)=>e.modelToViewX(t),(e,t)=>e.viewToModelX(t),(e,t,i)=>new i(e,t,0,0))),_defineProperty(A,"VERTICAL",new s("y","centerY","minY","maxY","top","bottom","minHeight","maxHeight","rectY","rectHeight","vertical","height","row","preferredHeight","localPreferredHeight","heightSizable",(e,t)=>e.modelToViewY(t),(e,t)=>e.viewToModelY(t),(e,t,i)=>new i(t,e,0,0))),_defineProperty(A,"enumeration",new r.Z(s,{phetioDocumentation:"Horizontal or vertical orientation"})),A.HORIZONTAL.opposite=A.VERTICAL,A.VERTICAL.opposite=A.HORIZONTAL,n.Z.register("Orientation",A);const a=A},7232:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(8378),n=i(2550);class r{constructor(e){_defineProperty(this,"objects",[]);const t=(0,n.ZP)()({defaultArguments:[],initialize:e.prototype.initialize,maxSize:100,initialSize:0,useDefaultConstruction:!1},arguments.length<=1?void 0:arguments[1]);for(this._maxPoolSize=t.maxSize,this.partialConstructor=Function.prototype.bind.bind(e,e),this.DefaultConstructor=this.partialConstructor(...t.defaultArguments),this.initialize=t.initialize,this.useDefaultConstruction=t.useDefaultConstruction;this.objects.length<t.initialSize;)this.objects.push(this.createDefaultObject())}createDefaultObject(){return new this.DefaultConstructor}fetch(){return this.objects.length?this.objects.pop():this.createDefaultObject()}create(){let e;for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return this.objects.length?(e=this.objects.pop(),this.initialize.apply(e,i)):this.useDefaultConstruction?(e=this.createDefaultObject(),this.initialize.apply(e,i)):e=new(this.partialConstructor(...i)),e}get poolSize(){return this.objects.length}set maxPoolSize(e){this._maxPoolSize=e}get maxPoolSize(){return this._maxPoolSize}freeToPool(e){this.objects.length<this.maxPoolSize&&this.objects.push(e)}forEach(e){this.objects.forEach(e)}}s.Z.register("Pool",r)},9059:(e,t,i)=>{"use strict";function s(e,t){const i=_.indexOf(e,t);e.splice(i,1)}i.d(t,{Z:()=>n}),i(8378).Z.register("arrayRemove",s);const n=s},2573:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});i(1243);const s=(e,t)=>{0};i(8378).Z.register("assertHasProperties",s);const n=s},6212:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});const s=function(e){};i(8378).Z.register("assertMutuallyExclusiveOptions",s);const n=s},2530:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(9059),n=i(8378);const r=new class{constructor(){this.pendingLocks=[],this.loadComplete=!1,this.listeners=[]}reset(){this.loadComplete=!1}addListener(e){this.listeners.push(e)}proceedIfReady(){0===this.pendingLocks.length&&(this.loadComplete=!0,this.listeners.forEach(e=>e()))}createLock(e){return this.pendingLocks.push(e),()=>{(0,s.Z)(this.pendingLocks,e),this.proceedIfReady()}}};n.Z.register("asyncLoader",r);const o=r},5853:(e,t,i)=>{"use strict";function s(e){if(e){for(;e.length;)e.pop();return e}return[]}i.d(t,{Z:()=>n}),i(8378).Z.register("cleanArray",s);const n=s},8676:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(8378);const n={},r=e=>{window.phet&&window.phet.chipper&&window.phet.chipper.queryParameters&&phet.chipper.queryParameters.deprecationWarnings&&(n.hasOwnProperty(e)||(n[e]=!0,console.warn("Deprecation warning: "+e)))};s.Z.register("deprecationWarning",r);const o=r},1243:(e,t,i)=>{"use strict";function s(e){const t=[e];let i=e.prototype;for(;i&&(i=Object.getPrototypeOf(i));)i.constructor&&t.push(i.constructor);return t}i.d(t,{Z:()=>n}),i(8378).Z.register("inheritance",s);const n=s},8897:(e,t,i)=>{"use strict";let s;i.d(t,{Z:()=>n}),e=i.hmd(e);try{s=e&&e.hot}catch(r){s=!1}const n=s},831:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(8378);function n(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return _.each(i,t=>{if(t)for(const i in t)if(t.hasOwnProperty(i)&&void 0!==t[i]){const s=t[i];_.endsWith(i,"Options")&&"Options"!==i?e[i]=n(e[i]||{},s):e[i]=s}}),e}s.Z.register("merge",n);const r=n},2550:(e,t,i)=>{"use strict";i.d(t,{JA:()=>a,ZP:()=>o,lB:()=>A});var s=i(8378),n=i(831);const r=(e,t,i,s)=>(0,n.Z)(e,t,i,s);function o(){return r}function A(){return r}function a(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return r(e,...i)}s.Z.register("optionize",o)},8378:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(2492);const n=new s.Z("phetCore");n.register("Namespace",s.Z);const r=n},2823:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(8378);const n=navigator.userAgent;function r(e){return A()===e}function o(){return!!(window.phet&&phet.chipper&&phet.chipper.queryParameters&&phet.chipper.queryParameters["phet-app"]||(n.match(/(iPod|iPhone|iPad)/)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>=2)&&n.match(/AppleWebKit/))}function A(){let e=-1,t=null;return"Microsoft Internet Explorer"===navigator.appName?(t=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),null!==t.exec(n)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(t=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),null!==t.exec(n)&&(e=parseFloat(RegExp.$1))),e}const a={firefox:n.toLowerCase().indexOf("firefox")>-1,mobileSafari:o(),safari5:!!(n.match(/Version\/5\./)&&n.match(/Safari\//)&&n.match(/AppleWebKit/)),safari6:!!(n.match(/Version\/6\./)&&n.match(/Safari\//)&&n.match(/AppleWebKit/)),safari7:!!(n.match(/Version\/7\./)&&n.match(/Safari\//)&&n.match(/AppleWebKit/)),safari10:!!(n.match(/Version\/10\./)&&n.match(/Safari\//)&&n.match(/AppleWebKit/)),safari11:!!(n.match(/Version\/11\./)&&n.match(/Safari\//)&&n.match(/AppleWebKit/)),safari9:!!(n.match(/Version\/9\./)&&n.match(/Safari\//)&&n.match(/AppleWebKit/)),safari:o()||!!(n.match(/Version\//)&&n.match(/Safari\//)&&n.match(/AppleWebKit/)),ie:-1!==A(),ie9:r(9),ie10:r(10),ie11:r(11),android:n.indexOf("Android")>0,edge:!!n.match(/Edge\//),chromium:/chrom(e|ium)/.test(n.toLowerCase())&&!n.match(/Edge\//),chromeOS:n.indexOf("CrOS")>0,mac:navigator.platform.includes("Mac")};s.Z.register("platform",a);const h=a},8377:(e,t,i)=>{"use strict";function s(e){return e.replace(/\u202a|\u202b|\u202c/g,"")}i.d(t,{Z:()=>n}),i(8378).Z.register("stripEmbeddingMarks",s);const n=s},5322:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s=new(i(2492).Z)("phetcommon")},6114:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(5322);const n={format:function(e){const t=arguments;return e.replace(/{(\d)}/g,(e,i)=>t[+i+1])},fillIn:function(e,t){let i=e=e&&e.get?e.get():e;const s=e.match(/\{\{[^{}]+\}\}/g)||[];for(let n=0;n<s.length;n++){const e=s[n],r=e.replace("{{","").replace("}}","");if(void 0!==t[r]){const s=t[r]&&t[r].get?t[r].get():t[r];i=i.replace(e,s)}}return i},isEmbeddingMark:function(e){return"‪"===e||"‫"===e||"‬"===e},embeddedSlice:function(e,t,i){const s=[];let r;for(void 0===i&&(i=e.length),i<0&&(i+=e.length);t<e.length&&n.isEmbeddingMark(e.charAt(t));)t++;for(;i>=1&&n.isEmbeddingMark(e.charAt(i-1));)i--;if(t>=i||t>=e.length)return"";for(let n=0;n<t;n++)r=e.charAt(n),"‪"===r||"‫"===r?s.push(r):"‬"===r&&s.pop();let o=s.length,A=s.slice();const a=e.slice(t,i);for(let n=0;n<a.length;n++)r=a.charAt(n),"‪"===r||"‫"===r?s.push(r):"‬"===r&&(s.pop(),o=Math.min(s.length,o));let h=s;const l=Math.max(0,o-1);return A=A.slice(l),h=h.slice(l),A.join("")+a+h.join("").replace(/./g,"‬")},embeddedSplit:function(e,t,i){if(void 0===t)return[e];let s,r=[],o=e;function A(){let e,i;if(t instanceof window.RegExp){const s=o.match(t);s?(e=s.index,i=s[0].length):e=-1}else e=o.indexOf(t),i=t.length;return{index:e,length:i}}let a=0;for(;(s=A()).index>=0;){r.push(n.embeddedSlice(e,a,a+s.index));const t=s.index+s.length;o=o.slice(t),a+=t}return r.push(n.embeddedSlice(e,a)),void 0!==i&&(r=_.first(r,i)),r},embeddedDebugString:function(e){return e.replace(/\u202a/g,"[LTR]").replace(/\u202b/g,"[RTL]").replace(/\u202c/g,"[POP]")},wrapLTR:function(e){return"‪"+e+"‬"},wrapRTL:function(e){return"‫"+e+"‬"},wrapDirection:function(e,t){return"ltr"===t?n.wrapLTR(e):n.wrapRTL(e)},localeToLocalizedName:function(e){return n.wrapDirection(phet.chipper.localeData[e].localizedName,phet.chipper.localeData[e].direction)},capitalize(e){const t=e.search(/[A-Za-z0-9]/);return-1===t?e.slice(0):(t>0?e.slice(0,t):"")+e.charAt(t).toUpperCase()+(t+1<e.length?e.slice(t+1):"")}};s.Z.register("StringUtils",n);const r=n},369:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(9972),n=i(7320),r=i(668),o=i(5322);class A extends n.Z{modelToViewPosition(e){return this.transformPosition2(e)}modelToViewXY(e,t){return new r.Z(this.modelToViewX(e),this.modelToViewY(t))}modelToViewX(e){return this.matrix.m00()*e+this.matrix.m02()}modelToViewY(e){return this.matrix.m11()*e+this.matrix.m12()}modelToViewDelta(e){return this.transformDelta2(e)}modelToViewNormal(e){return this.transformNormal2(e)}modelToViewDeltaX(e){return this.transformDeltaX(e)}modelToViewDeltaY(e){return this.transformDeltaY(e)}modelToViewBounds(e){return this.transformBounds2(e)}modelToViewShape(e){return this.transformShape(e)}modelToViewRay(e){return this.transformRay2(e)}viewToModelPosition(e){return this.inversePosition2(e)}viewToModelXY(e,t){return new r.Z(this.viewToModelX(e),this.viewToModelY(t))}viewToModelX(e){const t=this.getInverse();return t.m00()*e+t.m02()}viewToModelY(e){const t=this.getInverse();return t.m11()*e+t.m12()}viewToModelDelta(e){return this.inverseDelta2(e)}viewToModelDeltaXY(e,t){return new r.Z(this.viewToModelDeltaX(e),this.viewToModelDeltaY(t))}viewToModelNormal(e){return this.inverseNormal2(e)}viewToModelDeltaX(e){return this.inverseDeltaX(e)}viewToModelDeltaY(e){return this.inverseDeltaY(e)}viewToModelBounds(e){return this.inverseBounds2(e)}viewToModelShape(e){return this.inverseShape(e)}viewToModelRay(e){return this.inverseRay2(e)}validateMatrix(e){super.validateMatrix(e)}setToRectangleMapping(e,t){const i=t.width/e.width,n=t.x-i*e.x,r=t.height/e.height,o=t.y-r*e.y;return this.setMatrix(s.Z.affine(i,0,n,0,r,o)),this}setToRectangleInvertedYMapping(e,t){const i=t.width/e.width,n=t.x-i*e.x,r=-t.height/e.height,o=t.y-r*e.getMaxY();return this.setMatrix(s.Z.affine(i,0,n,0,r,o)),this}static createIdentity(){return new A(s.Z.IDENTITY)}static createOffsetScaleMapping(e,t){return new A(s.Z.affine(t,0,e.x,0,t,e.y))}static createOffsetXYScaleMapping(e,t,i){return new A(s.Z.affine(t,0,e.x,0,i,e.y))}static createSinglePointXYScaleMapping(e,t,i,s){const n=t.x-e.x*i,o=t.y-e.y*s;return A.createOffsetXYScaleMapping(new r.Z(n,o),i,s)}static createSinglePointScaleMapping(e,t,i){return A.createSinglePointXYScaleMapping(e,t,i,i)}static createSinglePointScaleInvertedYMapping(e,t,i){return A.createSinglePointXYScaleMapping(e,t,i,-i)}static createRectangleMapping(e,t){return(new A).setToRectangleMapping(e,t)}static createRectangleInvertedYMapping(e,t){return(new A).setToRectangleInvertedYMapping(e,t)}}o.Z.register("ModelViewTransform2",A);const a=A},6278:(e,t,i)=>{"use strict";var s,n,r,o,A,a,h,l,g,c,d,u,m,p,V,M,B,w,C,E,Y,D,y,I,q,G,Q,S,T,x,k,F,R,U,L;i.d(t,{qlR:()=>Is,Eq$:()=>nA,DbO:()=>Kh,Lkj:()=>zh,Ox2:()=>Mn,EFT:()=>xa,uai:()=>Ur,zhG:()=>ed,i5w:()=>HA,Xs$:()=>vA,gOu:()=>Dc,UlH:()=>hs,JjN:()=>_A,lR5:()=>Tc,LdF:()=>Dt,mxV:()=>er,Us:()=>id,wNI:()=>hg,jsu:()=>Ol,Hl2:()=>Vc,Cdc:()=>tr,APE:()=>gg,CeX:()=>dg,SJ7:()=>mg,vAW:()=>Hl,Ilk:()=>le,gLI:()=>is,mJh:()=>as,g86:()=>ui,mnm:()=>ls,CJ2:()=>Pt,$RI:()=>eh,SOl:()=>ir,yU5:()=>kc,LyU:()=>Vg,MNr:()=>Zl,reX:()=>Un,sSl:()=>Bd,ljG:()=>Zt,Wk5:()=>ia,_U3:()=>da,QuO:()=>xl,oJv:()=>ct,Afc:()=>PA,A0U:()=>bA,hTm:()=>Mt,kdt:()=>Ch,iQc:()=>Ih,ANe:()=>we,wn$:()=>_i,eMb:()=>ga,WzJ:()=>Bc,cFi:()=>qc,THo:()=>sd,N52:()=>Sh,AGQ:()=>Dh,M_J:()=>Yh,hpR:()=>qh,gaG:()=>yh,TOE:()=>ze,ywP:()=>Go,IKS:()=>So,Zxw:()=>Ge,ITT:()=>kt,WWo:()=>Th,ztD:()=>Uh,phe:()=>ji,P5k:()=>gs,H1L:()=>zc,zch:()=>bh,r8_:()=>Fh,lnx:()=>kh,WJk:()=>Lh,Gly:()=>Rh,BET:()=>Xh,KF0:()=>rn,qYj:()=>sh,UXm:()=>hn,bjc:()=>Oo,JPB:()=>ad,Nqr:()=>Po,RCB:()=>hd,jGl:()=>Ka,Eep:()=>Pn,u8N:()=>Bg,bbJ:()=>Cg,Fbz:()=>Yg,z2i:()=>zl,p23:()=>yg,E0:()=>Fn,RnV:()=>yd,RJp:()=>gc,IIB:()=>jA,$AB:()=>ea,K48:()=>md,SEW:()=>TA,wgH:()=>Xr,e8H:()=>$r,Re8:()=>jr,qQp:()=>Pa,eXg:()=>tA,F3H:()=>Oa,ntP:()=>lt,DiB:()=>zo,Rme:()=>uh,O98:()=>ja,SmY:()=>Ah,dmK:()=>oh,SOj:()=>Xa,toq:()=>ph,BjU:()=>mh,dJ_:()=>nh,zU8:()=>rh,B3Q:()=>lr,x12:()=>sr,fVi:()=>qg,O7j:()=>Qg,fJl:()=>eg,Kbx:()=>_l,oas:()=>vi,VHz:()=>Mh,bGt:()=>Oh,cwl:()=>ch,jq0:()=>wh,z$X:()=>wn,TKz:()=>FA,YC1:()=>Ma,qDk:()=>ua,NBX:()=>Zs,V7H:()=>Vh,eQt:()=>zi,vP3:()=>yn,vEd:()=>In,Yc:()=>Dn,IN3:()=>zs,q5R:()=>yA,Grz:()=>BA,cw6:()=>LA,zMY:()=>Di,t13:()=>GA,eDZ:()=>Fi,wGU:()=>Ki,M4p:()=>wr,n:()=>ns,Q9x:()=>Br,SlY:()=>Yr,nvG:()=>qn,Jwh:()=>Pl,jRH:()=>Ul,Me8:()=>Ea,IK8:()=>qs,tfT:()=>Ei,y$t:()=>On,Eke:()=>Tg,Ay9:()=>kg,_QC:()=>ig,cfY:()=>Wi,GmO:()=>UA,cWH:()=>Ns,JOQ:()=>ar,gbg:()=>xA,eIk:()=>ld,HYB:()=>gd,$o8:()=>ha,rtN:()=>Zi,Qjn:()=>Us,XMe:()=>Hi,KwY:()=>Ho,qLK:()=>Zo,C7c:()=>Io,Xh$:()=>_c,AeJ:()=>rr,jk6:()=>Rg,dQq:()=>Pg,jVm:()=>Og,E4:()=>ng,mjA:()=>Ng,GV1:()=>mc,$1I:()=>fh,Thl:()=>Te,AL6:()=>Ws,Hof:()=>wl,Ys_:()=>nl,DyO:()=>Al,RZ3:()=>al,ki_:()=>ll,q_M:()=>hl,hMI:()=>il,E2n:()=>ol,T3N:()=>cn,FlK:()=>Rc,pkC:()=>qr,Uhj:()=>Ir,OMw:()=>Ec,AJg:()=>Gr,SBj:()=>Sr,yvo:()=>Qr,DDI:()=>Kl,iaM:()=>X,IAx:()=>OA,yR9:()=>Et,lKh:()=>Fl,Z0O:()=>th,sr$:()=>di,BOv:()=>td,ptS:()=>dc,tTM:()=>un,LZC:()=>gr,m5g:()=>ni,V6q:()=>gi,A1r:()=>or,QrZ:()=>Jg,rOj:()=>_g,Wk8:()=>Nc,xvT:()=>zn,V7E:()=>wi,Ue0:()=>ec,haP:()=>sc,maj:()=>Ac,$jb:()=>og,XhR:()=>RA,Qn1:()=>pn,DP0:()=>Vn,urZ:()=>Fr,ouJ:()=>Bn,pCm:()=>xr,cQK:()=>ve,SHm:()=>_h,Bbh:()=>ih,mE$:()=>cr,q7$:()=>Ja,CHP:()=>Do,yhY:()=>Dl,JxC:()=>El,QTu:()=>$s,b0G:()=>fc,HDe:()=>Ar,kcu:()=>hc,Nxy:()=>jl,pL8:()=>nn,U2N:()=>jt,Yj2:()=>Fa,CEW:()=>bi,cWU:()=>an,AXx:()=>sn,IK9:()=>Xt,MMl:()=>Hr,fJO:()=>An,XAX:()=>$h,GMJ:()=>el,S3T:()=>tn,MwI:()=>Ht,QF$:()=>W,u59:()=>Gl,Jy4:()=>yl,WPH:()=>Il,WW2:()=>ke,LY3:()=>so,KsW:()=>Mo,LdS:()=>Re});var P=i(8378);function b(e){return _.each(Array.prototype.slice.call(arguments,1),t=>{if(t)for(const i in t)Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}),e}P.Z.register("extend",b);const O=b;var f=i(2492);window.sceneryLog=null;const Z=document.createElement("canvas"),N=Z.getContext("2d");let K="";const J=new f.Z("scenery");function j(e){J.logString+=e.replace(/%c/g,"")+"\n"}function v(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];window.console&&window.console.log&&window.console.log(...Array.prototype.slice.call(t,0))}J.register("scratchCanvas",Z),J.register("scratchContext",N);const H={dirty:{name:"dirty",style:"color: #888;"},bounds:{name:"bounds",style:"color: #888;"},hitTest:{name:"hitTest",style:"color: #888;"},hitTestInternal:{name:"hitTestInternal",style:"color: #888;"},PerfCritical:{name:"Perf",style:"color: #f00;"},PerfMajor:{name:"Perf",style:"color: #aa0;"},PerfMinor:{name:"Perf",style:"color: #088;"},PerfVerbose:{name:"Perf",style:"color: #888;"},Cursor:{name:"Cursor",style:""},Stitch:{name:"Stitch",style:""},StitchDrawables:{name:"Stitch",style:""},GreedyStitcher:{name:"Greedy",style:"color: #088;"},GreedyVerbose:{name:"Greedy",style:"color: #888;"},RelativeTransform:{name:"RelativeTransform",style:"color: #606;"},BackboneDrawable:{name:"Backbone",style:"color: #a00;"},CanvasBlock:{name:"Canvas",style:""},WebGLBlock:{name:"WebGL",style:""},Display:{name:"Display",style:""},DOMBlock:{name:"DOM",style:""},Drawable:{name:"",style:""},FittedBlock:{name:"FittedBlock",style:""},Instance:{name:"Instance",style:""},InstanceTree:{name:"InstanceTree",style:""},ChangeInterval:{name:"ChangeInterval",style:"color: #0a0;"},SVGBlock:{name:"SVG",style:""},SVGGroup:{name:"SVGGroup",style:""},ImageSVGDrawable:{name:"ImageSVGDrawable",style:""},Paints:{name:"Paints",style:""},Filters:{name:"Filters",style:""},AlignBox:{name:"AlignBox",style:""},AlignGroup:{name:"AlignGroup",style:""},RichText:{name:"RichText",style:""},Sim:{name:"Sim",style:""},ParallelDOM:{name:"ParallelDOM",style:""},PDOMInstance:{name:"PDOMInstance",style:""},PDOMTree:{name:"PDOMTree",style:""},PDOMDisplaysInfo:{name:"PDOMDisplaysInfo",style:""},KeyboardFuzzer:{name:"KeyboardFuzzer",style:""},InputListener:{name:"InputListener",style:""},InputEvent:{name:"InputEvent",style:""},OnInput:{name:"OnInput",style:""},Pointer:{name:"Pointer",style:""},Input:{name:"Input",style:""},EventDispatch:{name:"EventDispatch",style:""},EventPath:{name:"EventPath",style:""}};O(J,{logString:"",logFunction:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];window.console&&window.console.log&&window.console.log(...Array.prototype.slice.call(t,0))},switchLogToConsole:function(){J.logFunction=v},switchLogToString:function(){window.console&&window.console.log("switching to string log"),J.logFunction=j},enableIndividualLog:function(e){return"stitch"===e?(this.enableIndividualLog("Stitch"),this.enableIndividualLog("StitchDrawables"),this.enableIndividualLog("GreedyStitcher"),void this.enableIndividualLog("GreedyVerbose")):"perf"===e?(this.enableIndividualLog("PerfCritical"),this.enableIndividualLog("PerfMajor"),this.enableIndividualLog("PerfMinor"),void this.enableIndividualLog("PerfVerbose")):"input"===e?(this.enableIndividualLog("InputListener"),this.enableIndividualLog("InputEvent"),this.enableIndividualLog("OnInput"),this.enableIndividualLog("Pointer"),this.enableIndividualLog("Input"),this.enableIndividualLog("EventDispatch"),void this.enableIndividualLog("EventPath")):"a11y"===e||"pdom"===e?(this.enableIndividualLog("ParallelDOM"),this.enableIndividualLog("PDOMInstance"),this.enableIndividualLog("PDOMTree"),void this.enableIndividualLog("PDOMDisplaysInfo")):void(e&&(window.sceneryLog[e]=window.sceneryLog[e]||function(t,i){const s=H[e],n=s.name?`[${s.name}] `:"";J.logFunction(`%c${K}%c${n}${t}`,"color: #ddd;",i||s.style)}))},disableIndividualLog:function(e){e&&delete window.sceneryLog[e]},enableLogging:function(e){window.sceneryLog=function(e){J.logFunction(e)},window.sceneryLog.push=function(){K+="| "},window.sceneryLog.pop=function(){K=K.slice(0,-2)},window.sceneryLog.getDepth=function(){return K.length/2};for(let t=0;t<e.length;t++)this.enableIndividualLog(e[t])},disableLogging:function(){window.sceneryLog=null},isLoggingPerformance:function(){return window.sceneryLog.PerfCritical||window.sceneryLog.PerfMajor||window.sceneryLog.PerfMinor||window.sceneryLog.PerfVerbose}});const W=J,z={DISABLED_OPACITY:.45,DEFAULT_COLOR_PROFILE:"default",PROJECTOR_COLOR_PROFILE:"projector"};W.register("SceneryConstants",z);const X=z;var ee=i(1935),te=i(1685),ie=i(8964),se=i(3600),ne=i(8585);const re=ie.Z.clamp,oe=ie.Z.linear,Ae="(-?\\d{1,3}%?)";function ae(e){let t=1;return e.endsWith("%")&&(t=2.55,e=e.slice(0,e.length-1)),ie.Z.roundSymmetric(Number(e)*t)}class le{constructor(e,t,i,s){this.changeEmitter=new te.Z,this.set(e,t,i,s)}copy(){return new le(this.r,this.g,this.b,this.a)}set(e,t,i,s){if(null===e)this.setRGBA(0,0,0,0);else if("string"==typeof e)this.setCSS(e);else if(e instanceof le)this.setRGBA(e.r,e.g,e.b,e.a);else if(void 0===i){const i=e>>16&255,s=e>>8&255,n=e>>0&255,r=void 0===t?1:t;this.setRGBA(i,s,n,r)}else this.setRGBA(e,t,i,void 0===s?1:s);return this}getRed(){return this.r}get red(){return this.getRed()}set red(e){this.setRed(e)}setRed(e){return this.setRGBA(e,this.g,this.b,this.a)}getGreen(){return this.g}get green(){return this.getGreen()}set green(e){this.setGreen(e)}setGreen(e){return this.setRGBA(this.r,e,this.b,this.a)}getBlue(){return this.b}get blue(){return this.getBlue()}set blue(e){this.setBlue(e)}setBlue(e){return this.setRGBA(this.r,this.g,e,this.a)}getAlpha(){return this.a}get alpha(){return this.getAlpha()}set alpha(e){this.setAlpha(e)}setAlpha(e){return this.setRGBA(this.r,this.g,this.b,e)}setRGBA(e,t,i,s){return this.r=ie.Z.roundSymmetric(re(e,0,255)),this.g=ie.Z.roundSymmetric(re(t,0,255)),this.b=ie.Z.roundSymmetric(re(i,0,255)),this.a=re(s,0,1),this.updateColor(),this}blend(e,t){const i=Math.pow(this.r,2.4),s=Math.pow(e.r,2.4),n=Math.pow(this.g,2.4),r=Math.pow(e.g,2.4),o=Math.pow(this.b,2.4),A=Math.pow(e.b,2.4),a=Math.pow(i+(s-i)*t,1/2.4),h=Math.pow(n+(r-n)*t,1/2.4),l=Math.pow(o+(A-o)*t,1/2.4),g=this.a+(e.a-this.a)*t;return new le(a,h,l,g)}computeCSS(){if(1===this.a)return`rgb(${this.r},${this.g},${this.b})`;{let e=this.a.toFixed(20);for(;e.length>=2&&e.endsWith("0")&&"."!==e[e.length-2];)e=e.slice(0,e.length-1);const t=0===this.a||1===this.a?this.a:e;return`rgba(${this.r},${this.g},${this.b},${t})`}}toCSS(){return this._css}setCSS(e){let t=!1;const i=le.preprocessCSS(e);for(let s=0;s<le.formatParsers.length;s++){const e=le.formatParsers[s],n=e.regexp.exec(i);if(n){e.apply(this,n),t=!0;break}}if(!t)throw new Error("Color unable to parse color string: "+e);return this.updateColor(),this}toNumber(){return(this.r<<16)+(this.g<<8)+this.b}updateColor(){const e=this._css;this._css=this.computeCSS(),e!==this._css&&this.changeEmitter.emit()}setImmutable(){return this}getCanvasStyle(){return this.toCSS()}setHSLA(e,t,i,s){let n;e=e%360/360,t=re(t/100,0,1),n=(i=re(i/100,0,1))<.5?i*(t+1):i+t-i*t;const r=2*i-n;return this.r=ie.Z.roundSymmetric(255*le.hueToRGB(r,n,e+1/3)),this.g=ie.Z.roundSymmetric(255*le.hueToRGB(r,n,e)),this.b=ie.Z.roundSymmetric(255*le.hueToRGB(r,n,e-1/3)),this.a=re(s,0,1),this.updateColor(),this}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}withAlpha(e){return new le(this.r,this.g,this.b,e)}checkFactor(e){return void 0===e?.7:e}brighterColor(e){e=this.checkFactor(e);const t=Math.min(255,Math.floor(this.r/e)),i=Math.min(255,Math.floor(this.g/e)),s=Math.min(255,Math.floor(this.b/e));return new le(t,i,s,this.a)}colorUtilsBrighter(e){e=this.checkFactor(e);const t=Math.min(255,this.getRed()+Math.floor(e*(255-this.getRed()))),i=Math.min(255,this.getGreen()+Math.floor(e*(255-this.getGreen()))),s=Math.min(255,this.getBlue()+Math.floor(e*(255-this.getBlue())));return new le(t,i,s,this.getAlpha())}darkerColor(e){e=this.checkFactor(e);const t=Math.max(0,Math.floor(e*this.r)),i=Math.max(0,Math.floor(e*this.g)),s=Math.max(0,Math.floor(e*this.b));return new le(t,i,s,this.a)}colorUtilsDarker(e){e=this.checkFactor(e);const t=Math.max(0,this.getRed()-Math.floor(e*this.getRed())),i=Math.max(0,this.getGreen()-Math.floor(e*this.getGreen())),s=Math.max(0,this.getBlue()-Math.floor(e*this.getBlue()));return new le(t,i,s,this.getAlpha())}colorUtilsBrightness(e){return 0===e?this:e>0?this.colorUtilsBrighter(e):this.colorUtilsDarker(-e)}toString(){return`${this.constructor.name}[r:${this.r} g:${this.g} b:${this.b} a:${this.a}]`}toHexString(){let e=this.toNumber().toString(16);for(;e.length<6;)e="0"+e;return"#"+e}toStateObject(){return{r:this.r,g:this.g,b:this.b,a:this.a}}static hueToRGB(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}static toColor(e){return null===e?le.TRANSPARENT:e instanceof le?e:"string"==typeof e?new le(e):le.toColor(e.value)}static interpolateRGBA(e,t,i){if(i<0||i>1)throw new Error("distance must be between 0 and 1: "+i);const s=Math.floor(oe(0,1,e.r,t.r,i)),n=Math.floor(oe(0,1,e.g,t.g,i)),r=Math.floor(oe(0,1,e.b,t.b,i)),o=oe(0,1,e.a,t.a,i);return new le(s,n,r,o)}static supersampleBlend(e){const t=e.map(e=>Math.pow(e.r/255,2.2)),i=e.map(e=>Math.pow(e.g/255,2.2)),s=e.map(e=>Math.pow(e.b/255,2.2)),n=e.map(e=>Math.pow(e.a,2.2)),r=_.sum(n);if(0===r)return new le(0,0,0,0);const o=_.sum(_.range(0,e.length).map(e=>t[e]*n[e]))/r,A=_.sum(_.range(0,e.length).map(e=>i[e]*n[e]))/r,a=_.sum(_.range(0,e.length).map(e=>s[e]*n[e]))/r,h=r/e.length;return new le(Math.floor(255*Math.pow(o,1/2.2)),Math.floor(255*Math.pow(A,1/2.2)),Math.floor(255*Math.pow(a,1/2.2)),Math.pow(h,1/2.2))}static fromStateObject(e){return new le(e.r,e.g,e.b,e.a)}static hsla(e,t,i,s){return new le(0,0,0,1).setHSLA(e,t,i,s)}static checkPaintString(e){0}static checkPaint(e){"string"==typeof e?le.checkPaintString(e):e instanceof ee.Z&&"string"==typeof e.value&&le.checkPaintString(e.value)}static getLuminance(e){const t=le.toColor(e),i=.2126*t.red+.7152*t.green+.0722*t.blue;return i}static toGrayscale(e){const t=le.getLuminance(e);return new le(t,t,t)}static isDarkColor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:186;return le.getLuminance(e)<t}static isLightColor(e,t){return!le.isDarkColor(e,t)}static grayColor(e,t){return new le(e,e,e,t)}static preprocessCSS(e){let t=e.replace(/ /g,"").toLowerCase();const i=le.colorKeywords[t];return i&&(t="#"+i),t}static isCSSColorString(e){const t=le.preprocessCSS(e);for(let i=0;i<le.formatParsers.length;i++){if(le.formatParsers[i].regexp.exec(t))return!0}return!1}}_defineProperty(le,"formatParsers",[{regexp:/^transparent$/,apply:(e,t)=>{e.setRGBA(0,0,0,0)}},{regexp:/^#(\w{1})(\w{1})(\w{1})$/,apply:(e,t)=>{e.setRGBA(parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),1)}},{regexp:/^#(\w{2})(\w{2})(\w{2})$/,apply:(e,t)=>{e.setRGBA(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),1)}},{regexp:new RegExp(`^rgb\\(${Ae},${Ae},${Ae}\\)$`),apply:(e,t)=>{e.setRGBA(ae(t[1]),ae(t[2]),ae(t[3]),1)}},{regexp:new RegExp(`^rgba\\(${Ae},${Ae},${Ae},(\\d+|\\d*\\.\\d+)\\)$`),apply:(e,t)=>{e.setRGBA(ae(t[1]),ae(t[2]),ae(t[3]),Number(t[4]))}},{regexp:new RegExp("^hsl\\((\\d{1,3}),(\\d{1,3})%,(\\d{1,3})%\\)$"),apply:(e,t)=>{e.setHSLA(Number(t[1]),Number(t[2]),Number(t[3]),1)}},{regexp:new RegExp("^hsla\\((\\d{1,3}),(\\d{1,3})%,(\\d{1,3})%,(\\d+|\\d*\\.\\d+)\\)$"),apply:(e,t)=>{e.setHSLA(Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]))}}]),_defineProperty(le,"basicColorKeywords",{aqua:"00ffff",black:"000000",blue:"0000ff",fuchsia:"ff00ff",gray:"808080",green:"008000",lime:"00ff00",maroon:"800000",navy:"000080",olive:"808000",purple:"800080",red:"ff0000",silver:"c0c0c0",teal:"008080",white:"ffffff",yellow:"ffff00"}),_defineProperty(le,"colorKeywords",{aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}),W.register("Color",le),le.BLACK=le.black=new le(0,0,0).setImmutable(),le.BLUE=le.blue=new le(0,0,255).setImmutable(),le.CYAN=le.cyan=new le(0,255,255).setImmutable(),le.DARK_GRAY=le.darkGray=new le(64,64,64).setImmutable(),le.GRAY=le.gray=new le(128,128,128).setImmutable(),le.GREEN=le.green=new le(0,255,0).setImmutable(),le.LIGHT_GRAY=le.lightGray=new le(192,192,192).setImmutable(),le.MAGENTA=le.magenta=new le(255,0,255).setImmutable(),le.ORANGE=le.orange=new le(255,200,0).setImmutable(),le.PINK=le.pink=new le(255,175,175).setImmutable(),le.RED=le.red=new le(255,0,0).setImmutable(),le.WHITE=le.white=new le(255,255,255).setImmutable(),le.YELLOW=le.yellow=new le(255,255,0).setImmutable(),le.TRANSPARENT=le.transparent=new le(0,0,0,0).setImmutable();new le("blue");function ge(e,t){return void 0!==e[t]?t:void 0!==e["moz"+(t=t.charAt(0).toUpperCase()+t.slice(1))]?"moz"+t:void 0!==e["Moz"+t]?"Moz"+t:void 0!==e["webkit"+t]?"webkit"+t:void 0!==e["ms"+t]?"ms"+t:void 0!==e["o"+t]?"o"+t:void 0}le.ColorIO=new se.Z("ColorIO",{valueType:le,documentation:"A color, with rgba",toStateObject:e=>e.toStateObject(),fromStateObject:e=>new le(e.r,e.g,e.b,e.a),stateSchema:{r:ne.Z,g:ne.Z,b:ne.Z,a:ne.Z}}),P.Z.register("detectPrefix",ge);const ce=ge,de={};function ue(e){try{const t=document.createElement("canvas");t.width=1,t.height=1;const i=t.getContext("2d");i.fillStyle="black",i.fillRect(0,0,1,1);const s=t.toDataURL([e]),n="data:"+e;return s.slice(0,n.length)===n}catch(t){return!1}}function me(e,t){const i=document.createElement("canvas");i.width=1,i.height=1;const s=i.getContext("2d"),n=document.createElement("img");n.crossOrigin="Anonymous";const r=()=>{try{s.drawImage(n,0,0),i.toDataURL(),de[e]=!0}catch(t){de[e]=!1}};n.onload=r;try{n.src=t,n.complete&&r()}catch(o){de[e]=!1}}W.register("Features",de),de.canvasPNGOutput=ue("image/png"),de.canvasJPEGOutput=ue("image/jpeg"),de.canvasGIFOutput=ue("image/gif"),de.canvasICONOutput=ue("image/x-icon"),me("canvasPNGInput","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NkYGD4DwABCQEBtxmN7wAAAABJRU5ErkJggg=="),me("canvasJPEGInput","data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCAABAAEDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD8qqKKKAP/2Q=="),me("canvasSVGInput","data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3cG9ydD0iMCAwIDEgMSIgd2lkdGg9IjEiIGhlaWdodD0iMSIgPg0KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiByeD0iMCIgcnk9IjAiIHN0eWxlPSJmaWxsOiBibGFjazsgc3Ryb2tlOiBub25lOyI+PC9yZWN0Pg0KPC9zdmc+DQo="),me("canvasGIFInput","data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEAAAIALAAAAAABAAEAAAICRAEAOw==");const pe=document.createElement("canvas"),Ve=pe.getContext("2d");de.toDataURLHD=ce(pe,"toDataURLHD"),de.createImageDataHD=ce(Ve,"createImageDataHD"),de.getImageDataHD=ce(Ve,"getImageDataHD"),de.putImageDataHD=ce(Ve,"putImageDataHD"),de.currentTransform=ce(Ve,"currentTransform"),de.canvasFilter=ce(Ve,"filter");const Me=document.createElement("span"),Be=document.createElement("div");de.textStroke=ce(Me.style,"textStroke"),de.textStrokeColor=ce(Me.style,"textStrokeColor"),de.textStrokeWidth=ce(Me.style,"textStrokeWidth"),de.transform=ce(Be.style,"transform"),de.transformOrigin=ce(Be.style,"transformOrigin"),de.backfaceVisibility=ce(Be.style,"backfaceVisibility"),de.borderRadius=ce(Be.style,"borderRadius"),de.userSelect=ce(Be.style,"userSelect"),de.touchAction=ce(Be.style,"touchAction"),de.touchCallout=ce(Be.style,"touchCallout"),de.userDrag=ce(Be.style,"userDrag"),de.tapHighlightColor=ce(Be.style,"tapHighlightColor"),de.fontSmoothing=ce(Be.style,"fontSmoothing"),de.requestAnimationFrame=ce(window,"requestAnimationFrame"),de.cancelAnimationFrame=ce(window,"cancelAnimationFrame"),de.setStyle=(e,t,i)=>{void 0!==t&&(e.style[t]=i)},de.passive=!1,window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{de.passive=!0}}));const we=de;var Ce=i(2550),Ee=i(8664),Ye=i(2643);const De=["normal","italic","oblique"],ye=["normal","small-caps"],Ie=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"],qe=["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"];class Ge extends Ee.Z{constructor(e){const t=(0,Ce.ZP)()({style:"normal",variant:"normal",weight:"normal",stretch:"normal",size:"10px",lineHeight:"normal",family:"sans-serif",phetioType:Ge.FontIO},e);super(t),this._style=t.style,this._variant=t.variant,this._weight=""+t.weight,this._stretch=t.stretch,this._size=Ge.castSize(t.size),this._lineHeight=t.lineHeight,this._family=t.family,this._font=this.computeShorthand()}getFont(){return this._font}get font(){return this.getFont()}getStyle(){return this._style}get style(){return this.getStyle()}getVariant(){return this._variant}get variant(){return this.getVariant()}getWeight(){return this._weight}get weight(){return this.getWeight()}getStretch(){return this._stretch}get stretch(){return this.getStretch()}getSize(){return this._size}get size(){return this.getSize()}getNumericSize(){const e=this._size.match(/^(\d+)px$/);if(e)return Number(e[1]);const t=this._size.match(/^(\d+)pt$/);if(t)return.75*Number(t[1]);const i=this._size.match(/^(\d+)em$/);return i?Number(i[1])/16:12}get numericSize(){return this.getNumericSize()}getLineHeight(){return this._lineHeight}get lineHeight(){return this.getLineHeight()}getFamily(){return this._family}get family(){return this.getFamily()}copy(e){return new Ge((0,Ce.JA)({style:this._style,variant:this._variant,weight:this._weight,stretch:this._stretch,size:this._size,lineHeight:this._lineHeight,family:this._family},e))}computeShorthand(){let e="";return"normal"!==this._style&&(e+=this._style+" "),"normal"!==this._variant&&(e+=this._variant+" "),"normal"!==this._weight&&(e+=this._weight+" "),"normal"!==this._stretch&&(e+=this._stretch+" "),e+=this._size,"normal"!==this._lineHeight&&(e+="/"+this._lineHeight),e+=" "+this._family,e}toCSS(){return this.getFont()}static castSize(e){return"number"==typeof e?e+"px":e}static isFontStyle(e){return De.includes(e)}static isFontVariant(e){return ye.includes(e)}static isFontWeight(e){return Ie.includes(e)}static isFontStretch(e){return qe.includes(e)}static fromCSS(e){const t={},i=_.filter(e.split(/[\x09\x0A\x0C\x0D\x20]/),e=>e.length>0);for(let s=0;s<i.length;s++){const e=i[s];if("normal"===e);else if(Ge.isFontStyle(e))t.style=e;else if(Ge.isFontVariant(e))t.variant=e;else if(Ge.isFontWeight(e))t.weight=e;else{if(!Ge.isFontStretch(e)){const n=e.split(/\//);t.size=n[0],n[1]&&(t.lineHeight=n[1]),t.family=i.slice(s+1).join(" ");break}t.stretch=e}}return new Ge(t)}}_defineProperty(Ge,"DEFAULT",new Ge),W.register("Font",Ge),Ge.FontIO=new se.Z("FontIO",{valueType:Ge,documentation:"Font handling for text drawing. Options:<ul><li><strong>style:</strong> normal      &mdash; normal | italic | oblique </li><li><strong>variant:</strong> normal    &mdash; normal | small-caps </li><li><strong>weight:</strong> normal     &mdash; normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 </li><li><strong>stretch:</strong> normal    &mdash; normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded </li><li><strong>size:</strong> 10px         &mdash; absolute-size | relative-size | length | percentage -- unitless number interpreted as px. absolute suffixes: cm, mm, in, pt, pc, px. relative suffixes: em, ex, ch, rem, vw, vh, vmin, vmax. </li><li><strong>lineHeight:</strong> normal &mdash; normal | number | length | percentage -- NOTE: Canvas spec forces line-height to normal </li><li><strong>family:</strong> sans-serif &mdash; comma-separated list of families, including generic families (serif, sans-serif, cursive, fantasy, monospace). ideally escape with double-quotes</li></ul>",toStateObject:e=>({style:e.getStyle(),variant:e.getVariant(),weight:e.getWeight(),stretch:e.getStretch(),size:e.getSize(),lineHeight:e.getLineHeight(),family:e.getFamily()}),fromStateObject:e=>new Ge(e),stateSchema:{style:Ye.Z,variant:Ye.Z,weight:Ye.Z,stretch:Ye.Z,size:Ye.Z,lineHeight:Ye.Z,family:Ye.Z}});const Qe={};W.register("Renderer",Qe),Qe.numActiveRenderers=4,Qe.bitsPerRenderer=5,Qe.bitmaskRendererArea=255,Qe.bitmaskCurrentRendererArea=15,Qe.bitmaskLacksOffset=65536,Qe.bitmaskLacksShift=16,Qe.bitmaskNodeDefault=Qe.bitmaskRendererArea,Qe.bitmaskCanvas=1,Qe.bitmaskSVG=2,Qe.bitmaskDOM=4,Qe.bitmaskWebGL=8,Qe.bitmaskSingleCanvas=256,Qe.bitmaskSingleSVG=512,Qe.bitmaskNotPainted=4096,Qe.bitmaskBoundsValid=8192,Qe.bitmaskNoPDOM=16384,Qe.bitmaskLacksCanvas=Qe.bitmaskCanvas<<Qe.bitmaskLacksShift,Qe.bitmaskLacksSVG=Qe.bitmaskSVG<<Qe.bitmaskLacksShift,Qe.bitmaskLacksDOM=Qe.bitmaskDOM<<Qe.bitmaskLacksShift,Qe.bitmaskLacksWebGL=Qe.bitmaskWebGL<<Qe.bitmaskLacksShift,Qe.isCanvas=function(e){return 0!=(e&Qe.bitmaskCanvas)},Qe.isSVG=function(e){return 0!=(e&Qe.bitmaskSVG)},Qe.isDOM=function(e){return 0!=(e&Qe.bitmaskDOM)},Qe.isWebGL=function(e){return 0!=(e&Qe.bitmaskWebGL)};const Se={canvas:Qe.bitmaskCanvas,svg:Qe.bitmaskSVG,dom:Qe.bitmaskDOM,webgl:Qe.bitmaskWebGL};Qe.fromName=function(e){return Se[e]},Qe.stripBitmask=function(e){return e&Qe.bitmaskRendererArea},Qe.createOrderBitmask=function(e,t,i,s){return(e=e||0)|(t=t||0)<<5|(i=i||0)<<10|(s=s||0)<<15},Qe.bitmaskOrder=function(e,t){return t>0&&(e>>=5*t),e&Qe.bitmaskCurrentRendererArea},Qe.bitmaskOrderFirst=function(e){return e&Qe.bitmaskCurrentRendererArea},Qe.bitmaskOrderSecond=function(e){return e>>5&Qe.bitmaskCurrentRendererArea},Qe.bitmaskOrderThird=function(e){return e>>10&Qe.bitmaskCurrentRendererArea},Qe.bitmaskOrderFourth=function(e){return e>>15&Qe.bitmaskCurrentRendererArea},Qe.pushOrderBitmask=function(e,t){let i=t;const s=Qe.bitsPerRenderer*Qe.numActiveRenderers;for(let n=0;n<=s;n+=Qe.bitsPerRenderer){const s=e>>n&Qe.bitmaskCurrentRendererArea;if(s===i)return e;if(0===s)return e|=i<<n;if(e&=~(Qe.bitmaskCurrentRendererArea<<n),e|=i<<n,i=s,i===t)return e}throw new Error("pushOrderBitmask overflow")},Qe.createSelfDrawable=function(e,t,i,s){let n;if(Qe.isCanvas(i))n=t.createCanvasDrawable(i,e);else if(Qe.isSVG(i))n=t.createSVGDrawable(i,e);else if(Qe.isDOM(i))n=t.createDOMDrawable(i,e);else{if(!Qe.isWebGL(i))throw new Error("Unrecognized renderer: "+i);n=t.createWebGLDrawable(i,e)}return n.setFittable(s),n},Qe.webglCustom=1,Qe.webglTexturedTriangles=2,Qe.webglVertexColorPolygons=3;const Te=Qe,xe="http://www.w3.org/2000/svg";W.register("svgns",xe);const ke=xe,Fe="http://www.w3.org/1999/xlink";W.register("xlinkns",Fe);const Re=Fe;var Ue=i(1603),Le=i(9972),Pe=i(7320),be=i(668),Oe=i(2823);function fe(e,t){return new be.Z(e,t)}const Ze=we.transform,Ne=we.transformOrigin||"transformOrigin";let Ke,Je=!0;const je={prepareForTransform(e){e.style[Ne]="top left"},applyPreparedTransform(e,t){t.style[Ze]=e.getCSSTransform()},setTransform(e,t){t.style[Ze]=e},unsetTransform(e){e.style[Ze]=""},polyfillRequestAnimationFrame(){window.requestAnimationFrame&&window.cancelAnimationFrame||(we.requestAnimationFrame&&we.cancelAnimationFrame?(window.requestAnimationFrame=window[we.requestAnimationFrame],window.cancelAnimationFrame=window[we.cancelAnimationFrame]):(window.requestAnimationFrame=e=>{const t=Date.now();return window.setTimeout(()=>{e(Date.now()-t)},16)},window.cancelAnimationFrame=clearTimeout))},backingStorePixelRatio:e=>e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1,backingScale(e){if("devicePixelRatio"in window){const t=je.backingStorePixelRatio(e);return window.devicePixelRatio/t}return 1},supportsNativeCanvasFilter:()=>!!we.canvasFilter,supportsImageDataCanvasFilter:()=>1===je.backingStorePixelRatio(W.scratchContext),scanBounds(e,t,i){const s=_.map(_.range(t),()=>!1),n=_.map(_.range(t),()=>!1);for(let l=0;l<t;l++)for(let i=0;i<t;i++){const r=4*(i*t+l);0===e.data[r]&&0===e.data[r+1]&&0===e.data[r+2]&&0===e.data[r+3]||(s[l]=!0,n[i]=!0)}const r=_.indexOf(s,!0),o=_.lastIndexOf(s,!0),A=_.indexOf(n,!0),a=_.lastIndexOf(n,!0),h=t/16;return{minBounds:new Ue.Z(r<1||r>=t-1?Number.POSITIVE_INFINITY:i.inversePosition2(fe(r+1+h,0)).x,A<1||A>=t-1?Number.POSITIVE_INFINITY:i.inversePosition2(fe(0,A+1+h)).y,o<1||o>=t-1?Number.NEGATIVE_INFINITY:i.inversePosition2(fe(o-h,0)).x,a<1||a>=t-1?Number.NEGATIVE_INFINITY:i.inversePosition2(fe(0,a-h)).y),maxBounds:new Ue.Z(r<1||r>=t-1?Number.NEGATIVE_INFINITY:i.inversePosition2(fe(r-1-h,0)).x,A<1||A>=t-1?Number.NEGATIVE_INFINITY:i.inversePosition2(fe(0,A-1-h)).y,o<1||o>=t-1?Number.POSITIVE_INFINITY:i.inversePosition2(fe(o+2+h,0)).x,a<1||a>=t-1?Number.POSITIVE_INFINITY:i.inversePosition2(fe(0,a+2+h)).y)}},canvasAccurateBounds(e,t){const i=t&&t.precision?t.precision:.001,s=t&&t.resolution?t.resolution:128,n=t&&t.initialScale?t.initialScale:1/16;let r=Ue.Z.NOTHING,o=Ue.Z.EVERYTHING;const A=document.createElement("canvas");A.width=s,A.height=s;const a=A.getContext("2d");function h(t){a.save(),t.matrix.canvasSetTransform(a),e(a),a.restore();const i=a.getImageData(0,0,s,s),n=je.scanBounds(i,s,t);return a.clearRect(0,0,s,s),n}function l(e){const t=(s-4)/(e.maxX-e.minX),i=(s-4)/(e.maxY-e.minY),n=-t*e.minX+2,r=-i*e.minY+2;return new Pe.Z(Le.Z.translation(n,r).timesMatrix(Le.Z.scaling(t,i)))}const g=new Pe.Z;g.append(Le.Z.translation(s/2,s/2)),g.append(Le.Z.scaling(n));const c=h(g);let d,u,m;for(r=r.union(c.minBounds),o=o.intersection(c.maxBounds),d=o.minY,u=o.maxY;isFinite(r.minX)&&isFinite(o.minX)&&Math.abs(r.minX-o.minX)>i;){if(m=h(l(new Ue.Z(o.minX,d,r.minX,u))),r.minX<=m.minBounds.minX&&o.minX>=m.maxBounds.minX){0;break}r=r.withMinX(Math.min(r.minX,m.minBounds.minX)),o=o.withMinX(Math.max(o.minX,m.maxBounds.minX)),d=Math.max(d,m.maxBounds.minY),u=Math.min(u,m.maxBounds.maxY)}for(d=o.minY,u=o.maxY;isFinite(r.maxX)&&isFinite(o.maxX)&&Math.abs(r.maxX-o.maxX)>i;){if(m=h(l(new Ue.Z(r.maxX,d,o.maxX,u))),r.maxX>=m.minBounds.maxX&&o.maxX<=m.maxBounds.maxX){0;break}r=r.withMaxX(Math.max(r.maxX,m.minBounds.maxX)),o=o.withMaxX(Math.min(o.maxX,m.maxBounds.maxX)),d=Math.max(d,m.maxBounds.minY),u=Math.min(u,m.maxBounds.maxY)}for(d=o.minX,u=o.maxX;isFinite(r.minY)&&isFinite(o.minY)&&Math.abs(r.minY-o.minY)>i;){if(m=h(l(new Ue.Z(d,o.minY,u,r.minY))),r.minY<=m.minBounds.minY&&o.minY>=m.maxBounds.minY){0;break}r=r.withMinY(Math.min(r.minY,m.minBounds.minY)),o=o.withMinY(Math.max(o.minY,m.maxBounds.minY)),d=Math.max(d,m.maxBounds.minX),u=Math.min(u,m.maxBounds.maxX)}for(d=o.minX,u=o.maxX;isFinite(r.maxY)&&isFinite(o.maxY)&&Math.abs(r.maxY-o.maxY)>i;){if(m=h(l(new Ue.Z(d,r.maxY,u,o.maxY))),r.maxY>=m.minBounds.maxY&&o.maxY<=m.maxBounds.maxY){0;break}r=r.withMaxY(Math.max(r.maxY,m.minBounds.maxY)),o=o.withMaxY(Math.min(o.maxY,m.maxBounds.maxY)),d=Math.max(d,m.maxBounds.minX),u=Math.min(u,m.maxBounds.maxX)}const p=new Ue.Z(isFinite(r.minX)&&isFinite(o.minX)?(r.minX+o.minX)/2:Number.POSITIVE_INFINITY,isFinite(r.minY)&&isFinite(o.minY)?(r.minY+o.minY)/2:Number.POSITIVE_INFINITY,isFinite(r.maxX)&&isFinite(o.maxX)?(r.maxX+o.maxX)/2:Number.NEGATIVE_INFINITY,isFinite(r.maxY)&&isFinite(o.maxY)?(r.maxY+o.maxY)/2:Number.NEGATIVE_INFINITY);return p.minBounds=r,p.maxBounds=o,p.isConsistent=o.containsBounds(r),p.precision=Math.max(Math.abs(r.minX-o.minX),Math.abs(r.minY-o.minY),Math.abs(r.maxX-o.maxX),Math.abs(r.maxY-o.maxY)),p},toPowerOf2(e){let t=1;for(;t<e;)t*=2;return t},createShader(e,t,i){const s=e.createShader(i);return e.shaderSource(s,t),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS)||(console.log("GLSL compile error:"),console.log(e.getShaderInfoLog(s)),console.log(t)),s},applyWebGLContextDefaults(e){e.clearColor(0,0,0,0),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)},setWebGLEnabled(e){Je=e},checkWebGLSupport(e){if(!Je)return!1;const t=document.createElement("canvas"),i={failIfMajorPerformanceCaveat:!0};try{const s=!!window.WebGLRenderingContext&&(t.getContext("webgl",i)||t.getContext("experimental-webgl",i));if(!s)return!1;if(e)for(let t=0;t<e.length;t++)if(null===s.getExtension(e[t]))return!1;return!0}catch(s){return!1}},checkIE11StencilSupport(){const e=document.createElement("canvas");try{const t=!!window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl"));return!!t&&(t.clearStencil(0),0===t.getError())}catch(t){return!1}},get isWebGLSupported(){return void 0===Ke&&(Ke=je.checkWebGLSupport()),Ke},loseContext(e){const t=e.getExtension("WEBGL_lose_context");t&&(t.loseContext(),setTimeout(()=>{t.restoreContext()},1e3))},safariEmbeddingMarkWorkaround(e){if(Oe.Z.safari){const t=e.split("");let i="",s=!1;for(let e=0;e<t.length;e++){const n=t[e],r="‪"===n||"‫"===n||"‬"===n;s&&r&&(i+="​"),i+=n,s=r}return i}return e}};W.register("Utils",je);const ve=je;var He=i(0);class We{constructor(e,t){this.display=e,this.trail=t}}s=We,_defineProperty(We,"FocusIO",new se.Z("FocusIO",{valueType:s,documentation:"A IO Type for the instance in the simulation which currently has keyboard focus. FocusIO is serialized into and Object with key `focusedPhetioElement` that is a list of PhET-iO Elements, from parent-most to child-most corresponding to the PhET-iO Element that was instrumented.",toStateObject:e=>{const t=[];return e.trail.nodes.forEach((e,i)=>{e.isPhetioInstrumented()&&t.push(e.tandem.phetioID)}),{focusedPhetioElement:t}},stateSchema:{focusedPhetioElement:(0,He.Z)(Ye.Z)}})),W.register("Focus",We);const ze=We;var Xe=i(7959);const _e=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],$e=["KeyW","KeyS","KeyA","KeyD"],et=["Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9"],tt=["ShiftLeft","ShiftRight"],it=["ControlLeft","ControlRight"],st=["AltLeft","AltRight"],nt=["MetaLeft","MetaRight","OSLeft","OSRight"],rt=["Alt","Control","Shift"],ot=["AltLeft","AltRight","ControlLeft","ControlRight","ShiftLeft","ShiftRight","MetaLeft","MetaRight","OSLeft","OSRight"],At={valueType:Event},at=[],ht={KEY_SPACE:"Space",KEY_ENTER:"Enter",KEY_TAB:"Tab",KEY_RIGHT_ARROW:"ArrowRight",KEY_LEFT_ARROW:"ArrowLeft",KEY_UP_ARROW:"ArrowUp",KEY_DOWN_ARROW:"ArrowDown",KEY_SHIFT_LEFT:"ShiftLeft",KEY_SHIFT_RIGHT:"ShiftRight",KEY_ALT_LEFT:"AltLeft",KEY_ALT_RIGHT:"AltRight",KEY_CONTROL_LEFT:"ControlLeft",KEY_CONTROL_RIGHT:"ControlRight",KEY_META_LEFT:"MetaLeft",KEY_META_RIGHT:"MetaRight",KEY_META_LEFT_FIREFOX:"OSLeft",KEY_META_RIGHT_FIREFOX:"OSRight",KEY_SHIFT:"Shift",KEY_ALT:"Alt",KEY_CONTROL:"Control",KEY_ESCAPE:"Escape",KEY_DELETE:"Delete",KEY_BACKSPACE:"Backspace",KEY_PAGE_UP:"PageUp",KEY_PAGE_DOWN:"PageDown",KEY_END:"End",KEY_HOME:"Home",KEY_0:"Digit0",KEY_1:"Digit1",KEY_2:"Digit2",KEY_3:"Digit3",KEY_4:"Digit4",KEY_5:"Digit5",KEY_6:"Digit6",KEY_7:"Digit7",KEY_8:"Digit8",KEY_9:"Digit9",KEY_NUMPAD_0:"Numpad0",KEY_NUMPAD_1:"Numpad1",KEY_NUMPAD_2:"Numpad2",KEY_NUMPAD_3:"Numpad3",KEY_NUMPAD_4:"Numpad4",KEY_NUMPAD_5:"Numpad5",KEY_NUMPAD_6:"Numpad6",KEY_NUMPAD_7:"Numpad7",KEY_NUMPAD_8:"Numpad8",KEY_NUMPAD_9:"Numpad9",KEY_NUMPAD_DECIMAL:"NumpadDecimal",KEY_NUMPAD_PLUS:"NumpadAdd",KEY_NUMPAD_MINUS:"NumpadSubtract",KEY_A:"KeyA",KEY_B:"KeyB",KEY_C:"KeyC",KEY_D:"KeyD",KEY_E:"KeyE",KEY_F:"KeyF",KEY_G:"KeyG",KEY_H:"KeyH",KEY_I:"KeyI",KEY_J:"KeyJ",KEY_K:"KeyK",KEY_L:"KeyL",KEY_M:"KeyM",KEY_N:"KeyN",KEY_O:"KeyO",KEY_P:"KeyP",KEY_Q:"KeyQ",KEY_R:"KeyR",KEY_S:"KeyS",KEY_T:"KeyT",KEY_U:"KeyU",KEY_V:"KeyV",KEY_W:"KeyW",KEY_X:"KeyX",KEY_Y:"KeyY",KEY_Z:"KeyZ",KEY_EQUALS:"Equal",KEY_PLUS:"Equal",KEY_MINUS:"Minus",KEY_PERIOD:"Period",ARROW_KEYS:_e,WASD_KEYS:$e,MOVEMENT_KEYS:_e.concat($e),SHIFT_KEYS:tt,CONTROL_KEYS:it,ALT_KEYS:st,META_KEYS:nt,MODIFIER_KEY_CODES:ot,MODIFIER_KEY_TO_CODE_MAP:new Map([["Alt",st],["Shift",tt],["Control",it]]),isArrowKey:e=>ht.isAnyKeyEvent(e,_e),isRangeKey:e=>ht.isArrowKey(e)||ht.isAnyKeyEvent(e,[ht.KEY_PAGE_UP,ht.KEY_PAGE_DOWN,ht.KEY_HOME,ht.KEY_END]),isNumberKey:e=>ht.isAnyKeyEvent(e,et),getNumberFromCode:e=>ht.isNumberKey(e)&&e instanceof KeyboardEvent?Number(e.code.replace("Digit","")):null,isShiftKey:e=>ht.isAnyKeyEvent(e,tt),isAltKey:e=>ht.isAnyKeyEvent(e,st),isControlKey:e=>ht.isAnyKeyEvent(e,it),isMetaKey:e=>ht.isAnyKeyEvent(e,nt),isWASDKey:e=>ht.isAnyKeyEvent(e,$e),isMovementKey:e=>ht.isAnyKeyEvent(e,ht.MOVEMENT_KEYS),isAnyKeyEvent(e,t){(0,Xe.Z)(e,At);const i=ht.getEventCode(e);return!!i&&t.includes(i)},isKeyEvent:(e,t)=>ht.getEventCode(e)===t,getEventCode(e){let t=null;return e instanceof KeyboardEvent&&e.code&&(t=e.code,t.startsWith("Numpad")&&at.includes(e.key)&&(t=e.key)),t},isModifierKey:e=>rt.includes(e),ALL_KEYS:at};for(const _ in ht)ht.hasOwnProperty(_)&&"string"==typeof ht[_]&&at.push(ht[_]);W.register("KeyboardUtils",ht);const lt=ht,gt={q:[lt.KEY_Q],w:[lt.KEY_W],e:[lt.KEY_E],r:[lt.KEY_R],t:[lt.KEY_T],y:[lt.KEY_Y],u:[lt.KEY_U],i:[lt.KEY_I],o:[lt.KEY_O],p:[lt.KEY_P],a:[lt.KEY_A],s:[lt.KEY_S],d:[lt.KEY_D],f:[lt.KEY_F],g:[lt.KEY_G],h:[lt.KEY_H],j:[lt.KEY_J],k:[lt.KEY_K],l:[lt.KEY_L],z:[lt.KEY_Z],x:[lt.KEY_X],c:[lt.KEY_C],v:[lt.KEY_V],b:[lt.KEY_B],n:[lt.KEY_N],m:[lt.KEY_M],0:[lt.KEY_0,lt.KEY_NUMPAD_0],1:[lt.KEY_1,lt.KEY_NUMPAD_1],2:[lt.KEY_2,lt.KEY_NUMPAD_2],3:[lt.KEY_3,lt.KEY_NUMPAD_3],4:[lt.KEY_4,lt.KEY_NUMPAD_4],5:[lt.KEY_5,lt.KEY_NUMPAD_5],6:[lt.KEY_6,lt.KEY_NUMPAD_6],7:[lt.KEY_7,lt.KEY_NUMPAD_7],8:[lt.KEY_8,lt.KEY_NUMPAD_8],9:[lt.KEY_9,lt.KEY_NUMPAD_9],enter:[lt.KEY_ENTER],tab:[lt.KEY_TAB],equals:[lt.KEY_EQUALS],plus:[lt.KEY_PLUS,lt.KEY_NUMPAD_PLUS],minus:[lt.KEY_MINUS,lt.KEY_NUMPAD_MINUS],period:[lt.KEY_PERIOD,lt.KEY_NUMPAD_DECIMAL],escape:[lt.KEY_ESCAPE],delete:[lt.KEY_DELETE],backspace:[lt.KEY_BACKSPACE],pageUp:[lt.KEY_PAGE_UP],pageDown:[lt.KEY_PAGE_DOWN],end:[lt.KEY_END],home:[lt.KEY_HOME],space:[lt.KEY_SPACE],arrowLeft:[lt.KEY_LEFT_ARROW],arrowRight:[lt.KEY_RIGHT_ARROW],arrowUp:[lt.KEY_UP_ARROW],arrowDown:[lt.KEY_DOWN_ARROW],ctrl:[lt.KEY_CONTROL_LEFT,lt.KEY_CONTROL_RIGHT],alt:[lt.KEY_ALT_LEFT,lt.KEY_ALT_RIGHT],shift:[lt.KEY_SHIFT_LEFT,lt.KEY_SHIFT_RIGHT]};W.register("EnglishStringToCodeMap",gt);const ct=gt,dt=["arrowLeft","arrowRight","arrowUp","arrowDown"];var ut=i(5602),mt=i(2306),pt=i(170);const Vt=new se.Z("EventIO",{valueType:window.Event,documentation:"A DOM Event",toStateObject:e=>jA.serializeDomEvent(e),fromStateObject:e=>jA.deserializeDomEvent(e),stateSchema:()=>({constructorName:Ye.Z,altKey:(0,mt.Z)(ut.Z),button:(0,mt.Z)(ne.Z),charCode:(0,mt.Z)(ne.Z),clientX:(0,mt.Z)(ne.Z),clientY:(0,mt.Z)(ne.Z),code:(0,mt.Z)(Ye.Z),ctrlKey:(0,mt.Z)(ut.Z),deltaMode:(0,mt.Z)(ne.Z),deltaX:(0,mt.Z)(ne.Z),deltaY:(0,mt.Z)(ne.Z),deltaZ:(0,mt.Z)(ne.Z),key:(0,mt.Z)(Ye.Z),keyCode:(0,mt.Z)(ne.Z),metaKey:(0,mt.Z)(ut.Z),pageX:(0,mt.Z)(ne.Z),pageY:(0,mt.Z)(ne.Z),pointerId:(0,mt.Z)(ne.Z),pointerType:(0,mt.Z)(Ye.Z),scale:(0,mt.Z)(ne.Z),shiftKey:(0,mt.Z)(ut.Z),target:(0,mt.Z)(pt.Z),type:(0,mt.Z)(Ye.Z),relatedTarget:(0,mt.Z)(pt.Z),which:(0,mt.Z)(ne.Z)})});W.register("EventIO",Vt);const Mt=Vt,Bt=document.createElement("style");Bt.type="text/css",document.head.appendChild(Bt);const wt=document.styleSheets[document.styleSheets.length-1],Ct={stylesheet:wt,styleElement:Bt,addRule(e){this.stylesheet.insertRule(e,0)}};W.register("SceneryStyle",Ct);const Et=Ct;class Yt{constructor(e,t){this.canvas=e,this.context=t,this.resetStyles()}resetStyles(){this.fillStyle=void 0,this.strokeStyle=void 0,this.lineWidth=void 0,this.lineCap=void 0,this.lineJoin=void 0,this.lineDash=void 0,this.lineDashOffset=void 0,this.miterLimit=void 0,this.font=void 0,this.direction=void 0}setDimensions(e,t){this.canvas.width=e,this.canvas.height=t,this.resetStyles()}setFillStyle(e){e&&e instanceof ee.Z&&(e=e.value),e&&e.getCanvasStyle&&(e=e.getCanvasStyle()),this.fillStyle!==e&&(this.fillStyle=e,this.context.fillStyle=e)}setStrokeStyle(e){e&&e instanceof ee.Z&&(e=e.value),e&&e.getCanvasStyle&&(e=e.getCanvasStyle()),this.strokeStyle!==e&&(this.strokeStyle=e,this.context.strokeStyle=e)}setLineWidth(e){this.lineWidth!==e&&(this.lineWidth=e,this.context.lineWidth=e)}setLineCap(e){this.lineCap!==e&&(this.lineCap=e,this.context.lineCap=e)}setLineJoin(e){this.lineJoin!==e&&(this.lineJoin=e,this.context.lineJoin=e)}setMiterLimit(e){this.miterLimit!==e&&(this.miterLimit=e,this.context.miterLimit=e)}setLineDash(e){this.lineDash!==e&&(this.lineDash=e,this.context.setLineDash?this.context.setLineDash(null===e?[]:e):void 0!==this.context.mozDash?this.context.mozDash=e:void 0!==this.context.webkitLineDash&&(this.context.webkitLineDash=e||[]))}setLineDashOffset(e){this.lineDashOffset!==e&&(this.lineDashOffset=e,void 0!==this.context.lineDashOffset?this.context.lineDashOffset=e:void 0!==this.context.webkitLineDashOffset&&(this.context.webkitLineDashOffset=e))}setFont(e){this.font!==e&&(this.font=e,this.context.font=e)}setDirection(e){this.direction!==e&&(this.direction=e,this.context.direction=e)}}W.register("CanvasContextWrapper",Yt);const Dt=Yt;var yt=i(592);function It(e,t,i){return void 0!==e["on"+t]?t:void 0!==e["onmoz"+t]?"moz"+t:void 0!==e["onMoz"+t]?"Moz"+t:void 0!==e["onwebkit"+t]?"webkit"+t:void 0!==e["onms"+t]?"ms"+t:void 0!==e["ono"+t]?"o"+t:void 0}P.Z.register("detectPrefixEvent",It);const qt=It,Gt=ce(document,"exitFullscreen")||ce(document,"cancelFullScreen"),Qt=ce(document,"fullscreenElement")||ce(document,"fullScreenElement"),St=ce(document,"fullscreenEnabled")||ce(document,"fullScreenEnabled");let Tt=qt(document,"fullscreenchange");"msfullscreenchange"===Tt&&(Tt="MSFullscreenChange");const xt={isFullScreen:()=>!!document[Qt],isFullScreenEnabled:()=>document[St]&&!Oe.Z.safari7,enterFullScreen(e){const t=ce(document.body,"requestFullscreen")||ce(document.body,"requestFullScreen");e.domElement[t]&&e.domElement[t]()},exitFullScreen(){document[Gt]&&document[Gt]()},toggleFullScreen(e){xt.isFullScreen()?xt.exitFullScreen():xt.enterFullScreen(e)},isFullScreenProperty:new yt.Z(!1)};document.addEventListener(Tt,e=>{xt.isFullScreenProperty.set(xt.isFullScreen())}),W.register("FullScreen",xt);const kt=xt,Ft={mixInto(e,t){const i=(0,Ce.ZP)()({defaultArguments:[],initialize:e.prototype.initialize,maxSize:100,initialSize:0,useDefaultConstruction:!1},t),s=[];let n=i.maxSize;const r=Function.prototype.bind.bind(e,e),o=r(...i.defaultArguments),A=i.initialize,a=i.useDefaultConstruction,h=e.prototype;for(O(e,{pool:s,dirtyFromPool:()=>s.length?s.pop():new o,createFromPool(){let e;for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return s.length?(e=s.pop(),A.apply(e,i)):a?(e=new o,A.apply(e,i)):e=new(r(...i)),e},get poolSize(){return s.length},set maxPoolSize(e){n=e},get maxPoolSize(){return n}}),O(h,{freeToPool(){s.length<n&&s.push(this)}});s.length<i.initialSize;)s.push(new o);return e}};P.Z.register("Poolable",Ft);const Rt=Ft;class Ut{constructor(e,t){this.create=e,this.destroy=t,this.map=new Map}increment(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.map.has(e))this.map.get(e).count+=t;else{const i=this.create(e),s=Lt.createFromPool(t,e,i);this.map.set(e,s)}}decrement(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=this.map.get(e);i&&(i.count-=t,i.count<1&&(this.destroy(e,i.value),this.map.delete(e),i.dispose()))}get(e){return this.map.get(e).value}clear(){this.map.clear()}}class Lt{constructor(e,t,i){this.initialize(e,t,i)}initialize(e,t,i){this.count=e,this.key=t,this.value=i}dispose(){this.key=null,this.value=null,this.freeToPool()}}Rt.mixInto(Lt,{initialize:Lt.prototype.initialize}),W.register("CountMap",Ut);const Pt=Ut;var bt=i(9806),Ot=i(831);class ft extends bt.Z{constructor(e,t){super(!1,t=(0,Ot.Z)({display:null},t)),this.node=e,this.display=t.display,this.updateListener=this.updateValue.bind(this),this.changedInstanceListener=this.changedInstance.bind(this),e.changedInstanceEmitter.addListener(this.changedInstanceListener);const i=e.instances;for(let s=0;s<i.length;s++)this.changedInstance(i[s],!0)}updateValue(){this.value=this.node.wasVisuallyDisplayed(this.display)}changedInstance(e,t){t?e.visibleEmitter.addListener(this.updateListener):e.visibleEmitter.removeListener(this.updateListener),this.updateValue()}dispose(){const e=this.node.instances;for(let t=0;t<e.length;t++)this.changedInstance(e[t],!1);this.node.changedInstanceEmitter.removeListener(this.changedInstanceListener),super.dispose()}}W.register("DisplayedProperty",ft);const Zt=ft;class Nt{constructor(e){this.scene=e,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.img=document.createElement("img"),this.update()}update(e){this.scene.updateScene(),this.canvas.width=this.scene.getSceneWidth(),this.canvas.height=this.scene.getSceneHeight(),this.scene.renderToCanvas(this.canvas,this.context,()=>{const t=this.toDataURL();this.img.onload=()=>{e(),delete this.img.onload},this.img.src=t})}}W.register("SceneImage",Nt);var Kt=i(1005);const Jt=new bt.Z(!(null!==(n=window)&&void 0!==n&&null!==(r=n.phet)&&void 0!==r&&null!==(o=r.chipper)&&void 0!==o&&o.queryParameters)||(null===(A=window)||void 0===A||null===(a=A.phet)||void 0===a||null===(h=a.chipper)||void 0===h||null===(l=h.queryParameters)||void 0===l?void 0:l.allowLinks),{tandem:Kt.Z.GENERAL_MODEL.createTandem("allowLinksProperty")});W.register("allowLinksProperty",Jt);const jt=Jt;function vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jt.value;const i=phet&&phet.chipper&&phet.chipper.isFuzzEnabled();if(t&&!i){const t=window.open(e,"_blank");t&&t.focus()}}W.register("openPopup",vt);const Ht=vt;var Wt=i(5428);const zt=(e,t)=>{const i=(0,Ce.ZP)()({requiredOnly:!1},t),s=[],n=new LineBreaker(e);n[Symbol.iterator]=()=>({next(){const e=n.nextBreak();return null!==e?{value:e,done:!1}:{done:!0}}});let r=0;for(const o of n){const e=o.position;i.requiredOnly&&!o.required||(r!==e&&s.push(new Wt.Z(r,e)),r=o.position)}return r<e.length&&s.push(new Wt.Z(r,e.length)),s};W.register("getLineBreakRanges",zt);const Xt=zt;var _t=i(8445),$t=i(2956),ei=i(4676),ti=i(7232);const ii=new be.Z(0,0),si=Le.Z.IDENTITY.copy();class ni extends ei.Z{}_defineProperty(ni,"TRANSLATION",new(g=ni)),_defineProperty(ni,"TRANSLATION_AND_SCALE",new g),_defineProperty(ni,"TRANSLATION_AND_ROTATION",new g),_defineProperty(ni,"AFFINE",new g),_defineProperty(ni,"enumeration",new $t.Z(g,{phetioDocumentation:"Defines the available transform type for a SpriteInstance"}));class ri{constructor(){this.sprite=null,this.matrix=(new Le.Z).setToAffine(1,0,0,0,1,0),this.transformType=ni.TRANSLATION,this.alpha=1}initialize(){return this}getShape(){return this.sprite?this.sprite.getShape().transformed(this.matrix):new _t.bn}containsPoint(e){if(!this.sprite)return!1;const t=ii.set(e);return this.transformType===ni.AFFINE?si.set(this.matrix).invert().multiplyVector2(t):(t.x-=this.matrix.m02(),t.y-=this.matrix.m12(),this.transformType===ni.TRANSLATION_AND_SCALE?(t.x/=this.matrix.m00(),t.y/=this.matrix.m11()):this.transformType===ni.TRANSLATION_AND_ROTATION&&t.rotate(-this.matrix.rotation)),this.sprite.containsPoint(t)}freeToPool(){ri.pool.freeToPool(this)}}c=ri,_defineProperty(ri,"pool",new ti.Z(c,{maxSize:1e3})),W.register("SpriteInstance",ri);var oi=i(7464);class Ai{constructor(e){this.rootBin=new ai(e,null)}allocate(e,t){const i=this.rootBin.findAvailableBin(e,t);if(i){const s=i.split(e,t);return s.use(),s}return null}deallocate(e){e.unuse()}toString(){let e="",t="";return function i(s){e+=t+s.toString()+"\n",t+="  ",_.each(s.children,i),t=t.substring(2)}(this.rootBin),e}}oi.Z.register("BinPacker",Ai);class ai{constructor(e,t){this.bounds=e,this.parent=t,this.isSplit=!1,this.isUsed=!1,this.children=[]}findAvailableBin(e,t){if(this.isUsed)return null;if(this.bounds.width<e||this.bounds.height<t)return null;if(this.isSplit){for(let i=0;i<this.children.length;i++){const s=this.children[i].findAvailableBin(e,t);if(s)return s}return null}return this}split(e,t){if(e===this.bounds.width&&t===this.bounds.height)return this;this.isSplit=!0;const i=this.bounds.minX+e,s=this.bounds.minY+t,n=new Ue.Z(this.bounds.minX,this.bounds.minY,i,s),r=new Ue.Z(i,this.bounds.minY,this.bounds.maxX,s),o=new Ue.Z(this.bounds.minX,s,this.bounds.maxX,this.bounds.maxY),A=new ai(n,this);return this.children.push(A),r.hasNonzeroArea()&&this.children.push(new ai(r,this)),o.hasNonzeroArea()&&this.children.push(new ai(o,this)),A}use(){this.isUsed=!0}unuse(){this.isUsed=!1,this.parent&&this.parent.attemptToCollapse()}attemptToCollapse(){for(let e=0;e<this.children.length;e++){const t=this.children[e];if(t.isSplit||t.isUsed)return}this.children=[],this.isSplit=!1,this.parent&&this.parent.attemptToCollapse()}toString(){return this.bounds.toString()+(this.isUsed?" used":"")}}Ai.Bin=ai;var hi=i(6243);const li=new hi.Z(1024,1024);class gi{constructor(e){this.useMipmaps=e,this.gl=null,this.texture=null,this.bounds=new Ue.Z(0,0,li.width,li.height),this.width=this.bounds.width,this.height=this.bounds.height,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.context=this.canvas.getContext("2d"),this.binPacker=new Ai(this.bounds),this.dirty=!0,this.usedSprites=[],this.unusedSprites=[]}initializeContext(e){this.gl=e,this.createTexture()}createTexture(){const e=this.gl;this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,this.useMipmaps?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),this.useMipmaps&&(e.hint(e.GENERATE_MIPMAP_HINT,e.NICEST),e.generateMipmap(e.TEXTURE_2D)),e.bindTexture(e.TEXTURE_2D,null),this.dirty=!1}updateTexture(){if(this.dirty){this.dirty=!1;const e=this.gl;e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),this.useMipmaps&&(e.hint(e.GENERATE_MIPMAP_HINT,e.NICEST),e.generateMipmap(e.TEXTURE_2D)),e.bindTexture(e.TEXTURE_2D,null)}}addImage(e,t,i){let s,n;for(s=0;s<this.usedSprites.length;s++){const t=this.usedSprites[s];if(t.image===e)return t.count++,t}for(s=0;s<this.unusedSprites.length;s++){const t=this.unusedSprites[s];if(t.image===e)return t.count++,this.unusedSprites.splice(s,1),this.usedSprites.push(t),t}for(;!(n=this.binPacker.allocate(t+2+1,i+2+1))&&this.unusedSprites.length;){const e=this.unusedSprites.shift();this.dirty=!0;const t=e.bin.bounds;this.context.clearRect(t.x,t.y,t.width,t.height),this.binPacker.deallocate(e.bin)}if(n){const s=new Ue.Z((n.bounds.minX+1)/this.width,(n.bounds.minY+1)/this.height,(n.bounds.maxX-1-1)/this.width,(n.bounds.maxY-1-1)/this.height),r=new ci(this,n,s,e,1);return this.copyImageWithGutter(e,t,i,n.bounds.x,n.bounds.y),this.dirty=!0,this.usedSprites.push(r),r}return null}removeImage(e){let t,i;for(i=0;i<this.usedSprites.length;i++)if(this.usedSprites[i].image===e){t=this.usedSprites[i];break}--t.count<=0&&(this.usedSprites.splice(i,1),this.unusedSprites.push(t))}containsImage(e){let t;for(t=0;t<this.usedSprites.length;t++)if(this.usedSprites[t].image===e)return!0;for(t=0;t<this.unusedSprites.length;t++)if(this.unusedSprites[t].image===e)return!0;return!1}copyImageWithGutter(e,t,i,s,n){this.copyImageRegion(e,1,1,0,0,s,n),this.copyImageRegion(e,1,1,t-1,0,s+1+t,n),this.copyImageRegion(e,1,1,t-1,i-1,s+1+t,n+1+i),this.copyImageRegion(e,1,1,0,i-1,s,n+1+i),this.copyImageRegion(e,t,1,0,0,s+1,n),this.copyImageRegion(e,t,1,0,i-1,s+1,n+1+i),this.copyImageRegion(e,1,i,0,0,s,n+1),this.copyImageRegion(e,1,i,t-1,0,s+1+t,n+1),this.context.drawImage(e,s+1,n+1)}copyImageRegion(e,t,i,s,n,r,o){this.context.drawImage(e,s,n,t,i,r,o,t,i)}}_defineProperty(gi,"MAX_DIMENSION",li),W.register("SpriteSheet",gi);class ci{constructor(e,t,i,s,n){this.spriteSheet=e,this.bin=t,this.uvBounds=i,this.image=s,this.count=n}}gi.Sprite=ci;class di{constructor(e,t,i,s){const n=(0,Ce.ZP)()({attributes:[],uniforms:[]},s);this.vertexSource=t,this.fragmentSource=i,this.attributeNames=n.attributes,this.uniformNames=n.uniforms,this.initialize(e)}initialize(e){this.gl=e,this.used=!1,this.program=this.gl.createProgram(),this.vertexShader=ve.createShader(this.gl,this.vertexSource,this.gl.VERTEX_SHADER),this.fragmentShader=ve.createShader(this.gl,this.fragmentSource,this.gl.FRAGMENT_SHADER),this.gl.attachShader(this.program,this.vertexShader),this.gl.attachShader(this.program,this.fragmentShader),this.gl.linkProgram(this.program),this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS)||(console.log("GLSL link error:"),console.log(this.gl.getProgramInfoLog(this.program)),console.log("for vertex shader"),console.log(this.vertexSource),console.log("for fragment shader"),console.log(this.fragmentSource)),this.gl.deleteShader(this.vertexShader),this.gl.deleteShader(this.fragmentShader),this.uniformLocations={},this.attributeLocations={},this.activeAttributes={},_.each(this.attributeNames,e=>{this.attributeLocations[e]=this.gl.getAttribLocation(this.program,e),this.activeAttributes[e]=!0}),_.each(this.uniformNames,e=>{this.uniformLocations[e]=this.gl.getUniformLocation(this.program,e)}),this.isInitialized=!0}use(){this.used||(this.used=!0,this.gl.useProgram(this.program),_.each(this.attributeNames,e=>{this.activeAttributes[e]&&this.enableVertexAttribArray(e)}))}activateAttribute(e){this.activeAttributes[e]||(this.activeAttributes[e]=!0,this.used&&this.enableVertexAttribArray(e))}enableVertexAttribArray(e){this.gl.enableVertexAttribArray(this.attributeLocations[e])}unuse(){this.used&&(this.used=!1,_.each(this.attributeNames,e=>{this.activeAttributes[e]&&this.disableVertexAttribArray(e)}))}disableVertexAttribArray(e){this.gl.disableVertexAttribArray(this.attributeLocations[e])}deactivateAttribute(e){this.activeAttributes[e]&&(this.activeAttributes[e]=!1,this.used&&this.disableVertexAttribArray(e))}dispose(){this.gl.deleteProgram(this.program)}}W.register("ShaderProgram",di);class ui extends yt.Z{constructor(e,t){super(e,(0,Ce.ZP)()({valueType:le,phetioValueType:le.ColorIO},t))}}W.register("ColorProperty",ui);let mi,pi;const Vi={};let Mi=!1;const Bi={approximateSVGBounds(e,t){if(!mi.parentNode){if(!document.body)throw new Error("No document.body and trying to get approximate SVG bounds of a Text node");document.body.appendChild(mi)}Bi.setSVGTextAttributes(pi,e,t);const i=pi.getBBox();return 0===i.width&&0===i.height&&t.length>0?(Mi||(Mi=!0,console.log("WARNING: Guessing text bounds, is the simulation hidden? See https://github.com/phetsims/chipper/issues/768")),Bi.guessSVGBounds(e,t)):new Ue.Z(i.x,i.y,i.x+i.width,i.y+i.height)},guessSVGBounds(e,t){const i=e.getNumericSize(),s="bold"===e.weight;return new Ue.Z(0,-.9*i,(s?.435:.4)*i*t.length,.22*i)},accurateCanvasBounds(e){const t=W.scratchContext;t.font=e._font.toCSS(),t.direction="ltr";const i=t.measureText(e.renderedText);return new Ue.Z(-i.actualBoundingBoxLeft,-i.actualBoundingBoxAscent,i.actualBoundingBoxRight,i.actualBoundingBoxDescent)},accurateCanvasBoundsFallback(e){const t=Bi.approximateSVGBounds(e._font,e.renderedText);if(!e.renderedText.length||0===t.width)return t;const i=ve.canvasAccurateBounds(t=>{if(t.font=e._font.toCSS(),t.direction="ltr",t.fillText(e.renderedText,0,0),e.hasPaintableStroke()){const i=new Dt(null,t);e.beforeCanvasStroke(i),t.strokeText(e.renderedText,0,0),e.afterCanvasStroke(i)}},{precision:.5,resolution:128,initialScale:32/Math.max(Math.abs(t.minX),Math.abs(t.minY),Math.abs(t.maxX),Math.abs(t.maxY))});return i.isFinite()?i:t},getVerticalBounds(e){const t=e.toCSS();let i=Vi[t];return i||(i=Vi[t]=Bi.approximateSVGBounds(e,"m")),i},approximateCanvasWidth(e,t){const i=W.scratchContext;return i.font=e.toCSS(),i.direction="ltr",i.measureText(t).width},approximateHybridBounds(e,t){const i=Bi.getVerticalBounds(e),s=Bi.approximateCanvasWidth(e,t);return new Ue.Z(0,i.minY,s,i.maxY)},approximateDOMBounds(e,t){const i=document.createElement("div");$(i).css({position:"absolute",left:0,top:0,padding:"0 !important",margin:"0 !important",display:"hidden"});const s=document.createElement("span");$(s).css("font",e.toCSS()),s.appendChild(t),s.setAttribute("direction","ltr");const n=document.createElement("div");$(n).css({"vertical-align":"baseline",display:"inline-block",width:0,height:"1024px",margin:"0 !important",padding:"0 !important"}),i.appendChild(s),i.appendChild(n),document.body.appendChild(i);const r=s.getBoundingClientRect(),o=i.getBoundingClientRect(),A=new Ue.Z(r.left,r.top-1024,r.right+1,r.bottom-1024).shiftedXY(-o.left,-o.top);return document.body.removeChild(i),A},approximateImprovedDOMBounds(e,t){const i=document.createElement("div");i.style.display="inline-block",i.style.font=e.toCSS(),i.style.color="transparent",i.style.padding="0 !important",i.style.margin="0 !important",i.style.position="absolute",i.style.left="0",i.style.top="0",i.setAttribute("direction","ltr"),i.appendChild(t),document.body.appendChild(i);const s=new Ue.Z(i.offsetLeft,i.offsetTop,i.offsetLeft+i.offsetWidth+1,i.offsetTop+i.offsetHeight+1);document.body.removeChild(i);const n=Bi.getVerticalBounds(e);return s.shiftedY(n.minY)},setSVGTextAttributes(e,t,i){e.setAttribute("direction","ltr"),e.setAttribute("font-family",t.getFamily()),e.setAttribute("font-size",t.getSize()),e.setAttribute("font-style",t.getStyle()),e.setAttribute("font-weight",t.getWeight()),e.setAttribute("font-stretch",t.getStretch()),e.lastChild.nodeValue=i},initializeTextBounds(){mi=document.getElementById("sceneryTextSizeContainer"),mi||(mi=document.createElementNS(ke,"svg"),mi.setAttribute("width","2"),mi.setAttribute("height","2"),mi.setAttribute("id","sceneryTextSizeContainer"),mi.setAttribute("style","visibility: hidden; pointer-events: none; position: absolute; left: -65535px; right: -65535px;")),pi=document.getElementById("sceneryTextSizeElement"),pi||(pi=document.createElementNS(ke,"text"),pi.appendChild(document.createTextNode("")),pi.setAttribute("dominant-baseline","alphabetic"),pi.setAttribute("text-rendering","geometricPrecision"),pi.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),pi.setAttribute("id","sceneryTextSizeElement"),mi.appendChild(pi))}};W.register("TextBounds",Bi);const wi=Bi;class Ci{constructor(e,t,i){this.pdomInstance=e,this.trail=t,this.isRoot=i,this.fullTrail=this.pdomInstance.trail.copy();for(let s=this.isRoot?0:1;s<this.trail.length;s++)this.fullTrail.addDescendant(this.trail.nodes[s])}}W.register("PartialPDOMTrail",Ci);const Ei=Ci;Et.addRule(".a11y-pdom-element{position: fixed;pointer-events: none;top: 0px;left: 0px;transform-origin: left top 0px;border-width: 0px;border: 0px;padding: 1px 1px;margin: 0px;white-space: nowrap;outline: none;box-shadow:none;border-color:transparent;font-size: 1px;clip: rect(1px, 1px, 1px, 1px);}"),Et.addRule(".a11y-pdom-root{position: absolute;z-index: 1;opacity: 0.0001;}"),Et.addRule(".a11y-pdom-list-item{list-style: none;");const Yi={SIBLING_CLASS_NAME:"a11y-pdom-element",ROOT_CLASS_NAME:"a11y-pdom-root",LIST_ITEM_CLASS_NAME:"a11y-pdom-list-item"};W.register("PDOMSiblingStyle",Yi);const Di=Yi;var yi=i(6685),Ii=i(8377);const qi=["A","AREA","INPUT","SELECT","TEXTAREA","BUTTON","IFRAME"],Gi=["B","STRONG","I","EM","MARK","SMALL","DEL","INS","SUB","SUP","BR","U"],Qi=["INPUT"];function Si(e){const t=e.getElementsByTagName("*"),i=[];for(let s=0;s<t.length;s++)t[s].nodeType===Node.ELEMENT_NODE&&(i[s]=t[s]);return i}function Ti(e,t){const i=Si(t||document.body),s=document.activeElement,n="NEXT"===e?1:-1;let r=i.indexOf(s)+n;for(;r<i.length&&r>=0;){const e=i[r];if(r+=n,ki.isElementFocusable(e))return e}return s}function xi(e){return!_.includes(Qi,e.toUpperCase())}const ki={unwrapStringProperty(e){const t=null===e?null:"string"==typeof e?e:e.value;return t},getNextFocusable:e=>Ti("NEXT",e),getPreviousFocusable:e=>Ti("PREVIOUS",e),getFirstFocusable(e){const t=Si(e||document.body);let i=document.body,s=0;for(;s<t.length;){const e=t[s];if(s++,ki.isElementFocusable(e)){i=e;break}}return i},getRandomFocusable(e){const t=Si(document.body),i=[];for(let s=0;s<t.length;s++)ki.isElementFocusable(t[s])&&i.push(t[s]);return i[e.nextInt(i.length)]},containsFormattingTags(e){if(null===e)return!1;let t=0;const i=[],s=[];for(;t<e.length;){const n=e.indexOf("<",t),r=e.indexOf(">",t);n>-1&&(i.push(n),t=n+1),r>-1?(s.push(r),t=r+1):t++}if(i.length!==s.length||0===i.length)return!1;let n=!0;const r=e.toUpperCase();for(let o=0;o<i.length;o++){let e=r.substring(i[o]+1,s[o]);e=e.replace("/","");const t=e.replace(/^\s+/,"");e.length-t.length>0||(_.includes(Gi,e)||(n=!1))}return n},setTextContent(e,t){if(null===t)e.innerHTML="";else{const i=t.replaceAll("<br>","<br/>"),s=(0,Ii.Z)(i);(0,Xe.Z)(s,yi.Z.STRING_WITHOUT_TEMPLATE_VARS_VALIDATOR),xi(e.tagName)&&(ki.containsFormattingTags(s)?e.innerHTML=s:e.textContent=s)}},tagIsDefaultFocusable:e=>_.includes(qi,e.toUpperCase()),isElementFocusable:e=>!!document.body.contains(e)&&(!function e(t){return!!t.hidden||t!==document.body&&e(t.parentElement)}(e)&&(!_.includes(Gi,e.tagName)&&"true"===e.getAttribute("data-focusable"))),tagNameSupportsContent:e=>xi(e),removeElements(e,t){for(let i=0;i<t.length;i++){const s=t[i];e.removeChild(s)}},insertElements(e,t,i){for(let s=0;s<t.length;s++){const n=t[s];e.insertBefore(n,i||null)}},createElement(e,t,i){const s=(i=(0,Ot.Z)({namespace:null,id:null},i)).namespace?document.createElementNS(i.namespace,e):document.createElement(e);return i.id&&(s.id=i.id),ki.overrideFocusWithTabIndex(s,t),s.classList.add(Di.SIBLING_CLASS_NAME),s},overrideFocusWithTabIndex(e,t){ki.tagIsDefaultFocusable(e.tagName)!==t?e.tabIndex=t?0:-1:e.removeAttribute("tabindex"),e.setAttribute("data-focusable",t)},TAGS:{INPUT:"INPUT",LABEL:"LABEL",BUTTON:"BUTTON",TEXTAREA:"TEXTAREA",SELECT:"SELECT",OPTGROUP:"OPTGROUP",DATALIST:"DATALIST",OUTPUT:"OUTPUT",DIV:"DIV",A:"A",P:"P",B:"B",STRONG:"STRONG",I:"I",EM:"EM",MARK:"MARK",SMALL:"SMALL",DEL:"DEL",INS:"INS",SUB:"SUB",SUP:"SUP"},FORM_ELEMENTS:["INPUT","BUTTON","TEXTAREA","SELECT","OPTGROUP","DATALIST","OUTPUT","A"],DEFAULT_CONTAINER_TAG_NAME:"DIV",DEFAULT_DESCRIPTION_TAG_NAME:"P",DEFAULT_LABEL_TAG_NAME:"P",ASSOCIATION_ATTRIBUTES:["aria-labelledby","aria-describedby","aria-activedescendant"],INPUT_TYPES_THAT_SUPPORT_CHECKED:["RADIO","CHECKBOX"],DOM_EVENTS:["focusin","focusout","input","change","click","keydown","keyup"],USER_GESTURE_EVENTS:["input","change","click","keydown","keyup"],BLOCKED_DOM_EVENTS:["touchstart","touchend","touchmove","touchcancel","mousedown","mouseup","mousemove","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerover","pointerout","pointercancel","gotpointercapture","lostpointercapture"],DATA_PDOM_UNIQUE_ID:"data-unique-id",PDOM_UNIQUE_ID_SEPARATOR:"-",DATA_EXCLUDE_FROM_INPUT:"data-exclude-from-input"};W.register("PDOMUtils",ki);const Fi=ki;var Ri=i(8311);const Ui=_.hasIn(window,"phet.chipper.queryParameters.colorProfile")?phet.chipper.queryParameters.colorProfile:X.DEFAULT_COLOR_PROFILE,Li=_.hasIn(window,"phet.chipper.colorProfiles")?phet.chipper.colorProfiles:[X.DEFAULT_COLOR_PROFILE],Pi=new Ri.Z(Ui,{tandem:Kt.Z.GENERAL_VIEW.createTandem("colorProfileProperty"),phetioFeatured:!0,validValues:Li});W.register("colorProfileProperty",Pi);const bi=Pi;var Oi=i(9059);const fi=[];class Zi extends ui{constructor(e,t,i,s){const n=(0,Ce.ZP)()({valueComparisonStrategy:"equalsFunction"},s);n.tandem;i=_.mapValues(i,e=>le.toColor(e).setImmutable()),super(le.toColor(i[bi.value]||i[X.DEFAULT_COLOR_PROFILE]),n),this.colorProfileMap=i,bi.link(e=>{this.value=le.toColor(this.colorProfileMap[e]||this.colorProfileMap[X.DEFAULT_COLOR_PROFILE])}),this.name=`${e.name}.${t}`,this.link(e=>{window.parent!==window&&window.parent.postMessage(JSON.stringify({type:"reportColor",name:this.name,value:e.toHexString(),alpha:e.getAlpha()}),"*")}),fi.push(this)}dispose(){(0,Oi.Z)(fi,this),super.dispose()}}d=Zi,_defineProperty(Zi,"TANDEM_NAME_SUFFIX","ColorProperty"),_defineProperty(Zi,"TANDEM_NAME_SUFFIXES",[d.TANDEM_NAME_SUFFIX,"FillProperty","StrokeProperty"]),window.addEventListener("message",e=>{let t;try{t=JSON.parse(e.data)}catch(i){}if(t&&"setColor"===t.type)for(let s=0;s<fi.length;s++){const e=fi[s];e.name===t.name&&(e.colorProfileMap[bi.value]=new le(t.value).withAlpha(t.alpha),e.value=le.toColor(e.colorProfileMap[bi.value]))}}),W.register("ProfileColorProperty",Zi);let Ni=1;class Ki{constructor(){this.id="paint"+Ni++,this.transformMatrix=null}setTransformMatrix(e){return this.transformMatrix!==e&&(this.transformMatrix=e),this}toString(){return this.id}}Ki.prototype.isPaint=!0,W.register("Paint",Ki);var Ji=i(5853);class ji extends Ki{constructor(){super(),this.stops=[],this.lastStopRatio=0,this.canvasGradient=null,this.colorStopsDirty=!1,this.lastColorStopValues=[]}addColorStop(e,t){if(this.lastStopRatio>e)throw new Error("Color stops not specified in the order of increasing ratios");return this.lastStopRatio=e,this.stops.push({ratio:e,color:t}),this.lastColorStopValues.push(""),this}getSVGStops(){return this.stops}invalidateCanvasGradient(){this.colorStopsDirty=!0}haveCanvasColorStopsChanged(){if(null===this.lastColorStopValues)return!0;for(let e=0;e<this.stops.length;e++)if(ji.colorToString(this.stops[e].color)!==this.lastColorStopValues[e])return!0;return!1}getCanvasStyle(){if(!this.canvasGradient||this.colorStopsDirty&&this.haveCanvasColorStopsChanged()){this.colorStopsDirty=!1,(0,Ji.Z)(this.lastColorStopValues),this.canvasGradient=this.createCanvasGradient();for(let e=0;e<this.stops.length;e++){const t=this.stops[e],i=ji.colorToString(t.color);this.canvasGradient.addColorStop(t.ratio,i),this.lastColorStopValues.push(i)}}return this.canvasGradient}static colorToString(e){return e instanceof ee.Z&&(e=e.value),null===e&&(e="transparent"),e instanceof le&&(e=e.toCSS()),e}}ji.prototype.isGradient=!0,W.register("Gradient",ji);class vi extends ji{constructor(e,t,i,s){super(),this.start=new be.Z(e,t),this.end=new be.Z(i,s)}createCanvasGradient(){return W.scratchContext.createLinearGradient(this.start.x,this.start.y,this.end.x,this.end.y)}createSVGPaint(e){return Gr.pool.create(e,this)}toString(){let e=`new phet.scenery.LinearGradient( ${this.start.x}, ${this.start.y}, ${this.end.x}, ${this.end.y} )`;return _.each(this.stops,t=>{e+=`.addColorStop( ${t.ratio}, ${is.scenerySerialize(t.color)} )`}),e}}vi.prototype.isLinearGradient=!0,W.register("LinearGradient",vi);class Hi extends ji{constructor(e,t,i,s,n,r){if(super(),this.start=new be.Z(e,t),this.end=new be.Z(s,n),Oe.Z.safari){const i=(e+s)/2,r=(t+n)/2;this.start.x=i,this.start.y=r,this.end.x=i,this.end.y=r}this.startRadius=i,this.endRadius=r,this.focalPoint=this.start.plus(this.end.minus(this.start).times(this.startRadius/(this.startRadius-this.endRadius))),this.startIsLarger=this.startRadius>this.endRadius,this.largePoint=this.startIsLarger?this.start:this.end,this.maxRadius=Math.max(this.startRadius,this.endRadius),this.minRadius=Math.min(this.startRadius,this.endRadius),this.startRadius,this.endRadius}createCanvasGradient(){return W.scratchContext.createRadialGradient(this.start.x,this.start.y,this.startRadius,this.end.x,this.end.y,this.endRadius)}createSVGPaint(e){return Qr.pool.create(e,this)}getSVGStops(){const e=this.startIsLarger,t=this.maxRadius,i=this.minRadius;const s=this.stops.map((function(s){let n=e?1-s.ratio:s.ratio;var r,o;return i>0&&(n=(o=i/t)+(n-(r=0))*(1-o)/(1-r)),{ratio:n,color:s.color}}));return e&&s.reverse(),s}toString(){let e=`new phet.scenery.RadialGradient( ${this.start.x}, ${this.start.y}, ${this.startRadius}, ${this.end.x}, ${this.end.y}, ${this.endRadius} )`;return _.each(this.stops,t=>{e+=`.addColorStop( ${t.ratio}, ${is.scenerySerialize(t.color)} )`}),e}}Hi.prototype.isRadialGradient=!0,W.register("RadialGradient",Hi);class Wi extends Ki{constructor(e){super(),this.image=e,this.canvasPattern=W.scratchContext.createPattern(e,"repeat")}getCanvasStyle(){return this.canvasPattern}createSVGPaint(e){return Sr.pool.create(this)}toString(){return`new phet.scenery.Pattern( $( '<img src="${this.image.src}"/>' )[0] )`}}Wi.prototype.isPattern=!0,W.register("Pattern",Wi);class zi extends Wi{constructor(e,t,i,s,n,r){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Le.Z.IDENTITY;const A=document.createElement("img");new Zs({scale:t,children:[e]}).toCanvas((function(e,t,i,s,n){A.src=e.toDataURL()}),-i*t,-s*t,n*t,r*t),super(A),this.setTransformMatrix(o.timesMatrix(Le.Z.scaling(1/t)))}}W.register("NodePattern",zi);let Xi=1;class _i{constructor(){this.id="filter"+Xi++,this.filterRegionPercentageIncrease=0}isDOMCompatible(){return!1}isSVGCompatible(){return!1}isCanvasCompatible(){return!!we.canvasFilter&&this.isDOMCompatible()}isWebGLCompatible(){return!1}toString(){return this.id}static applyColorMatrix(e,t,i,s){const n=document.createElementNS(ke,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values",e),n.setAttribute("in",i),n.setAttribute("color-interpolation-filters","sRGB"),s&&n.setAttribute("result",s),t.appendChild(n)}}W.register("Filter",_i);var $i=i(1039),es=i(9883);const ts={isColorDef:e=>null===e||"string"==typeof e||e instanceof le||e instanceof ee.Z&&(null===e.value||"string"==typeof e.value||e.value instanceof le),scenerySerialize:e=>null===e?"null":e instanceof le?`'${e.toCSS()}'`:"string"==typeof e?`'${e}'`:ts.scenerySerialize(e.value),ColorDefIO:null};ts.ColorDefIO=new se.Z("ColorDefIO",{isValidValue:ts.isColorDef,supertype:(0,mt.Z)((0,$i.Z)([Ye.Z,le.ColorIO,(0,es.Z)(yt.Z.PropertyIO((0,mt.Z)((0,$i.Z)([Ye.Z,le.ColorIO]))))]))}),W.register("ColorDef",ts);const is=ts,ss={isPaintDef:e=>null===e||"string"==typeof e||e instanceof le||e instanceof Ki||e instanceof ee.Z&&(null===e.value||"string"==typeof e.value||e.value instanceof le),toColor(e){if("string"==typeof e)return new le(e);if(e instanceof le)return e.copy();if(e instanceof ee.Z)return ss.toColor(e.value);if(e instanceof ji){let t=le.TRANSPARENT;const i=0;return e.stops.forEach(e=>{t=t.blend(ss.toColor(e.color),1/(i+1))}),t}return le.TRANSPARENT}};W.register("PaintDef",ss);const ns=ss;var rs=i(5870);const os=ve.supportsImageDataCanvasFilter(),As=Oe.Z.chromium;class as extends _i{constructor(e,t,i,s,n,r,o,A,a,h,l,g,c,d,u,m,p,V,M,B){super(),this.m00=e,this.m01=t,this.m02=i,this.m03=s,this.m04=n,this.m10=r,this.m11=o,this.m12=A,this.m13=a,this.m14=h,this.m20=l,this.m21=g,this.m22=c,this.m23=d,this.m24=u,this.m30=m,this.m31=p,this.m32=V,this.m33=M,this.m34=B}applySVGFilter(e,t,i){_i.applyColorMatrix(`${(0,rs.Z)(this.m00)} ${(0,rs.Z)(this.m01)} ${(0,rs.Z)(this.m02)} ${(0,rs.Z)(this.m03)} ${(0,rs.Z)(this.m04)} ${(0,rs.Z)(this.m10)} ${(0,rs.Z)(this.m11)} ${(0,rs.Z)(this.m12)} ${(0,rs.Z)(this.m13)} ${(0,rs.Z)(this.m14)} ${(0,rs.Z)(this.m20)} ${(0,rs.Z)(this.m21)} ${(0,rs.Z)(this.m22)} ${(0,rs.Z)(this.m23)} ${(0,rs.Z)(this.m24)} ${(0,rs.Z)(this.m30)} ${(0,rs.Z)(this.m31)} ${(0,rs.Z)(this.m32)} ${(0,rs.Z)(this.m33)} ${(0,rs.Z)(this.m34)}`,e,t,i)}applyCanvasFilter(e){const t=e.canvas.width,i=e.canvas.height,s=e.context.getImageData(0,0,t,i),n=t*i;for(let r=0;r<n;r++){const e=4*r;if(As){const t=1.45,i=Math.pow(s.data[e+0]/255,t),n=Math.pow(s.data[e+1]/255,t),r=Math.pow(s.data[e+2]/255,t),o=Math.pow(s.data[e+3]/255,t);s.data[e+0]=255*Math.pow(i*this.m00+n*this.m01+r*this.m02+o*this.m03+this.m04,1/t),s.data[e+1]=255*Math.pow(i*this.m10+n*this.m11+r*this.m12+o*this.m13+this.m14,1/t),s.data[e+2]=255*Math.pow(i*this.m20+n*this.m21+r*this.m22+o*this.m23+this.m24,1/t),s.data[e+3]=255*Math.pow(i*this.m30+n*this.m31+r*this.m32+o*this.m33+this.m34,1/t)}else{const t=s.data[e+0],i=s.data[e+1],n=s.data[e+2],r=s.data[e+3];s.data[e+0]=t*this.m00+i*this.m01+n*this.m02+r*this.m03+this.m04,s.data[e+1]=t*this.m10+i*this.m11+n*this.m12+r*this.m13+this.m14,s.data[e+2]=t*this.m20+i*this.m21+n*this.m22+r*this.m23+this.m24,s.data[e+3]=t*this.m30+i*this.m31+n*this.m32+r*this.m33+this.m34}}e.context.putImageData(s,0,0)}isSVGCompatible(){return!0}isCanvasCompatible(){return super.isCanvasCompatible()||os}getCSSFilterString(){throw new Error("unimplemented")}}W.register("ColorMatrixFilter",as);class hs extends as{constructor(e){super(e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0),this.amount=e}getCSSFilterString(){return`brightness(${(0,rs.Z)(this.amount)})`}isDOMCompatible(){return!0}}_defineProperty(hs,"BLACKEN",new hs(0)),W.register("Brightness",hs);class ls extends as{constructor(e){super(e,0,0,0,-.5*e+.5,0,e,0,0,-.5*e+.5,0,0,e,0,-.5*e+.5,0,0,0,1,0),this.amount=e}getCSSFilterString(){return`contrast(${(0,rs.Z)(this.amount)})`}isDOMCompatible(){return!0}}_defineProperty(ls,"GRAY",new ls(0)),W.register("Contrast",ls);W.register("DropShadow",class extends _i{constructor(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:15;super(),this.offset=e,this.blurRadius=t,this.color=i,this.colorCSS=ns.toColor(i).toCSS(),this.filterRegionPercentageIncrease=s}getCSSFilterString(){return`drop-shadow(${(0,rs.Z)(this.offset.x)}px ${(0,rs.Z)(this.offset.y)}px ${(0,rs.Z)(this.blurRadius)}px ${this.colorCSS})`}isDOMCompatible(){return!0}applyCanvasFilter(){throw new Error("unimplemented")}applySVGFilter(e,t,i){throw new Error("unimplemented")}});W.register("GaussianBlur",class extends _i{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;super(),this.standardDeviation=e,this.filterRegionPercentageIncrease=t}getCSSFilterString(){return`blur(${(0,rs.Z)(this.standardDeviation)}px)`}applySVGFilter(e,t,i){const s=document.createElementNS(ke,"feGaussianBlur");s.setAttribute("stdDeviation",(0,rs.Z)(this.standardDeviation)),s.setAttribute("edgeMode","none"),e.appendChild(s),s.setAttribute("in",t),i&&s.setAttribute("result",i),e.appendChild(s)}isDOMCompatible(){return!0}isSVGCompatible(){return!0}applyCanvasFilter(e){throw new Error("unimplemented")}});class gs extends as{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=1-e;super(.2126+.7874*t,.7152-.7152*t,.0722-.0722*t,0,0,.2126-.2126*t,.7152+.2848*t,.0722-.0722*t,0,0,.2126-.2126*t,.7152-.7152*t,.0722+.9278*t,0,0,0,0,0,1,0),this.amount=e}getCSSFilterString(){return`grayscale(${(0,rs.Z)(this.amount)})`}isDOMCompatible(){return!0}}_defineProperty(gs,"FULL",new gs(1)),W.register("Grayscale",gs);W.register("HueRotate",class extends as{constructor(e){const t=Math.cos(e),i=Math.sin(e);super(.213+.787*t-.213*i,.715-.715*t-.715*i,.072-.072*t+.928*i,0,0,.213-.213*t+.143*i,.715+.285*t+.14*i,.072-.072*t-.283*i,0,0,.213-.213*t-.787*i,.715-.715*t+.715*i,.072+.928*t+.072*i,0,0,0,0,0,1,0),this.amount=e}getCSSFilterString(){return`hue-rotate(${(0,rs.Z)(ie.Z.toDegrees(this.amount))}deg)`}isDOMCompatible(){return!0}});class cs extends _i{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;super(),this.amount=e}getCSSFilterString(){return`invert(${(0,rs.Z)(this.amount)})`}isDOMCompatible(){return!0}applyCanvasFilter(e){throw new Error("unimplemented")}applySVGFilter(e,t,i){throw new Error("unimplemented")}}_defineProperty(cs,"FULL",new cs(1)),W.register("Invert",cs);W.register("Opacity",class extends _i{constructor(e){super(),this.amount=e}getCSSFilterString(){return`opacity(${(0,rs.Z)(this.amount)})`}isDOMCompatible(){return!0}applyCanvasFilter(e){throw new Error("unimplemented")}applySVGFilter(e,t,i){throw new Error("unimplemented")}});W.register("Saturate",class extends as{constructor(e){super(.213+.787*e,.715-.715*e,.072-.072*e,0,0,.213-.213*e,.715-.285*e,.072-.072*e,0,0,.213-.213*e,.715-.715*e,.072-.928*e,0,0,0,0,0,1,0),this.amount=e}getCSSFilterString(){return`saturate(${(0,rs.Z)(this.amount)})`}isDOMCompatible(){return!0}});class ds extends as{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;super(.393+.607*(1-e),.769-.769*(1-e),.189-.189*(1-e),0,0,.349-.349*(1-e),.686+.314*(1-e),.168-.168*(1-e),0,0,.272-.272*(1-e),.534-.534*(1-e),.131+.869*(1-e),0,0,0,0,0,1,0),this.amount=e}getCSSFilterString(){return`sepia(${(0,rs.Z)(this.amount)})`}isDOMCompatible(){return!0}}function us(e,t,i,s,n){i=i||[],s=s||[],n=n||[],Array.prototype.push.apply(i,e),Array.prototype.push.apply(s,t);e:for(let r=0;r<i.length;r++){const e=i[r];for(let t=0;t<s.length;t++){if(e===s[t]){if(n.push(e),i.splice(r,1),s.splice(t,1),t=0,r===i.length)break e;r-=1}}}return i}_defineProperty(ds,"FULL",new ds(1)),W.register("Sepia",ds),P.Z.register("arrayDifference",us);const ms=us;var ps=i(7857),Vs=i(7922),Ms=i(8292);class Bs extends Ms.Z{constructor(e,t,i){super(e,i),t&&(this.targetPropertyInstrumented=t)}setValueOrTargetProperty(e,t,i){if((0,ps.i)(i))this.setTargetProperty(e,t,i);else{const e=this.get();this.clearTargetProperty(),this.setPropertyValue(i),this.areValuesEqual(e,i)||this.notifyListeners(e)}}setTargetProperty(e,t,i){if(this.targetProperty===i)return e;this.targetProperty&&this.targetProperty instanceof ee.Z&&this.targetProperty.isPhetioInstrumented();const s=this.targetProperty;this.ownedPhetioProperty&&i!==this.ownedPhetioProperty&&this.disposeOwnedPhetioProperty(),e&&null!==t&&e.updateLinkedElementForProperty(t,s,i);const n=this.get();return this.clearTargetProperty(),this.targetProperty=i,this.targetProperty?(this.targetProperty.lazyLink(this.forwardingListener),this.setPropertyValue(this.targetProperty.value)):this.setPropertyValue(n),this.areValuesEqual(n,this.get())||this.notifyListeners(n),e}clearTargetProperty(){this.forwardingListener=this.forwardingListener||this.onTargetPropertyChange.bind(this),this.targetProperty&&this.targetProperty.unlink(this.forwardingListener),this.targetProperty=null}onTargetPropertyChange(e){super.set(e)}set(e){return this.targetProperty?this.targetProperty.set(e):super.set(e),this}setTargetPropertyInstrumented(e,t){return this.targetPropertyInstrumented=e,t}getTargetPropertyInstrumented(){return this.targetPropertyInstrumented||!1}initializePhetio(e,t,i){!this.targetProperty&&this.targetPropertyInstrumented?(this.ownedPhetioProperty=i(),this.setTargetProperty(e,t,this.ownedPhetioProperty)):this.targetProperty&&this.targetProperty instanceof ee.Z&&this.targetProperty.isPhetioInstrumented()&&e.updateLinkedElementForProperty(t,null,this.targetProperty)}getTargetProperty(){return this.targetProperty||null}disposeOwnedPhetioProperty(){this.ownedPhetioProperty&&(this.ownedPhetioProperty.dispose(),delete this.ownedPhetioProperty)}dispose(){this.clearTargetProperty(),this.disposeOwnedPhetioProperty(),super.dispose()}}Vs.Z.register("TinyForwardingProperty",Bs);var ws=i(8047);Fi.TAGS.INPUT;const Cs=Fi.TAGS.P,Es=Cs,Ys=Cs,Ds=(e,t,i)=>(t.labelTagName="h"+e.headingLevel,t.labelContent=i,t),ys=e=>{const t=null===e?null:"string"==typeof e?e:e.value;return t},Is=(Fi.FORM_ELEMENTS,Fi.INPUT_TYPES_THAT_SUPPORT_CHECKED,Fi.ASSOCIATION_ATTRIBUTES,["focusable","tagName","accessibleName","accessibleNameBehavior","helpText","helpTextBehavior","pdomHeading","pdomHeadingBehavior","containerTagName","containerAriaRole","innerContent","inputType","inputValue","pdomChecked","pdomNamespace","ariaLabel","ariaRole","ariaValueText","labelTagName","labelContent","appendLabel","descriptionTagName","descriptionContent","appendDescription","focusHighlight","focusHighlightLayerable","groupFocusHighlight","pdomVisible","pdomOrder","ariaLabelledbyAssociations","ariaDescribedbyAssociations","activeDescendantAssociations","focusPanTargetBoundsProperty","limitPanDirection","positionInPDOM","pdomTransformSourceNode"]);class qs extends Ee.Z{constructor(e){super(e),_defineProperty(this,"_inputValue",null),_defineProperty(this,"_labelContent",null),_defineProperty(this,"_descriptionContent",null),_defineProperty(this,"_ariaLabel",null),_defineProperty(this,"_hasAppliedAriaLabel",!1),_defineProperty(this,"_ariaValueText",null),_defineProperty(this,"_hasAppliedAriaValueText",!1),_defineProperty(this,"_accessibleName",null),_defineProperty(this,"_helpText",null),_defineProperty(this,"_pdomHeading",null),this._onPDOMContentChangeListener=this.onPDOMContentChange.bind(this),this._onInputValueChangeListener=this.invalidatePeerInputValue.bind(this),this._onAriaLabelChangeListener=this.onAriaLabelChange.bind(this),this._onAriaValueTextChangeListener=this.onAriaValueTextChange.bind(this),this._onLabelContentChangeListener=this.invalidatePeerLabelSiblingContent.bind(this),this._onDescriptionContentChangeListener=this.invalidatePeerDescriptionSiblingContent.bind(this),this._tagName=null,this._containerTagName=null,this._labelTagName=null,this._descriptionTagName=null,this._inputType=null,this._pdomChecked=!1,this._appendLabel=!1,this._appendDescription=!1,this._pdomAttributes=[],this._pdomClasses=[],this._innerContentProperty=new Bs(null,!1),this._innerContentProperty.lazyLink(this.onInnerContentPropertyChange.bind(this)),this._pdomNamespace=null,this._ariaRole=null,this._containerAriaRole=null,this._ariaLabelledbyAssociations=[],this._nodesThatAreAriaLabelledbyThisNode=[],this._ariaDescribedbyAssociations=[],this._nodesThatAreAriaDescribedbyThisNode=[],this._activeDescendantAssociations=[],this._nodesThatAreActiveDescendantToThisNode=[],this._focusableOverride=null,this._focusHighlight=null,this._focusHighlightLayerable=!1,this._groupFocusHighlight=!1,this._pdomVisible=!0,this._pdomOrder=null,this._pdomParent=null,this._pdomTransformSourceNode=null,this._focusPanTargetBoundsProperty=null,this._limitPanDirection=null,this._pdomDisplaysInfo=new zs(this),this._pdomInstances=[],this._positionInPDOM=!1,this.excludeLabelSiblingFromInput=!1,this._accessibleNameBehavior=qs.BASIC_ACCESSIBLE_NAME_BEHAVIOR,this._helpTextBehavior=qs.HELP_TEXT_AFTER_CONTENT,this._headingLevel=null,this._pdomHeadingBehavior=Ds,this.focusHighlightChangedEmitter=new te.Z,this.pdomDisplaysEmitter=new te.Z,this.pdomBoundInputEnabledListener=this.pdomInputEnabledListener.bind(this)}disposeParallelDOM(){(0,ps.i)(this._accessibleName)&&!this._accessibleName.isDisposed&&(this._accessibleName.unlink(this._onPDOMContentChangeListener),this._accessibleName=null),(0,ps.i)(this._helpText)&&!this._helpText.isDisposed&&(this._helpText.unlink(this._onPDOMContentChangeListener),this._helpText=null),(0,ps.i)(this._pdomHeading)&&!this._pdomHeading.isDisposed&&(this._pdomHeading.unlink(this._onPDOMContentChangeListener),this._pdomHeading=null),(0,ps.i)(this._inputValue)&&!this._inputValue.isDisposed&&(this._inputValue.unlink(this._onPDOMContentChangeListener),this._inputValue=null),(0,ps.i)(this._ariaLabel)&&!this._ariaLabel.isDisposed&&this._ariaLabel.unlink(this._onAriaLabelChangeListener),(0,ps.i)(this._ariaValueText)&&!this._ariaValueText.isDisposed&&this._ariaValueText.unlink(this._onAriaValueTextChangeListener),(0,ps.i)(this._labelContent)&&!this._labelContent.isDisposed&&this._labelContent.unlink(this._onLabelContentChangeListener),(0,ps.i)(this._descriptionContent)&&!this._descriptionContent.isDisposed&&this._descriptionContent.unlink(this._onDescriptionContentChangeListener),this.inputEnabledProperty.unlink(this.pdomBoundInputEnabledListener),this.pdomOrder=null,this.setPDOMTransformSourceNode(null),this.setAriaLabelledbyAssociations([]),this.setAriaDescribedbyAssociations([]),this.setActiveDescendantAssociations([]),this.removePDOMAttributes(),this._innerContentProperty.dispose()}pdomInputEnabledListener(e){this.setPDOMAttribute("aria-disabled",!e),this.setPDOMAttribute("onclick",e?"":"return false")}isFocused(){for(let e=0;e<this._pdomInstances.length;e++){if(this._pdomInstances[e].peer.isFocused())return!0}return!1}get focused(){return this.isFocused()}focus(){if(this._pdomInstances.length>0){const e=this._pdomInstances[0].peer;e.focus()}}blur(){if(this._pdomInstances.length>0){const e=this._pdomInstances[0].peer;e.blur()}}pdomAudit(){this.hasPDOMContent;for(let e=0;e<this.children.length;e++)this.children[e].pdomAudit()}setAccessibleName(e){e!==this._accessibleName&&((0,ps.i)(this._accessibleName)&&!this._accessibleName.isDisposed&&this._accessibleName.unlink(this._onPDOMContentChangeListener),this._accessibleName=e,(0,ps.i)(e)&&e.lazyLink(this._onPDOMContentChangeListener),this.onPDOMContentChange())}set accessibleName(e){this.setAccessibleName(e)}get accessibleName(){return this.getAccessibleName()}getAccessibleName(){return(0,ps.i)(this._accessibleName)?this._accessibleName.value:this._accessibleName}removeFromPDOM(){this.tagName=null}setAccessibleNameBehavior(e){this._accessibleNameBehavior!==e&&(this._accessibleNameBehavior=e,this.onPDOMContentChange())}set accessibleNameBehavior(e){this.setAccessibleNameBehavior(e)}get accessibleNameBehavior(){return this.getAccessibleNameBehavior()}getAccessibleNameBehavior(){return this._accessibleNameBehavior}setPDOMHeading(e){e!==this._pdomHeading&&((0,ps.i)(this._pdomHeading)&&!this._pdomHeading.isDisposed&&this._pdomHeading.unlink(this._onPDOMContentChangeListener),this._pdomHeading=e,(0,ps.i)(e)&&e.lazyLink(this._onPDOMContentChangeListener),this.onPDOMContentChange())}set pdomHeading(e){this.setPDOMHeading(e)}get pdomHeading(){return this.getPDOMHeading()}getPDOMHeading(){return(0,ps.i)(this._pdomHeading)?this._pdomHeading.value:this._pdomHeading}setPDOMHeadingBehavior(e){this._pdomHeadingBehavior!==e&&(this._pdomHeadingBehavior=e,this.onPDOMContentChange())}set pdomHeadingBehavior(e){this.setPDOMHeadingBehavior(e)}get pdomHeadingBehavior(){return this.getPDOMHeadingBehavior()}getPDOMHeadingBehavior(){return this._pdomHeadingBehavior}getHeadingLevel(){return this._headingLevel}get headingLevel(){return this.getHeadingLevel()}computeHeadingLevel(){if(!this._pdomParent)return this.pdomHeading?(this._headingLevel=1,1):0;if(this.pdomHeading){const e=this._pdomParent.computeHeadingLevel()+1;return this._headingLevel=e,e}return this._pdomParent.computeHeadingLevel()}setHelpText(e){e!==this._helpText&&((0,ps.i)(this._helpText)&&!this._helpText.isDisposed&&this._helpText.unlink(this._onPDOMContentChangeListener),this._helpText=e,(0,ps.i)(e)&&e.lazyLink(this._onPDOMContentChangeListener),this.onPDOMContentChange())}set helpText(e){this.setHelpText(e)}get helpText(){return this.getHelpText()}getHelpText(){return(0,ps.i)(this._helpText)?this._helpText.value:this._helpText}setHelpTextBehavior(e){this._helpTextBehavior!==e&&(this._helpTextBehavior=e,this.onPDOMContentChange())}set helpTextBehavior(e){this.setHelpTextBehavior(e)}get helpTextBehavior(){return this.getHelpTextBehavior()}getHelpTextBehavior(){return this._helpTextBehavior}setTagName(e){e!==this._tagName&&(this._tagName=e,this.onPDOMContentChange())}set tagName(e){this.setTagName(e)}get tagName(){return this.getTagName()}getTagName(){return this._tagName}setLabelTagName(e){e!==this._labelTagName&&(this._labelTagName=e,this.onPDOMContentChange())}set labelTagName(e){this.setLabelTagName(e)}get labelTagName(){return this.getLabelTagName()}getLabelTagName(){return this._labelTagName}setDescriptionTagName(e){e!==this._descriptionTagName&&(this._descriptionTagName=e,this.onPDOMContentChange())}set descriptionTagName(e){this.setDescriptionTagName(e)}get descriptionTagName(){return this.getDescriptionTagName()}getDescriptionTagName(){return this._descriptionTagName}setInputType(e){if(e!==this._inputType){this._inputType=e;for(let t=0;t<this._pdomInstances.length;t++){const i=this._pdomInstances[t].peer;null===e?i.removeAttributeFromElement("type"):i.setAttributeToElement("type",e)}}}set inputType(e){this.setInputType(e)}get inputType(){return this.getInputType()}getInputType(){return this._inputType}setAppendLabel(e){this._appendLabel!==e&&(this._appendLabel=e,this.onPDOMContentChange())}set appendLabel(e){this.setAppendLabel(e)}get appendLabel(){return this.getAppendLabel()}getAppendLabel(){return this._appendLabel}setAppendDescription(e){this._appendDescription!==e&&(this._appendDescription=e,this.onPDOMContentChange())}set appendDescription(e){this.setAppendDescription(e)}get appendDescription(){return this.getAppendDescription()}getAppendDescription(){return this._appendDescription}setContainerTagName(e){this._containerTagName!==e&&(this._containerTagName=e,this.onPDOMContentChange())}set containerTagName(e){this.setContainerTagName(e)}get containerTagName(){return this.getContainerTagName()}getContainerTagName(){return this._containerTagName}invalidatePeerLabelSiblingContent(){const e=this.labelContent;this._labelTagName||this.setLabelTagName(Ys);for(let t=0;t<this._pdomInstances.length;t++){this._pdomInstances[t].peer.setLabelSiblingContent(e)}}setLabelContent(e){e!==this._labelContent&&((0,ps.i)(this._labelContent)&&!this._labelContent.isDisposed&&this._labelContent.unlink(this._onLabelContentChangeListener),this._labelContent=e,(0,ps.i)(e)&&e.lazyLink(this._onLabelContentChangeListener),this.invalidatePeerLabelSiblingContent())}set labelContent(e){this.setLabelContent(e)}get labelContent(){return this.getLabelContent()}getLabelContent(){return ys(this._labelContent)}setInnerContent(e){this._innerContentProperty.setValueOrTargetProperty(this,null,e)}set innerContent(e){this.setInnerContent(e)}get innerContent(){return this.getInnerContent()}getInnerContent(){return this._innerContentProperty.value}onInnerContentPropertyChange(e){for(let t=0;t<this._pdomInstances.length;t++){this._pdomInstances[t].peer.setPrimarySiblingContent(e)}}invalidatePeerDescriptionSiblingContent(){const e=this.descriptionContent;this._descriptionTagName||this.setDescriptionTagName(Es);for(let t=0;t<this._pdomInstances.length;t++){this._pdomInstances[t].peer.setDescriptionSiblingContent(e)}}setDescriptionContent(e){e!==this._descriptionContent&&((0,ps.i)(this._descriptionContent)&&!this._descriptionContent.isDisposed&&this._descriptionContent.unlink(this._onDescriptionContentChangeListener),this._descriptionContent=e,(0,ps.i)(e)&&e.lazyLink(this._onDescriptionContentChangeListener),this.invalidatePeerDescriptionSiblingContent())}set descriptionContent(e){this.setDescriptionContent(e)}get descriptionContent(){return this.getDescriptionContent()}getDescriptionContent(){return ys(this._descriptionContent)}setAriaRole(e){this._ariaRole!==e&&(this._ariaRole=e,null!==e?this.setPDOMAttribute("role",e):this.removePDOMAttribute("role"))}set ariaRole(e){this.setAriaRole(e)}get ariaRole(){return this.getAriaRole()}getAriaRole(){return this._ariaRole}setContainerAriaRole(e){this._containerAriaRole!==e&&(this._containerAriaRole=e,null===e?this.removePDOMAttribute("role",{elementName:BA.CONTAINER_PARENT}):this.setPDOMAttribute("role",e,{elementName:BA.CONTAINER_PARENT}))}set containerAriaRole(e){this.setContainerAriaRole(e)}get containerAriaRole(){return this.getContainerAriaRole()}getContainerAriaRole(){return this._containerAriaRole}onAriaValueTextChange(){const e=this.ariaValueText;null===e?this._hasAppliedAriaLabel&&(this.removePDOMAttribute("aria-valuetext"),this._hasAppliedAriaLabel=!1):(this.setPDOMAttribute("aria-valuetext",e),this._hasAppliedAriaLabel=!0)}setAriaValueText(e){this._ariaValueText!==e&&((0,ps.i)(this._ariaValueText)&&!this._ariaValueText.isDisposed&&this._ariaValueText.unlink(this._onAriaValueTextChangeListener),this._ariaValueText=e,(0,ps.i)(e)&&e.lazyLink(this._onAriaValueTextChangeListener),this.onAriaValueTextChange())}set ariaValueText(e){this.setAriaValueText(e)}get ariaValueText(){return this.getAriaValueText()}getAriaValueText(){return ys(this._ariaValueText)}setPDOMNamespace(e){return this._pdomNamespace!==e&&(this._pdomNamespace=e,this.onPDOMContentChange()),this}set pdomNamespace(e){this.setPDOMNamespace(e)}get pdomNamespace(){return this.getPDOMNamespace()}getPDOMNamespace(){return this._pdomNamespace}onAriaLabelChange(){const e=this.ariaLabel;null===e?this._hasAppliedAriaLabel&&(this.removePDOMAttribute("aria-label"),this._hasAppliedAriaLabel=!1):(this.setPDOMAttribute("aria-label",e),this._hasAppliedAriaLabel=!0)}setAriaLabel(e){this._ariaLabel!==e&&((0,ps.i)(this._ariaLabel)&&!this._ariaLabel.isDisposed&&this._ariaLabel.unlink(this._onAriaLabelChangeListener),this._ariaLabel=e,(0,ps.i)(e)&&e.lazyLink(this._onAriaLabelChangeListener),this.onAriaLabelChange())}set ariaLabel(e){this.setAriaLabel(e)}get ariaLabel(){return this.getAriaLabel()}getAriaLabel(){return ys(this._ariaLabel)}setFocusHighlight(e){this._focusHighlight!==e&&(this._focusHighlight=e,this._focusHighlightLayerable&&(e.visible=!1),this.focusHighlightChangedEmitter.emit())}set focusHighlight(e){this.setFocusHighlight(e)}get focusHighlight(){return this.getFocusHighlight()}getFocusHighlight(){return this._focusHighlight}setFocusHighlightLayerable(e){this._focusHighlightLayerable!==e&&(this._focusHighlightLayerable=e,this._focusHighlight&&(this._focusHighlight.visible=!1,this.focusHighlightChangedEmitter.emit()))}set focusHighlightLayerable(e){this.setFocusHighlightLayerable(e)}get focusHighlightLayerable(){return this.getFocusHighlightLayerable()}getFocusHighlightLayerable(){return this._focusHighlightLayerable}setGroupFocusHighlight(e){this._groupFocusHighlight=e}set groupFocusHighlight(e){this.setGroupFocusHighlight(e)}get groupFocusHighlight(){return this.getGroupFocusHighlight()}getGroupFocusHighlight(){return this._groupFocusHighlight}setAriaLabelledbyAssociations(e){let t,i;if(0===e.length&&0===this._ariaLabelledbyAssociations.length)return;const s=[],n=[],r=[];for(ms(e,this._ariaLabelledbyAssociations,n,s,r),i=0;i<s.length;i++)t=s[i],this.removeAriaLabelledbyAssociation(t);for(i=0;i<n.length;i++){const t=e[i];this.addAriaLabelledbyAssociation(t)}}set ariaLabelledbyAssociations(e){this.setAriaLabelledbyAssociations(e)}get ariaLabelledbyAssociations(){return this.getAriaLabelledbyAssociations()}getAriaLabelledbyAssociations(){return this._ariaLabelledbyAssociations}addAriaLabelledbyAssociation(e){this._ariaLabelledbyAssociations.push(e),e.otherNode._nodesThatAreAriaLabelledbyThisNode.push(this),this.updateAriaLabelledbyAssociationsInPeers()}removeAriaLabelledbyAssociation(e){this._ariaLabelledbyAssociations.splice(_.indexOf(this._ariaLabelledbyAssociations,e),1)[0].otherNode.removeNodeThatIsAriaLabelledByThisNode(this),this.updateAriaLabelledbyAssociationsInPeers()}removeNodeThatIsAriaLabelledByThisNode(e){const t=_.indexOf(this._nodesThatAreAriaLabelledbyThisNode,e);this._nodesThatAreAriaLabelledbyThisNode.splice(t,1)}updateAriaLabelledbyAssociationsInPeers(){for(let e=0;e<this.pdomInstances.length;e++){this.pdomInstances[e].peer.onAriaLabelledbyAssociationChange()}}updateOtherNodesAriaLabelledby(){for(let e=0;e<this._nodesThatAreAriaLabelledbyThisNode.length;e++){this._nodesThatAreAriaLabelledbyThisNode[e].updateAriaLabelledbyAssociationsInPeers()}}getNodesThatAreAriaLabelledbyThisNode(){return this._nodesThatAreAriaLabelledbyThisNode}get nodesThatAreAriaLabelledbyThisNode(){return this.getNodesThatAreAriaLabelledbyThisNode()}setAriaDescribedbyAssociations(e){let t;if(0===e.length&&0===this._ariaDescribedbyAssociations.length)return;const i=[],s=[],n=[];let r;for(ms(e,this._ariaDescribedbyAssociations,s,i,n),r=0;r<i.length;r++)t=i[r],this.removeAriaDescribedbyAssociation(t);for(r=0;r<s.length;r++){const t=e[r];this.addAriaDescribedbyAssociation(t)}}set ariaDescribedbyAssociations(e){this.setAriaDescribedbyAssociations(e)}get ariaDescribedbyAssociations(){return this.getAriaDescribedbyAssociations()}getAriaDescribedbyAssociations(){return this._ariaDescribedbyAssociations}addAriaDescribedbyAssociation(e){this._ariaDescribedbyAssociations.push(e),e.otherNode._nodesThatAreAriaDescribedbyThisNode.push(this),this.updateAriaDescribedbyAssociationsInPeers()}hasAriaDescribedbyAssociation(e){return _.includes(this._ariaDescribedbyAssociations,e)}removeAriaDescribedbyAssociation(e){this._ariaDescribedbyAssociations.splice(_.indexOf(this._ariaDescribedbyAssociations,e),1)[0].otherNode.removeNodeThatIsAriaDescribedByThisNode(this),this.updateAriaDescribedbyAssociationsInPeers()}removeNodeThatIsAriaDescribedByThisNode(e){const t=_.indexOf(this._nodesThatAreAriaDescribedbyThisNode,e);this._nodesThatAreAriaDescribedbyThisNode.splice(t,1)}updateAriaDescribedbyAssociationsInPeers(){for(let e=0;e<this.pdomInstances.length;e++){this.pdomInstances[e].peer.onAriaDescribedbyAssociationChange()}}updateOtherNodesAriaDescribedby(){for(let e=0;e<this._nodesThatAreAriaDescribedbyThisNode.length;e++){this._nodesThatAreAriaDescribedbyThisNode[e].updateAriaDescribedbyAssociationsInPeers()}}getNodesThatAreAriaDescribedbyThisNode(){return this._nodesThatAreAriaDescribedbyThisNode}get nodesThatAreAriaDescribedbyThisNode(){return this.getNodesThatAreAriaDescribedbyThisNode()}setActiveDescendantAssociations(e){let t;if(0===e.length&&0===this._activeDescendantAssociations.length)return;const i=[],s=[],n=[];let r;for(ms(e,this._activeDescendantAssociations,s,i,n),r=0;r<i.length;r++)t=i[r],this.removeActiveDescendantAssociation(t);for(r=0;r<s.length;r++){const t=e[r];this.addActiveDescendantAssociation(t)}}set activeDescendantAssociations(e){this.setActiveDescendantAssociations(e)}get activeDescendantAssociations(){return this.getActiveDescendantAssociations()}getActiveDescendantAssociations(){return this._activeDescendantAssociations}addActiveDescendantAssociation(e){this._activeDescendantAssociations.push(e),e.otherNode._nodesThatAreActiveDescendantToThisNode.push(this),this.updateActiveDescendantAssociationsInPeers()}removeActiveDescendantAssociation(e){this._activeDescendantAssociations.splice(_.indexOf(this._activeDescendantAssociations,e),1)[0].otherNode.removeNodeThatIsActiveDescendantThisNode(this),this.updateActiveDescendantAssociationsInPeers()}removeNodeThatIsActiveDescendantThisNode(e){const t=_.indexOf(this._nodesThatAreActiveDescendantToThisNode,e);this._nodesThatAreActiveDescendantToThisNode.splice(t,1)}updateActiveDescendantAssociationsInPeers(){for(let e=0;e<this.pdomInstances.length;e++){this.pdomInstances[e].peer.onActiveDescendantAssociationChange()}}updateOtherNodesActiveDescendant(){for(let e=0;e<this._nodesThatAreActiveDescendantToThisNode.length;e++){this._nodesThatAreActiveDescendantToThisNode[e].updateActiveDescendantAssociationsInPeers()}}getNodesThatAreActiveDescendantToThisNode(){return this._nodesThatAreActiveDescendantToThisNode}get nodesThatAreActiveDescendantToThisNode(){return this.getNodesThatAreActiveDescendantToThisNode()}setPDOMOrder(e){if(this._pdomOrder!==e){const t=this._pdomOrder;this._pdomOrder=null===e?null:e.slice(),GA.pdomOrderChange(this,t,e),this.rendererSummaryRefreshEmitter.emit()}}set pdomOrder(e){this.setPDOMOrder(e)}get pdomOrder(){return this.getPDOMOrder()}getPDOMOrder(){return this._pdomOrder?this._pdomOrder.slice(0):this._pdomOrder}hasPDOMOrder(){return null!==this._pdomOrder&&0!==this._pdomOrder.length&&(this._pdomOrder.length>1||null!==this._pdomOrder[0])}getPDOMParent(){return this._pdomParent}get pdomParent(){return this.getPDOMParent()}getEffectiveChildren(){const e=[];for(let t=0;t<this._children.length;t++){const i=this._children[t];i._pdomParent||e.push(i)}if(this.hasPDOMOrder()){const t=this.pdomOrder.slice(),i=t.indexOf(null);return i>=0?(e.unshift(i,1),Array.prototype.splice.apply(t,e)):Array.prototype.push.apply(t,e),t}return e}setPDOMVisible(e){this._pdomVisible!==e&&(this._pdomVisible=e,this._pdomDisplaysInfo.onPDOMVisibilityChange(e))}set pdomVisible(e){this.setPDOMVisible(e)}get pdomVisible(){return this.isPDOMVisible()}isPDOMVisible(){return this._pdomVisible}isPDOMDisplayed(){for(let e=0;e<this._pdomInstances.length;e++)if(this._pdomInstances[e].isGloballyVisible())return!0;return!1}get pdomDisplayed(){return this.isPDOMDisplayed()}invalidatePeerInputValue(){for(let e=0;e<this.pdomInstances.length;e++){this.pdomInstances[e].peer.onInputValueChange()}}setInputValue(e){e!==this._inputValue&&((0,ps.i)(this._inputValue)&&!this._inputValue.isDisposed&&this._inputValue.unlink(this._onPDOMContentChangeListener),this._inputValue=e,(0,ps.i)(e)&&e.lazyLink(this._onPDOMContentChangeListener),this.invalidatePeerInputValue())}set inputValue(e){this.setInputValue(e)}get inputValue(){return this.getInputValue()}getInputValue(){let e;return e=(0,ps.i)(this._inputValue)?this._inputValue.value:this._inputValue,null===e?null:""+e}setPDOMChecked(e){this._tagName,this._inputType,this._pdomChecked!==e&&(this._pdomChecked=e,this.setPDOMAttribute("checked",e,{asProperty:!0}))}set pdomChecked(e){this.setPDOMChecked(e)}get pdomChecked(){return this.getPDOMChecked()}getPDOMChecked(){return this._pdomChecked}getPDOMAttributes(){return this._pdomAttributes.slice(0)}get pdomAttributes(){return this.getPDOMAttributes()}setPDOMAttribute(e,t,i){const s=(0,Ce.ZP)()({namespace:null,asProperty:!1,elementName:BA.PRIMARY_SIBLING},i);for(let r=0;r<this._pdomAttributes.length;r++){const t=this._pdomAttributes[r];t.attribute===e&&t.options.namespace===s.namespace&&t.options.elementName===s.elementName&&(t.options.asProperty===s.asProperty?this._pdomAttributes.splice(r,1):this.removePDOMAttribute(t.attribute,t.options))}let n=t=>{for(let i=0;i<this._pdomInstances.length;i++){this._pdomInstances[i].peer.setAttributeToElement(e,t,s)}};(0,ps.i)(t)?t.link(n):(n(t),n=null),this._pdomAttributes.push({attribute:e,value:t,listener:n,options:s})}removePDOMAttribute(e,t){const i=(0,Ce.ZP)()({namespace:null,elementName:BA.PRIMARY_SIBLING},t);let s=!1;for(let n=0;n<this._pdomAttributes.length;n++)if(this._pdomAttributes[n].attribute===e&&this._pdomAttributes[n].options.namespace===i.namespace&&this._pdomAttributes[n].options.elementName===i.elementName){const e=this._pdomAttributes[n];e.listener&&(0,ps.i)(e.value)&&!e.value.isDisposed&&e.value.unlink(e.listener),this._pdomAttributes.splice(n,1),s=!0}for(let n=0;n<this._pdomInstances.length;n++){this._pdomInstances[n].peer.removeAttributeFromElement(e,i)}}removePDOMAttributes(){const e=this.getPDOMAttributes();for(let t=0;t<e.length;t++){const i=e[t].attribute;this.removePDOMAttribute(i)}}hasPDOMAttribute(e,t){const i=(0,Ce.ZP)()({namespace:null,elementName:BA.PRIMARY_SIBLING},t);let s=!1;for(let n=0;n<this._pdomAttributes.length;n++)this._pdomAttributes[n].attribute===e&&this._pdomAttributes[n].options.namespace===i.namespace&&this._pdomAttributes[n].options.elementName===i.elementName&&(s=!0);return s}setPDOMClass(e,t){const i=(0,Ce.ZP)()({elementName:BA.PRIMARY_SIBLING},t);for(let s=0;s<this._pdomClasses.length;s++){const t=this._pdomClasses[s];if(t.className===e&&t.options.elementName===i.elementName)return}this._pdomClasses.push({className:e,options:i});for(let s=0;s<this._pdomInstances.length;s++){this._pdomInstances[s].peer.setClassToElement(e,i)}}removePDOMClass(e,t){const i=(0,Ce.ZP)()({elementName:BA.PRIMARY_SIBLING},t);let s=!1;for(let n=0;n<this._pdomClasses.length;n++)this._pdomClasses[n].className===e&&this._pdomClasses[n].options.elementName===i.elementName&&(this._pdomClasses.splice(n,1),s=!0);for(let n=0;n<this._pdomClasses.length;n++){this.pdomInstances[n].peer.removeClassFromElement(e,i)}}getPDOMClasses(){return this._pdomClasses.slice(0)}get pdomClasses(){return this.getPDOMClasses()}setFocusable(e){if(this._focusableOverride!==e){this._focusableOverride=e;for(let e=0;e<this._pdomInstances.length;e++)this._pdomInstances[e].peer.setFocusable(this.focusable)}}set focusable(e){this.setFocusable(e)}get focusable(){return this.isFocusable()}isFocusable(){return null!==this._focusableOverride?this._focusableOverride:null!==this._tagName&&Fi.tagIsDefaultFocusable(this._tagName)}setPDOMTransformSourceNode(e){this._pdomTransformSourceNode=e;for(let t=0;t<this._pdomInstances.length;t++)this._pdomInstances[t].peer.setPDOMTransformSourceNode(this._pdomTransformSourceNode)}set pdomTransformSourceNode(e){this.setPDOMTransformSourceNode(e)}get pdomTransformSourceNode(){return this.getPDOMTransformSourceNode()}getPDOMTransformSourceNode(){return this._pdomTransformSourceNode}setFocusPanTargetBoundsProperty(e){e!==this._focusPanTargetBoundsProperty&&(this._focusPanTargetBoundsProperty=e)}getFocusPanTargetBoundsProperty(){return this._focusPanTargetBoundsProperty}set focusPanTargetBoundsProperty(e){this.setFocusPanTargetBoundsProperty(e)}get focusPanTargetBoundsProperty(){return this.getFocusPanTargetBoundsProperty()}setLimitPanDirection(e){this._limitPanDirection=e}getLimitPanDirection(){return this._limitPanDirection}set limitPanDirection(e){this.setLimitPanDirection(e)}get limitPanDirection(){return this.getLimitPanDirection()}setPositionInPDOM(e){this._positionInPDOM=e;for(let t=0;t<this._pdomInstances.length;t++)this._pdomInstances[t].peer.setPositionInPDOM(e)}set positionInPDOM(e){this.setPositionInPDOM(e)}get positionInPDOM(){return this.getPositionInPDOM()}getPositionInPDOM(){return this._positionInPDOM}setExcludeLabelSiblingFromInput(){this.excludeLabelSiblingFromInput=!0,this.onPDOMContentChange()}isInsidePhetioArchetype(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;if(e.isPhetioInstrumented())return e.phetioIsArchetype;for(let t=0;t<e.parents.length;t++)if(this.isInsidePhetioArchetype(e.parents[t]))return!0;return!1}alertDescriptionUtterance(e){if(ws.Z.value)return;if(Kt.Z.PHET_IO_ENABLED&&this.isInsidePhetioArchetype())return;const t=this.getConnectedDisplays();for(let i=0;i<t.length;i++){const s=t[i];s.isAccessible()&&s.descriptionUtteranceQueue.addToBack(e)}}forEachUtteranceQueue(e){const t=this.getConnectedDisplays();for(let i=0;i<t.length;i++){const s=t[i];s.isAccessible()&&e(s.descriptionUtteranceQueue)}}getBaseOptions(){const e={};for(let t=0;t<Is.length;t++){const i=Is[t];e[i]=this[i]}return e}getNestedPDOMOrder(){const e=new pn(this);let t=[];const i=[],s=[i];return function i(n,r){let o=0;if(_.each(t,e=>{n===e&&o++}),o>1||1===o&&!r)return;if(n.hasPDOMContent){const t={trail:e.copy(),children:[]};s[s.length-1].push(t),s.push(t.children)}const A=null===n._pdomOrder?[]:n._pdomOrder;t=t.concat(A),_.each(A,t=>{_.each(n.getLeafTrailsTo(t),s=>{s.removeAncestor(),e.addDescendantTrail(s),i(t,!0),e.removeDescendantTrail(s)})});const a=n._children.length;for(let t=0;t<a;t++){const s=n._children[t];e.addDescendant(s,t),i(s,!1),e.removeDescendant()}_.each(A,()=>{t.pop()}),n.hasPDOMContent&&s.pop()}(this,!1),i}onPDOMContentChange(){GA.pdomContentChange(this),this.pdomHeading&&this.computeHeadingLevel(),this.rendererSummaryRefreshEmitter.emit()}get hasPDOMContent(){return!!this._tagName}onPDOMAddChild(e){this._pdomDisplaysInfo.onAddChild(e),GA.addChild(this,e)}onPDOMRemoveChild(e){this._pdomDisplaysInfo.onRemoveChild(e),GA.removeChild(this,e),e.updateOtherNodesAriaLabelledby(),e.updateOtherNodesAriaDescribedby(),e.updateOtherNodesActiveDescendant()}onPDOMReorderedChildren(){GA.childrenOrderChange(this)}updateLinkedElementForProperty(e,t,i){if(this.isPhetioInstrumented()){t&&t instanceof ee.Z&&t.isPhetioInstrumented()&&t instanceof Ee.Z&&this.removeLinkedElements(t);const s=this.tandem.createTandem(e);i&&i instanceof ee.Z&&i.isPhetioInstrumented()&&i instanceof Ee.Z&&s!==i.tandem&&this.addLinkedElement(i,{tandemName:e})}}getPDOMInstances(){return this._pdomInstances}get pdomInstances(){return this.getPDOMInstances()}addPDOMInstance(e){this._pdomInstances.push(e)}removePDOMInstance(e){const t=_.indexOf(this._pdomInstances,e);this._pdomInstances.splice(t,1)}static BASIC_ACCESSIBLE_NAME_BEHAVIOR(e,t,i){return"input"===e.tagName?(t.labelTagName="label",t.labelContent=i):Fi.tagNameSupportsContent(e.tagName)?t.innerContent=i:t.ariaLabel=i,t}static HELP_TEXT_BEFORE_CONTENT(e,t,i){return t.descriptionTagName=Fi.DEFAULT_DESCRIPTION_TAG_NAME,t.descriptionContent=i,t.appendDescription=!1,t}static HELP_TEXT_AFTER_CONTENT(e,t,i){return t.descriptionTagName=Fi.DEFAULT_DESCRIPTION_TAG_NAME,t.descriptionContent=i,t.appendDescription=!0,t}}W.register("ParallelDOM",qs);var Gs=i(6871);class Qs extends Ms.Z{constructor(e,t){super(e),this.onAccessAttempt=t}get(){return this.onAccessAttempt(),super.get()}set(e){throw new Error("Cannot set a TinyStaticProperty value")}isSettable(){return!1}notifyListeners(e){this.emit(this.get(),e,this)}link(e){this.addListener(e),e(this.get(),null,this)}equalsValue(e){return this.areValuesEqual(e,this.get())}}Vs.Z.register("TinyStaticProperty",Qs);var Ss=i(8676);let Ts=1;const xs=Ue.Z.NOTHING.copy(),ks=Ue.Z.NOTHING.copy(),Fs=new Le.Z,Rs=Gs.Z.TANDEM_NAME;const Us=["leftTop","centerTop","rightTop","leftCenter","center","rightCenter","leftBottom","centerBottom","rightBottom","left","right","top","bottom","centerX","centerY"],Ls=["children","cursor","phetioVisiblePropertyInstrumented","visibleProperty","visible","pickableProperty","pickable","phetioEnabledPropertyInstrumented","enabledProperty","enabled","phetioInputEnabledPropertyInstrumented","inputEnabledProperty","inputEnabled","inputListeners","opacity","disabledOpacity","filters","matrix","translation","x","y","rotation","scale","excludeInvisibleChildrenFromBounds","layoutOptions","localBounds","maxWidth","maxHeight","renderer","layerSplit","usesOpacity","cssTransform","excludeInvisible","webglScale","preventFit","mouseArea","touchArea","clipArea","transformBounds",...Us],Ps={phetioVisiblePropertyInstrumented:!0,visible:!0,opacity:1,disabledOpacity:1,pickable:null,enabled:!0,phetioEnabledPropertyInstrumented:!1,inputEnabled:!0,phetioInputEnabledPropertyInstrumented:!1,clipArea:null,mouseArea:null,touchArea:null,cursor:null,transformBounds:!1,maxWidth:null,maxHeight:null,renderer:null,usesOpacity:!1,layerSplit:!1,cssTransform:!1,excludeInvisible:!1,webglScale:null,preventFit:!1},bs=null===Ps.renderer?0:Te.fromName(Ps.renderer);class Os extends qs{constructor(e){super(),_defineProperty(this,"parentAddedEmitter",new te.Z),_defineProperty(this,"parentRemovedEmitter",new te.Z),_defineProperty(this,"_activeParentLayoutConstraint",null),this._id=Ts++,this._instances=[],this._rootedDisplays=[],this._drawables=[],this._visibleProperty=new Bs(Ps.visible,Ps.phetioVisiblePropertyInstrumented,this.onVisiblePropertyChange.bind(this)),this.opacityProperty=new Ms.Z(Ps.opacity,this.onOpacityPropertyChange.bind(this)),this.disabledOpacityProperty=new Ms.Z(Ps.disabledOpacity,this.onDisabledOpacityPropertyChange.bind(this)),this._pickableProperty=new Bs(Ps.pickable,!1,this.onPickablePropertyChange.bind(this)),this._enabledProperty=new Bs(Ps.enabled,Ps.phetioEnabledPropertyInstrumented,this.onEnabledPropertyChange.bind(this)),this._inputEnabledProperty=new Bs(Ps.inputEnabled,Ps.phetioInputEnabledPropertyInstrumented),this.clipAreaProperty=new Ms.Z(Ps.clipArea),this.voicingVisibleProperty=new Ms.Z(!0),this._mouseArea=Ps.mouseArea,this._touchArea=Ps.touchArea,this._cursor=Ps.cursor,this._children=[],this._parents=[],this._transformBounds=Ps.transformBounds,this._transform=new Pe.Z,this._transformListener=this.onTransformChange.bind(this),this._transform.changeEmitter.addListener(this._transformListener),this._maxWidth=Ps.maxWidth,this._maxHeight=Ps.maxHeight,this._appliedScaleFactor=1,this._inputListeners=[],this._renderer=bs,this._usesOpacity=Ps.usesOpacity,this._layerSplit=Ps.layerSplit,this._cssTransform=Ps.cssTransform,this._excludeInvisible=Ps.excludeInvisible,this._webglScale=Ps.webglScale,this._preventFit=Ps.preventFit,this.inputEnabledProperty.lazyLink(this.pdomBoundInputEnabledListener);const t=this.onBoundsListenersAddedOrRemoved.bind(this),i=this.validateBounds.bind(this),s=this.validateSelfBounds.bind(this);this.boundsProperty=new Qs(Ue.Z.NOTHING.copy(),i),this.boundsProperty.changeCount=t,this.localBoundsProperty=new Qs(Ue.Z.NOTHING.copy(),i),this.localBoundsProperty.changeCount=t,this.childBoundsProperty=new Qs(Ue.Z.NOTHING.copy(),i),this.childBoundsProperty.changeCount=t,this.selfBoundsProperty=new Qs(Ue.Z.NOTHING.copy(),s),this._localBoundsOverridden=!1,this._excludeInvisibleChildrenFromBounds=!1,this._layoutOptions=null,this._boundsDirty=!0,this._localBoundsDirty=!0,this._selfBoundsDirty=!0,this._childBoundsDirty=!0,this._filters=[],this.childrenChangedEmitter=new te.Z,this.childInsertedEmitter=new te.Z,this.childRemovedEmitter=new te.Z,this.childrenReorderedEmitter=new te.Z,this.transformEmitter=new te.Z,this.instanceRefreshEmitter=new te.Z,this.rendererSummaryRefreshEmitter=new te.Z,this.filterChangeEmitter=new te.Z,this.changedInstanceEmitter=new te.Z,this.layoutOptionsChangedEmitter=new te.Z,this._rendererBitmask=Te.bitmaskNodeDefault,this._rendererSummary=new Ws(this),this._boundsEventCount=0,this._boundsEventSelfCount=0,this._picker=new Ns(this),this._isGettingRemovedFromParent=!1,e&&this.mutate(e)}insertChild(e,t,i){return this._picker.onInsertChild(t),this.changeBoundsEventCount(t._boundsEventCount>0?1:0),this._rendererSummary.summaryChange(Ws.bitmaskAll,t._rendererSummary.bitmask),t._parents.push(this),this._children.splice(e,0,t),t._rendererSummary.hasNoPDOM()||this.onPDOMAddChild(t),t.invalidateBounds(),this._boundsDirty=!0,this.childInsertedEmitter.emit(t,e),t.parentAddedEmitter.emit(this),!i&&this.childrenChangedEmitter.emit(),this}addChild(e,t){return this.insertChild(this._children.length,e,t),this}removeChild(e,t){const i=_.indexOf(this._children,e);return this.removeChildWithIndex(e,i,t),this}removeChildAt(e,t){const i=this._children[e];return this.removeChildWithIndex(i,e,t),this}removeChildWithIndex(e,t,i){const s=_.indexOf(e._parents,this);e._isGettingRemovedFromParent=!0,e._rendererSummary.hasNoPDOM()||this.onPDOMRemoveChild(e),this._picker.onRemoveChild(e),this.changeBoundsEventCount(e._boundsEventCount>0?-1:0),this._rendererSummary.summaryChange(e._rendererSummary.bitmask,Ws.bitmaskAll),e._parents.splice(s,1),this._children.splice(t,1),e._isGettingRemovedFromParent=!1,this.invalidateBounds(),this._childBoundsDirty=!0,this.childRemovedEmitter.emit(e,t),e.parentRemovedEmitter.emit(this),!i&&this.childrenChangedEmitter.emit()}moveChildToIndex(e,t){const i=this.indexOfChild(e);return this._children[t]!==e&&(this._children.splice(i,1),this._children.splice(t,0,e),this._rendererSummary.hasNoPDOM()||this.onPDOMReorderedChildren(),this.childrenReorderedEmitter.emit(Math.min(i,t),Math.max(i,t)),this.childrenChangedEmitter.emit()),this}removeAllChildren(){return this.setChildren([]),this}setChildren(e){const t=[],i=[],s=[];let n;for(ms(e,this._children,i,t,s),n=t.length-1;n>=0;n--)this.removeChild(t[n],!0);let r=-1,o=-1;for(n=0;n<s.length;n++){const e=s[n];this._children[n]!==e&&(this._children[n]=e,-1===r&&(r=n),o=n)}const A=-1!==r;if(A&&(this._rendererSummary.hasNoPDOM()||this.onPDOMReorderedChildren(),this.childrenReorderedEmitter.emit(r,o)),i.length){let t=0,s=i[t];for(n=0;n<e.length;n++)e[n]===s&&(this.insertChild(n,s,!0),s=i[++t])}return(0!==t.length||0!==i.length||A)&&this.childrenChangedEmitter.emit(),this}set children(e){this.setChildren(e)}get children(){return this.getChildren()}getChildren(){return this._children.slice(0)}getChildrenCount(){return this._children.length}getParents(){return this._parents.slice(0)}get parents(){return this.getParents()}getParent(){return this._parents.length?this._parents[0]:null}get parent(){return this.getParent()}getChildAt(e){return this._children[e]}indexOfParent(e){return _.indexOf(this._parents,e)}indexOfChild(e){return _.indexOf(this._children,e)}moveToFront(){return _.each(this.parents,e=>e.moveChildToFront(this)),this}moveChildToFront(e){return this.moveChildToIndex(e,this._children.length-1)}moveForward(){return this.parents.forEach(e=>e.moveChildForward(this)),this}moveChildForward(e){const t=this.indexOfChild(e);return t<this.getChildrenCount()-1&&this.moveChildToIndex(e,t+1),this}moveBackward(){return this.parents.forEach(e=>e.moveChildBackward(this)),this}moveChildBackward(e){const t=this.indexOfChild(e);return t>0&&this.moveChildToIndex(e,t-1),this}moveToBack(){return _.each(this.parents,e=>e.moveChildToBack(this)),this}moveChildToBack(e){return this.moveChildToIndex(e,0)}replaceChild(e,t){const i=this.indexOfChild(e),s=e.focused;return this.removeChild(e,!0),this.insertChild(i,t,!0),this.childrenChangedEmitter.emit(),s&&t.focusable&&t.focus(),this}detach(){return _.each(this._parents.slice(0),e=>e.removeChild(this)),this}changeBoundsEventCount(e){if(0!==e){const t=0===this._boundsEventCount;if(this._boundsEventCount+=e,t!==(0===this._boundsEventCount)){const e=t?1:-1,i=this._parents.length;for(let t=0;t<i;t++)this._parents[t].changeBoundsEventCount(e)}}}validateSelfBounds(){if(this._selfBoundsDirty){const e=xs.set(this.selfBoundsProperty._value),t=this.updateSelfBounds();return this._selfBoundsDirty=!1,t&&this.selfBoundsProperty.notifyListeners(e),!0}return!1}validateBounds(){let e;let t=this.validateSelfBounds();const i=this.childBoundsProperty._value,s=this.localBoundsProperty._value,n=this.selfBoundsProperty._value,r=this.boundsProperty._value;if(this._childBoundsDirty){for(t=!0,e=this._children.length;e--;){const t=this._children[e];t&&t.validateBounds()}const s=xs.set(i);for(i.set(Ue.Z.NOTHING),e=this._children.length;e--;){const t=this._children[e];(t&&!this._excludeInvisibleChildrenFromBounds||t.isVisible())&&i.includeBounds(t.bounds)}this._childBoundsDirty=!1,i.equals(s)||i.equalsEpsilon(s,1e-13)||this.childBoundsProperty.notifyListeners(s)}if(this._localBoundsDirty){t=!0,this._localBoundsDirty=!1;const e=xs.set(s);if(!this._localBoundsOverridden){s.set(n).includeBounds(i);const e=this.clipArea;e&&s.constrainBounds(e.bounds)}null===this._maxWidth&&null===this._maxHeight||this.updateMaxDimension(s),s.equals(e)||(this._boundsDirty=!0,s.equalsEpsilon(e,1e-13)||this.localBoundsProperty.notifyListeners(e))}if(this._boundsDirty){t=!0,this._boundsDirty=!1;const i=xs.set(r);if(this._transformBounds&&!this._transform.getMatrix().isAxisAligned()){const e=Fs.set(this.getMatrix());r.set(Ue.Z.NOTHING),this._includeTransformedSubtreeBounds(e,r);const t=this.clipArea;t&&r.constrainBounds(t.getBoundsWithTransform(e))}else r.set(s),this.transformBoundsFromLocalToParent(r);if(!r.equals(i)){for(e=this._parents.length;e--;)this._parents[e].invalidateBounds();r.equalsEpsilon(i,1e-13)||this.boundsProperty.notifyListeners(i)}}return(this._childBoundsDirty||this._boundsDirty)&&this.validateBounds(),t}_includeTransformedSubtreeBounds(e,t){this.selfBounds.isEmpty()||t.includeBounds(this.getTransformedSelfBounds(e));const i=this._children.length;for(let s=0;s<i;s++){const i=this._children[s];e.multiplyMatrix(i._transform.getMatrix()),i._includeTransformedSubtreeBounds(e,t),e.multiplyMatrix(i._transform.getInverse())}return t}validateWatchedBounds(){for(;this.watchedBoundsScan(););}watchedBoundsScan(){if(0!==this._boundsEventSelfCount)return this.validateBounds();if(this._boundsEventCount>0&&this._childBoundsDirty){let e=!1;const t=this._children.length;for(let i=0;i<t;i++)e=this._children[i].watchedBoundsScan()||e;return e}return!1}invalidateBounds(){this._boundsDirty=!0,this._localBoundsDirty=!0;let e=this._parents.length;for(;e--;)this._parents[e].invalidateChildBounds()}invalidateChildBounds(){if(!this._childBoundsDirty){this._childBoundsDirty=!0,this._localBoundsDirty=!0;let e=this._parents.length;for(;e--;)this._parents[e].invalidateChildBounds()}}invalidateSelf(e){const t=this.selfBoundsProperty._value;if(e){if(this._selfBoundsDirty=!1,!t.equals(e)){const i=xs.set(t);this.invalidateBounds(),this._picker.onSelfBoundsDirty(),t.set(e),this.selfBoundsProperty.notifyListeners(i)}}else this._selfBoundsDirty=!0,this.invalidateBounds(),this._picker.onSelfBoundsDirty()}updateSelfBounds(){return!1}hasChild(e){const t=_.includes(this._children,e);return t}getSelfShape(){return this.selfBounds.isEmpty()?new _t.bn:_t.bn.bounds(this.selfBounds)}getSelfBounds(){return this.selfBoundsProperty.value}get selfBounds(){return this.getSelfBounds()}getSafeSelfBounds(){return this.selfBoundsProperty.value}get safeSelfBounds(){return this.getSafeSelfBounds()}getChildBounds(){return this.childBoundsProperty.value}get childBounds(){return this.getChildBounds()}getLocalBounds(){return this.localBoundsProperty.value}get localBounds(){return this.getLocalBounds()}set localBounds(e){this.setLocalBounds(e)}get localBoundsOverridden(){return this._localBoundsOverridden}setLocalBounds(e){const t=this.localBoundsProperty._value,i=t.copy();if(null===e)this._localBoundsOverridden&&(this._localBoundsOverridden=!1,this.localBoundsProperty.notifyListeners(i),this.invalidateBounds());else{const s=!e.equals(t)||!this._localBoundsOverridden;s&&t.set(e),this._localBoundsOverridden||(this._localBoundsOverridden=!0),s&&(this.localBoundsProperty.notifyListeners(i),this.invalidateBounds())}return this}getTransformedSelfBounds(e){return this.selfBounds.transformed(e)}getTransformedSafeSelfBounds(e){return this.safeSelfBounds.transformed(e)}getSafeTransformedVisibleBounds(e){const t=(e||Le.Z.IDENTITY).timesMatrix(this.matrix),i=Ue.Z.NOTHING.copy();if(this.visibleProperty.value&&(this.selfBounds.isEmpty()||i.includeBounds(this.getTransformedSafeSelfBounds(t)),this._children.length))for(let s=0;s<this._children.length;s++)i.includeBounds(this._children[s].getSafeTransformedVisibleBounds(t));return i}get safeTransformedVisibleBounds(){return this.getSafeTransformedVisibleBounds()}setTransformBounds(e){return this._transformBounds!==e&&(this._transformBounds=e,this.invalidateBounds()),this}set transformBounds(e){this.setTransformBounds(e)}get transformBounds(){return this.getTransformBounds()}getTransformBounds(){return this._transformBounds}getBounds(){return this.boundsProperty.value}get bounds(){return this.getBounds()}getVisibleLocalBounds(){const e=this.selfBounds.copy();let t=this._children.length;for(;t--;)e.includeBounds(this._children[t].getVisibleBounds());return e}get visibleLocalBounds(){return this.getVisibleLocalBounds()}getVisibleBounds(){return this.isVisible()?this.getVisibleLocalBounds().transform(this.getMatrix()):Ue.Z.NOTHING}get visibleBounds(){return this.getVisibleBounds()}hitTest(e,t,i){return this._picker.hitTest(e,!!t,!!i)}trailUnderPointer(e){return null===e.point?null:this.hitTest(e.point,e instanceof FA,e.isTouchLike())}containsPoint(e){return null!==this.hitTest(e)}containsPointSelf(e){return this.selfBounds.containsPoint(e)}intersectsBoundsSelf(e){return this.selfBounds.intersectsBounds(e)}isPhetioMouseHittable(e){return!(!1===this.pickable&&!this.isAnyDescendantAPhetioMouseHitTarget())&&(this.visible&&(null===this.clipArea||this.clipArea.containsPoint(this._transform.getInverse().timesVector2(e))))}isAnyDescendantAPhetioMouseHitTarget(){return"phetioNotSelectable"!==this.getPhetioMouseHitTarget()||_.some(this.children,e=>e.isAnyDescendantAPhetioMouseHitTarget())}getPhetioMouseHit(e){if(!this.isPhetioMouseHittable(e))return null;const t=this._transform.getInverse().timesVector2(e);let i=null;for(let s=this._children.length-1;s>=0;s--){const e=this._children[s].getPhetioMouseHit(t);if(e instanceof Ee.Z)return e;"phetioNotSelectable"===e&&(i=!0)}return i?this.getPhetioMouseHitTarget():this._mouseArea?this._mouseArea.containsPoint(t)?this.getPhetioMouseHitTarget():null:this.selfBounds.containsPoint(t)&&this.containsPointSelf(t)?this.getPhetioMouseHitTarget():null}isPainted(){return!1}areSelfBoundsValid(){return!0}hasParent(){return 0!==this._parents.length}hasChildren(){return this._children.length>0}isChildIncludedInLayout(e){return e.bounds.isValid()&&(!this._excludeInvisibleChildrenFromBounds||e.visible)}walkDepthFirst(e){e(this);const t=this._children.length;for(let i=0;i<t;i++)this._children[i].walkDepthFirst(e)}addInputListener(e){return _.includes(this._inputListeners,e)||(this._inputListeners.push(e),this._picker.onAddInputListener()),this}removeInputListener(e){const t=_.indexOf(this._inputListeners,e);return t>=0&&(this._inputListeners.splice(t,1),this._picker.onRemoveInputListener()),this}hasInputListener(e){for(let t=0;t<this._inputListeners.length;t++)if(this._inputListeners[t]===e)return!0;return!1}interruptInput(){const e=this.inputListeners;for(let t=0;t<e.length;t++){const i=e[t];i.interrupt&&i.interrupt()}return this}interruptSubtreeInput(){this.interruptInput();const e=this._children.slice();for(let t=0;t<e.length;t++)e[t].interruptSubtreeInput();return this}translate(e,t,i){if("number"==typeof e){if(Math.abs(e)<1e-12&&Math.abs(t)<1e-12)return;i?this.prependTranslation(e,t):this.appendMatrix(Fs.setToTranslation(e,t))}else{const i=e;if(!i.x&&!i.y)return;this.translate(i.x,i.y,t)}}scale(e,t,i){if("number"==typeof e)if(void 0===t||"boolean"==typeof t)this.scale(e,e,t);else{if(1===e&&1===t)return;i?this.prependMatrix(Le.Z.scaling(e,t)):this.appendMatrix(Le.Z.scaling(e,t))}else{const i=e;this.scale(i.x,i.y,t)}}rotate(e,t){e%(2*Math.PI)!=0&&(t?this.prependMatrix(Le.Z.rotation2(e)):this.appendMatrix(Le.Z.rotation2(e)))}rotateAround(e,t){let i=Le.Z.translation(-e.x,-e.y);return i=Le.Z.rotation2(t).timesMatrix(i),i=Le.Z.translation(e.x,e.y).timesMatrix(i),this.prependMatrix(i),this}setX(e){return this.translate(e-this.getX(),0,!0),this}set x(e){this.setX(e)}get x(){return this.getX()}getX(){return this._transform.getMatrix().m02()}setY(e){return this.translate(0,e-this.getY(),!0),this}set y(e){this.setY(e)}get y(){return this.getY()}getY(){return this._transform.getMatrix().m12()}setScaleMagnitude(e,t){const i=this.getScaleVector();return"number"==typeof e?(void 0===t&&(t=e),this.appendMatrix(Le.Z.scaling(e/i.x,t/i.y))):this.appendMatrix(Le.Z.scaling(e.x/i.x,e.y/i.y)),this}getScaleVector(){return this._transform.getMatrix().getScaleVector()}setRotation(e){return this.appendMatrix(Fs.setToRotationZ(e-this.getRotation())),this}set rotation(e){this.setRotation(e)}get rotation(){return this.getRotation()}getRotation(){return this._transform.getMatrix().getRotation()}setTranslation(e,t){const i=this._transform.getMatrix(),s=i.m02(),n=i.m12();let r,o;return"number"==typeof e?(r=e-s,o=t-n):(r=e.x-s,o=e.y-n),this.translate(r,o,!0),this}set translation(e){this.setTranslation(e)}get translation(){return this.getTranslation()}getTranslation(){const e=this._transform.getMatrix();return new be.Z(e.m02(),e.m12())}appendMatrix(e){this._transform.append(e)}prependMatrix(e){this._transform.prepend(e)}prependTranslation(e,t){(e||t)&&this._transform.prependTranslation(e,t)}setMatrix(e){this._transform.setMatrix(e)}set matrix(e){this.setMatrix(e)}get matrix(){return this.getMatrix()}getMatrix(){return this._transform.getMatrix()}getTransform(){return this._transform}get transform(){return this.getTransform()}resetTransform(){this.setMatrix(Le.Z.IDENTITY)}onTransformChange(){this.invalidateBounds(),this._picker.onTransformChange(),this.transformEmitter.emit()}onSummaryChange(e,t){this._pdomDisplaysInfo.onSummaryChange(e,t)}updateMaxDimension(e){const t=this._appliedScaleFactor;let i=1;if(null!==this._maxWidth){const t=e.width;t>this._maxWidth&&(i=Math.min(i,this._maxWidth/t))}if(null!==this._maxHeight){const t=e.height;t>this._maxHeight&&(i=Math.min(i,this._maxHeight/t))}const s=i/t;1!==s&&(this._appliedScaleFactor=i,this.scale(s))}auditMaxDimensions(){}onMaxDimensionChange(e,t){null===e&&null!==t?(this.changeBoundsEventCount(1),this._boundsEventSelfCount++):null!==e&&null===t&&(this.changeBoundsEventCount(-1),this._boundsEventSelfCount--)}setMaxWidth(e){this._maxWidth!==e&&(this.onMaxDimensionChange(this._maxWidth,e),this._maxWidth=e,this.updateMaxDimension(this.localBoundsProperty.value))}set maxWidth(e){this.setMaxWidth(e)}get maxWidth(){return this.getMaxWidth()}getMaxWidth(){return this._maxWidth}setMaxHeight(e){this._maxHeight!==e&&(this.onMaxDimensionChange(this._maxHeight,e),this._maxHeight=e,this.updateMaxDimension(this.localBoundsProperty.value))}set maxHeight(e){this.setMaxHeight(e)}get maxHeight(){return this.getMaxHeight()}getMaxHeight(){return this._maxHeight}setLeft(e){const t=this.getLeft();return isFinite(t)&&this.translate(e-t,0,!0),this}set left(e){this.setLeft(e)}get left(){return this.getLeft()}getLeft(){return this.getBounds().minX}setRight(e){const t=this.getRight();return isFinite(t)&&this.translate(e-t,0,!0),this}set right(e){this.setRight(e)}get right(){return this.getRight()}getRight(){return this.getBounds().maxX}setCenterX(e){const t=this.getCenterX();return isFinite(t)&&this.translate(e-t,0,!0),this}set centerX(e){this.setCenterX(e)}get centerX(){return this.getCenterX()}getCenterX(){return this.getBounds().getCenterX()}setCenterY(e){const t=this.getCenterY();return isFinite(t)&&this.translate(0,e-t,!0),this}set centerY(e){this.setCenterY(e)}get centerY(){return this.getCenterY()}getCenterY(){return this.getBounds().getCenterY()}setTop(e){const t=this.getTop();return isFinite(t)&&this.translate(0,e-t,!0),this}set top(e){this.setTop(e)}get top(){return this.getTop()}getTop(){return this.getBounds().minY}setBottom(e){const t=this.getBottom();return isFinite(t)&&this.translate(0,e-t,!0),this}set bottom(e){this.setBottom(e)}get bottom(){return this.getBottom()}getBottom(){return this.getBounds().maxY}setLeftTop(e){const t=this.getLeftTop();return t.isFinite()&&this.translate(e.minus(t),!0),this}set leftTop(e){this.setLeftTop(e)}get leftTop(){return this.getLeftTop()}getLeftTop(){return this.getBounds().getLeftTop()}setCenterTop(e){const t=this.getCenterTop();return t.isFinite()&&this.translate(e.minus(t),!0),this}set centerTop(e){this.setCenterTop(e)}get centerTop(){return this.getCenterTop()}getCenterTop(){return this.getBounds().getCenterTop()}setRightTop(e){const t=this.getRightTop();return t.isFinite()&&this.translate(e.minus(t),!0),this}set rightTop(e){this.setRightTop(e)}get rightTop(){return this.getRightTop()}getRightTop(){return this.getBounds().getRightTop()}setLeftCenter(e){const t=this.getLeftCenter();return t.isFinite()&&this.translate(e.minus(t),!0),this}set leftCenter(e){this.setLeftCenter(e)}get leftCenter(){return this.getLeftCenter()}getLeftCenter(){return this.getBounds().getLeftCenter()}setCenter(e){const t=this.getCenter();return t.isFinite()&&this.translate(e.minus(t),!0),this}set center(e){this.setCenter(e)}get center(){return this.getCenter()}getCenter(){return this.getBounds().getCenter()}setRightCenter(e){const t=this.getRightCenter();return t.isFinite()&&this.translate(e.minus(t),!0),this}set rightCenter(e){this.setRightCenter(e)}get rightCenter(){return this.getRightCenter()}getRightCenter(){return this.getBounds().getRightCenter()}setLeftBottom(e){const t=this.getLeftBottom();return t.isFinite()&&this.translate(e.minus(t),!0),this}set leftBottom(e){this.setLeftBottom(e)}get leftBottom(){return this.getLeftBottom()}getLeftBottom(){return this.getBounds().getLeftBottom()}setCenterBottom(e){const t=this.getCenterBottom();return t.isFinite()&&this.translate(e.minus(t),!0),this}set centerBottom(e){this.setCenterBottom(e)}get centerBottom(){return this.getCenterBottom()}getCenterBottom(){return this.getBounds().getCenterBottom()}setRightBottom(e){const t=this.getRightBottom();return t.isFinite()&&this.translate(e.minus(t),!0),this}set rightBottom(e){this.setRightBottom(e)}get rightBottom(){return this.getRightBottom()}getRightBottom(){return this.getBounds().getRightBottom()}getWidth(){return this.getBounds().getWidth()}get width(){return this.getWidth()}getHeight(){return this.getBounds().getHeight()}get height(){return this.getHeight()}getLocalWidth(){return this.getLocalBounds().getWidth()}get localWidth(){return this.getLocalWidth()}getLocalHeight(){return this.getLocalBounds().getHeight()}get localHeight(){return this.getLocalHeight()}getLocalLeft(){return this.getLocalBounds().minX}get localLeft(){return this.getLocalLeft()}getLocalRight(){return this.getLocalBounds().maxX}get localRight(){return this.getLocalRight()}getLocalCenterX(){return this.getLocalBounds().getCenterX()}get localCenterX(){return this.getLocalCenterX()}getLocalCenterY(){return this.getLocalBounds().getCenterY()}get localCenterY(){return this.getLocalCenterY()}getLocalTop(){return this.getLocalBounds().minY}get localTop(){return this.getLocalTop()}getLocalBottom(){return this.getLocalBounds().maxY}get localBottom(){return this.getLocalBottom()}getLocalLeftTop(){return this.getLocalBounds().getLeftTop()}get localLeftTop(){return this.getLocalLeftTop()}getLocalCenterTop(){return this.getLocalBounds().getCenterTop()}get localCenterTop(){return this.getLocalCenterTop()}getLocalRightTop(){return this.getLocalBounds().getRightTop()}get localRightTop(){return this.getLocalRightTop()}getLocalLeftCenter(){return this.getLocalBounds().getLeftCenter()}get localLeftCenter(){return this.getLocalLeftCenter()}getLocalCenter(){return this.getLocalBounds().getCenter()}get localCenter(){return this.getLocalCenter()}getLocalRightCenter(){return this.getLocalBounds().getRightCenter()}get localRightCenter(){return this.getLocalRightCenter()}getLocalLeftBottom(){return this.getLocalBounds().getLeftBottom()}get localLeftBottom(){return this.getLocalLeftBottom()}getLocalCenterBottom(){return this.getLocalBounds().getCenterBottom()}get localCenterBottom(){return this.getLocalCenterBottom()}getLocalRightBottom(){return this.getLocalBounds().getRightBottom()}get localRightBottom(){return this.getLocalRightBottom()}getId(){return this._id}get id(){return this.getId()}onVisiblePropertyChange(e){this._picker.onVisibilityChange(),this._pdomDisplaysInfo.onVisibilityChange(e);for(let t=0;t<this._parents.length;t++){const e=this._parents[t];e._excludeInvisibleChildrenFromBounds&&e.invalidateChildBounds()}}setVisibleProperty(e){return this._visibleProperty.setTargetProperty(this,"visibleProperty",e)}set visibleProperty(e){this.setVisibleProperty(e)}get visibleProperty(){return this.getVisibleProperty()}getVisibleProperty(){return this._visibleProperty}setVisible(e){return this.visibleProperty.set(e),this}set visible(e){this.setVisible(e)}get visible(){return this.isVisible()}isVisible(){return this.visibleProperty.value}setPhetioVisiblePropertyInstrumented(e){return this._visibleProperty.setTargetPropertyInstrumented(e,this)}set phetioVisiblePropertyInstrumented(e){this.setPhetioVisiblePropertyInstrumented(e)}get phetioVisiblePropertyInstrumented(){return this.getPhetioVisiblePropertyInstrumented()}getPhetioVisiblePropertyInstrumented(){return this._visibleProperty.getTargetPropertyInstrumented()}swapVisibility(e){const t=this.visible?this:e,i=this.visible?e:this,s=t.focused;return t.visible=!1,i.visible=!0,s&&i.focusable&&i.focus(),this}setOpacity(e){if(e<0||e>1)throw new Error("opacity out of range: "+e);this.opacityProperty.value=e}set opacity(e){this.setOpacity(e)}get opacity(){return this.getOpacity()}getOpacity(){return this.opacityProperty.value}setDisabledOpacity(e){if(e<0||e>1)throw new Error("disabledOpacity out of range: "+e);return this.disabledOpacityProperty.value=e,this}set disabledOpacity(e){this.setDisabledOpacity(e)}get disabledOpacity(){return this.getDisabledOpacity()}getDisabledOpacity(){return this.disabledOpacityProperty.value}getEffectiveOpacity(){return this.opacityProperty.value*(this.enabledProperty.value?1:this.disabledOpacityProperty.value)}get effectiveOpacity(){return this.getEffectiveOpacity()}onOpacityPropertyChange(){this.filterChangeEmitter.emit()}onDisabledOpacityPropertyChange(){this._enabledProperty.value||this.filterChangeEmitter.emit()}setFilters(e){this._filters.length=0,this._filters.push(...e),this.invalidateHint(),this.filterChangeEmitter.emit()}set filters(e){this.setFilters(e)}get filters(){return this.getFilters()}getFilters(){return this._filters.slice()}setPickableProperty(e){return this._pickableProperty.setTargetProperty(this,null,e)}set pickableProperty(e){this.setPickableProperty(e)}get pickableProperty(){return this.getPickableProperty()}getPickableProperty(){return this._pickableProperty}setPickable(e){return this._pickableProperty.set(e),this}set pickable(e){this.setPickable(e)}get pickable(){return this.isPickable()}isPickable(){return this._pickableProperty.value}onPickablePropertyChange(e,t){this._picker.onPickableChange(t,e)}setEnabledProperty(e){return this._enabledProperty.setTargetProperty(this,Rs,e)}set enabledProperty(e){this.setEnabledProperty(e)}get enabledProperty(){return this.getEnabledProperty()}getEnabledProperty(){return this._enabledProperty}setPhetioEnabledPropertyInstrumented(e){return this._enabledProperty.setTargetPropertyInstrumented(e,this)}set phetioEnabledPropertyInstrumented(e){this.setPhetioEnabledPropertyInstrumented(e)}get phetioEnabledPropertyInstrumented(){return this.getPhetioEnabledPropertyInstrumented()}getPhetioEnabledPropertyInstrumented(){return this._enabledProperty.getTargetPropertyInstrumented()}setEnabled(e){return this._enabledProperty.set(e),this}set enabled(e){this.setEnabled(e)}get enabled(){return this.isEnabled()}isEnabled(){return this._enabledProperty.value}onEnabledPropertyChange(e){!e&&this.interruptSubtreeInput(),this.inputEnabled=e,1!==this.disabledOpacityProperty.value&&this.filterChangeEmitter.emit()}setInputEnabledProperty(e){return this._inputEnabledProperty.setTargetProperty(this,"inputEnabledProperty",e)}set inputEnabledProperty(e){this.setInputEnabledProperty(e)}get inputEnabledProperty(){return this.getInputEnabledProperty()}getInputEnabledProperty(){return this._inputEnabledProperty}setPhetioInputEnabledPropertyInstrumented(e){return this._inputEnabledProperty.setTargetPropertyInstrumented(e,this)}set phetioInputEnabledPropertyInstrumented(e){this.setPhetioInputEnabledPropertyInstrumented(e)}get phetioInputEnabledPropertyInstrumented(){return this.getPhetioInputEnabledPropertyInstrumented()}getPhetioInputEnabledPropertyInstrumented(){return this._inputEnabledProperty.getTargetPropertyInstrumented()}setInputEnabled(e){this.inputEnabledProperty.value=e}set inputEnabled(e){this.setInputEnabled(e)}get inputEnabled(){return this.isInputEnabled()}isInputEnabled(){return this.inputEnabledProperty.value}setInputListeners(e){for(;this._inputListeners.length;)this.removeInputListener(this._inputListeners[0]);for(let t=0;t<e.length;t++)this.addInputListener(e[t]);return this}set inputListeners(e){this.setInputListeners(e)}get inputListeners(){return this.getInputListeners()}getInputListeners(){return this._inputListeners.slice(0)}setCursor(e){this._cursor="auto"===e?null:e}set cursor(e){this.setCursor(e)}get cursor(){return this.getCursor()}getCursor(){return this._cursor}getEffectiveCursor(){if(this._cursor)return this._cursor;for(let e=0;e<this._inputListeners.length;e++){const t=this._inputListeners[e];if(t.cursor)return t.cursor}return null}setMouseArea(e){return this._mouseArea!==e&&(this._mouseArea=e,this._picker.onMouseAreaChange()),this}set mouseArea(e){this.setMouseArea(e)}get mouseArea(){return this.getMouseArea()}getMouseArea(){return this._mouseArea}setTouchArea(e){return this._touchArea!==e&&(this._touchArea=e,this._picker.onTouchAreaChange()),this}set touchArea(e){this.setTouchArea(e)}get touchArea(){return this.getTouchArea()}getTouchArea(){return this._touchArea}setClipArea(e){this.clipArea!==e&&(this.clipAreaProperty.value=e,this.invalidateBounds(),this._picker.onClipAreaChange())}set clipArea(e){this.setClipArea(e)}get clipArea(){return this.getClipArea()}getClipArea(){return this.clipAreaProperty.value}hasClipArea(){return null!==this.clipArea}setRendererBitmask(e){e!==this._rendererBitmask&&(this._rendererBitmask=e,this._rendererSummary.selfChange(),this.instanceRefreshEmitter.emit())}invalidateSupportedRenderers(){}invalidateHint(){this.rendererSummaryRefreshEmitter.emit(),this.instanceRefreshEmitter.emit()}setRenderer(e){let t=0;"canvas"===e?t=Te.bitmaskCanvas:"svg"===e?t=Te.bitmaskSVG:"dom"===e?t=Te.bitmaskDOM:"webgl"===e&&(t=Te.bitmaskWebGL),this._renderer!==t&&(this._renderer=t,this.invalidateHint())}set renderer(e){this.setRenderer(e)}get renderer(){return this.getRenderer()}getRenderer(){return 0===this._renderer?null:this._renderer===Te.bitmaskCanvas?"canvas":this._renderer===Te.bitmaskSVG?"svg":this._renderer===Te.bitmaskDOM?"dom":this._renderer===Te.bitmaskWebGL?"webgl":null}setLayerSplit(e){e!==this._layerSplit&&(this._layerSplit=e,this.invalidateHint())}set layerSplit(e){this.setLayerSplit(e)}get layerSplit(){return this.isLayerSplit()}isLayerSplit(){return this._layerSplit}setUsesOpacity(e){e!==this._usesOpacity&&(this._usesOpacity=e,this.invalidateHint())}set usesOpacity(e){this.setUsesOpacity(e)}get usesOpacity(){return this.getUsesOpacity()}getUsesOpacity(){return this._usesOpacity}setCSSTransform(e){e!==this._cssTransform&&(this._cssTransform=e,this.invalidateHint())}set cssTransform(e){this.setCSSTransform(e)}get cssTransform(){return this.isCSSTransformed()}isCSSTransformed(){return this._cssTransform}setExcludeInvisible(e){e!==this._excludeInvisible&&(this._excludeInvisible=e,this.invalidateHint())}set excludeInvisible(e){this.setExcludeInvisible(e)}get excludeInvisible(){return this.isExcludeInvisible()}isExcludeInvisible(){return this._excludeInvisible}setExcludeInvisibleChildrenFromBounds(e){e!==this._excludeInvisibleChildrenFromBounds&&(this._excludeInvisibleChildrenFromBounds=e,this.invalidateBounds())}set excludeInvisibleChildrenFromBounds(e){this.setExcludeInvisibleChildrenFromBounds(e)}get excludeInvisibleChildrenFromBounds(){return this.isExcludeInvisibleChildrenFromBounds()}isExcludeInvisibleChildrenFromBounds(){return this._excludeInvisibleChildrenFromBounds}setLayoutOptions(e){e!==this._layoutOptions&&(this._layoutOptions=e,this.layoutOptionsChangedEmitter.emit())}set layoutOptions(e){this.setLayoutOptions(e)}get layoutOptions(){return this.getLayoutOptions()}getLayoutOptions(){return this._layoutOptions}mutateLayoutOptions(e){this.layoutOptions=(0,Ce.lB)()({},this.layoutOptions||{},e)}get widthSizable(){return!1}get heightSizable(){return!1}get extendsWidthSizable(){return!1}get extendsHeightSizable(){return!1}get extendsSizable(){return!1}setPreventFit(e){e!==this._preventFit&&(this._preventFit=e,this.invalidateHint())}set preventFit(e){this.setPreventFit(e)}get preventFit(){return this.isPreventFit()}isPreventFit(){return this._preventFit}setWebGLScale(e){e!==this._webglScale&&(this._webglScale=e,this.invalidateHint())}set webglScale(e){this.setWebGLScale(e)}get webglScale(){return this.getWebGLScale()}getWebGLScale(){return this._webglScale}getUniqueTrail(e){if(e){const t=this.getTrails(e);return t[0]}{const e=new pn;let t=this;for(;t;)e.addAncestor(t),t=t._parents[0];return e}}getUniqueTrailTo(e){return this.getUniqueTrail(t=>e===t)}getTrails(e){e=e||Os.defaultTrailPredicate;const t=[],i=new pn(this);return pn.appendAncestorTrailsWithPredicate(t,i,e),t}getTrailsTo(e){return this.getTrails(t=>t===e)}getLeafTrails(e){e=e||Os.defaultLeafTrailPredicate;const t=[],i=new pn(this);return pn.appendDescendantTrailsWithPredicate(t,i,e),t}getLeafTrailsTo(e){return this.getLeafTrails(t=>t===e)}getUniqueLeafTrail(e){const t=this.getLeafTrails(e);return t[0]}getUniqueLeafTrailTo(e){return this.getUniqueLeafTrail(t=>t===e)}getConnectedNodes(){const e=[];let t=this._children.concat(this._parents).concat(this);for(;t.length;){const i=t.pop();_.includes(e,i)||(e.push(i),t=t.concat(i._children,i._parents))}return e}getSubtreeNodes(){const e=[];let t=this._children.concat(this);for(;t.length;){const i=t.pop();_.includes(e,i)||(e.push(i),t=t.concat(i._children))}return e}getTopologicallySortedNodes(){const e={},t=[],i=[];let s;function n(i){delete e[s.id][i.id],_.every(e,e=>!e[i.id])&&t.push(i)}for(_.each(this.getConnectedNodes(),i=>{e[i.id]={},_.each(i._children,t=>{e[i.id][t.id]=!0}),i.parents.length||t.push(i)});t.length;)s=t.pop(),i.push(s),_.each(s._children,n);return i}canAddChild(e){if(this===e||_.includes(this._children,e))return!1;const t={},i=[],s=[];let n;function r(e){delete t[n.id][e.id],_.every(t,t=>!t[e.id])&&i.push(e)}for(_.each(this.getConnectedNodes().concat(e.getConnectedNodes()),s=>{t[s.id]={},_.each(s._children,e=>{t[s.id][e.id]=!0}),s.parents.length||s===e||i.push(s)}),t[this.id][e.id]=!0;i.length;)n=i.pop(),s.push(n),_.each(n._children,r),n===this&&r(e);return _.every(t,e=>_.every(e,e=>!1))}canvasPaintSelf(e,t){}renderToCanvasSelf(e,t){this.isPainted()&&this._rendererBitmask&Te.bitmaskCanvas&&this.canvasPaintSelf(e,t)}renderToCanvasSubtree(e,t){t=t||Le.Z.identity(),e.resetStyles(),this.renderToCanvasSelf(e,t);for(let i=0;i<this._children.length;i++){const s=this._children[i];if(s.isVisible()&&s.bounds.isValid()){const i=1!==s.effectiveOpacity||s.clipArea||s._filters.length;if(e.context.save(),t.multiplyMatrix(s._transform.getMatrix()),t.canvasSetTransform(e.context),i){const i=s.localBounds.transformed(t).dilate(4).roundOut().constrainBounds(ks.setMinMax(0,0,e.canvas.width,e.canvas.height));if(i.width>0&&i.height>0){const n=document.createElement("canvas");n.width=i.width,n.height=i.height;const r=n.getContext("2d"),o=new Dt(n,r),A=t.copy().prependTranslation(-i.minX,-i.minY);A.canvasSetTransform(r),s.renderToCanvasSubtree(o,A),e.context.save(),s.clipArea&&(e.context.beginPath(),s.clipArea.writeToContext(e.context),e.context.clip()),e.context.setTransform(1,0,0,1,0,0),e.context.globalAlpha=s.effectiveOpacity;let a=!1;s._filters.length&&(we.canvasFilter&&_.every(s._filters,e=>e.isDOMCompatible())?(e.context.filter=s._filters.map(e=>e.getCSSFilterString()).join(" "),a=!0):s._filters.forEach(e=>e.applyCanvasFilter(o))),e.context.drawImage(n,i.minX,i.minY),e.context.restore(),a&&(e.context.filter="none")}}else s.renderToCanvasSubtree(e,t);t.multiplyMatrix(s._transform.getInverse()),e.context.restore()}}}renderToCanvas(e,t,i,s){e.width=e.width,s&&(t.fillStyle=s,t.fillRect(0,0,e.width,e.height));const n=new Dt(e,t);this.renderToCanvasSubtree(n,Le.Z.identity()),i&&i()}toCanvas(e,t,i,s,n){const r=this.getBounds().union(this.localToParentBounds(this.getSafeSelfBounds()));t=void 0!==t?t:Math.ceil(2-r.minX),i=void 0!==i?i:Math.ceil(2-r.minY),s=void 0!==s?s:Math.ceil(r.getWidth()+4),n=void 0!==n?n:Math.ceil(r.getHeight()+4);const o=document.createElement("canvas");o.width=s,o.height=n;const A=o.getContext("2d");A.translate(t,i),this._transform.getMatrix().canvasAppendTransform(A);const a=new Dt(o,A);this.renderToCanvasSubtree(a,Le.Z.translation(t,i).timesMatrix(this._transform.getMatrix())),e(o,t,i,s,n)}toDataURL(e,t,i,s,n){this.toCanvas((t,i,s,n,r)=>{e(t.toDataURL(),i,s,n,r)},t,i,s,n)}toImage(e,t,i,s,n){this.toDataURL((t,i,s)=>{const n=document.createElement("img");n.onload=()=>{e(n,i,s);try{delete n.onload}catch(t){}},n.src=t},t,i,s,n)}toImageNodeAsynchronous(e,t,i,s,n){this.toImage((t,i,s)=>{e(new Os({children:[new Pn(t,{x:-i,y:-s})]}))},t,i,s,n)}toCanvasNodeSynchronous(e,t,i,s){let n=null;return this.toCanvas((e,t,i)=>{n=new Os({children:[new Pn(e,{x:-t,y:-i})]})},e,t,i,s),n}toDataURLImageSynchronous(e,t,i,s){let n=null;return this.toDataURL((e,t,i,s,r)=>{n=new Pn(e,{x:-t,y:-i,initialWidth:s,initialHeight:r})},e,t,i,s),n}toDataURLNodeSynchronous(e,t,i,s){return new Os({children:[this.toDataURLImageSynchronous(e,t,i,s)]})}rasterized(e){const t=(0,Ce.ZP)()({resolution:1,sourceBounds:null,useTargetBounds:!0,wrap:!0,useCanvas:!1,imageOptions:{}},e),i=t.resolution,s=t.sourceBounds;const n=new Os({scale:i,children:[this]});let r=s||this.getSafeTransformedVisibleBounds().dilated(2).roundedOut();1!==i&&(r=new Ue.Z(i*r.minX,i*r.minY,i*r.maxX,i*r.maxY),r.width%1!=0&&(r.maxX+=1-r.width%1),r.height%1!=0&&(r.maxY+=1-r.height%1));let o=null;n.toCanvas((function(e,s,n,r,A){const a=t.useCanvas?e:e.toDataURL();o=new Pn(a,(0,Ce.JA)({},t.imageOptions,{x:-s,y:-n,initialWidth:r,initialHeight:A})),o.scale(1/i,1/i,!0)}),-r.minX,-r.minY,ie.Z.roundSymmetric(r.width),ie.Z.roundSymmetric(r.height)),n.dispose();let A=this.getVisibleBounds();if(s&&(A=s.intersection(A)),t.useTargetBounds&&(o.imageBounds=o.parentToLocalBounds(A)),t.wrap){const e=new Os({children:[o]});return t.useTargetBounds&&(e.localBounds=A),e}return t.useTargetBounds&&(o.localBounds=o.parentToLocalBounds(A)),o}createDOMDrawable(e,t){throw new Error("createDOMDrawable is abstract. The subtype should either override this method, or not support the DOM renderer")}createSVGDrawable(e,t){throw new Error("createSVGDrawable is abstract. The subtype should either override this method, or not support the DOM renderer")}createCanvasDrawable(e,t){throw new Error("createCanvasDrawable is abstract. The subtype should either override this method, or not support the DOM renderer")}createWebGLDrawable(e,t){throw new Error("createWebGLDrawable is abstract. The subtype should either override this method, or not support the DOM renderer")}getInstances(){return this._instances}get instances(){return this.getInstances()}addInstance(e){this._instances.push(e),this.changedInstanceEmitter.emit(e,!0)}removeInstance(e){const t=_.indexOf(this._instances,e);this._instances.splice(t,1),this.changedInstanceEmitter.emit(e,!1)}wasVisuallyDisplayed(e){for(let t=0;t<this._instances.length;t++){const i=this._instances[t];if(i.visible&&(!e||i.display===e))return!0}return!1}getRootedDisplays(){return this._rootedDisplays}get rootedDisplays(){return this.getRootedDisplays()}addRootedDisplay(e){this._rootedDisplays.push(e),this._pdomDisplaysInfo.onAddedRootedDisplay(e)}removeRootedDisplay(e){const t=_.indexOf(this._rootedDisplays,e);this._rootedDisplays.splice(t,1),this._pdomDisplaysInfo.onRemovedRootedDisplay(e)}getRecursiveConnectedDisplays(e){this.rootedDisplays.length&&e.push(...this.rootedDisplays);for(let t=0;t<this._parents.length;t++)e.push(...this._parents[t].getRecursiveConnectedDisplays(e));return _.uniq(e)}getConnectedDisplays(){return _.uniq(this.getRecursiveConnectedDisplays([]))}localToParentPoint(e){return this._transform.transformPosition2(e)}localToParentBounds(e){return this._transform.transformBounds2(e)}parentToLocalPoint(e){return this._transform.inversePosition2(e)}parentToLocalBounds(e){return this._transform.inverseBounds2(e)}transformBoundsFromLocalToParent(e){return e.transform(this._transform.getMatrix())}transformBoundsFromParentToLocal(e){return e.transform(this._transform.getInverse())}getLocalToGlobalMatrix(){let e=this;const t=[];for(;e;)t.push(e._transform.getMatrix()),e=e._parents[0];const i=Le.Z.identity();for(let s=t.length-1;s>=0;s--)i.multiplyMatrix(t[s]);return i}getUniqueTransform(){return new Pe.Z(this.getLocalToGlobalMatrix())}getGlobalToLocalMatrix(){return this.getLocalToGlobalMatrix().invert()}localToGlobalPoint(e){let t=this;const i=e.copy();for(;t;)t._transform.getMatrix().multiplyVector2(i),t=t._parents[0];return i}globalToLocalPoint(e){let t=this;const i=[];for(;t;)i.push(t._transform),t=t._parents[0];const s=e.copy();for(let n=i.length-1;n>=0;n--)i[n].getInverse().multiplyVector2(s);return s}localToGlobalBounds(e){return e.transformed(this.getLocalToGlobalMatrix())}globalToLocalBounds(e){return e.transformed(this.getGlobalToLocalMatrix())}parentToGlobalPoint(e){return this.parents.length?this.parents[0].localToGlobalPoint(e):e}parentToGlobalBounds(e){return this.parents.length?this.parents[0].localToGlobalBounds(e):e}globalToParentPoint(e){return this.parents.length?this.parents[0].globalToLocalPoint(e):e}globalToParentBounds(e){return this.parents.length?this.parents[0].globalToLocalBounds(e):e}getGlobalBounds(){return this.parentToGlobalBounds(this.getBounds())}get globalBounds(){return this.getGlobalBounds()}boundsOf(e){return this.globalToLocalBounds(e.getGlobalBounds())}boundsTo(e){return e.globalToLocalBounds(this.getGlobalBounds())}attachDrawable(e){return this._drawables.push(e),this}detachDrawable(e){const t=_.indexOf(this._drawables,e);return this._drawables.splice(t,1),this}mutate(e){if(!e)return this;const t=this._mutatorKeys;for(let i=0;i<t.length;i++){const s=t[i];if(void 0!==e[s]){const t=Object.getOwnPropertyDescriptor(Os.prototype,s);t&&"function"==typeof t.value?this[s](e[s]):this[s]=e[s]}}return this.initializePhetioObject(fs,e),this}initializePhetioObject(e,t){const i=this.isPhetioInstrumented();super.initializePhetioObject(e,t),Kt.Z.PHET_IO_ENABLED&&!i&&this.isPhetioInstrumented()&&(this._visibleProperty.initializePhetio(this,"visibleProperty",()=>new bt.Z(this.visible,(0,Ce.JA)({phetioReadOnly:this.phetioReadOnly,tandem:this.tandem.createTandem("visibleProperty"),phetioDocumentation:"Controls whether the Node will be visible (and interactive)."},t.visiblePropertyOptions))),this._enabledProperty.initializePhetio(this,Rs,()=>new Gs.Z(this.enabled,(0,Ce.JA)({phetioReadOnly:this.phetioReadOnly,phetioDocumentation:'Sets whether the node is enabled. This will set whether input is enabled for this Node and most often children as well. It will also control and toggle the "disabled look" of the node.',tandem:this.tandem.createTandem(Rs)},t.enabledPropertyOptions))),this._inputEnabledProperty.initializePhetio(this,"inputEnabledProperty",()=>new yt.Z(this.inputEnabled,(0,Ce.JA)({phetioReadOnly:this.phetioReadOnly,tandem:this.tandem.createTandem("inputEnabledProperty"),phetioValueType:ut.Z,phetioFeatured:!0,phetioDocumentation:"Sets whether the element will have input enabled, and hence be interactive."},t.inputEnabledPropertyOptions))))}setVoicingVisible(e){this.voicingVisibleProperty.value!==e&&(this.voicingVisibleProperty.value=e)}set voicingVisible(e){this.setVoicingVisible(e)}get voicingVisible(){return this.isVoicingVisible()}isVoicingVisible(){return this.voicingVisibleProperty.value}getDebugHTMLExtras(){return""}inspect(){localStorage.scenerySnapshot=JSON.stringify({type:"Subtree",rootNodeId:this.id,nodes:Il(this)})}toString(e,t){return`${this.constructor.name}#${this.id}`}auditInstanceSubtreeForDisplay(e){0}onBoundsListenersAddedOrRemoved(e){this.changeBoundsEventCount(e),this._boundsEventSelfCount+=e}dispose(){this.disposeParallelDOM(),this.removeAllChildren(),this.detach(),this._inputEnabledProperty.dispose(),this._enabledProperty.dispose(),this._pickableProperty.dispose(),this._visibleProperty.dispose(),super.dispose()}disposeSubtree(){if(!this.isDisposed){const e=this.children;this.dispose();for(let t=0;t<e.length;t++)e[t].disposeSubtree()}}static defaultTrailPredicate(e){return 0===e._parents.length}static defaultLeafTrailPredicate(e){return 0===e._children.length}}_defineProperty(Os,"REQUIRES_BOUNDS_OPTION_KEYS",Us),_defineProperty(Os,"DEFAULT_NODE_OPTIONS",Ps),Os.prototype._mutatorKeys=Is.concat(Ls),Os.prototype.drawableMarkFlags=[],W.register("Node",Os),Os.NodeIO=new se.Z("NodeIO",{valueType:Os,documentation:"The base type for graphical and potentially interactive objects.",metadataDefaults:{phetioState:!1}});const fs={phetioType:Os.NodeIO,phetioState:!1},Zs=Os;class Ns{constructor(e){this.node=e,this.selfPruned=!1,this.selfInclusive=!1,this.subtreePrunable=!0,this.subtreePickableCount=0,this.mouseInclusiveBounds=Ue.Z.NOTHING.copy(),this.mouseExclusiveBounds=Ue.Z.NOTHING.copy(),this.touchInclusiveBounds=Ue.Z.NOTHING.copy(),this.touchExclusiveBounds=Ue.Z.NOTHING.copy(),this.mouseInclusiveDirty=!0,this.mouseExclusiveDirty=!0,this.touchInclusiveDirty=!0,this.touchExclusiveDirty=!0,this.scratchVector=new be.Z(0,0)}hitTest(e,t,i){const s=this.selfInclusive;return t?s?this.validateMouseInclusive():this.validateMouseExclusive():i?s?this.validateTouchInclusive():this.validateTouchExclusive():this.node.validateBounds(),this.recursiveHitTest(e,t,i,!1)}recursiveHitTest(e,t,i,s){if(s=s||this.selfInclusive,this.selfPruned||!s&&this.subtreePrunable)return null;let n;if(n=t?s?this.mouseInclusiveBounds:this.mouseExclusiveBounds:i?s?this.touchInclusiveBounds:this.touchExclusiveBounds:this.node.bounds,!n.containsPoint(e))return null;const r=this.node._transform.getInverse().multiplyVector2(this.scratchVector.set(e)),o=this.node.clipArea;if(null!==o&&!o.containsPoint(r))return null;for(let A=this.node._children.length-1;A>=0;A--){const e=this.node._children[A]._picker.recursiveHitTest(r,t,i,s);if(e)return e.addAncestor(this.node,A)}return t&&this.node._mouseArea?this.node._mouseArea.containsPoint(r)?new pn(this.node):null:i&&this.node._touchArea?this.node._touchArea.containsPoint(r)?new pn(this.node):null:this.node.selfBounds.containsPoint(r)&&this.node.containsPointSelf(r)?new pn(this.node):null}invalidate(e,t){let i=!!t||!this.mouseInclusiveDirty||!this.touchInclusiveDirty;if(this.mouseInclusiveDirty=!0,this.touchInclusiveDirty=!0,e&&(i=i||!this.mouseExclusiveDirty||!this.touchExclusiveDirty,this.mouseExclusiveDirty=!0,this.touchExclusiveDirty=!0),!this.selfPruned&&i){const t=this.node._parents;for(let i=0;i<t.length;i++)t[i]._picker.invalidate(e||this.selfInclusive,!1)}}validateMouseInclusive(){if(!this.mouseInclusiveDirty)return;this.mouseInclusiveBounds.set(this.node.selfBounds);const e=this.node._children;for(let t=0;t<e.length;t++){const i=e[t]._picker;i.selfPruned||(i.validateMouseInclusive(),this.mouseInclusiveBounds.includeBounds(i.mouseInclusiveBounds))}this.applyAreasAndTransform(this.mouseInclusiveBounds,this.node._mouseArea),this.mouseInclusiveDirty=!1}validateMouseExclusive(){if(!this.mouseExclusiveDirty)return;this.mouseExclusiveBounds.set(this.node.selfBounds);const e=this.node._children;for(let t=0;t<e.length;t++){const i=e[t]._picker;i.subtreePrunable||(i.selfInclusive?(i.validateMouseInclusive(),this.mouseExclusiveBounds.includeBounds(i.mouseInclusiveBounds)):(i.validateMouseExclusive(),this.mouseExclusiveBounds.includeBounds(i.mouseExclusiveBounds)))}this.applyAreasAndTransform(this.mouseExclusiveBounds,this.node._mouseArea),this.mouseExclusiveDirty=!1}validateTouchInclusive(){if(!this.touchInclusiveDirty)return;this.touchInclusiveBounds.set(this.node.selfBounds);const e=this.node._children;for(let t=0;t<e.length;t++){const i=e[t]._picker;i.selfPruned||(i.validateTouchInclusive(),this.touchInclusiveBounds.includeBounds(i.touchInclusiveBounds))}this.applyAreasAndTransform(this.touchInclusiveBounds,this.node._touchArea),this.touchInclusiveDirty=!1}validateTouchExclusive(){if(!this.touchExclusiveDirty)return;this.touchExclusiveBounds.set(this.node.selfBounds);const e=this.node._children;for(let t=0;t<e.length;t++){const i=e[t]._picker;i.subtreePrunable||(i.selfInclusive?(i.validateTouchInclusive(),this.touchExclusiveBounds.includeBounds(i.touchInclusiveBounds)):(i.validateTouchExclusive(),this.touchExclusiveBounds.includeBounds(i.touchExclusiveBounds)))}this.applyAreasAndTransform(this.touchExclusiveBounds,this.node._touchArea),this.touchExclusiveDirty=!1}applyAreasAndTransform(e,t){t&&e.includeBounds(t instanceof Ue.Z?t:t.bounds);const i=this.node.clipArea;if(i){const t=i.bounds;e.minX=Math.max(e.minX,t.minX),e.minY=Math.max(e.minY,t.minY),e.maxX=Math.min(e.maxX,t.maxX),e.maxY=Math.min(e.maxY,t.maxY)}this.node.transformBoundsFromLocalToParent(e)}onInsertChild(e){if(!e._picker.selfPruned){const t=e._picker.subtreePickableCount>0;t&&this.changePickableCount(1),this.invalidate(t,!0)}}onRemoveChild(e){if(!e._picker.selfPruned){const t=e._picker.subtreePickableCount>0;t&&this.changePickableCount(-1),this.invalidate(t,!0)}}onAddInputListener(){this.checkSelfInclusive(),this.checkSubtreePrunable(),this.changePickableCount(1)}onRemoveInputListener(){this.checkSelfInclusive(),this.checkSubtreePrunable(),this.changePickableCount(-1)}onPickableChange(e,t){this.checkSelfPruned(),this.checkSelfInclusive(),this.checkSubtreePrunable();const i=(!0===e?-1:0)+(!0===t?1:0);i&&this.changePickableCount(i)}onVisibilityChange(){this.checkSelfPruned(),this.checkSubtreePrunable()}onMouseAreaChange(){this.invalidate(!0)}onTouchAreaChange(){this.invalidate(!0)}onTransformChange(){this.invalidate(!0)}onSelfBoundsDirty(){this.invalidate(!0)}onClipAreaChange(){this.invalidate(!0)}checkSelfPruned(){const e=!1===this.node.pickableProperty.value||!this.node.isVisible();if(this.selfPruned!==e){this.selfPruned=e;const t=this.node._parents;for(let e=0;e<t.length;e++){const i=t[e]._picker;this.subtreePickableCount>0?(i.invalidate(!0,!0),i.changePickableCount(this.selfPruned?-1:1)):i.invalidate(!1,!0)}}}checkSelfInclusive(){const e=!0===this.node.pickableProperty.value||this.node._inputListeners.length>0;this.selfInclusive!==e&&(this.selfInclusive=e,this.invalidate(!0,!0))}checkSubtreePrunable(){const e=!1===this.node.pickableProperty.value||!this.node.isVisible()||!0!==this.node.pickableProperty.value&&0===this.subtreePickableCount;this.subtreePrunable!==e&&(this.subtreePrunable=e,this.invalidate(!0,!0))}changePickableCount(e){if(0===e)return;const t=0===this.subtreePickableCount;this.subtreePickableCount+=e;const i=0===this.subtreePickableCount;if(this.checkSubtreePrunable(),!this.selfPruned&&t!==i){const e=this.node._parents.length;for(let i=0;i<e;i++)this.node._parents[i]._picker.changePickableCount(t?1:-1)}}audit(){0}}W.register("Picker",Ns);const Ks=[Te.bitmaskCanvas,Te.bitmaskSVG,Te.bitmaskDOM,Te.bitmaskWebGL,Te.bitmaskSingleCanvas,Te.bitmaskSingleSVG,Te.bitmaskNotPainted,Te.bitmaskBoundsValid,Te.bitmaskNoPDOM,Te.bitmaskLacksCanvas,Te.bitmaskLacksSVG,Te.bitmaskLacksDOM,Te.bitmaskLacksWebGL],Js={};Ks.forEach((e,t)=>{Js[e]=t});const js=Ks.length;let vs=0;for(let _=0;_<js;_++)vs|=Ks[_];class Hs{constructor(e){this.node=e,this._counts=new Int16Array(js),this.bitmask=vs,this.selfBitmask=Hs.summaryBitmaskForNodeSelf(e),this.summaryChange(this.bitmask,this.selfBitmask);const t=this.selfChange.bind(this);this.node.filterChangeEmitter.addListener(t),this.node.clipAreaProperty.lazyLink(t),this.node.rendererSummaryRefreshEmitter.addListener(t)}summaryChange(e,t){const i=e^t;let s=0,n=0;for(let r=0;r<js;r++){const e=Ks[r],o=Js[e];e&i&&(e&t?(this._counts[o]--,0===this._counts[o]&&(n|=e)):(this._counts[o]++,1===this._counts[o]&&(s|=e)))}if(s||n){const e=this.bitmask;for(let i=0;i<js;i++){const e=Ks[i];n&e&&(this.bitmask|=e),s&e&&(this.bitmask^=e)}this.node.instanceRefreshEmitter.emit(),this.node.onSummaryChange(e,this.bitmask);const t=this.node._parents.length;for(let i=0;i<t;i++)this.node._parents[i]._rendererSummary.summaryChange(s,n)}}selfChange(){const e=this.selfBitmask,t=Hs.summaryBitmaskForNodeSelf(this.node);e!==t&&(this.summaryChange(e,t),this.selfBitmask=t)}computeBitmask(){let e=0;for(let t=0;t<js;t++)0===this._counts[t]&&(e|=Ks[t]);return e}isSubtreeFullyCompatible(e){return!!(e&this.bitmask)}isSubtreeContainingCompatible(e){return!(e<<Te.bitmaskLacksShift&this.bitmask)}isSingleCanvasSupported(){return!!(Te.bitmaskSingleCanvas&this.bitmask)}isSingleSVGSupported(){return!!(Te.bitmaskSingleSVG&this.bitmask)}isNotPainted(){return!!(Te.bitmaskNotPainted&this.bitmask)}hasNoPDOM(){return!!(Te.bitmaskNoPDOM&this.bitmask)}areBoundsValid(){return!!(Te.bitmaskBoundsValid&this.bitmask)}isSubtreeRenderedExclusivelySVG(e){if(!this.isSingleSVGSupported())return!1;for(let t=0;t<Te.numActiveRenderers;t++){const i=Te.bitmaskOrder(e,t);if(Te.bitmaskSVG&i)return!0;if(this.isSubtreeContainingCompatible(i))return!1}return!1}isSubtreeRenderedExclusivelyCanvas(e){if(!this.isSingleCanvasSupported())return!1;for(let t=0;t<Te.numActiveRenderers;t++){const i=Te.bitmaskOrder(e,t);if(Te.bitmaskCanvas&i)return!0;if(this.isSubtreeContainingCompatible(i))return!1}return!1}audit(){0}toString(){let e=Hs.bitmaskToString(this.bitmask);for(let t=0;t<js;t++){const i=Ks[t],s=this._counts[t];0!==s&&(e+=` ${Hs.bitToString(i)}:${s}`)}return e}static summaryBitmaskForNodeSelf(e){let t=e._rendererBitmask;e.isPainted()?t|=(e._rendererBitmask&Te.bitmaskCurrentRendererArea^Te.bitmaskCurrentRendererArea)<<Te.bitmaskLacksShift:t|=Te.bitmaskCurrentRendererArea<<Te.bitmaskLacksShift;const i=e._cssTransform||e._layerSplit,s=e._renderer;return i||!Te.isSVG(e._rendererBitmask)||s&&!Te.isSVG(s)||(t|=Te.bitmaskSingleSVG),i||!Te.isCanvas(e._rendererBitmask)||s&&!Te.isCanvas(s)||(t|=Te.bitmaskSingleCanvas),e.isPainted()||(t|=Te.bitmaskNotPainted),e.areSelfBoundsValid()&&(t|=Te.bitmaskBoundsValid),e.hasPDOMContent||e.hasPDOMOrder()||(t|=Te.bitmaskNoPDOM),t}static bitToString(e){return e===Te.bitmaskCanvas?"Canvas":e===Te.bitmaskSVG?"SVG":e===Te.bitmaskDOM?"DOM":e===Te.bitmaskWebGL?"WebGL":e===Te.bitmaskLacksCanvas?"(-Canvas)":e===Te.bitmaskLacksSVG?"(-SVG)":e===Te.bitmaskLacksDOM?"(-DOM)":e===Te.bitmaskLacksWebGL?"(-WebGL)":e===Te.bitmaskSingleCanvas?"SingleCanvas":e===Te.bitmaskSingleSVG?"SingleSVG":e===Te.bitmaskNotPainted?"NotPainted":e===Te.bitmaskBoundsValid?"BoundsValid":e===Te.bitmaskNoPDOM?"NotAccessible":"?"}static bitmaskToString(e){let t="";for(let i=0;i<js;i++){const s=Ks[i];e&s&&(t+=Hs.bitToString(s)+" ")}return t}}Hs.bitmaskAll=vs,W.register("RendererSummary",Hs);const Ws=Hs;class zs{constructor(e){this.node=e,this.pdomDisplays=[]}onAddChild(e){e._pdomDisplaysInfo.canHavePDOMDisplays()&&e._pdomDisplaysInfo.addPDOMDisplays(this.pdomDisplays)}onRemoveChild(e){e._pdomDisplaysInfo.canHavePDOMDisplays()&&e._pdomDisplaysInfo.removePDOMDisplays(this.pdomDisplays)}onSummaryChange(e,t){if(this.node.visible&&this.node.pdomVisible){const i=!(Te.bitmaskNoPDOM&e),s=!(Te.bitmaskNoPDOM&t);s&&!i&&this.addAllPDOMDisplays(),!s&&i&&this.removeAllPDOMDisplays()}}onVisibilityChange(e){this.node.pdomVisible&&!this.node._rendererSummary.hasNoPDOM()&&(e?this.addAllPDOMDisplays():this.removeAllPDOMDisplays())}onPDOMVisibilityChange(e){this.node.visible&&!this.node._rendererSummary.hasNoPDOM()&&(e?this.addAllPDOMDisplays():this.removeAllPDOMDisplays())}onAddedRootedDisplay(e){e._accessible&&this.canHavePDOMDisplays()&&this.addPDOMDisplays([e])}onRemovedRootedDisplay(e){e._accessible&&this.canHavePDOMDisplays()&&this.removePDOMDisplays([e])}canHavePDOMDisplays(){return this.node.visible&&this.node.pdomVisible&&!this.node._rendererSummary.hasNoPDOM()}addAllPDOMDisplays(){let e;const t=[];for(e=0;e<this.node._parents.length;e++)Array.prototype.push.apply(t,this.node._parents[e]._pdomDisplaysInfo.pdomDisplays);for(e=0;e<this.node._rootedDisplays.length;e++){const i=this.node._rootedDisplays[e];i._accessible&&t.push(i)}this.addPDOMDisplays(t)}removeAllPDOMDisplays(){this.removePDOMDisplays(this.pdomDisplays.slice())}addPDOMDisplays(e){if(0!==e.length){Array.prototype.push.apply(this.pdomDisplays,e);for(let t=0;t<this.node._children.length;t++){this.node._children[t]._pdomDisplaysInfo.canHavePDOMDisplays()&&this.node._children[t]._pdomDisplaysInfo.addPDOMDisplays(e)}this.node.pdomDisplaysEmitter.emit()}}removePDOMDisplays(e){if(0!==e.length){let t;for(t=e.length-1;t>=0;t--){this.pdomDisplays.lastIndexOf(e[t]);this.pdomDisplays.splice(t,1)}for(t=0;t<this.node._children.length;t++){const i=this.node._children[t];i._pdomDisplaysInfo.canHavePDOMDisplays()&&!i._isGettingRemovedFromParent&&i._pdomDisplaysInfo.removePDOMDisplays(e)}this.node.pdomDisplaysEmitter.emit()}}}function Xs(e){const t=new Map;return i=>{if(t.has(i))return t.get(i);{const s=e(i);return t.set(i,s),s}}}W.register("PDOMDisplaysInfo",zs),P.Z.register("memoize",Xs);const _s=Xs,$s=["preferredWidth","minimumWidth","localPreferredWidth","localMinimumWidth","widthSizable"],en=_s(e=>{const t=Un("WidthSizable",$s,class extends e{constructor(){super(...arguments),_defineProperty(this,"preferredWidthProperty",new Ms.Z(null)),_defineProperty(this,"minimumWidthProperty",new Ms.Z(null)),_defineProperty(this,"localPreferredWidthProperty",new Ms.Z(null)),_defineProperty(this,"localMinimumWidthProperty",new Ms.Z(null)),_defineProperty(this,"isWidthResizableProperty",new Ms.Z(!0)),_defineProperty(this,"_preferredSizeChanging",!1),_defineProperty(this,"_minimumSizeChanging",!1),_defineProperty(this,"_preferredSizeChangeAttemptDuringLock",!1),_defineProperty(this,"_minimumSizeChangeAttemptDuringLock",!1),this._updatePreferredWidthListener=this._updatePreferredWidth.bind(this),this._updateLocalPreferredWidthListener=this._updateLocalPreferredWidth.bind(this),this._updateMinimumWidthListener=this._updateMinimumWidth.bind(this),this._updateLocalMinimumWidthListener=this._updateLocalMinimumWidth.bind(this),this.preferredWidthProperty.lazyLink(this._updateLocalPreferredWidthListener),this.localPreferredWidthProperty.lazyLink(this._updatePreferredWidthListener),this.minimumWidthProperty.lazyLink(this._updateLocalMinimumWidthListener),this.localMinimumWidthProperty.lazyLink(this._updateMinimumWidthListener),this.transformEmitter.addListener(this._updateLocalPreferredWidthListener),this.transformEmitter.addListener(this._updateMinimumWidthListener)}get preferredWidth(){return this.preferredWidthProperty.value}set preferredWidth(e){this.preferredWidthProperty.value=e}get localPreferredWidth(){return this.localPreferredWidthProperty.value}set localPreferredWidth(e){this.localPreferredWidthProperty.value=e}get minimumWidth(){return this.minimumWidthProperty.value}set minimumWidth(e){this.minimumWidthProperty.value=e}get localMinimumWidth(){return this.localMinimumWidthProperty.value}set localMinimumWidth(e){this.localMinimumWidthProperty.value=e}get widthSizable(){return this.isWidthResizableProperty.value}set widthSizable(e){this.isWidthResizableProperty.value=e}get extendsWidthSizable(){return!0}validateLocalPreferredWidth(){0}_calculateLocalPreferredWidth(){return this.matrix.isAligned()&&null!==this.preferredWidth?Math.abs(this.transform.inverseDeltaX(this.preferredWidth)):null}_onReentrantPreferredWidth(){this._updateLocalPreferredWidthListener()}_updateLocalPreferredWidth(){if(this._preferredSizeChanging)this._preferredSizeChangeAttemptDuringLock=!0;else{this._preferredSizeChanging=!0;do{this._preferredSizeChangeAttemptDuringLock=!1;const e=this._calculateLocalPreferredWidth();(null===this.localPreferredWidthProperty.value||null===e||Math.abs(this.localPreferredWidthProperty.value-e)>1e-9)&&(this.localPreferredWidthProperty.value=e)}while(this._preferredSizeChangeAttemptDuringLock);this._preferredSizeChanging=!1}}_calculatePreferredWidth(){return this.matrix.isAligned()&&null!==this.localPreferredWidth?Math.abs(this.transform.transformDeltaX(this.localPreferredWidth)):null}_updatePreferredWidth(){if(this._preferredSizeChanging)this._preferredSizeChangeAttemptDuringLock=!0;else{this._preferredSizeChanging=!0,this._preferredSizeChangeAttemptDuringLock=!1;const e=this._calculatePreferredWidth();(null===this.preferredWidthProperty.value||null===e||Math.abs(this.preferredWidthProperty.value-e)>1e-9)&&(this.preferredWidthProperty.value=e),this._preferredSizeChanging=!1,this._preferredSizeChangeAttemptDuringLock&&this._onReentrantPreferredWidth()}}_calculateLocalMinimumWidth(){return this.matrix.isAligned()&&null!==this.minimumWidth?Math.abs(this.transform.inverseDeltaX(this.minimumWidth)):null}_onReentrantLocalMinimumWidth(){this._updateMinimumWidthListener()}_updateLocalMinimumWidth(){if(this._minimumSizeChanging)this._minimumSizeChangeAttemptDuringLock=!0;else{this._minimumSizeChanging=!0;const e=this._calculateLocalMinimumWidth();this._minimumSizeChangeAttemptDuringLock=!1,(null===this.localMinimumWidthProperty.value||null===e||Math.abs(this.localMinimumWidthProperty.value-e)>1e-9)&&(this.localMinimumWidthProperty.value=e),this._minimumSizeChanging=!1,this._minimumSizeChangeAttemptDuringLock&&this._onReentrantLocalMinimumWidth()}}_calculateMinimumWidth(){return this.matrix.isAligned()&&null!==this.localMinimumWidth?Math.abs(this.transform.transformDeltaX(this.localMinimumWidth)):null}_updateMinimumWidth(){if(this._minimumSizeChanging)this._minimumSizeChangeAttemptDuringLock=!0;else{this._minimumSizeChanging=!0;do{this._minimumSizeChangeAttemptDuringLock=!1;const e=this._calculateMinimumWidth();(null===this.minimumWidthProperty.value||null===e||Math.abs(this.minimumWidthProperty.value-e)>1e-9)&&(this.minimumWidthProperty.value=e)}while(this._minimumSizeChangeAttemptDuringLock);this._minimumSizeChanging=!1}}mutate(e){return super.mutate(e)}});if(e.prototype._mutatorKeys){const i=e.prototype._mutatorKeys,s=$s,n=i.indexOf(Us[0]);t.prototype._mutatorKeys=[...i.slice(0,n),...s,...i.slice(n)]}return t}),tn=e=>e.widthSizable,sn=e=>e.extendsWidthSizable;W.register("WidthSizable",en);const nn=en,rn=["preferredHeight","minimumHeight","localPreferredHeight","localMinimumHeight","heightSizable"],on=_s(e=>{const t=Un("HeightSizable",rn,class extends e{constructor(){super(...arguments),_defineProperty(this,"preferredHeightProperty",new Ms.Z(null)),_defineProperty(this,"minimumHeightProperty",new Ms.Z(null)),_defineProperty(this,"localPreferredHeightProperty",new Ms.Z(null)),_defineProperty(this,"localMinimumHeightProperty",new Ms.Z(null)),_defineProperty(this,"isHeightResizableProperty",new Ms.Z(!0)),_defineProperty(this,"_preferredSizeChanging",!1),_defineProperty(this,"_minimumSizeChanging",!1),_defineProperty(this,"_preferredSizeChangeAttemptDuringLock",!1),_defineProperty(this,"_minimumSizeChangeAttemptDuringLock",!1),this._updatePreferredHeightListener=this._updatePreferredHeight.bind(this),this._updateLocalPreferredHeightListener=this._updateLocalPreferredHeight.bind(this),this._updateMinimumHeightListener=this._updateMinimumHeight.bind(this),this._updateLocalMinimumHeightListener=this._updateLocalMinimumHeight.bind(this),this.preferredHeightProperty.lazyLink(this._updateLocalPreferredHeightListener),this.localPreferredHeightProperty.lazyLink(this._updatePreferredHeightListener),this.minimumHeightProperty.lazyLink(this._updateLocalMinimumHeightListener),this.localMinimumHeightProperty.lazyLink(this._updateMinimumHeightListener),this.transformEmitter.addListener(this._updateLocalPreferredHeightListener),this.transformEmitter.addListener(this._updateMinimumHeightListener)}get preferredHeight(){return this.preferredHeightProperty.value}set preferredHeight(e){this.preferredHeightProperty.value=e}get localPreferredHeight(){return this.localPreferredHeightProperty.value}set localPreferredHeight(e){this.localPreferredHeightProperty.value=e}get minimumHeight(){return this.minimumHeightProperty.value}set minimumHeight(e){this.minimumHeightProperty.value=e}get localMinimumHeight(){return this.localMinimumHeightProperty.value}set localMinimumHeight(e){this.localMinimumHeightProperty.value=e}get heightSizable(){return this.isHeightResizableProperty.value}set heightSizable(e){this.isHeightResizableProperty.value=e}get extendsHeightSizable(){return!0}validateLocalPreferredHeight(){0}_calculateLocalPreferredHeight(){return this.matrix.isAligned()&&null!==this.preferredHeight?Math.abs(this.transform.inverseDeltaY(this.preferredHeight)):null}_onReentrantPreferredHeight(){this._updateLocalPreferredHeightListener()}_updateLocalPreferredHeight(){if(this._preferredSizeChanging)this._preferredSizeChangeAttemptDuringLock=!0;else{this._preferredSizeChanging=!0;do{this._preferredSizeChangeAttemptDuringLock=!1;const e=this._calculateLocalPreferredHeight();(null===this.localPreferredHeightProperty.value||null===e||Math.abs(this.localPreferredHeightProperty.value-e)>1e-9)&&(this.localPreferredHeightProperty.value=e)}while(this._preferredSizeChangeAttemptDuringLock);this._preferredSizeChanging=!1}}_calculatePreferredHeight(){return this.matrix.isAligned()&&null!==this.localPreferredHeight?Math.abs(this.transform.transformDeltaY(this.localPreferredHeight)):null}_updatePreferredHeight(){if(this._preferredSizeChanging)this._preferredSizeChangeAttemptDuringLock=!0;else{this._preferredSizeChanging=!0,this._preferredSizeChangeAttemptDuringLock=!1;const e=this._calculatePreferredHeight();(null===this.preferredHeightProperty.value||null===e||Math.abs(this.preferredHeightProperty.value-e)>1e-9)&&(this.preferredHeightProperty.value=e),this._preferredSizeChanging=!1,this._preferredSizeChangeAttemptDuringLock&&this._onReentrantPreferredHeight()}}_calculateLocalMinimumHeight(){return this.matrix.isAligned()&&null!==this.minimumHeight?Math.abs(this.transform.inverseDeltaY(this.minimumHeight)):null}_onReentrantLocalMinimumHeight(){this._updateMinimumHeight()}_updateLocalMinimumHeight(){if(this._minimumSizeChanging)this._minimumSizeChangeAttemptDuringLock=!0;else{this._minimumSizeChanging=!0,this._minimumSizeChangeAttemptDuringLock=!1;const e=this._calculateLocalMinimumHeight();(null===this.localMinimumHeightProperty.value||null===e||Math.abs(this.localMinimumHeightProperty.value-e)>1e-9)&&(this.localMinimumHeightProperty.value=e),this._minimumSizeChanging=!1,this._minimumSizeChangeAttemptDuringLock&&this._onReentrantLocalMinimumHeight()}}_calculateMinimumHeight(){return this.matrix.isAligned()&&null!==this.localMinimumHeight?Math.abs(this.transform.transformDeltaY(this.localMinimumHeight)):null}_updateMinimumHeight(){if(!this._minimumSizeChanging){this._minimumSizeChanging=!0;do{this._minimumSizeChangeAttemptDuringLock=!1;const e=this._calculateMinimumHeight();(null===this.minimumHeightProperty.value||null===e||Math.abs(this.minimumHeightProperty.value-e)>1e-9)&&(this.minimumHeightProperty.value=e)}while(this._minimumSizeChangeAttemptDuringLock);this._minimumSizeChanging=!1}}mutate(e){return super.mutate(e)}});if(e.prototype._mutatorKeys){const i=e.prototype._mutatorKeys,s=rn,n=i.indexOf(Us[0]);t.prototype._mutatorKeys=[...i.slice(0,n),...s,...i.slice(n)]}return t}),An=e=>e.heightSizable,an=e=>e.extendsHeightSizable;W.register("HeightSizable",on);const hn=on;var ln=i(6212);const gn=["preferredSize","minimumSize","localPreferredSize","localMinimumSize","sizable"],cn=["preferredSize","minimumSize","localPreferredSize","localMinimumSize","sizable",...$s,...rn],dn=_s(e=>{const t=nn(hn(e)),i=Un("Sizable",gn,class extends t{constructor(){super(...arguments),this.preferredWidthProperty.lazyLink(this._updateLocalPreferredHeightListener),this.preferredHeightProperty.lazyLink(this._updateLocalPreferredWidthListener),this.localPreferredWidthProperty.lazyLink(this._updatePreferredHeightListener),this.localPreferredHeightProperty.lazyLink(this._updatePreferredWidthListener),this.minimumWidthProperty.lazyLink(this._updateLocalMinimumHeightListener),this.minimumHeightProperty.lazyLink(this._updateLocalMinimumWidthListener),this.localMinimumWidthProperty.lazyLink(this._updateMinimumHeightListener),this.localMinimumHeightProperty.lazyLink(this._updateMinimumWidthListener)}get preferredSize(){return null===this.preferredWidth||null===this.preferredHeight?null:new hi.Z(this.preferredWidth,this.preferredHeight)}set preferredSize(e){this.preferredWidth=null===e?null:e.width,this.preferredHeight=null===e?null:e.height}get localPreferredSize(){return null===this.localPreferredWidth||null===this.localPreferredHeight?null:new hi.Z(this.localPreferredWidth,this.localPreferredHeight)}set localPreferredSize(e){this.localPreferredWidth=null===e?null:e.width,this.localPreferredHeight=null===e?null:e.height}get minimumSize(){return null===this.minimumWidth||null===this.minimumHeight?null:new hi.Z(this.minimumWidth,this.minimumHeight)}set minimumSize(e){this.minimumWidth=null===e?null:e.width,this.minimumHeight=null===e?null:e.height}get localMinimumSize(){return null===this.localMinimumWidth||null===this.localMinimumHeight?null:new hi.Z(this.localMinimumWidth,this.localMinimumHeight)}set localMinimumSize(e){this.localMinimumWidth=null===e?null:e.width,this.localMinimumHeight=null===e?null:e.height}get sizable(){return this.widthSizable}set sizable(e){this.widthSizable=e,this.heightSizable=e}get extendsSizable(){return!0}validateLocalPreferredSize(){0}mutate(e){return(0,ln.Z)(e,["preferredSize"],["preferredWidth","preferredHeight"]),(0,ln.Z)(e,["localPreferredSize"],["localPreferredWidth","localPreferredHeight"]),(0,ln.Z)(e,["minimumSize"],["minimumWidth","minimumHeight"]),(0,ln.Z)(e,["localMinimumSize"],["localMinimumWidth","localMinimumHeight"]),(0,ln.Z)(e,["sizable"],["widthSizable","heightSizable"]),super.mutate(e)}_calculateLocalPreferredWidth(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.preferredWidth)return Math.abs(this.transform.inverseDeltaX(this.preferredWidth))}else if(null!==this.preferredHeight)return Math.abs(this.transform.getInverse().m01()*this.preferredHeight);return null}_calculateLocalPreferredHeight(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.preferredHeight)return Math.abs(this.transform.inverseDeltaY(this.preferredHeight))}else if(null!==this.preferredWidth)return Math.abs(this.transform.getInverse().m10()*this.preferredWidth);return null}_calculatePreferredWidth(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.localPreferredWidth)return Math.abs(this.transform.transformDeltaX(this.localPreferredWidth))}else if(null!==this.localPreferredHeight)return Math.abs(this.transform.matrix.m01()*this.localPreferredHeight);return null}_calculatePreferredHeight(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.localPreferredHeight)return Math.abs(this.transform.transformDeltaY(this.localPreferredHeight))}else if(null!==this.localPreferredWidth)return Math.abs(this.transform.matrix.m10()*this.localPreferredWidth);return null}_onReentrantLocalMinimumWidth(){this._updateMinimumWidthListener(),this._updateMinimumHeightListener()}_onReentrantLocalMinimumHeight(){this._updateMinimumWidthListener(),this._updateMinimumHeightListener()}_onReentrantPreferredWidth(){this._updateLocalPreferredWidthListener(),this._updateLocalPreferredHeightListener()}_onReentrantPreferredHeight(){this._updateLocalPreferredWidthListener(),this._updateLocalPreferredHeightListener()}_calculateLocalMinimumWidth(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.minimumWidth)return Math.abs(this.transform.inverseDeltaX(this.minimumWidth))}else if(null!==this.minimumHeight)return Math.abs(this.transform.getInverse().m01()*this.minimumHeight);return null}_calculateLocalMinimumHeight(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.minimumHeight)return Math.abs(this.transform.inverseDeltaY(this.minimumHeight))}else if(null!==this.minimumWidth)return Math.abs(this.transform.getInverse().m10()*this.minimumWidth);return null}_calculateMinimumWidth(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.localMinimumWidth)return Math.abs(this.transform.transformDeltaX(this.localMinimumWidth))}else if(null!==this.localMinimumHeight)return Math.abs(this.transform.matrix.m01()*this.localMinimumHeight);return null}_calculateMinimumHeight(){if(this.matrix.isAxisAligned())if(this.matrix.isAligned()){if(null!==this.localMinimumHeight)return Math.abs(this.transform.transformDeltaY(this.localMinimumHeight))}else if(null!==this.localMinimumWidth)return Math.abs(this.transform.matrix.m10()*this.localMinimumWidth);return null}});if(t.prototype._mutatorKeys){const e=t.prototype._mutatorKeys,s=gn,n=e.indexOf(Us[0]);i.prototype._mutatorKeys=[...e.slice(0,n),...s,...e.slice(n)]}return i});W.register("Sizable",dn);const un=dn,mn=Fi.PDOM_UNIQUE_ID_SEPARATOR;class pn{constructor(e){if(e instanceof pn){const t=e;return this.nodes=t.nodes.slice(0),this.length=t.length,this.uniqueId=t.uniqueId,void(this.indices=t.indices.slice(0))}if(this.nodes=[],this.length=0,this.uniqueId="",this.indices=[],e)if(e instanceof Zs){const t=e;this.addDescendant(t)}else{const t=e.length;for(let i=0;i<t;i++)this.addDescendant(e[i])}}copy(){return new pn(this)}isPainted(){return this.lastNode().isPainted()}isValid(){this.reindex();const e=this.indices.length;for(let t=0;t<e;t++)if(this.indices[t]<0)return!1;return!0}isVisible(){let e=this.nodes.length;for(;e--;)if(!this.nodes[e].isVisible())return!1;return!0}isPDOMVisible(){let e=this.nodes.length;for(;e--;)if(!this.nodes[e].isVisible()||!this.nodes[e].isPDOMVisible())return!1;return!0}getOpacity(){let e=1,t=this.nodes.length;for(;t--;)e*=this.nodes[t].getOpacity();return e}isPickable(){return!_.some(this.nodes,e=>!1===e.pickable||!e.visible)&&!!_.some(this.nodes,e=>e._inputListeners.length>0||!0===e.pickableProperty.value)}get(e){return e>=0?this.nodes[e]:this.nodes[this.nodes.length+e]}slice(e,t){return new pn(this.nodes.slice(e,t))}subtrailTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.slice(0,_.indexOf(this.nodes,e)+(t?0:1))}isEmpty(){return 0===this.nodes.length}getMatrixConcatenation(e,t){const i=Le.Z.identity(),s=this.nodes;for(let n=e;n<t;n++)i.multiplyMatrix(s[n].getMatrix());return i}getMatrix(){return this.getMatrixConcatenation(0,this.nodes.length)}getAncestorMatrix(){return this.getMatrixConcatenation(1,this.nodes.length)}getParentMatrix(){return this.getMatrixConcatenation(0,this.nodes.length-1)}getAncestorParentMatrix(){return this.getMatrixConcatenation(1,this.nodes.length-1)}getTransform(){return new Pe.Z(this.getMatrix())}getParentTransform(){return new Pe.Z(this.getParentMatrix())}addAncestor(e,t){if(this.nodes.length){const i=this.nodes[0];this.indices.unshift(void 0===t?_.indexOf(e._children,i):t)}return this.nodes.unshift(e),this.length++,this.uniqueId=this.uniqueId?e.id+mn+this.uniqueId:""+e.id,this}removeAncestor(){return this.nodes.shift(),this.indices.length&&this.indices.shift(),this.length--,this.updateUniqueId(),this}addDescendant(e,t){if(this.nodes.length){const i=this.lastNode();this.indices.push(void 0===t?_.indexOf(i._children,e):t)}return this.nodes.push(e),this.length++,this.uniqueId=this.uniqueId?this.uniqueId+mn+e.id:""+e.id,this}removeDescendant(){return this.nodes.pop(),this.indices.length&&this.indices.pop(),this.length--,this.updateUniqueId(),this}addDescendantTrail(e){const t=e.length;t&&this.addDescendant(e.nodes[0]);for(let i=1;i<t;i++)this.addDescendant(e.nodes[i],this.indices[i-1])}removeDescendantTrail(e){for(let t=e.length-1;t>=0;t--)this.removeDescendant()}reindex(){const e=this.length;for(let t=1;t<e;t++){const e=this.indices[t-1],i=this.nodes[t-1];i._children[e]!==this.nodes[t]&&(this.indices[t-1]=_.indexOf(i._children,this.nodes[t]))}}setImmutable(){return this}setMutable(){return this}areIndicesValid(){for(let e=1;e<this.length;e++){const t=this.indices[e-1];if(this.nodes[e-1]._children[t]!==this.nodes[e])return!1}return!0}equals(e){if(this.length!==e.length)return!1;for(let t=0;t<this.nodes.length;t++)if(this.nodes[t]!==e.nodes[t])return!1;return!0}upToNode(e){_.indexOf(this.nodes,e);return this.slice(0,_.indexOf(this.nodes,e)+1)}isExtensionOf(e,t){if(this.length<=e.length-(t?1:0))return!1;for(let i=0;i<e.nodes.length;i++)if(this.nodes[i]!==e.nodes[i])return!1;return!0}containsNode(e){return _.includes(this.nodes,e)}getTransformTo(e){return new Pe.Z(this.getMatrixTo(e))}getMatrixTo(e){this.reindex(),e.reindex();const t=this.getBranchIndexTo(e);let i,s=Le.Z.IDENTITY;for(i=this.length-1;i>=t;i--)s=this.nodes[i].getMatrix().timesMatrix(s);for(i=t;i<e.length;i++)s=e.nodes[i].getTransform().getInverse().timesMatrix(s);return s}getBranchIndexTo(e){let t;const i=Math.min(this.length,e.length);for(t=0;t<i&&this.nodes[t]===e.nodes[t];t++);return t}getLastInputEnabledIndex(){let e=-1;for(let t=0;t<this.length&&this.nodes[t].inputEnabled;t++)e=t;return e}getCursorCheckIndex(){return this.getLastInputEnabledIndex()}nodeFromTop(e){return this.nodes[this.length-1-e]}lastNode(){return this.nodeFromTop(0)}rootNode(){return this.nodes[0]}previous(){if(this.nodes.length<=1)return null;const e=this.nodeFromTop(0),t=this.nodeFromTop(1),i=_.indexOf(t._children,e),s=this.nodes.slice(0,this.nodes.length-1);if(0===i)return new pn(s);for(s.push(t._children[i-1]);0!==s[s.length-1]._children.length;){const e=s[s.length-1];s.push(e._children[e._children.length-1])}return new pn(s)}previousPainted(){let e=this.previous();for(;e&&!e.isPainted();)e=e.previous();return e}next(){const e=this.nodes.slice(0),t=this.nodeFromTop(0);if(t._children.length>0)return e.push(t._children[0]),new pn(e);{let t=this.nodes.length-1;for(;t>0;){const i=this.nodes[t],s=this.nodes[t-1];e.pop();const n=_.indexOf(s._children,i);if(n!==s._children.length-1)return e.push(s._children[n+1]),new pn(e);t--}return null}}nextPainted(){let e=this.next();for(;e&&!e.isPainted();)e=e.next();return e}eachTrailUnder(e){new Vn(this,!0).eachTrailBetween(new Vn(this,!1),e)}compare(e){const t=Math.min(this.nodes.length,e.nodes.length);for(let i=0;i<t;i++)if(this.nodes[i]!==e.nodes[i])return this.nodes[i-1].children.indexOf(this.nodes[i])<e.nodes[i-1].children.indexOf(e.nodes[i])?-1:1;return this.nodes.length<e.nodes.length?-1:this.nodes.length>e.nodes.length?1:0}isBefore(e){return-1===this.compare(e)}isAfter(e){return 1===this.compare(e)}localToGlobalPoint(e){return this.getMatrix().timesVector2(e)}localToGlobalBounds(e){return e.transformed(this.getMatrix())}globalToLocalPoint(e){return this.getTransform().inversePosition2(e)}globalToLocalBounds(e){return this.getTransform().inverseBounds2(e)}parentToGlobalPoint(e){return this.getParentMatrix().timesVector2(e)}parentToGlobalBounds(e){return e.transformed(this.getParentMatrix())}globalToParentPoint(e){return this.getParentTransform().inversePosition2(e)}globalToParentBounds(e){return this.getParentTransform().inverseBounds2(e)}updateUniqueId(){let e="";const t=this.nodes.length;t>0&&(e+=this.nodes[0]._id);for(let i=1;i<t;i++)e+=mn+this.nodes[i]._id;this.uniqueId=e}getUniqueId(){return this.uniqueId}toString(){return this.reindex(),this.length?`[Trail ${this.indices.join(".")} ${this.getUniqueId()}]`:"Empty Trail"}toPathString(){return _.map(this.nodes,e=>{let t=e.constructor.name;return"Node"===t&&(t="."),t}).join("/")}toDebugString(){return`${this.toString()} ${this.toPathString()}`}static eachPaintedTrailBetween(e,t,i,s,n){pn.eachTrailBetween(e,t,e=>!!e.isPainted()&&i(e),s,n)}static eachTrailBetween(e,t,i,s,n){const r=new Vn(e?e.copy():new pn(n),!0),o=t?new Vn(t.copy(),!0):new Vn(new pn(n),!1);s&&(r.nestedForwards(),o.nestedBackwards(),1===r.compareNested(o))||r.depthFirstUntil(o,e=>!!e.isBefore&&i(e.trail),!1)}static branchIndex(e,t){let i;const s=Math.min(e.length,t.length);for(i=0;i<s&&e.nodes[i]===t.nodes[i];i++);return i}static sharedTrail(e,t){return e.slice(0,pn.branchIndex(e,t))}static appendAncestorTrailsWithPredicate(e,t,i){const s=t.rootNode();i(s)&&e.push(t.copy());const n=s._parents.length;for(let r=0;r<n;r++){const n=s._parents[r];t.addAncestor(n),pn.appendAncestorTrailsWithPredicate(e,t,i),t.removeAncestor()}}static appendDescendantTrailsWithPredicate(e,t,i){const s=t.lastNode();i(s)&&e.push(t.copy());const n=s._children.length;for(let r=0;r<n;r++){const n=s._children[r];t.addDescendant(n,r),pn.appendDescendantTrailsWithPredicate(e,t,i),t.removeDescendant()}}static spannedSubtrees(e,t){}static fromUniqueId(e,t){const i=t.split(mn).map(e=>Number(e));let s=e;i.shift();const n=[s];for(;i.length>0;){const e=i.shift(),t=(s.pdomOrder||[]).concat(s.children);for(let i=0;i<t.length;i++)if(null!==t[i]&&t[i].id===e){const e=t[i];n.push(e),s=e;break}}return new pn(n)}}W.register("Trail",pn);class Vn{constructor(e,t){this.trail=e,this.setBefore(t)}isActive(){return!!this.trail}copy(){return new Vn(this.trail.copy(),this.isBefore)}setBefore(e){this.isBefore=e,this.isAfter=!e}getRenderSwappedPointer(){const e=this.isBefore?this.trail.previous():this.trail.next();return null===e?null:new Vn(e,!this.isBefore)}getRenderBeforePointer(){return this.isBefore?this:this.getRenderSwappedPointer()}getRenderAfterPointer(){return this.isAfter?this:this.getRenderSwappedPointer()}compareRender(e){const t=this.getRenderBeforePointer(),i=e.getRenderBeforePointer();return null!==t&&null!==i?t.trail.compare(i.trail):t===i?0:null===t?1:-1}compareNested(e){const t=this,i=e,s=t.trail.compare(i.trail);return 0===s?this.isBefore===e.isBefore?0:this.isBefore?-1:1:t.trail.isExtensionOf(i.trail)?e.isBefore?1:-1:i.trail.isExtensionOf(t.trail)?this.isBefore?-1:1:s}equalsRender(e){return 0===this.compareRender(e)}equalsNested(e){return 0===this.compareNested(e)}hasTrail(){return!!this.trail}nestedForwards(){const e=this;if(this.isBefore){const t=e.trail.lastNode()._children;t.length>0?e.trail.addDescendant(t[0],0):this.setBefore(!1)}else{if(0===e.trail.indices.length)return this.trail=null,null;{const t=e.trail.indices[e.trail.indices.length-1];e.trail.removeDescendant();const i=e.trail.lastNode()._children;i.length>t+1&&(e.trail.addDescendant(i[t+1],t+1),this.setBefore(!0))}}return this}nestedBackwards(){const e=this;if(this.isBefore){if(0===e.trail.indices.length)return this.trail=null,null;{const t=e.trail.indices[e.trail.indices.length-1];e.trail.removeDescendant(),t-1>=0&&(e.trail.addDescendant(e.trail.lastNode()._children[t-1],t-1),this.setBefore(!1))}}else if(e.trail.lastNode()._children.length>0){const t=e.trail.lastNode()._children;e.trail.addDescendant(t[t.length-1],t.length-1)}else this.setBefore(!0);return this}eachNodeBetween(e,t){this.eachTrailBetween(e,e=>t(e.lastNode()))}eachTrailBetween(e,t){this.isBefore&&t(this.trail),this.depthFirstUntil(e,e=>!!e.isBefore&&t(e.trail),!0)}depthFirstUntil(e,t,i){const s=e;this.trail.reindex(),s.trail.reindex();const n=this.copy();n.trail.setMutable();let r=!0;for(;!n.equalsNested(e);){let s=!1;if(r?(i||(s=t(n)),r=!1):s=t(n),s&&n.isBefore){if(n.setBefore(!1),1===n.compareNested(e))break}else n.nestedForwards()}i||t(n)}toString(){return`[${this.isBefore?"before":"after"} ${this.trail.toString().slice(1)}`}static compareNested(e,t,i,s){const n=e.compare(i);return 0===n?t===s?0:t?-1:1:e.isExtensionOf(i)?s?1:-1:i.isExtensionOf(e)?t?-1:1:n}}W.register("TrailPointer",Vn);class Mn extends Ms.Z{constructor(e){super(new Set),_defineProperty(this,"listenedNodeSet",new Set),_defineProperty(this,"updateEmitter",new te.Z),this.node=e,this._nodeUpdateListener=this.update.bind(this),this.addNodeListener(e),this.update()}areValuesEqual(e,t){return e.size===t.size&&_.every([...e],e=>t.has(e))}update(){const e=new Set;!function t(i){i.parents.forEach(i=>{e.add(i),t(i)})}(this.node),e.forEach(e=>{this.listenedNodeSet.has(e)||this.addNodeListener(e)}),this.listenedNodeSet.forEach(t=>{e.has(t)||t===this.node||this.removeNodeListener(t)}),this.value=e,this.updateEmitter.emit()}addNodeListener(e){this.listenedNodeSet.add(e),e.parentAddedEmitter.addListener(this._nodeUpdateListener),e.parentRemovedEmitter.addListener(this._nodeUpdateListener)}removeNodeListener(e){this.listenedNodeSet.delete(e),e.parentAddedEmitter.removeListener(this._nodeUpdateListener),e.parentRemovedEmitter.removeListener(this._nodeUpdateListener)}dispose(){this.listenedNodeSet.forEach(e=>this.removeNodeListener(e)),super.dispose()}}W.register("AncestorNodesProperty",Mn);class Bn extends Ms.Z{constructor(e,t){super([]),_defineProperty(this,"listenedNodeSet",new Set),this.rootNode=e,this.leafNode=t,this._trailUpdateListener=this.update.bind(this),this.update()}update(){const e=[],t=new Set,i=new pn(this.leafNode),s=this.rootNode;!function n(){const r=i.rootNode();t.add(r),r===s&&e.push(i.copy()),r.parents.forEach(e=>{i.addAncestor(e),n(),i.removeAncestor()})}(),t.forEach(e=>{this.listenedNodeSet.has(e)||this.addNodeListener(e)}),this.listenedNodeSet.forEach(e=>{t.has(e)||this.removeNodeListener(e)});const n=this.value;let r=n.length===e.length;if(r)for(let o=0;o<e.length;o++)if(!n[o].equals(e[o])){r=!1;break}r||(this.value=e)}addNodeListener(e){this.listenedNodeSet.add(e),e.parentAddedEmitter.addListener(this._trailUpdateListener),e.parentRemovedEmitter.addListener(this._trailUpdateListener)}removeNodeListener(e){this.listenedNodeSet.delete(e),e.parentAddedEmitter.removeListener(this._trailUpdateListener),e.parentRemovedEmitter.removeListener(this._trailUpdateListener)}dispose(){this.listenedNodeSet.forEach(e=>this.removeNodeListener(e)),super.dispose()}}W.register("TrailsBetweenProperty",Bn);class wn extends Ms.Z{constructor(e,t,i){const s=(0,Ce.ZP)()({fromCoordinateFrame:"local",toCoordinateFrame:"local"},i);super(Le.Z.IDENTITY),_defineProperty(this,"rootNode",null),_defineProperty(this,"fromTrail",null),_defineProperty(this,"toTrail",null),_defineProperty(this,"listenedNodeSet",new Set),this.from=e,this.to=t,this.fromCoordinateFrame=s.fromCoordinateFrame,this.toCoordinateFrame=s.toCoordinateFrame,this.useDeepEquality=!0,this.fromAncestorsProperty=new Mn(e),this.toAncestorsProperty=new Mn(t);const n=this.update.bind(this);this._nodeTransformListener=this.updateMatrix.bind(this),this.fromAncestorsProperty.updateEmitter.addListener(n),this.toAncestorsProperty.updateEmitter.addListener(n),this.update()}update(){const e=[...this.fromAncestorsProperty.value,this.from],t=[...this.toAncestorsProperty.value,this.to],i=e.filter(e=>t.includes(e));let s=!1;const n=i.filter(i=>{const n=e.filter(e=>i.hasChild(e)),r=t.filter(e=>i.hasChild(e)),o=[],A=[];ms(n,r,o,A,[]),(n.length>1||r.length>1)&&(o.length||A.length)&&(s=!0);const a=o.length>0||this.from===i,h=A.length>0||this.to===i;return a&&h});s||1!==n.length?(this.rootNode=null,this.fromTrail=null,this.toTrail=null):(this.rootNode=n[0],this.fromTrail=this.from.getUniqueTrailTo(this.rootNode),this.toTrail=this.to.getUniqueTrailTo(this.rootNode));const r=new Set;this.fromTrail&&this.fromTrail.nodes.forEach(e=>r.add(e)),this.toTrail&&this.toTrail.nodes.forEach(e=>r.add(e)),r.forEach(e=>{this.listenedNodeSet.has(e)||this.addNodeListener(e)}),this.listenedNodeSet.forEach(e=>{r.has(e)||e===this.from||e===this.to||this.removeNodeListener(e)}),this.updateMatrix()}updateMatrix(){if(this.rootNode&&this.fromTrail&&this.toTrail){const e=1===this.fromTrail.nodes.length,t=1===this.toTrail.nodes.length,i=e&&"parent"===this.fromCoordinateFrame||t&&"parent"===this.toCoordinateFrame,s=this.fromTrail.getMatrixConcatenation(i?0:1,this.fromTrail.nodes.length-("parent"===this.fromCoordinateFrame?1:0)),n=this.toTrail.getMatrixConcatenation(i?0:1,this.toTrail.nodes.length-("parent"===this.toCoordinateFrame?1:0));this.value=n.inverted().timesMatrix(s)}else this.value=null}addNodeListener(e){this.listenedNodeSet.add(e),e.transformEmitter.addListener(this._nodeTransformListener)}removeNodeListener(e){this.listenedNodeSet.delete(e),e.transformEmitter.removeListener(this._nodeTransformListener)}dispose(){this.fromAncestorsProperty.dispose(),this.toAncestorsProperty.dispose(),super.dispose()}}W.register("MatrixBetweenProperty",wn);var Cn=i(2573),En=i(1243);const Yn=Oe.Z.safari5,Dn=["fill","fillPickable","stroke","strokePickable","lineWidth","lineCap","lineJoin","miterLimit","lineDash","lineDashOffset","cachedPaints"],yn={fill:null,fillPickable:!0,stroke:null,strokePickable:!1,lineWidth:_t.$.lineWidth,lineCap:_t.$.lineCap,lineJoin:_t.$.lineJoin,lineDashOffset:_t.$.lineDashOffset,miterLimit:_t.$.miterLimit},In=["fill","stroke","lineWidth","lineOptions","cachedPaints"],qn=_s(e=>class extends e{constructor(){super(...arguments),(0,Cn.Z)(this,["_drawables"]),this._fill=yn.fill,this._fillPickable=yn.fillPickable,this._stroke=yn.stroke,this._strokePickable=yn.strokePickable,this._cachedPaints=[],this._lineDrawingStyles=new _t.Ob}setFill(e){return this._fill!==e&&(this._fill=e,this.invalidateFill()),this}set fill(e){this.setFill(e)}get fill(){return this.getFill()}getFill(){return this._fill}hasFill(){return null!==this.getFillValue()}getFillValue(){const e=this.getFill();return e instanceof ee.Z?e.get():e}get fillValue(){return this.getFillValue()}setStroke(e){return this._stroke!==e&&(this._stroke=e,this.invalidateStroke()),this}set stroke(e){this.setStroke(e)}get stroke(){return this.getStroke()}getStroke(){return this._stroke}hasStroke(){return null!==this.getStrokeValue()}hasPaintableStroke(){return this.hasStroke()&&this.getLineWidth()>0}getStrokeValue(){const e=this.getStroke();return e instanceof ee.Z?e.get():e}get strokeValue(){return this.getStrokeValue()}setFillPickable(e){return this._fillPickable!==e&&(this._fillPickable=e,this.invalidateFill()),this}set fillPickable(e){this.setFillPickable(e)}get fillPickable(){return this.isFillPickable()}isFillPickable(){return this._fillPickable}setStrokePickable(e){return this._strokePickable!==e&&(this._strokePickable=e,this.invalidateStroke()),this}set strokePickable(e){this.setStrokePickable(e)}get strokePickable(){return this.isStrokePickable()}isStrokePickable(){return this._strokePickable}setLineWidth(e){if(this.getLineWidth()!==e){this._lineDrawingStyles.lineWidth=e,this.invalidateStroke();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyLineWidth()}return this}set lineWidth(e){this.setLineWidth(e)}get lineWidth(){return this.getLineWidth()}getLineWidth(){return this._lineDrawingStyles.lineWidth}setLineCap(e){if(this._lineDrawingStyles.lineCap!==e){this._lineDrawingStyles.lineCap=e,this.invalidateStroke();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyLineOptions()}return this}set lineCap(e){this.setLineCap(e)}get lineCap(){return this.getLineCap()}getLineCap(){return this._lineDrawingStyles.lineCap}setLineJoin(e){if(this._lineDrawingStyles.lineJoin!==e){this._lineDrawingStyles.lineJoin=e,this.invalidateStroke();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyLineOptions()}return this}set lineJoin(e){this.setLineJoin(e)}get lineJoin(){return this.getLineJoin()}getLineJoin(){return this._lineDrawingStyles.lineJoin}setMiterLimit(e){if(this._lineDrawingStyles.miterLimit!==e){this._lineDrawingStyles.miterLimit=e,this.invalidateStroke();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyLineOptions()}return this}set miterLimit(e){this.setMiterLimit(e)}get miterLimit(){return this.getMiterLimit()}getMiterLimit(){return this._lineDrawingStyles.miterLimit}setLineDash(e){if(this._lineDrawingStyles.lineDash!==e){this._lineDrawingStyles.lineDash=e||[],this.invalidateStroke();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyLineOptions()}return this}set lineDash(e){this.setLineDash(e)}get lineDash(){return this.getLineDash()}getLineDash(){return this._lineDrawingStyles.lineDash}hasLineDash(){return!!this._lineDrawingStyles.lineDash.length}setLineDashOffset(e){if(this._lineDrawingStyles.lineDashOffset!==e){this._lineDrawingStyles.lineDashOffset=e,this.invalidateStroke();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyLineOptions()}return this}set lineDashOffset(e){this.setLineDashOffset(e)}get lineDashOffset(){return this.getLineDashOffset()}getLineDashOffset(){return this._lineDrawingStyles.lineDashOffset}setLineStyles(e){return this._lineDrawingStyles=e,this.invalidateStroke(),this}set lineStyles(e){this.setLineStyles(e)}get lineStyles(){return this.getLineStyles()}getLineStyles(){return this._lineDrawingStyles}setCachedPaints(e){this._cachedPaints=e.filter(e=>e instanceof Ki);const t=this._drawables.length;for(let i=0;i<t;i++)this._drawables[i].markDirtyCachedPaints();return this}set cachedPaints(e){this.setCachedPaints(e)}get cachedPaints(){return this.getCachedPaints()}getCachedPaints(){return this._cachedPaints}addCachedPaint(e){if(e instanceof Ki){this._cachedPaints.push(e);const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyCachedPaints()}}removeCachedPaint(e){if(e instanceof Ki){(0,Oi.Z)(this._cachedPaints,e);const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyCachedPaints()}}beforeCanvasFill(e){const t=this.getFillValue();e.setFillStyle(t),t.transformMatrix&&(e.context.save(),t.transformMatrix.canvasAppendTransform(e.context))}afterCanvasFill(e){this.getFillValue().transformMatrix&&e.context.restore()}beforeCanvasStroke(e){const t=this.getStrokeValue();if(e.setStrokeStyle(this._stroke),e.setLineCap(this.getLineCap()),e.setLineJoin(this.getLineJoin()),t.transformMatrix){const i=t.transformMatrix.getScaleVector(),s=1/i.x;e.context.save(),t.transformMatrix.canvasAppendTransform(e.context),e.setLineWidth(this.getLineWidth()*s),e.setMiterLimit(this.getMiterLimit()*s),e.setLineDash(this.getLineDash().map(e=>e*s)),e.setLineDashOffset(this.getLineDashOffset()*s)}else e.setLineWidth(this.getLineWidth()),e.setMiterLimit(this.getMiterLimit()),e.setLineDash(this.getLineDash()),e.setLineDashOffset(this.getLineDashOffset())}afterCanvasStroke(e){this.getStrokeValue().transformMatrix&&e.context.restore()}getCSSFill(){const e=this.getFillValue();return e?e.toCSS?e.toCSS():e:"transparent"}getSimpleCSSStroke(){const e=this.getStrokeValue();return e?e.toCSS?e.toCSS():e:"transparent"}appendFillablePropString(e,t){return this._fill&&(t&&(t+=",\n"),"string"==typeof this.getFillValue()?t+=`${e}fill: '${this.getFillValue()}'`:t+=`${e}fill: ${this.getFillValue()}`),t}appendStrokablePropString(e,t){function i(i,s,n){t&&(t+=",\n"),t+=n||"string"!=typeof s?`${e+i}: ${s}`:`${e+i}: '${s}'`}if(this._stroke){const e=new _t.Ob,t=this.getStrokeValue();"string"==typeof t?i("stroke",t):i("stroke",t?t.toString():"null",!0),_.each(["lineWidth","lineCap","miterLimit","lineJoin","lineDashOffset"],t=>{this[t]!==e[t]&&i(t,this[t])}),this.lineDash.length&&i("lineDash",JSON.stringify(this.lineDash),!0)}return t}getFillRendererBitmask(){let e=0;return Yn&&this._fill instanceof ji||(e|=Te.bitmaskSVG),e|=Te.bitmaskCanvas,this.hasFill()&&(this._fill instanceof Wi||this._fill instanceof ji)||(e|=Te.bitmaskDOM,e|=Te.bitmaskWebGL),e}getStrokeRendererBitmask(){let e=0;return e|=Te.bitmaskCanvas,e|=Te.bitmaskSVG,this.hasStroke()||(e|=Te.bitmaskDOM,e|=Te.bitmaskWebGL),e}invalidateFill(){this.invalidateSupportedRenderers();const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyFill()}invalidateStroke(){this.invalidateSupportedRenderers();const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyStroke()}});W.register("Paintable",qn),qn.DEFAULT_OPTIONS=yn;const Gn=Math.log2||function(e){return Math.log(e)/Math.LN2},Qn={imageOpacity:1,initialWidth:0,initialHeight:0,mipmap:!1,mipmapBias:0,mipmapInitialLevel:4,mipmapMaxLevel:5,hitTestPixels:!1};let Sn=null,Tn=null;const xn=()=>(Sn||(Sn=document.createElement("canvas")),Sn),kn=e=>class extends e{constructor(){super(...arguments),this._image=null,this._initialWidth=Qn.initialWidth,this._initialHeight=Qn.initialHeight,this._imageOpacity=Qn.imageOpacity,this._mipmap=Qn.mipmap,this._mipmapBias=Qn.mipmapBias,this._mipmapInitialLevel=Qn.mipmapInitialLevel,this._mipmapMaxLevel=Qn.mipmapMaxLevel,this._hitTestPixels=Qn.hitTestPixels,this._mipmapCanvases=[],this._mipmapURLs=[],this._mipmapData=null,this._imageLoadListener=this._onImageLoad.bind(this),this._imageLoadListenerAttached=!1,this._hitTestImageData=null,this.mipmapEmitter=new te.Z}setImage(e){let t=this._image!==e;if(t&&"string"==typeof e&&this._image&&this._image instanceof HTMLImageElement&&e===this._image.src&&(t=!1),t&&e===this._mipmapData&&(t=!1),t){if(this._initialWidth=0,this._initialHeight=0,this._image&&this._imageLoadListenerAttached&&this._detachImageLoadListener(),this._mipmapData=null,"string"==typeof e){const t=e;(e=document.createElement("img")).src=t}else Array.isArray(e)&&(this._mipmapData=e,e=e[0].img,this._mipmapInitialLevel=this._mipmapMaxLevel=this._mipmapData.length,this._mipmap=!0);this._image=e,!(this._image instanceof HTMLImageElement)||this._image.width&&this._image.height||this._attachImageLoadListener(),this.invalidateImage()}return this}set image(e){this.setImage(e)}get image(){return this.getImage()}getImage(){return this._image}invalidateImage(){this.invalidateMipmaps(),this._invalidateHitTestData()}setImageWithSize(e,t,i){return this.setImage(e),this.setInitialWidth(t),this.setInitialHeight(i),this}setImageOpacity(e){this._imageOpacity!==e&&(this._imageOpacity=e)}set imageOpacity(e){this.setImageOpacity(e)}get imageOpacity(){return this.getImageOpacity()}getImageOpacity(){return this._imageOpacity}setInitialWidth(e){return e!==this._initialWidth&&(this._initialWidth=e,this.invalidateImage()),this}set initialWidth(e){this.setInitialWidth(e)}get initialWidth(){return this.getInitialWidth()}getInitialWidth(){return this._initialWidth}setInitialHeight(e){return e!==this._initialHeight&&(this._initialHeight=e,this.invalidateImage()),this}set initialHeight(e){this.setInitialHeight(e)}get initialHeight(){return this.getInitialHeight()}getInitialHeight(){return this._initialHeight}setMipmap(e){return this._mipmap!==e&&(this._mipmap=e,this.invalidateMipmaps()),this}set mipmap(e){this.setMipmap(e)}get mipmap(){return this.isMipmap()}isMipmap(){return this._mipmap}setMipmapBias(e){return this._mipmapBias!==e&&(this._mipmapBias=e,this.invalidateMipmaps()),this}set mipmapBias(e){this.setMipmapBias(e)}get mipmapBias(){return this.getMipmapBias()}getMipmapBias(){return this._mipmapBias}setMipmapInitialLevel(e){return this._mipmapInitialLevel!==e&&(this._mipmapInitialLevel=e,this.invalidateMipmaps()),this}set mipmapInitialLevel(e){this.setMipmapInitialLevel(e)}get mipmapInitialLevel(){return this.getMipmapInitialLevel()}getMipmapInitialLevel(){return this._mipmapInitialLevel}setMipmapMaxLevel(e){return this._mipmapMaxLevel!==e&&(this._mipmapMaxLevel=e,this.invalidateMipmaps()),this}set mipmapMaxLevel(e){this.setMipmapMaxLevel(e)}get mipmapMaxLevel(){return this.getMipmapMaxLevel()}getMipmapMaxLevel(){return this._mipmapMaxLevel}setHitTestPixels(e){return this._hitTestPixels!==e&&(this._hitTestPixels=e,this._invalidateHitTestData()),this}set hitTestPixels(e){this.setHitTestPixels(e)}get hitTestPixels(){return this.getHitTestPixels()}getHitTestPixels(){return this._hitTestPixels}_constructNextMipmap(){const e=this._mipmapCanvases.length,t=this._mipmapCanvases[e-1];if(t.width*t.height>2){const e=document.createElement("canvas");if(e.width=Math.ceil(t.width/2),e.height=Math.ceil(t.height/2),e.width>0&&e.height>0){const i=e.getContext("2d");i.scale(.5,.5),i.drawImage(t,0,0),this._mipmapCanvases.push(e),this._mipmapURLs.push(e.toDataURL())}}}invalidateMipmaps(){if((0,Ji.Z)(this._mipmapCanvases),(0,Ji.Z)(this._mipmapURLs),this._image&&this._mipmap)if(this._mipmapData)for(let e=0;e<this._mipmapData.length;e++){const t=this._mipmapData[e].url;this._mipmapURLs.push(t);const i=this._mipmapData[e].updateCanvas;i&&i(),this._mipmapCanvases.push(this._mipmapData[e].canvas)}else{const e=document.createElement("canvas");if(e.width=this.getImageWidth(),e.height=this.getImageHeight(),e.width&&e.height){e.getContext("2d").drawImage(this._image,0,0),this._mipmapCanvases.push(e),this._mipmapURLs.push(e.toDataURL());let t=0;for(;++t<this._mipmapInitialLevel;)this._constructNextMipmap()}}this.mipmapEmitter.emit()}getMipmapLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=kn.getApproximateMatrixScale(e)*(window.devicePixelRatio||1);return this.getMipmapLevelFromScale(i,t)}getMipmapLevelFromScale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e>=1)return 0;let i=Gn(1/e);if(i=ie.Z.roundSymmetric(i+this._mipmapBias+t-.7),i<0&&(i=0),i>this._mipmapMaxLevel&&(i=this._mipmapMaxLevel),this.mipmap&&!this._mipmapCanvases[i]){let e=this._mipmapCanvases.length-1;for(;++e<=i;)this._constructNextMipmap();return Math.min(i,this._mipmapCanvases.length-1)}return i}getMipmapCanvas(e){if(this._mipmapData){const t=this._mipmapData[e]&&this._mipmapData[e].updateCanvas;t&&t()}return this._mipmapCanvases[e]}getMipmapURL(e){return this._mipmapURLs[e]}hasMipmaps(){return this._mipmapCanvases.length>0}_invalidateHitTestData(){this._hitTestPixels&&null!==this._image&&(this._hitTestImageData=kn.getHitTestData(this._image,this.imageWidth,this.imageHeight))}getImageWidth(){if(null===this._image)return 0;const e=this._mipmapData?this._mipmapData[0].width:("naturalWidth"in this._image?this._image.naturalWidth:0)||this._image.width;return 0===e?this._initialWidth:e}get imageWidth(){return this.getImageWidth()}getImageHeight(){if(null===this._image)return 0;const e=this._mipmapData?this._mipmapData[0].height:("naturalHeight"in this._image?this._image.naturalHeight:0)||this._image.height;return 0===e?this._initialHeight:e}get imageHeight(){return this.getImageHeight()}getImageURL(){return this._image.src}_attachImageLoadListener(){this.isDisposed||(this._image.addEventListener("load",this._imageLoadListener),this._imageLoadListenerAttached=!0)}_detachImageLoadListener(){this._image.removeEventListener("load",this._imageLoadListener),this._imageLoadListenerAttached=!1}_onImageLoad(){this.invalidateImage(),this._detachImageLoadListener()}dispose(){this._image&&this._imageLoadListenerAttached&&this._detachImageLoadListener(),super.dispose&&super.dispose()}};kn.getHitTestData=(e,t,i)=>{if(!("naturalWidth"in e&&e.naturalWidth||e.width)||!("naturalHeight"in e&&e.naturalHeight||e.height))return null;const s=xn(),n=(Tn||(Tn=xn().getContext("2d",{willReadFrequently:!0})),Tn);return s.width=t,s.height=i,n.drawImage(e,0,0),n.getImageData(0,0,t,i)},kn.testHitTestData=(e,t,i,s)=>{const n=4*(ie.Z.clamp(Math.floor(s.x/t*e.width),0,e.width-1)+ie.Z.clamp(Math.floor(s.y/i*e.height),0,e.height-1)*e.width)+3;return 0!==e.data[n]},kn.hitTestDataToShape=(e,t,i)=>{const s=t/e.width,n=i/e.height,r=new _t.bn;let o=!1,A=0;for(let a=0;a<e.height;a++){for(let t=0;t<e.width;t++){const i=4*(t+a*e.width)+3;0!==e.data[i]?o||(o=!0,A=t):o&&(o=!1,r.rect(A*s,a*s,s*(t-A),n))}o&&(o=!1,r.rect(A*s,a*s,s*(e.width-A),n))}return r.getSimplifiedAreaShape()},kn.createSVGImage=(e,t,i)=>{const s=document.createElementNS(ke,"image");return s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("width",t+"px"),s.setAttribute("height",i+"px"),s.setAttributeNS(Re,"xlink:href",e),s},kn.createFastMipmapFromCanvas=e=>{const t=[],i=e.toDataURL(),s=new window.Image;s.src=i,t.push({img:s,url:i,width:e.width,height:e.height,canvas:e});let n=e;for(;n.width>=2&&n.height>=2;){const e=document.createElement("canvas");e.width=Math.ceil(n.width/2),e.height=Math.ceil(n.height/2);const i=e.getContext("2d");i.setTransform(.5,0,0,.5,0,0),i.drawImage(n,0,0);const s={width:e.width,height:e.height,canvas:e,url:e.toDataURL(),img:new window.Image};s.img.src=s.url,n=e,t.push(s)}return t},kn.getApproximateMatrixScale=e=>(Math.sqrt(e.m00()*e.m00()+e.m10()*e.m10())+Math.sqrt(e.m01()*e.m01()+e.m11()*e.m11()))/2,kn.CANVAS_MIPMAP_BIAS_ADJUSTMENT=.5,kn.DEFAULT_OPTIONS=Qn,W.register("Imageable",kn);const Fn=kn,Rn=(e,t,i)=>{const s=`_${e}PendingOptions`,n=`_${e}IsConstructed`;return class extends i{constructor(){super(...arguments),this[n]=!0,this.mutate(this[s]),this[s]=void 0}mutate(e){return e&&!this[n]&&(this[s]=(0,Ce.JA)(this[s]||{},_.pick(e,t)),e=_.omit(e,t)),super.mutate(e)}}};W.register("DelayedMutate",Rn);const Un=Rn;var Ln=i(538);class Pn extends(Fn(Zs)){constructor(e,t){const i=(0,Ce.ZP)()({image:e},t);super(),this._imageBounds=null,this.mutate(i),this.invalidateSupportedRenderers()}invalidateImage(){this._image?this.invalidateSelf(this._imageBounds||new Ue.Z(0,0,this.getImageWidth(),this.getImageHeight())):this.invalidateSelf(Ue.Z.NOTHING);const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyImage();super.invalidateImage(),this.invalidateSupportedRenderers()}invalidateSupportedRenderers(){let e=Te.bitmaskCanvas;this.getImageWidth()<=gi.MAX_DIMENSION.width&&this.getImageHeight()<=gi.MAX_DIMENSION.height&&(e|=Te.bitmaskWebGL),this._image instanceof HTMLCanvasElement||(e|=Te.bitmaskSVG|Te.bitmaskDOM),this.setRendererBitmask(e)}setImageOpacity(e){const t=this._imageOpacity!==e;if(super.setImageOpacity(e),t){const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyImageOpacity()}}setImageBounds(e){this._imageBounds!==e&&(this._imageBounds=e,this.invalidateImage())}set imageBounds(e){this.setImageBounds(e)}get imageBounds(){return this._imageBounds}getImageBounds(){return this._imageBounds}isPainted(){return!0}canvasPaintSelf(e,t){Bg.prototype.paintCanvas(e,this,t)}createDOMDrawable(e,t){return Cg.createFromPool(e,t)}createSVGDrawable(e,t){return Yg.createFromPool(e,t)}createCanvasDrawable(e,t){return Bg.createFromPool(e,t)}createWebGLDrawable(e,t){return yg.createFromPool(e,t)}containsPointSelf(e){const t=Zs.prototype.containsPointSelf.call(this,e);return t&&this._hitTestPixels&&this._hitTestImageData?Fn.testHitTestData(this._hitTestImageData,this.imageWidth,this.imageHeight,e):t}getSelfShape(){return this._hitTestPixels&&this._hitTestImageData?Fn.hitTestDataToShape(this._hitTestImageData,this.imageWidth,this.imageHeight):Zs.prototype.getSelfShape.call(this)}invalidateMipmaps(){const e=this._image&&this._mipmap&&!this._mipmapData;if(super.invalidateMipmaps(),e){const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyMipmap()}}mutate(e){return super.mutate(e)}}_defineProperty(Pn,"DEFAULT_IMAGE_OPTIONS",(0,Ce.JA)({},Zs.DEFAULT_NODE_OPTIONS,Fn.DEFAULT_OPTIONS)),Pn.prototype._mutatorKeys=["image","imageOpacity","imageBounds","initialWidth","initialHeight","mipmap","mipmapBias","mipmapInitialLevel","mipmapMaxLevel","hitTestPixels",...Zs.prototype._mutatorKeys],Pn.prototype.drawableMarkFlags=[...Zs.prototype.drawableMarkFlags,"image","imageOpacity","mipmap"],Pn.ImageIO=new se.Z("ImageIO",{valueType:Pn,supertype:Zs.NodeIO,events:["changed"],methods:{setImage:{returnType:Ln.Z,parameterTypes:[Ye.Z],implementation:function(e){const t=new window.Image;t.src=e,this.image=t},documentation:"Set the image from a base64 string",invocableForReadOnlyElements:!1}}}),W.register("Image",Pn);const bn={shape:null,boundsMethod:"accurate"};class On extends(qn(Zs)){constructor(e,t){e||null!=t&&t.shape;const i=(0,Ce.ZP)()({shape:e,boundsMethod:bn.boundsMethod},t);super(),this._shape=bn.shape,this._strokedShape=null,this._boundsMethod=bn.boundsMethod,this._invalidShapeListener=this.invalidateShape.bind(this),this._invalidShapeListenerAttached=!1,this.invalidateSupportedRenderers(),this.mutate(i)}setShape(e){return this._shape!==e&&(this._invalidShapeListenerAttached&&this.detachShapeListener(),"string"==typeof e&&(e=new _t.bn(e)),this._shape=e,this.invalidateShape(),this._shape&&!this._shape.isImmutable()&&this.attachShapeListener()),this}set shape(e){this.setShape(e)}get shape(){return this.getShape()}getShape(){return this._shape}getStrokedShape(){return this._strokedShape||(this._strokedShape=this.getShape().getStrokedShape(this._lineDrawingStyles)),this._strokedShape}getPathRendererBitmask(){return Te.bitmaskCanvas|Te.bitmaskSVG}invalidateSupportedRenderers(){this.setRendererBitmask(this.getFillRendererBitmask()&this.getStrokeRendererBitmask()&this.getPathRendererBitmask())}invalidateShape(){this.invalidatePath();const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyShape();this._invalidShapeListenerAttached&&this._shape&&this._shape.isImmutable()&&this.detachShapeListener()}invalidatePath(){this._strokedShape=null,this.invalidateSelf()}attachShapeListener(){this.isDisposed||(this._shape.invalidatedEmitter.addListener(this._invalidShapeListener),this._invalidShapeListenerAttached=!0)}detachShapeListener(){this._shape.invalidatedEmitter.removeListener(this._invalidShapeListener),this._invalidShapeListenerAttached=!1}updateSelfBounds(){const e=this.hasShape()?this.computeShapeBounds():Ue.Z.NOTHING,t=!e.equals(this.selfBoundsProperty._value);return t&&this.selfBoundsProperty._value.set(e),t}setBoundsMethod(e){return this._boundsMethod!==e&&(this._boundsMethod=e,this.invalidatePath(),this.rendererSummaryRefreshEmitter.emit()),this}set boundsMethod(e){this.setBoundsMethod(e)}get boundsMethod(){return this.getBoundsMethod()}getBoundsMethod(){return this._boundsMethod}computeShapeBounds(){const e=this.getShape();if("none"!==this._boundsMethod&&e){if(this.hasPaintableStroke()&&"unstroked"!==this._boundsMethod){if("accurate"===this._boundsMethod)return e.getStrokedBounds(this.getLineStyles());{let t;return t="safePadding"===this._boundsMethod&&"miter"===this.getLineJoin()?this.getMiterLimit():"square"===this.getLineCap()?Math.SQRT2:1,e.bounds.dilated(t*this.getLineWidth()/2)}}return e.bounds}return Ue.Z.NOTHING}areSelfBoundsValid(){return"accurate"===this._boundsMethod||"safePadding"===this._boundsMethod||"none"!==this._boundsMethod&&!this.hasStroke()}getTransformedSelfBounds(e){return(this._stroke?this.getStrokedShape():this.getShape()).getBoundsWithTransform(e)}getTransformedSafeSelfBounds(e){return this.getTransformedSelfBounds(e)}invalidateStroke(){this.invalidatePath(),this.rendererSummaryRefreshEmitter.emit(),super.invalidateStroke()}hasShape(){return!!this._shape}canvasPaintSelf(e,t){Tg.prototype.paintCanvas(e,this,t)}createSVGDrawable(e,t){return kg.createFromPool(e,t)}createCanvasDrawable(e,t){return Tg.createFromPool(e,t)}isPainted(){return!0}containsPointSelf(e){let t=!1;return this.hasShape()?(this._fillPickable&&(t=this.getShape().containsPoint(e)),!t&&this._strokePickable&&(t=this.getStrokedShape().containsPoint(e)),t):t}getSelfShape(){return _t.bn.union([...this.hasShape()&&this._fillPickable?[this.getShape()]:[],...this.hasShape()&&this._strokePickable?[this.getStrokedShape()]:[]])}intersectsBoundsSelf(e){return!!this._shape&&this._shape.intersectsBounds(e)}requiresSVGBoundsWorkaround(){if(!(this._stroke&&this._stroke instanceof Ki&&this.hasShape()))return!1;const e=this.computeShapeBounds();return e.x*e.y==0}getDebugHTMLExtras(){return this._shape?` (<span style="color: #88f" onclick="window.open( 'data:text/plain;charset=utf-8,' + encodeURIComponent( '${this._shape.getSVGPath()}' ) );">path</span>)`:""}dispose(){this._invalidShapeListenerAttached&&this.detachShapeListener(),super.dispose()}mutate(e){return super.mutate(e)}}function fn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}_defineProperty(On,"DEFAULT_PATH_OPTIONS",(0,Ce.JA)({},Zs.DEFAULT_NODE_OPTIONS,bn)),On.prototype._mutatorKeys=[...Dn,"boundsMethod","shape",...Zs.prototype._mutatorKeys],On.prototype.drawableMarkFlags=[...Zs.prototype.drawableMarkFlags,...In,"shape"],W.register("Path",On),P.Z.register("escapeHTML",fn);const Zn=fn;function Nn(e){return _.each(Array.prototype.slice.call(arguments,1),t=>{if(t)for(const i in t){const s=Object.getOwnPropertyDescriptor(t,i);!s||"function"!=typeof s.get&&void 0===t[i]||Object.defineProperty(e,i,s)}}),e}P.Z.register("extendDefined",Nn);const Kn=Nn;var Jn=i(4974);const jn=new yt.Z("none",{tandem:Kt.Z.GENERAL_VIEW.createTandem("phetioElementSelectionProperty"),phetioValueType:Ye.Z,validValues:["view","linked","string","none"],phetioState:!1,phetioDocumentation:'Specifies how PhET-iO Elements are being selected. "view": the target view element, "linked": the corresponding linked element of the view element (if there is one), "string": select only string elements in the sim, "none": no active selection.'});Jn.Z.register("phetioElementSelectionProperty",jn);const vn=jn,Hn=["boundsMethod","stringProperty","string","font","fontWeight","fontFamily","fontStretch","fontStyle","fontSize"],Wn=window.navigator.userAgent.includes("like Gecko) Version/5")&&window.navigator.userAgent.includes("Safari/");class zn extends(qn(Zs)){constructor(e,t){super(),this._stringProperty=new Bs("",!0,this.onStringPropertyChange.bind(this)),this._font=Ge.DEFAULT,this._boundsMethod="hybrid",this._isHTML=!1,this._cachedRenderedText=null;const i=Kn({fill:"#000000",tandemNameSuffix:"Text",phetioType:zn.TextIO,phetioVisiblePropertyInstrumented:!1},t);"string"==typeof e||"number"==typeof e?i.string=e:i.stringProperty=e,this.mutate(i),this.invalidateSupportedRenderers()}mutate(e){return super.mutate(e)}setString(e){return e=""+e,this._stringProperty.set(e),this}set string(e){this.setString(e)}get string(){return this.getString()}getString(){return this._stringProperty.value}getRenderedText(){return null===this._cachedRenderedText&&(this._cachedRenderedText=this.string.replace(" "," "),Oe.Z.edge&&(this._cachedRenderedText=zn.simplifyEmbeddingMarks(this._cachedRenderedText))),this._cachedRenderedText}get renderedText(){return this.getRenderedText()}onStringPropertyChange(){this._cachedRenderedText=null;const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyText();this.invalidateText()}setStringProperty(e){return this._stringProperty.setTargetProperty(this,zn.STRING_PROPERTY_TANDEM_NAME,e)}set stringProperty(e){this.setStringProperty(e)}get stringProperty(){return this.getStringProperty()}getStringProperty(){return this._stringProperty}initializePhetioObject(e,t){const i=this.isPhetioInstrumented();super.initializePhetioObject(e,t),Kt.Z.PHET_IO_ENABLED&&!i&&this.isPhetioInstrumented()&&this._stringProperty.initializePhetio(this,zn.STRING_PROPERTY_TANDEM_NAME,()=>new Ri.Z(this.string,(0,Ce.JA)({phetioReadOnly:!0,tandem:this.tandem.createTandem(zn.STRING_PROPERTY_TANDEM_NAME),phetioDocumentation:"Property for the displayed text"},t.stringPropertyOptions)))}getPhetioMouseHitTarget(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"string"===vn.value?this.getStringPropertyPhetioMouseHitTarget(e):super.getPhetioMouseHitTarget(e)}getStringPropertyPhetioMouseHitTarget(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this._stringProperty.getTargetProperty();return t instanceof Ee.Z?t.getPhetioMouseHitTarget(e):"phetioNotSelectable"}setBoundsMethod(e){if(e!==this._boundsMethod){this._boundsMethod=e,this.invalidateSupportedRenderers();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyBounds();this.invalidateText(),this.rendererSummaryRefreshEmitter.emit()}return this}set boundsMethod(e){this.setBoundsMethod(e)}get boundsMethod(){return this.getBoundsMethod()}getBoundsMethod(){return this._boundsMethod}getTextRendererBitmask(){let e=0;return"fast"===this._boundsMethod||this._isHTML||(e|=Te.bitmaskCanvas),this._isHTML||(e|=Te.bitmaskSVG),e|=Te.bitmaskDOM,e}invalidateSupportedRenderers(){this.setRendererBitmask(this.getFillRendererBitmask()&this.getStrokeRendererBitmask()&this.getTextRendererBitmask())}invalidateText(){this.invalidateSelf();const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirtyBounds();this.invalidateSupportedRenderers()}updateSelfBounds(){let e;e=this._isHTML||Wn&&"accurate"!==this._boundsMethod?wi.approximateDOMBounds(this._font,this.getDOMTextNode()):"hybrid"===this._boundsMethod?wi.approximateHybridBounds(this._font,this.renderedText):"accurate"===this._boundsMethod?wi.accurateCanvasBounds(this):wi.approximateSVGBounds(this._font,this.renderedText),this.hasStroke()&&e.dilate(this.getLineWidth()/2);const t=!e.equals(this.selfBoundsProperty._value);return t&&this.selfBoundsProperty._value.set(e),t}invalidateStroke(){this.invalidateText(),super.invalidateStroke()}invalidateFill(){this.invalidateText(),super.invalidateFill()}canvasPaintSelf(e,t){ec.prototype.paintCanvas(e,this,t)}createDOMDrawable(e,t){return sc.createFromPool(e,t)}createSVGDrawable(e,t){return Ac.createFromPool(e,t)}createCanvasDrawable(e,t){return ec.createFromPool(e,t)}getDOMTextNode(){if(this._isHTML){const e=document.createElement("span");return e.innerHTML=this.string,e}return document.createTextNode(this.renderedText)}getSafeSelfBounds(){const e=this.getSelfBounds();return e.dilatedXY(1*e.width,1*e.height)}setFont(e){if(e!==("string"==typeof e?this._font.toCSS():this._font)){this._font="string"==typeof e?Ge.fromCSS(e):e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyFont();this.invalidateText()}return this}set font(e){this.setFont(e)}get font(){return this.getFont()}getFont(){return this._font.getFont()}setFontWeight(e){return this.setFont(this._font.copy({weight:e}))}set fontWeight(e){this.setFontWeight(e)}get fontWeight(){return this.getFontWeight()}getFontWeight(){return this._font.getWeight()}setFontFamily(e){return this.setFont(this._font.copy({family:e}))}set fontFamily(e){this.setFontFamily(e)}get fontFamily(){return this.getFontFamily()}getFontFamily(){return this._font.getFamily()}setFontStretch(e){return this.setFont(this._font.copy({stretch:e}))}set fontStretch(e){this.setFontStretch(e)}get fontStretch(){return this.getFontStretch()}getFontStretch(){return this._font.getStretch()}setFontStyle(e){return this.setFont(this._font.copy({style:e}))}set fontStyle(e){this.setFontStyle(e)}get fontStyle(){return this.getFontStyle()}getFontStyle(){return this._font.getStyle()}setFontSize(e){return this.setFont(this._font.copy({size:e}))}set fontSize(e){this.setFontSize(e)}get fontSize(){return this.getFontSize()}getFontSize(){return this._font.getSize()}isPainted(){return!0}areSelfBoundsValid(){return"accurate"===this._boundsMethod}getDebugHTMLExtras(){return` "${Zn(this.renderedText)}"${this._isHTML?" (html)":""}`}dispose(){super.dispose(),this._stringProperty.dispose()}static embeddedDebugString(e){return e.replace(/\u202a/g,"[LTR]").replace(/\u202b/g,"[RTL]").replace(/\u202c/g,"[POP]")}static simplifyEmbeddingMarks(e){const t={dir:null,children:[],parent:null};let i=t;for(let s=0;s<e.length;s++){const t=e.charAt(s);if(t===Xn||t===_n){const e={dir:t,children:[],parent:i};i.children.push(e),i=e}else t===$n?i=i.parent:i.children.push(t)}return function e(t){if("string"==typeof t)return t;const i=t.children.map(e).join("");return t.dir?t.dir+i+"‬":i}(function e(t){if("string"!=typeof t){for(let i=0;i<t.children.length;i++)e(t.children[i]);!function(e){1===e.children.length&&"string"!=typeof e.children[0]&&e.children[0].dir&&(e.dir=e.children[0].dir,e.children=e.children[0].children)}(t),function(e){for(let t=e.children.length-1;t>=0;t--){const i=e.children[t];"string"!=typeof i&&e.dir===i.dir&&e.children.splice(t,1,...i.children)}}(t),function e(t){for(let i=t.children.length-1;i>=1;i--){const s=t.children[i-1],n=t.children[i];"string"!=typeof n&&"string"!=typeof s&&n.dir&&s.dir===n.dir&&(s.children=s.children.concat(n.children),t.children.splice(i,1),e(s))}}(t)}return t}(t))}}_defineProperty(zn,"STRING_PROPERTY_NAME","stringProperty"),_defineProperty(zn,"STRING_PROPERTY_TANDEM_NAME","stringProperty"),zn.prototype._mutatorKeys=[...Dn,...Hn,...Zs.prototype._mutatorKeys],zn.prototype.drawableMarkFlags=[...Zs.prototype.drawableMarkFlags,...In,"text","font","bounds"],W.register("Text",zn);const Xn="‪",_n="‫",$n="‬";wi.initializeTextBounds(),zn.TextIO=new se.Z("TextIO",{valueType:zn,supertype:Zs.NodeIO,documentation:"Text that is displayed in the simulation. TextIO has a nested PropertyIO.&lt;String&gt; for the current string value."});class er extends Zs{constructor(e){super(e),this.setRendererBitmask(Te.bitmaskCanvas)}setCanvasBounds(e){this.invalidateSelf(e)}set canvasBounds(e){this.setCanvasBounds(e)}get canvasBounds(){return this.getCanvasBounds()}getCanvasBounds(){return this.getSelfBounds()}isPainted(){return!0}invalidatePaint(){const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirty()}canvasPaintSelf(e,t){this.paintCanvas(e.context)}containsPointSelf(e){return!1}getSelfShape(){return new _t.bn}createCanvasDrawable(e,t){return hg.createFromPool(e,t)}mutate(e){return super.mutate(e)}}er.prototype._mutatorKeys=["canvasBounds"].concat(Zs.prototype._mutatorKeys),W.register("CanvasNode",er);class tr extends On{constructor(e,t){super(null),this._radius=0,t="object"==typeof e?e:Kn({radius:e},t),this.mutate(t)}getStrokeRendererBitmask(){let e=super.getStrokeRendererBitmask();return this.hasStroke()&&!this.getStroke().isGradient&&!this.getStroke().isPattern&&this.getLineWidth()<=this.getRadius()&&(e|=Te.bitmaskDOM),e}getPathRendererBitmask(){return Te.bitmaskCanvas|Te.bitmaskSVG|(we.borderRadius?Te.bitmaskDOM:0)}invalidateCircle(){this._shape=null,this.invalidatePath()}createCircleShape(){return _t.bn.circle(0,0,this._radius).makeImmutable()}intersectsBoundsSelf(e){let t=Math.abs(e.centerX),i=Math.abs(e.centerY);const s=e.maxX-t,n=e.maxY-i;return!(t>s+this._radius||i>n+this._radius)&&(t<=s||i<=n||(t-=s,i-=n,t*t+i*i<=this._radius*this._radius))}canvasPaintSelf(e,t){gg.prototype.paintCanvas(e,this,t)}createDOMDrawable(e,t){return dg.createFromPool(e,t)}createSVGDrawable(e,t){return mg.createFromPool(e,t)}createCanvasDrawable(e,t){return gg.createFromPool(e,t)}setRadius(e){if(this._radius!==e){this._radius=e,this.invalidateCircle();const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyRadius()}return this}set radius(e){this.setRadius(e)}get radius(){return this.getRadius()}getRadius(){return this._radius}computeShapeBounds(){let e=new Ue.Z(-this._radius,-this._radius,this._radius,this._radius);return this._stroke&&(e=e.dilated(this.getLineWidth()/2)),e}containsPointSelf(e){const t=e.x*e.x+e.y*e.y;let i,s=!0;if(this._strokePickable){i=this.getLineWidth()/2;const e=this._radius+i;s=s&&t<=e*e}if(this._fillPickable)return this._strokePickable?s:t<=this._radius*this._radius;if(this._strokePickable){const e=this._radius-i;return s&&t>=e*e}return!1}setShape(e){if(null!==e)throw new Error("Cannot set the shape of a Circle to something non-null");return this.invalidatePath(),this}getShape(){return this._shape||(this._shape=this.createCircleShape()),this._shape}hasShape(){return!0}mutate(e){return super.mutate(e)}}tr.prototype._mutatorKeys=["radius"].concat(On.prototype._mutatorKeys),tr.prototype.drawableMarkFlags=On.prototype.drawableMarkFlags.concat(["radius"]).filter(e=>"shape"!==e),W.register("Circle",tr);class ir extends Zs{constructor(e,t){(e=>!(!e||!e.jquery))(e)&&(e=e[0]),super(),this._container=document.createElement("div"),this._$container=$(this._container),this._$container.css("position","absolute"),this._$container.css("left",0),this._$container.css("top",0),this.invalidateDOMLock=!1,this._preventTransform=!1,t=Kn({element:e},t),this.mutate(t),this.setRendererBitmask(Te.bitmaskDOM)}calculateDOMBounds(){const e=$(this._element);return new Ue.Z(0,0,e.width(),e.height())}invalidateDOM(){if(this.invalidateDOMLock)return;this.invalidateDOMLock=!0;const e=document.createElement("div");$(e).css({display:"hidden",padding:"0 !important",margin:"0 !important",position:"absolute",left:0,top:0,width:65535,height:65535}),this._container.removeChild(this._element),e.appendChild(this._element),document.body.appendChild(e);const t=this.calculateDOMBounds();this.invalidateSelf(t),this._$container.width(t.getWidth()),this._$container.height(t.getHeight()),document.body.removeChild(e),e.removeChild(this._element),this._container.appendChild(this._element),this.invalidateDOMLock=!1}createDOMDrawable(e,t){return Vg.createFromPool(e,t)}isPainted(){return!0}setElement(e){return this._element!==e&&(this._element&&this._container.removeChild(this._element),this._element=e,this._container.appendChild(this._element),this.invalidateDOM()),this}set element(e){this.setElement(e)}get element(){return this.getElement()}getElement(){return this._element}setPreventTransform(e){this._preventTransform!==e&&(this._preventTransform=e)}set preventTransform(e){this.setPreventTransform(e)}get preventTransform(){return this.isTransformPrevented()}isTransformPrevented(){return this._preventTransform}mutate(e){return super.mutate(e)}}ir.prototype._mutatorKeys=["element","preventTransform"].concat(Zs.prototype._mutatorKeys),W.register("DOM",ir);class sr extends On{constructor(e,t,i,s,n){super(null),this._x1=0,this._y1=0,this._x2=0,this._y2=0,n="object"==typeof e?e instanceof be.Z?Kn({x1:e.x,y1:e.y,x2:t.x,y2:t.y,strokePickable:!0},i):Kn({strokePickable:!0},e):Kn({x1:e,y1:t,x2:i,y2:s,strokePickable:!0},n),this.mutate(n)}setLine(e,t,i,s){this._x1=e,this._y1=t,this._x2=i,this._y2=s;const n=this._drawables.length;for(let r=0;r<n;r++){this._drawables[r].markDirtyLine()}return this.invalidateLine(),this}setPoint1(e,t){"number"==typeof e?(this._x1=e,this._y1=t):(this._x1=e.x,this._y1=e.y);const i=this._drawables.length;for(let s=0;s<i;s++)this._drawables[s].markDirtyP1();return this.invalidateLine(),this}set p1(e){this.setPoint1(e)}get p1(){return new be.Z(this._x1,this._y1)}setPoint2(e,t){"number"==typeof e?(this._x2=e,this._y2=t):(this._x2=e.x,this._y2=e.y);const i=this._drawables.length;for(let s=0;s<i;s++)this._drawables[s].markDirtyP2();return this.invalidateLine(),this}set p2(e){this.setPoint2(e)}get p2(){return new be.Z(this._x2,this._y2)}setX1(e){if(this._x1!==e){this._x1=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyX1();this.invalidateLine()}return this}set x1(e){this.setX1(e)}get x1(){return this.getX1()}getX1(){return this._x1}setY1(e){if(this._y1!==e){this._y1=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyY1();this.invalidateLine()}return this}set y1(e){this.setY1(e)}get y1(){return this.getY1()}getY1(){return this._y1}setX2(e){if(this._x2!==e){this._x2=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyX2();this.invalidateLine()}return this}set x2(e){this.setX2(e)}get x2(){return this.getX2()}getX2(){return this._x2}setY2(e){if(this._y2!==e){this._y2=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyY2();this.invalidateLine()}return this}set y2(e){this.setY2(e)}get y2(){return this.getY2()}getY2(){return this._y2}createLineShape(){return _t.bn.lineSegment(this._x1,this._y1,this._x2,this._y2).makeImmutable()}invalidateLine(){this._shape=null,this.invalidatePath()}containsPointSelf(e){return!!this._strokePickable&&super.containsPointSelf(e)}canvasPaintSelf(e,t){qg.prototype.paintCanvas(e,this,t)}computeShapeBounds(){if(this._stroke){const e=this.getLineCap(),t=this.getLineWidth()/2;if("round"===e)return new Ue.Z(Math.min(this._x1,this._x2)-t,Math.min(this._y1,this._y2)-t,Math.max(this._x1,this._x2)+t,Math.max(this._y1,this._y2)+t);{const i=this._x2-this._x1,s=this._y2-this._y1,n=Math.sqrt(i*i+s*s);if(0===n)return new Ue.Z(this._x1-t,this._y1-t,this._x2+t,this._y2+t);const r=t*i/n,o=t*s/n,A=Ue.Z.NOTHING.copy();return"butt"===e?(A.addCoordinates(this._x1-o,this._y1+r),A.addCoordinates(this._x1+o,this._y1-r),A.addCoordinates(this._x2-o,this._y2+r),A.addCoordinates(this._x2+o,this._y2-r)):(A.addCoordinates(this._x1-r-o,this._y1-o+r),A.addCoordinates(this._x1-r+o,this._y1-o-r),A.addCoordinates(this._x2+r-o,this._y2+o+r),A.addCoordinates(this._x2+r+o,this._y2+o-r)),A}}{const e=Ue.Z.NOTHING.copy();return e.addCoordinates(this._x1,this._y1),e.addCoordinates(this._x2,this._y2),e}}createSVGDrawable(e,t){return Qg.createFromPool(e,t)}createCanvasDrawable(e,t){return qg.createFromPool(e,t)}setShape(e){if(null!==e)throw new Error("Cannot set the shape of a Line to something non-null");return this.invalidatePath(),this}getShape(){return this._shape||(this._shape=this.createLineShape()),this._shape}hasShape(){return!0}mutate(e){return super.mutate(e)}getFillRendererBitmask(){return Te.bitmaskCanvas|Te.bitmaskSVG|Te.bitmaskDOM|Te.bitmaskWebGL}}sr.prototype._mutatorKeys=["p1","p2","x1","y1","x2","y2"].concat(On.prototype._mutatorKeys),sr.prototype.drawableMarkFlags=On.prototype.drawableMarkFlags.concat(["line","p1","p2","x1","x2","y1","y2"]).filter(e=>"shape"!==e),W.register("Line",sr);const nr=un(On);class rr extends nr{constructor(e,t,i,s,n,r,o){super(null,{sizable:!1});let A={};this._rectX=0,this._rectY=0,this._rectWidth=0,this._rectHeight=0,this._cornerXRadius=0,this._cornerYRadius=0,A="object"==typeof e?e instanceof Ue.Z?"number"!=typeof t?(0,Ce.JA)(A,{rectBounds:e},t):(0,Ce.JA)(A,{rectBounds:e,cornerXRadius:t,cornerYRadius:i},s):(0,Ce.JA)(A,e):void 0===r?(0,Ce.JA)(A,{rectX:e,rectY:t,rectWidth:i,rectHeight:s},n):(0,Ce.JA)(A,{rectX:e,rectY:t,rectWidth:i,rectHeight:s,cornerXRadius:n,cornerYRadius:r},o),this.localPreferredWidthProperty.lazyLink(this.updatePreferredSizes.bind(this)),this.localPreferredHeightProperty.lazyLink(this.updatePreferredSizes.bind(this)),this.localMinimumWidthProperty.lazyLink(this.updatePreferredSizes.bind(this)),this.localMinimumHeightProperty.lazyLink(this.updatePreferredSizes.bind(this)),this.mutate(A)}getMaximumArcSize(){return Math.min(this._rectWidth/2,this._rectHeight/2)}getStrokeRendererBitmask(){let e=super.getStrokeRendererBitmask();const t=this.getStroke();return!t||t instanceof ji||t instanceof Wi||this.hasLineDash()||("miter"===this.getLineJoin()||"round"===this.getLineJoin()&&we.borderRadius)&&(e|=Te.bitmaskDOM),this.hasStroke()||(e|=Te.bitmaskWebGL),e}getPathRendererBitmask(){let e=Te.bitmaskCanvas|Te.bitmaskSVG;const t=this.getMaximumArcSize();return(!this.hasStroke()||this.getLineWidth()<=this._rectHeight&&this.getLineWidth()<=this._rectWidth)&&(!this.isRounded()||we.borderRadius&&this._cornerXRadius===this._cornerYRadius)&&this._cornerYRadius<=t&&this._cornerXRadius<=t&&(e|=Te.bitmaskDOM),this.hasStroke()||this.isRounded()||(e|=Te.bitmaskWebGL),e}setRect(e,t,i,s,n,r){const o=void 0!==n,A=void 0!==r;if(!(this._rectX!==e||this._rectY!==t||this._rectWidth!==i||this._rectHeight!==s||o&&this._cornerXRadius!==n||A&&this._cornerYRadius!==r))return this;this._rectX=e,this._rectY=t,this._rectWidth=i,this._rectHeight=s,this._cornerXRadius=o?n:this._cornerXRadius,this._cornerYRadius=A?r:this._cornerYRadius;const a=this._drawables.length;for(let h=0;h<a;h++)this._drawables[h].markDirtyRectangle();return this.invalidateRectangle(),this}setRectX(e){if(this._rectX!==e){this._rectX=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyX();this.invalidateRectangle()}return this}set rectX(e){this.setRectX(e)}get rectX(){return this.getRectX()}getRectX(){return this._rectX}setRectY(e){if(this._rectY!==e){this._rectY=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyY();this.invalidateRectangle()}return this}set rectY(e){this.setRectY(e)}get rectY(){return this.getRectY()}getRectY(){return this._rectY}setRectWidth(e){if(this._rectWidth!==e){this._rectWidth=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyWidth();this.invalidateRectangle()}return this}set rectWidth(e){this.setRectWidth(e)}get rectWidth(){return this.getRectWidth()}getRectWidth(){return this._rectWidth}setRectHeight(e){if(this._rectHeight!==e){this._rectHeight=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyHeight();this.invalidateRectangle()}return this}set rectHeight(e){this.setRectHeight(e)}get rectHeight(){return this.getRectHeight()}getRectHeight(){return this._rectHeight}setCornerXRadius(e){if(this._cornerXRadius!==e){this._cornerXRadius=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyCornerXRadius();this.invalidateRectangle()}return this}set cornerXRadius(e){this.setCornerXRadius(e)}get cornerXRadius(){return this.getCornerXRadius()}getCornerXRadius(){return this._cornerXRadius}setCornerYRadius(e){if(this._cornerYRadius!==e){this._cornerYRadius=e;const t=this._drawables.length;for(let e=0;e<t;e++)this._drawables[e].markDirtyCornerYRadius();this.invalidateRectangle()}return this}set cornerYRadius(e){this.setCornerYRadius(e)}get cornerYRadius(){return this.getCornerYRadius()}getCornerYRadius(){return this._cornerYRadius}setRectBounds(e){return this.setRect(e.x,e.y,e.width,e.height),this}set rectBounds(e){this.setRectBounds(e)}get rectBounds(){return this.getRectBounds()}getRectBounds(){return Ue.Z.rect(this._rectX,this._rectY,this._rectWidth,this._rectHeight)}setRectSize(e){return this.setRectWidth(e.width),this.setRectHeight(e.height),this}set rectSize(e){this.setRectSize(e)}get rectSize(){return this.getRectSize()}getRectSize(){return new hi.Z(this._rectWidth,this._rectHeight)}setRectWidthFromRight(e){if(this._rectWidth!==e){const t=this._rectX+this._rectWidth;this.setRectWidth(e),this.setRectX(t-e)}return this}set rectWidthFromRight(e){this.setRectWidthFromRight(e)}get rectWidthFromRight(){return this.getRectWidth()}setRectHeightFromBottom(e){if(this._rectHeight!==e){const t=this._rectY+this._rectHeight;this.setRectHeight(e),this.setRectY(t-e)}return this}set rectHeightFromBottom(e){this.setRectHeightFromBottom(e)}get rectHeightFromBottom(){return this.getRectHeight()}isRounded(){return 0!==this._cornerXRadius&&0!==this._cornerYRadius}computeShapeBounds(){let e=new Ue.Z(this._rectX,this._rectY,this._rectX+this._rectWidth,this._rectY+this._rectHeight);return this._stroke&&(e=e.dilated(this.getLineWidth()/2)),e}createRectangleShape(){if(this.isRounded()){const e=Math.min(this._rectWidth/2,this._rectHeight/2);return _t.bn.roundRectangle(this._rectX,this._rectY,this._rectWidth,this._rectHeight,Math.min(e,this._cornerXRadius),Math.min(e,this._cornerYRadius)).makeImmutable()}return _t.bn.rectangle(this._rectX,this._rectY,this._rectWidth,this._rectHeight).makeImmutable()}invalidateRectangle(){this._shape=null,this.invalidatePath(),this.invalidateSupportedRenderers()}updatePreferredSizes(){let e=this.localPreferredWidth,t=this.localPreferredHeight;null!==e&&(e=Math.max(e,this.localMinimumWidth||0)),null!==t&&(t=Math.max(t,this.localMinimumHeight||0)),null!==e&&(this.rectWidth=this.hasStroke()?e-this.lineWidth:e),null!==t&&(this.rectHeight=this.hasStroke()?t-this.lineWidth:t)}invalidateStroke(){super.invalidateStroke(),this.updatePreferredSizes()}containsPointSelf(e){const t=this._rectX,i=this._rectY,s=this._rectWidth,n=this._rectHeight,r=this._cornerXRadius,o=this._cornerYRadius,A=this.getLineWidth()/2;let a=!0;if(this._strokePickable){const h=this.isRounded();if(!h&&"bevel"===this.getLineJoin())return super.containsPointSelf(e);const l="miter"===this.getLineJoin()&&!h;a=a&&rr.intersects(t-A,i-A,s+2*A,n+2*A,l?0:r+A,l?0:o+A,e)}return this._fillPickable?this._strokePickable?a:rr.intersects(t,i,s,n,r,o,e):!!this._strokePickable&&(a&&!rr.intersects(t+A,i+A,s-2*A,n-2*A,r-A,o-A,e))}intersectsBoundsSelf(e){return!this.computeShapeBounds().intersection(e).isEmpty()}canvasPaintSelf(e,t){Rg.prototype.paintCanvas(e,this,t)}createDOMDrawable(e,t){return Pg.createFromPool(e,t)}createSVGDrawable(e,t){return Og.createFromPool(e,t)}createCanvasDrawable(e,t){return Rg.createFromPool(e,t)}createWebGLDrawable(e,t){return Ng.createFromPool(e,t)}setShape(e){if(null!==e)throw new Error("Cannot set the shape of a Rectangle to something non-null");return this.invalidatePath(),this}getShape(){return this._shape||(this._shape=this.createRectangleShape()),this._shape}hasShape(){return!0}setCornerRadius(e){return this.setCornerXRadius(e),this.setCornerYRadius(e),this}set cornerRadius(e){this.setCornerRadius(e)}get cornerRadius(){return this.getCornerRadius()}getCornerRadius(){return this._cornerXRadius}mutate(e){return super.mutate(e)}static intersects(e,t,i,s,n,r,o){const A=o.x>=e&&o.x<=e+i&&o.y>=t&&o.y<=t+s;if(!A||n<=0||r<=0)return A;const a=Math.min(i/2,s/2);let h,l;n=Math.min(a,n),r=Math.min(a,r);let g=!1;if(o.x<e+i/2?(h=e+n,g=g||o.x>=h):(h=e+i-n,g=g||o.x<=h),g)return!0;if(o.y<t+s/2?(l=t+r,g=g||o.y>=l):(l=t+s-r,g=g||o.y<=l),g)return!0;let c=o.x-h,d=o.y-l;return c/=n,d/=r,c*=c,d*=d,c+d<=1}static rect(e,t,i,s,n){return new rr(e,t,i,s,0,0,n)}static roundedRect(e,t,i,s,n,r,o){return new rr(e,t,i,s,n,r,o)}static bounds(e,t){return new rr(e.minX,e.minY,e.width,e.height,t)}static roundedBounds(e,t,i,s){return new rr(e.minX,e.minY,e.width,e.height,t,i,s)}static dimension(e,t){return new rr(0,0,e.width,e.height,0,0,t)}}rr.prototype._mutatorKeys=["rectBounds","rectSize","rectX","rectY","rectWidth","rectHeight","cornerRadius","cornerXRadius","cornerYRadius",...nr.prototype._mutatorKeys],rr.prototype.drawableMarkFlags=On.prototype.drawableMarkFlags.concat(["x","y","width","height","cornerXRadius","cornerYRadius"]).filter(e=>"shape"!==e),W.register("Rectangle",rr);class or extends Zs{constructor(e){const t=(0,Ce.ZP)()({sprites:[],spriteInstances:[],hitTestSprites:!1,renderer:"webgl"},e);super(),this._sprites=t.sprites,this._spriteInstances=t.spriteInstances,this._hitTestSprites=t.hitTestSprites,this.setRendererBitmask(Te.bitmaskCanvas|Te.bitmaskWebGL),this.mutate(t)}setCanvasBounds(e){this.invalidateSelf(e)}set canvasBounds(e){this.setCanvasBounds(e)}get canvasBounds(){return this.getCanvasBounds()}getCanvasBounds(){return this.getSelfBounds()}canvasPaintSelf(e,t){Jg.prototype.paintCanvas(e,this,t)}createCanvasDrawable(e,t){return Jg.createFromPool(e,t)}createWebGLDrawable(e,t){return _g.createFromPool(e,t)}containsPointSelf(e){return!!super.containsPointSelf(e)&&(!this._hitTestSprites||!!this.getSpriteInstanceFromPoint(e))}getSpriteInstanceFromPoint(e){for(let t=this._spriteInstances.length-1;t>=0;t--)if(this._spriteInstances[t].containsPoint(e))return this._spriteInstances[t];return null}getSelfShape(){return this._hitTestSprites?_t.bn.union(this._spriteInstances.map(e=>e.getShape())):_t.bn.bounds(this.selfBounds)}isPainted(){return!0}invalidatePaint(){const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirty()}mutate(e){return super.mutate(e)}}or.prototype._mutatorKeys=["canvasBounds"].concat(Zs.prototype._mutatorKeys),W.register("Sprites",or);class Ar extends Zs{constructor(e,t){super(t),this.setRendererBitmask(Te.bitmaskWebGL),this.painterType=e}setCanvasBounds(e){return this.invalidateSelf(e),this}set canvasBounds(e){this.setCanvasBounds(e)}get canvasBounds(){return this.getCanvasBounds()}getCanvasBounds(){return this.getSelfBounds()}isPainted(){return!0}invalidatePaint(){const e=this._drawables.length;for(let t=0;t<e;t++)this._drawables[t].markDirty()}containsPointSelf(e){return!1}getSelfShape(){return new _t.bn}canvasPaintSelf(e,t){}renderToCanvasSelf(e,t){const i=e.canvas.width,s=e.canvas.height,n=document.createElement("canvas");n.width=i,n.height=s;const r={antialias:!0,preserveDrawingBuffer:!0},o=n.getContext("webgl",r)||n.getContext("experimental-webgl",r);ve.applyWebGLContextDefaults(o);const A=(new Le.Z).rowMajor(2/i,0,-1,0,-2/s,1,0,0,1);o.viewport(0,0,i,s);const a=new(0,this.painterType)(o,this);a.paint(t,A),a.dispose(),A.freeToPool(),o.flush(),e.context.setTransform(1,0,0,1,0,0),e.context.drawImage(n,0,0),e.context.restore()}createWebGLDrawable(e,t){return hc.createFromPool(e,t)}mutate(e){return super.mutate(e)}}_defineProperty(Ar,"PAINTED_NOTHING",0),_defineProperty(Ar,"PAINTED_SOMETHING",1),Ar.prototype._mutatorKeys=["canvasBounds"].concat(Zs.prototype._mutatorKeys),W.register("WebGLNode",Ar);class ar extends rr{constructor(e){super(-2e3,-2e3,6e3,6e3,e)}}W.register("Plane",ar);const hr=_s(e=>class extends e{constructor(){super(...arguments)}insertChild(e,t){throw new Error("Attempt to insert child into Leaf")}removeChildWithIndex(e,t){throw new Error("Attempt to remove child from Leaf")}});W.register("Leaf",hr);const lr=hr;class gr extends(lr(Zs)){constructor(e,t,i){super(),this.localBounds=new Ue.Z(0,0,e,t),this.mutate(i)}}W.register("Spacer",gr);W.register("HStrut",class extends gr{constructor(e,t){super(e,0,t)}});class cr extends gr{constructor(e,t){super(0,e,t)}}function dr(e,t,i){i&&_.each(t,t=>{void 0!==i[t]&&(e[t]=i[t])})}W.register("VStrut",cr),P.Z.register("mutate",dr);const ur=dr;let mr=1;const pr=new be.Z(0,0);class Vr extends(Fn(Object)){constructor(e,t,i){const s=(0,Ce.ZP)()({hitTestPixels:!1,pickable:!0,image:e},i);super(),this.id=mr++,this.offset=t,this.pickable=s.pickable,this.shape=null,this.imageData=null,this.setImage(e),ur(this,Object.keys(Fn.DEFAULT_OPTIONS),s)}get width(){return this.imageWidth}get height(){return this.imageHeight}getShape(){if(!this.pickable)return new _t.bn;if(!this.shape){if(this.hitTestPixels){if(this.ensureImageData(),!this.imageData)return new _t.bn;this.shape=Fn.hitTestDataToShape(this.imageData,this.width,this.height)}else{if(!this.width||!this.height)return new _t.bn;this.shape=_t.bn.rect(0,0,this.width,this.height)}this.shape=this.shape.transformed(Le.Z.translation(-this.offset.x,-this.offset.y))}return this.shape}ensureImageData(){!this.imageData&&this.width&&this.height&&(this.imageData=Fn.getHitTestData(this.image,this.width,this.height))}containsPoint(e){if(!this.pickable)return!1;const t=this.width,i=this.height;if(!t&&!i)return!1;const s=pr.set(e).add(this.offset);return!(s.x<0||s.y<0||s.x>t||s.y>i)&&(!this.hitTestPixels||(this.ensureImageData(),!!this.imageData&&Fn.testHitTestData(this.imageData,t,i,s)))}}W.register("SpriteImage",Vr);W.register("Sprite",class{constructor(e){this.imageProperty=new yt.Z(e)}getShape(){return this.imageProperty.value.getShape()}containsPoint(e){return this.imageProperty.value.containsPoint(e)}});class Mr{constructor(e){this.primary=null,this.changeCallback=e,this.notifyChangeCallback=this.notifyChanged.bind(this),this.updateSecondaryListener=this.updateSecondary.bind(this),this.secondaryPropertyCountsMap={}}setPrimary(e){e!==this.primary&&(this.detachPrimary(this.primary),this.primary=e,this.attachPrimary(e),this.notifyChangeCallback())}clean(){this.detachPrimary(this.primary),this.primary=null}updateSecondary(e,t,i){const s=this.secondaryPropertyCountsMap[i.id];for(let n=0;n<s;n++)this.attachSecondary(e);this.notifyChangeCallback()}attachPrimary(e){if(e instanceof ee.Z)this.secondaryLazyLinkProperty(e),this.attachSecondary(e.get());else if(e instanceof le)e.setImmutable();else if(e instanceof ji)for(let t=0;t<e.stops.length;t++)this.attachPrimary(e.stops[t].color)}detachPrimary(e){if(e instanceof ee.Z)this.secondaryUnlinkProperty(e);else if(e instanceof ji)for(let t=0;t<e.stops.length;t++)this.detachPrimary(e.stops[t].color)}attachSecondary(e){e instanceof le&&e.setImmutable()}notifyChanged(){this.primary instanceof ji&&this.primary.invalidateCanvasGradient(),this.changeCallback()}secondaryLazyLinkProperty(e){const t=e.id;this.secondaryPropertyCountsMap[t]?this.secondaryPropertyCountsMap[t]++:(this.secondaryPropertyCountsMap[t]=1,e.lazyLink(this.updateSecondaryListener))}secondaryUnlinkProperty(e){const t=e.id,i=--this.secondaryPropertyCountsMap[t];0===i&&(delete this.secondaryPropertyCountsMap[t],e.isDisposed||e.unlink(this.updateSecondaryListener))}}W.register("PaintObserver",Mr);const Br=Mr;class wr extends yt.Z{constructor(e,t){const i=ns.toColor(e),s=(0,Ce.ZP)()({luminanceFactor:0,valueComparisonStrategy:"equalsFunction"},t);super(i,s),this._paint=null,this._luminanceFactor=s.luminanceFactor,this._changeListener=this.invalidatePaint.bind(this),this._paintObserver=new Br(this._changeListener),this.setPaint(e)}setPaint(e){this._paint=e,this._paintObserver.setPrimary(e)}set paint(e){this.setPaint(e)}get paint(){return this.getPaint()}getPaint(){return this._paint}setLuminanceFactor(e){this.luminanceFactor!==e&&(this._luminanceFactor=e,this.invalidatePaint())}set luminanceFactor(e){this.setLuminanceFactor(e)}get luminanceFactor(){return this.getLuminanceFactor()}getLuminanceFactor(){return this._luminanceFactor}invalidatePaint(){this.value=ns.toColor(this._paint).colorUtilsBrightness(this._luminanceFactor)}dispose(){this.paint=null,super.dispose()}}W.register("PaintColorProperty",wr);class Cr{constructor(){this.initialize()}initialize(){this.svgBlock=null,this.fillStyle="none",this.strokeStyle="none",this.fillPaint=null,this.strokePaint=null,this.updateBaseStyle(),this.strokeDetailStyle=""}dispose(){this.releaseFillPaint(),this.releaseStrokePaint()}releaseFillPaint(){this.fillPaint&&(this.svgBlock.decrementPaint(this.fillPaint),this.fillPaint=null)}releaseStrokePaint(){this.strokePaint&&(this.svgBlock.decrementPaint(this.strokePaint),this.strokePaint=null)}updateFill(e,t){const i=Er(t,e);t!==this.fillPaint&&(this.releaseFillPaint(),t&&t.isPaint&&(this.fillPaint=t,e.incrementPaint(t))),i!==this.fillStyle&&(this.fillStyle=i,this.updateBaseStyle())}updateStroke(e,t){const i=Er(t,e);t!==this.strokePaint&&(this.releaseStrokePaint(),t&&t.isPaint&&(this.strokePaint=t,e.incrementPaint(t))),i!==this.strokeStyle&&(this.strokeStyle=i,this.updateBaseStyle())}updateBaseStyle(){this.baseStyle=`fill: ${this.fillStyle}; stroke: ${this.strokeStyle};`}updateStrokeDetailStyle(e){let t="";const i=e.getLineWidth();1!==i&&(t+=`stroke-width: ${i};`);const s=e.getLineCap();"butt"!==s&&(t+=`stroke-linecap: ${s};`);const n=e.getLineJoin();"miter"!==n&&(t+=`stroke-linejoin: ${n};`),t+=`stroke-miterlimit: ${e.getMiterLimit()};`,e.hasLineDash()&&(t+=`stroke-dasharray: ${e.getLineDash().join(",")};`,t+=`stroke-dashoffset: ${e.getLineDashOffset()};`),this.strokeDetailStyle=t}updateSVGBlock(e){const t=this.svgBlock;t&&(this.fillPaint&&t.decrementPaint(this.fillPaint),this.strokePaint&&t.decrementPaint(this.strokePaint)),this.svgBlock=e,this.fillPaint&&e.incrementPaint(this.fillPaint),this.strokePaint&&e.incrementPaint(this.strokePaint)}}function Er(e,t){return e?e.toCSS?e.toCSS():e.isPaint?`url(#${e.id}-${t?t.id:"noblock"})`:e:"none"}W.register("PaintSVGState",Cr);const Yr=Cr,Dr=new le("transparent");class yr{constructor(e,t,i){this.lastColor=null,this.initialize(e,t,i)}isActiveSVGGradientStop(){return!!this.svgGradient}initialize(e,t,i){return this.svgGradient=e,this.color=i,this.ratio=t,this.svgElement=this.svgElement||document.createElementNS(ke,"stop"),this.svgElement.setAttribute("offset",""+t),this.dirty=!0,this.update(),this.propertyListener=this.propertyListener||this.onPropertyChange.bind(this),this.colorListener=this.colorListener||this.markDirty.bind(this),i instanceof ee.Z?(i.lazyLink(this.propertyListener),i.value instanceof le&&(i.value.changeEmitter.addListener(this.colorListener),this.lastColor=i.value)):i instanceof le&&i.changeEmitter.addListener(this.colorListener),this}onPropertyChange(e,t){null!==this.lastColor&&(this.lastColor.changeEmitter.removeListener(this.colorListener),this.lastColor=null),e instanceof le&&(e.changeEmitter.addListener(this.colorListener),this.lastColor=e),this.markDirty()}markDirty(){this.dirty=!0,this.svgGradient.markDirty()}update(){if(!this.dirty)return;this.dirty=!1;let e=this.color;e instanceof ee.Z&&(e=e.value),null===e&&(e="transparent"),"string"==typeof e?Dr.setCSS(e):Dr.set(e);const t=`stop-opacity: ${Dr.a.toFixed(20)};`;Dr.alpha=1;const i=`stop-color: ${Dr.toCSS()};`;this.svgElement.setAttribute("style",`${i} ${t}`)}dispose(){const e=this.color;this.lastColor&&(this.lastColor.changeEmitter.removeListener(this.colorListener),this.lastColor=null),e instanceof ee.Z?e.hasListener(this.propertyListener)&&e.unlink(this.propertyListener):e instanceof le&&e.changeEmitter.removeListener(this.colorListener),this.color=null,this.svgGradient=null,this.freeToPool()}freeToPool(){yr.pool.freeToPool(this)}}u=yr,_defineProperty(yr,"pool",new ti.Z(u)),W.register("SVGGradientStop",yr);const Ir=yr;class qr{constructor(e,t){this.initialize(e,t)}isActiveSVGGradient(){return!!this.svgBlock}initialize(e,t){this.svgBlock=e,this.gradient=t;const i=void 0!==this.definition;this.definition=this.definition||this.createDefinition(),i||this.definition.setAttribute("gradientUnits","userSpaceOnUse"),t.transformMatrix?this.definition.setAttribute("gradientTransform",t.transformMatrix.getSVGTransform()):this.definition.removeAttribute("gradientTransform");const s=t.getSVGStops();this.stops=(0,Ji.Z)(this.stops);for(let n=0;n<s.length;n++){const e=new Ir(this,s[n].ratio,s[n].color);this.stops.push(e),this.definition.appendChild(e.svgElement)}this.dirty=!1}markDirty(){if(!this.dirty){const e=this;this.dirty=!0,e.svgBlock.markDirtyGradient(this)}}update(){if(this.dirty){this.dirty=!1;for(let e=0;e<this.stops.length;e++)this.stops[e].update()}}dispose(){for(let e=0;e<this.stops.length;e++){const t=this.stops[e];this.definition.removeChild(t.svgElement),t.dispose()}(0,Ji.Z)(this.stops),this.svgBlock=null,this.gradient=null,this.freeToPool()}}W.register("SVGGradient",qr);class Gr extends qr{constructor(e,t){super(e,t)}initialize(e,t){super.initialize(e,t);const i=t;return this.definition.setAttribute("x1",""+i.start.x),this.definition.setAttribute("y1",""+i.start.y),this.definition.setAttribute("x2",""+i.end.x),this.definition.setAttribute("y2",""+i.end.y),this}createDefinition(){return document.createElementNS(ke,"linearGradient")}freeToPool(){Gr.pool.freeToPool(this)}}m=Gr,_defineProperty(Gr,"pool",new ti.Z(m)),W.register("SVGLinearGradient",Gr);class Qr extends qr{constructor(e,t){super(e,t)}initialize(e,t){return super.initialize(e,t),this.definition.setAttribute("cx",""+t.largePoint.x),this.definition.setAttribute("cy",""+t.largePoint.y),this.definition.setAttribute("r",""+t.maxRadius),this.definition.setAttribute("fx",""+t.focalPoint.x),this.definition.setAttribute("fy",""+t.focalPoint.y),this}createDefinition(){return document.createElementNS(ke,"radialGradient")}freeToPool(){Qr.pool.freeToPool(this)}}p=Qr,_defineProperty(Qr,"pool",new ti.Z(p)),W.register("SVGRadialGradient",Qr);class Sr{constructor(e){this.initialize(e)}initialize(e){const t=void 0!==this.definition;return this.definition=this.definition||document.createElementNS(ke,"pattern"),t||(this.definition.setAttribute("patternUnits","userSpaceOnUse"),this.definition.setAttribute("patternContentUnits","userSpaceOnUse")),e.transformMatrix?this.definition.setAttribute("patternTransform",e.transformMatrix.getSVGTransform()):this.definition.removeAttribute("patternTransform"),this.definition.setAttribute("x","0"),this.definition.setAttribute("y","0"),this.definition.setAttribute("width",""+e.image.width),this.definition.setAttribute("height",""+e.image.height),this.imageElement=this.imageElement||document.createElementNS(ke,"image"),this.imageElement.setAttribute("x","0"),this.imageElement.setAttribute("y","0"),this.imageElement.setAttribute("width",e.image.width+"px"),this.imageElement.setAttribute("height",e.image.height+"px"),this.imageElement.setAttributeNS(Re,"xlink:href",e.image.src),t||this.definition.appendChild(this.imageElement),this}update(){}dispose(){this.freeToPool()}freeToPool(){Sr.pool.freeToPool(this)}}V=Sr,_defineProperty(Sr,"pool",new ti.Z(V)),W.register("SVGPattern",Sr);class Tr{constructor(e,t){_defineProperty(this,"_matrices",null),_defineProperty(this,"_dirtyIndex",0),_defineProperty(this,"_listeners",[]),_defineProperty(this,"_nodeTransformListeners",[]);const i=(0,Ce.ZP)()({isStatic:!1},t);this._isStatic=i.isStatic,this.trail=e,this._nodeTransformListeners=[];for(let s=1;s<this.trail.length;s++){const t=(e=>()=>{this.onTransformChange(e)})(s-1);this._nodeTransformListeners.push(t),e.nodes[s].transformEmitter.addListener(t)}}dispose(){for(let e=1;e<this.trail.length;e++){const t=this._nodeTransformListeners[e-1];this.trail.nodes[e].transformEmitter.hasListener(t)&&this.trail.nodes[e].transformEmitter.removeListener(t)}}addListener(e){this._listeners.push(e)}removeListener(e){const t=_.indexOf(this._listeners,e);this._listeners.splice(t,1)}notifyListeners(){let e=this._listeners;this._isStatic||(e=e.slice());const t=e.length;for(let i=0;i<t;i++)e[i]()}onTransformChange(e){this._dirtyIndex=Math.min(this._dirtyIndex,e),this.notifyListeners()}getMatrix(){if(null===this._matrices){this._matrices=[];for(let e=1;e<this.trail.length;e++)this._matrices.push(new Le.Z)}if(this._matrices.length<=0)return Le.Z.IDENTITY;const e=this._matrices.length;for(let t=this._dirtyIndex;t<e;t++){const e=this.trail.nodes[t+1].matrix;0===t?this._matrices[t].set(e):(this._matrices[t].set(this._matrices[t-1]),this._matrices[t].multiplyMatrix(e))}return this._dirtyIndex=e,this._matrices[e-1]}get matrix(){return this.getMatrix()}}W.register("TransformTracker",Tr);const xr=Tr;class kr{constructor(e,t){t=(0,Ot.Z)({isStatic:!1},t),this.isStatic=t.isStatic,this.trail=e,this._listeners=[],this.trailVisibleProperty=new Ms.Z(this.trail.isVisible()),this._nodeVisibilityListeners=[];for(let i=0;i<this.trail.length;i++){const t=()=>{this.trailVisibleProperty.set(e.isVisible())};this._nodeVisibilityListeners.push(t),e.nodes[i].visibleProperty.link(t)}this.boundTrailVisibilityChangedListener=this.onVisibilityChange.bind(this),this.trailVisibleProperty.link(this.boundTrailVisibilityChangedListener)}addListener(e){this._listeners.push(e)}removeListener(e){const t=_.indexOf(this._listeners,e);this._listeners.splice(t,1)}dispose(){for(let e=0;e<this.trail.length;e++){const t=this._nodeVisibilityListeners[e];this.trail.nodes[e].visibleProperty.hasListener(t)&&this.trail.nodes[e].visibleProperty.removeListener(t)}this.trailVisibleProperty.unlink(this.boundTrailVisibilityChangedListener)}onVisibilityChange(){this.notifyListeners()}notifyListeners(){let e=this._listeners;this._isStatic||(e=e.slice());const t=e.length;for(let i=0;i<t;i++)e[i]()}}W.register("TrailVisibilityTracker",kr);const Fr=kr,Rr={mutateNode(e,t){t?e.setPDOMAttribute("aria-haspopup",t):e.removePDOMAttribute("aria-haspopup"),e.positionInPDOM=!!t}};W.register("AriaHasPopUpMutator",Rr);const Ur=Rr;class Lr extends Zs{constructor(e){const t=(0,Ce.ZP)()({headingLevel:1},e);super(t),this.tagName="h"+t.headingLevel,this.focusHighlight="invisible";const i={blur:()=>{this.focusable=!1}};this.addInputListener(i),this.disposeFocusableHeadingNode=()=>{this.removeInputListener(i)}}focus(){this.focusable=!0,super.focus()}dispose(){this.disposeFocusableHeadingNode(),super.dispose()}}W.register("FocusableHeadingNode",Lr);class Pr{constructor(e){const t=this;this.outputUtteranceProperty=new yt.Z(new br(document.title,"off")),this.linearDOM=this.getLinearDOMElements(e),this.activeElement=null,this.activeLine=null,this.letterPosition=0,this.positionInLine=0,this.wordPosition=0,this.observers=[],this.keyState={},document.addEventListener("keydown",t=>{let i;this.keyState[t.keyCode]=!0;const s=t.shiftKey?"PREVIOUS":"NEXT";if(this.linearDOM=this.getLinearDOMElements(e),this.updateLiveElementList(),!this.activeElement||"application"!==this.activeElement.getAttribute("role")){if(this.keyState[40]&&!this.keyState[45])i=this.readNextPreviousLine("NEXT");else if(this.keyState[38]&&!this.keyState[45])i=this.readNextPreviousLine("PREVIOUS");else if(this.keyState[72]){const e=["H1","H2","H3","H4","H5","H6"];i=this.readNextPreviousHeading(e,s)}else this.keyState[9]||(this.keyState[39]&&!this.keyState[17]?i=this.readNextPreviousCharacter("NEXT"):this.keyState[37]&&!this.keyState[17]?i=this.readNextPreviousCharacter("PREVIOUS"):this.keyState[37]&&this.keyState[17]?i=this.readNextPreviousWord("PREVIOUS"):this.keyState[39]&&this.keyState[17]?i=this.readNextPreviousWord("NEXT"):this.keyState[45]&&this.keyState[38]?i=this.readActiveLine():this.keyState[49]?i=this.readNextPreviousHeading(["H1"],s):this.keyState[50]?i=this.readNextPreviousHeading(["H2"],s):this.keyState[51]?i=this.readNextPreviousHeading(["H3"],s):this.keyState[52]?i=this.readNextPreviousHeading(["H4"],s):this.keyState[53]?i=this.readNextPreviousHeading(["H5"],s):this.keyState[54]?i=this.readNextPreviousHeading(["H6"],s):this.keyState[70]?i=this.readNextPreviousFormElement(s):this.keyState[66]?i=this.readNextPreviousButton(s):this.keyState[76]?i=this.readNextPreviousList(s):this.keyState[73]?i=this.readNextPreviousListItem(s):this.keyState[45]&&this.keyState[40]&&this.readEntireDocument());this.activeElement&&this.isFocusable(this.activeElement)&&this.activeElement.focus()," "===i&&(i="space"),i&&this.outputUtteranceProperty.set(new br(i,"off"))}}),document.addEventListener("keyup",e=>{this.keyState[e.keyCode]=!1}),document.addEventListener("focusin",(function(e){if(e.target!==t.activeElement){t.activeElement=e.target;const i=!0,s=t.getAccessibleText(this.activeElement,i);if(s){const e=t.activeElement.getAttribute("aria-live");t.outputUtteranceProperty.set(new br(s,e))}}}))}getLinearDOMElements(e){const t=e.getElementsByTagName("*"),i=[];for(let s=0;s<t.length;s++)t[s].nodeType===Node.ELEMENT_NODE&&(i[s]=t[s]);return i}getLiveRole(e){let t=null;return["log","status","alert","progressbar","marquee","timer","assertive","polite"].forEach(i=>{e.getAttribute("aria-live")!==i&&e.getAttribute("role")!==i||(t=i)}),t}getNextPreviousElement(e){this.activeElement||(this.activeElement=this.linearDOM[0]);const t="NEXT"===e?1:-1,i=this.linearDOM.indexOf(this.activeElement)+t;return this.linearDOM[i]}getLabel(e){const t=document.getElementsByTagName("label");let i;return Array.prototype.forEach.call(t,e=>{e.getAttribute("for")&&(i=e)}),i}getAccessibleText(e,t){let i="";if(!e)return"End of Document";if("ScreenView"===e.getAttribute("class"))return null;if("HEADER"===e.tagName)return null;if("SECTION"===e.tagName)return null;if("LABEL"===e.tagName)return null;let s=e;for(;s.parentElement;){if(s.getAttribute("aria-hidden")||s.hidden)return null;s=s.parentElement}if("P"===e.tagName&&(i+=e.textContent),"H1"===e.tagName&&(i+="Heading Level 1, "+e.textContent),"H2"===e.tagName&&(i+="Heading Level 2, "+e.textContent),"H3"===e.tagName&&(i+="Heading Level 3, "+e.textContent),"UL"===e.tagName){const t=e.children.length;i+=`List with ${t} items`}if("LI"===e.tagName&&(i+="List Item: "+e.textContent),"BUTTON"===e.tagName){const t=" Button";if(e.getAttribute("aria-pressed")){let s=" toggle";const n=" pressed",r=" not";s+=t+",","true"===e.getAttribute("aria-pressed")?s+=n:s+=r+n,i+=e.textContent+","+s}else i+=e.textContent+t}if("INPUT"===e.tagName&&("reset"===e.type&&(i+=e.getAttribute("value")+" Button"),"checkbox"===e.type)){const t=this.getLabel(e.id).textContent;if("switch"===e.getAttribute("role")){const s=e.getAttribute("aria-checked");if(s){i+=`${t+", "}switch, ${"true"===s?"On":"Off"}`}}else{const t=e.checked?" Checked":" Not Checked";i+=`${e.textContent} Checkbox${t}`}}if(t){i.length>0&&(i+=",");const t=e.getAttribute("aria-label");t&&(i+=" "+t+",");const n=e.getAttribute("aria-labelledBy");if(n){const e=document.getElementById(n).textContent;i+=" "+e+","}let r;for(s=e;s.parentElement;){if(r=s.getAttribute("role"),"document"===r||"application"===r){i+=" "+r+",";break}s=s.parentElement}e.getAttribute("role")&&(r=e.getAttribute("role"),"button"===r&&(i+=" Button")),e.draggable&&(i+=" draggable,"),"true"===e.getAttribute("aria-grabbed")&&(i+=" grabbed,");const o=e.getAttribute("aria-describedby");if(o){let e,t;o.split(" ").forEach(s=>{e=document.getElementById(s),t=e.textContent,i+=" "+t})}}return","===i[i.length-1]&&(i=i.slice(0,-1)),i}getNextPreviousElementWithPDOMContent(e){let t;for(;!t;)this.activeElement=this.getNextPreviousElement(e),t=this.getAccessibleText(this.activeElement,!1);return this.activeElement}getNextPreviousElementWithRole(e,t){let i=null;const s="NEXT"===t?1:-1;this.activeElement||(this.activeElement=this.linearDOM[0]);let n=this.linearDOM.indexOf(this.activeElement)+s;for(;this.linearDOM[n];){for(let t=0;t<e.length;t++){const s=this.linearDOM[n].tagName,r=this.linearDOM[n].type,o=this.linearDOM[n].getAttribute("role"),A=e[t];if(s===A||o===A||r===A){i=this.linearDOM[n];break}}if(i)break;n+=s}return i}readNextPreviousLine(e){let t="";this.letterPosition=0,this.wordPosition=0,this.activeElement||(this.activeElement=this.getNextPreviousElementWithPDOMContent(e));let i=this.getAccessibleText(this.activeElement,!1).split(" ");if("PREVIOUS"===e&&(this.positionInLine=this.positionInLine-30),!i[this.positionInLine]){this.positionInLine=0;const t=this.activeElement;this.activeElement=this.getNextPreviousElementWithPDOMContent(e),i=this.getAccessibleText(this.activeElement,!1).split(" "),this.activeElement||(this.activeElement=t)}const s=this.positionInLine+15;for(let n=this.positionInLine;n<s;n++)if(i[n]){if(t+=i[n],this.positionInLine+=1,!i[n+1]){this.positionInLine+=15-this.positionInLine%15;break}t+=" "}return this.activeLine=t,t}readActiveLine(){let e="";this.activeLine||(this.activeLine=this.readNextPreviousLine("NEXT"));const t=this.activeLine.split(" ");for(let i=0;i<15;i++)if(t[i]){if(e+=t[i],!t[i+1])break;e+=" "}return e}readNextPreviousWord(e){this.activeLine||(this.activeLine=this.readNextPreviousLine(e));const t=this.activeLine.split(" ");let i,s;"NEXT"===e?(s=t.length,i=1):"PREVIOUS"===e&&(s=0,i=-2),this.wordPosition===s&&(this.activeLine=this.readNextPreviousLine(e));const n=t[this.wordPosition];return this.wordPosition+=i,n}readNextPreviousHeading(e,t){let i,s,n;for(;!i;)n=this.activeElement,s=this.getNextPreviousElementWithRole(e,t),this.activeElement=s,i=this.getAccessibleText(s);if(!s){this.activeElement=n;const i="NEXT"===t?"more":"previous";if(1===e.length){const t=`No ${i} headings at `,s=e[0];return t+("H1"===s?"Level 1":"H2"===s?"Level 2":"H3"===s?"Level 3":"H4"===s?"Level 4":"H5"===s?"Level 5":"Level 6")}return`No ${i} headings`}return this.activeElement=s,i}readNextPreviousButton(e){const t=["button","BUTTON","submit","reset"];let i,s,n;for(;!s;)n=this.activeElement,i=this.getNextPreviousElementWithRole(t,e),this.activeElement=i,s=this.getAccessibleText(i,!0);if(!i){return this.activeElement=n,`No ${"NEXT"===e?"more":"previous"} buttons`}return this.activeElement=i,s}readNextPreviousFormElement(e){const t=["INPUT","BUTTON"].concat(["button"]);let i,s,n;for(;!s;)n=this.activeElement,i=this.getNextPreviousElementWithRole(t,e),this.activeElement=i,s=this.getAccessibleText(i,!0);if("End of Document"===s){return this.activeElement=n,`No ${"NEXT"===e?"next":"previous"} form field`}return this.activeElement=i,s}readNextPreviousListItem(e){let t;this.activeElement||(this.activeElement=this.getNextPreviousElementWithPDOMContent(e));const i=this.activeElement.parentElement;if("UL"===i.tagName||"OL"===i.tagName){const s="NEXT"===e?1:-1;let n=Array.prototype.indexOf.call(i.children,this.activeElement)+s;for(;i.children[n];){if(t=this.getAccessibleText(i.children[n]),t){this.activeElement=i.children[n];break}n+=s}t||(t=this.readNextPreviousList(e))}else t=this.readNextPreviousList(e);if(!t){return`No ${"NEXT"===e?"more":"previous"} list items`}return t}readNextPreviousList(e){this.activeElement||(this.activeElement=this.getNextPreviousElementWithPDOMContent(e));const t=this.activeElement.parentElement;let i;"UL"!==t.tagName&&"OL"!==t.tagName||(i=this.activeElement,this.activeElement=t);const s=this.getNextPreviousElementWithRole(["UL","OL"],e);if(!s){return i&&(this.activeElement=i),`No ${"NEXT"===e?"more":"previous"} lists`}const n=this.getAccessibleText(s);let r="";const o=s.children[0];return o&&(r=this.getAccessibleText(o),this.activeElement=o),`${n}, ${r}`}readNextPreviousCharacter(e){let t,i,s;this.activeLine||(this.activeLine=this.readNextPreviousLine("NEXT")),"NEXT"===e?(t=this.activeLine.length,i=1,s=0):"PREVIOUS"===e&&(t=2,i=-1,s=-2),this.letterPosition===t&&(this.activeLine=this.readNextPreviousLine(e),this.letterPosition=this.activeLine.length);const n=this.activeLine[this.letterPosition+s];return this.letterPosition+=i,n}updateLiveElementList(){for(let e=0;e<this.observers.length;e++)this.observers[e]&&this.observers[e].disconnect();this.observers=[];for(let e=0;e<this.linearDOM.length;e++){const t=this.linearDOM[e];if(this.getLiveRole(t)){const e=e=>{e.forEach(e=>{let t,i=e.target;for(;!t;)t=this.getLiveRole(i),i=i.parentElement;if(e.addedNodes[0]){const i=e.addedNodes[0].data;this.outputUtteranceProperty.set(new br(i,t))}})},i=new MutationObserver(t=>{e(t)}),s={childList:!0,subtree:!0};i.observe(t,s),this.observers.push(i)}}}readEntireDocument(){let e=this.getAccessibleText(this.activeElement),t=this.activeElement;for(;"End of Document"!==e;)t=this.activeElement,e=this.readNextPreviousLine("NEXT"),"End of Document"===e&&(this.activeElement=t),this.outputUtteranceProperty.set(new br(e,"polite"))}isFocusable(e){let t=!1;return["tabindex","BUTTON","INPUT"].forEach(i=>{(e.getAttribute(i)||e.tagName===i)&&(t=!0)}),t}}W.register("Cursor",Pr);class br{constructor(e,t){this.text=e,this.liveRole=t}}var Or=i(3061);class fr{constructor(e){this.speakingStartedEmitter=new Or.Z({parameters:[{valueType:Object}]}),this.speakingEndedEmitter=new Or.Z({parameters:[{valueType:Object}]}),this.speaking=!1,this.politeUtterances=[];const t=navigator.userAgent,i=t.match(/Windows/),s=!!(t.match(/Version\/[5-9]\./)&&t.match(/Safari\//)&&t.match(/AppleWebKit/));window.speechSynthesis&&SpeechSynthesisUtterance&&window.speechSynthesis.speak?(this.synth=window.speechSynthesis,e.outputUtteranceProperty.link(e=>{const t=new SpeechSynthesisUtterance(e.text);let n;if(t.addEventListener("start",t=>{this.speakingStartedEmitter.emit(e)}),t.addEventListener("end",t=>{this.speakingEndedEmitter.emit(e)}),this.synth.getVoices().forEach(e=>{e.default&&(n=e)}),t.voice=n,t.rate=1.2,"assertive"!==e.liveRole&&"off"!==e.liveRole&&e.liveRole){if("polite"===e.liveRole)if(s){this.politeUtterances.push(t);const e=()=>{this.speaking=!0;const e=this.politeUtterances.shift();e?this.synth.speak(e):this.speaking=!1};if(this.speaking)setTimeout(()=>{e()},2e3);else{this.synth.speak(t);const e=this.politeUtterances.indexOf(t);e>0&&this.politeUtterances.splice(e,1)}}else this.synth.speak(t)}else this.politeUtterances=[],this.speaking=!0,i?(this.synth.pause(),this.synth.cancel(),this.synth.speak(t),this.synth.resume()):(this.synth.cancel(),this.synth.speak(t))})):e.outputUtteranceProperty.link(()=>{this.speakingStartedEmitter.emit({text:"Sorry! Web Speech API not supported on this platform."})})}}W.register("Reader",fr);var Zr=i(5281),Nr=i(2221),Kr=i(2976);class Jr{constructor(e){var t,i;_defineProperty(this,"keyState",{}),_defineProperty(this,"_lastKeyDown",null),_defineProperty(this,"attachedToDocument",!1),_defineProperty(this,"documentKeyupListener",null),_defineProperty(this,"documentKeydownListener",null),_defineProperty(this,"_enabled",!0),_defineProperty(this,"keydownEmitter",new Or.Z({parameters:[{valueType:KeyboardEvent}]})),_defineProperty(this,"keyupEmitter",new Or.Z({parameters:[{valueType:KeyboardEvent}]})),this.keydownUpdateAction=new Zr.Z(e=>{const t=lt.getEventCode(e);if(t){if(this.correctModifierKeys(e),!this.isKeyDown(t)){const t=lt.getEventCode(e);this.keyState[t]={keyDown:!0,key:t,timeDown:0}}this._lastKeyDown=t,this.keydownEmitter.emit(e)}},{phetioPlayback:!0,tandem:null==e||null===(t=e.tandem)||void 0===t?void 0:t.createTandem("keydownUpdateAction"),parameters:[{name:"event",phetioType:Mt}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Action that executes whenever a keydown occurs from the input listeners this keyStateTracker adds (most likely to the document)."}),this.keyupUpdateAction=new Zr.Z(e=>{const t=lt.getEventCode(e);t&&(this.correctModifierKeys(e),this.isKeyDown(t)&&delete this.keyState[t],Oe.Z.mac&&lt.isMetaKey(e)&&this.clearState(),this.keyupEmitter.emit(e))},{phetioPlayback:!0,tandem:null==e||null===(i=e.tandem)||void 0===i?void 0:i.createTandem("keyupUpdateAction"),parameters:[{name:"event",phetioType:Mt}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Action that executes whenever a keyup occurs from the input listeners this keyStateTracker adds (most likely to the document)."});const s=this.step.bind(this);Nr.Z.addListener(s),this.disposeKeyStateTracker=()=>{Nr.Z.removeListener(s),this.attachedToDocument&&this.detachFromDocument()}}keydownUpdate(e){this.enabled&&this.keydownUpdateAction.execute(e)}correctModifierKeys(e){const t=lt.getEventCode(e);!e.shiftKey||lt.isShiftKey(e)||this.shiftKeyDown||(this.keyState[lt.KEY_SHIFT_LEFT]={keyDown:!0,key:t,timeDown:0}),!e.altKey||lt.isAltKey(e)||this.altKeyDown||(this.keyState[lt.KEY_ALT_LEFT]={keyDown:!0,key:t,timeDown:0}),!e.ctrlKey||lt.isControlKey(e)||this.ctrlKeyDown||(this.keyState[lt.KEY_CONTROL_LEFT]={keyDown:!0,key:t,timeDown:0}),!e.shiftKey&&this.shiftKeyDown&&(delete this.keyState[lt.KEY_SHIFT_LEFT],delete this.keyState[lt.KEY_SHIFT_RIGHT]),!e.altKey&&this.altKeyDown&&(delete this.keyState[lt.KEY_ALT_LEFT],delete this.keyState[lt.KEY_ALT_RIGHT]),!e.ctrlKey&&this.ctrlKeyDown&&(delete this.keyState[lt.KEY_CONTROL_LEFT],delete this.keyState[lt.KEY_CONTROL_RIGHT])}keyupUpdate(e){this.enabled&&this.keyupUpdateAction.execute(e)}get movementKeysDown(){return this.isAnyKeyInListDown(lt.MOVEMENT_KEYS)}getLastKeyDown(){return this._lastKeyDown}isKeyDown(e){return!!this.keyState[e]&&this.keyState[e].keyDown}isAnyKeyInListDown(e){for(let t=0;t<e.length;t++)if(this.isKeyDown(e[t]))return!0;return!1}areKeysDown(e){for(let t=0;t<e.length;t++)if(!this.isKeyDown(e[t]))return!1;return!0}areKeysExclusivelyDown(e){const t=Object.keys(this.keyState);if(t.length!==e.length)return!1;let i=!0;for(let s=0;s<e.length;s++){const n=e[s];let r=[n];lt.isModifierKey(n)&&(r=lt.MODIFIER_KEY_TO_CODE_MAP.get(n)),0===_.intersection(t,r).length&&(i=!1)}return i}areKeysDownWithoutExtraModifiers(e){for(let t=0;t<lt.MODIFIER_KEY_CODES.length;t++){const i=lt.MODIFIER_KEY_CODES[t];if(this.isKeyDown(i)&&!e.includes(i))return!1}return this.areKeysDown(e)}keysAreDown(){return Object.keys(this.keyState).length>0}get enterKeyDown(){return this.isKeyDown(lt.KEY_ENTER)}get shiftKeyDown(){return this.isAnyKeyInListDown(lt.SHIFT_KEYS)}get altKeyDown(){return this.isAnyKeyInListDown(lt.ALT_KEYS)}get ctrlKeyDown(){return this.isAnyKeyInListDown(lt.CONTROL_KEYS)}timeDownForKey(e){return this.keyState[e].timeDown}clearState(){this.keyState={}}step(e){if(this.keysAreDown()){const t=1e3*e;for(const e in this.keyState)this.keyState.hasOwnProperty(e)&&this.keyState[e].keyDown&&(this.keyState[e].timeDown+=t)}}attachToWindow(){this.documentKeydownListener=e=>{this.keydownUpdate(e)},this.documentKeyupListener=e=>{this.keyupUpdate(e)};const e=()=>{window.addEventListener("keyup",this.documentKeyupListener,{capture:!0}),window.addEventListener("keydown",this.documentKeydownListener,{capture:!0}),this.attachedToDocument=!0};if(document)e();else{const t=()=>{e(),window.removeEventListener("load",t)};window.addEventListener("load",t)}}setEnabled(e){this._enabled!==e&&(this._enabled=e,!e&&this.clearState())}set enabled(e){this.setEnabled(e)}get enabled(){return this.isEnabled()}isEnabled(){return this._enabled}detachFromDocument(){window.removeEventListener("keyup",this.documentKeyupListener),window.removeEventListener("keydown",this.documentKeydownListener),this.documentKeyupListener=null,this.documentKeydownListener=null,this.attachedToDocument=!1}dispose(){this.disposeKeyStateTracker()}}W.register("KeyStateTracker",Jr);const jr=Jr;const vr=new class extends jr{constructor(e){super(e)}}({tandem:Kt.Z.GENERAL_CONTROLLER.createTandem("keyStateTracker")});W.register("globalKeyStateTracker",vr);const Hr=vr,Wr=["interactiveHighlight","interactiveHighlightLayerable","interactiveHighlightEnabled"],zr=_s(e=>{const t=Un("InteractiveHighlightingClass",Wr,class extends e{constructor(){super(...arguments),this._activationListener={enter:this._onPointerEntered.bind(this),over:this._onPointerOver.bind(this),move:this._onPointerMove.bind(this),exit:this._onPointerExited.bind(this),down:this._onPointerDown.bind(this)},this._pointer=null,this.displays={},this._interactiveHighlight=null,this._interactiveHighlightLayerable=!1,this._interactiveHighlightEnabled=!0,this.interactiveHighlightChangedEmitter=new te.Z,this._changedInstanceListener=this.onChangedInstance.bind(this),this.changedInstanceEmitter.addListener(this._changedInstanceListener),this._interactiveHighlightingEnabledListener=this._onInteractiveHighlightingEnabledChange.bind(this);const e=this._onPointerRelease.bind(this),t=this._onPointerCancel.bind(this);this._pointerListener={up:e,cancel:t,interrupt:t}}get isInteractiveHighlighting(){return!0}static get _mixesInteractiveHighlighting(){return!0}setInteractiveHighlight(e){this._interactiveHighlight!==e&&(this._interactiveHighlight=e,this._interactiveHighlightLayerable&&(e.visible=!1),this.interactiveHighlightChangedEmitter.emit())}set interactiveHighlight(e){this.setInteractiveHighlight(e)}get interactiveHighlight(){return this.getInteractiveHighlight()}getInteractiveHighlight(){return this._interactiveHighlight}setInteractiveHighlightLayerable(e){this._interactiveHighlightLayerable!==e&&(this._interactiveHighlightLayerable=e,this._interactiveHighlight&&(this._interactiveHighlight.visible=!1,this.interactiveHighlightChangedEmitter.emit()))}set interactiveHighlightLayerable(e){this.setInteractiveHighlightLayerable(e)}get interactiveHighlightLayerable(){return this.getInteractiveHighlightLayerable()}getInteractiveHighlightLayerable(){return this._interactiveHighlightLayerable}setInteractiveHighlightEnabled(e){this._interactiveHighlightEnabled=e;const t=Object.keys(this.displays);for(let i=0;i<t.length;i++){const e=this.displays[t[i]];this._interactiveHighlightingEnabledListener(e.focusManager.pointerHighlightsVisibleProperty.value)}}getInteractiveHighlightEnabled(){return this._interactiveHighlightEnabled}set interactiveHighlightEnabled(e){this.setInteractiveHighlightEnabled(e)}get interactiveHighlightEnabled(){return this.getInteractiveHighlightEnabled()}isInteractiveHighlightActivated(){let e=!1;const t=Object.keys(this.displays);for(let i=0;i<t.length;i++){const s=this.displays[t[i]].focusManager.pointerFocusProperty.value;if(s&&s.trail.lastNode()===this){e=!0;break}}return e}get interactiveHighlightActivated(){return this.isInteractiveHighlightActivated()}dispose(){this.changedInstanceEmitter.removeListener(this._changedInstanceListener),this.hasInputListener(this._activationListener)&&this.removeInputListener(this._activationListener);const e=Object.keys(this.displays);for(let t=0;t<e.length;t++){this.displays[e[t]].focusManager.pointerHighlightsVisibleProperty.unlink(this._interactiveHighlightingEnabledListener),delete this.displays[e[t]]}super.dispose&&super.dispose()}_onPointerOver(e){const t=e.trail.nodes.find(e=>e.groupFocusHighlight&&e.isInteractiveHighlighting);if(t){const i=e.trail.subtrailTo(t),s=Object.values(this.displays);for(let e=0;e<s.length;e++){const t=s[e];null===t.focusManager.pointerFocusProperty.value&&t.focusManager.pointerFocusProperty.set(new ze(t,i))}}}_onPointerEntered(e){const t=Object.values(this.displays);for(let i=0;i<t.length;i++){const s=t[i];null!==s.focusManager.pointerFocusProperty.value&&e.trail.equals(s.focusManager.pointerFocusProperty.value.trail)||s.focusManager.pointerFocusProperty.set(new ze(s,e.trail))}}_onPointerMove(e){const t=Object.values(this.displays);for(let i=0;i<t.length;i++){const s=t[i],n=e.trail.subtrailTo(this);null!==s.focusManager.pointerFocusProperty.value&&n.equals(s.focusManager.pointerFocusProperty.value.trail)||this.getDescendantsUseHighlighting(e.trail)||s.focusManager.pointerFocusProperty.set(new ze(s,n))}}_onPointerExited(e){const t=Object.values(this.displays);for(let i=0;i<t.length;i++){const s=t[i];s.focusManager.pointerFocusProperty.set(null);const n=s.focusManager.lockedPointerFocusProperty.value;e.trail.isPickable()||null!==n&&!e.trail.containsNode(n.trail.lastNode())||this._onPointerRelease(e)}}_onPointerDown(e){if(null===this._pointer){const t=Object.values(this.displays);for(let e=0;e<t.length;e++){const i=t[e],s=i.focusManager.pointerFocusProperty.value;s&&i.focusManager.lockedPointerFocusProperty.set(new ze(s.display,s.trail.copy()))}this._pointer=e.pointer,this._pointer.addInputListener(this._pointerListener)}}_onPointerRelease(e){const t=Object.values(this.displays);for(let i=0;i<t.length;i++){t[i].focusManager.lockedPointerFocusProperty.value=null}this._pointer&&this._pointer.listeners.includes(this._pointerListener)&&(this._pointer.removeInputListener(this._pointerListener),this._pointer=null)}_onPointerCancel(e){const t=Object.values(this.displays);for(let i=0;i<t.length;i++){t[i].focusManager.pointerFocusProperty.set(null)}this._onPointerRelease(e)}_onInteractiveHighlightingEnabledChange(e){const t=e&&this._interactiveHighlightEnabled,i=this.hasInputListener(this._activationListener);t&&!i?this.addInputListener(this._activationListener):!t&&i&&this.removeInputListener(this._activationListener)}onChangedInstance(e,t){if(t)this.displays[e.trail.uniqueId]=e.display,e.display.focusManager.pointerHighlightsVisibleProperty.hasListener(this._interactiveHighlightingEnabledListener)||e.display.focusManager.pointerHighlightsVisibleProperty.link(this._interactiveHighlightingEnabledListener);else{const t=this.displays[e.trail.uniqueId];t&&0===e.node.instances.length&&t.focusManager.pointerHighlightsVisibleProperty.unlink(this._interactiveHighlightingEnabledListener),delete this.displays[e.trail.uniqueId]}}getDescendantsUseHighlighting(e){const t=e.nodes.indexOf(this),i=e.nodes.slice(t+1,e.nodes.length);let s=!1;for(let n=0;n<i.length;n++)if(i[n].isInteractiveHighlighting){s=!0;break}return s}mutate(e){return super.mutate(e)}});return t.prototype._mutatorKeys=Wr.concat(t.prototype._mutatorKeys),t});W.register("InteractiveHighlighting",zr);const Xr=zr;class _r extends(Xr(Zs)){constructor(e){super(e)}}W.register("InteractiveHighlightingNode",_r);const $r=_r;var eo=i(621);class to extends eo.Z{constructor(e){super((0,Ce.ZP)()({respectResponseCollectorProperties:!0,phetioDocumentation:"Announcer that manages the voicing feature, providing audio responses via WebAudio."},e))}initialize(e,t){super.initialize(e,t),Hr.keyupEmitter.addListener(e=>{lt.isControlKey(e)&&this.cancel()})}voicingSupportedForLocale(e){return e.startsWith("en")}}const io=new to;W.register("voicingManager",io);const so=io;var no=i(2391),ro=i(6692);let oo=1;class Ao extends ei.Z{constructor(e){super(),this.attributeString=e}}function ao(e){const t=e.attributeString,i=document.createElement("div");for(let s=1;s<=4;s++){const e=document.createElement("p");e.setAttribute("id",`elements-${oo}-${t}-${s}`),e.setAttribute("aria-live",t),i.appendChild(e)}return i}_defineProperty(Ao,"POLITE",new(M=Ao)("polite")),_defineProperty(Ao,"ASSERTIVE",new M("assertive")),_defineProperty(Ao,"enumeration",new $t.Z(M));class ho extends no.Z{constructor(e){const t=(0,Ce.ZP)()({respectResponseCollectorProperties:!1,lang:"en"},e);super(t),this.politeElementIndex=0,this.assertiveElementIndex=0,this.ariaLiveContainer=document.createElement("div"),this.ariaLiveContainer.setAttribute("lang",t.lang),this.ariaLiveContainer.setAttribute("id","aria-live-elements-"+oo),this.ariaLiveContainer.setAttribute("style","position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; clip: rect(0px 0px 0px 0px); pointer-events: none;");const i=ao(Ao.POLITE),s=ao(Ao.ASSERTIVE);this.ariaLiveContainer.appendChild(i),this.ariaLiveContainer.appendChild(s),this.politeElements=Array.from(i.children),this.assertiveElements=Array.from(s.children),oo++}announce(e,t,i){const s=(0,Ce.ZP)()({ariaLivePriority:Ao.POLITE},i);if(this.hasSpoken=!0,e)if(s.ariaLivePriority===Ao.POLITE){const i=this.politeElements[this.politeElementIndex];this.updateLiveElement(i,e,t),this.politeElementIndex=(this.politeElementIndex+1)%this.politeElements.length}else if(s.ariaLivePriority===Ao.ASSERTIVE){const i=this.assertiveElements[this.assertiveElementIndex];this.updateLiveElement(i,e,t),this.assertiveElementIndex=(this.assertiveElementIndex+1)%this.assertiveElements.length}this.announcementCompleteEmitter.emit(t,e)}cancel(){}cancelUtterance(e){}updateLiveElement(e,t,i){e.textContent="",e.hidden=!1,this.readyToAnnounce=!1,Nr.Z.setTimeout(()=>{i.predicate()?(Fi.setTextContent(e,t),Nr.Z.setTimeout(()=>{Oe.Z.safari?e.hidden=!0:e.textContent="",this.readyToAnnounce=!0},ho.ARIA_LIVE_DELAY)):this.readyToAnnounce=!0},0)}}_defineProperty(ho,"ARIA_LIVE_DELAY",200),_defineProperty(ho,"AriaLive",Ao),ro.Z.register("AriaLiveAnnouncer",ho);const lo=ho;var go=i(428);class co{constructor(e){this.utterance=e,this.timeInQueue=0,this.stableTime=0,this.announcingUtterancePriorityListener=null}resetTimingVariables(){this.timeInQueue=0,this.stableTime=0}}ro.Z.register("UtteranceWrapper",co);const uo=co;class mo extends Ee.Z{constructor(e,t){const i=(0,Ce.ZP)()({debug:!1,initialize:!0,featureSpecificAnnouncingControlPropertyName:null},t);super(i),this.announcer=e,this._initialized=i.initialize,this.featureSpecificAnnouncingControlPropertyName=i.featureSpecificAnnouncingControlPropertyName,this.queue=[],this._muted=!1,this._enabled=!0,this.utteranceToPriorityListenerMap=new Map,this.announcingUtteranceWrapper=null,this.debug=i.debug,this.announcer.announcementCompleteEmitter.addListener(e=>{if(this.announcingUtteranceWrapper&&e===this.announcingUtteranceWrapper.utterance){const e=this.announcingUtteranceWrapper.announcingUtterancePriorityListener;this.announcingUtteranceWrapper.utterance.priorityProperty.hasListener(e)&&(this.announcingUtteranceWrapper.utterance.priorityProperty.unlink(e),this.announcingUtteranceWrapper.announcingUtterancePriorityListener=null,this.announcingUtteranceWrapper=null)}}),this.stepQueueListener=null,this._initialized&&(this.stepQueueListener=this.stepQueue.bind(this),Nr.Z.addListener(this.stepQueueListener))}get length(){return this.queue.length}addToBack(e){if(this.initializedAndEnabled)if(this.announcer.hasSpoken){const t=this.prepareUtterance(e);this.queue.push(t),this.debug&&console.log("addToBack"),this.addPriorityListenerAndPrioritizeQueue(t)}else this.announceImmediately(e)}addToFront(e){if((0,Ss.Z)("`addToFront()` has been deprecated because it is confusing, and most of the time doesn't do what is expected, because Utterances are announced based on time-in-queue first, and then position in the queue. It is recommended to use addToBack, and then timing variables on Utterances, or instead call queue.clear() before adding a more important alert to the queue."),!this.initializedAndEnabled)return;const t=this.prepareUtterance(e);this.queue.unshift(t)}addPriorityListenerAndPrioritizeQueue(e){const t=()=>{this.prioritizeUtterances(e)};e.utterance.priorityProperty.lazyLink(t),this.utteranceToPriorityListenerMap.set(e.utterance,t),this.prioritizeUtterances(e)}prepareUtterance(e){e instanceof go.Z||(e=new go.Z({alert:e}));const t=new uo(e);return this.removeOthersAndUpdateUtteranceWrapper(t),t.stableTime=0,t}removeUtterance(e){const t=t=>t.utterance===e,i=_.remove(this.queue,t);this.removePriorityListeners(i)}prioritizeUtterances(e){let t=this.queue.indexOf(e);const i=t>=0;let s;s=i?t-1:-1;for(let n=s;n>=0;n--){const t=this.queue[n];this.shouldUtteranceCancelOther(e.utterance,t.utterance)&&this.removeUtterance(t.utterance)}if(i){t=this.queue.indexOf(e);const i=this.queue[t+1];i&&this.shouldUtteranceCancelOther(i.utterance,e.utterance)&&this.removeUtterance(e.utterance)}this.queue.length>0&&this.announcer.onUtterancePriorityChange(this.queue[0].utterance)}shouldUtteranceCancelOther(e,t){return this.announcer.shouldUtteranceCancelOther(e,t)}removeOthersAndUpdateUtteranceWrapper(e){const t=[];for(let s=0;s<this.queue.length;s++){const i=this.queue[s];i.utterance===e.utterance&&t.push(i.timeInQueue)}t.length>=1&&(e.timeInQueue=Math.max(...t));const i=_.remove(this.queue,t=>t.utterance===e.utterance);this.removePriorityListeners(i)}get initializedAndEnabled(){return this._enabled&&this._initialized}getNextUtterance(){let e=null;for(let t=0;t<this.queue.length;t++){const i=this.queue[t];if(i.stableTime>i.utterance.alertStableDelay||i.timeInQueue>i.utterance.alertMaximumDelay){e=i;break}}return e}hasUtterance(e){for(let t=0;t<this.queue.length;t++){if(e===this.queue[t].utterance)return!0}return!1}clear(){this.debug&&console.log("UttearnceQueue.clear()"),this.removePriorityListeners(this.queue),this.queue.length=0}cancelUtterance(e){this.announcer.cancelUtterance(e),this.hasUtterance(e)&&this.removeUtterance(e)}cancel(){this.debug&&console.log("UtteranceQueue.cancel()"),this.clear(),this.announcer.cancel()}removePriorityListeners(e){e.forEach(e=>this.removePriorityListener(e.utterance))}removePriorityListener(e){const t=this.utteranceToPriorityListenerMap.get(e);t&&(e.priorityProperty.unlink(t),this.utteranceToPriorityListenerMap.delete(e))}setMuted(e){this._muted=e}set muted(e){this.setMuted(e)}get muted(){return this.getMuted()}getMuted(){return this._muted}setEnabled(e){this._enabled=e}set enabled(e){this.setEnabled(e)}get enabled(){return this.isEnabled()}isEnabled(){return this._enabled}stepQueue(e){if(this._enabled&&(e*=1e3,this.queue.length>0)){for(let i=0;i<this.queue.length;i++){const t=this.queue[i];t.timeInQueue+=e,t.stableTime+=e}const t=this.getNextUtterance();t&&this.attemptToAnnounce(t)}}announceImmediately(e){if(this.initializedAndEnabled&&(this.debug&&console.log("announceImmediately"),e instanceof go.Z||(e=new go.Z({alert:e})),null===this.announcingUtteranceWrapper||this.announcer.shouldUtteranceCancelOther(e,this.announcingUtteranceWrapper.utterance))){const t=this.prepareUtterance(e);t.stableTime=Number.POSITIVE_INFINITY,t.timeInQueue=Number.POSITIVE_INFINITY,this.queue.unshift(t),this.addPriorityListenerAndPrioritizeQueue(t),this.queue.includes(t)&&this.attemptToAnnounce(t)}}attemptToAnnounce(e){const t=e.utterance;if(this.announcer.readyToAnnounce){const i=t.getAlertText(this.announcer.respectResponseCollectorProperties);this.debug&&console.log("ready to announce in attemptToAnnounce(): ",i);const s=!this.featureSpecificAnnouncingControlPropertyName||t[this.featureSpecificAnnouncingControlPropertyName].value,n=t.canAnnounceProperty.value&&t.predicate()&&s;!this._muted&&n&&""!==i?(this.announcingUtteranceWrapper=e,this.announcingUtteranceWrapper.announcingUtterancePriorityListener=()=>{this.prioritizeUtterances(e)},e.utterance.priorityProperty.link(this.announcingUtteranceWrapper.announcingUtterancePriorityListener),this.debug&&console.log("announcing: ",i),this.announcer.announce(i,t,t.announcerOptions)):this.debug&&console.log("announcer readyToAnnounce but utterance cannot announce, will not be spoken: ",i),this.queue.includes(e)&&this.removeUtterance(e.utterance)}else this.debug&&console.log("announcer not readyToAnnounce")}dispose(){this._initialized&&Nr.Z.removeListener(this.stepQueueListener),super.dispose()}static fromFactory(){const e=new lo,t=new mo(e),i=e.ariaLiveContainer;document.body?document.body.appendChild(i):document.children[0].appendChild(i);let s=0;const n=e=>{const t=e-s;s=e,phet.axon.stepTimer.emit(t/1e3),window.requestAnimationFrame(n)};return window.requestAnimationFrame(n),t}}ro.Z.register("UtteranceQueue",mo);const po=mo,Vo=new po(so,{featureSpecificAnnouncingControlPropertyName:"voicingCanAnnounceProperty"});Vo.enabled=!1,W.register("voicingUtteranceQueue",Vo);const Mo=Vo;var Bo=i(6629),wo=i(6103);class Co extends go.Z{constructor(e){super(e)}}const Eo=["voicingNameResponse","voicingObjectResponse","voicingContextResponse","voicingHintResponse","voicingUtterance","voicingResponsePatternCollection","voicingIgnoreVoicingManagerProperties","voicingFocusListener"],Yo=e=>{const t=Un("Voicing",Eo,class t extends(Xr(e)){constructor(){super(...arguments),this._boundInstanceCanVoiceChangeListener=this.onInstanceCanVoiceChange.bind(this),this._voicingUtterance=null,t.prototype.initialize.call(this)}initialize(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return super.initialize&&super.initialize(t),this._voicingCanSpeakProperty=new Ms.Z(!0),this._voicingResponsePacket=new Bo.Z,this._voicingFocusListener=this.defaultFocusListener,this.setVoicingUtterance(new Co),this._voicingCanSpeakCount=0,this._boundInstancesChangedListener=this.addOrRemoveInstanceListeners.bind(this),this.changedInstanceEmitter.addListener(this._boundInstancesChangedListener),this._speakContentOnFocusListener={focus:e=>{this._voicingFocusListener&&this._voicingFocusListener(e)}},this.addInputListener(this._speakContentOnFocusListener),this}voicingSpeakFullResponse(e){const t=(0,Ce.JA)({},e);t.hasOwnProperty("nameResponse")||(t.nameResponse=this._voicingResponsePacket.nameResponse),t.hasOwnProperty("objectResponse")||(t.objectResponse=this._voicingResponsePacket.objectResponse),t.hasOwnProperty("contextResponse")||(t.contextResponse=this._voicingResponsePacket.contextResponse),t.hasOwnProperty("hintResponse")||(t.hintResponse=this._voicingResponsePacket.hintResponse),this.collectAndSpeakResponse(t)}voicingSpeakResponse(e){const t=(0,Ce.JA)({nameResponse:null,objectResponse:null,contextResponse:null,hintResponse:null},e);this.collectAndSpeakResponse(t)}voicingSpeakNameResponse(e){const t=(0,Ce.JA)({},e);t.hasOwnProperty("nameResponse")||(t.nameResponse=this._voicingResponsePacket.nameResponse),this.collectAndSpeakResponse(t)}voicingSpeakObjectResponse(e){const t=(0,Ce.JA)({},e);t.hasOwnProperty("objectResponse")||(t.objectResponse=this._voicingResponsePacket.objectResponse),this.collectAndSpeakResponse(t)}voicingSpeakContextResponse(e){const t=(0,Ce.JA)({},e);t.hasOwnProperty("contextResponse")||(t.contextResponse=this._voicingResponsePacket.contextResponse),this.collectAndSpeakResponse(t)}voicingSpeakHintResponse(e){const t=(0,Ce.JA)({},e);t.hasOwnProperty("hintResponse")||(t.hintResponse=this._voicingResponsePacket.hintResponse),this.collectAndSpeakResponse(t)}collectAndSpeakResponse(e){this.speakContent(this.collectResponse(e))}collectResponse(e){const t=(0,Ce.JA)({ignoreProperties:this._voicingResponsePacket.ignoreProperties,responsePatternCollection:this._voicingResponsePacket.responsePatternCollection,utterance:this.voicingUtterance},e);let i=wo.Z.collectResponses(t);return t.utterance&&(t.utterance.alert=i,i=t.utterance),i}speakContent(e){const t=!Kt.Z.PHET_IO_ENABLED||!this.isInsidePhetioArchetype();e&&t&&Mo.addToBack(e)}setVoicingNameResponse(e){this._voicingResponsePacket.nameResponse=e}set voicingNameResponse(e){this.setVoicingNameResponse(e)}get voicingNameResponse(){return this.getVoicingNameResponse()}getVoicingNameResponse(){return this._voicingResponsePacket.nameResponse}setVoicingObjectResponse(e){this._voicingResponsePacket.objectResponse=e}set voicingObjectResponse(e){this.setVoicingObjectResponse(e)}get voicingObjectResponse(){return this.getVoicingObjectResponse()}getVoicingObjectResponse(){return this._voicingResponsePacket.objectResponse}setVoicingContextResponse(e){this._voicingResponsePacket.contextResponse=e}set voicingContextResponse(e){this.setVoicingContextResponse(e)}get voicingContextResponse(){return this.getVoicingContextResponse()}getVoicingContextResponse(){return this._voicingResponsePacket.contextResponse}setVoicingHintResponse(e){this._voicingResponsePacket.hintResponse=e}set voicingHintResponse(e){this.setVoicingHintResponse(e)}get voicingHintResponse(){return this.getVoicingHintResponse()}getVoicingHintResponse(){return this._voicingResponsePacket.hintResponse}setVoicingIgnoreVoicingManagerProperties(e){this._voicingResponsePacket.ignoreProperties=e}set voicingIgnoreVoicingManagerProperties(e){this.setVoicingIgnoreVoicingManagerProperties(e)}get voicingIgnoreVoicingManagerProperties(){return this.getVoicingIgnoreVoicingManagerProperties()}getVoicingIgnoreVoicingManagerProperties(){return this._voicingResponsePacket.ignoreProperties}setVoicingResponsePatternCollection(e){this._voicingResponsePacket.responsePatternCollection=e}set voicingResponsePatternCollection(e){this.setVoicingResponsePatternCollection(e)}get voicingResponsePatternCollection(){return this.getVoicingResponsePatternCollection()}getVoicingResponsePatternCollection(){return this._voicingResponsePacket.responsePatternCollection}setVoicingUtterance(e){this._voicingUtterance!==e&&(this._voicingUtterance&&this.cleanVoicingUtterance(),Yo.registerUtteranceToVoicingNode(e,this),this._voicingUtterance=e)}set voicingUtterance(e){this.setVoicingUtterance(e)}get voicingUtterance(){return this.getVoicingUtterance()}getVoicingUtterance(){return function(e){if(!(e instanceof go.Z))throw new Error("utterance is not an Utterance")}(this._voicingUtterance),this._voicingUtterance}getVoicingCanSpeakProperty(){return this._voicingCanSpeakProperty}get voicingCanSpeakProperty(){return this.getVoicingCanSpeakProperty()}setVoicingFocusListener(e){this._voicingFocusListener=e}set voicingFocusListener(e){this.setVoicingFocusListener(e)}get voicingFocusListener(){return this.getVoicingFocusListener()}getVoicingFocusListener(){return this._voicingFocusListener}defaultFocusListener(){this.voicingSpeakFullResponse({contextResponse:null})}get isVoicing(){return!0}dispose(){this.removeInputListener(this._speakContentOnFocusListener),this.changedInstanceEmitter.removeListener(this._boundInstancesChangedListener),this._voicingUtterance&&(this.cleanVoicingUtterance(),this._voicingUtterance=null),super.dispose()}clean(){this.removeInputListener(this._speakContentOnFocusListener),this.changedInstanceEmitter.removeListener(this._boundInstancesChangedListener),this._voicingUtterance&&(this.cleanVoicingUtterance(),this._voicingUtterance=null),super.clean&&super.clean()}onInstanceCanVoiceChange(e){e?this._voicingCanSpeakCount++:this._voicingCanSpeakCount--,this._voicingCanSpeakProperty.value=this._voicingCanSpeakCount>0}handleInstancesChanged(e,t){e.visible&&e.voicingVisible&&(this._voicingCanSpeakCount=t?this._voicingCanSpeakCount+1:this._voicingCanSpeakCount-1),this._voicingCanSpeakProperty.value=this._voicingCanSpeakCount>0}addOrRemoveInstanceListeners(e,t){t?e.canVoiceEmitter.addListener(this._boundInstanceCanVoiceChangeListener):e.canVoiceEmitter.removeListener(this._boundInstanceCanVoiceChangeListener),this.handleInstancesChanged(e,t)}cleanVoicingUtterance(){this._voicingUtterance instanceof Co?this._voicingUtterance.dispose():this._voicingUtterance&&!this._voicingUtterance.isDisposed&&Yo.unregisterUtteranceToVoicingNode(this._voicingUtterance,this)}mutate(e){return super.mutate(e)}});return t.prototype._mutatorKeys=Eo.concat(t.prototype._mutatorKeys),t};Yo.VOICING_OPTION_KEYS=Eo,Yo.alertUtterance=e=>{Mo.addToBack(e)},Yo.registerUtteranceToVoicingNode=(e,t)=>{const i=e.voicingCanAnnounceProperties;i.includes(t.voicingCanSpeakProperty)||(e.voicingCanAnnounceProperties=i.concat([t.voicingCanSpeakProperty]))},Yo.unregisterUtteranceToVoicingNode=(e,t)=>{const i=e.voicingCanAnnounceProperties,s=i.indexOf(t.voicingCanSpeakProperty);e.voicingCanAnnounceProperties=i.splice(s,1)},Yo.registerUtteranceToNode=(e,t)=>{const i=e.voicingCanAnnounceProperties;i.includes(t.visibleProperty)||(e.voicingCanAnnounceProperties=e.voicingCanAnnounceProperties.concat([t.visibleProperty])),i.includes(t.voicingVisibleProperty)||(e.voicingCanAnnounceProperties=e.voicingCanAnnounceProperties.concat([t.voicingVisibleProperty]))},Yo.unregisterUtteranceToNode=(e,t)=>{const i=e.voicingCanAnnounceProperties,s=i.indexOf(t.visibleProperty),n=i.splice(s,1).indexOf(t.voicingVisibleProperty),r=i.splice(n,1);e.voicingCanAnnounceProperties=r};W.register("Voicing",Yo);const Do=Yo;class yo extends go.Z{constructor(e,t){super(t),this.readingBlockFocus=e}}W.register("ReadingBlockUtterance",yo);const Io=yo;class qo{constructor(e,t){_defineProperty(this,"node",null),_defineProperty(this,"visibilityTracker",null);const i=(0,Ce.ZP)()({onRemoveFocus:_.noop},t);this.focusProperty=e,this.onRemoveFocus=i.onRemoveFocus,this.boundVisibilityListener=this.handleTrailVisibilityChange.bind(this),this.boundInstancesChangedListener=this.handleInstancesChange.bind(this),this.boundFocusListener=this.handleFocusChange.bind(this),this.focusProperty.link(this.boundFocusListener)}handleFocusChange(e){this.removeDisplayedListeners(),e&&this.addDisplayedListeners(e)}handleTrailVisibilityChange(){this.visibilityTracker&&!this.visibilityTracker.trailVisibleProperty.value&&(this.focusProperty.value=null,this.onRemoveFocus())}handleInstancesChange(e){e.node&&0===e.node.instances.length&&(this.focusProperty.value=null,this.onRemoveFocus())}addDisplayedListeners(e){this.visibilityTracker=new Fr(e.trail),this.visibilityTracker.addListener(this.boundVisibilityListener),this.node=e.trail.lastNode(),this.node.changedInstanceEmitter.addListener(this.boundInstancesChangedListener)}removeDisplayedListeners(){this.visibilityTracker&&(this.visibilityTracker.removeListener(this.boundVisibilityListener),this.visibilityTracker.dispose(),this.visibilityTracker=null),this.node&&(this.node.changedInstanceEmitter.removeListener(this.boundInstancesChangedListener),this.node=null)}dispose(){this.removeDisplayedListeners(),this.focusProperty.unlink(this.boundFocusListener),this.node=null,this.visibilityTracker=null,this.focusProperty=null}}W.register("FocusDisplayedController",qo);const Go=qo;var Qo=i(4075);class So{constructor(){this.pointerFocusProperty=new yt.Z(null),this.readingBlockFocusProperty=new yt.Z(null),this.lockedPointerFocusProperty=new yt.Z(null),this.pdomFocusHighlightsVisibleProperty=new bt.Z(!0),this.interactiveHighlightsVisibleProperty=new bt.Z(!1),this.readingBlockHighlightsVisibleProperty=new bt.Z(!1),this.voicingFullyEnabledListener=e=>{this.readingBlockHighlightsVisibleProperty.value=e},so.voicingFullyEnabledProperty.link(this.voicingFullyEnabledListener),this.pointerHighlightsVisibleProperty=new Qo.ZP([this.interactiveHighlightsVisibleProperty,this.readingBlockHighlightsVisibleProperty],(e,t)=>e||t),this.readingBlockFocusController=new Go(this.readingBlockFocusProperty),this.startSpeakingListener=(e,t)=>{this.readingBlockFocusProperty.value=t instanceof Io?t.readingBlockFocus:null},so.startSpeakingEmitter.addListener(this.startSpeakingListener),this.endSpeakingListener=(e,t)=>{t instanceof Io&&this.readingBlockFocusProperty.value&&t.readingBlockFocus.trail.equals(this.readingBlockFocusProperty.value.trail)&&(this.readingBlockFocusProperty.value=null)},so.endSpeakingEmitter.addListener(this.endSpeakingListener),this.pointerFocusDisplayedController=new Go(this.pointerFocusProperty,{onRemoveFocus:()=>{this.lockedPointerFocusProperty.value=null}})}dispose(){this.readingBlockFocusController.dispose(),this.pointerFocusDisplayedController.dispose(),this.pointerHighlightsVisibleProperty.dispose(),so.startSpeakingEmitter.removeListener(this.startSpeakingListener),so.endSpeakingEmitter.removeListener(this.endSpeakingListener),so.voicingFullyEnabledProperty.unlink(this.voicingFullyEnabledListener)}static updatePDOMFocusFromEvent(e,t,i){if(i)for(let s=0;s<e.length;s++){const i=e[s],n=document.activeElement;if(i.isElementUnderPDOM(n)){const e=n.getAttribute(Fi.DATA_PDOM_UNIQUE_ID),s=yA.uniqueIdToTrail(i,e),r=yA.guessVisualTrail(s,i.rootNode);r.lastNode().focusable?So.pdomFocus=new ze(i,r):(t.target.blur(),t.stopImmediatePropagation());break}}else for(let s=0;s<e.length;s++){const i=e[s],n=i._input.getRelatedTargetTrail(t);n&&n.lastNode().focusable?So.pdomFocus=new ze(i,yA.guessVisualTrail(n,i.rootNode)):So.pdomFocus=null}}static set pdomFocus(e){if(So.pdomFocusProperty.value!==e){let t;So.pdomFocusProperty.value&&(t=So.pdomFocusedNode),So.pdomFocusProperty.value=e,t&&!e&&t.blur()}}static get pdomFocus(){return So.pdomFocusProperty.value}static getPDOMFocusedNode(){let e=null;const t=So.pdomFocusProperty.get();return t&&(e=t.trail.lastNode()),e}static get pdomFocusedNode(){return this.getPDOMFocusedNode()}static attachToWindow(){So.attachedWindowFocusListener=()=>{So._windowHasFocusProperty.value=!0},So.attachedWindowBlurListener=()=>{So._windowHasFocusProperty.value=!1},window.addEventListener("focus",So.attachedWindowFocusListener),window.addEventListener("blur",So.attachedWindowBlurListener),So._windowHasFocusProperty.value=document.hasFocus(),So.globallyAttached=!0}static detachFromWindow(){window.removeEventListener("focus",So.attachedWindowFocusListener),window.removeEventListener("blur",So.attachedWindowBlurListener),So._windowHasFocusProperty.value=!1,So.globallyAttached=!1}}B=So,_defineProperty(So,"attachedWindowFocusListener",null),_defineProperty(So,"attachedWindowBlurListener",null),_defineProperty(So,"globallyAttached",!1),_defineProperty(So,"pdomFocusProperty",new yt.Z(null,{tandem:Kt.Z.GENERAL_MODEL.createTandem("pdomFocusProperty"),phetioDocumentation:"Stores the current focus in the Parallel DOM, null if nothing has focus. This is not updated based on mouse or touch input, only keyboard and other alternative inputs. Note that this only applies to simulations that support alternative input.",phetioValueType:(0,mt.Z)(ze.FocusIO),phetioState:!1,phetioFeatured:!0,phetioReadOnly:!0})),_defineProperty(So,"_windowHasFocusProperty",new bt.Z(!1)),_defineProperty(So,"windowHasFocusProperty",B._windowHasFocusProperty),W.register("FocusManager",So);const To=new le("rgba(212,19,106,0.5)"),xo=new le("rgba(250,40,135,0.9)"),ko=new le("rgba(233,113,166,1.0)"),Fo=new le("rgba(233,113,166,1.0)"),Ro=new le("rgba(159,15,80,1.0)"),Uo=new le("rgba(159,15,80,1.0)");class Lo extends On{constructor(e,t){const i=(0,Ce.ZP)()({outerStroke:To,innerStroke:xo,outerLineWidth:null,innerLineWidth:null,dashed:!1,transformSourceNode:null},t);super(e),_defineProperty(this,"highlightChangedEmitter",new Or.Z),this._innerHighlightColor=i.innerStroke,this._outerHighlightColor=i.outerStroke;const s=_.pick(i,Object.keys(On.DEFAULT_PATH_OPTIONS));this.innerLineWidth=i.innerLineWidth,this.outerLineWidth=i.outerLineWidth,this.transformSourceNode=i.transformSourceNode,i.stroke=i.outerStroke,this.mutate(i);const n=(0,Ce.JA)({},s,{stroke:i.innerStroke});this.innerHighlightPath=new On(e,n),this.addChild(this.innerHighlightPath),this.updateLineWidth(),i.dashed&&this.makeDashed(!0)}mutateWithInnerHighlight(e){super.mutate(e),this.innerHighlightPath&&this.innerHighlightPath.mutate(e),this.highlightChangedEmitter.emit()}makeDashed(e){const t=e?[7,7]:[];this.mutateWithInnerHighlight({lineDash:t})}setShape(e){return super.setShape(e),this.innerHighlightPath&&this.innerHighlightPath.setShape(e),this.highlightChangedEmitter&&this.highlightChangedEmitter.emit(),this}updateLineWidth(e){e=e||this,this.lineWidth=this.getOuterLineWidth(e),this.innerHighlightPath.lineWidth=this.getInnerLineWidth(e),this.highlightChangedEmitter.emit()}getOuterLineWidth(e){return this.outerLineWidth?this.outerLineWidth:Lo.getOuterLineWidthFromNode(e)}getInnerLineWidth(e){return this.innerLineWidth?this.innerLineWidth:Lo.getInnerLineWidthFromNode(e)}setInnerHighlightColor(e){this._innerHighlightColor=e,this.innerHighlightPath.setStroke(e),this.highlightChangedEmitter.emit()}set innerHighlightColor(e){this.setInnerHighlightColor(e)}get innerHighlightColor(){return this.getInnerHighlightColor()}getInnerHighlightColor(){return this._innerHighlightColor}setOuterHighlightColor(e){this._outerHighlightColor=e,this.setStroke(e),this.highlightChangedEmitter.emit()}set outerHighlightColor(e){this.setOuterHighlightColor(e)}get outerHighlightColor(){return this.getOuterHighlightColor()}getOuterHighlightColor(){return this._outerHighlightColor}getUniqueHighlightTrail(e){const t=this.transformSourceNode;let i=null;if(t.instances.length<=1)i=t.getUniqueTrail();else{const s=t.getTrails().filter(t=>t.isExtensionOf(e,!0));i=s[0]}return i}static getInnerLineWidthFromNode(e){return 2.5/Lo.getWidthMagnitudeFromTransform(e)}static getOuterLineWidthFromNode(e){return 4/Lo.getWidthMagnitudeFromTransform(e)}static getWidthMagnitudeFromTransform(e){return e.transform.transformDelta2(be.Z.X_UNIT).magnitude}static getDilationCoefficient(e){return.75*Lo.getOuterLineWidthFromNode(e)}static getGroupDilationCoefficient(e){return 1.9*Lo.getOuterLineWidthFromNode(e)}}_defineProperty(Lo,"OUTER_FOCUS_COLOR",To),_defineProperty(Lo,"INNER_FOCUS_COLOR",xo),_defineProperty(Lo,"INNER_LIGHT_GROUP_FOCUS_COLOR",ko),_defineProperty(Lo,"OUTER_LIGHT_GROUP_FOCUS_COLOR",Fo),_defineProperty(Lo,"INNER_DARK_GROUP_FOCUS_COLOR",Ro),_defineProperty(Lo,"OUTER_DARK_GROUP_FOCUS_COLOR",Uo),_defineProperty(Lo,"GROUP_OUTER_LINE_WIDTH",2),_defineProperty(Lo,"GROUP_INNER_LINE_WIDTH",2),W.register("HighlightPath",Lo);const Po=Lo;class bo extends Po{constructor(e,t){const i=(0,Ce.ZP)()({useLocalBounds:!0,dilationCoefficient:null,useGroupDilation:!1},t);i.transformSourceNode=e,super(null,i),_defineProperty(this,"observedBoundsProperty",null),_defineProperty(this,"boundsListener",null),this.useLocalBounds=i.useLocalBounds,this.useGroupDilation=i.useGroupDilation,this.dilationCoefficient=i.dilationCoefficient,e&&this.setShapeFromNode(e)}setShapeFromNode(e){this.observedBoundsProperty&&this.observedBoundsProperty.unlink(this.boundsListener),this.observedBoundsProperty=this.useLocalBounds?e.localBoundsProperty:e.boundsProperty,this.boundsListener=t=>{if(!t.isFinite())return;let i=this.dilationCoefficient;null===this.dilationCoefficient&&(i=this.useGroupDilation?Po.getGroupDilationCoefficient(e):Po.getDilationCoefficient(e));const s=t.dilated(i);this.updateLineWidthFromNode(e),this.setShape(_t.bn.bounds(s))},this.observedBoundsProperty.link(this.boundsListener)}updateLineWidthFromNode(e){this.lineWidth=this.getOuterLineWidth(e),this.innerHighlightPath.lineWidth=this.getInnerLineWidth(e)}}W.register("HighlightFromNode",bo);const Oo=bo;class fo extends Oo{constructor(e,t){super(e,(0,Ce.ZP)()({outerStroke:"grey",innerStroke:"black"},t))}}W.register("ReadingBlockHighlight",fo);const Zo=fo;var No=i(6975);const Ko=["readingBlockTagName","readingBlockNameResponse","readingBlockHintResponse","readingBlockResponsePatternCollection","readingBlockActiveHighlight"];class Jo extends Io{constructor(e,t){super(e,t)}}const jo=new No.Z({nameHint:"{{NAME}}. {{HINT}}"}),vo=_s(e=>{const t=Un("ReadingBlock",Ko,class extends(Do(e)){constructor(){super(...arguments),this._readingBlockTagName="button",this._readingBlockDisabledTagName="p",this._readingBlockActiveHighlight=null,this.readingBlockActiveHighlightChangedEmitter=new te.Z,this.readingBlockResponsePatternCollection=jo,this._localBoundsChangedListener=this._onLocalBoundsChanged.bind(this),this.localBoundsProperty.link(this._localBoundsChangedListener),this._readingBlockInputListener={focus:e=>this._speakReadingBlockContentListener(e),up:e=>this._speakReadingBlockContentListener(e),click:e=>this._speakReadingBlockContentListener(e)},this._readingBlockFocusableChangeListener=this._onReadingBlockFocusableChanged.bind(this),so.speechAllowedAndFullyEnabledProperty.link(this._readingBlockFocusableChangeListener),this.focusHighlight=new Zo(this),this.voicingUtterance=new Jo(null)}get isReadingBlock(){return!0}setReadingBlockTagName(e){this._readingBlockTagName=e,this._onReadingBlockFocusableChanged(so.speechAllowedAndFullyEnabledProperty.value)}set readingBlockTagName(e){this.setReadingBlockTagName(e)}get readingBlockTagName(){return this.getReadingBlockTagName()}getReadingBlockTagName(){return this._readingBlockTagName}setReadingBlockNameResponse(e){this._voicingResponsePacket.nameResponse=e}set readingBlockNameResponse(e){this.setReadingBlockNameResponse(e)}get readingBlockNameResponse(){return this.getReadingBlockNameResponse()}getReadingBlockNameResponse(){return this._voicingResponsePacket.nameResponse}setReadingBlockHintResponse(e){this._voicingResponsePacket.hintResponse=e}set readingBlockHintResponse(e){this.setReadingBlockHintResponse(e)}get readingBlockHintResponse(){return this.getReadingBlockHintResponse()}getReadingBlockHintResponse(){return this._voicingResponsePacket.hintResponse}setReadingBlockResponsePatternCollection(e){this._voicingResponsePacket.responsePatternCollection=e}set readingBlockResponsePatternCollection(e){this.setReadingBlockResponsePatternCollection(e)}get readingBlockResponsePatternCollection(){return this.getReadingBlockResponsePatternCollection()}getReadingBlockResponsePatternCollection(){return this._voicingResponsePacket.responsePatternCollection}setVoicingUtterance(e){super.setVoicingUtterance(e)}set voicingUtterance(e){super.voicingUtterance=e}get voicingUtterance(){return this.getVoicingUtterance()}getVoicingUtterance(){const e=super.getVoicingUtterance();return e}setVoicingNameResponse(){}getVoicingNameResponse(){}setVoicingObjectResponse(){}getVoicingObjectResponse(){}setVoicingContextResponse(){}getVoicingContextResponse(){}setVoicingHintResponse(){}getVoicingHintResponse(){}setVoicingResponsePatternCollection(){}getVoicingResponsePatternCollection(){}setReadingBlockActiveHighlight(e){this._readingBlockActiveHighlight!==e&&(this._readingBlockActiveHighlight=e,this.readingBlockActiveHighlightChangedEmitter.emit())}set readingBlockActiveHighlight(e){this.setReadingBlockActiveHighlight(e)}get readingBlockActiveHighlight(){return this._readingBlockActiveHighlight}getReadingBlockActiveHighlight(){return this._readingBlockActiveHighlight}isReadingBlockActivated(){let e=!1;const t=Object.keys(this.displays);for(let i=0;i<t.length;i++){const s=this.displays[t[i]].focusManager.readingBlockFocusProperty.value;if(s&&s.trail.lastNode()===this){e=!0;break}}return e}get readingBlockActivated(){return this.isReadingBlockActivated()}_onReadingBlockFocusableChanged(e){this.focusable=e,e?(this.tagName=this._readingBlockTagName,this.hasInputListener(this._readingBlockInputListener)||this.addInputListener(this._readingBlockInputListener)):(this.tagName=this._readingBlockDisabledTagName,this.hasInputListener(this._readingBlockInputListener)&&this.removeInputListener(this._readingBlockInputListener))}_onLocalBoundsChanged(e){this.mouseArea=e,this.touchArea=e}_speakReadingBlockContentListener(e){const t=this.getConnectedDisplays(),i=this.voicingUtterance,s=this.collectResponse({nameResponse:this.getReadingBlockNameResponse(),hintResponse:this.getReadingBlockHintResponse(),ignoreProperties:this.voicingIgnoreVoicingManagerProperties,responsePatternCollection:this._voicingResponsePacket.responsePatternCollection,utterance:i});if(s)for(let n=0;n<t.length;n++)if(!this.getDescendantsUseHighlighting(e.trail)){const r=e.trail.subtrailTo(this),o=yA.guessVisualTrail(r,t[n].rootNode),A=new ze(t[n],o);i.readingBlockFocus=A,this.speakContent(s)}}cleanVoicingUtterance(){this._voicingUtterance instanceof Jo&&this._voicingUtterance.dispose(),super.cleanVoicingUtterance()}dispose(){so.speechAllowedAndFullyEnabledProperty.unlink(this._readingBlockFocusableChangeListener),this.localBoundsProperty.unlink(this._localBoundsChangedListener),this.hasInputListener(this._readingBlockInputListener)&&this.removeInputListener(this._readingBlockInputListener),super.dispose()}mutate(e){return super.mutate(e)}});return t.prototype._mutatorKeys=Ko.concat(t.prototype._mutatorKeys),t});W.register("ReadingBlock",vo);const Ho=vo,Wo={isPlatformMac:()=>_.includes(window.navigator.platform,"Mac"),getPlatformZoomMetaKey:()=>Wo.isPlatformMac()?"metaKey":"ctrlKey",isZoomCommand:(e,t)=>{const i=t?lt.KEY_EQUALS:lt.KEY_MINUS;return e[Wo.getPlatformZoomMetaKey()]&&lt.isKeyEvent(e,i)},isZoomResetCommand:e=>e[Wo.getPlatformZoomMetaKey()]&&lt.isKeyEvent(e,lt.KEY_0)};W.register("KeyboardZoomUtils",Wo);const zo=Wo;var Xo=i(7023);const _o={INPUT:[...lt.ARROW_KEYS,lt.KEY_PAGE_UP,lt.KEY_PAGE_DOWN,lt.KEY_HOME,lt.KEY_END,lt.KEY_ENTER,lt.KEY_SPACE],DIV:[...lt.ARROW_KEYS,...lt.WASD_KEYS],P:[lt.KEY_ESCAPE],BUTTON:[lt.KEY_ENTER,lt.KEY_SPACE]},$o=lt.ALL_KEYS;class eA{constructor(e,t){this.display=e,this.random=new Xo.Z({seed:t}),this.numberOfComponentsTested=10,this.keyupListeners=[],this.currentElement=null}chooseNextElement(){if(null===this.currentElement)this.currentElement=document.activeElement;else if(this.random.nextDouble()<.1){this.clearListeners();const e=Fi.getRandomFocusable(this.random);e.focus(),this.currentElement=e}}clearListeners(){this.keyupListeners.forEach(e=>{Nr.Z.clearTimeout(e.timeout),e()})}triggerClickEvent(){const e=document.activeElement;e instanceof HTMLElement&&e.click()}triggerKeyDownUpEvents(e){this.triggerDOMEvent("keydown",e);const t=this.random.nextInt(100),i=()=>{this.triggerDOMEvent("keyup",e),this.keyupListeners.includes(i)&&this.keyupListeners.splice(this.keyupListeners.indexOf(i),1)};i.timeout=Nr.Z.setTimeout(i,100===t?2e3:t),this.keyupListeners.push(i)}triggerRandomKeyDownUpEvents(e){const t=$o[Math.floor(this.random.nextDouble()*($o.length-1))];this.triggerKeyDownUpEvents(t)}fuzzBoardEvents(e){if(this.display&&this.display._input&&this.display._input.pdomPointer){const e=this.display._input.pdomPointer;e&&!e.blockTrustedEvents&&(e.blockTrustedEvents=!0)}for(let t=0;t<this.numberOfComponentsTested;t++){this.chooseNextElement();for(let t=0;t<e/this.numberOfComponentsTested;t++){const e=document.activeElement;if(e&&_o[e.tagName.toUpperCase()]){const t=this.random.nextDouble();if(t<.6){const t=_o[e.tagName],i=this.random.sample(t);this.triggerKeyDownUpEvents(i)}else t<.7?this.triggerClickEvent():this.triggerRandomKeyDownUpEvents(e)}else e&&this.triggerRandomKeyDownUpEvents(e)}}}triggerDOMEvent(e,t){if(document.activeElement){const i=new KeyboardEvent(e,{bubbles:!0,code:t,shiftKey:Hr.shiftKeyDown,altKey:Hr.altKeyDown,ctrlKey:Hr.ctrlKeyDown});document.activeElement.dispatchEvent(i)}}}W.register("KeyboardFuzzer",eA);const tA=eA;class iA extends Oo{constructor(e,t){super(e,(0,Ce.ZP)()({outerStroke:Po.OUTER_LIGHT_GROUP_FOCUS_COLOR,innerStroke:Po.INNER_LIGHT_GROUP_FOCUS_COLOR,outerLineWidth:Po.GROUP_OUTER_LINE_WIDTH,innerLineWidth:Po.GROUP_INNER_LINE_WIDTH,useGroupDilation:!0},t))}}W.register("GroupHighlightFromNode",iA);class sA extends Oo{constructor(e,t){super(e,(0,Ce.ZP)()({innerStroke:null,outerStroke:null,fill:"rgba(255,255,0,0.5)"},t))}}_defineProperty(sA,"ACTIVATED_HIGHLIGHT_COLOR","rgba(255,255,0,0.5)"),W.register("ActivatedReadingBlockHighlight",sA);const nA=sA,rA=Fi.TAGS.LABEL,oA=Fi.TAGS.INPUT,AA={attributes:!1,childList:!0,characterData:!0};let aA=1;const hA=new Ue.Z(0,0,0,0),lA=new Ue.Z(0,0,0,0),gA=new Le.Z,cA=new Le.Z,dA=new Le.Z;class uA{constructor(e,t){this.initializePDOMPeer(e,t)}initializePDOMPeer(e,t){return t=(0,Ot.Z)({primarySibling:null},t),this.id=this.id||aA++,this.pdomInstance=e,this.node=this.pdomInstance.node,this.display=e.display,this.trail=e.trail,this.visible=null,this.focusable=null,this._labelSibling=null,this._descriptionSibling=null,this._containerParent=null,this.topLevelElements=[],this.positionDirty=!1,this.childPositionDirty=!1,this.positionInPDOM=!1,this.mutationObserver=this.mutationObserver||new MutationObserver(this.invalidateCSSPositioning.bind(this)),this.transformListener=this.transformListener||this.invalidateCSSPositioning.bind(this),this.pdomInstance.transformTracker.addListener(this.transformListener),this._preservedDisabledValue=null,this.isDisposed=!1,this.pdomInstance.isRootInstance&&(this._primarySibling=t.primarySibling,this._primarySibling.classList.add(Di.ROOT_CLASS_NAME),Fi.BLOCKED_DOM_EVENTS.forEach(e=>{this._primarySibling.addEventListener(e,e=>{e.stopPropagation()})})),this}update(e){let t=this.node.getBaseOptions();const i=[];null!==this.node.accessibleName&&(t=this.node.accessibleNameBehavior(this.node,t,this.node.accessibleName,i)),null!==this.node.pdomHeading&&(t=this.node.pdomHeadingBehavior(this.node,t,this.node.pdomHeading,i)),null!==this.node.helpText&&(t=this.node.helpTextBehavior(this.node,t,this.node.helpText,i)),this._primarySibling=mA(t.tagName,this.node.focusable,{namespace:t.pdomNamespace}),t.containerTagName&&(this._containerParent=mA(t.containerTagName,!1)),t.labelTagName&&(this._labelSibling=mA(t.labelTagName,!1,{excludeFromInput:this.node.excludeLabelSiblingFromInput})),t.descriptionTagName&&(this._descriptionSibling=mA(t.descriptionTagName,!1)),e&&this.updateIndicesStringAndElementIds(),this.orderElements(t),this.mutationObserver.disconnect(),this.mutationObserver.observe(this._primarySibling,AA),t.labelContent&&null!==t.labelTagName&&this.setLabelSiblingContent(t.labelContent),t.innerContent&&null!==t.tagName&&this.setPrimarySiblingContent(t.innerContent),t.descriptionContent&&null!==t.descriptionTagName&&this.setDescriptionSiblingContent(t.descriptionContent),t.tagName.toUpperCase()===oA&&t.inputType&&this.setAttributeToElement("type",t.inputType),t.labelTagName&&t.labelTagName.toUpperCase()===rA&&this.setAttributeToElement("for",this._primarySibling.id,{elementName:uA.LABEL_SIBLING}),this.setFocusable(this.node.focusable),this.setPositionInPDOM(this.node.positionInPDOM),this.onAriaLabelledbyAssociationChange(),this.onAriaDescribedbyAssociationChange(),this.onActiveDescendantAssociationChange(),this.onAttributeChange(t),this.onClassChange(),this.onInputValueChange(),this.node.updateOtherNodesAriaLabelledby(),this.node.updateOtherNodesAriaDescribedby(),this.node.updateOtherNodesActiveDescendant(),i.forEach(e=>{e()})}orderElements(e){this._containerParent?(this._containerParent.insertBefore(this._primarySibling,this._containerParent.children[0]||null),this.topLevelElements=[this._containerParent]):this.topLevelElements=[this._labelSibling,this._descriptionSibling,this._primarySibling].filter(_.identity),this._labelSibling&&this.arrangeContentElement(this._labelSibling,e.appendLabel),this._descriptionSibling&&this.arrangeContentElement(this._descriptionSibling,e.appendDescription)}getPrimarySibling(){return this._primarySibling}get primarySibling(){return this.getPrimarySibling()}getLabelSibling(){return this._labelSibling}get labelSibling(){return this.getLabelSibling()}getDescriptionSibling(){return this._descriptionSibling}get descriptionSibling(){return this.getDescriptionSibling()}getContainerParent(){return this._containerParent}get containerParent(){return this.getContainerParent()}getTopLevelElementContainingPrimarySibling(){return this._containerParent||this._primarySibling}onAriaLabelledbyAssociationChange(){this.removeAttributeFromAllElements("aria-labelledby");for(let e=0;e<this.node.ariaLabelledbyAssociations.length;e++){const t=this.node.ariaLabelledbyAssociations[e];this.setAssociationAttribute("aria-labelledby",t)}}onAriaDescribedbyAssociationChange(){this.removeAttributeFromAllElements("aria-describedby");for(let e=0;e<this.node.ariaDescribedbyAssociations.length;e++){const t=this.node.ariaDescribedbyAssociations[e];this.setAssociationAttribute("aria-describedby",t)}}onActiveDescendantAssociationChange(){this.removeAttributeFromAllElements("aria-activedescendant");for(let e=0;e<this.node.activeDescendantAssociations.length;e++){const t=this.node.activeDescendantAssociations[e];this.setAssociationAttribute("aria-activedescendant",t)}}handleAttributeWithPDOMOption(e,t){"string"==typeof t?this.setAttributeToElement(e,t):this.removeAttributeFromElement(e)}onAttributeChange(e){for(let t=0;t<this.node.pdomAttributes.length;t++){const e=this.node.pdomAttributes[t];this.setAttributeToElement(e.attribute,e.value,e.options)}this.handleAttributeWithPDOMOption("aria-label",e.ariaLabel),this.handleAttributeWithPDOMOption("role",e.ariaRole)}onClassChange(){for(let e=0;e<this.node.pdomClasses.length;e++){const t=this.node.pdomClasses[e];this.setClassToElement(t.className,t.options)}}onInputValueChange(){if(null===this.node.inputValue)this.removeAttributeFromElement("value");else{const e=""+this.node.inputValue;this.setAttributeToElement("value",e,{asProperty:!0})}}getElementByName(e){if(e===uA.PRIMARY_SIBLING)return this._primarySibling;if(e===uA.LABEL_SIBLING)return this._labelSibling;if(e===uA.DESCRIPTION_SIBLING)return this._descriptionSibling;if(e===uA.CONTAINER_PARENT)return this._containerParent;throw new Error("invalid elementName name: "+e)}setAttributeToElement(e,t,i){const s=(i=(0,Ot.Z)({namespace:null,asProperty:!1,elementName:"PRIMARY_SIBLING",element:null},i)).element||this.getElementByName(i.elementName);let n=t;"string"==typeof t&&(n=(0,Ii.Z)(t)),"disabled"!==e||this.display.interactive||(this._preservedDisabledValue=!i.asProperty||n),i.namespace?s.setAttributeNS(i.namespace,e,n):i.asProperty?s[e]=n:s.setAttribute(e,n)}removeAttributeFromElement(e,t){const i=(t=(0,Ot.Z)({namespace:null,elementName:"PRIMARY_SIBLING",element:null},t)).element||this.getElementByName(t.elementName);t.namespace?i.removeAttributeNS(t.namespace,e):"disabled"!==e||this.display.interactive?i.removeAttribute(e):this._preservedDisabledValue=!1}removeAttributeFromAllElements(e){this._primarySibling&&this._primarySibling.removeAttribute(e),this._labelSibling&&this._labelSibling.removeAttribute(e),this._descriptionSibling&&this._descriptionSibling.removeAttribute(e),this._containerParent&&this._containerParent.removeAttribute(e)}setClassToElement(e,t){t=(0,Ot.Z)({elementName:"PRIMARY_SIBLING"},t),this.getElementByName(t.elementName).classList.add(e)}removeClassFromElement(e,t){t=(0,Ot.Z)({elementName:"PRIMARY_SIBLING"},t),this.getElementByName(t.elementName).classList.remove(e)}setAssociationAttribute(e,t){const i=t.otherNode.getPDOMInstances();if(i.length>0){const s=i[0];s===this.pdomInstance&&(s.peer=this);const n=s.peer.getElementByName(t.otherElementName),r=this.getElementByName(t.thisElementName);if(r&&n){const i=r.getAttribute(e)||"",s=[i.trim(),n.id].join(" ").trim();this.setAttributeToElement(e,s,{elementName:t.thisElementName})}}}arrangeContentElement(e,t){if(this.topLevelElements[0]===this._containerParent)t?this._containerParent.appendChild(e):this._containerParent.insertBefore(e,this._primarySibling);else{(0,Oi.Z)(this.topLevelElements,e);const i=this.topLevelElements.indexOf(this._primarySibling),s=t?this.topLevelElements.length:i;this.topLevelElements.splice(s,0,e)}}isVisible(){return null===this.visible||this.visible}setVisible(e){if(this.visible!==e){this.visible=e;for(let t=0;t<this.topLevelElements.length;t++){const i=this.topLevelElements[t];e?this.removeAttributeFromElement("hidden",{element:i}):this.setAttributeToElement("hidden","",{element:i})}this.invalidateCSSPositioning()}}isFocused(){const e=yA.guessVisualTrail(this.trail,this.display.rootNode);return So.pdomFocusProperty.value&&So.pdomFocusProperty.value.trail.equals(e)}focus(){So.windowHasFocusProperty.value&&this._primarySibling.focus()}blur(){this._primarySibling.blur()}setFocusable(e){const t=this.isFocused();this.focusable!==e&&(this.focusable=e,Fi.overrideFocusWithTabIndex(this.primarySibling,e),t&&!e&&this.blur(),this.invalidateCSSPositioning())}setLabelSiblingContent(e){this._labelSibling&&Fi.setTextContent(this._labelSibling,e)}setDescriptionSiblingContent(e){this._descriptionSibling&&Fi.setTextContent(this._descriptionSibling,e)}setPrimarySiblingContent(e){this._primarySibling&&Fi.setTextContent(this._primarySibling,e)}setPDOMTransformSourceNode(e){this.pdomInstance.transformTracker.removeListener(this.transformListener),this.pdomInstance.updateTransformTracker(e),this.pdomInstance.transformTracker.addListener(this.transformListener),this.invalidateCSSPositioning()}setPositionInPDOM(e){this.positionInPDOM=e,this.invalidateCSSPositioning()}getElementId(e,t){return`display${this.display.id}-${e}-${t}`}updateIndicesStringAndElementIds(){const e=this.pdomInstance.getPDOMInstanceUniqueId();this._primarySibling&&(this._primarySibling.setAttribute(Fi.DATA_PDOM_UNIQUE_ID,e),this._primarySibling.id=this.getElementId("primary",e)),this._labelSibling&&(this._labelSibling.setAttribute(Fi.DATA_PDOM_UNIQUE_ID,e),this._labelSibling.id=this.getElementId("label",e)),this._descriptionSibling&&(this._descriptionSibling.setAttribute(Fi.DATA_PDOM_UNIQUE_ID,e),this._descriptionSibling.id=this.getElementId("description",e)),this._containerParent&&(this._containerParent.setAttribute(Fi.DATA_PDOM_UNIQUE_ID,e),this._containerParent.id=this.getElementId("container",e))}invalidateCSSPositioning(){if(!this.positionDirty){this.positionDirty=!0;let e=this.pdomInstance.parent;for(;e;)e.peer.childPositionDirty=!0,e=e.parent}}positionElements(e){if(e){const e=this.node.pdomTransformSourceNode||this.node;if(hA.set(e.localBounds),hA.isFinite()){hA.transform(this.pdomInstance.transformTracker.getMatrix());const e=this.display.bounds;if(e.intersectsBounds(hA)){hA.constrainBounds(e);let t=VA(this._primarySibling),i=t.width,s=t.height;i>0&&s>0&&(lA.setMinMax(0,0,i,s),lA.transform(pA(i,s,hA)),MA(this._primarySibling,lA)),this.labelSibling&&(t=VA(this._labelSibling),i=t.width,s=t.height,s>0&&i>0&&(lA.setMinMax(0,0,i,s),lA.transform(pA(i,s,hA)),MA(this._labelSibling,lA)))}}}else lA.set(uA.OFFSCREEN_SIBLING_BOUNDS),MA(this._primarySibling,lA),this._labelSibling&&MA(this._labelSibling,lA);this.positionDirty=!1}updateSubtreePositioning(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.childPositionDirty=!1;const t=this.positionInPDOM||e;this.positionDirty&&this.positionElements(t);for(let i=0;i<this.pdomInstance.children.length;i++){const e=this.pdomInstance.children[i].peer;(e.positionDirty||e.childPositionDirty)&&this.pdomInstance.children[i].peer.updateSubtreePositioning(t)}}recursiveDisable(e){e?(this._preservedDisabledValue=this._primarySibling.disabled,this._primarySibling.disabled=!0):this._primarySibling.disabled=this._preservedDisabledValue;for(let t=0;t<this.pdomInstance.children.length;t++)this.pdomInstance.children[t].peer.recursiveDisable(e)}dispose(){this.isDisposed=!0,this.blur(),this._primarySibling.removeEventListener("blur",this.blurEventListener),this._primarySibling.removeEventListener("focus",this.focusEventListener),this.pdomInstance.transformTracker.removeListener(this.transformListener),this.mutationObserver.disconnect(),this.pdomInstance=null,this.node=null,this.display=null,this.trail=null,this._primarySibling=null,this._labelSibling=null,this._descriptionSibling=null,this._containerParent=null,this.focusable=null,this.freeToPool()}}function mA(e,t,i){i=(0,Ot.Z)({siblingName:null,excludeFromInput:!1},i);const s=Fi.createElement(e,t,i);return i.excludeFromInput&&s.setAttribute(Fi.DATA_EXCLUDE_FROM_INPUT,!0),s}function pA(e,t,i){return gA.setToTranslation(i.minX,i.minY),cA.setToScale(i.width/e,i.height/t),gA.multiplyMatrix(cA).multiplyMatrix(dA)}function VA(e){let t=e.clientWidth,i=e.clientHeight;if(0===t&&0===i){const s=e.getBoundingClientRect();t=s.width,i=s.height}return{width:t,height:i}}function MA(e,t){e.style.top=t.top+"px",e.style.left=t.left+"px",e.style.width=t.width+"px",e.style.height=t.height+"px"}uA.PRIMARY_SIBLING="PRIMARY_SIBLING",uA.LABEL_SIBLING="LABEL_SIBLING",uA.DESCRIPTION_SIBLING="DESCRIPTION_SIBLING",uA.CONTAINER_PARENT="CONTAINER_PARENT",uA.OFFSCREEN_SIBLING_BOUNDS=new Ue.Z(0,0,1,1),W.register("PDOMPeer",uA),Rt.mixInto(uA,{initialize:uA.prototype.initializePDOMPeer});const BA=uA;var wA=i(6918);class CA extends ei.Z{}_defineProperty(CA,"INDICES",new(w=CA)),_defineProperty(CA,"TRAIL_ID",new w),_defineProperty(CA,"enumeration",new $t.Z(w));const EA=CA.TRAIL_ID;let YA=1;class DA{constructor(e,t,i){_defineProperty(this,"relativeNodes",[]),_defineProperty(this,"relativeVisibilities",[]),_defineProperty(this,"relativeListeners",[]),_defineProperty(this,"transformTracker",null),this.initializePDOMInstance(e,t,i)}initializePDOMInstance(e,t,i){if(this.id=this.id||YA++,this.parent=e,this.display=t,this.trail=i,this.isRootInstance=null===e,this.node=this.isRootInstance?null:i.lastNode(),this.children=(0,Ji.Z)(this.children),this.node&&this.node.addPDOMInstance(this),this.invisibleCount=0,this.relativeNodes=[],this.relativeVisibilities=[],this.relativeListeners=[],this.transformTracker=null,this.updateTransformTracker(this.node?this.node.pdomTransformSourceNode:null),this.isDisposed=!1,this.isRootInstance){const e=document.createElement("div");this.peer=BA.createFromPool(this,{primarySibling:e})}else{this.peer=BA.createFromPool(this),this.peer.update(EA===CA.TRAIL_ID);const e=this.parent.trail;for(let s=e.length;s<i.length;s++){const n=i.nodes[s];this.relativeNodes.push(n);const r=n._pdomDisplaysInfo.pdomDisplays,o=_.includes(r,t);this.relativeVisibilities.push(o),o||this.invisibleCount++;const A=this.checkAccessibleDisplayVisibility.bind(this,s-e.length);n.pdomDisplaysEmitter.addListener(A),this.relativeListeners.push(A)}this.updateVisibility()}return this}addConsecutiveInstances(e){const t=this.children.length>0;Array.prototype.push.apply(this.children,e);for(let i=0;i<e.length;i++)Fi.insertElements(this.peer.primarySibling,e[i].peer.topLevelElements);t&&this.sortChildren(),EA===CA.INDICES&&this.updateDescendantPeerIds(e)}removeInstancesForTrail(e){for(let t=0;t<this.children.length;t++){const i=this.children[t],s=i.trail;let n=s.length<e.length;if(!n)for(let t=this.trail.length;t<e.length;t++)if(e.nodes[t]!==s.nodes[t]){n=!0;break}n||(this.children.splice(t,1),i.dispose(),t-=1)}}removeAllChildren(){for(;this.children.length;)this.children.pop().dispose()}findChildWithTrail(e){for(let t=0;t<this.children.length;t++){const i=this.children[t];if(i.trail.equals(e))return i}return null}removeSubtree(e){for(let t=this.children.length-1;t>=0;t--){const i=this.children[t];i.trail.isExtensionOf(e,!0)&&(this.children.splice(t,1),i.dispose())}}checkAccessibleDisplayVisibility(e){const t=_.includes(this.relativeNodes[e]._pdomDisplaysInfo.pdomDisplays,this.display);if(t!==this.relativeVisibilities[e]){this.relativeVisibilities[e]=t;const i=0===this.invisibleCount;this.invisibleCount+=t?-1:1,0===this.invisibleCount!==i&&this.updateVisibility()}}updateVisibility(){this.peer.setVisible(this.invisibleCount<=0),!this.peer.isVisible()&&So.pdomFocusedNode&&So.pdomFocusedNode.pdomInstances[0].trail.containsNode(this.node)&&(So.pdomFocus=null)}isGloballyVisible(){return!!this.peer.isVisible()&&(!this.parent||this.parent.isGloballyVisible())}getChildOrdering(e){const t=e.lastNode(),i=t.getEffectiveChildren();let s;const n=[];if(t.hasPDOMContent&&t!==this.node){const i=t.pdomInstances;e:for(s=0;s<i.length;s++){const t=i[s];if(t.parent===this){for(let i=0;i<e.length;i++)if(e.nodes[i]!==t.trail.nodes[i+t.trail.length-e.length])continue e;n.push(t)}}}else for(s=0;s<i.length;s++)e.addDescendant(i[s],s),Array.prototype.push.apply(n,this.getChildOrdering(e)),e.removeDescendant();return n}sortChildren(){var e,t;let i;i=this.isRootInstance?this.display.rootNode:this.node;const s=this.getChildOrdering(new pn(i));this.children=s;const n=this.peer.primarySibling,r=(null===(e=So.pdomFocusedNode)||void 0===e||null===(t=e.pdomInstances[0])||void 0===t?void 0:t.trail)||null;let o=n.childNodes.length-1;const A=r&&_.find(this.children,e=>r.containsNode(e.peer.node));if(A){const e=_.flatten(this.children.map(e=>e.peer.topLevelElements));if(!_.every(e,(e,t)=>n.children[t]===e)){const t=A.peer.getTopLevelElementContainingPrimarySibling(),i=e.indexOf(t);for(let s=0;s<i;s++)n.insertBefore(e[s],t);for(let s=i+1;s<e.length;s++)n.appendChild(e[s])}}else for(let a=this.children.length-1;a>=0;a--){const e=this.children[a].peer;for(let t=e.topLevelElements.length-1;t>=0;t--){const i=e.topLevelElements[t];n.childNodes[o]!==i&&n.insertBefore(i,n.childNodes[o+1]),o--}}EA===CA.INDICES&&this.updateDescendantPeerIds(this.children)}updateTransformTracker(e){this.transformTracker&&this.transformTracker.dispose();let t=null;t=e?e.getUniqueTrail():DA.guessVisualTrail(this.trail,this.display.rootNode),this.transformTracker=new xr(t)}getPDOMInstanceUniqueId(){if(EA===CA.INDICES){const e=[];let t=this;for(;t.parent;){const i=t.parent.children.indexOf(t);if(-1===i)return"STILL_BEING_CREATED"+wA.Z.nextDouble();e.unshift(i),t=t.parent}return e.join(Fi.PDOM_UNIQUE_ID_SEPARATOR)}return this.trail.getUniqueId()}updateDescendantPeerIds(e){const t=Array.from(e);for(;t.length>0;){const e=t.shift();e.peer.updateIndicesStringAndElementIds(),t.push(...e.children)}}static uniqueIdToTrail(e,t){return EA===CA.INDICES?e.getTrailFromPDOMIndicesString(t):pn.fromUniqueId(e.rootNode,t)}dispose(){const e=this.peer;if(!this.isRootInstance){Fi.removeElements(this.parent.peer.primarySibling,e.topLevelElements);for(let e=0;e<this.relativeNodes.length;e++)this.relativeNodes[e].pdomDisplaysEmitter.removeListener(this.relativeListeners[e])}for(;this.children.length;)this.children.pop().dispose();e.dispose(),this.transformTracker.dispose(),this.transformTracker=null,this.node&&this.node.removePDOMInstance(this),this.relativeNodes=null,this.display=null,this.trail=null,this.node=null,this.peer=null,this.isDisposed=!0,this.freeToPool()}toString(){return`${this.id}#{${this.trail.toString()}}`}auditRoot(){return void 0}static guessVisualTrail(e,t){e.reindex();const i=e.indices.lastIndexOf(-1);if(i<0)return e;const s=i+1,n=e.nodes[s].getTrailsTo(t);if(0===n.length)return e;const r=n[0];for(let o=s+1;o<e.length;o++)r.addDescendant(e.nodes[o]);return r}static createFakePDOMTree(e){return{node:null,children:function e(t){let i=_.flatten(t.getEffectiveChildren().map(e));return t.hasPDOMContent&&(i=[{node:t,children:i}]),i}(e)}}freeToPool(){DA.pool.freeToPool(this)}}C=DA,_defineProperty(DA,"pool",new ti.Z(C,{initialize:C.prototype.initializePDOMInstance})),W.register("PDOMInstance",DA);const yA=DA;let IA=null;const qA={addChild(e,t){qA.beforeOp(),t._pdomParent||qA.addTree(e,t),qA.afterOp()},removeChild(e,t){qA.beforeOp(),t._pdomParent||qA.removeTree(e,t),qA.afterOp()},childrenOrderChange(e){qA.beforeOp(),qA.reorder(e),qA.afterOp()},pdomOrderChange(e,t,i){qA.beforeOp();const s=[],n=[];let r,o;ms(t||[],i||[],s,n);const A=qA.findPDOMTrails(e);for(r=0;r<s.length;r++){const t=s[r];t&&(qA.removeTree(e,t,A),t._pdomParent=null)}for(r=0;r<n.length;r++){const t=n[r];if(t){const i=t._parents;for(o=0;o<i.length;o++)qA.removeTree(i[o],t);t._pdomParent=e}}for(r=0;r<s.length;r++){const e=s[r];if(e){const t=e._parents;for(o=0;o<t.length;o++)qA.addTree(t[o],e)}}for(r=0;r<n.length;r++){const t=n[r];t&&qA.addTree(e,t,A)}qA.reorder(e,A),qA.afterOp()},pdomContentChange(e){let t;qA.beforeOp();const i=e._pdomParent?[e._pdomParent]:e._parents,s=[];for(t=0;t<i.length;t++){const n=i[t],r=qA.findPDOMTrails(n);s.push(r),qA.removeTree(n,e,r)}for(t=0;t<i.length;t++)qA.addTree(i[t],e,s[t]);for(t=0;t<e._rootedDisplays.length;t++){const i=e._rootedDisplays[t];i._accessible&&qA.rebuildInstanceTree(i._rootPDOMInstance)}qA.afterOp()},rebuildInstanceTree(e){const t=e.display.rootNode;e.removeAllChildren(),e.addConsecutiveInstances(qA.createTree(new pn(t),e.display,e))},addTree(e,t,i){i=i||qA.findPDOMTrails(e);for(let s=0;s<i.length;s++){const e=i[s],n=e.pdomInstance;e.fullTrail.addDescendant(t);const r=qA.createTree(e.fullTrail,n.display,n);e.fullTrail.removeDescendant(t),n.addConsecutiveInstances(r)}},removeTree(e,t,i){i=i||qA.findPDOMTrails(e);for(let s=0;s<i.length;s++){const e=i[s];e.fullTrail.addDescendant(t),e.pdomInstance.removeInstancesForTrail(e.fullTrail),e.fullTrail.removeDescendant(t)}},reorder(e,t){t=t||qA.findPDOMTrails(e);for(let i=0;i<t.length;i++){t[i].pdomInstance.sortChildren()}},createTree(e,t,i){const s=e.lastNode(),n=s.getEffectiveChildren();let r,o=!1;s.hasPDOMContent&&(r=i.findChildWithTrail(e),r?o=!0:r=yA.pool.create(i,t,e.copy()),i=r);const A=[];for(let a=0;a<n.length;a++)e.addDescendant(n[a],a),Array.prototype.push.apply(A,qA.createTree(e,t,i)),e.removeDescendant();return r?(r.addConsecutiveInstances(A),o?[]:[r]):A},beforeOp(){IA=So.pdomFocusedNode,_A.blockFocusCallbacks=!0},afterOp(){IA&&IA.focusable&&IA.focus(),_A.blockFocusCallbacks=!1},findPDOMTrails(e){const t=[];return qA.recursivePDOMTrailSearch(t,new pn(e)),t},recursivePDOMTrailSearch(e,t){const i=t.rootNode();let s;if(i.hasPDOMContent){const n=i.pdomInstances;for(s=0;s<n.length;s++)e.push(new Ei(n[s],t.copy(),!1));return}{const n=i.rootedDisplays;for(s=0;s<n.length;s++){const i=n[s];i._accessible&&e.push(new Ei(i._rootPDOMInstance,t.copy(),!0))}}const n=i._pdomParent?[i._pdomParent]:i._parents,r=n.length;for(s=0;s<r;s++){const i=n[s];t.addAncestor(i),qA.recursivePDOMTrailSearch(e,t),t.removeAncestor()}},auditPDOMDisplays(e){0},auditNodeForPDOMCycles(e){0},debugOrder:e=>null===e?"null":`[${e.map(e=>null===e?"null":e._id).join(",")}]`};W.register("PDOMTree",qA);const GA=qA;var QA=i(2238);class SA{constructor(e,t,i){i=i||null,this.nodeCount=e,this.logToConsole=t,this.nodes=_.range(0,e).map(()=>new Zs),this.display=new Bd(this.nodes[0]),this.random=new Xo.Z({seed:i}),this.actionsTaken=[]}step(){const e=this.random.sample(this.enumerateActions());if(this.logToConsole&&console.log(e.text),this.actionsTaken.push(e),e.execute(),this.display._rootPDOMInstance.auditRoot(),GA.auditPDOMDisplays(this.display.rootNode),this.logToConsole)for(let t=0;t<this.nodes.length;t++){const e=this.nodes[t];console.log(`${t}#${e.id} ${e.tagName} ch:${GA.debugOrder(e.children)} or:${GA.debugOrder(e.pdomOrder)} vis:${e.visible} avis:${e.pdomVisible}`)}}enumerateActions(){const e=[];return this.nodes.forEach(t=>{e.push({text:`#${t.id}.visible = ${!t.visible}`,execute:()=>{t.visible=!t.visible}}),e.push({text:`#${t.id}.pdomVisible = ${!t.pdomVisible}`,execute:()=>{t.pdomVisible=!t.pdomVisible}}),["span","div",null].forEach(i=>{t.tagName!==i&&e.push({text:`#${t.id}.tagName = ${i}`,execute:()=>{t.tagName=i}})}),this.powerSet(ms(this.nodes,[t]).concat([null])).forEach(i=>{QA.Z.forEachPermutation(i,i=>{this.isPDOMOrderChangeLegal(t,i)&&e.push({text:`#${t.id}.pdomOrder = ${GA.debugOrder(i)}`,execute:()=>{t.pdomOrder=i}})})}),this.nodes.forEach(i=>{this.isAddChildLegal(t,i)&&_.range(0,t.children.length+1).forEach(s=>{e.push({text:`#${t.id}.insertChild(${s},#${i.id})`,execute:()=>{t.insertChild(s,i)}})}),t.hasChild(i)&&e.push({text:`#${t.id}.removeChild(#${i.id})`,execute:()=>{t.removeChild(i)}})})}),e}isAddChildLegal(e,t){return!e.hasChild(t)&&this.isAcyclic(e,t)}powerSet(e){if(0===e.length)return[[]];{const t=this.powerSet(e.slice(1));return t.concat(t.map(t=>[e[0]].concat(t)))}}isPDOMOrderChangeLegal(e,t){if(null===t&&(t=[]),t=t.filter(e=>null!==e),_.includes(t,e)||_.uniq(t).length<t.length)return!1;for(let n=0;n<t.length;n++)if(t[n]._pdomParent&&t[n]._pdomParent!==e)return!1;const i=(i,s)=>i===e?i.hasChild(s)||_.includes(t,s):i.hasChild(s)||!!i.pdomOrder&&_.includes(i.pdomOrder,s),s=e.children.concat(t);return _.every(s,t=>this.isAcyclic(e,t,i))}isAcyclic(e,t,i){if(e===t)return!1;const s=t.children.concat(t.pdomOrder).filter(e=>null!==e);for(;s.length;){const t=s.pop();if(t===e)return!1;i?this.nodes.forEach(e=>{i(t,e)&&s.push(e)}):(Array.prototype.push.apply(s,t.children),t.pdomOrder&&Array.prototype.push.apply(s,t.pdomOrder.filter(e=>null!==e)))}return!0}dispose(){this.display.dispose()}}W.register("PDOMFuzzer",SA);class TA extends ei.Z{}_defineProperty(TA,"DRAG",new(E=TA)),_defineProperty(TA,"KEYBOARD_DRAG",new E),_defineProperty(TA,"enumeration",new $t.Z(E,{phetioDocumentation:"entries when signifying Intent of the pointer"}));class xA{constructor(e,t){this.point=e,this.type=t,this.trail=null,this.inputEnabledTrail=null,this.isDownProperty=new bt.Z(!1),this.attachedProperty=new bt.Z(!1),this._listeners=[],this._attachedListener=null,this._cursor=null,this.lastEventContext=null,this._intents=[],this._pointerCaptured=!1,this._listenerForDragReserve=null,this._listenerForKeyboardDragReserve=null}setCursor(e){return this._cursor=e,this}set cursor(e){this.setCursor(e)}get cursor(){return this.getCursor()}getCursor(){return this._cursor}getListeners(){return this._listeners.slice()}get listeners(){return this.getListeners()}addInputListener(e,t){this._listeners.push(e),t&&this.attach(e)}removeInputListener(e){const t=_.indexOf(this._listeners,e);this.isAttached()&&e===this._attachedListener&&this.detach(e),this._listeners.splice(t,1)}getAttachedListener(){return this._attachedListener}get attachedListener(){return this.getAttachedListener()}isAttached(){return this.attachedProperty.value}isTouchLike(){return!1}set isDown(e){this.isDownProperty.value=e}get isDown(){return this.isDownProperty.value}interruptAttached(){this.isAttached()&&this._attachedListener.interrupt()}interruptAll(){const e=this._listeners.slice();for(let t=0;t<e.length;t++){const i=e[t];i.interrupt&&i.interrupt()}}attach(e){this.attachedProperty.value=!0,this._attachedListener=e}updatePoint(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];const t=this.hasPointChanged(e);return this.point=e,t}down(e){this.isDown=!0}up(e,t){return this.isDown=!1,this.updatePoint(e,"up")}cancel(e){return this.isDown=!1,this.updatePoint(e,"cancel")}detach(e){this.attachedProperty.value=!1,this._attachedListener=null}hasPointChanged(e){return!(this.point===e||e&&this.point&&this.point.equals(e))}addIntent(e){this._intents.includes(e)||this._intents.push(e)}removeIntent(e){if(this._intents.includes(e)){const t=this._intents.indexOf(e);this._intents.splice(t,1)}}hasIntent(e){return this._intents.includes(e)}reserveForDrag(){if(!this._intents.includes(TA.DRAG)){this.addIntent(TA.DRAG);const e={up:e=>{this.removeIntent(TA.DRAG),this.removeInputListener(this._listenerForDragReserve),this._listenerForDragReserve=null}};this._listenerForDragReserve=e,this.addInputListener(this._listenerForDragReserve)}}reserveForKeyboardDrag(){if(!this._intents.includes(TA.KEYBOARD_DRAG)){this.addIntent(TA.KEYBOARD_DRAG);const e={keyup:e=>t(),blur:e=>t()},t=()=>{this.removeIntent(TA.KEYBOARD_DRAG),this.removeInputListener(this._listenerForKeyboardDragReserve),this._listenerForKeyboardDragReserve=null};this._listenerForKeyboardDragReserve=e,this.addInputListener(this._listenerForKeyboardDragReserve)}}onGotPointerCapture(){this._pointerCaptured=!0}onLostPointerCapture(){this._pointerCaptured&&this.interruptAll(),this._pointerCaptured=!1}dispose(){this._listenerForDragReserve&&this._listeners.includes(this._listenerForDragReserve)&&this.removeInputListener(this._listenerForDragReserve),this._listenerForKeyboardDragReserve&&this._listeners.includes(this._listenerForKeyboardDragReserve)&&this.removeInputListener(this._listenerForKeyboardDragReserve)}toString(){return`Pointer#${this.type}_at_${this.point}`}}Y=xA,_defineProperty(xA,"PointerIO",new se.Z("PointerIO",{valueType:Y,toStateObject:e=>({point:e.point.toStateObject(),type:e.type}),stateSchema:{point:be.Z.Vector2IO,type:Ye.Z}})),W.register("Pointer",xA);var kA=i(8002);class FA extends xA{constructor(e){super(e,"mouse"),this.id=null,this.leftDown=!1,this.middleDown=!1,this.rightDown=!1,this.wheelDelta=new kA.Z(0,0,0),this.wheelDeltaMode=0}down(e){switch(e.button){case 0:this.leftDown=!0;break;case 1:this.middleDown=!0;break;case 2:this.rightDown=!0}return super.down(e)}up(e,t){switch(t.button){case 0:this.leftDown=!1;break;case 1:this.middleDown=!1;break;case 2:this.rightDown=!1}return super.up(e,t)}move(e){const t=this.hasPointChanged(e);return this.point=e,t}over(e){const t=this.hasPointChanged(e);return this.point=e,t}out(e){return this.hasPointChanged(e)}wheel(e){const t=e;this.wheelDelta.setXYZ(t.deltaX,t.deltaY,t.deltaZ),this.wheelDeltaMode=t.deltaMode}toString(){return"Mouse"}}W.register("Mouse",FA);class RA extends xA{constructor(e,t,i){super(t,"touch"),this.id=e}move(e){const t=this.hasPointChanged(e);return this.point=e,t}toString(){return"Touch#"+this.id}isTouchLike(){return!0}}W.register("Touch",RA);class UA extends xA{constructor(e,t,i){super(t,"pen"),this.id=e}move(e){const t=this.hasPointChanged(e);return this.point=e,t}toString(){return"Pen#"+this.id}isTouchLike(){return!0}}W.register("Pen",UA);class LA extends xA{constructor(e){super(be.Z.ZERO,"pdom"),this.display=e,this.initializeListeners(),this.blockTrustedEvents=!1,this.keydownTargetNode=null}initializeListeners(){this.addInputListener({focus:e=>{const t=this.trail.lastNode();if(t.focusable){const e=yA.guessVisualTrail(this.trail,this.display.rootNode);this.point=e.parentToGlobalPoint(t.center),isNaN(this.point.x)&&this.point.setXY(0,0)}},blur:e=>{this.trail=null,this.keydownTargetNode=null},keydown:e=>{this.blockTrustedEvents&&e.domEvent.isTrusted||(this.keydownTargetNode=e.target)},keyup:e=>{this.blockTrustedEvents&&e.domEvent.isTrusted||this.keydownTargetNode!==e.target&&e.abort()}})}updateTrail(e){return this.trail&&this.trail.equals(e)||(this.trail=e),this.trail}}W.register("PDOMPointer",LA);class PA{constructor(e){this.domEvent=e,this.activeElement=document.activeElement}static createSynthetic(){return new PA(new window.Event("synthetic"))}}const bA=new se.Z("EventContextIO",{valueType:PA,documentation:"A DOM event and its context",toStateObject:e=>({domEvent:jA.serializeDomEvent(e.domEvent)}),fromStateObject:e=>new PA(jA.deserializeDomEvent(e.domEvent)),stateSchema:()=>({domEvent:Mt})});W.register("EventContext",PA);class OA{constructor(e,t,i,s){this.handled=!1,this.aborted=!1,this.trail=e,this.type=t,this.pointer=i,this.context=s,this.domEvent=s.domEvent,this.activeElement=s.activeElement,this.currentTarget=null,this.target=e.lastNode(),this.isPrimary=!(i instanceof FA&&this.domEvent&&0!==this.domEvent.button),i.lastEventContext=s}handle(){this.handled=!0}abort(){this.aborted=!0}isFromPDOM(){return this.pointer instanceof LA}canStartPress(){return!(this.pointer.isAttached()||this.pointer instanceof FA&&0!==this.domEvent.button)}}D=OA,_defineProperty(OA,"SceneryEventIO",new se.Z("SceneryEventIO",{valueType:D,documentation:'An event, with a "point" field',toStateObject:e=>({type:e.type,domEventType:(0,mt.Z)(Mt).toStateObject(e.domEvent),point:e.pointer&&e.pointer.point?be.Z.Vector2IO.toStateObject(e.pointer.point):null}),stateSchema:{type:Ye.Z,domEventType:(0,mt.Z)(Mt),point:(0,mt.Z)(be.Z.Vector2IO)}})),W.register("SceneryEvent",OA);const fA=(0,He.Z)(xA.PointerIO),ZA=["altKey","button","charCode","clientX","clientY","code","ctrlKey","deltaMode","deltaX","deltaY","deltaZ","key","keyCode","metaKey","pageX","pageY","pointerId","pointerType","scale","shiftKey","target","type","relatedTarget","which"],NA=["deltaMode","deltaX","deltaY","deltaZ","altKey","button","charCode","clientX","clientY","code","ctrlKey","key","keyCode","metaKey","pageX","pageY","pointerId","pointerType","shiftKey","type","relatedTarget","which"],KA=["target","relatedTarget"],JA=["focus","blur","focusin","focusout"];class jA extends Ee.Z{constructor(e,t,i,s,n,r){var o,A,a,h,l,g,c,d,u,m,p,V,M,B,w,C,E,Y,D,y,I,q,G,Q;const S=(0,Ce.ZP)()({phetioType:jA.InputIO,phetioDocumentation:"Central point for user input events, such as mouse, touch"},r);super(S),_defineProperty(this,"currentSceneryEvent",null),this.display=e,this.rootNode=e.rootNode,this.attachToWindow=t,this.batchDOMEvents=i,this.assumeFullWindow=s,this.passiveEvents=n,this.batchedEvents=[],this.pdomPointer=null,this.mouse=null,this.pointers=[],this.pointerAddedEmitter=new te.Z,this.currentlyFiringEvents=!1,this.upTimeStamp=0,this.validatePointersAction=new Zr.Z(()=>{let e=this.pointers.length;for(;e--;){const t=this.pointers[e];t.point&&t!==this.pdomPointer&&this.branchChangeEvents(t,t.lastEventContext||PA.createSynthetic(),!1)}},{phetioPlayback:!0,tandem:null===(o=S.tandem)||void 0===o?void 0:o.createTandem("validatePointersAction"),phetioHighFrequency:!0}),this.mouseUpAction=new Zr.Z((e,t)=>{const i=this.ensureMouse(e);i.id=null,this.upEvent(i,t,e)},{phetioPlayback:!0,tandem:null===(A=S.tandem)||void 0===A?void 0:A.createTandem("mouseUpAction"),parameters:[{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a mouse button is released."}),this.mouseDownAction=new Zr.Z((e,t,i)=>{const s=this.ensureMouse(t);s.id=e,this.downEvent(s,i,t)},{phetioPlayback:!0,tandem:null===(a=S.tandem)||void 0===a?void 0:a.createTandem("mouseDownAction"),parameters:[{name:"id",phetioType:(0,mt.Z)(ne.Z)},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a mouse button is pressed."}),this.mouseMoveAction=new Zr.Z((e,t)=>{const i=this.ensureMouse(e);i.move(e),this.moveEvent(i,t)},{phetioPlayback:!0,tandem:null===(h=S.tandem)||void 0===h?void 0:h.createTandem("mouseMoveAction"),parameters:[{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the mouse is moved.",phetioHighFrequency:!0}),this.mouseOverAction=new Zr.Z((e,t)=>{this.ensureMouse(e).over(e)},{phetioPlayback:!0,tandem:null===(l=S.tandem)||void 0===l?void 0:l.createTandem("mouseOverAction"),parameters:[{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the mouse is moved while on the sim."}),this.mouseOutAction=new Zr.Z((e,t)=>{this.ensureMouse(e).out(e)},{phetioPlayback:!0,tandem:null===(g=S.tandem)||void 0===g?void 0:g.createTandem("mouseOutAction"),parameters:[{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the mouse moves out of the display."}),this.wheelScrollAction=new Zr.Z(e=>{const t=e.domEvent,i=this.ensureMouse(this.pointFromEvent(t));if(i.wheel(t),i.point){const t=this.rootNode.trailUnderPointer(i)||new pn(this.rootNode);this.dispatchEvent(t,"wheel",i,e,!0)}},{phetioPlayback:!0,tandem:null===(c=S.tandem)||void 0===c?void 0:c.createTandem("wheelScrollAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the mouse wheel scrolls.",phetioHighFrequency:!0}),this.touchStartAction=new Zr.Z((e,t,i)=>{const s=new RA(e,t,i.domEvent);this.addPointer(s),this.downEvent(s,i,t)},{phetioPlayback:!0,tandem:null===(d=S.tandem)||void 0===d?void 0:d.createTandem("touchStartAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a touch begins."}),this.touchEndAction=new Zr.Z((e,t,i)=>{const s=this.findPointerById(e);s&&(this.upEvent(s,i,t),this.removePointer(s))},{phetioPlayback:!0,tandem:null===(u=S.tandem)||void 0===u?void 0:u.createTandem("touchEndAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a touch ends."}),this.touchMoveAction=new Zr.Z((e,t,i)=>{const s=this.findPointerById(e);s&&(s.move(t),this.moveEvent(s,i))},{phetioPlayback:!0,tandem:null===(m=S.tandem)||void 0===m?void 0:m.createTandem("touchMoveAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a touch moves.",phetioHighFrequency:!0}),this.touchCancelAction=new Zr.Z((e,t,i)=>{const s=this.findPointerById(e);s&&(this.cancelEvent(s,i,t),this.removePointer(s))},{phetioPlayback:!0,tandem:null===(p=S.tandem)||void 0===p?void 0:p.createTandem("touchCancelAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a touch is canceled."}),this.penStartAction=new Zr.Z((e,t,i)=>{const s=new UA(e,t,i.domEvent);this.addPointer(s),this.downEvent(s,i,t)},{phetioPlayback:!0,tandem:null===(V=S.tandem)||void 0===V?void 0:V.createTandem("penStartAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a pen touches the screen."}),this.penEndAction=new Zr.Z((e,t,i)=>{const s=this.findPointerById(e);s&&(this.upEvent(s,i,t),this.removePointer(s))},{phetioPlayback:!0,tandem:null===(M=S.tandem)||void 0===M?void 0:M.createTandem("penEndAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a pen is lifted."}),this.penMoveAction=new Zr.Z((e,t,i)=>{const s=this.findPointerById(e);s&&(s.move(t),this.moveEvent(s,i))},{phetioPlayback:!0,tandem:null===(B=S.tandem)||void 0===B?void 0:B.createTandem("penMoveAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a pen is moved.",phetioHighFrequency:!0}),this.penCancelAction=new Zr.Z((e,t,i)=>{const s=this.findPointerById(e);s&&(this.cancelEvent(s,i,t),this.removePointer(s))},{phetioPlayback:!0,tandem:null===(w=S.tandem)||void 0===w?void 0:w.createTandem("penCancelAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"point",phetioType:be.Z.Vector2IO},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a pen is canceled."}),this.gotPointerCaptureAction=new Zr.Z((e,t)=>{const i=this.findPointerById(e);i&&i.onGotPointerCapture()},{phetioPlayback:!0,tandem:null===(C=S.tandem)||void 0===C?void 0:C.createTandem("gotPointerCaptureAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a pointer is captured (normally at the start of an interaction)",phetioHighFrequency:!0}),this.lostPointerCaptureAction=new Zr.Z((e,t)=>{const i=this.findPointerById(e);i&&i.onLostPointerCapture()},{phetioPlayback:!0,tandem:null===(E=S.tandem)||void 0===E?void 0:E.createTandem("lostPointerCaptureAction"),parameters:[{name:"id",phetioType:ne.Z},{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when a pointer loses its capture (normally at the end of an interaction)",phetioHighFrequency:!0}),this.focusinAction=new Zr.Z(e=>{const t=this.getPDOMEventTrail(e.domEvent,"focusin");t&&(this.dispatchPDOMEvent(t,"focus",e,!1),this.dispatchPDOMEvent(t,"focusin",e,!0))},{phetioPlayback:!0,tandem:null===(Y=S.tandem)||void 0===Y?void 0:Y.createTandem("focusinAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the PDOM root gets the focusin DOM event."}),this.focusoutAction=new Zr.Z(e=>{const t=this.getPDOMEventTrail(e.domEvent,"focusout");t&&(this.dispatchPDOMEvent(t,"blur",e,!1),this.dispatchPDOMEvent(t,"focusout",e,!0))},{phetioPlayback:!0,tandem:null===(D=S.tandem)||void 0===D?void 0:D.createTandem("focusoutAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the PDOM root gets the focusout DOM event."}),this.clickAction=new Zr.Z(e=>{const t=this.getPDOMEventTrail(e.domEvent,"click");t&&this.dispatchPDOMEvent(t,"click",e,!0)},{phetioPlayback:!0,tandem:null===(y=S.tandem)||void 0===y?void 0:y.createTandem("clickAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the PDOM root gets the click DOM event."}),this.inputAction=new Zr.Z(e=>{const t=this.getPDOMEventTrail(e.domEvent,"input");t&&this.dispatchPDOMEvent(t,"input",e,!0)},{phetioPlayback:!0,tandem:null===(I=S.tandem)||void 0===I?void 0:I.createTandem("inputAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the PDOM root gets the input DOM event."}),this.changeAction=new Zr.Z(e=>{const t=this.getPDOMEventTrail(e.domEvent,"change");t&&this.dispatchPDOMEvent(t,"change",e,!0)},{phetioPlayback:!0,tandem:null===(q=S.tandem)||void 0===q?void 0:q.createTandem("changeAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the PDOM root gets the change DOM event."}),this.keydownAction=new Zr.Z(e=>{this.dispatchGlobalEvent("globalkeydown",e,!0);const t=this.getPDOMEventTrail(e.domEvent,"keydown");t&&this.dispatchPDOMEvent(t,"keydown",e,!0),this.dispatchGlobalEvent("globalkeydown",e,!1)},{phetioPlayback:!0,tandem:null===(G=S.tandem)||void 0===G?void 0:G.createTandem("keydownAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the PDOM root gets the keydown DOM event."}),this.keyupAction=new Zr.Z(e=>{this.dispatchGlobalEvent("globalkeyup",e,!0);const t=this.getPDOMEventTrail(e.domEvent,"keydown");t&&this.dispatchPDOMEvent(t,"keyup",e,!0),this.dispatchGlobalEvent("globalkeyup",e,!1)},{phetioPlayback:!0,tandem:null===(Q=S.tandem)||void 0===Q?void 0:Q.createTandem("keyupAction"),parameters:[{name:"context",phetioType:bA}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Emits when the PDOM root gets the keyup DOM event."})}interruptPointers(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_.each(this.pointers,t=>{t!==e&&t.interruptAll()})}batchEvent(e,t,i,s){this.display.interactive&&(this.batchedEvents.push(HA.pool.create(e,t,i)),!s&&this.batchDOMEvents||this.fireBatchedEvents()),!0===this.passiveEvents||i===this.mouseDown&&!Oe.Z.edge||t===vA.ALT_TYPE||e.domEvent.preventDefault()}fireBatchedEvents(){if(!this.currentlyFiringEvents&&this.batchedEvents.length){this.currentlyFiringEvents=!0;const e=this.batchedEvents;for(let t=0;t<e.length;t++){const i=e[t];i.run(this),i.dispose()}(0,Ji.Z)(e),this.currentlyFiringEvents=!1}}clearBatchedEvents(){this.batchedEvents.length=0}validatePointers(){this.validatePointersAction.execute()}removeTemporaryPointers(){for(let e=this.pointers.length-1;e>=0;e--){const t=this.pointers[e];if(!(t instanceof FA)){this.pointers.splice(e,1);const i=t.trail||new pn(this.rootNode);this.exitEvents(t,PA.createSynthetic(),i,0,!0)}}}connectListeners(){_A.addDisplay(this.display,this.attachToWindow,this.passiveEvents)}disconnectListeners(){_A.removeDisplay(this.display,this.attachToWindow,this.passiveEvents)}pointFromEvent(e){const t=be.Z.pool.create(e.clientX,e.clientY);if(!this.assumeFullWindow){const e=this.display.domElement.getBoundingClientRect();e.width>0&&e.height>0&&(t.subtractXY(e.left,e.top),e.width===this.display.width&&e.height===this.display.height||(t.x*=this.display.width/e.width,t.y*=this.display.height/e.height))}return t}addPointer(e){this.pointers.push(e),this.pointerAddedEmitter.emit(e)}removePointer(e){for(let t=this.pointers.length-1;t>=0;t--)this.pointers[t]===e&&this.pointers.splice(t,1);e.dispose()}findPointerById(e){let t=this.pointers.length;for(;t--;){const i=this.pointers[t];if(i.id===e)return i}return null}getPDOMEventTrail(e,t){if(!this.display.interactive)return null;const i=this.getTrailFromPDOMEvent(e);return i&&!("click"===t&&_.some(i.nodes,e=>e.positionInPDOM)&&e.timeStamp-this.upTimeStamp<=80)?i:null}initMouse(e){const t=new FA(e);return this.mouse=t,this.addPointer(t),t}ensureMouse(e){const t=this.mouse;return t||this.initMouse(e)}initPDOMPointer(){const e=new LA(this.display);return this.pdomPointer=e,this.addPointer(e),e}ensurePDOMPointer(){const e=this.pdomPointer;return e||this.initPDOMPointer()}dispatchPDOMEvent(e,t,i,s){this.ensurePDOMPointer().updateTrail(e),Fi.USER_GESTURE_EVENTS.includes(t)&&Bd.userGestureEmitter.emit();const n=i.domEvent;if(!n.target||!n.target.hasAttribute(Fi.DATA_EXCLUDE_FROM_INPUT)){e.isPickable()||JA.includes(t)||(e=new pn([])),this.dispatchEvent(e,t,this.pdomPointer,i,s)}}dispatchGlobalEvent(e,t,i){this.ensurePDOMPointer();const s=this.pdomPointer,n=new OA(new pn,e,s,t),r=t=>{if(!t.isDisposed&&t.isVisible()&&t.isInputEnabled()&&t.isPDOMVisible()){for(let e=t._children.length-1;e>=0;e--)r(t._children[e]);n.aborted||n.handled||(n.currentTarget=t,this.dispatchToListeners(s,t._inputListeners,e,n,i))}};r(this.rootNode)}getRelatedTargetTrail(e){const t=e.relatedTarget;if(t&&this.display.isElementUnderPDOM(t)){const t=e.relatedTarget,i=t.getAttribute(Fi.DATA_PDOM_UNIQUE_ID);return yA.uniqueIdToTrail(this.display,i)}return null}getTrailFromPDOMEvent(e){if(!this.display._accessible)return null;if(e.targetSubstitute){const t=e.targetSubstitute.getAttribute(Fi.DATA_PDOM_UNIQUE_ID);return yA.uniqueIdToTrail(this.display,t)}{const t=e.target;if(t&&this.display.isElementUnderPDOM(t)){const e=t.getAttribute(Fi.DATA_PDOM_UNIQUE_ID);return yA.uniqueIdToTrail(this.display,e)}}return null}mouseDown(e,t,i){this.mouseDownAction.execute(e,t,i)}mouseUp(e,t){this.mouseUpAction.execute(e,t)}mouseMove(e,t){this.mouseMoveAction.execute(e,t)}mouseOver(e,t){this.mouseOverAction.execute(e,t)}mouseOut(e,t){this.mouseOutAction.execute(e,t)}wheel(e){this.wheelScrollAction.execute(e)}touchStart(e,t,i){this.touchStartAction.execute(e,t,i)}touchEnd(e,t,i){this.touchEndAction.execute(e,t,i)}touchMove(e,t,i){this.touchMoveAction.execute(e,t,i)}touchCancel(e,t,i){this.touchCancelAction.execute(e,t,i)}penStart(e,t,i){this.penStartAction.execute(e,t,i)}penEnd(e,t,i){this.penEndAction.execute(e,t,i)}penMove(e,t,i){this.penMoveAction.execute(e,t,i)}penCancel(e,t,i){this.penCancelAction.execute(e,t,i)}pointerDown(e,t,i,s){const n=this.attachToWindow?document.body:this.display.domElement;switch(n.setPointerCapture&&s.domEvent.pointerId&&n.setPointerCapture(s.domEvent.pointerId),t=this.handleUnknownPointerType(t,e)){case"mouse":this.mouseDown(e,i,s);break;case"touch":this.touchStart(e,i,s);break;case"pen":this.penStart(e,i,s);break;default:0}}pointerUp(e,t,i,s){switch(this.upTimeStamp=s.domEvent.timeStamp,t=this.handleUnknownPointerType(t,e)){case"mouse":this.mouseUp(i,s);break;case"touch":this.touchEnd(e,i,s);break;case"pen":this.penEnd(e,i,s);break;default:0}}pointerCancel(e,t,i,s){switch(t=this.handleUnknownPointerType(t,e)){case"mouse":console&&console.log&&console.log("WARNING: Pointer mouse cancel was received");break;case"touch":this.touchCancel(e,i,s);break;case"pen":this.penCancel(e,i,s);break;default:console.log&&console.log("Unknown pointer type: "+t)}}gotPointerCapture(e,t,i,s){this.gotPointerCaptureAction.execute(e,s)}lostPointerCapture(e,t,i,s){this.lostPointerCaptureAction.execute(e,s)}pointerMove(e,t,i,s){switch(t=this.handleUnknownPointerType(t,e)){case"mouse":this.mouseMove(i,s);break;case"touch":this.touchMove(e,i,s);break;case"pen":this.penMove(e,i,s);break;default:console.log&&console.log("Unknown pointer type: "+t)}}pointerOver(e,t,i,s){}pointerOut(e,t,i,s){}pointerEnter(e,t,i,s){}pointerLeave(e,t,i,s){}focusIn(e){this.focusinAction.execute(e)}focusOut(e){this.focusoutAction.execute(e)}input(e){this.inputAction.execute(e)}change(e){this.changeAction.execute(e)}click(e){this.clickAction.execute(e)}keyDown(e){this.keydownAction.execute(e)}keyUp(e){this.keyupAction.execute(e)}handleUnknownPointerType(e,t){return""!==e?e:this.mouse&&this.mouse.id===t?"mouse":"touch"}getPointerTrail(e){return this.rootNode.trailUnderPointer(e)||new pn(this.rootNode)}upEvent(e,t,i){if(this.display.isElementUnderPDOM(t.domEvent.target))return;const s=e.up(i,t.domEvent),n=this.branchChangeEvents(e,t,s);this.dispatchEvent(n,"up",e,t,!0),e.isTouchLike()&&this.exitEvents(e,t,n,0,!0)}downEvent(e,t,i){if(this.display.isElementUnderPDOM(t.domEvent.target))return;const s=e.updatePoint(i),n=this.branchChangeEvents(e,t,s);e.down(t.domEvent),this.dispatchEvent(n,"down",e,t,!0)}moveEvent(e,t){this.branchChangeEvents(e,t,!0)}cancelEvent(e,t,i){const s=e.cancel(i),n=this.branchChangeEvents(e,t,s);this.dispatchEvent(n,"cancel",e,t,!0),e.isTouchLike()&&this.exitEvents(e,t,n,0,!0)}branchChangeEvents(e,t,i){const s=this.getPointerTrail(e),n=s.slice(0,Math.min(s.nodes.length,s.getLastInputEnabledIndex()+1)),r=e.inputEnabledTrail||new pn(this.rootNode),o=pn.branchIndex(n,r),A=r.lastNode()!==n.lastNode();return i&&this.dispatchEvent(s,"move",e,t,!0),this.exitEvents(e,t,r,o,A),this.enterEvents(e,t,n,o,A),e.trail=s,e.inputEnabledTrail=n,s}enterEvents(e,t,i,s,n){n&&this.dispatchEvent(i,"over",e,t,!0,!0);for(let r=s;r<i.length;r++)this.dispatchEvent(i.slice(0,r+1),"enter",e,t,!1)}exitEvents(e,t,i,s,n){for(let r=i.length-1;r>=s;r--)this.dispatchEvent(i.slice(0,r+1),"exit",e,t,!1,!0);n&&this.dispatchEvent(i,"out",e,t,!0)}dispatchEvent(e,t,i,s,n){let r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const o=new OA(e,t,i,s);this.currentSceneryEvent=o,this.dispatchToListeners(i,i.getListeners(),t,o),this.dispatchToTargets(e,t,i,o,n,r),this.dispatchToListeners(i,this.display.getInputListeners(),t,o),Bd.inputListeners.length&&this.dispatchToListeners(i,Bd.inputListeners.slice(),t,o),this.currentSceneryEvent=null}dispatchToListeners(e,t,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(s.handled)return;const r=e.type+i;for(let o=0;o<t.length;o++){const e=t[o];null!==n&&n!==!!e.capture||(!s.aborted&&e[r]&&e[r](s),!s.aborted&&e[i]&&e[i](s))}}dispatchToTargets(e,t,i,s,n){let r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(s.aborted||s.handled)return;const o=e.getLastInputEnabledIndex();for(let A=e.nodes.length-1;A>=0;n?A--:A=-1){const n=e.nodes[A],a=o<A;if(!(n.isDisposed||!r&&a)&&(s.currentTarget=n,this.dispatchToListeners(i,n.getInputListeners(),t,s),s.aborted||s.handled))return}}static serializeDomEvent(e){const t={constructorName:e.constructor.name};return ZA.forEach(i=>{const s=e[i];null==s?t[i]=null:s instanceof Element&&KA.includes(i)&&"function"==typeof s.getAttribute&&s.hasAttribute(Fi.DATA_PDOM_UNIQUE_ID)?t[i]={[Fi.DATA_PDOM_UNIQUE_ID]:s.getAttribute(Fi.DATA_PDOM_UNIQUE_ID),id:s.getAttribute("id")}:t[i]="object"==typeof s?{}:JSON.parse(JSON.stringify(s))}),t}static deserializeDomEvent(e){const t=e.constructorName||"Event",i=_.pick(e,NA);if(i.relatedTarget){const e=document.getElementById(i.relatedTarget.id);i.relatedTarget=e}const s=new window[t](t,i);for(const n in e)e.hasOwnProperty(n)&&!NA.includes(n)&&("target"===n?(s.targetSubstitute=_.clone(e[n])||{},s.targetSubstitute.getAttribute=function(e){return this[e]}):s[n]=e[n]);return s}static debugText(e,t){let i=`${t.timeStamp} ${t.type}`;return null!==e&&(i=`${e.x},${e.y} ${i}`),i}static msPointerType(e){return e.pointerType===window.MSPointerEvent.MSPOINTER_TYPE_TOUCH?"touch":e.pointerType===window.MSPointerEvent.MSPOINTER_TYPE_PEN?"pen":e.pointerType===window.MSPointerEvent.MSPOINTER_TYPE_MOUSE?"mouse":e.pointerType}}y=jA,_defineProperty(jA,"InputIO",new se.Z("InputIO",{valueType:y,applyState:_.noop,toStateObject:e=>({pointers:fA.toStateObject(e.pointers)}),stateSchema:{pointers:fA}})),W.register("Input",jA);class vA extends ei.Z{}_defineProperty(vA,"POINTER_TYPE",new(I=vA)),_defineProperty(vA,"MS_POINTER_TYPE",new I),_defineProperty(vA,"TOUCH_TYPE",new I),_defineProperty(vA,"MOUSE_TYPE",new I),_defineProperty(vA,"WHEEL_TYPE",new I),_defineProperty(vA,"ALT_TYPE",new I),_defineProperty(vA,"enumeration",new $t.Z(I,{phetioDocumentation:"The type of batched event"}));class HA{constructor(e,t,i){this.initialize(e,t,i)}initialize(e,t,i){return this.eventContext=e,this.type=t,this.callback=i,this}run(e){const t=this.callback;if(e.validatePointers(),this.type===vA.POINTER_TYPE){const i=this.eventContext,s=i.domEvent;t.call(e,s.pointerId,s.pointerType,e.pointFromEvent(s),i)}else if(this.type===vA.MS_POINTER_TYPE){const i=this.eventContext,s=i.domEvent;t.call(e,s.pointerId,jA.msPointerType(s),e.pointFromEvent(s),i)}else if(this.type===vA.TOUCH_TYPE){const i=this.eventContext,s=i.domEvent;for(let n=0;n<s.changedTouches.length;n++){const r=s.changedTouches.item(n);t.call(e,r.identifier,e.pointFromEvent(r),i)}}else if(this.type===vA.MOUSE_TYPE){const i=this.eventContext,s=e.pointFromEvent(i.domEvent);t===e.mouseDown?t.call(e,null,s,i):t.call(e,s,i)}else{if(this.type!==vA.WHEEL_TYPE&&this.type!==vA.ALT_TYPE)throw new Error("bad type value: "+this.type);t.call(e,this.eventContext)}}dispose(){this.eventContext=null,this.callback=null,this.freeToPool()}freeToPool(){HA.pool.freeToPool(this)}}q=HA,_defineProperty(HA,"pool",new ti.Z(q)),W.register("BatchedDOMEvent",HA);const WA=()=>{};let zA=!1;const XA={blockFocusCallbacks:!1,addDisplay(e,t,i){zA||(zA=!0,Hr.attachToWindow(),So.attachToWindow()),this.attachedDisplays.push(e),t?1===this.attachedDisplays.length&&this.connectWindowListeners(i):this.addOrRemoveListeners(e.domElement,!0,i),e.domElement.addEventListener("wheel",this.onwheel,XA.getEventOptions(i,!0))},removeDisplay(e,t,i){(0,Oi.Z)(this.attachedDisplays,e),t?0===this.attachedDisplays.length&&this.disconnectWindowListeners(i):this.addOrRemoveListeners(e.domElement,!1,i),e.domElement.removeEventListener("wheel",this.onwheel,XA.getEventOptions(i,!0))},getEventOptions(e,t){if(we.passive&&null!==e){const i={passive:e};return t&&(i.capture=!1),i}return!1},listenersAttachedToWindow:0,listenersAttachedToElement:0,attachedDisplays:[],canUsePointerEvents:!!(window.navigator&&window.navigator.pointerEnabled||window.PointerEvent)&&!Oe.Z.firefox,canUseMSPointerEvents:window.navigator&&window.navigator.msPointerEnabled,pointerListenerTypes:["pointerdown","pointerup","pointermove","pointerover","pointerout","pointercancel","gotpointercapture","lostpointercapture"],msPointerListenerTypes:["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerOver","MSPointerOut","MSPointerCancel"],touchListenerTypes:["touchstart","touchend","touchmove","touchcancel"],mouseListenerTypes:["mousedown","mouseup","mousemove","mouseover","mouseout"],wheelListenerTypes:["wheel"],altListenerTypes:Fi.DOM_EVENTS,getNonWheelUsedTypes(){let e;return e=this.canUsePointerEvents?this.pointerListenerTypes:this.canUseMSPointerEvents?this.msPointerListenerTypes:this.touchListenerTypes.concat(this.mouseListenerTypes),e=e.concat(this.altListenerTypes),e},connectWindowListeners(e){this.addOrRemoveListeners(window,!0,e)},disconnectWindowListeners(e){this.addOrRemoveListeners(window,!1,e)},addOrRemoveListeners(e,t,i){const s=e===window,n=t?1:-1;s?this.listenersAttachedToWindow+=n:this.listenersAttachedToElement+=n;const r=t?"addEventListener":"removeEventListener",o=this.getNonWheelUsedTypes();for(let A=0;A<o.length;A++){const t=o[A];s&&document[r](t,WA,XA.getEventOptions(i,!1));const n=this["on"+t];e[r](t,n,XA.getEventOptions(i,!0))}},batchWindowEvent(e,t,i,s){for(let n=0;n<this.attachedDisplays.length;n++){const r=this.attachedDisplays[n]._input;(!XA.blockFocusCallbacks||"focusIn"!==i&&"focusOut"!==i)&&r.batchEvent(e,t,r[i],s)}},onpointerdown:function(e){const t=new PA(e);"mouse"===e.pointerType&&Bd.userGestureEmitter.emit(),XA.batchWindowEvent(t,vA.POINTER_TYPE,"pointerDown",!1)},onpointerup:function(e){const t=new PA(e);Bd.userGestureEmitter.emit(),XA.batchWindowEvent(t,vA.POINTER_TYPE,"pointerUp",!0)},onpointermove:function(e){XA.batchWindowEvent(new PA(e),vA.POINTER_TYPE,"pointerMove",!1)},onpointerover:function(e){XA.batchWindowEvent(new PA(e),vA.POINTER_TYPE,"pointerOver",!1)},onpointerout:function(e){XA.batchWindowEvent(new PA(e),vA.POINTER_TYPE,"pointerOut",!1)},onpointercancel:function(e){XA.batchWindowEvent(new PA(e),vA.POINTER_TYPE,"pointerCancel",!1)},ongotpointercapture:function(e){XA.batchWindowEvent(new PA(e),vA.POINTER_TYPE,"gotPointerCapture",!1)},onlostpointercapture:function(e){XA.batchWindowEvent(new PA(e),vA.POINTER_TYPE,"lostPointerCapture",!1)},onMSPointerDown:function(e){XA.batchWindowEvent(new PA(e),vA.MS_POINTER_TYPE,"pointerDown",!1)},onMSPointerUp:function(e){XA.batchWindowEvent(new PA(e),vA.MS_POINTER_TYPE,"pointerUp",!0)},onMSPointerMove:function(e){XA.batchWindowEvent(new PA(e),vA.MS_POINTER_TYPE,"pointerMove",!1)},onMSPointerOver:function(e){XA.batchWindowEvent(new PA(e),vA.MS_POINTER_TYPE,"pointerOver",!1)},onMSPointerOut:function(e){XA.batchWindowEvent(new PA(e),vA.MS_POINTER_TYPE,"pointerOut",!1)},onMSPointerCancel:function(e){XA.batchWindowEvent(new PA(e),vA.MS_POINTER_TYPE,"pointerCancel",!1)},ontouchstart:function(e){XA.batchWindowEvent(new PA(e),vA.TOUCH_TYPE,"touchStart",!1)},ontouchend:function(e){const t=new PA(e);Bd.userGestureEmitter.emit(),XA.batchWindowEvent(t,vA.TOUCH_TYPE,"touchEnd",!0)},ontouchmove:function(e){XA.batchWindowEvent(new PA(e),vA.TOUCH_TYPE,"touchMove",!1)},ontouchcancel:function(e){XA.batchWindowEvent(new PA(e),vA.TOUCH_TYPE,"touchCancel",!1)},onmousedown:function(e){const t=new PA(e);Bd.userGestureEmitter.emit(),XA.batchWindowEvent(t,vA.MOUSE_TYPE,"mouseDown",!1)},onmouseup:function(e){const t=new PA(e);Bd.userGestureEmitter.emit(),XA.batchWindowEvent(t,vA.MOUSE_TYPE,"mouseUp",!0)},onmousemove:function(e){XA.batchWindowEvent(new PA(e),vA.MOUSE_TYPE,"mouseMove",!1)},onmouseover:function(e){XA.batchWindowEvent(new PA(e),vA.MOUSE_TYPE,"mouseOver",!1)},onmouseout:function(e){XA.batchWindowEvent(new PA(e),vA.MOUSE_TYPE,"mouseOut",!1)},onwheel:function(e){XA.batchWindowEvent(new PA(e),vA.WHEEL_TYPE,"wheel",!1)},onfocusin:function(e){So.updatePDOMFocusFromEvent(XA.attachedDisplays,e,!0),XA.batchWindowEvent(new PA(e),vA.ALT_TYPE,"focusIn",!0)},onfocusout:function(e){So.updatePDOMFocusFromEvent(XA.attachedDisplays,e,!1),XA.batchWindowEvent(new PA(e),vA.ALT_TYPE,"focusOut",!0)},oninput:function(e){XA.batchWindowEvent(new PA(e),vA.ALT_TYPE,"input",!0)},onchange:function(e){XA.batchWindowEvent(new PA(e),vA.ALT_TYPE,"change",!0)},onclick:function(e){XA.batchWindowEvent(new PA(e),vA.ALT_TYPE,"click",!0)},onkeydown:function(e){XA.batchWindowEvent(new PA(e),vA.ALT_TYPE,"keyDown",!0)},onkeyup:function(e){XA.batchWindowEvent(new PA(e),vA.ALT_TYPE,"keyUp",!0)}};W.register("BrowserEvents",XA);const _A=XA;class $A{constructor(e,t){this.display=e,this.touches=[],this.nextTouchID=1,this.isMouseDown=!1,this.mousePosition=new be.Z(0,0),this.random=new Xo.Z({seed:t}),this.mouseToggleAction=()=>{this.mouseToggle()},this.mouseMoveAction=()=>{this.mouseMove()},this.touchStartAction=()=>{const e=this.createTouch(this.getRandomPosition());this.touchStart(e)},this.touchMoveAction=()=>{const e=this.random.sample(this.touches);this.touchMove(e)},this.touchEndAction=()=>{const e=this.random.sample(this.touches);this.touchEnd(e),this.removeTouch(e)},this.touchCancelAction=()=>{const e=this.random.sample(this.touches);this.touchCancel(e),this.removeTouch(e)}}fuzzEvents(e,t,i,s){for(this.display._input.currentlyFiringEvents=!0;this.random.nextDouble()<1-1/(e+1);){const e=this.touches.length+(this.isMouseDown?1:0)<s,n=[];t&&(this.isMouseDown||e)&&(n.push(this.mouseToggleAction),n.push(this.mouseMoveAction)),i&&(e&&n.push(this.touchStartAction),this.touches.length&&(n.push(this.random.nextDouble()<.8?this.touchEndAction:this.touchCancelAction),n.push(this.touchMoveAction))),this.random.sample(n)()}this.display._input.currentlyFiringEvents=!1,this.display._input.fireBatchedEvents()}createTouchEvent(e,t){const i=this.display.domElement,s=t.map(e=>({identifier:e.id,target:i,clientX:e.position.x,clientY:e.position.y}));if(void 0!==window.Touch&&void 0!==window.TouchEvent&&1===window.Touch.length&&1===window.TouchEvent.length){const t=s.map(e=>new window.Touch(e));return new window.TouchEvent(e,{cancelable:!0,bubbles:!0,touches:t,targetTouches:[],changedTouches:t,shiftKey:!1})}{const t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!0,!0,{touches:s,targetTouches:[],changedTouches:s}),t}}getRandomPosition(){return new be.Z(Math.floor(this.random.nextDouble()*this.display.width),Math.floor(this.random.nextDouble()*this.display.height))}createTouch(e){const t={id:this.nextTouchID++,position:e};return this.touches.push(t),t}removeTouch(e){this.touches.splice(this.touches.indexOf(e),1)}touchStart(e){const t=this.createTouchEvent("touchstart",[e]);this.display._input.validatePointers(),this.display._input.touchStart(e.id,e.position,new PA(t))}touchMove(e){e.position=this.getRandomPosition();const t=this.createTouchEvent("touchmove",[e]);this.display._input.validatePointers(),this.display._input.touchMove(e.id,e.position,new PA(t))}touchEnd(e){const t=this.createTouchEvent("touchend",[e]);this.display._input.validatePointers(),this.display._input.touchEnd(e.id,e.position,new PA(t))}touchCancel(e){const t=this.createTouchEvent("touchcancel",[e]);this.display._input.validatePointers(),this.display._input.touchCancel(e.id,e.position,new PA(t))}mouseToggle(){const e=document.createEvent("MouseEvent");e.initMouseEvent(this.isMouseDown?"mouseup":"mousedown",!0,!0,window,1,this.mousePosition.x,this.mousePosition.y,this.mousePosition.x,this.mousePosition.y,!1,!1,!1,!1,0,null),this.display._input.validatePointers(),this.isMouseDown?(this.display._input.mouseUp(this.mousePosition,new PA(e)),this.isMouseDown=!1):(this.display._input.mouseDown(null,this.mousePosition,new PA(e)),this.isMouseDown=!0)}mouseMove(){this.mousePosition=this.getRandomPosition();const e=document.createEvent("MouseEvent");e.initMouseEvent("mousemove",!0,!0,window,0,this.mousePosition.x,this.mousePosition.y,this.mousePosition.x,this.mousePosition.y,!1,!1,!1,!1,0,null),this.display._input.validatePointers(),this.display._input.mouseMove(this.mousePosition,new PA(e))}}W.register("InputFuzzer",$A);const ea=$A;class ta extends Ee.Z{constructor(e){super(e=(0,Ot.Z)({mouseButton:0},e)),this.options=e,this.isDown=!1,this.downCurrentTarget=null,this.downTrail=null,this.pointer=null,this.interrupted=!1,this.downListener={up:e=>{e.pointer instanceof FA&&e.domEvent.button!==this.options.mouseButton||this.buttonUp(e)},interrupt:()=>{this.interrupt()},cancel:e=>{this.buttonUp(e)}}}buttonDown(e){this.isDown||e.pointer instanceof FA&&e.domEvent.button!==this.options.mouseButton||(e.pointer.addInputListener(this.downListener),this.isDown=!0,this.downCurrentTarget=e.currentTarget,this.downTrail=e.trail.subtrailTo(e.currentTarget,!1),this.pointer=e.pointer,this.options.down&&this.options.down(e,this.downTrail))}buttonUp(e){this.isDown=!1,this.pointer.removeInputListener(this.downListener);const t=e.currentTarget;if(e.currentTarget=this.downCurrentTarget,this.options.upInside||this.options.upOutside){const t=e.trail.isExtensionOf(this.downTrail,!0)&&!this.interrupted;t&&this.options.upInside?this.options.upInside(e,this.downTrail):!t&&this.options.upOutside&&this.options.upOutside(e,this.downTrail)}this.options.up&&this.options.up(e,this.downTrail),e.currentTarget=t}down(e){this.buttonDown(e)}interrupt(){if(this.isDown){this.interrupted=!0;const e=PA.createSynthetic(),t=new OA(new pn,"synthetic",this.pointer,e);t.currentTarget=this.downCurrentTarget,this.buttonUp(t),this.interrupted=!1}}}W.register("DownUpListener",ta);const ia=ta;class sa extends ia{constructor(e){super({tandem:(e=(0,Ot.Z)({phetioType:sa.ButtonListenerIO,phetioState:!1,phetioEventType:Kr.Z.USER},e)).tandem,phetioType:e.phetioType,phetioState:e.phetioState,mouseButton:e.mouseButton||0,down:(e,t)=>{this.setButtonState(e,"down")},up:(e,t)=>{this.setButtonState(e,this._overCount>0?"over":"up")}}),this.buttonState="up",this._overCount=0,this._buttonOptions=e}setButtonState(e,t){if(t!==this.buttonState){const i=this.buttonState;this.buttonState=t,this._buttonOptions[t]&&(this.phetioStartEvent(t),this._buttonOptions[t](e,i),this.phetioEndEvent()),this._buttonOptions.fire&&this._overCount>0&&!this.interrupted&&(this._buttonOptions.fireOnDown?"down"===t:"down"===i)&&(this.phetioStartEvent("fire"),this._buttonOptions.fire(e),this.phetioEndEvent())}}enter(e){this._overCount++,1===this._overCount&&this.setButtonState(e,this.isDown?"down":"over")}exit(e){this._overCount--,0===this._overCount&&this.setButtonState(e,this.isDown?"out":"up")}focus(e){this.enter(e)}blur(e){this.exit(e)}click(e){this.setButtonState(e,"down"),this.setButtonState(e,"up")}}W.register("ButtonListener",sa),sa.ButtonListenerIO=new se.Z("ButtonListenerIO",{valueType:sa,documentation:"Button listener",events:["up","over","down","out","fire"]});class na extends Ee.Z{constructor(e){e=(0,Ot.Z)({start:null,drag:null,end:null,translate:null,allowTouchSnag:!1,mouseButton:0,dragCursor:"pointer",attach:!0,tandem:Kt.Z.REQUIRED,phetioState:!1,phetioEventType:Kr.Z.USER,phetioReadOnly:!0},e),super(),this.options=e,this.isDraggingProperty=new bt.Z(!1,{phetioReadOnly:e.phetioReadOnly,phetioState:!1,tandem:e.tandem.createTandem("isDraggingProperty"),phetioDocumentation:"Indicates whether the object is dragging"}),this.pointer=null,this.trail=null,this.transform=null,this.node=null,this.lastDragPoint=null,this.startTransformMatrix=null,this.mouseButton=void 0,this.interrupted=!1,this.lastInterruptedTouchLikePointer=null,this._attach=e.attach,this.dragStartAction=new Zr.Z((e,t)=>{this.dragging||(this._attach&&(t.pointer.dragging=!0),t.pointer.cursor=this.options.dragCursor,t.pointer.addInputListener(this.dragListener,this.options.attach),t.pointer.reserveForDrag(),this.isDraggingProperty.set(!0),this.pointer=t.pointer,this.trail=t.trail.subtrailTo(t.currentTarget,!0),this.transform=this.trail.getTransform(),this.node=t.currentTarget,this.lastDragPoint=t.pointer.point,this.startTransformMatrix=t.currentTarget.getMatrix().copy(),this.mouseButton=t.pointer instanceof FA?t.domEvent.button:void 0,this.options.start&&this.options.start.call(null,t,this.trail))},{tandem:e.tandem.createTandem("dragStartAction"),phetioReadOnly:e.phetioReadOnly,parameters:[{name:"point",phetioType:be.Z.Vector2IO,phetioDocumentation:"the position of the drag start in view coordinates"},{phetioPrivate:!0,valueType:[OA,null]}]}),this.dragAction=new Zr.Z((e,t)=>{if(!this.dragging||this.isDisposed)return;const i=this.pointer.point.minus(this.lastDragPoint);if(0===i.magnitudeSquared)return;const s=this.transform.inverseDelta2(i);if(this.options.translate){const e=this.node.getMatrix().getTranslation();this.options.translate.call(null,{delta:s,oldPosition:e,position:e.plus(s)})}if(this.lastDragPoint=this.pointer.point,this.options.drag){const e=t.currentTarget;t.currentTarget=this.node,this.options.drag.call(null,t,this.trail),t.currentTarget=e}},{phetioHighFrequency:!0,phetioReadOnly:e.phetioReadOnly,tandem:e.tandem.createTandem("dragAction"),parameters:[{name:"point",phetioType:be.Z.Vector2IO,phetioDocumentation:"the position of the drag in view coordinates"},{phetioPrivate:!0,valueType:[OA,null]}]}),this.dragEndAction=new Zr.Z((e,t)=>{this.dragging&&(this._attach&&(this.pointer.dragging=!1),this.pointer.cursor=null,this.pointer.removeInputListener(this.dragListener),this.isDraggingProperty.set(!1),this.options.end&&this.options.end.call(null,t,this.trail),this.pointer=null)},{tandem:e.tandem.createTandem("dragEndAction"),phetioReadOnly:e.phetioReadOnly,parameters:[{name:"point",phetioType:be.Z.Vector2IO,phetioDocumentation:"the position of the drag end in view coordinates"},{phetioPrivate:!0,isValidValue:e=>null===e||e instanceof OA||e.pointer&&e.currentTarget}]}),this.transformListener={transform:e=>{if(!this.trail.isExtensionOf(e.trail,!0))return;const t=e.trail.getMatrix(),i=this.transform.getMatrix();this.node.prependMatrix(t.inverted().timesMatrix(i)),this.transform.setMatrix(t)}},this.dragListener={up:e=>{if(this.dragging&&!this.isDisposed&&(!(e.pointer instanceof FA)||e.domEvent.button===this.mouseButton)){const t=e.currentTarget;e.currentTarget=this.node,this.endDrag(e),e.currentTarget=t}},cancel:e=>{if(!this.dragging||this.isDisposed)return;const t=e.currentTarget;e.currentTarget=this.node,this.endDrag(e),e.currentTarget=t,this.transform||this.node.setMatrix(this.startTransformMatrix)},move:e=>{this.dragAction.execute(e.pointer.point,e)},interrupt:()=>{this.interrupt()}},this.initializePhetioObject({},e)}get dragging(){return this.isDraggingProperty.get()}set dragging(e){}startDrag(e){this.dragStartAction.execute(e.pointer.point,e)}endDrag(e){this.dragEndAction.execute(e?e.pointer.point:be.Z.ZERO,e)}interrupt(){this.dragging&&(this.interrupted=!0,this.pointer&&this.pointer.isTouchLike()&&(this.lastInterruptedTouchLikePointer=this.pointer),this.endDrag({pointer:this.pointer,currentTarget:this.node}),this.interrupted=!1)}tryToSnag(e){e.pointer instanceof FA&&e.domEvent&&this.options.mouseButton!==e.domEvent.button&&-1!==this.options.mouseButton||this.isDisposed||this.dragging||e.pointer.dragging&&this._attach||e.pointer===this.lastInterruptedTouchLikePointer||!e.canStartPress()||this.startDrag(e)}tryTouchToSnag(e){this.options.allowTouchSnag&&(!0===this.options.allowTouchSnag||this.options.allowTouchSnag(e))&&this.tryToSnag(e)}down(e){this.tryToSnag(e)}touchenter(e){this.tryTouchToSnag(e)}touchmove(e){this.tryTouchToSnag(e)}dispose(){this.dragging&&(this._attach&&(this.pointer.dragging=!1),this.pointer.cursor=null,this.pointer.removeInputListener(this.dragListener)),this.isDraggingProperty.dispose(),this.dragEndAction.dispose(),this.dragAction.dispose(),this.dragStartAction.dispose(),super.dispose()}static createForwardingListener(e,t){return t=(0,Ot.Z)({allowTouchSnag:!1},t),{down:t=>{!t.pointer.dragging&&t.canStartPress()&&e(t)},touchenter:function(e){t.allowTouchSnag&&this.down(e)},touchmove:function(e){t.allowTouchSnag&&this.down(e)}}}}W.register("SimpleDragHandler",na);var ra=i(4317),oa=i(1453);let Aa=0;const aa=_.constant(!0);class ha extends ra.Z{constructor(e){const t=(0,Ce.ZP)()({press:_.noop,release:_.noop,targetNode:null,drag:_.noop,attach:!0,mouseButton:0,pressCursor:"pointer",useInputListenerCursor:!1,canStartPress:aa,a11yLooksPressedInterval:100,collapseDragEvents:!1,phetioEnabledPropertyInstrumented:!1,tandem:Kt.Z.REQUIRED,phetioReadOnly:!0,phetioFeatured:Ee.Z.DEFAULT_OPTIONS.phetioFeatured},e);super(t),this._id=Aa++,this._mouseButton=t.mouseButton,this._a11yLooksPressedInterval=t.a11yLooksPressedInterval,this._pressCursor=t.pressCursor,this._pressListener=t.press,this._releaseListener=t.release,this._dragListener=t.drag,this._canStartPress=t.canStartPress,this._targetNode=t.targetNode,this._attach=t.attach,this._collapseDragEvents=t.collapseDragEvents,this.overPointers=(0,oa.Z)(),this.isPressedProperty=new bt.Z(!1,{reentrant:!0}),this.isOverProperty=new bt.Z(!1),this.looksOverProperty=new bt.Z(!1),this.isHoveringProperty=new bt.Z(!1),this.isHighlightedProperty=new bt.Z(!1),this.isFocusedProperty=new bt.Z(!1),this.cursorProperty=new Qo.ZP([this.enabledProperty],e=>t.useInputListenerCursor&&e&&this._attach?this._pressCursor:null),this.pointer=null,this.pressedTrail=null,this.interrupted=!1,this._pendingCollapsedDragEvent=null,this._listeningToPointer=!1,this._isHoveringListener=this.invalidateHovering.bind(this),this._isHighlightedListener=this.invalidateHighlighted.bind(this),this.pdomClickingProperty=new bt.Z(!1),this.looksPressedProperty=Qo.ZP.or([this.pdomClickingProperty,this.isPressedProperty]),this._pdomClickingTimeoutListener=null,this._pointerListener={up:this.pointerUp.bind(this),cancel:this.pointerCancel.bind(this),move:this.pointerMove.bind(this),interrupt:this.pointerInterrupt.bind(this),listener:this},this._pressAction=new Zr.Z(this.onPress.bind(this),{tandem:t.tandem.createTandem("pressAction"),phetioDocumentation:"Executes whenever a press occurs. The first argument when executing can be used to convey info about the SceneryEvent.",phetioReadOnly:!0,phetioFeatured:t.phetioFeatured,phetioEventType:Kr.Z.USER,parameters:[{name:"event",phetioType:OA.SceneryEventIO},{phetioPrivate:!0,valueType:[Zs,null]},{phetioPrivate:!0,valueType:["function",null]}]}),this._releaseAction=new Zr.Z(this.onRelease.bind(this),{parameters:[{name:"event",phetioType:(0,mt.Z)(OA.SceneryEventIO)},{phetioPrivate:!0,valueType:["function",null]}],tandem:t.tandem.createTandem("releaseAction"),phetioDocumentation:"Executes whenever a release occurs.",phetioReadOnly:!0,phetioFeatured:t.phetioFeatured,phetioEventType:Kr.Z.USER}),this.display=null,this.boundInvalidateOverListener=this.invalidateOver.bind(this),this.overPointers.lengthProperty.link(this.invalidateOver.bind(this)),this.isFocusedProperty.link(this.invalidateOver.bind(this)),this.overPointers.lengthProperty.link(this._isHoveringListener),this.isPressedProperty.link(this._isHoveringListener),this.overPointers.addItemAddedListener(e=>e.isDownProperty.link(this._isHoveringListener)),this.overPointers.addItemRemovedListener(e=>e.isDownProperty.unlink(this._isHoveringListener)),this.isHoveringProperty.link(this._isHighlightedListener),this.isPressedProperty.link(this._isHighlightedListener),this.enabledProperty.lazyLink(this.onEnabledPropertyChange.bind(this))}get isPressed(){return this.isPressedProperty.value}get cursor(){return this.cursorProperty.value}get attach(){return this._attach}get targetNode(){return this._targetNode}getCurrentTarget(){return this.pressedTrail.lastNode()}get currentTarget(){return this.getCurrentTarget()}canPress(e){return!!this.enabledProperty.value&&!this.isPressed&&this._canStartPress(e,this)&&(!(e.pointer instanceof FA)||e.domEvent.button===this._mouseButton)&&(!this._attach||!e.pointer.isAttached())}canClick(){return this.enabledProperty.value&&!this.isPressed&&this._canStartPress(null,this)}press(e,t,i){return!!this.canPress(e)&&(this.flushCollapsedDrag(),this._pressAction.execute(e,t||null,i||null),!0)}release(e,t){this.flushCollapsedDrag(),this._releaseAction.execute(e||null,t||null)}drag(e){this._dragListener(e,this)}interrupt(){this.pdomClickingProperty.value?(this.interrupted=!0,this._listeningToPointer?this.release():(this.isPressedProperty.value=!1,this._releaseListener(null,this)),Nr.Z.hasListener(this._pdomClickingTimeoutListener)&&(Nr.Z.clearTimeout(this._pdomClickingTimeoutListener),this.pdomClickingProperty.isDisposed||(this.pdomClickingProperty.value=!1))):this.isPressed&&(this.interrupted=!0,this.release())}clearOverPointers(){this.overPointers.clear()}step(){this.flushCollapsedDrag()}setCreatePanTargetBounds(e){this._pointerListener.createPanTargetBounds=e}set createPanTargetBounds(e){this.setCreatePanTargetBounds(e)}setCreatePanTargetBoundsFromTrail(e){this.setCreatePanTargetBounds(()=>e.localToGlobalBounds(e.lastNode().localBounds))}set createPanTargetBoundsFromTrail(e){this.setCreatePanTargetBoundsFromTrail(e)}flushCollapsedDrag(){this._pendingCollapsedDragEvent&&this.drag(this._pendingCollapsedDragEvent),this._pendingCollapsedDragEvent=null}invalidateOver(){let e=!1;if(this._listeningToPointer)e=!1;else for(let t=0;t<this.overPointers.length;t++)if(this.overPointers.get(t).isAttached()){e=!0;break}this.isOverProperty.value=this.overPointers.length>0&&!e,this.looksOverProperty.value=this.isOverProperty.value||this.isFocusedProperty.value&&!!this.display&&this.display.focusManager.pdomFocusHighlightsVisibleProperty.value}invalidateHovering(){for(let e=0;e<this.overPointers.length;e++){const t=this.overPointers[e];if(!t.isDown||t===this.pointer)return void(this.isHoveringProperty.value=!0)}this.isHoveringProperty.value=!1}invalidateHighlighted(){this.isHighlightedProperty.value=this.isHoveringProperty.value||this.isPressedProperty.value}onEnabledPropertyChange(e){!e&&this.interrupt()}onPress(e,t,i){const s=t||this._targetNode;this.pointer=e.pointer,this.pressedTrail=s?s.getUniqueTrail():e.trail.subtrailTo(e.currentTarget,!1),this.interrupted=!1,this.pointer.addInputListener(this._pointerListener,this._attach),this._listeningToPointer=!0,this.pointer.cursor=this.pressedTrail.lastNode().getEffectiveCursor()||this._pressCursor,this.isPressedProperty.value=!0,this._pressListener(e,this),i&&i()}onRelease(e,t){this.pointer.removeInputListener(this._pointerListener),this._listeningToPointer=!1,this.isPressedProperty.value=!1,this._releaseListener(e,this),t&&t(),this.pointer.cursor=null,this.pointer=null,this.pressedTrail=null}down(e){this.press(e)}up(e){this.invalidateOver(),this.invalidateHovering()}enter(e){this.overPointers.push(e.pointer)}move(e){this.invalidateOver()}exit(e){this.overPointers.includes(e.pointer)&&this.overPointers.remove(e.pointer)}pointerUp(e){this.isPressed&&this.release(e)}pointerCancel(e){this.isPressed&&this.interrupt()}pointerMove(e){this.isPressed&&(this._collapseDragEvents?this._pendingCollapsedDragEvent=e:this.drag(e))}pointerInterrupt(){this.interrupt()}click(e,t){return this.canClick()&&(this.interrupted=!1,this.pdomClickingProperty.value=!0,this.isFocusedProperty.value=!0,this.isPressedProperty.value=!0,this._pressListener(e,this),t&&t(),this.isPressedProperty.value=!1,this._releaseListener(e,this),Nr.Z.clearTimeout(this._pdomClickingTimeoutListener),this._pdomClickingTimeoutListener=Nr.Z.setTimeout(()=>{this.pdomClickingProperty.isDisposed||(this.pdomClickingProperty.value=!1)},this._a11yLooksPressedInterval)),!0}focus(e){const t=e.trail.rootNode().getRootedDisplays().filter(e=>e.isAccessible());this.display=t[0],this.display.focusManager.pdomFocusHighlightsVisibleProperty.hasListener(this.boundInvalidateOverListener)||this.display.focusManager.pdomFocusHighlightsVisibleProperty.link(this.boundInvalidateOverListener),this.isFocusedProperty.value=!0}blur(){this.display&&(this.display.focusManager.pdomFocusHighlightsVisibleProperty.hasListener(this.boundInvalidateOverListener)&&this.display.focusManager.pdomFocusHighlightsVisibleProperty.unlink(this.boundInvalidateOverListener),this.display=null),this.isFocusedProperty.value=!1}dispose(){this.overPointers.clear(),this._listeningToPointer&&this.isPressed&&this.pointer.removeInputListener(this._pointerListener),this.isPressedProperty.isDisposed||(this.isPressedProperty.unlink(this._isHighlightedListener),this.isPressedProperty.unlink(this._isHoveringListener)),!this.isHoveringProperty.isDisposed&&this.isHoveringProperty.unlink(this._isHighlightedListener),this._pressAction.dispose(),this._releaseAction.dispose(),this.looksPressedProperty.dispose(),this.pdomClickingProperty.dispose(),this.cursorProperty.dispose(),this.isFocusedProperty.dispose(),this.isHighlightedProperty.dispose(),this.isHoveringProperty.dispose(),this.looksOverProperty.dispose(),this.isOverProperty.dispose(),this.isPressedProperty.dispose(),this.overPointers.dispose(),this.display&&(this.display.focusManager.pdomFocusHighlightsVisibleProperty.unlink(this.boundInvalidateOverListener),this.display=null),super.dispose()}}_defineProperty(ha,"phetioAPI",{pressAction:{phetioType:Zr.Z.PhetioActionIO([OA.SceneryEventIO])},releaseAction:{phetioType:Zr.Z.PhetioActionIO([(0,mt.Z)(OA.SceneryEventIO)])}}),W.register("PressListener",ha);var la=i(2558);class ga extends ha{constructor(e){const t=(0,Ce.ZP)()({fire:_.noop,fireOnDown:!1,fireOnHold:!1,fireOnHoldDelay:400,fireOnHoldInterval:100,tandem:Kt.Z.REQUIRED,phetioReadOnly:Ee.Z.DEFAULT_OPTIONS.phetioReadOnly},e);super(t),this._fireOnDown=t.fireOnDown,this.firedEmitter=new Or.Z({tandem:t.tandem.createTandem("firedEmitter"),phetioEventType:Kr.Z.USER,phetioReadOnly:t.phetioReadOnly,phetioDocumentation:"Emits at the time that the listener fires",parameters:[{name:"event",phetioType:(0,mt.Z)(OA.SceneryEventIO)}]}),this.firedEmitter.addListener(t.fire),t.fireOnHold&&(this._timer=new la.Z({callback:this.fire.bind(this,null),delay:t.fireOnHoldDelay,interval:t.fireOnHoldInterval}))}fire(e){this.firedEmitter.emit(e)}press(e,t,i){return super.press(e,t,()=>{this._fireOnDown&&this.fire(e),this._timer&&this._timer.start(),i&&i()})}release(e,t){super.release(e,()=>{const i=!this._fireOnDown&&this.isHoveringProperty.value&&!this.interrupted;this._timer?this._timer.stop(i):i&&this.fire(e||null),t&&t()})}click(e,t){return super.click(e,()=>{this.interrupted||this.fire(e),t&&t()})}interrupt(){super.interrupt(),this._timer&&this._timer.stop(!1)}dispose(){this.firedEmitter.dispose(),this._timer&&this._timer.dispose(),super.dispose()}}W.register("FireListener",ga);const ca=new be.Z(0,0);class da extends ha{constructor(e){const t=(0,Ce.ZP)()({positionProperty:null,start:null,end:null,transform:null,dragBoundsProperty:null,allowTouchSnag:!0,applyOffset:!0,useParentOffset:!1,trackAncestors:!1,translateNode:!1,mapPosition:null,offsetPosition:null,canClick:!1,tandem:Kt.Z.REQUIRED,phetioReadOnly:!0,phetioFeatured:Ee.Z.DEFAULT_OPTIONS.phetioFeatured},e);super(t),this._allowTouchSnag=t.allowTouchSnag,this._applyOffset=t.applyOffset,this._useParentOffset=t.useParentOffset,this._trackAncestors=t.trackAncestors,this._translateNode=t.translateNode,this._transform=t.transform,this._positionProperty=t.positionProperty,this._mapPosition=t.mapPosition,this._offsetPosition=t.offsetPosition,this._dragBoundsProperty=t.dragBoundsProperty||new yt.Z(null),this._start=t.start,this._end=t.end,this._canClick=t.canClick,this.isUserControlledProperty=this.isPressedProperty,this._globalPoint=new be.Z(0,0),this._localPoint=new be.Z(0,0),this._parentPoint=new be.Z(0,0),this._modelPoint=new be.Z(0,0),this._modelDelta=new be.Z(0,0),this._parentOffset=new be.Z(0,0),this._transformTracker=null,this._transformTrackerListener=this.ancestorTransformed.bind(this),this._lastInterruptedTouchLikePointer=null,this._dragAction=new Zr.Z(e=>{const t=this.pointer.point;t&&(this._globalPoint.equals(t)||this.reposition(t)),ha.prototype.drag.call(this,e)},{parameters:[{name:"event",phetioType:OA.SceneryEventIO}],phetioFeatured:t.phetioFeatured,tandem:t.tandem.createTandem("dragAction"),phetioHighFrequency:!0,phetioDocumentation:"Emits whenever a drag occurs with an SceneryEventIO argument.",phetioReadOnly:t.phetioReadOnly,phetioEventType:Kr.Z.USER})}press(e,t,i){return super.press(e,t,()=>{this.pointer.reserveForDrag(),this.attachTransformTracker();const t=this.pointer.point,s=this.globalToParentPoint(this._localPoint.set(t));this._useParentOffset&&this.modelToParentPoint(this._parentOffset.set(this._positionProperty.value)).subtract(s),this.parentToLocalPoint(s),this.reposition(t),this._start&&this._start(e,this),i&&i()})}release(e,t){super.release(e,()=>{this.detachTransformTracker(),this._end&&this._end(e||null,this),t&&t()})}canClick(){return super.canClick()&&this._canClick}click(e,t){return super.click(e,()=>{this._start&&this._start(e,this),t&&t(),this._end&&this._end(e,this)})}drag(e){const t=this.pointer.point;t&&!this._globalPoint.equals(t)&&this._dragAction.execute(e)}tryTouchSnag(e){!this._allowTouchSnag||this.attach&&e.pointer.isAttached()||this.press(e)}getGlobalPoint(){return this._globalPoint.copy()}get globalPoint(){return this.getGlobalPoint()}getLocalPoint(){return this._localPoint.copy()}get localPoint(){return this.getLocalPoint()}getParentPoint(){return this._parentPoint.copy()}get parentPoint(){return this.getParentPoint()}getModelPoint(){return this._modelPoint.copy()}get modelPoint(){return this.getModelPoint()}getModelDelta(){return this._modelDelta.copy()}get modelDelta(){return this.getModelDelta()}globalToParentPoint(e){const t=this;return t.pressedTrail.getParentTransform().getInverse().multiplyVector2(e),e}parentToLocalPoint(e){const t=this;return t.pressedTrail.lastNode().getTransform().getInverse().multiplyVector2(e),e}localToParentPoint(e){const t=this;return t.pressedTrail.lastNode().getMatrix().multiplyVector2(e),e}parentToModelPoint(e){if(this._transform){(this._transform instanceof Pe.Z?this._transform:this._transform.value).getInverse().multiplyVector2(e)}return e}modelToParentPoint(e){if(this._transform){(this._transform instanceof Pe.Z?this._transform:this._transform.value).getMatrix().multiplyVector2(e)}return e}mapModelPoint(e){return this._mapPosition?this._mapPosition(e):this._dragBoundsProperty.value?this._dragBoundsProperty.value.closestPointTo(e):e}applyParentOffset(e){this._offsetPosition&&e.add(this._offsetPosition(e,this)),this._applyOffset&&(this._useParentOffset?e.add(this._parentOffset):(e.subtract(this.localToParentPoint(ca.set(this._localPoint))),e.add(this.localToParentPoint(ca.setXY(0,0)))))}reposition(e){const t=this;this._globalPoint.set(e),this.applyParentOffset(this.globalToParentPoint(this._parentPoint.set(e))),this._modelDelta.set(this._modelPoint).negate(),this._modelPoint.set(this.mapModelPoint(this.parentToModelPoint(ca.set(this._parentPoint)))),this._modelDelta.add(this._modelPoint),this.modelToParentPoint(this._parentPoint.set(this._modelPoint)),this._translateNode&&(t.pressedTrail.lastNode().translation=this._parentPoint),this._positionProperty&&(this._positionProperty.value=this._modelPoint.copy())}touchenter(e){e.pointer.isDownProperty.value&&this.tryTouchSnag(e)}touchmove(e){this.tryTouchSnag(e)}ancestorTransformed(){const e=this.pointer.point;e&&this.reposition(e)}attachTransformTracker(){const e=this;this._trackAncestors&&(this._transformTracker=new xr(e.pressedTrail.copy().removeDescendant()),this._transformTracker.addListener(this._transformTrackerListener))}detachTransformTracker(){this._transformTracker&&(this._transformTracker.removeListener(this._transformTrackerListener),this._transformTracker.dispose(),this._transformTracker=null)}getDragBounds(){return this._dragBoundsProperty.value}get dragBounds(){return this.getDragBounds()}setTransform(e){this._transform=e}set transform(e){this.setTransform(e)}get transform(){return this.getTransform()}getTransform(){return this._transform}interrupt(){this.pointer&&this.pointer.isTouchLike()&&(this._lastInterruptedTouchLikePointer=this.pointer),super.interrupt()}canPress(e){return e.pointer!==this._lastInterruptedTouchLikePointer&&super.canPress(e)}dispose(){this._dragAction.dispose(),this.detachTransformTracker(),super.dispose()}static createForwardingListener(e,t){const i=(0,Ce.ZP)()({allowTouchSnag:!0},t);return{down(t){t.canStartPress()&&e(t)},touchenter(e){i.allowTouchSnag&&this.down(e)},touchmove(e){i.allowTouchSnag&&this.down(e)}}}}W.register("DragListener",da);class ua{constructor(e,t){this.pointer=e,this.trail=t,this.interrupted=!1,this.initialPoint=e.point,this.localPoint=null,this.recomputeLocalPoint()}recomputeLocalPoint(){this.localPoint=this.trail.globalToLocalPoint(this.pointer.point)}get targetPoint(){return this.trail.globalToParentPoint(this.pointer.point)}}W.register("MultiListenerPress",ua);var ma=i(3286),pa=i(1063);class Va{constructor(e,t){const i=(0,Ce.ZP)()({mouseButton:0,pressCursor:"pointer",allowScale:!0,allowRotation:!0,allowMultitouchInterruption:!1,allowMoveInterruption:!0,minScale:1,maxScale:4,tandem:Kt.Z.REQUIRED},t);this._targetNode=e,this._minScale=i.minScale,this._maxScale=i.maxScale,this._mouseButton=i.mouseButton,this._pressCursor=i.pressCursor,this._allowScale=i.allowScale,this._allowRotation=i.allowRotation,this._allowMultitouchInterruption=i.allowMultitouchInterruption,this._allowMoveInterruption=i.allowMoveInterruption,this._presses=[],this._backgroundPresses=[],this.matrixProperty=new yt.Z(e.matrix.copy(),{phetioValueType:Le.Z.Matrix3IO,tandem:i.tandem.createTandem("matrixProperty"),phetioReadOnly:!0}),this.matrixProperty.link(e=>{this._targetNode.matrix=e}),this._interrupted=!1,this._pressListener={move:e=>{const t=this.findPress(e.pointer);this.movePress(t)},up:e=>{const t=this.findPress(e.pointer);this.removePress(t)},cancel:e=>{const t=this.findPress(e.pointer);t.interrupted=!0,this.removePress(t)},interrupt:()=>{this.interrupt()}},this._backgroundListener={up:e=>{if(!this._interrupted){const t=this.findBackgroundPress(e.pointer);this.removeBackgroundPress(t)}},move:e=>{const t=this._backgroundPresses.filter(e=>!e.pointer.hasIntent(TA.DRAG)&&e.initialPoint.distance(e.pointer.point)>25);(1!==this.getCurrentScale()||t.length>=2)&&t.forEach(e=>{this.removeBackgroundPress(e),this.interruptOtherListeners(e.pointer),this.addPress(e)})},cancel:e=>{if(!this._interrupted){const t=this.findBackgroundPress(e.pointer);this.removeBackgroundPress(t)}},interrupt:()=>{this.interrupt()}}}findPress(e){for(let t=0;t<this._presses.length;t++)if(this._presses[t].pointer===e)return this._presses[t];return null}findBackgroundPress(e){for(let t=0;t<this._backgroundPresses.length;t++)if(this._backgroundPresses[t].pointer===e)return this._backgroundPresses[t];return null}hasPress(e){return _.some(this._presses.concat(this._backgroundPresses),t=>t.pointer===e.pointer)}interruptOtherListeners(e){const t=e.getListeners();for(let i=0;i<t.length;i++){const e=t[i];e!==this._backgroundListener&&e.interrupt&&e.interrupt()}}down(e){if(e.pointer instanceof FA&&e.domEvent instanceof MouseEvent&&e.domEvent.button!==this._mouseButton)return;let t;this._interrupted=!1,t=_.includes(e.trail.nodes,this._targetNode)?e.trail.subtrailTo(this._targetNode,!1):this._targetNode.getUniqueTrailTo(e.target);const i=new ua(e.pointer,t);this._allowMoveInterruption||this._allowMultitouchInterruption?this.addBackgroundPress(i):e.pointer.isAttached()||this.addPress(i)}addPress(e){this.hasPress(e)||(this._presses.push(e),e.pointer.cursor=this._pressCursor,e.pointer.addInputListener(this._pressListener,!0),this.recomputeLocals(),this.reposition())}movePress(e){this.reposition()}removePress(e){e.pointer.removeInputListener(this._pressListener),e.pointer.cursor=null,(0,Oi.Z)(this._presses,e),this.recomputeLocals(),this.reposition()}addBackgroundPress(e){this.hasPress(e)||(this._backgroundPresses.push(e),e.pointer.addInputListener(this._backgroundListener,!1))}removeBackgroundPress(e){e.pointer.removeInputListener(this._backgroundListener),(0,Oi.Z)(this._backgroundPresses,e)}reposition(){this.matrixProperty.set(this.computeMatrix())}recomputeLocals(){for(let e=0;e<this._presses.length;e++)this._presses[e].recomputeLocalPoint()}interrupt(){for(;this._presses.length;)this.removePress(this._presses[this._presses.length-1]);for(;this._backgroundPresses.length;)this.removeBackgroundPress(this._backgroundPresses[this._backgroundPresses.length-1]);this._interrupted=!0}computeMatrix(){return 0===this._presses.length?this._targetNode.getMatrix():1===this._presses.length?this.computeSinglePressMatrix():this._allowScale&&this._allowRotation?this.computeTranslationRotationScaleMatrix():this._allowScale?this.computeTranslationScaleMatrix():this._allowRotation?this.computeTranslationRotationMatrix():this.computeTranslationMatrix()}computeSinglePressMatrix(){const e=this._presses[0].targetPoint,t=this._presses[0].localPoint,i=this._targetNode.localToParentPoint(t),s=e.minus(i);return Le.Z.translationFromVector(s).timesMatrix(this._targetNode.getMatrix())}computeTranslationMatrix(){const e=new be.Z(0,0);for(let t=0;t<this._presses.length;t++){e.add(this._presses[t].targetPoint);const i=this._presses[t].localPoint;e.subtract(i)}return Le.Z.translationFromVector(e.dividedScalar(this._presses.length))}computeTranslationScaleMatrix(){const e=this._presses.map(e=>e.localPoint),t=this._presses.map(e=>e.targetPoint),i=new be.Z(0,0),s=new be.Z(0,0);e.forEach(e=>{i.add(e)}),t.forEach(e=>{s.add(e)}),i.divideScalar(this._presses.length),s.divideScalar(this._presses.length);let n=0,r=0;e.forEach(e=>{n+=e.distanceSquared(i)}),t.forEach(e=>{r+=e.distanceSquared(s)});let o=this.getCurrentScale();0!==r&&(o=this.limitScale(Math.sqrt(r/n)));const A=Le.Z.translation(s.x,s.y),a=Le.Z.translation(-i.x,-i.y);return A.timesMatrix(Le.Z.scaling(o)).timesMatrix(a)}limitScale(e){let t=Math.max(e,this._minScale);return t=Math.min(t,this._maxScale),t}computeTranslationRotationMatrix(){let e;const t=new ma.Z(2,this._presses.length),i=new ma.Z(2,this._presses.length),s=new be.Z(0,0),n=new be.Z(0,0);for(e=0;e<this._presses.length;e++){const r=this._presses[e].localPoint,o=this._presses[e].targetPoint;s.add(r),n.add(o),t.set(0,e,r.x),t.set(1,e,r.y),i.set(0,e,o.x),i.set(1,e,o.y)}for(s.divideScalar(this._presses.length),n.divideScalar(this._presses.length),e=0;e<this._presses.length;e++)t.set(0,e,t.get(0,e)-s.x),t.set(1,e,t.get(1,e)-s.y),i.set(0,e,i.get(0,e)-n.x),i.set(1,e,i.get(1,e)-n.y);const r=t.times(i.transpose()),o=new pa.Z(r);let A=o.getV().times(o.getU().transpose());A.det()<0&&(A=o.getV().times(ma.Z.diagonalMatrix([1,-1])).times(o.getU().transpose()));const a=(new Le.Z).rowMajor(A.get(0,0),A.get(0,1),0,A.get(1,0),A.get(1,1),0,0,0,1),h=n.minus(a.timesVector2(s));return a.set02(h.x),a.set12(h.y),a}computeTranslationRotationScaleMatrix(){let e;const t=new ma.Z(2*this._presses.length,4);for(e=0;e<this._presses.length;e++){const i=this._presses[e].localPoint;t.set(2*e+0,0,i.x),t.set(2*e+0,1,i.y),t.set(2*e+0,2,1),t.set(2*e+1,0,i.y),t.set(2*e+1,1,-i.x),t.set(2*e+1,3,1)}const i=new ma.Z(2*this._presses.length,1);for(e=0;e<this._presses.length;e++){const t=this._presses[e].targetPoint;i.set(2*e+0,0,t.x),i.set(2*e+1,0,t.y)}const s=pa.Z.pseudoinverse(t).times(i),n=s.get(0,0),r=s.get(1,0),o=s.get(2,0),A=s.get(3,0);return(new Le.Z).rowMajor(n,r,o,-r,n,A,0,0,1)}getCurrentScale(){return this._targetNode.getScaleVector().x}resetTransform(){this._targetNode.resetTransform(),this.matrixProperty.set(this._targetNode.matrix.copy())}}W.register("MultiListener",Va);const Ma=Va;var Ba=i(369);const wa=new Le.Z;class Ca extends Ma{constructor(e,t){var i;const s=(0,Ce.ZP)()({panBounds:Ue.Z.NOTHING,targetBounds:null,targetScale:1,allowRotation:!1},t);super(e,s),this._panBounds=s.panBounds,this._targetBounds=s.targetBounds||e.globalBounds.copy(),this._targetScale=s.targetScale,this.sourceFramePanBoundsProperty=new yt.Z(Kt.Z.API_GENERATION?new Ue.Z(0,0,0,0):this._panBounds,{tandem:null===(i=s.tandem)||void 0===i?void 0:i.createTandem("sourceFramePanBoundsProperty"),phetioReadOnly:!0,phetioValueType:Ue.Z.Bounds2IO}),this.sourceFramePanBoundsProperty.lazyLink(()=>{if(ws.Z.value){const e=Ba.Z.createRectangleMapping(this.sourceFramePanBoundsProperty.get(),this._panBounds),t=this._targetNode.matrix.translation.componentMultiply(e.matrix.getScaleVector()),i=this.matrixProperty.get().getScaleVector();this.matrixProperty.set(Le.Z.translationFromVector(t).timesMatrix(Le.Z.scaling(i.x,i.y)))}},{phetioDependencies:[this.matrixProperty]})}correctReposition(){wa.set(this._targetNode.matrix);const e=this._targetBounds.transformed(this._targetNode.getMatrix());e.left>this._panBounds.left&&(this._targetNode.left=this._panBounds.left-(e.left-this._targetNode.left)),e.top>this._panBounds.top&&(this._targetNode.top=this._panBounds.top-(e.top-this._targetNode.top)),e.right<this._panBounds.right&&(this._targetNode.right=this._panBounds.right+(this._targetNode.right-e.right)),e.bottom<this._panBounds.bottom&&(this._targetNode.bottom=this._panBounds.bottom+(this._targetNode.bottom-e.bottom)),wa.equals(this._targetNode.matrix)||this.matrixProperty.set(this._targetNode.matrix.copy())}addPress(e){super.addPress(e);const t=this._targetBounds.transformed(this._targetNode.getMatrix()).equalsEpsilon(this._panBounds,1e-8);e.pointer.cursor=t?null:this._pressCursor}reposition(){super.reposition(),this.correctReposition()}resetTransform(){super.resetTransform(),this.correctReposition()}setPanBounds(e){this._panBounds=e,Kt.Z.API_GENERATION||this.sourceFramePanBoundsProperty.set(this._panBounds),this.correctReposition()}setTargetBounds(e){this._targetBounds=e,this.correctReposition()}setTargetScale(e){this._targetScale=e}getTargetBounds(){return this._targetBounds}}W.register("PanZoomListener",Ca);const Ea=Ca,Ya=new be.Z(0,0),Da=new be.Z(0,0),ya=new be.Z(0,0),Ia=new Ue.Z(0,0,0,0);class qa extends Ea{constructor(e,t){const i=(0,Ce.ZP)()({tandem:Kt.Z.REQUIRED},t);super(e,i),_defineProperty(this,"trackpadGestureStartScale",1),_defineProperty(this,"animatingProperty",new bt.Z(!1)),_defineProperty(this,"_transformTracker",null),_defineProperty(this,"_focusBoundsListener",null),this.sourcePosition=null,this.destinationPosition=null,this.sourceScale=this.getCurrentScale(),this.destinationScale=this.getCurrentScale(),this.scaleGestureTargetPosition=null,this.discreteScales=Ta(this._minScale,this._maxScale),this.middlePress=null,this._dragBounds=null,this._transformedPanBounds=this._panBounds.transformed(this._targetNode.matrix.inverted()),this._draggingInDragBounds=!1,this._attachedPointers=[],this.boundsFinite=!1;let s=null,n=null;this.gestureStartAction=new Zr.Z(e=>{e.preventDefault(),this.trackpadGestureStartScale=e.scale,this.scaleGestureTargetPosition=new be.Z(e.pageX,e.pageY)},{phetioPlayback:!0,tandem:i.tandem.createTandem("gestureStartAction"),parameters:[{name:"event",phetioType:Mt}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Action that executes whenever a gesture starts on a trackpad in macOS Safari."}),this.gestureChangeAction=new Zr.Z(e=>{e.preventDefault();const t=this.sourceScale+e.scale-this.trackpadGestureStartScale;this.setDestinationScale(t)},{phetioPlayback:!0,tandem:i.tandem.createTandem("gestureChangeAction"),parameters:[{name:"event",phetioType:Mt}],phetioEventType:Kr.Z.USER,phetioDocumentation:"Action that executes whenever a gesture changes on a trackpad in macOS Safari."}),Oe.Z.safari&&!Oe.Z.mobileSafari&&(s=this.handleGestureStartEvent.bind(this),n=this.handleGestureChangeEvent.bind(this),this.trackpadGestureStartScale=this.getCurrentScale(),window.addEventListener("gesturestart",s),window.addEventListener("gesturechange",n)),Hr.keydownEmitter.addListener(this.windowKeydown.bind(this));const r=this.handleFocusChange.bind(this);So.pdomFocusProperty.link(r),this.sourceFramePanBoundsProperty.lazyLink(()=>{ws.Z.value&&(this.initializePositions(),this.sourceScale=this.getCurrentScale(),this.setDestinationScale(this.sourceScale))},{phetioDependencies:[this.matrixProperty]}),this.disposeAnimatedPanZoomListener=()=>{s&&window.removeEventListener("gesturestart",s),n&&window.removeEventListener("gestureChange",n),this.animatingProperty.dispose(),this._transformTracker&&this._transformTracker.dispose(),So.pdomFocusProperty.unlink(r)}}step(e){this.middlePress&&this.handleMiddlePress(e),this._attachedPointers.length>0&&this.getCurrentScale()>1&&(this._attachedPointers.length>0&&(this._attachedPointers=this._attachedPointers.filter(e=>e.attachedListener)),(this._draggingInDragBounds||this._attachedPointers.some(e=>e instanceof LA))&&this.repositionDuringDrag()),this.animateToTargets(e)}down(e){super.down(e),null!==this._dragBounds&&e.pointer.hasIntent(TA.DRAG)&&(0===this._attachedPointers.length&&(this._draggingInDragBounds=this._dragBounds.containsPoint(e.pointer.point)),e.pointer.attachedListener&&(this._attachedPointers.includes(e.pointer)||this._attachedPointers.push(e.pointer))),"mouse"===e.pointer.type&&e.pointer instanceof FA&&e.pointer.middleDown&&!this.middlePress?(this.middlePress=new Sa(e.pointer,e.trail),e.pointer.cursor="all-scroll"):this.cancelMiddlePress()}cancelMiddlePress(){this.middlePress&&(this.middlePress.pointer.cursor=null,this.middlePress=null,this.stopInProgressAnimation())}movePress(e){this.middlePress||super.movePress(e)}move(e){if(this._attachedPointers.length>0&&this.getCurrentScale()>1)if(this._draggingInDragBounds){if(!this._attachedPointers.includes(e.pointer)){const t=this.hasDragIntent(e.pointer);null!==e.currentTarget&&t&&e.pointer.attachedListener&&this._attachedPointers.push(e.pointer)}}else this._dragBounds&&(this._draggingInDragBounds=this._dragBounds.containsPoint(e.pointer.point))}getTargetNodeDuringDrag(){if(this._attachedPointers.length>0){const e=this._attachedPointers[0].attachedListener;if(e.listener instanceof ha||e.listener instanceof Pa){const t=e.listener;if(t.isPressed)return t.getCurrentTarget()}}return null}getGlobalBoundsToViewDuringDrag(){let e=null;if(this._attachedPointers.length>0){const t=this._attachedPointers[0].attachedListener;if(t.createPanTargetBounds)e=t.createPanTargetBounds();else if(t.listener instanceof ha||t.listener instanceof Pa){const i=t.listener;if(i.isPressed){const t=i.getCurrentTarget();if(1===t.instances.length){const i=t.instances[0].trail;e=i.parentToGlobalBounds(t.visibleBounds)}}}}return e}repositionDuringDrag(){const e=this.getGlobalBoundsToViewDuringDrag(),t=this.getTargetNodeDuringDrag();e&&this.keepBoundsInView(e,this._attachedPointers.some(e=>e instanceof LA),null==t?void 0:t.limitPanDirection)}cancelPanningDuringDrag(e){if(e){const t=this._attachedPointers.indexOf(e.pointer);t>-1&&this._attachedPointers.splice(t,1)}else this._attachedPointers=[];this._draggingInDragBounds=!1}up(e){this.cancelPanningDuringDrag(e)}wheel(e){if(!this.middlePress){const t=new Qa(e,this._targetScale);this.repositionFromWheel(t,e)}}windowKeydown(e){this.cancelMiddlePress();const t=_.get(window,"phet.joist.sim",null);if((!t||!t.display._accessible||!t.display.pdomRootElement.contains(e.target))&&(this.handleZoomCommands(e),lt.isArrowKey(e))){const e=new Ga(Hr,this.getCurrentScale(),this._targetScale);this.repositionFromKeys(e)}}keydown(e){const t=e.domEvent;this.cancelMiddlePress(),this.handleZoomCommands(t);const i=e.pointer.hasIntent(TA.KEYBOARD_DRAG);if(lt.isArrowKey(t)&&!i){const e=new Ga(Hr,this.getCurrentScale(),this._targetScale);this.repositionFromKeys(e)}}handleFocusChange(e,t){if(this._transformTracker&&(this._transformTracker.dispose(),this._transformTracker=null),t&&t.trail.lastNode()&&t.trail.lastNode().focusPanTargetBoundsProperty){const e=t.trail.lastNode().focusPanTargetBoundsProperty;e.unlink(this._focusBoundsListener),this._focusBoundsListener=null}if(e){const t=e.trail.lastNode();let i=e.trail;if(e.trail.containsNode(this._targetNode)){const t=e.trail.nodes.indexOf(this._targetNode),s=e.trail.nodes.length;i=e.trail.slice(t,s)}this._transformTracker=new xr(i);const s=()=>{if(this.getCurrentScale()>1){let i;if(t.focusPanTargetBoundsProperty){const s=t.focusPanTargetBoundsProperty.value;i=e.trail.localToGlobalBounds(s)}else i=e.trail.localToGlobalBounds(e.trail.lastNode().localBounds);this.keepBoundsInView(i,!0,t.limitPanDirection)}};this._transformTracker.addListener(s),t.focusPanTargetBoundsProperty&&(this._focusBoundsListener=s,t.focusPanTargetBoundsProperty.link(this._focusBoundsListener)),this.keepTrailInView(e.trail,t.limitPanDirection)}}handleZoomCommands(e){const t=zo.isZoomCommand(e,!0),i=zo.isZoomCommand(e,!1);if(t||i){e.preventDefault();const i=this.getNextDiscreteScale(t),s=new Ga(Hr,i,this._targetScale);this.repositionFromKeys(s)}else zo.isZoomResetCommand(e)&&(e.preventDefault(),this.resetTransform())}handleGestureStartEvent(e){this.gestureStartAction.execute(e)}handleGestureChangeEvent(e){this.gestureChangeAction.execute(e)}handleMiddlePress(e){const t=this.middlePress,i=this.sourcePosition;if(e>0){const s=t.pointer.point.minus(t.initialPoint),n=s.magnitude/100;n>0&&(s.setMagnitude(Math.min(n/e,150*this._targetScale)),this.setDestinationPosition(i.plus(s)))}}translateScaleToTarget(e,t){const i=this._targetNode.globalToLocalPoint(e),s=this._targetNode.globalToParentPoint(e),n=Le.Z.translation(-i.x,-i.y),r=Le.Z.translation(s.x,s.y),o=this.limitScale(this.getCurrentScale()+t),A=r.timesMatrix(Le.Z.scaling(o)).timesMatrix(n);this.matrixProperty.set(A),this.correctReposition()}setTranslationScaleToTarget(e,t){const i=this._targetNode.globalToLocalPoint(e),s=this._targetNode.globalToParentPoint(e),n=Le.Z.translation(-i.x,-i.y),r=Le.Z.translation(s.x,s.y),o=this.limitScale(t),A=r.timesMatrix(Le.Z.scaling(o)).timesMatrix(n);this.matrixProperty.set(A),this.correctReposition()}translateDelta(e){const t=this._targetNode.globalToParentPoint(this._panBounds.center),i=t.plus(e);this.translateToTarget(i,t)}translateToTarget(e,t){const i=this._targetNode.globalToParentPoint(e),s=this._targetNode.globalToParentPoint(t).minus(i);this.matrixProperty.set(Le.Z.translationFromVector(s).timesMatrix(this._targetNode.getMatrix())),this.correctReposition()}repositionFromKeys(e){const t=this.sourcePosition,i=e.scale;i!==this.getCurrentScale()?(this.setDestinationScale(i),this.scaleGestureTargetPosition=e.computeScaleTargetFromKeyPress()):e.translationVector.equals(be.Z.ZERO)||this.setDestinationPosition(t.plus(e.translationVector)),this.correctReposition()}repositionFromWheel(e,t){const i=t.domEvent,s=this.sourcePosition;if(i.preventDefault(),e.isCtrlKeyDown){const t=this.limitScale(this.getCurrentScale()+e.scaleDelta);this.scaleGestureTargetPosition=e.targetPoint,this.setDestinationScale(t)}else this.setDestinationPosition(s.plus(e.translationVector));this.correctReposition()}correctReposition(){super.correctReposition(),this._panBounds.isFinite()&&(this._transformedPanBounds=this._panBounds.transformed(this._targetNode.matrix.inverted()),this.sourcePosition=this._transformedPanBounds.center,this.sourceScale=this.getCurrentScale())}addPress(e){super.addPress(e),this.stopInProgressAnimation()}removePress(e){super.removePress(e),this.middlePress&&(e.pointer.cursor="all-scroll"),0===this._presses.length&&this.stopInProgressAnimation()}interrupt(){this.cancelPanningDuringDrag(),this.cancelMiddlePress(),super.interrupt()}cancel(){this.interrupt()}hasDragIntent(e){return e.hasIntent(TA.KEYBOARD_DRAG)||e.hasIntent(TA.DRAG)}panToNode(e,t,i){this.keepBoundsInView(e.globalBounds,t,i)}keepBoundsInView(e,t,i){const s=this.sourcePosition,n=this._targetNode.globalToLocalBounds(e),r=new be.Z(0,0);let o=0,A=0,a=0,h=0;t?(o=this._transformedPanBounds.centerX-n.centerX,A=this._transformedPanBounds.centerX-n.centerX,a=this._transformedPanBounds.centerY-n.centerY,h=this._transformedPanBounds.centerY-n.centerY):("vertical"===i||n.width<this._transformedPanBounds.width)&&("horizontal"===i||n.height<this._transformedPanBounds.height)&&(o=this._transformedPanBounds.left-n.left,A=this._transformedPanBounds.right-n.right,a=this._transformedPanBounds.top-n.top,h=this._transformedPanBounds.bottom-n.bottom),"vertical"!==i&&(A<0&&(r.x=-A),o>0&&(r.x=-o)),"horizontal"!==i&&(h<0&&(r.y=-h),a>0&&(r.y=-a)),this.setDestinationPosition(s.plus(r))}keepTrailInView(e,t){if(this._panBounds.isFinite()&&e.lastNode().bounds.isFinite()){const i=e.localToGlobalBounds(e.lastNode().localBounds);this._panBounds.containsBounds(i)||this.keepBoundsInView(i,!0,t)}}animateToTargets(e){const t=this.sourcePosition,i=this.destinationPosition,s=!i.equalsEpsilon(t,.1),n=!ie.Z.equalsEpsilon(this.sourceScale,this.destinationScale,.001);if(this.animatingProperty.value=s||n,0===this._presses.length||null!==this.middlePress){if(s){const s=i.minus(t);let n=s;0!==s.magnitude&&(n=s.normalized());const r=this.getTranslationSpeed(s.magnitude);ya.setXY(r,r);const o=ya.multiplyScalar(e),A=n.componentTimes(o);A.magnitude>s.magnitude&&A.set(s),this.translateDelta(A)}if(n){const i=this.destinationScale-this.sourceScale;let s=i*e*6;Math.abs(s)>Math.abs(i)&&(s=i),this.translateScaleToTarget(this.scaleGestureTargetPosition,s),this.setDestinationPosition(t)}else this.destinationScale!==this.sourceScale&&(this.setTranslationScaleToTarget(this.scaleGestureTargetPosition,this.destinationScale),this.setDestinationPosition(t))}}stopInProgressAnimation(){this.boundsFinite&&this.sourcePosition&&(this.setDestinationScale(this.sourceScale),this.setDestinationPosition(this.sourcePosition))}initializePositions(){this.boundsFinite=this._transformedPanBounds.isFinite(),this.boundsFinite?(this.sourcePosition=this._transformedPanBounds.center,this.setDestinationPosition(this.sourcePosition)):(this.sourcePosition=null,this.destinationPosition=null)}setPanBounds(e){super.setPanBounds(e),this.initializePositions(),this._dragBounds=e.erodedXY(.1*e.width,.1*e.height)}setTargetBounds(e){super.setTargetBounds(e),this.initializePositions()}setDestinationPosition(e){const t=this.sourcePosition;Ia.setMinMax(t.x-this._transformedPanBounds.left-this._panBounds.left,t.y-this._transformedPanBounds.top-this._panBounds.top,t.x+this._panBounds.right-this._transformedPanBounds.right,t.y+this._panBounds.bottom-this._transformedPanBounds.bottom),this.destinationPosition=Ia.closestPointTo(e)}setDestinationScale(e){this.destinationScale=this.limitScale(e)}getTranslationSpeed(e){const t=e*this.getCurrentScale(),i=t*(1/(Math.pow(t,2)-Math.pow(5,2))+5);return Math.min(Math.abs(i),1e3*this.getCurrentScale())}resetTransform(){super.resetTransform(),this.stopInProgressAnimation()}getNextDiscreteScale(e){const t=this.getCurrentScale();let i=null,s=Number.POSITIVE_INFINITY;for(let r=0;r<this.discreteScales.length;r++){const e=Math.abs(this.discreteScales[r]-t);e<s&&(s=e,i=r)}i=i;let n=e?i+1:i-1;return n=ie.Z.clamp(n,0,this.discreteScales.length-1),this.discreteScales[n]}dispose(){this.disposeAnimatedPanZoomListener()}}class Ga{constructor(e,t,i,s){const n=(0,Ce.ZP)()({translationMagnitude:80},s);let r=0;r+=e.isKeyDown(lt.KEY_RIGHT_ARROW)?1:0,r-=e.isKeyDown(lt.KEY_LEFT_ARROW)?1:0;let o=0;if(o+=e.isKeyDown(lt.KEY_DOWN_ARROW)?1:0,o-=e.isKeyDown(lt.KEY_UP_ARROW)?1:0,Ya.setXY(r,o),!Ya.equals(be.Z.ZERO)){const e=n.translationMagnitude*i;Ya.setMagnitude(e)}this.translationVector=Ya,this.scale=t}computeScaleTargetFromKeyPress(){Da.setXY(0,0);const e=So.pdomFocusProperty.value;if(e){const t=e.trail,i=t.lastNode();i.bounds.isFinite()&&Da.set(t.parentToGlobalPoint(i.center))}else{const e=Fi.getNextFocusable();if(e!==document.body){const t=e.offsetLeft+e.offsetWidth/2,i=e.offsetTop+e.offsetHeight/2;Da.setXY(t,i)}}return Da}}class Qa{constructor(e,t){const i=e.domEvent;this.isCtrlKeyDown=i.ctrlKey,this.scaleDelta=i.deltaY>0?-.5:.5,this.targetPoint=e.pointer.point;let s=.5*i.deltaX,n=.5*i.deltaY;i.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(s*=25,n*=25),this.translationVector=Ya.setXY(s*t,n*t)}}class Sa{constructor(e,t){this.pointer=e,this.trail=t,this.initialPoint=e.point.copy()}}const Ta=(e,t)=>{const i=[];for(let n=0;n<8;n++)i[n]=(t-e)/8*(n*n);const s=i[7];for(let n=0;n<i.length;n++)i[n]=e+i[n]*(t-e)/s;return i};W.register("AnimatedPanZoomListener",qa);const xa=qa;const ka=new class{constructor(){_defineProperty(this,"_listener",null)}initialize(e,t){this._listener=new xa(e,t)}dispose(){this._listener.dispose(),this._listener=null}get listener(){return this._listener}get initialized(){return!!this._listener}};W.register("animatedPanZoomSingleton",ka);const Fa=ka;class Ra{down(e){e.handle()}}W.register("HandleDownlistener",Ra);const Ua=new Map([["both",{left:[lt.KEY_A,lt.KEY_LEFT_ARROW],right:[lt.KEY_RIGHT_ARROW,lt.KEY_D],up:[lt.KEY_UP_ARROW,lt.KEY_W],down:[lt.KEY_DOWN_ARROW,lt.KEY_S]}],["leftRight",{left:[lt.KEY_A,lt.KEY_LEFT_ARROW,lt.KEY_DOWN_ARROW,lt.KEY_S],right:[lt.KEY_RIGHT_ARROW,lt.KEY_D,lt.KEY_UP_ARROW,lt.KEY_W],up:[],down:[]}],["upDown",{left:[],right:[],up:[lt.KEY_RIGHT_ARROW,lt.KEY_D,lt.KEY_UP_ARROW,lt.KEY_W],down:[lt.KEY_A,lt.KEY_LEFT_ARROW,lt.KEY_DOWN_ARROW,lt.KEY_S]}]]);class La extends ra.Z{constructor(e){const t=(0,Ce.ZP)()({dragDelta:10,shiftDragDelta:5,dragVelocity:0,shiftDragVelocity:0,keyboardDragDirection:"both",positionProperty:null,transform:null,dragBoundsProperty:null,mapPosition:null,start:null,drag:null,end:null,moveOnHoldDelay:0,moveOnHoldInterval:1e3/60,hotkeyHoldInterval:800,phetioEnabledPropertyInstrumented:!1,tandem:Kt.Z.REQUIRED,phetioReadOnly:!0},e);super(t),this._start=t.start,this._drag=t.drag,this._end=t.end,this._dragBoundsProperty=t.dragBoundsProperty||new yt.Z(null),this._mapPosition=t.mapPosition,this._transform=t.transform,this._positionProperty=t.positionProperty,this._dragVelocity=t.dragVelocity,this._shiftDragVelocity=t.shiftDragVelocity,this._dragDelta=t.dragDelta,this._shiftDragDelta=t.shiftDragDelta,this._moveOnHoldDelay=t.moveOnHoldDelay,this.moveOnHoldInterval=t.moveOnHoldInterval,this._hotkeyHoldInterval=t.hotkeyHoldInterval,this._keyboardDragDirection=t.keyboardDragDirection,this.isPressedProperty=new bt.Z(!1,{reentrant:!0}),this.keyState=[],this._hotkeys=[],this.currentHotkey=null,this.hotkeyDisablingDragging=!1,this.hotkeyHoldIntervalCounter=this._hotkeyHoldInterval,this.useDragVelocity=t.dragVelocity>0||t.shiftDragVelocity>0,this.moveOnHoldDelayCounter=0,this.moveOnHoldIntervalCounter=0,this.delayComplete=!1,this.dragStartAction=new Zr.Z(e=>{const t=lt.getEventCode(e.domEvent);if(!this.movementKeysDown&&lt.isMovementKey(e.domEvent)&&(this._pointer=e.pointer,e.pointer.addInputListener(this._pointerListener,!0),this.isPressedProperty.value=!0),this.keyState.push({keyDown:!0,key:t,timeDown:0}),this._start&&this.movementKeysDown&&this._start(e),!this.useDragVelocity){const e=this.shiftKeyDown()?this._shiftDragDelta:this._dragDelta;this.updatePosition(e),this.moveOnHoldIntervalCounter=0}},{parameters:[{name:"event",phetioType:OA.SceneryEventIO}],tandem:t.tandem.createTandem("dragStartAction"),phetioDocumentation:"Emits whenever a keyboard drag starts.",phetioReadOnly:t.phetioReadOnly,phetioEventType:Kr.Z.USER}),this.dragEmitter=new Or.Z({tandem:t.tandem.createTandem("dragEmitter"),phetioHighFrequency:!0,phetioDocumentation:"Emits whenever a keyboard drag occurs.",phetioReadOnly:t.phetioReadOnly,phetioEventType:Kr.Z.USER}),this.dragEndAction=new Zr.Z(e=>{this.movementKeysDown||(this._pointer.removeInputListener(this._pointerListener),this._pointer=null,this.isPressedProperty.value=!1),this._end&&this._end(e)},{parameters:[{name:"event",phetioType:OA.SceneryEventIO}],tandem:t.tandem.createTandem("dragEndAction"),phetioDocumentation:"Emits whenever a keyboard drag ends.",phetioReadOnly:t.phetioReadOnly,phetioEventType:Kr.Z.USER});const i=this.step.bind(this);Nr.Z.addListener(i),this.enabledProperty.lazyLink(this.onEnabledPropertyChange.bind(this)),this._pointerListener={listener:this,interrupt:this.interrupt.bind(this)},this._pointer=null,this._disposeKeyboardDragListener=()=>{Nr.Z.removeListener(i),this.isPressedProperty.dispose()}}getDragBounds(){return this._dragBoundsProperty.value}get dragBounds(){return this.getDragBounds()}setTransform(e){this._transform=e}set transform(e){this.setTransform(e)}get transform(){return this.getTransform()}getTransform(){return this._transform}get dragVelocity(){return this._dragVelocity}set dragVelocity(e){this._dragVelocity=e}get shiftDragVelocity(){return this._shiftDragVelocity}set shiftDragVelocity(e){this._shiftDragVelocity=e}get dragDelta(){return this._dragDelta}set dragDelta(e){this._dragDelta=e}get shiftDragDelta(){return this._shiftDragDelta}set shiftDragDelta(e){this._shiftDragDelta=e}get moveOnHoldDelay(){return this._moveOnHoldDelay}set moveOnHoldDelay(e){this._moveOnHoldDelay=e}get moveOnHoldInterval(){return this._moveOnHoldInterval}set moveOnHoldInterval(e){this._moveOnHoldInterval=e}get hotkeyHoldInterval(){return this._hotkeyHoldInterval}set hotkeyHoldInterval(e){this._hotkeyHoldInterval=e}get isPressed(){return!!this._pointer}getCurrentTarget(){return this._pointer.trail.lastNode()}onEnabledPropertyChange(e){!e&&this.interrupt()}keydown(e){const t=e.domEvent,i=lt.getEventCode(t);t.metaKey||(lt.isMovementKey(t)&&t.preventDefault(),e.pointer.reserveForKeyboardDrag(),this.keyInListDown([i])||(Oe.Z.safari&&lt.isArrowKey(t)&&this.keyInListDown([lt.KEY_RIGHT_ARROW,lt.KEY_LEFT_ARROW,lt.KEY_UP_ARROW,lt.KEY_DOWN_ARROW])?this.interrupt():this.canDrag()&&this.dragStartAction.execute(e)))}keyup(e){const t=e.domEvent,i=lt.getEventCode(t),s=this.movementKeysDown;i===lt.KEY_TAB&&t.shiftKey&&this.keyState.push({keyDown:!0,key:lt.KEY_SHIFT_LEFT,timeDown:0});for(let r=0;r<this.keyState.length;r++)i===this.keyState[r].key&&this.keyState.splice(r,1);const n=this.movementKeysDown;n||s===n||this.dragEndAction.execute(e),this.currentHotkey&&!this.allKeysInListDown(this.currentHotkey.keys)&&this.resetHotkeyState(),this.resetPressAndHold()}focusout(e){this.interrupt()}step(e){const t=1e3*e;if(this.keyState.length>0){for(let i=0;i<this.keyState.length;i++)this.keyState[i].keyDown&&(this.keyState[i].timeDown+=t);this.movementKeysDown&&(this.moveOnHoldDelayCounter+=t,this.moveOnHoldIntervalCounter+=t),this.currentHotkey&&(this.hotkeyHoldIntervalCounter+=t);let e=0;if(this.useDragVelocity){e=t*((this.shiftKeyDown()?this._shiftDragVelocity:this._dragVelocity)/1e3)}else{let t=!1;if(this.moveOnHoldDelayCounter>=this._moveOnHoldDelay&&!this.delayComplete&&(t=!0,this.delayComplete=!0,this.moveOnHoldIntervalCounter=0),this.delayComplete&&this.moveOnHoldIntervalCounter>=this._moveOnHoldInterval){t=!0;const e=this.moveOnHoldIntervalCounter-this._moveOnHoldInterval;this.moveOnHoldIntervalCounter=e}e=t?this.shiftKeyDown()?this._shiftDragDelta:this._dragDelta:0}e>0&&this.updatePosition(e)}}canDrag(){return this.enabledProperty.value}updateHotkeys(){for(let e=0;e<this._hotkeys.length;e++){const t=[],i=this._hotkeys[e].keys;for(let e=0;e<i.length;e++)for(let s=0;s<this.keyState.length;s++)this.keyState[s].key===i[e]&&t.push(this.keyState[s]);let s=1===t.length&&1===i.length;for(let e=0;e<t.length-1;e++)t[e+1]&&t[e].timeDown>t[e+1].timeDown&&(s=!0);s&&(this.currentHotkey=this._hotkeys[e],this.hotkeyHoldIntervalCounter>=this._hotkeyHoldInterval&&(this.hotkeyHoldIntervalCounter=0,this._hotkeys[e].callback()))}this.currentHotkey&&(this.keyInListDown(this.currentHotkey.keys)?this.hotkeyDisablingDragging=!0:(this.hotkeyDisablingDragging=!1,this.currentHotkey=null))}updatePosition(e){if(this.updateHotkeys(),!this.hotkeyDisablingDragging){let t=0,i=0;this.leftMovementKeysDown()&&(t-=e),this.rightMovementKeysDown()&&(t+=e),this.upMovementKeysDown()&&(i-=e),this.downMovementKeysDown()&&(i+=e);let s=new be.Z(t,i);if(!s.equals(be.Z.ZERO)){if(this._transform){s=(this._transform instanceof Pe.Z?this._transform:this._transform.value).inverseDelta2(s)}if(this._positionProperty){let e=this._positionProperty.get().plus(s);e=this.mapModelPoint(e),e.equals(this._positionProperty.get())||this._positionProperty.set(e)}this._drag&&this._drag(s,this),this.dragEmitter.emit()}}}mapModelPoint(e){return this._mapPosition?this._mapPosition(e):this._dragBoundsProperty.value?this._dragBoundsProperty.value.closestPointTo(e):e}keyInListDown(e){let t=!1;for(let i=0;i<this.keyState.length;i++){if(this.keyState[i].keyDown)for(let s=0;s<e.length;s++)if(e[s]===this.keyState[i].key){t=!0;break}if(t)break}return t}allKeysInListDown(e){let t=!0;for(let i=0;i<e.length;i++){const s=_.find(this.keyState,t=>t.key===e[i]);if(!s||!s.keyDown){t=!1;break}}return t}getKeyboardDragDirectionKeys(){const e=Ua.get(this._keyboardDragDirection);return e}leftMovementKeysDown(){return this.keyInListDown(this.getKeyboardDragDirectionKeys().left)}rightMovementKeysDown(){return this.keyInListDown(this.getKeyboardDragDirectionKeys().right)}upMovementKeysDown(){return this.keyInListDown(this.getKeyboardDragDirectionKeys().up)}downMovementKeysDown(){return this.keyInListDown(this.getKeyboardDragDirectionKeys().down)}getMovementKeysDown(){return this.rightMovementKeysDown()||this.leftMovementKeysDown()||this.upMovementKeysDown()||this.downMovementKeysDown()}get movementKeysDown(){return this.getMovementKeysDown()}enterKeyDown(){return this.keyInListDown([lt.KEY_ENTER])}shiftKeyDown(){return this.keyInListDown(lt.SHIFT_KEYS)}addHotkey(e){this._hotkeys.push(e)}removeHotkey(e){const t=this._hotkeys.indexOf(e);this._hotkeys.splice(t,1)}setHotkeys(e){this._hotkeys=e.slice(0)}set hotkeys(e){this.setHotkeys(e)}removeAllHotkeys(){this._hotkeys=[]}resetPressAndHold(){this.delayComplete=!1,this.moveOnHoldDelayCounter=0,this.moveOnHoldIntervalCounter=0}resetHotkeyState(){this.currentHotkey=null,this.hotkeyHoldIntervalCounter=this._hotkeyHoldInterval,this.hotkeyDisablingDragging=!1}interrupt(){this.keyState=[],this.resetHotkeyState(),this.resetPressAndHold(),this._pointer&&(this._pointer.removeInputListener(this._pointerListener),this._pointer=null,this.isPressedProperty.value=!1,this._end&&this._end())}dispose(){this.interrupt(),this._disposeKeyboardDragListener(),super.dispose()}static isLeftMovementKey(e){return e===lt.KEY_A||e===lt.KEY_LEFT_ARROW}static isRightMovementKey(e){return e===lt.KEY_D||e===lt.KEY_RIGHT_ARROW}static isUpMovementKey(e){return e===lt.KEY_W||e===lt.KEY_UP_ARROW}static isDownMovementKey(e){return e===lt.KEY_S||e===lt.KEY_DOWN_ARROW}}W.register("KeyboardDragListener",La);const Pa=La;class ba{constructor(e){const t=(0,Ce.ZP)()({callback:_.noop,cancel:_.noop,focus:_.noop,blur:_.noop,global:!1,capture:!1,handle:!1,abort:!1,listenerFireTrigger:"down",fireOnHold:!1,fireOnHoldDelay:400,fireOnHoldInterval:100},e);this._callback=t.callback,this._cancel=t.cancel,this._focus=t.focus,this._blur=t.blur,this._listenerFireTrigger=t.listenerFireTrigger,this._fireOnHold=t.fireOnHold,this._fireOnHoldDelay=t.fireOnHoldDelay,this._fireOnHoldInterval=t.fireOnHoldInterval,this._activeKeyGroups=[],this.keysDown=!1,this._global=t.global,this._handle=t.handle,this._abort=t.abort,this._keyGroups=this.convertKeysToKeyGroups(t.keys),this.listener=this,this.capture=t.capture,this._windowFocusListener=this.handleWindowFocusChange.bind(this),So.windowHasFocusProperty.link(this._windowFocusListener)}fireCallback(e,t){this._callback(e,t.naturalKeys,this)}handleKeyDown(e){"down"!==this._listenerFireTrigger&&"both"!==this._listenerFireTrigger||this._keyGroups.forEach(t=>{this._activeKeyGroups.includes(t)||this.areKeysDownForListener(t)&&t.keys.includes(Hr.getLastKeyDown())&&(this._activeKeyGroups.push(t),this.keysDown=!0,e.pointer.reserveForKeyboardDrag(),t.timer&&t.timer.start(),this.fireCallback(e,t))}),this.manageEvent(e)}handleKeyUp(e){if(this._activeKeyGroups.length>0&&this._activeKeyGroups.forEach((e,t)=>{this.areKeysDownForListener(e)||(e.timer&&e.timer.stop(!1),this._activeKeyGroups.splice(t,1))}),"up"===this._listenerFireTrigger||"both"===this._listenerFireTrigger){const t=lt.getEventCode(e.domEvent);t&&this._keyGroups.forEach(i=>{this.areModifierKeysDownForListener(i)&&i.keys.includes(t)&&(this.keysDown=!1,this.fireCallback(e,i))})}this.manageEvent(e)}getDownModifierKeys(e){const t=e.modifierKeys,i=[];return t.forEach(e=>{for(const t of e)if(Hr.isKeyDown(t)){i.push(t);break}}),i}areKeysDownForListener(e){const t=this.getDownModifierKeys(e),i=t.length===e.modifierKeys.length,s=e.keys.find(e=>Hr.isKeyDown(e));if(i&&s){const e=[...t,s];return Hr.areKeysDownWithoutExtraModifiers(e)}return!1}areModifierKeysDownForListener(e){const t=this.getDownModifierKeys(e);return!!(t.length===e.modifierKeys.length)&&Hr.areKeysDownWithoutExtraModifiers(t)}manageEvent(e){this._handle&&e.handle(),this._abort&&e.abort()}keydown(e){this._global||this.handleKeyDown(e)}keyup(e){this._global||this.handleKeyUp(e)}globalkeydown(e){this._global&&this.handleKeyDown(e)}globalkeyup(e){this._global&&this.handleKeyUp(e)}handleCancel(){this.clearActiveKeyGroups(),this._cancel(this)}handleWindowFocusChange(e){e||this.handleCancel()}cancel(){this.handleCancel()}interrupt(){this.handleCancel()}focusout(e){this.interrupt(),this._blur(this)}focusin(e){this._focus(this)}dispose(){this._keyGroups.forEach(e=>{e.timer&&e.timer.dispose()}),this._keyGroups.length=0,So.windowHasFocusProperty.unlink(this._windowFocusListener)}clearActiveKeyGroups(){this._activeKeyGroups.forEach(e=>{e.timer&&e.timer.stop(!1)}),this._activeKeyGroups.length=0}convertKeysToKeyGroups(e){return e.map(e=>{const t=e.split("+"),i=t.slice(-1)[0],s=ct[i];let n=[];if(t.length>1){n=t.slice(0,t.length-1).map(e=>{const t=ct[e];return t})}const r={keys:s,modifierKeys:n,naturalKeys:e,timer:this._fireOnHold?new la.Z({callback:()=>this.fireCallback(null,r),delay:this._fireOnHoldDelay,interval:this._fireOnHoldInterval}):null};return r})}}W.register("KeyboardListener",ba);const Oa=ba,fa=_s(e=>class extends e{constructor(){super(...arguments),_defineProperty(this,"spriteInstance",null)}press(e,t,i){if(this.isPressed)return!1;if(this.spriteInstance=null,e.currentTarget instanceof or){const t=e.currentTarget;this.spriteInstance=t.getSpriteInstanceFromPoint(t.globalToLocalPoint(e.pointer.point))}return!!this.spriteInstance&&super.press(e,t,i)}});W.register("SpriteListenable",fa);class Za{constructor(e){this._pointer=null,this.downPoint=null,this.downEvent=null,this.enabled=!1,this.lastPoint=null,this.currentPoint=null,this.velocity=null,this.swipeDistance=null,this.firstUp=!1,this.timeSinceLastDown=0,this.downPointers=[],this.holdingTime=0,this.focusedNode=null,this.handleEventListener={down:e=>{e.handle(),e.abort(),this.handleDown(e)}},e.pointerAddedEmitter.addListener(e=>{this.enabled&&e.addInputListener(this.handleEventListener,!0)}),this._attachedPointerListener={up:e=>{this.focusedNode&&this.focusedNode.swipeEnd&&this.focusedNode.swipeEnd.bind(this.focusedNode)(e,this),this.focusedNode=null,this._pointer.removeInputListener(this._attachedPointerListener),this._pointer=null},move:e=>{this.focusedNode&&this.focusedNode.swipeMove&&this.focusedNode.swipeMove.bind(this.focusedNode)(e,this)},interrupt:e=>{this.focusedNode=null,this._pointer.removeInputListener(this._attachedPointerListener),this._pointer=null},cancel:e=>{this.focusedNode=null,this._pointer.removeInputListener(this._attachedPointerListener),this._pointer=null}},this._pointerListener={up:e=>{this.endSwipe(),this._pointer=null,this.swipeDistance=e.pointer.point.minus(this.downPoint);const t=this.swipeDistance.y,i=this.swipeDistance.x;if(Math.abs(i)>100&&Math.abs(t)<100)if(i>0){if(So.pdomFocusedNode&&"Reset All"===So.pdomFocusedNode.innerContent)return;Fi.getNextFocusable(document.body).focus()}else Fi.getPreviousFocusable(document.body).focus();else if(this.firstUp){if(this.timeSinceLastDown<.6){this.firstUp=!1,this.timeSinceLastDown=0;const t=document.getElementsByClassName("a11y-pdom-root")[0];t&&t.contains(e.activeElement)&&e.activeElement.click()}}else this.firstUp=!0},move:e=>{this.lastPoint=this.currentPoint,this.currentPoint=e.pointer.point},interrupt:()=>{this.interrupt()},cancel:()=>{this.interrupt()}},Nr.Z.addListener(this.step.bind(this))}handleDown(e){e.pointer.addIntent(TA.DRAG),this.downPointers.push(e.pointer),this.downPointers.length>1&&(this.downPointers.forEach(e=>e.removeIntent(TA.DRAG)),e.pointer.removeIntent(TA.DRAG)),e.pointer.removeInputListener(this.handleEventListener),null===this._pointer&&"touch"===e.pointer.type&&(this._pointer=e.pointer,e.pointer.addInputListener(this._pointerListener,!0),e.abort(),this.downEvent=e,this.downPoint=e.pointer.point,this.currentPoint=this.downPoint.copy(),this.previousPoint=this.currentPoint.copy())}up(e){const t=this.downPointers.indexOf(e.pointer);t>-1&&this.downPointers.splice(t,1)}step(e){if(this.firstUp&&(this.timeSinceLastDown+=e,this.timeSinceLastDown>.6&&(this.firstUp=!1,this.timeSinceLastDown=0)),this._pointer&&!this._pointer.listeners.includes(this._attachedPointerListener))if(this.holdingTime>.75){const e=So.pdomFocusedNode;e&&(this._pointer.removeInputListener(this._pointerListener),this.holdingTime=0,this.focusedNode=e,this._pointer.addInputListener(this._attachedPointerListener,!0),this.focusedNode.swipeStart&&this.focusedNode.swipeStart(this.downEvent,this),this.downEvent=null)}else this.holdingTime+=e;null!==this.lastPoint&&null!==this.currentPoint&&(this.velocity=this.lastPoint.minus(this.currentPoint).dividedScalar(e))}endSwipe(){this.holdingTime=0,this._pointer&&this._pointer.listeners.includes(this._pointerListener)&&this._pointer.removeInputListener(this._pointerListener)}detachPointerListener(){this._pointer.detach(this._attachedPointerListener)}interrupt(){this.endSwipe(),this._pointer=null,this.downEvent=null}}W.register("SwipeListener",Za);var Na=i(2473);const Ka=["left","right","center","origin"],Ja=["top","bottom","center","origin"];class ja extends ei.Z{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;super(),this.horizontal=e,this.vertical=t,this.padRatio=i}static getAllowedAligns(e){return[...e===Na.Z.HORIZONTAL?Ka:Ja,null]}static alignToInternal(e,t){return e===Na.Z.HORIZONTAL?ja.horizontalAlignToInternal(t):ja.verticalAlignToInternal(t)}static horizontalAlignToInternal(e){return null===e?null:va[e]}static verticalAlignToInternal(e){return null===e?null:Ha[e]}static internalToAlign(e,t){return null===t?null:e===Na.Z.HORIZONTAL?t.horizontal:t.vertical}}_defineProperty(ja,"START",new(G=ja)("left","top",0)),_defineProperty(ja,"END",new G("right","bottom",1)),_defineProperty(ja,"CENTER",new G("center","center",.5)),_defineProperty(ja,"ORIGIN",new G("origin","origin")),_defineProperty(ja,"enumeration",new $t.Z(G,{phetioDocumentation:"Alignment for layout containers"}));const va={left:ja.START,right:ja.END,center:ja.CENTER,origin:ja.ORIGIN},Ha={top:ja.START,bottom:ja.END,center:ja.CENTER,origin:ja.ORIGIN};W.register("LayoutAlign",ja);const Wa=["left","right","center","spaceBetween","spaceAround","spaceEvenly"],za=["top","bottom","center","spaceBetween","spaceAround","spaceEvenly"];class Xa extends ei.Z{constructor(e,t,i){super(),this.spacingFunctionFactory=e,this.horizontal=t,this.vertical=i}static getAllowedJustificationValues(e){return e===Na.Z.HORIZONTAL?Wa:za}static justifyToInternal(e,t){return e===Na.Z.HORIZONTAL?_a[t]:$a[t]}static internalToJustify(e,t){return e===Na.Z.HORIZONTAL?t.horizontal:t.vertical}}_defineProperty(Xa,"START",new(Q=Xa)(()=>()=>0,"left","top")),_defineProperty(Xa,"END",new Q(e=>t=>0===t?e:0,"right","bottom")),_defineProperty(Xa,"CENTER",new Q(e=>t=>0===t?e/2:0,"center","center")),_defineProperty(Xa,"SPACE_BETWEEN",new Q((e,t)=>i=>0!==i?e/(t-1):0,"spaceBetween","spaceBetween")),_defineProperty(Xa,"SPACE_AROUND",new Q((e,t)=>i=>(0!==i?2:1)*e/(2*t),"spaceAround","spaceAround")),_defineProperty(Xa,"SPACE_EVENLY",new Q((e,t)=>i=>e/(t+1),"spaceEvenly","spaceEvenly")),_defineProperty(Xa,"enumeration",new $t.Z(Q,{phetioDocumentation:"Justify for layout containers"}));const _a={left:Xa.START,right:Xa.END,center:Xa.CENTER,spaceBetween:Xa.SPACE_BETWEEN,spaceAround:Xa.SPACE_AROUND,spaceEvenly:Xa.SPACE_EVENLY},$a={top:Xa.START,bottom:Xa.END,center:Xa.CENTER,spaceBetween:Xa.SPACE_BETWEEN,spaceAround:Xa.SPACE_AROUND,spaceEvenly:Xa.SPACE_EVENLY};W.register("LayoutJustification",Xa);const eh={stretch:!0,isSeparator:!0};class th extends sr{constructor(e){super((0,Ce.ZP)()({layoutOptions:eh,stroke:"rgb(100,100,100)"},e))}}W.register("Separator",th);class ih extends(hn(th)){constructor(e){super(),this.localPreferredHeightProperty.link(e=>{null!==e&&(this.y2=e)}),this.mutate(e)}}W.register("VSeparator",ih);class sh extends(nn(th)){constructor(e){super(),this.localPreferredWidthProperty.link(e=>{null!==e&&(this.x2=e)}),this.mutate(e)}}W.register("HSeparator",sh);class nh{constructor(e){this.initialize(e)}initialize(e){return this.trail=e,this}checkPreconditions(){}get node(){return this.trail.lastNode()}get bounds(){return this.trail.parentToGlobalBounds(this.node.bounds)}get visibleBounds(){return this.trail.parentToGlobalBounds(this.node.visibleBounds)}get width(){return this.bounds.width}get height(){return this.bounds.height}get x(){return this.trail.getParentTransform().transformX(this.node.x)}set x(e){this.node.x=this.trail.getParentTransform().inverseX(e)}get y(){return this.trail.getParentTransform().transformY(this.node.y)}set y(e){this.node.y=this.trail.getParentTransform().inverseY(e)}get translation(){return this.trail.getParentTransform().transformPosition2(this.node.translation)}set translation(e){this.node.translation=this.trail.getParentTransform().inversePosition2(e)}get left(){return this.trail.getParentTransform().transformX(this.node.left)}set left(e){this.node.left=this.trail.getParentTransform().inverseX(e)}get right(){return this.trail.getParentTransform().transformX(this.node.right)}set right(e){this.node.right=this.trail.getParentTransform().inverseX(e)}get centerX(){return this.trail.getParentTransform().transformX(this.node.centerX)}set centerX(e){this.node.centerX=this.trail.getParentTransform().inverseX(e)}get top(){return this.trail.getParentTransform().transformY(this.node.top)}set top(e){this.node.top=this.trail.getParentTransform().inverseY(e)}get bottom(){return this.trail.getParentTransform().transformY(this.node.bottom)}set bottom(e){this.node.bottom=this.trail.getParentTransform().inverseY(e)}get centerY(){return this.trail.getParentTransform().transformY(this.node.centerY)}set centerY(e){this.node.centerY=this.trail.getParentTransform().inverseY(e)}get leftTop(){return this.trail.getParentTransform().transformPosition2(this.node.leftTop)}set leftTop(e){this.node.leftTop=this.trail.getParentTransform().inversePosition2(e)}get centerTop(){return this.trail.getParentTransform().transformPosition2(this.node.centerTop)}set centerTop(e){this.node.centerTop=this.trail.getParentTransform().inversePosition2(e)}get rightTop(){return this.trail.getParentTransform().transformPosition2(this.node.rightTop)}set rightTop(e){this.node.rightTop=this.trail.getParentTransform().inversePosition2(e)}get leftCenter(){return this.trail.getParentTransform().transformPosition2(this.node.leftCenter)}set leftCenter(e){this.node.leftCenter=this.trail.getParentTransform().inversePosition2(e)}get center(){return this.trail.getParentTransform().transformPosition2(this.node.center)}set center(e){this.node.center=this.trail.getParentTransform().inversePosition2(e)}get rightCenter(){return this.trail.getParentTransform().transformPosition2(this.node.rightCenter)}set rightCenter(e){this.node.rightCenter=this.trail.getParentTransform().inversePosition2(e)}get leftBottom(){return this.trail.getParentTransform().transformPosition2(this.node.leftBottom)}set leftBottom(e){this.node.leftBottom=this.trail.getParentTransform().inversePosition2(e)}get centerBottom(){return this.trail.getParentTransform().transformPosition2(this.node.centerBottom)}set centerBottom(e){this.node.centerBottom=this.trail.getParentTransform().inversePosition2(e)}get rightBottom(){return this.trail.getParentTransform().transformPosition2(this.node.rightBottom)}set rightBottom(e){this.node.rightBottom=this.trail.getParentTransform().inversePosition2(e)}get widthSizable(){return this.node.widthSizable}get heightSizable(){return this.node.heightSizable}get preferredWidth(){const e=this.node.preferredWidth;return null===e?null:Math.abs(this.trail.getParentTransform().transformDeltaX(e))}set preferredWidth(e){this.node.preferredWidth=null===e?null:Math.abs(this.trail.getParentTransform().inverseDeltaX(e))}get preferredHeight(){const e=this.node.preferredHeight;return null===e?null:Math.abs(this.trail.getParentTransform().transformDeltaY(e))}set preferredHeight(e){this.node.preferredHeight=null===e?null:Math.abs(this.trail.getParentTransform().inverseDeltaY(e))}get minimumWidth(){const e=tn(this.node)?this.node.minimumWidth||0:this.node.width;return Math.abs(this.trail.getParentTransform().transformDeltaX(e))}get minimumHeight(){const e=An(this.node)?this.node.minimumHeight||0:this.node.height;return Math.abs(this.trail.getParentTransform().transformDeltaY(e))}getMinimum(e){return e===Na.Z.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maxWidth(){return null===this.node.maxWidth?null:Math.abs(this.trail.getParentTransform().transformDeltaX(this.node.maxWidth))}set maxWidth(e){this.node.maxWidth=null===e?null:Math.abs(this.trail.getParentTransform().inverseDeltaX(e))}get maxHeight(){return null===this.node.maxHeight?null:Math.abs(this.trail.getParentTransform().transformDeltaY(this.node.maxHeight))}set maxHeight(e){this.node.maxHeight=null===e?null:Math.abs(this.trail.getParentTransform().inverseDeltaY(e))}getMax(e){return e===Na.Z.HORIZONTAL?this.maxWidth:this.maxHeight}get visible(){return this.node.visible}set visible(e){this.node.visible=e}dispose(){this.trail=null,this.freeToPool()}freeToPool(){nh.pool.freeToPool(this)}}S=nh,_defineProperty(nh,"pool",new ti.Z(S,{maxSize:1e3})),W.register("LayoutProxy",nh);class rh extends Qo.oL{constructor(e,t,i){const s=new Bn(e,t);super([s],e=>1===e.length?nh.pool.create(e[0].copy().removeAncestor()):null),_defineProperty(this,"transformTracker",null),this.trailsBetweenProperty=s,this.lazyLink((e,t)=>{t&&t.dispose()});const n=null==i?void 0:i.onTransformChange;n&&this.link(t=>{this.transformTracker&&(this.transformTracker.dispose(),this.transformTracker=null),t&&(this.transformTracker=new xr(t.trail.copy().addAncestor(e)),this.transformTracker.addListener(n))})}dispose(){this.trailsBetweenProperty.dispose(),this.transformTracker&&this.transformTracker.dispose(),super.dispose()}}W.register("LayoutProxyProperty",rh);class oh{constructor(e){_defineProperty(this,"_layoutLockCount",0),_defineProperty(this,"_layoutAttemptDuringLock",!1),_defineProperty(this,"_enabled",!0),_defineProperty(this,"_listenedNodes",new Set),_defineProperty(this,"finishedLayoutEmitter",new te.Z),this.ancestorNode=e,this._updateLayoutListener=this.updateLayoutAutomatically.bind(this)}addNode(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&(e._activeParentLayoutConstraint=this),e.boundsProperty.lazyLink(this._updateLayoutListener),e.visibleProperty.lazyLink(this._updateLayoutListener),sn(e)&&(e.minimumWidthProperty.lazyLink(this._updateLayoutListener),e.isWidthResizableProperty.lazyLink(this._updateLayoutListener)),an(e)&&(e.minimumHeightProperty.lazyLink(this._updateLayoutListener),e.isHeightResizableProperty.lazyLink(this._updateLayoutListener)),this._listenedNodes.add(e)}removeNode(e){e._activeParentLayoutConstraint===this&&(e._activeParentLayoutConstraint=null),e.boundsProperty.unlink(this._updateLayoutListener),e.visibleProperty.unlink(this._updateLayoutListener),sn(e)&&(e.minimumWidthProperty.unlink(this._updateLayoutListener),e.isWidthResizableProperty.unlink(this._updateLayoutListener)),an(e)&&(e.minimumHeightProperty.unlink(this._updateLayoutListener),e.isHeightResizableProperty.unlink(this._updateLayoutListener)),this._listenedNodes.delete(e)}layout(){}get isLocked(){return this._layoutLockCount>0}lock(){this._layoutLockCount++}unlock(){this._layoutLockCount--}validateLocalPreferredWidth(e){0}validateLocalPreferredHeight(e){0}validateLocalPreferredSize(e){0}updateLayout(){if(this.isLocked)this._layoutAttemptDuringLock=!0;else{this.lock();do{this._layoutAttemptDuringLock=!1,this.layout()}while(this._layoutAttemptDuringLock);this.unlock()}}updateLayoutAutomatically(){this._enabled&&this.updateLayout()}createLayoutProxy(e){const t=e.getTrails(e=>e===this.ancestorNode);return 1===t.length?nh.pool.create(t[0].removeAncestor()):null}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this.updateLayoutAutomatically())}dispose(){const e=[...this._listenedNodes.keys()];for(let t=0;t<e.length;t++)this.removeNode(e[t]);this.finishedLayoutEmitter.dispose()}}W.register("LayoutConstraint",oh);class Ah{constructor(e,t,i){i?(this.layoutProxyProperty=null,this._proxy=i):(this._proxy=null,this.layoutProxyProperty=new rh(e.ancestorNode,t,{onTransformChange:()=>e.updateLayoutAutomatically()}),this.layoutProxyProperty.link(t=>{this._proxy=t,e.updateLayoutAutomatically()})),this._constraint=e,this._node=t,this.layoutOptionsListener=this.onLayoutOptionsChange.bind(this),this.node.layoutOptionsChangedEmitter.addListener(this.layoutOptionsListener)}onLayoutOptionsChange(){}get node(){return this._node}isConnected(){return null!==this._proxy}get proxy(){return this._proxy}isSizable(e){return e===Na.Z.HORIZONTAL?this.proxy.widthSizable:this.proxy.heightSizable}dispose(){this.layoutProxyProperty&&this.layoutProxyProperty.dispose(),this.node.layoutOptionsChangedEmitter.removeListener(this.layoutOptionsListener)}}W.register("LayoutCell",Ah);class ah{constructor(e,t){_defineProperty(this,"_map",new Map),this._enumeration=e,this._values=e.enumeration.values,this._values.forEach(e=>{this._map.set(e,t(e))})}get(e){return this._map.get(e)}set(e,t){this._map.set(e,t)}map(e){return new ah(this._enumeration,t=>e(this.get(t),t))}forEach(e){this._values.forEach(t=>e(this.get(t),t))}values(){return this._values.map(e=>this.get(e))}}P.Z.register("EnumerationMap",ah);const hh=ah;class lh extends hh{constructor(e,t){super(Na.Z,i=>i===Na.Z.HORIZONTAL?e:t)}get horizontal(){return this.get(Na.Z.HORIZONTAL)}set horizontal(e){this.set(Na.Z.HORIZONTAL,e)}get vertical(){return this.get(Na.Z.VERTICAL)}set vertical(e){this.set(Na.Z.VERTICAL,e)}with(e,t){return new lh(e===Na.Z.HORIZONTAL?t:this.horizontal,e===Na.Z.VERTICAL?t:this.vertical)}static create(e){return new lh(e(Na.Z.HORIZONTAL),e(Na.Z.VERTICAL))}}P.Z.register("OrientationPair",lh);const gh=lh;class ch extends Ah{constructor(e,t,i){super(e,t,i),_defineProperty(this,"preferredSizeSet",new gh(!1,!1)),_defineProperty(this,"lastAvailableBounds",Ue.Z.NOTHING.copy()),_defineProperty(this,"lastUsedBounds",Ue.Z.NOTHING.copy()),this._marginConstraint=e}reposition(e,t,i,s,n,r){const o=s&&this.isSizable(e)?t:this.getMinimumSize(e);this.attemptPreferredSize(e,o),r===ja.ORIGIN?this.positionOrigin(e,i+n):this.positionStart(e,i+(t-this.getCellBounds()[e.size])*r.padRatio);const A=this.getCellBounds();return this.lastAvailableBounds[e.minCoordinate]=i,this.lastAvailableBounds[e.maxCoordinate]=i+t,this.lastUsedBounds.set(A),A}get effectiveLeftMargin(){return null!==this._leftMargin?this._leftMargin:this._marginConstraint._leftMargin}get effectiveRightMargin(){return null!==this._rightMargin?this._rightMargin:this._marginConstraint._rightMargin}get effectiveTopMargin(){return null!==this._topMargin?this._topMargin:this._marginConstraint._topMargin}get effectiveBottomMargin(){return null!==this._bottomMargin?this._bottomMargin:this._marginConstraint._bottomMargin}getEffectiveMinMargin(e){return e===Na.Z.HORIZONTAL?this.effectiveLeftMargin:this.effectiveTopMargin}getEffectiveMaxMargin(e){return e===Na.Z.HORIZONTAL?this.effectiveRightMargin:this.effectiveBottomMargin}get effectiveMinContentWidth(){return null!==this._minContentWidth?this._minContentWidth:this._marginConstraint._minContentWidth}get effectiveMinContentHeight(){return null!==this._minContentHeight?this._minContentHeight:this._marginConstraint._minContentHeight}getEffectiveMinContent(e){return e===Na.Z.HORIZONTAL?this.effectiveMinContentWidth:this.effectiveMinContentHeight}get effectiveMaxContentWidth(){return null!==this._maxContentWidth?this._maxContentWidth:this._marginConstraint._maxContentWidth}get effectiveMaxContentHeight(){return null!==this._maxContentHeight?this._maxContentHeight:this._marginConstraint._maxContentHeight}getEffectiveMaxContent(e){return e===Na.Z.HORIZONTAL?this.effectiveMaxContentWidth:this.effectiveMaxContentHeight}getMinimumSize(e){return this.getEffectiveMinMargin(e)+Math.max(this.proxy.getMinimum(e),this.getEffectiveMinContent(e)||0)+this.getEffectiveMaxMargin(e)}getMaximumSize(e){return this.getEffectiveMinMargin(e)+(this.getEffectiveMaxContent(e)||Number.POSITIVE_INFINITY)+this.getEffectiveMaxMargin(e)}attemptPreferredSize(e,t){if(this.proxy[e.sizable]){const i=this.getMinimumSize(e),s=this.getMaximumSize(e);let n=(t=ie.Z.clamp(t,i,s))-this.getEffectiveMinMargin(e)-this.getEffectiveMaxMargin(e);const r=this.proxy.getMax(e);null!==r&&(n=Math.min(r,n)),this._marginConstraint.setProxyPreferredSize(e,this.proxy,n),this.preferredSizeSet.set(e,!0)}}unsetPreferredSize(e){this.proxy[e.sizable]&&this._marginConstraint.setProxyPreferredSize(e,this.proxy,null)}positionStart(e,t){const i=this.getEffectiveMinMargin(e)+t;this._marginConstraint.setProxyMinSide(e,this.proxy,i)}positionOrigin(e,t){this._marginConstraint.setProxyOrigin(e,this.proxy,t)}getOriginBounds(){return this.getCellBounds().shiftedXY(-this.proxy.x,-this.proxy.y)}getCellBounds(){return this.proxy.bounds.withOffsets(this.effectiveLeftMargin,this.effectiveTopMargin,this.effectiveRightMargin,this.effectiveBottomMargin)}dispose(){Na.Z.enumeration.values.forEach(e=>{this.preferredSizeSet.get(e)&&this.unsetPreferredSize(e)}),super.dispose()}static createHelperNode(e,t,i){const s=new Zs,n=_t.bn.union(e.map(e=>_t.bn.bounds(e.lastAvailableBounds))),r=_t.bn.union(e.map(e=>_t.bn.bounds(e.lastUsedBounds))),o=_t.bn.union(e.map(e=>_t.bn.bounds(e.proxy.bounds))),A=_t.bn.bounds(t).shapeDifference(n),a=n.shapeDifference(r),h=r.shapeDifference(o),l=(e,t,i)=>{const s=new zn(e,{font:new Ge({size:6,family:"monospace"}),fill:t}),n=rr.bounds(s.bounds,{fill:i,children:[s]});return new zi(n,4,Math.floor(n.left),Math.ceil(n.top+1),Math.floor(n.width),Math.floor(n.height-2),Le.Z.rotation2(-Math.PI/4))};return s.addChild(new On(A,{fill:l("spacing","#000","#fff"),opacity:.6})),s.addChild(new On(a,{fill:l("empty","#aaa","#000"),opacity:.6})),s.addChild(new On(h,{fill:l("margin","#600","#f00"),opacity:.6})),s.addChild(rr.bounds(t,{stroke:"white",lineDash:[2,2],lineDashOffset:2,lineWidth:.4})),s.addChild(rr.bounds(t,{stroke:"black",lineDash:[2,2],lineWidth:.4})),e.forEach(e=>{s.addChild(rr.bounds(e.getCellBounds(),{stroke:"rgba(0,255,0,1)",lineWidth:.4}))}),e.forEach(e=>{s.addChild(rr.bounds(e.proxy.bounds,{stroke:"rgba(255,0,0,1)",lineWidth:.4}))}),e.forEach(e=>{const t=e.getCellBounds(),n=new ha({tandem:Kt.Z.OPT_OUT});s.addChild(rr.bounds(t,{inputListeners:[n]}));let r=i(e);e.effectiveLeftMargin&&(r+=`leftMargin: ${e.effectiveLeftMargin}\n`),e.effectiveRightMargin&&(r+=`rightMargin: ${e.effectiveRightMargin}\n`),e.effectiveTopMargin&&(r+=`topMargin: ${e.effectiveTopMargin}\n`),e.effectiveBottomMargin&&(r+=`bottomMargin: ${e.effectiveBottomMargin}\n`),e.effectiveMinContentWidth&&(r+=`minContentWidth: ${e.effectiveMinContentWidth}\n`),e.effectiveMinContentHeight&&(r+=`minContentHeight: ${e.effectiveMinContentHeight}\n`),e.effectiveMaxContentWidth&&(r+=`maxContentWidth: ${e.effectiveMaxContentWidth}\n`),e.effectiveMaxContentHeight&&(r+=`maxContentHeight: ${e.effectiveMaxContentHeight}\n`),r+=`layoutOptions: ${JSON.stringify(e.node.layoutOptions,null,2).replace(/ /g,"&nbsp;")}\n`;const o=new wl(r.trim().replace(/\n/g,"<br>"),{font:new Ge({size:12})}),A=rr.bounds(o.bounds.dilated(3),{fill:"rgba(255,255,255,0.8)",children:[o],leftTop:t.leftTop});s.addChild(A),n.isOverProperty.link(e=>{A.visible=e})}),s}}W.register("MarginLayoutCell",ch);var dh=i(2560);const uh=["resize","layoutOrigin"];class mh extends(un(Zs)){constructor(e){super(e),_defineProperty(this,"layoutOriginProperty",new dh.Z(be.Z.ZERO))}linkLayoutBounds(){this._constraint.layoutBoundsProperty.link(e=>{this.localBounds=e})}setExcludeInvisibleChildrenFromBounds(e){super.setExcludeInvisibleChildrenFromBounds(e),this._constraint.excludeInvisible=e}setChildren(e){if(this.constraint.isLocked)return super.setChildren(e);const t=this.getChildren();return this.constraint.lock(),super.setChildren(e),this.constraint.unlock(),_.isEqual(t,e)||this.constraint.updateLayoutAutomatically(),this}updateLayout(){this._constraint.updateLayout()}get resize(){return this._constraint.enabled}set resize(e){this._constraint.enabled=e}get layoutOrigin(){return this.layoutOriginProperty.value}set layoutOrigin(e){this.layoutOriginProperty.value=e}get constraint(){return this._constraint}dispose(){this._constraint.dispose(),super.dispose()}}W.register("LayoutNode",mh);class ph{initializeLayoutLine(){this.min=0,this.max=Number.POSITIVE_INFINITY,this.minOrigin=Number.POSITIVE_INFINITY,this.maxOrigin=Number.NEGATIVE_INFINITY,this.size=0,this.position=0}hasOrigin(){return isFinite(this.minOrigin)&&isFinite(this.maxOrigin)}}W.register("LayoutLine",ph);class Vh extends oh{constructor(e,t){const i=(0,Ce.ZP)()({preferredWidthProperty:new Ms.Z(null),preferredHeightProperty:new Ms.Z(null),minimumWidthProperty:new Ms.Z(null),minimumHeightProperty:new Ms.Z(null),layoutOriginProperty:new Ms.Z(be.Z.ZERO)},t);super(e),_defineProperty(this,"_excludeInvisible",!0),this.layoutBoundsProperty=new yt.Z(Ue.Z.NOTHING,{valueComparisonStrategy:"equalsFunction"}),this.preferredWidthProperty=i.preferredWidthProperty,this.preferredHeightProperty=i.preferredHeightProperty,this.minimumWidthProperty=i.minimumWidthProperty,this.minimumHeightProperty=i.minimumHeightProperty,this.layoutOriginProperty=i.layoutOriginProperty,this.preferredWidthProperty.lazyLink(this._updateLayoutListener),this.preferredHeightProperty.lazyLink(this._updateLayoutListener),this.layoutOriginProperty.lazyLink(this._updateLayoutListener)}filterLayoutCells(e){return e.filter(e=>e.isConnected()&&e.proxy.bounds.isValid()&&(!this.excludeInvisible||e.node.visible))}get excludeInvisible(){return this._excludeInvisible}set excludeInvisible(e){this._excludeInvisible!==e&&(this._excludeInvisible=e,this.updateLayoutAutomatically())}setProxyPreferredSize(e,t,i){t[e.preferredSize]=i}setProxyMinSide(e,t,i){Math.abs(t[e.minSide]-i)>1e-9&&(t[e.minSide]=i)}setProxyOrigin(e,t,i){Math.abs(t[e.coordinate]-i)>1e-9&&(t[e.coordinate]=i)}dispose(){this.preferredWidthProperty.unlink(this._updateLayoutListener),this.preferredHeightProperty.unlink(this._updateLayoutListener),this.layoutOriginProperty.unlink(this._updateLayoutListener),super.dispose()}}W.register("NodeLayoutConstraint",Vh);const Mh=["margin","xMargin","yMargin","leftMargin","rightMargin","topMargin","bottomMargin","minContentWidth","minContentHeight","maxContentWidth","maxContentHeight"],Bh=_s(e=>class extends e{constructor(){super(...arguments),_defineProperty(this,"_leftMargin",null),_defineProperty(this,"_rightMargin",null),_defineProperty(this,"_topMargin",null),_defineProperty(this,"_bottomMargin",null),_defineProperty(this,"_minContentWidth",null),_defineProperty(this,"_minContentHeight",null),_defineProperty(this,"_maxContentWidth",null),_defineProperty(this,"_maxContentHeight",null),_defineProperty(this,"changedEmitter",new te.Z)}mutateConfigurable(e){(0,ln.Z)(e,["margin"],["xMargin","yMargin"]),(0,ln.Z)(e,["xMargin"],["leftMargin","rightMargin"]),(0,ln.Z)(e,["yMargin"],["topMargin","bottomMargin"])}setConfigToBaseDefault(){this._leftMargin=0,this._rightMargin=0,this._topMargin=0,this._bottomMargin=0,this._minContentWidth=null,this._minContentHeight=null,this._maxContentWidth=null,this._maxContentHeight=null,this.changedEmitter.emit()}setConfigToInherit(){this._leftMargin=null,this._rightMargin=null,this._topMargin=null,this._bottomMargin=null,this._minContentWidth=null,this._minContentHeight=null,this._maxContentWidth=null,this._maxContentHeight=null,this.changedEmitter.emit()}get leftMargin(){return this._leftMargin}set leftMargin(e){this._leftMargin!==e&&(this._leftMargin=e,this.changedEmitter.emit())}get rightMargin(){return this._rightMargin}set rightMargin(e){this._rightMargin!==e&&(this._rightMargin=e,this.changedEmitter.emit())}get topMargin(){return this._topMargin}set topMargin(e){this._topMargin!==e&&(this._topMargin=e,this.changedEmitter.emit())}get bottomMargin(){return this._bottomMargin}set bottomMargin(e){this._bottomMargin!==e&&(this._bottomMargin=e,this.changedEmitter.emit())}get xMargin(){return this._leftMargin}set xMargin(e){this._leftMargin===e&&this._rightMargin===e||(this._leftMargin=e,this._rightMargin=e,this.changedEmitter.emit())}get yMargin(){return this._topMargin}set yMargin(e){this._topMargin===e&&this._bottomMargin===e||(this._topMargin=e,this._bottomMargin=e,this.changedEmitter.emit())}get margin(){return this._topMargin}set margin(e){this._leftMargin===e&&this._rightMargin===e&&this._topMargin===e&&this._bottomMargin===e||(this._leftMargin=e,this._rightMargin=e,this._topMargin=e,this._bottomMargin=e,this.changedEmitter.emit())}get minContentWidth(){return this._minContentWidth}set minContentWidth(e){this._minContentWidth!==e&&(this._minContentWidth=e,this.changedEmitter.emit())}get minContentHeight(){return this._minContentHeight}set minContentHeight(e){this._minContentHeight!==e&&(this._minContentHeight=e,this.changedEmitter.emit())}get maxContentWidth(){return this._maxContentWidth}set maxContentWidth(e){this._maxContentWidth!==e&&(this._maxContentWidth=e,this.changedEmitter.emit())}get maxContentHeight(){return this._maxContentHeight}set maxContentHeight(e){this._maxContentHeight!==e&&(this._maxContentHeight=e,this.changedEmitter.emit())}});W.register("MarginLayoutConfigurable",Bh);const wh=Bh,Ch=["orientation","align","stretch","grow"].concat(Mh),Eh=_s(e=>class extends(wh(e)){constructor(){super(...arguments),_defineProperty(this,"_orientation",Na.Z.HORIZONTAL),_defineProperty(this,"_align",null),_defineProperty(this,"_stretch",null),_defineProperty(this,"_grow",null),_defineProperty(this,"orientationChangedEmitter",new te.Z)}mutateConfigurable(e){super.mutateConfigurable(e),ur(this,Ch,e)}setConfigToBaseDefault(){this._align=ja.CENTER,this._stretch=!1,this._grow=0,super.setConfigToBaseDefault()}setConfigToInherit(){this._align=null,this._stretch=null,this._grow=null,super.setConfigToInherit()}get orientation(){return this._orientation===Na.Z.HORIZONTAL?"horizontal":"vertical"}set orientation(e){const t="horizontal"===e?Na.Z.HORIZONTAL:Na.Z.VERTICAL;this._orientation!==t&&(this._orientation=t,this.orientationChangedEmitter.emit(),this.changedEmitter.emit())}get align(){const e=ja.internalToAlign(this._orientation,this._align);return e}set align(e){const t=ja.alignToInternal(this._orientation.opposite,e);this._align!==t&&(this._align=t,this.changedEmitter.emit())}get stretch(){return this._stretch}set stretch(e){this._stretch!==e&&(this._stretch=e,this.changedEmitter.emit())}get grow(){return this._grow}set grow(e){this._grow!==e&&(this._grow=e,this.changedEmitter.emit())}});W.register("FlowConfigurable",Eh);const Yh=Eh;class Dh extends(Yh(ch)){constructor(e,t,i){super(e,t,i),_defineProperty(this,"size",0),_defineProperty(this,"_isSeparator",!1),this.flowConstraint=e,this.orientation=e.orientation,this.onLayoutOptionsChange()}get effectiveAlign(){return null!==this._align?this._align:this.flowConstraint._align}get effectiveStretch(){return null!==this._stretch?this._stretch:this.flowConstraint._stretch}get effectiveGrow(){return null!==this._grow?this._grow:this.flowConstraint._grow}onLayoutOptionsChange(){this.node.layoutOptions&&this.setOptions(this.node.layoutOptions),super.onLayoutOptionsChange()}setOptions(e){const t=(0,Ce.ZP)()({isSeparator:!1},e);this._isSeparator=t.isSeparator,this.setConfigToInherit(),this.mutateConfigurable(t)}}W.register("FlowCell",Dh);class yh extends ph{constructor(e,t){super(),this.initialize(e,t)}initialize(e,t){return this.orientation=e,this.cells=t,this.initializeLayoutLine(),this}getMinimumSize(e){return(this.cells.length-1)*e+_.sum(this.cells.map(e=>e.getMinimumSize(this.orientation)))}freeToPool(){yh.pool.freeToPool(this)}clean(){this.cells.length=0,this.freeToPool()}}T=yh,_defineProperty(yh,"pool",new ti.Z(T,{defaultArguments:[Na.Z.HORIZONTAL,[]]})),W.register("FlowLine",yh);const Ih=[...Ch,"spacing","lineSpacing","justify","justifyLines","wrap","excludeInvisible"];class qh extends(Yh(Vh)){constructor(e,t){super(e,t),_defineProperty(this,"cells",[]),_defineProperty(this,"_justify",Xa.SPACE_BETWEEN),_defineProperty(this,"_justifyLines",null),_defineProperty(this,"_wrap",!1),_defineProperty(this,"_spacing",0),_defineProperty(this,"_lineSpacing",0),_defineProperty(this,"displayedCells",[]),this.setConfigToBaseDefault(),this.mutateConfigurable(t),ur(this,Ih,t),this.changedEmitter.addListener(this._updateLayoutListener),this.orientationChangedEmitter.addListener(()=>this.cells.forEach(e=>{e.orientation=this.orientation}))}updateSeparatorVisibility(){let e=0;for(;e<this.cells.length;e++){const t=this.cells[e];if(t._isSeparator)t.node.visible=!1;else if(t.node.visible)break}let t=!1;for(let i=this.cells.length-1;i>e;i--){const e=this.cells[i];e._isSeparator?(e.node.visible=t,t=!1):e.node.visible&&(t=!0)}}layout(){super.layout();const e=this._orientation,t=this._orientation.opposite;this.updateSeparatorVisibility();const i=this.filterLayoutCells(this.cells);if(this.displayedCells=i,!i.length)return this.layoutBoundsProperty.value=Ue.Z.NOTHING,this.minimumWidthProperty.value=null,void(this.minimumHeightProperty.value=null);let s=this.getPreferredProperty(e).value;const n=this.getPreferredProperty(t).value,r=Math.max(...i.map(t=>t.getMinimumSize(e)||0));r>(s||Number.POSITIVE_INFINITY)&&(s=r);const o=[];if(this.wrap){let t=[],n=s||Number.POSITIVE_INFINITY;for(;i.length;){const r=i.shift(),A=r.getMinimumSize(e);0===t.length?(t.push(r),n-=A):this.spacing+A<=n+1e-7?(t.push(r),n-=this.spacing+A):(o.push(yh.pool.create(e,t)),n=s||Number.POSITIVE_INFINITY,t=[r],n-=A)}t.length&&o.push(yh.pool.create(e,t))}else o.push(yh.pool.create(e,i));o.forEach(e=>{e.cells.forEach(i=>{if(e.min=Math.max(e.min,i.getMinimumSize(t)),e.max=Math.min(e.max,i.getMaximumSize(t)),i.effectiveAlign===ja.ORIGIN){const s=i.getOriginBounds();e.minOrigin=Math.min(s[t.minCoordinate],e.minOrigin),e.maxOrigin=Math.max(s[t.maxCoordinate],e.maxOrigin)}}),isFinite(e.minOrigin)&&isFinite(e.maxOrigin)?e.size=Math.max(e.min,e.maxOrigin-e.minOrigin):e.size=e.min});const A=Math.max(...o.map(e=>e.getMinimumSize(this.spacing))),a=_.sum(o.map(e=>e.size))+(o.length-1)*this.lineSpacing,h=this.wrap?r:A,l=Math.max(A,s||0),g=Math.max(a,n||0),c=this.layoutOriginProperty.value[e.coordinate],d=this.layoutOriginProperty.value[e.opposite.coordinate];o.forEach(t=>{const i=_.sum(t.cells.map(t=>t.getMinimumSize(e))),s=this.spacing*(t.cells.length-1);let n,r=l-i-s;for(t.cells.forEach(t=>{t.size=t.getMinimumSize(e)});r>1e-7&&(n=t.cells.filter(t=>0!==t.effectiveGrow&&t.size<t.getMaximumSize(e)-1e-7)).length;){const t=_.sum(n.map(e=>e.effectiveGrow)),i=Math.min(Math.min(...n.map(t=>(t.getMaximumSize(e)-t.size)/t.effectiveGrow)),r/t);n.forEach(e=>{e.size+=i*e.effectiveGrow}),r-=i*t}t.cells.forEach(t=>t.attemptPreferredSize(e,t.size));const o=this._justify.spacingFunctionFactory(r,t.cells.length);let A=c;t.cells.forEach((t,i)=>{A+=o(i),i>0&&(A+=this.spacing),t.positionStart(e,A),t.lastAvailableBounds[e.minCoordinate]=A,t.lastAvailableBounds[e.maxCoordinate]=A+t.size,A+=t.size})});const u=g-a,m=(o[0].hasOrigin()?o[0].minOrigin:0)+d;let p=m;if(null===this._justifyLines)o.forEach(e=>{e.size+=u/o.length}),o.forEach(e=>{e.position=p,p+=e.size+this.lineSpacing});else{const e=this._justifyLines.spacingFunctionFactory(u,o.length);o.forEach((t,i)=>{p+=e(i),t.position=p,p+=t.size+this.lineSpacing})}o.forEach(e=>e.cells.forEach(i=>{i.reposition(t,e.size,e.position,i.effectiveStretch,-e.minOrigin,i.effectiveAlign)}));const V=c,M=c+l,B=m,w=m+g;this.layoutBoundsProperty.value=Ue.Z.oriented(e,V,B,M,w),this.minimumWidthProperty.value=e===Na.Z.HORIZONTAL?h:a,this.minimumHeightProperty.value=e===Na.Z.HORIZONTAL?a:h,this.finishedLayoutEmitter.emit(),o.forEach(e=>e.clean())}get justify(){const e=Xa.internalToJustify(this._orientation,this._justify);return e}set justify(e){const t=Xa.justifyToInternal(this._orientation,e);this._justify!==t&&(this._justify=t,this.updateLayoutAutomatically())}get justifyLines(){if(null===this._justifyLines)return null;{const e=Xa.internalToJustify(this._orientation,this._justifyLines);return e}}set justifyLines(e){const t=null===e?null:Xa.justifyToInternal(this._orientation.opposite,e);this._justifyLines!==t&&(this._justifyLines=t,this.updateLayoutAutomatically())}get wrap(){return this._wrap}set wrap(e){this._wrap!==e&&(this._wrap=e,this.updateLayoutAutomatically())}get spacing(){return this._spacing}set spacing(e){this._spacing!==e&&(this._spacing=e,this.updateLayoutAutomatically())}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){this._lineSpacing!==e&&(this._lineSpacing=e,this.updateLayoutAutomatically())}insertCell(e,t){t.orientation=this.orientation,this.cells.splice(e,0,t),this.addNode(t.node),t.changedEmitter.addListener(this._updateLayoutListener),this.updateLayoutAutomatically()}removeCell(e){(0,Oi.Z)(this.cells,e),this.removeNode(e.node),e.changedEmitter.removeListener(this._updateLayoutListener),this.updateLayoutAutomatically()}reorderCells(e,t,i){this.cells.splice(t,i-t+1,...e),this.updateLayoutAutomatically()}getPreferredProperty(e){return e===Na.Z.HORIZONTAL?this.preferredWidthProperty:this.preferredHeightProperty}dispose(){this.lock(),this.cells.forEach(e=>this.removeCell(e)),this.displayedCells=[],super.dispose(),this.unlock()}static create(e,t){return new qh(e,t)}}W.register("FlowConstraint",qh);const Gh=[...uh,...Ih.filter(e=>"excludeInvisible"!==e)],Qh={orientation:"horizontal",spacing:0,align:"center",stretch:!1};class Sh extends mh{constructor(e){const t=(0,Ce.ZP)()({excludeInvisibleChildrenFromBounds:!0,resize:!0,disabledOpacity:X.DISABLED_OPACITY},e);super(),_defineProperty(this,"_cellMap",new Map),this._constraint=new qh(this,{preferredWidthProperty:this.localPreferredWidthProperty,preferredHeightProperty:this.localPreferredHeightProperty,minimumWidthProperty:this.localMinimumWidthProperty,minimumHeightProperty:this.localMinimumHeightProperty,layoutOriginProperty:this.layoutOriginProperty,orientation:Qh.orientation,spacing:Qh.spacing,align:Qh.align,stretch:Qh.stretch,excludeInvisible:!1}),this.onChildInserted=this.onFlowBoxChildInserted.bind(this),this.onChildRemoved=this.onFlowBoxChildRemoved.bind(this),this.onChildrenReordered=this.onFlowBoxChildrenReordered.bind(this),this.onChildrenChanged=this.onFlowBoxChildrenChanged.bind(this),this.childInsertedEmitter.addListener(this.onChildInserted),this.childRemovedEmitter.addListener(this.onChildRemoved),this.childrenReorderedEmitter.addListener(this.onChildrenReordered),this.childrenChangedEmitter.addListener(this.onChildrenChanged);const i=_.omit(t,Us),s=_.pick(t,Us);this._constraint.lock(),this.mutate(i),this._constraint.unlock(),this._constraint.updateLayout(),this.mutate(s),this.linkLayoutBounds()}onFlowBoxChildInserted(e,t){const i=new Dh(this._constraint,e,this._constraint.createLayoutProxy(e));this._cellMap.set(e,i),this._constraint.insertCell(t,i)}onFlowBoxChildRemoved(e){const t=this._cellMap.get(e);this._cellMap.delete(e),this._constraint.removeCell(t),t.dispose()}onFlowBoxChildrenReordered(e,t){this._constraint.reorderCells(this._children.slice(e,t+1).map(e=>this._cellMap.get(e)),e,t)}onFlowBoxChildrenChanged(){this._constraint.updateLayoutAutomatically()}getCell(e){const t=this._cellMap.get(e);return t}get orientation(){return this._constraint.orientation}set orientation(e){this._constraint.orientation=e}get spacing(){return this._constraint.spacing}set spacing(e){this._constraint.spacing=e}get lineSpacing(){return this._constraint.lineSpacing}set lineSpacing(e){this._constraint.lineSpacing=e}get justify(){return this._constraint.justify}set justify(e){this._constraint.justify=e}get justifyLines(){return this._constraint.justifyLines}set justifyLines(e){this._constraint.justifyLines=e}get wrap(){return this._constraint.wrap}set wrap(e){this._constraint.wrap=e}get align(){return this._constraint.align}set align(e){this._constraint.align=e}get stretch(){return this._constraint.stretch}set stretch(e){this._constraint.stretch=e}get grow(){return this._constraint.grow}set grow(e){this._constraint.grow=e}get margin(){return this._constraint.margin}set margin(e){this._constraint.margin=e}get xMargin(){return this._constraint.xMargin}set xMargin(e){this._constraint.xMargin=e}get yMargin(){return this._constraint.yMargin}set yMargin(e){this._constraint.yMargin=e}get leftMargin(){return this._constraint.leftMargin}set leftMargin(e){this._constraint.leftMargin=e}get rightMargin(){return this._constraint.rightMargin}set rightMargin(e){this._constraint.rightMargin=e}get topMargin(){return this._constraint.topMargin}set topMargin(e){this._constraint.topMargin=e}get bottomMargin(){return this._constraint.bottomMargin}set bottomMargin(e){this._constraint.bottomMargin=e}get minContentWidth(){return this._constraint.minContentWidth}set minContentWidth(e){this._constraint.minContentWidth=e}get minContentHeight(){return this._constraint.minContentHeight}set minContentHeight(e){this._constraint.minContentHeight=e}get maxContentWidth(){return this._constraint.maxContentWidth}set maxContentWidth(e){this._constraint.maxContentWidth=e}get maxContentHeight(){return this._constraint.maxContentHeight}set maxContentHeight(e){this._constraint.maxContentHeight=e}dispose(){this._constraint.lock(),this.childInsertedEmitter.removeListener(this.onChildInserted),this.childRemovedEmitter.removeListener(this.onChildRemoved),this.childrenReorderedEmitter.removeListener(this.onChildrenReordered),this.childrenChangedEmitter.removeListener(this.onChildrenChanged);for(const e of this._cellMap.values())e.dispose();super.dispose()}setOrientation(e){return this.orientation=e,this}getOrientation(){return this.orientation}setSpacing(e){return this.spacing=e,this}getSpacing(){return this.spacing}setAlign(e){return this.align=e,this}getAlign(){return this.align}setResize(e){return this.resize=e,this}isResize(){return this.resize}getHelperNode(){return ch.createHelperNode(this.constraint.displayedCells,this.constraint.layoutBoundsProperty.value,e=>{let t="";const i=Na.Z.fromLayoutOrientation(e.orientation);return t+=`align: ${ja.internalToAlign(i,e.effectiveAlign)}\n`,t+=`stretch: ${e.effectiveStretch}\n`,t+=`grow: ${e.effectiveGrow}\n`,t})}mutate(e){return super.mutate(e)}}_defineProperty(Sh,"DEFAULT_FLOW_BOX_OPTIONS",Qh),Sh.prototype._mutatorKeys=[...cn,...Gh,...Zs.prototype._mutatorKeys],W.register("FlowBox",Sh);const Th=["xAlign","yAlign","stretch","xStretch","yStretch","grow","xGrow","yGrow"].concat(Mh),xh=_s(e=>class extends(wh(e)){constructor(){super(...arguments),_defineProperty(this,"_xAlign",null),_defineProperty(this,"_yAlign",null),_defineProperty(this,"_xStretch",null),_defineProperty(this,"_yStretch",null),_defineProperty(this,"_xGrow",null),_defineProperty(this,"_yGrow",null)}mutateConfigurable(e){super.mutateConfigurable(e),(0,ln.Z)(e,["stretch"],["xStretch","yStretch"]),(0,ln.Z)(e,["grow"],["xGrow","yGrow"]),ur(this,Th,e)}setConfigToBaseDefault(){this._xAlign=ja.CENTER,this._yAlign=ja.CENTER,this._xStretch=!1,this._yStretch=!1,this._xGrow=0,this._yGrow=0,super.setConfigToBaseDefault()}setConfigToInherit(){this._xAlign=null,this._yAlign=null,this._xStretch=null,this._yStretch=null,this._xGrow=null,this._yGrow=null,super.setConfigToInherit()}get xAlign(){const e=null===this._xAlign?null:this._xAlign.horizontal;return e}set xAlign(e){const t=ja.horizontalAlignToInternal(e);this._xAlign!==t&&(this._xAlign=t,this.changedEmitter.emit())}get yAlign(){const e=null===this._yAlign?null:this._yAlign.vertical;return e}set yAlign(e){const t=ja.verticalAlignToInternal(e);this._yAlign!==t&&(this._yAlign=t,this.changedEmitter.emit())}get grow(){return this._xGrow}set grow(e){this._xGrow===e&&this._yGrow===e||(this._xGrow=e,this._yGrow=e,this.changedEmitter.emit())}get xGrow(){return this._xGrow}set xGrow(e){this._xGrow!==e&&(this._xGrow=e,this.changedEmitter.emit())}get yGrow(){return this._yGrow}set yGrow(e){this._yGrow!==e&&(this._yGrow=e,this.changedEmitter.emit())}get stretch(){return this._xStretch}set stretch(e){this._xStretch===e&&this._yStretch===e||(this._xStretch=e,this._yStretch=e,this.changedEmitter.emit())}get xStretch(){return this._xStretch}set xStretch(e){this._xStretch!==e&&(this._xStretch=e,this.changedEmitter.emit())}get yStretch(){return this._yStretch}set yStretch(e){this._yStretch!==e&&(this._yStretch=e,this.changedEmitter.emit())}});W.register("GridConfigurable",xh);const kh=xh;class Fh extends(kh(ch)){constructor(e,t,i){super(e,t,i),this.gridConstraint=e,this.setOptions(t.layoutOptions),this.onLayoutOptionsChange()}get effectiveXAlign(){return null!==this._xAlign?this._xAlign:this.gridConstraint._xAlign}get effectiveYAlign(){return null!==this._yAlign?this._yAlign:this.gridConstraint._yAlign}getEffectiveAlign(e){return e===Na.Z.HORIZONTAL?this.effectiveXAlign:this.effectiveYAlign}get effectiveXGrow(){return null!==this._xGrow?this._xGrow:this.gridConstraint._xGrow}get effectiveYGrow(){return null!==this._yGrow?this._yGrow:this.gridConstraint._yGrow}getEffectiveGrow(e){return e===Na.Z.HORIZONTAL?this.effectiveXGrow:this.effectiveYGrow}get effectiveXStretch(){return null!==this._xStretch?this._xStretch:this.gridConstraint._xStretch}get effectiveYStretch(){return null!==this._yStretch?this._yStretch:this.gridConstraint._yStretch}getEffectiveStretch(e){return e===Na.Z.HORIZONTAL?this.effectiveXStretch:this.effectiveYStretch}onLayoutOptionsChange(){this.setOptions(this.node.layoutOptions),super.onLayoutOptionsChange()}setOptions(e){const t=(0,Ce.ZP)()({column:0,row:0,horizontalSpan:1,verticalSpan:1},e);this.setConfigToInherit(),this.position=new gh(t.column,t.row),this.size=new gh(t.horizontalSpan,t.verticalSpan),this.mutateConfigurable(t)}containsIndex(e,t){const i=this.position.get(e),s=this.size.get(e);return t>=i&&t<i+s}containsRow(e){return this.containsIndex(Na.Z.VERTICAL,e)}containsColumn(e){return this.containsIndex(Na.Z.HORIZONTAL,e)}getIndices(e){const t=this.position.get(e),i=this.size.get(e);return _.range(t,t+i)}}W.register("GridCell",Fh);class Rh extends ph{constructor(e,t,i){super(),this.initialize(e,t,i)}initialize(e,t,i){return this.index=e,this.cells=t,this.grow=i,this.initializeLayoutLine(),this}freeToPool(){Rh.pool.freeToPool(this)}clean(){this.cells.length=0,this.freeToPool()}}x=Rh,_defineProperty(Rh,"pool",new ti.Z(x,{defaultArguments:[0,[],0]})),W.register("GridLine",Rh);const Uh=[...Th,"excludeInvisible","spacing","xSpacing","ySpacing"];class Lh extends(kh(Vh)){constructor(e,t){super(e,t),_defineProperty(this,"cells",new Set),_defineProperty(this,"displayedCells",[]),_defineProperty(this,"displayedLines",new gh(new Map,new Map)),_defineProperty(this,"_spacing",new gh(0,0)),this.setConfigToBaseDefault(),this.mutateConfigurable(t),ur(this,Uh,t),this.changedEmitter.addListener(this._updateLayoutListener)}layout(){super.layout();const e=this.filterLayoutCells([...this.cells]);if(this.displayedCells=e,!e.length)return this.layoutBoundsProperty.value=Ue.Z.NOTHING,this.minimumWidthProperty.value=null,this.minimumHeightProperty.value=null,void this.displayedLines.forEach(e=>e.clear());const t=new gh(0,0),i=new gh(this.preferredWidthProperty.value,this.preferredHeightProperty.value),s=new Ue.Z(0,0,0,0);[Na.Z.HORIZONTAL,Na.Z.VERTICAL].forEach(n=>{const r=this._spacing.get(n),o=this.displayedLines.get(n);o.forEach(e=>e.clean()),o.clear();const A=_.sortedUniq(_.sortBy(_.flatten(e.map(e=>e.getIndices(n))))).map(t=>{const i=_.filter(e,e=>e.containsIndex(n,t)),s=Math.max(...i.map(e=>e.getEffectiveGrow(n))),r=Rh.pool.create(t,i,s);return o.set(t,r),r}),a=A.slice(0,-1).map(e=>"number"==typeof r?r:r[e.index]);e.forEach(e=>{if(1===e.size.get(n)){const t=o.get(e.position.get(n));if(t.min=Math.max(t.min,e.getMinimumSize(n)),t.max=Math.min(t.max,e.getMaximumSize(n)),e.getEffectiveAlign(n)===ja.ORIGIN){const i=e.getOriginBounds();t.minOrigin=Math.min(i[n.minCoordinate],t.minOrigin),t.maxOrigin=Math.max(i[n.maxCoordinate],t.maxOrigin)}}}),e.forEach(e=>{if(e.size.get(n)>1){const t=e.getIndices(n).map(e=>o.get(e)),i=_.sum(t.map(e=>e.min)),s=e.getMinimumSize(n);if(s>i){const e=(s-i)/t.length;t.forEach(t=>{t.min+=e})}}}),A.forEach(e=>{e.hasOrigin()?e.size=Math.max(e.min,e.maxOrigin-e.minOrigin):e.size=e.min});const h=_.sum(A.map(e=>e.size))+_.sum(a);t.set(n,h);const l=Math.max(h,i.get(n)||0);let g,c=l-h;for(;c>1e-7&&(g=A.filter(e=>e.grow>0&&e.size<e.max-1e-7)).length;){const e=_.sum(g.map(e=>e.grow)),t=Math.min(Math.min(...g.map(e=>(e.max-e.size)/e.grow)),c/e);g.forEach(e=>{e.size+=t*e.grow}),c-=t*e}const d=(A[0].hasOrigin()?A[0].minOrigin:0)+this.layoutOriginProperty.value[n.coordinate];s[n.minCoordinate]=d,s[n.maxCoordinate]=d+l,A.forEach((e,t)=>{const i=_.sum(A.slice(0,t).map(e=>e.size)),s=_.sum(a.slice(0,t));e.position=d+i+s}),e.forEach(e=>{const t=e.position.get(n),i=e.size.get(n),r=t+i-1,h=e.getIndices(n).map(e=>o.get(e)),l=o.get(t);let g=0;t!==r&&A.slice(0,-1).forEach((e,i)=>{e.index>=t&&e.index<r&&(g+=a[i])});const c=_.sum(h.map(e=>e.size))+g,d=l.position,u=e.reposition(n,c,d,e.getEffectiveStretch(n),-l.minOrigin,e.getEffectiveAlign(n));s[n.minCoordinate]=Math.min(s[n.minCoordinate],u[n.minCoordinate]),s[n.maxCoordinate]=Math.max(s[n.maxCoordinate],u[n.maxCoordinate])})}),this.layoutBoundsProperty.value=s,this.minimumWidthProperty.value=t.horizontal,this.minimumHeightProperty.value=t.vertical,this.finishedLayoutEmitter.emit()}get spacing(){return this.xSpacing}set spacing(e){this._spacing.get(Na.Z.HORIZONTAL)===e&&this._spacing.get(Na.Z.VERTICAL)===e||(this._spacing.set(Na.Z.HORIZONTAL,e),this._spacing.set(Na.Z.VERTICAL,e),this.updateLayoutAutomatically())}get xSpacing(){return this._spacing.get(Na.Z.HORIZONTAL)}set xSpacing(e){this._spacing.get(Na.Z.HORIZONTAL)!==e&&(this._spacing.set(Na.Z.HORIZONTAL,e),this.updateLayoutAutomatically())}get ySpacing(){return this._spacing.get(Na.Z.VERTICAL)}set ySpacing(e){this._spacing.get(Na.Z.VERTICAL)!==e&&(this._spacing.set(Na.Z.VERTICAL,e),this.updateLayoutAutomatically())}addCell(e){this.cells.add(e),this.addNode(e.node),e.changedEmitter.addListener(this._updateLayoutListener),this.updateLayoutAutomatically()}removeCell(e){this.cells.delete(e),this.removeNode(e.node),e.changedEmitter.removeListener(this._updateLayoutListener),this.updateLayoutAutomatically()}dispose(){this.lock(),[...this.cells].forEach(e=>this.removeCell(e)),this.displayedLines.forEach(e=>e.clear()),this.displayedCells=[],super.dispose(),this.unlock()}getIndices(e){const t=[];return this.cells.forEach(i=>{t.push(...i.getIndices(e))}),_.sortedUniq(_.sortBy(t))}getCell(e,t){return _.find([...this.cells],i=>i.containsRow(e)&&i.containsColumn(t))||null}getCellFromNode(e){return _.find([...this.cells],t=>t.node===e)||null}getCells(e,t){return _.filter([...this.cells],i=>i.containsIndex(e,t))}static create(e,t){return new Lh(e,t)}}W.register("GridConstraint",Lh);const Ph=[...uh,...Uh.filter(e=>"excludeInvisible"!==e),"rows","columns","autoRows","autoColumns"];class bh extends mh{constructor(e){const t=(0,Ce.ZP)()({excludeInvisibleChildrenFromBounds:!0,resize:!0},e);super(),_defineProperty(this,"_cellMap",new Map),_defineProperty(this,"_autoRows",null),_defineProperty(this,"_autoColumns",null),_defineProperty(this,"_autoLockCount",0),this._constraint=new Lh(this,{preferredWidthProperty:this.localPreferredWidthProperty,preferredHeightProperty:this.localPreferredHeightProperty,minimumWidthProperty:this.localMinimumWidthProperty,minimumHeightProperty:this.localMinimumHeightProperty,layoutOriginProperty:this.layoutOriginProperty,excludeInvisible:!1}),this.onChildInserted=this.onGridBoxChildInserted.bind(this),this.onChildRemoved=this.onGridBoxChildRemoved.bind(this),this.onChildVisibilityToggled=this.updateAllAutoLines.bind(this),this.childInsertedEmitter.addListener(this.onChildInserted),this.childRemovedEmitter.addListener(this.onChildRemoved);const i=_.omit(t,Us),s=_.pick(t,Us);this._constraint.lock(),this.mutate(i),this._constraint.unlock(),this._constraint.updateLayout(),this.mutate(s),this.linkLayoutBounds()}setLines(e,t){const i=[];for(let s=0;s<t.length;s++){const n=t[s];for(let t=0;t<n.length;t++){const r=n[t];null!==r&&(i.push(r),r.mutateLayoutOptions({[e.line]:s,[e.opposite.line]:t}))}}this.children=i}getLines(e){const t=[];for(const i of this._cellMap.values()){const s=i.position.get(e),n=i.position.get(e.opposite);for(;t.length<s+1;)t.push([]);for(;t[s].length<n+1;)t[s].push(null);t[s][n]=i.node}return t}set rows(e){this.setLines(Na.Z.VERTICAL,e)}get rows(){return this.getLines(Na.Z.VERTICAL)}set columns(e){this.setLines(Na.Z.HORIZONTAL,e)}get columns(){return this.getLines(Na.Z.HORIZONTAL)}getNodeAt(e,t){const i=this.constraint.getCell(e,t);return i?i.node:null}getRowOfNode(e){return this.constraint.getCellFromNode(e).position.vertical}getColumnOfNode(e){return this.constraint.getCellFromNode(e).position.horizontal}getNodesInRow(e){return this.constraint.getCells(Na.Z.VERTICAL,e).map(e=>e.node)}getNodesInColumn(e){return this.constraint.getCells(Na.Z.HORIZONTAL,e).map(e=>e.node)}addRow(e){return this.rows=[...this.rows,e],this}addColumn(e){return this.columns=[...this.columns,e],this}insertRow(e,t){return this.rows=[...this.rows.slice(0,e),t,...this.rows.slice(e)],this}insertColumn(e,t){return this.columns=[...this.columns.slice(0,e),t,...this.columns.slice(e)],this}removeRow(e){return this.rows=[...this.rows.slice(0,e),...this.rows.slice(e+1)],this}removeColumn(e){return this.columns=[...this.columns.slice(0,e),...this.columns.slice(e+1)],this}set autoRows(e){this._autoRows!==e&&(this._autoRows=e,this.updateAutoRows())}get autoRows(){return this._autoRows}set autoColumns(e){this._autoColumns!==e&&(this._autoColumns=e,this.updateAutoColumns())}get autoColumns(){return this._autoColumns}updateAutoLines(e,t){if(null!==t&&0===this._autoLockCount){let i=0;this.constraint.lock(),this.children.filter(e=>e.bounds.isValid()&&(!this._constraint.excludeInvisible||e.visible)).forEach((s,n)=>{const r=n%t,o=Math.floor(n/t);s.layoutOptions&&s.layoutOptions[e.line]===r&&s.layoutOptions[e.opposite.line]===o&&1===s.layoutOptions.horizontalSpan&&1===s.layoutOptions.verticalSpan||(i++,s.mutateLayoutOptions({[e.line]:n%t,[e.opposite.line]:Math.floor(n/t),horizontalSpan:1,verticalSpan:1}))}),this.constraint.unlock(),i>0&&this.constraint.updateLayoutAutomatically()}}updateAutoRows(){this.updateAutoLines(Na.Z.VERTICAL,this.autoRows)}updateAutoColumns(){this.updateAutoLines(Na.Z.HORIZONTAL,this.autoColumns)}updateAllAutoLines(){this.updateAutoRows(),this.updateAutoColumns()}setChildren(e){const t=this.getChildren();return this._autoLockCount++,super.setChildren(e),this._autoLockCount--,_.isEqual(t,e)||this.updateAllAutoLines(),this}onGridBoxChildInserted(e,t){e.visibleProperty.lazyLink(this.onChildVisibilityToggled);const i=new Fh(this._constraint,e,this._constraint.createLayoutProxy(e));this._cellMap.set(e,i),this._constraint.addCell(i),this.updateAllAutoLines()}onGridBoxChildRemoved(e){const t=this._cellMap.get(e);this._cellMap.delete(e),this._constraint.removeCell(t),t.dispose(),this.updateAllAutoLines(),e.visibleProperty.unlink(this.onChildVisibilityToggled)}mutate(e){return(0,ln.Z)(e,["rows"],["columns"],["children","autoRows","autoColumns"]),super.mutate(e)}get spacing(){return this._constraint.spacing}set spacing(e){this._constraint.spacing=e}get xSpacing(){return this._constraint.xSpacing}set xSpacing(e){this._constraint.xSpacing=e}get ySpacing(){return this._constraint.ySpacing}set ySpacing(e){this._constraint.ySpacing=e}get xAlign(){return this._constraint.xAlign}set xAlign(e){this._constraint.xAlign=e}get yAlign(){return this._constraint.yAlign}set yAlign(e){this._constraint.yAlign=e}get grow(){return this._constraint.grow}set grow(e){this._constraint.grow=e}get xGrow(){return this._constraint.xGrow}set xGrow(e){this._constraint.xGrow=e}get yGrow(){return this._constraint.yGrow}set yGrow(e){this._constraint.yGrow=e}get stretch(){return this._constraint.stretch}set stretch(e){this._constraint.stretch=e}get xStretch(){return this._constraint.xStretch}set xStretch(e){this._constraint.xStretch=e}get yStretch(){return this._constraint.yStretch}set yStretch(e){this._constraint.yStretch=e}get margin(){return this._constraint.margin}set margin(e){this._constraint.margin=e}get xMargin(){return this._constraint.xMargin}set xMargin(e){this._constraint.xMargin=e}get yMargin(){return this._constraint.yMargin}set yMargin(e){this._constraint.yMargin=e}get leftMargin(){return this._constraint.leftMargin}set leftMargin(e){this._constraint.leftMargin=e}get rightMargin(){return this._constraint.rightMargin}set rightMargin(e){this._constraint.rightMargin=e}get topMargin(){return this._constraint.topMargin}set topMargin(e){this._constraint.topMargin=e}get bottomMargin(){return this._constraint.bottomMargin}set bottomMargin(e){this._constraint.bottomMargin=e}get minContentWidth(){return this._constraint.minContentWidth}set minContentWidth(e){this._constraint.minContentWidth=e}get minContentHeight(){return this._constraint.minContentHeight}set minContentHeight(e){this._constraint.minContentHeight=e}get maxContentWidth(){return this._constraint.maxContentWidth}set maxContentWidth(e){this._constraint.maxContentWidth=e}get maxContentHeight(){return this._constraint.maxContentHeight}set maxContentHeight(e){this._constraint.maxContentHeight=e}setExcludeInvisibleChildrenFromBounds(e){super.setExcludeInvisibleChildrenFromBounds(e),this.updateAllAutoLines()}dispose(){this._constraint.lock(),this.childInsertedEmitter.removeListener(this.onChildInserted),this.childRemovedEmitter.removeListener(this.onChildRemoved);for(const e of this._cellMap.values())e.dispose(),e.node.visibleProperty.unlink(this.onChildVisibilityToggled);super.dispose()}getHelperNode(){return ch.createHelperNode(this.constraint.displayedCells,this.constraint.layoutBoundsProperty.value,e=>{let t="";return t+=`row: ${e.position.vertical}\n`,t+=`column: ${e.position.horizontal}\n`,e.size.horizontal>1&&(t+=`horizontalSpan: ${e.size.horizontal}\n`),e.size.vertical>1&&(t+=`verticalSpan: ${e.size.vertical}\n`),t+=`xAlign: ${ja.internalToAlign(Na.Z.HORIZONTAL,e.effectiveXAlign)}\n`,t+=`yAlign: ${ja.internalToAlign(Na.Z.VERTICAL,e.effectiveYAlign)}\n`,t+=`xStretch: ${e.effectiveXStretch}\n`,t+=`yStretch: ${e.effectiveYStretch}\n`,t+=`xGrow: ${e.effectiveXGrow}\n`,t+=`yGrow: ${e.effectiveYGrow}\n`,t})}}bh.prototype._mutatorKeys=[...cn,...Ph,...Zs.prototype._mutatorKeys],W.register("GridBox",bh);W.register("GridBackgroundNode",class extends Zs{constructor(e,t){(0,ln.Z)(t,["createCellBackground"],["fill","stroke"]);const i=(0,Ce.ZP)()({fill:"white",stroke:"black",createCellBackground:e=>rr.bounds(e.lastAvailableBounds,{fill:i.fill,stroke:i.stroke})},t);super(),this.constraint=e,this.createCellBackground=i.createCellBackground,this.layoutListener=this.update.bind(this),this.constraint.finishedLayoutEmitter.addListener(this.layoutListener),this.update(),this.mutate(i)}update(){this.children=this.constraint.displayedCells.map(this.createCellBackground).filter(_.identity)}dispose(){this.constraint.finishedLayoutEmitter.removeListener(this.layoutListener),super.dispose()}});class Oh extends oh{constructor(e,t,i){super(e),this.lock(),this.nodes=t,this.cells=t.map(e=>new Ah(this,e,null)),this.layoutCallback=i,this.nodes.forEach(e=>this.addNode(e,!1)),this.unlock(),this.updateLayout()}layout(){if(super.layout(),!_.some(this.cells,e=>!e.isConnected())){const e=this.cells.map(e=>e.proxy);this.layoutCallback.apply(null,e),this.finishedLayoutEmitter.emit()}}dispose(){this.cells.forEach(e=>e.dispose()),super.dispose()}static create(e,t,i){return new Oh(e,t,i)}}W.register("ManualConstraint",Oh);class fh extends oh{constructor(e,t,i){super(e),this.lock(),this.nodes=t,this.cells=t.map(e=>new Ah(this,e,null)),this.layoutCallback=i,this.nodes.forEach(e=>this.addNode(e,!1)),this.unlock(),this.updateLayout()}layout(){super.layout();const e=this.cells.map(e=>e.isConnected()?e.proxy:null);this.layoutCallback.apply(null,e),this.finishedLayoutEmitter.emit()}dispose(){this.cells.forEach(e=>e.dispose()),super.dispose()}static create(e,t,i){return new fh(e,t,i)}}W.register("RelaxedManualConstraint",fh);var Zh=i(9969);const Nh=un(Zs);class Kh extends Nh{constructor(e,t){const i=(0,Ce.ZP)()({children:[e]},t);super({sizable:!1}),_defineProperty(this,"_xSet",!1),_defineProperty(this,"_ySet",!1),_defineProperty(this,"_contentBoundsListener",_.noop),this._content=e,this._alignBounds=null,this._xAlign="center",this._yAlign="center",this._leftMargin=0,this._rightMargin=0,this._topMargin=0,this._bottomMargin=0,this._group=null,this._contentBoundsListener=this.invalidateAlignment.bind(this),this._alignBoundsProperty=null,this._alignBoundsPropertyListener=_.noop,(0,ln.Z)(i,["alignBounds"],["alignBoundsProperty"]),null!=t&&t.alignBoundsProperty&&(this._alignBoundsProperty=t.alignBoundsProperty,i.alignBounds=this._alignBoundsProperty.value,this._alignBoundsPropertyListener=e=>{this.alignBounds=e},this._alignBoundsProperty.lazyLink(this._alignBoundsPropertyListener)),this.localBounds=new Ue.Z(0,0,0,0),this.constraint=new Jh(this,e),this._content.boundsProperty.link(this._contentBoundsListener),this.mutate(i),Zh.Z.multilink([this.localPreferredWidthProperty,this.localPreferredHeightProperty],(e,t)=>{if(null!==e||null!==t){const i=this._alignBounds||new Ue.Z(0,0,0,0);e&&(i.minX=0,i.maxX=e,this._xSet=!0),t&&(i.minY=0,i.maxY=t,this._ySet=!0),this._alignBounds=i,this.constraint.updateLayout()}})}invalidateAlignment(){this._group&&this._group.onAlignBoxResized(this),this.constraint.updateLayout()}setAlignBounds(e){return this._xSet=!0,this._ySet=!0,this._alignBounds===e||e&&this._alignBounds&&e.equals(this._alignBounds)||(this._alignBounds=e,this.constraint.updateLayout()),this}set alignBounds(e){this.setAlignBounds(e)}get alignBounds(){return this.getAlignBounds()}getAlignBounds(){return this._alignBounds}setGroup(e){return this._group!==e&&(this._group&&this._group.removeAlignBox(this),this._group=e,this._group&&this._group.addAlignBox(this)),this}set group(e){this.setGroup(e)}get group(){return this.getGroup()}getGroup(){return this._group}setXAlign(e){return this._xAlign!==e&&(this._xAlign=e,this.invalidateAlignment()),this}set xAlign(e){this.setXAlign(e)}get xAlign(){return this.getXAlign()}getXAlign(){return this._xAlign}setYAlign(e){return this._yAlign!==e&&(this._yAlign=e,this.invalidateAlignment()),this}set yAlign(e){this.setYAlign(e)}get yAlign(){return this.getYAlign()}getYAlign(){return this._yAlign}setMargin(e){return this._leftMargin===e&&this._rightMargin===e&&this._topMargin===e&&this._bottomMargin===e||(this._leftMargin=this._rightMargin=this._topMargin=this._bottomMargin=e,this.invalidateAlignment()),this}set margin(e){this.setMargin(e)}get margin(){return this.getMargin()}getMargin(){return this._leftMargin}setXMargin(e){return this._leftMargin===e&&this._rightMargin===e||(this._leftMargin=this._rightMargin=e,this.invalidateAlignment()),this}set xMargin(e){this.setXMargin(e)}get xMargin(){return this.getXMargin()}getXMargin(){return this._leftMargin}setYMargin(e){return this._topMargin===e&&this._bottomMargin===e||(this._topMargin=this._bottomMargin=e,this.invalidateAlignment()),this}set yMargin(e){this.setYMargin(e)}get yMargin(){return this.getYMargin()}getYMargin(){return this._topMargin}setLeftMargin(e){return this._leftMargin!==e&&(this._leftMargin=e,this.invalidateAlignment()),this}set leftMargin(e){this.setLeftMargin(e)}get leftMargin(){return this.getLeftMargin()}getLeftMargin(){return this._leftMargin}setRightMargin(e){return this._rightMargin!==e&&(this._rightMargin=e,this.invalidateAlignment()),this}set rightMargin(e){this.setRightMargin(e)}get rightMargin(){return this.getRightMargin()}getRightMargin(){return this._rightMargin}setTopMargin(e){return this._topMargin!==e&&(this._topMargin=e,this.invalidateAlignment()),this}set topMargin(e){this.setTopMargin(e)}get topMargin(){return this.getTopMargin()}getTopMargin(){return this._topMargin}setBottomMargin(e){return this._bottomMargin!==e&&(this._bottomMargin=e,this.invalidateAlignment()),this}set bottomMargin(e){this.setBottomMargin(e)}get bottomMargin(){return this.getBottomMargin()}getBottomMargin(){return this._bottomMargin}getContent(){return this._content}get content(){return this.getContent()}getContentBounds(){const e=this._content.bounds;return new Ue.Z(e.left-this._leftMargin,e.top-this._topMargin,e.right+this._rightMargin,e.bottom+this._bottomMargin)}setAdjustedLocalBounds(e){if(this._xSet&&this._ySet)this.localBounds=e;else if(this._xSet){const t=this.getContentBounds();this.localBounds=new Ue.Z(e.minX,t.minY,e.maxX,t.maxY)}else if(this._ySet){const t=this.getContentBounds();this.localBounds=new Ue.Z(t.minX,e.minY,t.maxX,e.maxY)}else this.localBounds=this.getContentBounds()}dispose(){this._alignBoundsProperty&&this._alignBoundsProperty.unlink(this._alignBoundsPropertyListener),this._content.boundsProperty.unlink(this._contentBoundsListener),this._content=new Zs,this.group=null,this.constraint.dispose(),super.dispose()}mutate(e){return super.mutate(e)}}class Jh extends oh{constructor(e,t){super(e),this.alignBox=e,this.content=t,this.addNode(t),e.isWidthResizableProperty.lazyLink(this._updateLayoutListener),e.isHeightResizableProperty.lazyLink(this._updateLayoutListener)}updateProperty(e,t){const i=this.content[e],s=this.alignBox.localBounds[e]+t;Math.abs(i-s)>1e-5&&(this.content[e]=s)}layout(){super.layout();const e=this.alignBox,t=this.content;if(!t.bounds.isValid())return;const i=e.leftMargin+e.rightMargin,s=e.topMargin+e.bottomMargin;if(null!==e.alignBounds)e.setAdjustedLocalBounds(e.alignBounds);else{const n=t.width+i,r=t.height+s;e.setAdjustedLocalBounds(new Ue.Z(0,0,n,r))}const n=isFinite(t.width)?(tn(t)?t.minimumWidth||0:t.width)+i:null,r=isFinite(t.height)?(An(t)?t.minimumHeight||0:t.height)+s:null;t.localBounds.isEmpty()||("center"===e.xAlign?this.updateProperty("centerX",(e.leftMargin-e.rightMargin)/2):"left"===e.xAlign?this.updateProperty("left",e.leftMargin):"right"===e.xAlign?this.updateProperty("right",-e.rightMargin):"stretch"===e.xAlign&&(t.preferredWidth=e.localWidth-e.leftMargin-e.rightMargin,this.updateProperty("left",e.leftMargin)),"center"===e.yAlign?this.updateProperty("centerY",(e.topMargin-e.bottomMargin)/2):"top"===e.yAlign?this.updateProperty("top",e.topMargin):"bottom"===e.yAlign?this.updateProperty("bottom",-e.bottomMargin):"stretch"===e.yAlign&&(t.preferredHeight=e.localHeight-e.topMargin-e.bottomMargin,this.updateProperty("top",e.topMargin))),e.localMinimumWidth=e.widthSizable?n:e.localWidth,e.localMinimumHeight=e.heightSizable?r:e.localHeight}}Kh.prototype._mutatorKeys=["alignBounds","xAlign","yAlign","margin","xMargin","yMargin","leftMargin","rightMargin","topMargin","bottomMargin","group"].concat(Nh.prototype._mutatorKeys),W.register("AlignBox",Kh);var jh=i(8036),vh=i(1731);let Hh=1;const Wh={matchHorizontal:!0,matchVertical:!0};class zh extends vh.Z{constructor(e){const t=(0,Ce.lB)()({},Wh,e);super(t),this._alignBoxes=[],this._matchHorizontal=t.matchHorizontal,this._matchVertical=t.matchVertical,this._resizeLock=!1,this._maxWidthProperty=new jh.Z(0),this._maxHeightProperty=new jh.Z(0),this.id=Hh++}getMaxWidth(){return this._maxWidthProperty.value}get maxWidth(){return this.getMaxWidth()}getMaxWidthProperty(){return this._maxWidthProperty}get maxWidthProperty(){return this.getMaxWidthProperty()}getMaxHeight(){return this._maxHeightProperty.value}get maxHeight(){return this.getMaxHeight()}getMaxHeightProperty(){return this._maxHeightProperty}get maxHeightProperty(){return this.getMaxHeightProperty()}getMaxSizeProperty(e){return e===Na.Z.HORIZONTAL?this._maxWidthProperty:this._maxHeightProperty}createBox(e,t){return new Kh(e,(0,Ce.JA)({group:this},t))}setMatchHorizontal(e){return this._matchHorizontal!==e&&(this._matchHorizontal=e,this.updateLayout()),this}set matchHorizontal(e){this.setMatchHorizontal(e)}get matchHorizontal(){return this.getMatchHorizontal()}getMatchHorizontal(){return this._matchHorizontal}setMatchVertical(e){return this._matchVertical!==e&&(this._matchVertical=e,this.updateLayout()),this}set matchVertical(e){this.setMatchVertical(e)}get matchVertical(){return this.getMatchVertical()}getMatchVertical(){return this._matchVertical}updateLayout(){if(this._resizeLock)return;this._resizeLock=!0;let e=0,t=0;for(let i=0;i<this._alignBoxes.length;i++){const s=this._alignBoxes[i].getContentBounds();!s.isEmpty()&&s.isFinite()&&(e=Math.max(e,s.width),t=Math.max(t,s.height))}if(this._maxWidthProperty.value=e,this._maxHeightProperty.value=t,e>0&&t>0)for(let i=0;i<this._alignBoxes.length;i++)this.setBoxBounds(this._alignBoxes[i],e,t);this._resizeLock=!1}setBoxBounds(e,t,i){let s;if(this._matchVertical&&this._matchHorizontal)s=new Ue.Z(0,0,t,i);else{const n=e.getContentBounds();s=this._matchVertical?new Ue.Z(0,0,isFinite(n.width)?n.width:t,i):this._matchHorizontal?new Ue.Z(0,0,t,isFinite(n.height)?n.height:i):n}e.alignBounds=s}onAlignBoxResized(e){this.updateLayout()}addAlignBox(e){this._alignBoxes.push(e),this.updateLayout()}removeAlignBox(e){(0,Oi.Z)(this._alignBoxes,e),this.updateLayout()}dispose(){for(let e=this._alignBoxes.length-1;e>=0;e--)this._alignBoxes[e].dispose();super.dispose()}}W.register("AlignGroup",zh);class Xh extends Sh{constructor(e){super((0,Ce.ZP)()({orientation:"horizontal"},e))}onFlowBoxChildInserted(e,t){super.onFlowBoxChildInserted(e,t)}mutate(e){return super.mutate(e)}}W.register("HBox",Xh);class _h extends Sh{constructor(e){super((0,Ce.ZP)()({orientation:"vertical"},e))}onFlowBoxChildInserted(e,t){super.onFlowBoxChildInserted(e,t)}mutate(e){return super.mutate(e)}}W.register("VBox",_h);const $h=e=>"element"===e.type.toLowerCase(),el=e=>"text"===e.type.toLowerCase(),tl={scratchText:new zn(""),himalayaGetAttribute(e,t){if(!t)return null;const i=_.find(t.attributes,t=>t.key===e);return i&&i.value||null},himalayaStyleStringToMap(e){const t=e.split(";"),i={};return t.forEach(e=>{if(e.length>0){const t=e.split(":");i[t[0].trim()]=t[1].trim()}}),i}},il=tl;W.register("RichTextUtils",tl);const sl=_s(e=>class extends e{get isCleanable(){return!0}clean(){const e=this;for(let t=e._children.length-1;t>=0;t--){const i=e._children[t];e.removeChild(i),i.isCleanable&&i.clean()}e.matrix=Le.Z.IDENTITY,e.freeToPool()}});W.register("RichTextCleanable",sl);const nl=sl;class rl extends(nl(Zs)){constructor(e){super(),this.initialize(e)}initialize(e){return this.localBounds=new Ue.Z(0,0,0,e),this}freeToPool(){rl.pool.freeToPool(this)}}k=rl,_defineProperty(rl,"pool",new ti.Z(k)),W.register("RichTextVerticalSpacer",rl);const ol=rl;class Al extends(nl(Zs)){constructor(e){super(),this.initialize(e)}initialize(e){return this.isLTR=e,this.leftSpacing=0,this.rightSpacing=0,this}addElement(e){const t=this.children.length>0,i=e.width>0,s=e.getScaleVector().x,n=e.leftSpacing*s,r=e.rightSpacing*s;return!(!t&&!i)&&(t?i?(this.isLTR?(e.left=this.localRight+this.rightSpacing+n,this.rightSpacing=r):(e.right=this.localLeft-this.leftSpacing-r,this.leftSpacing=n),this.addChild(e),!0):(this.isLTR?this.rightSpacing+=n+r:this.leftSpacing+=n+r,!1):(this.isLTR?(e.left=0,this.leftSpacing=n,this.rightSpacing=r):(e.right=0,this.leftSpacing=n,this.rightSpacing=r),this.addChild(e),!0))}addExtraBeforeSpacing(e){this.isLTR?this.leftSpacing+=e:this.rightSpacing+=e}freeToPool(){Al.pool.freeToPool(this)}}F=Al,_defineProperty(Al,"pool",new ti.Z(F)),W.register("RichTextElement",Al);class al extends(nl(zn)){constructor(e,t,i,s,n,r,o){super(""),this.initialize(e,t,i,s,n,r,o)}initialize(e,t,i,s,n,r,o){let A="";for(;e.startsWith(" ");)A+=" ",e=e.slice(1);let a="";for(;e.endsWith(" ");)a=" ",e=e.slice(0,e.length-1);this.string=wl.contentToString(e,t),this.boundsMethod=s,this.font=i,this.fill=n,this.stroke=r,this.lineWidth=o;const h=A.length?il.scratchText.setString(A).setFont(i).width:0,l=a.length?il.scratchText.setString(a).setFont(i).width:0;return this.leftSpacing=t?h:l,this.rightSpacing=t?l:h,this}clean(){super.clean(),this.fill=null,this.stroke=null}fitsIn(e,t,i){return this.width+(t?i?this.leftSpacing:this.rightSpacing:0)<=e}freeToPool(){al.pool.freeToPool(this)}}R=al,_defineProperty(al,"pool",new ti.Z(R)),W.register("RichTextLeaf",al);class hl extends(nl(Zs)){constructor(e){super(),_defineProperty(this,"leftSpacing",0),_defineProperty(this,"rightSpacing",0),this.initialize(e)}initialize(e){return this.addChild(e),this}clean(){super.clean(),this.removeAllChildren()}fitsIn(e){return this.width<=e}freeToPool(){hl.pool.freeToPool(this)}}U=hl,_defineProperty(hl,"pool",new ti.Z(U)),W.register("RichTextNode",hl);class ll extends(Do(nl(Zs))){constructor(e,t){super(),_defineProperty(this,"fireListener",null),_defineProperty(this,"accessibleInputListener",null),_defineProperty(this,"allowLinksListener",null),this.initialize(e,t,!1),this.mutate({cursor:"pointer",tagName:"a"})}initialize(e,t){return(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&super.initialize(),this.innerContent=e,this.voicingNameResponse=e,"function"==typeof t?(this.fireListener=new ga({fire:t,tandem:Kt.Z.OPT_OUT}),this.addInputListener(this.fireListener),this.setPDOMAttribute("href","#"),this.setPDOMAttribute("target","_self"),this.accessibleInputListener={click:e=>{e.domEvent&&e.domEvent.preventDefault(),t()}},this.addInputListener(this.accessibleInputListener)):(this.fireListener=new ga({fire:e=>{e.isFromPDOM()&&e.domEvent.preventDefault(),self._linkEventsHandled&&e.handle(),Ht(t)},tandem:Kt.Z.OPT_OUT}),this.addInputListener(this.fireListener),this.setPDOMAttribute("href",t),this.setPDOMAttribute("target","_blank"),this.allowLinksListener=e=>{this.visible=e},jt.link(this.allowLinksListener)),this}clean(){super.clean(),this.fireListener&&(this.removeInputListener(this.fireListener),this.fireListener.dispose()),this.fireListener=null,this.accessibleInputListener&&(this.removeInputListener(this.accessibleInputListener),this.accessibleInputListener=null),this.allowLinksListener&&(jt.unlink(this.allowLinksListener),this.allowLinksListener=null)}freeToPool(){ll.pool.freeToPool(this)}}L=ll,_defineProperty(ll,"pool",new ti.Z(L)),W.register("RichTextLink",ll);i(6859);const gl=himalaya,cl=["boundsMethod","font","fill","stroke","lineWidth","subScale","subXSpacing","subYOffset","supScale","supXSpacing","supYOffset","capHeightScale","underlineLineWidth","underlineHeightScale","strikethroughLineWidth","strikethroughHeightScale","linkFill","linkEventsHandled","links","nodes","replaceNewlines","align","leading","lineWrap",zn.STRING_PROPERTY_NAME,"string"],dl=(window.QueryStringMachine&&QueryStringMachine.containsKey("stringTest"),new Ge({size:20})),ul=["b","strong","i","em","sub","sup","u","s"],ml="COMPLETE",pl="INCOMPLETE",Vl="NONE",Ml={"font-family":"family","font-size":"size","font-stretch":"stretch","font-style":"style","font-variant":"variant","font-weight":"weight","line-height":"lineHeight"},Bl=Object.keys(Ml);["color"].concat(Bl);class wl extends(nn(Zs)){constructor(e,t){const i=(0,Ce.ZP)()({fill:"#000000",tandemNameSuffix:"Text",phetioType:wl.RichTextIO,phetioVisiblePropertyInstrumented:!1},t);"string"==typeof e||"number"==typeof e?i.string=e:i.stringProperty=e,super(),_defineProperty(this,"_font",dl),_defineProperty(this,"_boundsMethod","hybrid"),_defineProperty(this,"_fill","#000000"),_defineProperty(this,"_stroke",null),_defineProperty(this,"_lineWidth",1),_defineProperty(this,"_subScale",.75),_defineProperty(this,"_subXSpacing",0),_defineProperty(this,"_subYOffset",0),_defineProperty(this,"_supScale",.75),_defineProperty(this,"_supXSpacing",0),_defineProperty(this,"_supYOffset",0),_defineProperty(this,"_capHeightScale",.75),_defineProperty(this,"_underlineLineWidth",1),_defineProperty(this,"_underlineHeightScale",.15),_defineProperty(this,"_strikethroughLineWidth",1),_defineProperty(this,"_strikethroughHeightScale",.3),_defineProperty(this,"_linkFill","rgb(27,0,241)"),_defineProperty(this,"_linkEventsHandled",!1),_defineProperty(this,"_links",{}),_defineProperty(this,"_nodes",{}),_defineProperty(this,"_replaceNewlines",!1),_defineProperty(this,"_align","left"),_defineProperty(this,"_leading",0),_defineProperty(this,"_lineWrap",null),_defineProperty(this,"_linkItems",[]),_defineProperty(this,"_hasAddedLeafToLine",!1),_defineProperty(this,"needPendingMinimumWidth",!1),_defineProperty(this,"pendingMinimumWidth",0),this._stringProperty=new Bs("",!0,this.onStringPropertyChange.bind(this)),this.lineContainer=new Zs({}),this.addChild(this.lineContainer),this.rebuildRichText(),this.localPreferredWidthProperty.lazyLink(()=>this.rebuildRichText()),this.mutate(i)}onStringPropertyChange(){this.rebuildRichText()}setStringProperty(e){return this._stringProperty.setTargetProperty(this,wl.STRING_PROPERTY_TANDEM_NAME,e)}set stringProperty(e){this.setStringProperty(e)}get stringProperty(){return this.getStringProperty()}getStringProperty(){return this._stringProperty}getPhetioMouseHitTarget(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"string"===vn.value?this.getStringPropertyPhetioMouseHitTarget(e):super.getPhetioMouseHitTarget(e)}getStringPropertyPhetioMouseHitTarget(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this._stringProperty.getTargetProperty();return t instanceof Ee.Z?t.getPhetioMouseHitTarget(e):"phetioNotSelectable"}initializePhetioObject(e,t){const i=(0,Ce.ZP)()({},t),s=this.isPhetioInstrumented();super.initializePhetioObject(e,i),Kt.Z.PHET_IO_ENABLED&&!s&&this.isPhetioInstrumented()&&this._stringProperty.initializePhetio(this,wl.STRING_PROPERTY_TANDEM_NAME,()=>new Ri.Z(this.string,(0,Ce.JA)({phetioReadOnly:!0,tandem:this.tandem.createTandem(wl.STRING_PROPERTY_TANDEM_NAME),phetioDocumentation:"Property for the displayed text"},i.stringPropertyOptions)))}rebuildRichText(){const e="stretch"===this._lineWrap;this.widthSizable=e,this.pendingMinimumWidth=0,this.needPendingMinimumWidth=e;const t="stretch"===this._lineWrap?this.localPreferredWidth:this._lineWrap;if(this.freeChildrenToPool(),""===this.string)return void this.appendEmptyLeaf();let i,s=this.string.replace(/\u202a/g,'<span dir="ltr">').replace(/\u202b/g,'<span dir="rtl">').replace(/\u202c/g,"</span>");this._replaceNewlines&&(s=s.replace(/\n/g,"<br>"));try{i=gl.parse(s)}catch(o){i=gl.parse("INVALID TRANSLATION")}this._linkItems.length=0;const n=null===t?Number.POSITIVE_INFINITY:t;let r=Al.pool.create(!0);for(this._hasAddedLeafToLine=!1;i.length;){const e=i[0],t=r.bounds.isValid()?r.width:0,s=this.appendElement(r,e,this._font,this._fill,!0,n-t,1);s!==Vl&&(r.bounds.isValid()?this.appendLine(r):this.appendLine(ol.pool.create(il.scratchText.setString("X").setFont(this._font).height)),r=Al.pool.create(!0),this._hasAddedLeafToLine=!1),s!==pl&&i.splice(0,1)}for(r.bounds.isValid()&&this.appendLine(r),0===this.lineContainer.getChildrenCount()&&this.appendEmptyLeaf(),this.alignLines();this._linkItems.length;)(()=>{const e=this._linkItems[0].element,t=this._linkItems[0].href;let i;const s=[];for(i=this._linkItems.length-1;i>=0;i--){const t=this._linkItems[i];t.element===e&&(s.push(t.node),this._linkItems.splice(i,1))}const n=ll.pool.create(e.innerContent,t);for(this.lineContainer.addChild(n),i=0;i<s.length;i++){const e=s[i],t=e.getUniqueTrailTo(this.lineContainer).getMatrix();e.detach(),e.matrix=t,n.addChild(e)}})();this._linkItems.length=0,this.localMinimumWidth=e?this.pendingMinimumWidth:this.localBounds.width}freeChildrenToPool(){for(;this.lineContainer._children.length;){const e=this.lineContainer._children[this.lineContainer._children.length-1];this.lineContainer.removeChild(e),e.clean()}}dispose(){this.freeChildrenToPool(),super.dispose(),this._stringProperty.dispose()}appendLine(e){this.lineContainer.bounds.isValid()&&(e.top=this.lineContainer.bottom+this._leading,e.left=0),this.lineContainer.addChild(e)}appendEmptyLeaf(){this.appendLine(al.pool.create("",!0,this._font,this._boundsMethod,this._fill,this._stroke,this._lineWidth))}alignLines(){const e="center"===this._align?"centerX":this._align,t=this.lineContainer[e];for(let i=0;i<this.lineContainer.getChildrenCount();i++)this.lineContainer.getChildAt(i)[e]=t}appendElement(e,t,i,s,n,r,o){let A,a=Vl;const h=r-(n?e.rightSpacing:e.leftSpacing);if(el(t)){if(A=al.pool.create(t.content,n,i,this._boundsMethod,s,this._stroke,this._lineWidth),this.needPendingMinimumWidth&&(this.pendingMinimumWidth=Math.max(this.pendingMinimumWidth,Math.max(...Xt(t.content).map(e=>{const r=t.content.slice(e.min,e.max),A=al.pool.create(r,n,i,this._boundsMethod,s,this._stroke,this._lineWidth),a=A.width*o;return A.dispose(),a})))),!A.fitsIn(h,this._hasAddedLeafToLine,n)){const e=Xt(t.content),r=e=>0===e.length?"":t.content.slice(e[0].min,e[e.length-1].max);if(this._hasAddedLeafToLine||e.length>1){const o=[];let l=!1;for(o.unshift(e.pop());e.length;){if(A.clean(),A=al.pool.create(r(e),n,i,this._boundsMethod,s,this._stroke,this._lineWidth),A.fitsIn(h,this._hasAddedLeafToLine,n)||!(this._hasAddedLeafToLine||e.length>1)){l=!0;break}o.unshift(e.pop())}if(!l)return A.clean(),pl;a=pl,t.content=r(o)}}this._hasAddedLeafToLine=!0}else if($h(t)){if("br"===t.tagName)return ml;if("span"===t.tagName){const e=il.himalayaGetAttribute("dir",t);e&&(n="ltr"===e)}if("node"===t.tagName){const e=il.himalayaGetAttribute("id",t),s=e&&this._nodes[e]||null;if(!s)return a;{if(A=hl.pool.create(s),this._hasAddedLeafToLine&&!A.fitsIn(h))return A.clean(),pl;const e=il.himalayaGetAttribute("align",t);if("center"===e||"top"===e||"bottom"===e){const t=il.scratchText.setString("Test").setFont(i).bounds;"center"===e?A.centerY=t.centerY:"top"===e?A.top=t.top:"bottom"===e&&(A.bottom=t.bottom)}}this._hasAddedLeafToLine=!0}else A=Al.pool.create(n);const e=il.himalayaGetAttribute("style",t);if(e){const t=il.himalayaStyleStringToMap(e);t.color&&(s=new le(t.color));const n={};for(let e=0;e<Bl.length;e++){const i=Bl[e];t[i]&&(n[Ml[i]]=t[i])}i=("string"==typeof i?Ge.fromCSS(i):i).copy(n)}if("a"===t.tagName){let e=il.himalayaGetAttribute("href",t);if(null!==e&&!0!==this._links)if(e.startsWith("{{")&&e.indexOf("}}")===e.length-2){const t=e.slice(2,-2);e=this._links[t]}else e=null;e&&(null!==this._linkFill&&(s=this._linkFill),t.innerContent||(t.innerContent=wl.himalayaElementToAccessibleString(t,n)),this._linkItems.push({element:t,node:A,href:e}))}else"b"===t.tagName||"strong"===t.tagName?i=("string"==typeof i?Ge.fromCSS(i):i).copy({weight:"bold"}):"i"===t.tagName||"em"===t.tagName?i=("string"==typeof i?Ge.fromCSS(i):i).copy({style:"italic"}):"sub"===t.tagName?(A.scale(this._subScale),A.addExtraBeforeSpacing(this._subXSpacing),A.y+=this._subYOffset):"sup"===t.tagName&&(A.scale(this._supScale),A.addExtraBeforeSpacing(this._supXSpacing),A.y+=this._supYOffset);const l=A.getScaleVector().x;if("node"!==t.tagName){for(;a===Vl&&t.children.length;){const e=A.bounds.isValid()?A.width:0,h=t.children[0];a=this.appendElement(A,h,i,s,n,r/l,o*l),a!==pl&&t.children.splice(0,1),r+=e-(A.bounds.isValid()?A.width:0)}a===ml&&t.children.length&&(a=pl)}if("sub"===t.tagName)isFinite(A.height)&&(A.centerY=0);else if("sup"===t.tagName)isFinite(A.height)&&(A.centerY=il.scratchText.setString("X").setFont(i).top*this._capHeightScale);else if("u"===t.tagName){const e=-A.top*this._underlineHeightScale;isFinite(A.top)&&A.addChild(new sr(A.localLeft,e,A.localRight,e,{stroke:s,lineWidth:this._underlineLineWidth}))}else if("s"===t.tagName){const e=A.top*this._strikethroughHeightScale;isFinite(A.top)&&A.addChild(new sr(A.localLeft,e,A.localRight,e,{stroke:s,lineWidth:this._strikethroughLineWidth}))}}if(A){e.addElement(A)||(this._linkItems=this._linkItems.filter(e=>e.node!==A),A.clean())}return a}setString(e){return e=""+e,this._stringProperty.set(e),this}set string(e){this.setString(e)}get string(){return this.getString()}getString(){return this._stringProperty.value}setBoundsMethod(e){return e!==this._boundsMethod&&(this._boundsMethod=e,this.rebuildRichText()),this}set boundsMethod(e){this.setBoundsMethod(e)}get boundsMethod(){return this.getBoundsMethod()}getBoundsMethod(){return this._boundsMethod}setFont(e){return this._font!==e&&(this._font=e,this.rebuildRichText()),this}set font(e){this.setFont(e)}get font(){return this.getFont()}getFont(){return this._font}setFill(e){return this._fill!==e&&(this._fill=e,this.rebuildRichText()),this}set fill(e){this.setFill(e)}get fill(){return this.getFill()}getFill(){return this._fill}setStroke(e){return this._stroke!==e&&(this._stroke=e,this.rebuildRichText()),this}set stroke(e){this.setStroke(e)}get stroke(){return this.getStroke()}getStroke(){return this._stroke}setLineWidth(e){return this._lineWidth!==e&&(this._lineWidth=e,this.rebuildRichText()),this}set lineWidth(e){this.setLineWidth(e)}get lineWidth(){return this.getLineWidth()}getLineWidth(){return this._lineWidth}setSubScale(e){return this._subScale!==e&&(this._subScale=e,this.rebuildRichText()),this}set subScale(e){this.setSubScale(e)}get subScale(){return this.getSubScale()}getSubScale(){return this._subScale}setSubXSpacing(e){return this._subXSpacing!==e&&(this._subXSpacing=e,this.rebuildRichText()),this}set subXSpacing(e){this.setSubXSpacing(e)}get subXSpacing(){return this.getSubXSpacing()}getSubXSpacing(){return this._subXSpacing}setSubYOffset(e){return this._subYOffset!==e&&(this._subYOffset=e,this.rebuildRichText()),this}set subYOffset(e){this.setSubYOffset(e)}get subYOffset(){return this.getSubYOffset()}getSubYOffset(){return this._subYOffset}setSupScale(e){return this._supScale!==e&&(this._supScale=e,this.rebuildRichText()),this}set supScale(e){this.setSupScale(e)}get supScale(){return this.getSupScale()}getSupScale(){return this._supScale}setSupXSpacing(e){return this._supXSpacing!==e&&(this._supXSpacing=e,this.rebuildRichText()),this}set supXSpacing(e){this.setSupXSpacing(e)}get supXSpacing(){return this.getSupXSpacing()}getSupXSpacing(){return this._supXSpacing}setSupYOffset(e){return this._supYOffset!==e&&(this._supYOffset=e,this.rebuildRichText()),this}set supYOffset(e){this.setSupYOffset(e)}get supYOffset(){return this.getSupYOffset()}getSupYOffset(){return this._supYOffset}setCapHeightScale(e){return this._capHeightScale!==e&&(this._capHeightScale=e,this.rebuildRichText()),this}set capHeightScale(e){this.setCapHeightScale(e)}get capHeightScale(){return this.getCapHeightScale()}getCapHeightScale(){return this._capHeightScale}setUnderlineLineWidth(e){return this._underlineLineWidth!==e&&(this._underlineLineWidth=e,this.rebuildRichText()),this}set underlineLineWidth(e){this.setUnderlineLineWidth(e)}get underlineLineWidth(){return this.getUnderlineLineWidth()}getUnderlineLineWidth(){return this._underlineLineWidth}setUnderlineHeightScale(e){return this._underlineHeightScale!==e&&(this._underlineHeightScale=e,this.rebuildRichText()),this}set underlineHeightScale(e){this.setUnderlineHeightScale(e)}get underlineHeightScale(){return this.getUnderlineHeightScale()}getUnderlineHeightScale(){return this._underlineHeightScale}setStrikethroughLineWidth(e){return this._strikethroughLineWidth!==e&&(this._strikethroughLineWidth=e,this.rebuildRichText()),this}set strikethroughLineWidth(e){this.setStrikethroughLineWidth(e)}get strikethroughLineWidth(){return this.getStrikethroughLineWidth()}getStrikethroughLineWidth(){return this._strikethroughLineWidth}setStrikethroughHeightScale(e){return this._strikethroughHeightScale!==e&&(this._strikethroughHeightScale=e,this.rebuildRichText()),this}set strikethroughHeightScale(e){this.setStrikethroughHeightScale(e)}get strikethroughHeightScale(){return this.getStrikethroughHeightScale()}getStrikethroughHeightScale(){return this._strikethroughHeightScale}setLinkFill(e){return this._linkFill!==e&&(this._linkFill=e,this.rebuildRichText()),this}set linkFill(e){this.setLinkFill(e)}get linkFill(){return this.getLinkFill()}getLinkFill(){return this._linkFill}setLinkEventsHandled(e){return this._linkEventsHandled!==e&&(this._linkEventsHandled=e,this.rebuildRichText()),this}set linkEventsHandled(e){this.setLinkEventsHandled(e)}get linkEventsHandled(){return this.getLinkEventsHandled()}getLinkEventsHandled(){return this._linkEventsHandled}setLinks(e){return this._links!==e&&(this._links=e,this.rebuildRichText()),this}getLinks(){return this._links}set links(e){this.setLinks(e)}get links(){return this.getLinks()}setNodes(e){return this._nodes!==e&&(this._nodes=e,this.rebuildRichText()),this}getNodes(){return this._nodes}set nodes(e){this.setNodes(e)}get nodes(){return this.getNodes()}setReplaceNewlines(e){return this._replaceNewlines!==e&&(this._replaceNewlines=e,this.rebuildRichText()),this}set replaceNewlines(e){this.setReplaceNewlines(e)}get replaceNewlines(){return this.getReplaceNewlines()}getReplaceNewlines(){return this._replaceNewlines}setAlign(e){return this._align!==e&&(this._align=e,this.rebuildRichText()),this}set align(e){this.setAlign(e)}get align(){return this.getAlign()}getAlign(){return this._align}setLeading(e){return this._leading!==e&&(this._leading=e,this.rebuildRichText()),this}set leading(e){this.setLeading(e)}get leading(){return this.getLeading()}getLeading(){return this._leading}setLineWrap(e){return this._lineWrap!==e&&(this._lineWrap=e,this.rebuildRichText()),this}set lineWrap(e){this.setLineWrap(e)}get lineWrap(){return this.getLineWrap()}getLineWrap(){return this._lineWrap}mutate(e){return super.mutate(e)}static stringWithFont(e,t){return`<span style='font-style: ${t.style};font-variant: ${t.variant};font-weight: ${t.weight};font-stretch: ${t.stretch};font-size: ${t.size};font-family: ${t.family};line-height: ${t.lineHeight};'>${e}</span>`}static himalayaElementToString(e,t){if(el(e))return wl.contentToString(e.content,t);if($h(e)){const i=il.himalayaGetAttribute("dir",e);return"span"===e.tagName&&i&&(t="ltr"===i),e.children.map(e=>wl.himalayaElementToString(e,t)).join("")}return""}static himalayaElementToAccessibleString(e,t){if(el(e))return wl.contentToString(e.content,t);if($h(e)){const i=il.himalayaGetAttribute("dir",e);"span"===e.tagName&&i&&(t="ltr"===i);const s=e.children.map(e=>wl.himalayaElementToAccessibleString(e,t)).join("");return _.includes(ul,e.tagName)?`<${e.tagName}>${s}</${e.tagName}>`:s}return""}static contentToString(e,t){const i=he.decode(e);return t?`‪${i}‬`:`‫${i}‬`}}_defineProperty(wl,"STRING_PROPERTY_TANDEM_NAME",zn.STRING_PROPERTY_TANDEM_NAME),wl.prototype._mutatorKeys=cl.concat(Zs.prototype._mutatorKeys),W.register("RichText",wl),wl.RichTextIO=new se.Z("RichTextIO",{valueType:wl,supertype:Zs.NodeIO,documentation:"The tandem IO Type for the scenery RichText node"});class Cl extends(Ho(zn)){constructor(e,t){const i=(0,Ce.ZP)()({readingBlockNameResponse:e,tagName:"p",innerContent:e},t);super(e),this.focusHighlight=new Zo(this),this.mutate(i)}}W.register("VoicingText",Cl);const El=Cl;class Yl extends(Ho(wl)){constructor(e,t){super(e,(0,Ce.ZP)()({readingBlockNameResponse:e,innerContent:e,readingBlockTagName:"button"},t)),this.focusHighlight=new Zo(this)}}W.register("VoicingRichText",Yl);const Dl=Yl,yl=e=>{if(e instanceof be.Z)return{type:"Vector2",x:e.x,y:e.y};if(e instanceof Le.Z)return{type:"Matrix3",m00:e.m00(),m01:e.m01(),m02:e.m02(),m10:e.m10(),m11:e.m11(),m12:e.m12(),m20:e.m20(),m21:e.m21(),m22:e.m22()};if(e instanceof Ue.Z){const t=e;return{type:"Bounds2",maxX:t.maxX,maxY:t.maxY,minX:t.minX,minY:t.minY}}if(e instanceof _t.bn)return{type:"Shape",path:e.getSVGPath()};if(Array.isArray(e))return{type:"Array",value:e.map(yl)};if(e instanceof le)return{type:"Color",red:e.red,green:e.green,blue:e.blue,alpha:e.alpha};if(e instanceof ee.Z)return{type:"Property",value:yl(e.value)};if(Ki&&e instanceof Ki){const t={};return e.transformMatrix&&(t.transformMatrix=yl(e.transformMatrix)),ji&&(e instanceof Hi||e instanceof vi)&&(t.stops=e.stops.map(e=>({ratio:e.ratio,stop:yl(e.color)})),t.start=yl(e.start),t.end=yl(e.end),vi&&e instanceof vi?t.type="LinearGradient":Hi&&e instanceof Hi&&(t.type="RadialGradient",t.startRadius=e.startRadius,t.endRadius=e.endRadius)),Wi&&e instanceof Wi&&(t.type="Pattern",t.url=e.image.src),t}if(e instanceof Zs){const t=e,i={},s={};["visible","opacity","disabledOpacity","pickable","inputEnabled","cursor","transformBounds","renderer","usesOpacity","layerSplit","cssTransform","excludeInvisible","webglScale","preventFit"].forEach(e=>{t[e]!==Zs.DEFAULT_NODE_OPTIONS[e]&&(i[e]=t[e])}),["tagName","innerContent","accessibleName","helpText"].forEach(e=>{null!==t[e]&&(i[e]=t[e])}),["maxWidth","maxHeight","clipArea","mouseArea","touchArea"].forEach(e=>{t[e]!==Zs.DEFAULT_NODE_OPTIONS[e]&&(s[e]=yl(t[e]))}),t.matrix.isIdentity()||(s.matrix=yl(t.matrix)),t._localBoundsOverridden&&(s.localBounds=yl(t.localBounds)),s.children=t.children.map(e=>e.id),s.hasInputListeners=t.inputListeners.length>0;const n={id:t.id,type:"Node",types:(0,En.Z)(t.constructor).map(e=>e.name).filter(e=>e&&"Object"!==e&&"Node"!==e),name:t.constructor.name,options:i,setup:s};if(On&&t instanceof On&&(n.type="Path",s.path=yl(t.shape),t.boundsMethod!==On.DEFAULT_PATH_OPTIONS.boundsMethod&&(i.boundsMethod=t.boundsMethod)),tr&&t instanceof tr&&(n.type="Circle",i.radius=t.radius),sr&&t instanceof sr&&(n.type="Line",i.x1=t.x1,i.y1=t.y1,i.x2=t.x2,i.y2=t.y2),rr&&t instanceof rr&&(n.type="Rectangle",i.rectX=t.rectX,i.rectY=t.rectY,i.rectWidth=t.rectWidth,i.rectHeight=t.rectHeight,i.cornerXRadius=t.cornerXRadius,i.cornerYRadius=t.cornerYRadius),zn&&t instanceof zn&&(n.type="Text","hybrid"!==t.boundsMethod&&(i.boundsMethod=t.boundsMethod),i.string=t.string,i.font=t.font),Pn&&t instanceof Pn&&(n.type="Image",["imageOpacity","initialWidth","initialHeight","mipmapBias","mipmapInitialLevel","mipmapMaxLevel"].forEach(e=>{t[e]!==Pn.DEFAULT_IMAGE_OPTIONS[e]&&(i[e]=t[e])}),s.width=t.imageWidth,s.height=t.imageHeight,t._mipmapData?(s.imageType="mipmapData",s.mipmapData=t._mipmapData.map(e=>({url:e.url,width:e.width,height:e.height}))):(t._mipmap&&(s.generateMipmaps=!0),t._image instanceof HTMLImageElement?(s.imageType="image",s.src=t._image.src):t._image instanceof HTMLCanvasElement&&(s.imageType="canvas",s.src=t._image.toDataURL()))),er&&t instanceof er||Ar&&t instanceof Ar){n.type=er&&t instanceof er?"CanvasNode":"WebGLNode",s.canvasBounds=yl(t.canvasBounds);const e=1,i=document.createElement("canvas");i.width=Math.ceil(t.canvasBounds.width*e),i.height=Math.ceil(t.canvasBounds.height*e);const r=i.getContext("2d"),o=new Dt(i,r),A=Le.Z.scale(1/e);o.context.setTransform(e,0,0,e,-t.canvasBounds.left,-t.canvasBounds.top),t.renderToCanvasSelf(o,A),s.url=i.toDataURL(),s.scale=e,s.offset=yl(t.canvasBounds.leftTop)}return ir&&t instanceof ir&&(n.type="DOM",n.element=(new window.XMLSerializer).serializeToString(t.element),t.element instanceof window.HTMLCanvasElement&&(n.dataURL=t.element.toDataURL()),i.preventTransform=t.preventTransform),(On&&t instanceof On||zn&&t instanceof zn)&&(["fillPickable","strokePickable","lineWidth","lineCap","lineJoin","lineDashOffset","miterLimit"].forEach(e=>{t[e]!==yn[e]&&(i[e]=t[e])}),t.fill!==yn.fill&&(s.fill=yl(t.fill)),t.stroke!==yn.stroke&&(s.stroke=yl(t.stroke)),t.lineDash.length&&(s.lineDash=yl(t.lineDash))),n}return e instanceof Bd?{type:"Display",width:e.width,height:e.height,backgroundColor:yl(e.backgroundColor),tree:{type:"Subtree",rootNodeId:e.rootNode.id,nodes:Il(e.rootNode)}}:{type:"value",value:e}},Il=e=>e.getSubtreeNodes().map(yl);W.register("scenerySerialize",yl);const ql=e=>{if("Vector2"===e.type)return new be.Z(e.x,e.y);if("Matrix3"===e.type)return(new Le.Z).rowMajor(e.m00,e.m01,e.m02,e.m10,e.m11,e.m12,e.m20,e.m21,e.m22);if("Bounds2"===e.type)return new Ue.Z(e.minX,e.minY,e.maxX,e.maxY);if("Shape"===e.type)return new _t.bn(e.path);if("Array"===e.type)return e.value.map(ql);if("Color"===e.type)return new le(e.red,e.green,e.blue,e.alpha);if("Property"===e.type)return new yt.Z(ql(e.value));if("Pattern"===e.type||"LinearGradient"===e.type||"RadialGradient"===e.type){let t;if("Pattern"===e.type){const i=new window.Image;i.src=e.url,t=new Wi(i)}else{const i=ql(e.start),s=ql(e.end);"LinearGradient"===e.type?t=new vi(i.x,i.y,s.x,s.y):"RadialGradient"===e.type&&(t=new Hi(i.x,i.y,e.startRadius,s.x,s.y,e.endRadius)),e.stops.forEach(e=>{t.addColorStop(e.ratio,ql(e.stop))})}return e.transformMatrix&&t.setTransformMatrix(ql(e.transformMatrix)),t}if(_.includes(["Node","Path","Circle","Line","Rectangle","Text","Image","CanvasNode","WebGLNode","DOM"],e.type)){let t;const i=e.setup;if("Node"===e.type)t=new Zs;else if("Path"===e.type)t=new On(ql(i.path));else if("Circle"===e.type)t=new tr({});else if("Line"===e.type)t=new sr({});else if("Rectangle"===e.type)t=new rr({});else if("Text"===e.type)t=new zn("");else if("Image"===e.type){if("image"===i.imageType||"canvas"===i.imageType)t=new Pn(i.src),i.generateMipmaps&&(t.mipmap=!0);else if("mipmapData"===i.imageType){const e=i.mipmapData.map(e=>{const t={width:e.width,height:e.height,url:e.url};t.img=new window.Image,t.img.src=e.url,t.canvas=document.createElement("canvas"),t.canvas.width=e.width,t.canvas.height=e.height;const i=t.canvas.getContext("2d");return t.updateCanvas=function(){t.img.complete&&(void 0===t.img.naturalWidth||t.img.naturalWidth>0)&&(i.drawImage(t.img,0,0),delete t.updateCanvas)},t});t=new Pn(e)}t.initialWidth=i.width,t.initialHeight=i.height}else if("CanvasNode"===e.type||"WebGLNode"===e.type)t=new Zs({children:[new Pn(i.url,{translation:ql(i.offset),scale:1/i.scale})]});else if("DOM"===e.type){const i=document.createElement("div");i.innerHTML=e.element;const s=i.childNodes[0];if(i.removeChild(s),e.dataURL){const t=new window.Image;t.onload=()=>{s.getContext("2d").drawImage(t,0,0)},t.src=e.dataURL}t=new ir(s)}return i.clipArea&&(t.clipArea=ql(i.clipArea)),i.mouseArea&&(t.mouseArea=ql(i.mouseArea)),i.touchArea&&(t.touchArea=ql(i.touchArea)),i.matrix&&(t.matrix=ql(i.matrix)),i.localBounds&&(t.localBounds=ql(i.localBounds)),i.fill&&(t.fill=ql(i.fill)),i.stroke&&(t.stroke=ql(i.stroke)),i.lineDash&&(t.lineDash=ql(i.lineDash)),t.mutate(e.options),t._serialization=e,t}if("Subtree"===e.type){const t={},i=e.nodes.map(ql);return i.forEach(e=>{t[e._serialization.id]=e}),i.forEach(e=>{e._serialization.setup.children.forEach(i=>{e.addChild(t[i])})}),t[e.rootNodeId]}return"value"===e.type?e.value:null};W.register("sceneryDeserialize",ql);const Gl=ql,Ql=e=>Gl(yl(e));W.register("sceneryCopy",Ql);let Sl=1;class Tl{initialize(e){return this.id=this.id||Sl++,this.clean(),this.renderer=e,this.dirty=!0,this.isDisposed=!1,this.linksDirty=!1,this.visibleProperty=new Ms.Z(!0),this.fittableProperty=new Ms.Z(!0),this}clean(){this.parentDrawable=null,this.backbone=null,this.pendingParentDrawable=null,this.pendingBackbone=null,this.pendingAddition=!1,this.pendingRemoval=!1,this.previousDrawable=null,this.nextDrawable=null,this.oldPreviousDrawable=null,this.oldNextDrawable=null,this.visibleProperty&&this.visibleProperty.removeAllListeners(),this.fittableProperty&&this.fittableProperty.removeAllListeners()}update(){let e=!1;return this.dirty&&!this.isDisposed&&(this.dirty=!1,e=!0),e}setVisible(e){this.visibleProperty.value=e}set visible(e){this.setVisible(e)}isVisible(){return this.visibleProperty.value}get visible(){return this.isVisible()}setFittable(e){this.fittableProperty.value=e}set fittable(e){this.setFittable(e)}isFittable(){return this.fittableProperty.value}get fittable(){return this.isFittable()}setBlockBackbone(e){this.parentDrawable=e,this.backbone=e,this.pendingParentDrawable=e,this.pendingBackbone=e,this.pendingAddition=!1,this.pendingRemoval=!1}notePendingAddition(e,t,i){this.pendingParentDrawable=t,this.pendingBackbone=i,this.pendingAddition=!0,this.pendingRemoval||e.markDrawableChangedBlock(this)}notePendingRemoval(e){this.pendingRemoval=!0,this.pendingAddition||e.markDrawableChangedBlock(this)}notePendingMove(e,t){this.pendingParentDrawable=t,this.pendingRemoval&&this.pendingAddition||e.markDrawableChangedBlock(this),this.pendingAddition=!0,this.pendingRemoval=!0}updateBlock(){let e=!1;return(this.pendingRemoval||this.pendingAddition)&&(e=!this.pendingRemoval||!this.pendingAddition||this.parentDrawable!==this.pendingParentDrawable||this.backbone!==this.pendingBackbone,e?(this.pendingRemoval&&(this.parentDrawable.removeDrawable(this),this.pendingAddition||(this.pendingParentDrawable=null,this.pendingBackbone=null)),this.parentDrawable=this.pendingParentDrawable,this.backbone=this.pendingBackbone,this.pendingAddition&&this.parentDrawable.addDrawable(this)):this.pendingAddition&&Te.isCanvas(this.renderer)&&this.parentDrawable.onPotentiallyMovedDrawable(this),this.pendingAddition=!1,this.pendingRemoval=!1),e}updateLinks(){this.oldNextDrawable=this.nextDrawable,this.oldPreviousDrawable=this.previousDrawable,this.linksDirty=!1}markDirty(){this.dirty||(this.dirty=!0,this.parentDrawable&&this.parentDrawable.markDirtyDrawable(this))}markLinksDirty(e){this.linksDirty||(this.linksDirty=!0,e.markDrawableForLinksUpdate(this))}markForDisposal(e){Tl.disconnectBefore(this,e),Tl.disconnectAfter(this,e),e.markDrawableForDisposal(this)}disposeImmediately(e){Tl.disconnectBefore(this,e),Tl.disconnectAfter(this,e),this.dispose()}dispose(){this.clean(),this.isDisposed=!0,this.freeToPool()}audit(e,t,i){0}toString(){return`${this.constructor.name}#${this.id}`}toDetailedString(){return this.toString()}static connectDrawables(e,t,i){e.nextDrawable!==t&&(e.nextDrawable&&(e.nextDrawable.markLinksDirty(i),e.nextDrawable.previousDrawable=null),t.previousDrawable&&(t.previousDrawable.markLinksDirty(i),t.previousDrawable.nextDrawable=null),e.nextDrawable=t,t.previousDrawable=e,e.markLinksDirty(i),t.markLinksDirty(i))}static disconnectBefore(e,t){e.previousDrawable&&(e.markLinksDirty(t),e.previousDrawable.markLinksDirty(t),e.previousDrawable.nextDrawable=null,e.previousDrawable=null)}static disconnectAfter(e,t){e.nextDrawable&&(e.markLinksDirty(t),e.nextDrawable.markLinksDirty(t),e.nextDrawable.previousDrawable=null,e.nextDrawable=null)}static listToArray(e,t){const i=[];for(let s=e;i.push(s),s!==t;s=s.nextDrawable);return i}static oldListToArray(e,t){const i=[];for(let s=e;i.push(s),s!==t;s=s.oldNextDrawable);return i}}W.register("Drawable",Tl);const xl=Tl;class kl extends xl{constructor(e,t){super(),this.initialize(e,t)}initialize(e,t){return super.initialize(e),this.drawableVisibilityListener=this.drawableVisibilityListener||this.updateSelfVisibility.bind(this),this.instance=t,this.node=t.trail.lastNode(),this.node.attachDrawable(this),this.instance.selfVisibleEmitter.addListener(this.drawableVisibilityListener),this.updateSelfVisibility(),this}dispose(){this.instance.selfVisibleEmitter.removeListener(this.drawableVisibilityListener),this.node.detachDrawable(this),this.instance=null,this.node=null,super.dispose()}updateSelfVisibility(){this.visible=this.instance.selfVisible}toDetailedString(){return`${this.toString()} (${this.instance.trail.toPathString()})`}}W.register("SelfDrawable",kl);const Fl=kl,Rl=_s(e=>class extends e{initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.fillCallback=this.fillCallback||this.markDirtyFill.bind(this),this.strokeCallback=this.strokeCallback||this.markDirtyStroke.bind(this),this.fillObserver=this.fillObserver||new Br(this.fillCallback),this.strokeObserver=this.strokeObserver||new Br(this.strokeCallback),this.fillObserver.setPrimary(t.node._fill),this.strokeObserver.setPrimary(t.node._stroke)}dispose(){this.fillObserver.clean(),this.strokeObserver.clean(),super.dispose()}markDirtyFill(){this.markPaintDirty(),this.fillObserver.setPrimary(this.instance.node._fill)}markDirtyStroke(){this.markPaintDirty(),this.strokeObserver.setPrimary(this.instance.node._stroke)}markDirtyLineWidth(){this.markPaintDirty()}markDirtyLineOptions(){this.markPaintDirty()}markDirtyCachedPaints(){this.markPaintDirty()}});W.register("PaintableStatelessDrawable",Rl);const Ul=Rl,Ll=_s(e=>class extends e{initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.dirtyFill=!0,this.hadStroke=!1,this.dirtyStroke=!0,this.dirtyLineWidth=!0,this.dirtyLineOptions=!0,this.dirtyCachedPaints=!0,this.lastCachedPaints=[],this.fillCallback=this.fillCallback||this.markDirtyFill.bind(this),this.strokeCallback=this.strokeCallback||this.markDirtyStroke.bind(this),this.fillObserver=this.fillObserver||new Br(this.fillCallback),this.strokeObserver=this.strokeObserver||new Br(this.strokeCallback),this.fillObserver.setPrimary(t.node._fill),this.strokeObserver.setPrimary(t.node._stroke)}cleanPaintableState(){this.dirtyFill=!1,this.dirtyStroke=!1,this.dirtyLineWidth=!1,this.dirtyLineOptions=!1,this.dirtyCachedPaints=!1,this.hadStroke=null!==this.node.getStroke()}dispose(){super.dispose(),this.fillObserver.clean(),this.strokeObserver.clean()}markDirtyFill(){this.dirtyFill=!0,this.markPaintDirty(),this.fillObserver.setPrimary(this.instance.node._fill)}markDirtyStroke(){this.dirtyStroke=!0,this.markPaintDirty(),this.strokeObserver.setPrimary(this.instance.node._stroke)}markDirtyLineWidth(){this.dirtyLineWidth=!0,this.markPaintDirty()}markDirtyLineOptions(){this.dirtyLineOptions=!0,this.markPaintDirty()}markDirtyCachedPaints(){this.dirtyCachedPaints=!0,this.markPaintDirty()}});W.register("PaintableStatefulDrawable",Ll);const Pl=Ll;class bl extends Fl{initialize(e,t){super.initialize(e,t),this.transformListener=this.transformListener||this.markTransformDirty.bind(this),t.relativeTransform.addListener(this.transformListener),t.relativeTransform.addPrecompute()}markTransformDirty(){this.markDirty()}markPaintDirty(){this.markDirty()}updateSelfVisibility(){super.updateSelfVisibility(),this.markDirty()}dispose(){this.instance.relativeTransform.removeListener(this.transformListener),this.instance.relativeTransform.removePrecompute(),super.dispose()}}W.register("CanvasSelfDrawable",bl);const Ol=bl;class fl extends Fl{initialize(e,t){return super.initialize(e,t),this.transformListener=this.transformListener||this.markTransformDirty.bind(this),this.markTransformDirty(),this.visibilityDirty=!0,t.relativeTransform.addListener(this.transformListener),t.relativeTransform.addPrecompute(),this}markTransformDirty(){this.transformDirty=!0,this.markDirty()}getTransformMatrix(){return this.instance.relativeTransform.validate(),this.instance.relativeTransform.matrix}update(){return!!super.update()&&(this.updateDOM(),this.visibilityDirty&&(this.visibilityDirty=!1,this.domElement.style.visibility=this.visible?"":"hidden"),this.cleanPaintableState&&this.cleanPaintableState(),!0)}updateDOM(){}updateSelfVisibility(){super.updateSelfVisibility(),this.visibilityDirty||(this.visibilityDirty=!0,this.markDirty())}dispose(){this.instance.relativeTransform.removeListener(this.transformListener),this.instance.relativeTransform.removePrecompute(),super.dispose()}}W.register("DOMSelfDrawable",fl);const Zl=fl;class Nl extends Fl{initialize(e,t,i,s){return super.initialize(e,t),this.usesPaint=i,this.keepElements=s,this.svgElement=null,this.svgBlock=null,this.usesPaint&&(this.paintState?this.paintState.initialize():this.paintState=new Yr),this}update(){return!!super.update()&&(this.updateSVG(),!0)}updateSVG(){if(this.paintDirty&&this.updateSVGSelf(this.node,this.svgElement),this.usesPaint&&this.dirtyCachedPaints){const e=this.node._cachedPaints.slice();let t,i;for(t=0;t<e.length;t++){const s=e[t];let n=!0;for(i=0;i<this.lastCachedPaints.length;i++)if(s===this.lastCachedPaints[i]){n=!1;break}n&&this.svgBlock.incrementPaint(s)}for(t=0;t<this.lastCachedPaints.length;t++){const s=this.lastCachedPaints[t];let n=!0;for(i=0;i<e.length;i++)if(s===e[i]){n=!1;break}n&&this.svgBlock.decrementPaint(s)}this.lastCachedPaints=e}this.setToCleanState()}updateFillStrokeStyle(e){if(!this.usesPaint)return;this.dirtyFill&&this.paintState.updateFill(this.svgBlock,this.node.getFillValue()),this.dirtyStroke&&this.paintState.updateStroke(this.svgBlock,this.node.getStrokeValue());const t=this.dirtyLineWidth||this.dirtyLineOptions;t&&this.paintState.updateStrokeDetailStyle(this.node),(this.dirtyFill||this.dirtyStroke||t)&&e.setAttribute("style",this.paintState.baseStyle+this.paintState.strokeDetailStyle),this.cleanPaintableState()}updateSVGBlock(e){const t=this.svgBlock;if(this.usesPaint&&t)for(let i=0;i<this.lastCachedPaints.length;i++)t.decrementPaint(this.lastCachedPaints[i]);if(this.svgBlock=e,this.usesPaint)for(let i=0;i<this.lastCachedPaints.length;i++)e.incrementPaint(this.lastCachedPaints[i]);this.updateDefsSelf&&this.updateDefsSelf(e),this.usesPaint&&this.paintState.updateSVGBlock(e),this.usesPaint&&this.markDirtyFill(),this.usesPaint&&this.markDirtyStroke()}dispose(){this.keepElements||(this.svgElement=null),this.updateDefsSelf&&this.updateDefsSelf(null),this.usesPaint&&this.paintState.dispose(),this.defs=null,this.svgBlock=null,super.dispose()}}W.register("SVGSelfDrawable",Nl);const Kl=Nl;class Jl extends Fl{initialize(e,t){return super.initialize(e,t),this.transformListener=this.transformListener||this.markTransformDirty.bind(this),t.relativeTransform.addListener(this.transformListener),t.relativeTransform.addPrecompute(),this}markTransformDirty(){this.markDirty()}updateSelfVisibility(){super.updateSelfVisibility(),this.markDirty()}dispose(){this.instance.relativeTransform.removeListener(this.transformListener),this.instance.relativeTransform.removePrecompute(),super.dispose()}}W.register("WebGLSelfDrawable",Jl);const jl=Jl,vl=_s(e=>class extends(Pl(e)){initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.paintDirty=!0,this.dirtyRadius=!0}markPaintDirty(){this.paintDirty=!0,this.markDirty()}markDirtyRadius(){this.dirtyRadius=!0,this.markPaintDirty()}setToCleanState(){this.paintDirty=!1,this.dirtyRadius=!1}});W.register("CircleStatefulDrawable",vl);const Hl=vl,Wl=_s(e=>class extends e{initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.paintDirty=!0,this.dirtyImage=!0,this.dirtyImageOpacity=!0,this.dirtyMipmap=!0}markPaintDirty(){this.paintDirty=!0,this.markDirty()}markDirtyImage(){this.dirtyImage=!0,this.markPaintDirty()}markDirtyImageOpacity(){this.dirtyImageOpacity=!0,this.markPaintDirty()}markDirtyMipmap(){this.dirtyMipmap=!0,this.markPaintDirty()}setToCleanState(){this.paintDirty=!1,this.dirtyImage=!1,this.dirtyImageOpacity=!1,this.dirtyMipmap=!1}});W.register("ImageStatefulDrawable",Wl);const zl=Wl,Xl=_s(e=>class extends(Ul(e)){initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.paintDirty=!0}markPaintDirty(){this.paintDirty=!0,this.markDirty()}markDirtyLine(){this.markPaintDirty()}markDirtyP1(){this.markPaintDirty()}markDirtyP2(){this.markPaintDirty()}markDirtyX1(){this.markPaintDirty()}markDirtyY1(){this.markPaintDirty()}markDirtyX2(){this.markPaintDirty()}markDirtyY2(){this.markPaintDirty()}});W.register("LineStatelessDrawable",Xl);const _l=Xl,$l=_s(e=>class extends(Pl(e)){initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.paintDirty=!0,this.dirtyX1=!0,this.dirtyY1=!0,this.dirtyX2=!0,this.dirtyY2=!0}markPaintDirty(){this.paintDirty=!0,this.markDirty()}markDirtyLine(){this.dirtyX1=!0,this.dirtyY1=!0,this.dirtyX2=!0,this.dirtyY2=!0,this.markPaintDirty()}markDirtyP1(){this.dirtyX1=!0,this.dirtyY1=!0,this.markPaintDirty()}markDirtyP2(){this.dirtyX2=!0,this.dirtyY2=!0,this.markPaintDirty()}markDirtyX1(){this.dirtyX1=!0,this.markPaintDirty()}markDirtyY1(){this.dirtyY1=!0,this.markPaintDirty()}markDirtyX2(){this.dirtyX2=!0,this.markPaintDirty()}markDirtyY2(){this.dirtyY2=!0,this.markPaintDirty()}setToCleanState(){this.paintDirty=!1,this.dirtyX1=!1,this.dirtyY1=!1,this.dirtyX2=!1,this.dirtyY2=!1}});W.register("LineStatefulDrawable",$l);const eg=$l,tg=_s(e=>class extends(Pl(e)){initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.paintDirty=!0,this.dirtyShape=!0}markPaintDirty(){this.paintDirty=!0,this.markDirty()}markDirtyShape(){this.dirtyShape=!0,this.markPaintDirty()}setToCleanState(){this.paintDirty=!1,this.dirtyShape=!1}});W.register("PathStatefulDrawable",tg);const ig=tg,sg=_s(e=>class extends(Pl(e)){initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.paintDirty=!0,this.dirtyX=!0,this.dirtyY=!0,this.dirtyWidth=!0,this.dirtyHeight=!0,this.dirtyCornerXRadius=!0,this.dirtyCornerYRadius=!0}markPaintDirty(){this.paintDirty=!0,this.markDirty()}markDirtyRectangle(){this.dirtyX=!0,this.dirtyY=!0,this.dirtyWidth=!0,this.dirtyHeight=!0,this.dirtyCornerXRadius=!0,this.dirtyCornerYRadius=!0,this.markPaintDirty()}markDirtyX(){this.dirtyX=!0,this.markPaintDirty()}markDirtyY(){this.dirtyY=!0,this.markPaintDirty()}markDirtyWidth(){this.dirtyWidth=!0,this.markPaintDirty()}markDirtyHeight(){this.dirtyHeight=!0,this.markPaintDirty()}markDirtyCornerXRadius(){this.dirtyCornerXRadius=!0,this.markPaintDirty()}markDirtyCornerYRadius(){this.dirtyCornerYRadius=!0,this.markPaintDirty()}setToCleanState(){this.paintDirty=!1,this.dirtyX=!1,this.dirtyY=!1,this.dirtyWidth=!1,this.dirtyHeight=!1,this.dirtyCornerXRadius=!1,this.dirtyCornerYRadius=!1}});W.register("RectangleStatefulDrawable",sg);const ng=sg,rg=_s(e=>class extends(Pl(e)){initialize(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];super.initialize(e,t,...s),this.paintDirty=!0,this.dirtyText=!0,this.dirtyFont=!0,this.dirtyBounds=!0}markPaintDirty(){this.paintDirty=!0,this.markDirty()}markDirtyText(){this.dirtyText=!0,this.markPaintDirty()}markDirtyFont(){this.dirtyFont=!0,this.markPaintDirty()}markDirtyBounds(){this.dirtyBounds=!0,this.markPaintDirty()}setToCleanState(){this.paintDirty=!1,this.dirtyText=!1,this.dirtyFont=!1,this.dirtyBounds=!1}});W.register("TextStatefulDrawable",rg);const og=rg,Ag=[];class ag extends Ol{paintCanvas(e,t,i){if(!t.selfBounds.isEmpty()){const i=e.context;i.save(),i.fillStyle="black",i.strokeStyle="black",i.lineWidth=1,i.lineCap="butt",i.lineJoin="miter",i.lineDash=Ag,i.lineDashOffset=0,i.miterLimit=10,t.paintCanvas(i),i.restore()}}}W.register("CanvasNodeDrawable",ag),Rt.mixInto(ag);const hg=ag;class lg extends(Ul(Ol)){paintCanvas(e,t,i){const s=e.context;s.beginPath(),s.arc(0,0,t._radius,0,2*Math.PI,!1),s.closePath(),t.hasFill()&&(t.beforeCanvasFill(e),s.fill(),t.afterCanvasFill(e)),t.hasPaintableStroke()&&(t.beforeCanvasStroke(e),s.stroke(),t.afterCanvasStroke(e))}markDirtyRadius(){this.markPaintDirty()}dispose(){super.dispose()}}W.register("CircleCanvasDrawable",lg),Rt.mixInto(lg);const gg=lg;class cg extends(Hl(Zl)){constructor(e,t){super(e,t),ve.prepareForTransform(this.domElement)}initialize(e,t){if(super.initialize(e,t),this.matrix=this.matrix||Le.Z.pool.fetch(),!this.fillElement||!this.strokeElement){const e=document.createElement("div");this.fillElement=e;const t=document.createElement("div");this.strokeElement=t,e.style.display="block",e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.pointerEvents="none",t.style.display="block",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.pointerEvents="none",e.appendChild(t)}this.domElement=this.fillElement}updateDOM(){const e=this.node,t=this.fillElement,i=this.strokeElement;if(this.paintDirty&&(this.dirtyRadius&&(t.style.width=2*e._radius+"px",t.style.height=2*e._radius+"px",t.style[we.borderRadius]=e._radius+"px"),this.dirtyFill&&(t.style.backgroundColor=e.getCSSFill()),this.dirtyStroke&&(e.hasStroke()?i.style.borderStyle="solid":i.style.borderStyle="none"),e.hasStroke())){const t=!this.hadStroke;(t||this.dirtyLineWidth||this.dirtyRadius)&&(i.style.width=2*e._radius-e.getLineWidth()+"px",i.style.height=2*e._radius-e.getLineWidth()+"px",i.style[we.borderRadius]=e._radius+e.getLineWidth()/2+"px"),(t||this.dirtyLineWidth)&&(i.style.left=-e.getLineWidth()/2+"px",i.style.top=-e.getLineWidth()/2+"px",i.style.borderWidth=e.getLineWidth()+"px"),(t||this.dirtyStroke)&&(i.style.borderColor=e.getSimpleCSSStroke())}if(this.transformDirty||this.dirtyRadius){this.matrix.set(this.getTransformMatrix());const t=Le.Z.translation(-e._radius,-e._radius);this.matrix.multiplyMatrix(t),t.freeToPool(),ve.applyPreparedTransform(this.matrix,this.fillElement)}this.setToCleanState(),this.cleanPaintableState(),this.transformDirty=!1}dispose(){super.dispose()}}W.register("CircleDOMDrawable",cg),Rt.mixInto(cg);const dg=cg;class ug extends(Hl(Kl)){initialize(e,t){super.initialize(e,t,!0,!0),this.svgElement=this.svgElement||document.createElementNS(ke,"circle")}updateSVGSelf(){const e=this.svgElement;this.dirtyRadius&&e.setAttribute("r",this.node._radius),this.updateFillStrokeStyle(e)}}W.register("CircleSVGDrawable",ug),Rt.mixInto(ug);const mg=ug;class pg extends Zl{constructor(e,t){super(e,t),ve.prepareForTransform(this.domElement)}initialize(e,t){super.initialize(e,t),this.domElement=this.node._container}updateDOM(){this.transformDirty&&!this.node._preventTransform&&ve.applyPreparedTransform(this.getTransformMatrix(),this.domElement),this.transformDirty=!1}dispose(){super.dispose(),this.domElement=null}}W.register("DOMDrawable",pg),Rt.mixInto(pg);const Vg=pg;class Mg extends Ol{paintCanvas(e,t,i){const s=1!==t._imageOpacity;if(t._image&&0!==t._image.width&&0!==t._image.height){if(s&&(e.context.save(),e.context.globalAlpha*=t._imageOpacity),t._mipmap&&t.hasMipmaps()){const s=t.getMipmapLevel(i,Fn.CANVAS_MIPMAP_BIAS_ADJUSTMENT),n=t.getMipmapCanvas(s),r=Math.pow(2,s);e.context.drawImage(n,0,0,n.width*r,n.height*r)}else e.context.drawImage(t._image,0,0);s&&e.context.restore()}}markDirtyImage(){this.markPaintDirty()}markDirtyMipmap(){this.markPaintDirty()}markDirtyImageOpacity(){this.markPaintDirty()}}W.register("ImageCanvasDrawable",Mg),Rt.mixInto(Mg);const Bg=Mg;class wg extends(zl(Zl)){constructor(e,t){super(e,t),ve.prepareForTransform(this.domElement)}initialize(e,t){super.initialize(e,t),this.domElement||(this.domElement=document.createElement("img"),this.domElement.style.display="block",this.domElement.style.position="absolute",this.domElement.style.pointerEvents="none",this.domElement.style.left="0",this.domElement.style.top="0"),this.hasOpacity=!1}updateDOM(){const e=this.node,t=this.domElement;this.paintDirty&&this.dirtyImage&&(t.src=e._image?e._image.src:"//:0"),this.dirtyImageOpacity&&(1===e._imageOpacity?this.hasOpacity&&(this.hasOpacity=!1,t.style.opacity=""):(this.hasOpacity=!0,t.style.opacity=e._imageOpacity)),this.transformDirty&&ve.applyPreparedTransform(this.getTransformMatrix(),this.domElement),this.setToCleanState(),this.transformDirty=!1}dispose(){super.dispose()}}W.register("ImageDOMDrawable",wg),Rt.mixInto(wg);const Cg=wg;class Eg extends(zl(Kl)){initialize(e,t){super.initialize(e,t,!1,!0),this.svgElement=this.svgElement||document.createElementNS(ke,"image"),this.svgElement.setAttribute("x","0"),this.svgElement.setAttribute("y","0"),this.hasOpacity=!1,this.usingMipmap=!1,this.mipmapLevel=-1,this._mipmapTransformListener=this._mipmapTransformListener||this.onMipmapTransform.bind(this),this._mipmapListener=this._mipmapListener||this.onMipmap.bind(this),this.node.mipmapEmitter.addListener(this._mipmapListener),this.updateMipmapStatus(t.node._mipmap)}updateSVGSelf(){const e=this.svgElement;this.dirtyImage?this.node._image?this.updateURL(e,!0):(e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttributeNS(Re,"xlink:href","//:0")):this.dirtyMipmap&&this.node._image&&this.updateURL(e,!1),this.dirtyImageOpacity&&(1===this.node._imageOpacity?this.hasOpacity&&(this.hasOpacity=!1,e.removeAttribute("opacity")):(this.hasOpacity=!0,e.setAttribute("opacity",this.node._imageOpacity)))}updateURL(e,t){let i=-1;if(this.node._mipmap&&(i=this.node.getMipmapLevel(this.instance.relativeTransform.matrix)),t||i!==this.mipmapLevel)if(this.mipmapLevel>=0&&-1===i&&e.removeAttribute("transform"),this.mipmapLevel=i,this.node._mipmap&&this.node.hasMipmaps()){const t=this.node.getMipmapURL(i),s=this.node.getMipmapCanvas(i);e.setAttribute("width",s.width+"px"),e.setAttribute("height",s.height+"px"),e.setAttribute("transform",`scale(${Math.pow(2,i).toFixed(20)})`),e.setAttributeNS(Re,"xlink:href",t)}else e.setAttribute("width",this.node.getImageWidth()+"px"),e.setAttribute("height",this.node.getImageHeight()+"px"),e.setAttributeNS(Re,"xlink:href",this.node.getImageURL())}updateMipmapStatus(e){this.usingMipmap!==e&&(this.usingMipmap=e,e?(this.instance.relativeTransform.addListener(this._mipmapTransformListener),this.instance.relativeTransform.addPrecompute()):(this.instance.relativeTransform.removeListener(this._mipmapTransformListener),this.instance.relativeTransform.removePrecompute()),this.markDirtyMipmap())}onMipmap(){this.markDirtyMipmap(),this.updateMipmapStatus(this.node._mipmap)}onMipmapTransform(){this.markDirtyMipmap()}dispose(){this.updateMipmapStatus(!1),this.node.mipmapEmitter.removeListener(this._mipmapListener),super.dispose()}}W.register("ImageSVGDrawable",Eg),Rt.mixInto(Eg);const Yg=Eg;class Dg extends(zl(jl)){initialize(e,t){super.initialize(e,t),this.vertexArray=this.vertexArray||new Float32Array(30),this.upperLeft=new be.Z(0,0),this.lowerLeft=new be.Z(0,0),this.upperRight=new be.Z(0,0),this.lowerRight=new be.Z(0,0),this.xyDirty=!0,this.uvDirty=!0,this.updatedOnce=!1,this.sprite=null}onAddToBlock(e){this.webglBlock=e,this.markDirty(),this.reserveSprite()}onRemoveFromBlock(e){this.unreserveSprite()}reserveSprite(){if(this.sprite){if(this.sprite.image===this.node._image)return;this.unreserveSprite()}const e=this.node.getImageWidth(),t=this.node.getImageHeight();this.sprite=e>0&&t>0?this.webglBlock.addSpriteSheetImage(this.node._image,e,t):null,this.xyDirty=!0,this.uvDirty=!0}unreserveSprite(){this.sprite&&this.webglBlock.removeSpriteSheetImage(this.sprite),this.sprite=null}markTransformDirty(){this.xyDirty=!0,super.markTransformDirty()}markPaintDirty(){this.xyDirty=!0,this.uvDirty=!0,this.markDirty()}update(){if(!super.update())return!1;if(this.reserveSprite(),!this.dirtyImageOpacity&&this.updatedOnce||(this.vertexArray[4]=this.node._imageOpacity,this.vertexArray[9]=this.node._imageOpacity,this.vertexArray[14]=this.node._imageOpacity,this.vertexArray[19]=this.node._imageOpacity,this.vertexArray[24]=this.node._imageOpacity,this.vertexArray[29]=this.node._imageOpacity),this.updatedOnce=!0,!this.sprite)return!1;if(this.uvDirty){this.uvDirty=!1;const e=this.sprite.uvBounds;this.vertexArray[2]=e.minX,this.vertexArray[3]=e.minY,this.vertexArray[7]=e.minX,this.vertexArray[8]=e.maxY,this.vertexArray[12]=e.maxX,this.vertexArray[13]=e.minY,this.vertexArray[17]=e.maxX,this.vertexArray[18]=e.minY,this.vertexArray[22]=e.minX,this.vertexArray[23]=e.maxY,this.vertexArray[27]=e.maxX,this.vertexArray[28]=e.maxY}if(this.xyDirty){this.xyDirty=!1;const e=this.node.getImageWidth(),t=this.node.getImageHeight(),i=this.instance.relativeTransform.matrix;i.multiplyVector2(this.upperLeft.setXY(0,0)),i.multiplyVector2(this.lowerLeft.setXY(0,t)),i.multiplyVector2(this.upperRight.setXY(e,0)),i.multiplyVector2(this.lowerRight.setXY(e,t)),this.vertexArray[0]=this.upperLeft.x,this.vertexArray[1]=this.upperLeft.y,this.vertexArray[5]=this.lowerLeft.x,this.vertexArray[6]=this.lowerLeft.y,this.vertexArray[10]=this.upperRight.x,this.vertexArray[11]=this.upperRight.y,this.vertexArray[15]=this.upperRight.x,this.vertexArray[16]=this.upperRight.y,this.vertexArray[20]=this.lowerLeft.x,this.vertexArray[21]=this.lowerLeft.y,this.vertexArray[25]=this.lowerRight.x,this.vertexArray[26]=this.lowerRight.y}return!0}}Dg.prototype.webglRenderer=Te.webglTexturedTriangles,W.register("ImageWebGLDrawable",Dg),Rt.mixInto(Dg);const yg=Dg;class Ig extends(_l(Ol)){paintCanvas(e,t,i){const s=e.context;s.beginPath(),s.moveTo(t.x1,t.y1),s.lineTo(t.x2,t.y2),t.hasPaintableStroke()&&(t.beforeCanvasStroke(e),s.stroke(),t.afterCanvasStroke(e))}}W.register("LineCanvasDrawable",Ig),Rt.mixInto(Ig);const qg=Ig;class Gg extends(eg(Kl)){initialize(e,t){super.initialize(e,t,!0,!0),this.svgElement=this.svgElement||document.createElementNS(ke,"line")}updateSVGSelf(){const e=this.svgElement;this.dirtyX1&&e.setAttribute("x1",this.node.x1),this.dirtyY1&&e.setAttribute("y1",this.node.y1),this.dirtyX2&&e.setAttribute("x2",this.node.x2),this.dirtyY2&&e.setAttribute("y2",this.node.y2),this.updateFillStrokeStyle(e)}}W.register("LineSVGDrawable",Gg),Rt.mixInto(Gg);const Qg=Gg;class Sg extends(Ul(Ol)){paintCanvas(e,t,i){const s=e.context;t.hasShape()&&(s.beginPath(),t._shape.writeToContext(s),t.hasFill()&&(t.beforeCanvasFill(e),s.fill(),t.afterCanvasFill(e)),t.hasPaintableStroke()&&(t.beforeCanvasStroke(e),s.stroke(),t.afterCanvasStroke(e)))}markDirtyShape(){this.markPaintDirty()}}W.register("PathCanvasDrawable",Sg),Rt.mixInto(Sg);const Tg=Sg;class xg extends(ig(Kl)){initialize(e,t){super.initialize(e,t,!0,!0),this.svgElement=this.svgElement||document.createElementNS(ke,"path")}updateSVGSelf(){const e=this.svgElement;if(this.dirtyShape){let t=this.node.hasShape()?this.node._shape.getSVGPath():"";t||(t="M0 0"),e.setAttribute("d",`${t}${Oe.Z.safari?" M0 0":""}`)}this.updateFillStrokeStyle(e)}}W.register("PathSVGDrawable",xg),Rt.mixInto(xg);const kg=xg;class Fg extends(Ul(Ol)){writeRectangularPath(e,t){e.beginPath(),e.moveTo(t._rectX,t._rectY),e.lineTo(t._rectX+t._rectWidth,t._rectY),e.lineTo(t._rectX+t._rectWidth,t._rectY+t._rectHeight),e.lineTo(t._rectX,t._rectY+t._rectHeight),e.closePath()}paintCanvas(e,t,i){const s=e.context;if(t.isRounded()){s.beginPath();const i=t.getMaximumArcSize(),n=Math.min(t._cornerXRadius,i),r=Math.min(t._cornerYRadius,i),o=t._rectX+n,A=t._rectX+t._rectWidth-n,a=t._rectY+r,h=t._rectY+t._rectHeight-r;n===r?(s.arc(A,a,n,-Math.PI/2,0,!1),s.arc(A,h,n,0,Math.PI/2,!1),s.arc(o,h,n,Math.PI/2,Math.PI,!1),s.arc(o,a,n,Math.PI,3*Math.PI/2,!1)):(s.ellipse(A,a,n,r,0,-Math.PI/2,0,!1),s.ellipse(A,h,n,r,0,0,Math.PI/2,!1),s.ellipse(o,h,n,r,0,Math.PI/2,Math.PI,!1),s.ellipse(o,a,n,r,0,Math.PI,3*Math.PI/2,!1)),s.closePath(),t.hasFill()&&(t.beforeCanvasFill(e),s.fill(),t.afterCanvasFill(e)),t.hasPaintableStroke()&&(t.beforeCanvasStroke(e),s.stroke(),t.afterCanvasStroke(e))}else t.hasFill()&&(t.getFillValue().transformMatrix?(this.writeRectangularPath(s,t),t.beforeCanvasFill(e),s.fill(),t.afterCanvasFill(e)):(t.beforeCanvasFill(e),s.fillRect(t._rectX,t._rectY,t._rectWidth,t._rectHeight),t.afterCanvasFill(e))),t.hasPaintableStroke()&&(t.getStrokeValue().transformMatrix?(this.writeRectangularPath(s,t),t.beforeCanvasStroke(e),s.stroke(),t.afterCanvasStroke(e)):(t.beforeCanvasStroke(e),s.strokeRect(t._rectX,t._rectY,t._rectWidth,t._rectHeight),t.afterCanvasStroke(e)))}markDirtyRectangle(){this.markPaintDirty()}markDirtyX(){this.markDirtyRectangle()}markDirtyY(){this.markDirtyRectangle()}markDirtyWidth(){this.markDirtyRectangle()}markDirtyHeight(){this.markDirtyRectangle()}markDirtyCornerXRadius(){this.markDirtyRectangle()}markDirtyCornerYRadius(){this.markDirtyRectangle()}}W.register("RectangleCanvasDrawable",Fg),Rt.mixInto(Fg);const Rg=Fg,Ug=Le.Z.pool.fetch();class Lg extends(ng(Zl)){constructor(e,t){super(e,t),ve.prepareForTransform(this.domElement)}initialize(e,t){if(super.initialize(e,t),!this.fillElement||!this.strokeElement){const e=document.createElement("div");this.fillElement=e,e.style.display="block",e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.pointerEvents="none";const t=document.createElement("div");this.strokeElement=t,t.style.display="block",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.pointerEvents="none",e.appendChild(t)}this.domElement=this.fillElement}updateDOM(){const e=this.node,t=this.fillElement,i=this.strokeElement;if(this.paintDirty){const s=Math.min(e._cornerXRadius,e._cornerYRadius),n=this.dirtyCornerXRadius||this.dirtyCornerYRadius;if(this.dirtyWidth&&(t.style.width=e._rectWidth+"px"),this.dirtyHeight&&(t.style.height=e._rectHeight+"px"),n&&(t.style[we.borderRadius]=s+"px"),this.dirtyFill&&(t.style.backgroundColor=e.getCSSFill()),this.dirtyStroke&&(e.hasStroke()?i.style.borderStyle="solid":i.style.borderStyle="none"),e.hasStroke()){const t=!this.hadStroke;(t||this.dirtyWidth||this.dirtyLineWidth)&&(i.style.width=e._rectWidth-e.getLineWidth()+"px"),(t||this.dirtyHeight||this.dirtyLineWidth)&&(i.style.height=e._rectHeight-e.getLineWidth()+"px"),(t||this.dirtyLineWidth)&&(i.style.left=-e.getLineWidth()/2+"px",i.style.top=-e.getLineWidth()/2+"px",i.style.borderWidth=e.getLineWidth()+"px"),(t||this.dirtyStroke)&&(i.style.borderColor=e.getSimpleCSSStroke()),(t||n||this.dirtyLineWidth||this.dirtyLineOptions)&&(i.style[we.borderRadius]=e.isRounded()||"round"===e.getLineJoin()?s+e.getLineWidth()/2+"px":"0")}}if(this.transformDirty||this.dirtyX||this.dirtyY){Ug.set(this.getTransformMatrix());const t=Le.Z.translation(e._rectX,e._rectY);Ug.multiplyMatrix(t),t.freeToPool(),ve.applyPreparedTransform(Ug,this.fillElement)}this.setToCleanState(),this.cleanPaintableState(),this.transformDirty=!1}dispose(){super.dispose()}}W.register("RectangleDOMDrawable",Lg),Rt.mixInto(Lg);const Pg=Lg;class bg extends(ng(Kl)){initialize(e,t){super.initialize(e,t,!0,!0),this.lastArcW=-1,this.lastArcH=-1,this.svgElement=this.svgElement||document.createElementNS(ke,"rect")}updateSVGSelf(){const e=this.svgElement;if(this.dirtyX&&e.setAttribute("x",this.node._rectX),this.dirtyY&&e.setAttribute("y",this.node._rectY),this.dirtyWidth&&e.setAttribute("width",this.node._rectWidth),this.dirtyHeight&&e.setAttribute("height",this.node._rectHeight),this.dirtyCornerXRadius||this.dirtyCornerYRadius||this.dirtyWidth||this.dirtyHeight){let t=0,i=0;if(this.node.isRounded()){const e=this.node.getMaximumArcSize();t=Math.min(this.node._cornerXRadius,e),i=Math.min(this.node._cornerYRadius,e)}t!==this.lastArcW&&(this.lastArcW=t,e.setAttribute("rx",t)),i!==this.lastArcH&&(this.lastArcH=i,e.setAttribute("ry",i))}this.updateFillStrokeStyle(e)}}W.register("RectangleSVGDrawable",bg),Rt.mixInto(bg);const Og=bg,fg=new le("transparent");class Zg extends(ng(jl)){initialize(e,t){super.initialize(e,t),this.vertexArray||(this.vertexArray=new Float32Array(36)),this.upperLeft=new be.Z(0,0),this.lowerLeft=new be.Z(0,0),this.upperRight=new be.Z(0,0),this.lowerRight=new be.Z(0,0),this.transformDirty=!0,this.includeVertices=!0}onAddToBlock(e){this.webglBlock=e,this.markDirty()}onRemoveFromBlock(e){}markTransformDirty(){this.transformDirty=!0,super.markTransformDirty()}update(){if(!super.update())return!1;if(this.dirtyFill&&(this.includeVertices=this.node.hasFill(),this.includeVertices)){const e=this.node.fill instanceof ee.Z?this.node.fill.value:this.node.fill,t=fg.set(e),i=t.red/255,s=t.green/255,n=t.blue/255,r=t.alpha;for(let o=0;o<6;o++){const e=6*o;this.vertexArray[2+e]=i,this.vertexArray[3+e]=s,this.vertexArray[4+e]=n,this.vertexArray[5+e]=r}}if(this.transformDirty||this.dirtyX||this.dirtyY||this.dirtyWidth||this.dirtyHeight){this.transformDirty=!1;const e=this.node._rectX,t=this.node._rectY,i=this.node._rectWidth,s=this.node._rectHeight,n=this.instance.relativeTransform.matrix;n.multiplyVector2(this.upperLeft.setXY(e,t)),n.multiplyVector2(this.lowerLeft.setXY(e,t+s)),n.multiplyVector2(this.upperRight.setXY(e+i,t)),n.multiplyVector2(this.lowerRight.setXY(e+i,t+s)),this.vertexArray[0]=this.upperLeft.x,this.vertexArray[1]=this.upperLeft.y,this.vertexArray[6]=this.lowerLeft.x,this.vertexArray[7]=this.lowerLeft.y,this.vertexArray[12]=this.upperRight.x,this.vertexArray[13]=this.upperRight.y,this.vertexArray[18]=this.upperRight.x,this.vertexArray[19]=this.upperRight.y,this.vertexArray[24]=this.lowerLeft.x,this.vertexArray[25]=this.lowerLeft.y,this.vertexArray[30]=this.lowerRight.x,this.vertexArray[31]=this.lowerRight.y}return this.setToCleanState(),this.cleanPaintableState(),!0}}Zg.prototype.webglRenderer=Te.webglVertexColorPolygons,W.register("RectangleWebGLDrawable",Zg),Rt.mixInto(Zg);const Ng=Zg;class Kg extends Ol{paintCanvas(e,t,i){const s=Fn.getApproximateMatrixScale(i)*(window.devicePixelRatio||1),n=t._spriteInstances.length;for(let r=0;r<n;r++){const n=t._spriteInstances[r],o=n.sprite.imageProperty.value,A=1!==n.alpha||1!==o.imageOpacity,a=o._mipmap&&o.hasMipmaps();if(A&&(e.context.save(),e.context.globalAlpha*=n.alpha*o.imageOpacity),n.transformType===ni.TRANSLATION&&i.isTranslation())if(a){const t=o.getMipmapLevelFromScale(s,Fn.CANVAS_MIPMAP_BIAS_ADJUSTMENT),i=o.getMipmapCanvas(t),r=Math.pow(2,t);e.context.drawImage(i,n.matrix.m02()-o.offset.x,n.matrix.m12()-o.offset.y,i.width*r,i.height*r)}else e.context.drawImage(o.image,n.matrix.m02()-o.offset.x,n.matrix.m12()-o.offset.y);else{if(e.context.save(),n.matrix.canvasAppendTransform(e.context),a){const t=o.getMipmapLevelFromScale(s*Fn.getApproximateMatrixScale(n.matrix),Fn.CANVAS_MIPMAP_BIAS_ADJUSTMENT),i=o.getMipmapCanvas(t),r=Math.pow(2,t);e.context.drawImage(i,-o.offset.x,-o.offset.y,i.width*r,i.height*r)}else e.context.drawImage(o.image,-o.offset.x,-o.offset.y);e.context.restore()}A&&e.context.restore()}}}W.register("SpritesCanvasDrawable",Kg),Rt.mixInto(Kg);const Jg=Kg;var jg=i(732);const vg=new be.Z(0,0),Hg=new be.Z(0,0),Wg=new be.Z(0,0),zg=new be.Z(0,0);class Xg extends jl{initialize(e,t){super.initialize(e,t),this.contextChangeListener=this.onWebGLContextChange.bind(this),this.spriteSheet=new gi(!0),this.spriteImageUVMap={},this.vertexArray=new Float32Array(3840),this.transformMatrixArray=new Float32Array(9),this.spriteChangeListener=this.onSpriteChange.bind(this),this.node._sprites.forEach(e=>{e.imageProperty.lazyLink(this.spriteChangeListener),this.addSpriteImage(e.imageProperty.value)}),this.hasDrawn=!1}addSpriteImage(e){this.spriteImageUVMap[e.id]=this.spriteSheet.addImage(e.image,e.image.width,e.image.height).uvBounds}removeSpriteImage(e){this.spriteSheet.removeImage(e.image),delete this.spriteImageUVMap[e.id]}onSpriteChange(e,t){this.removeSpriteImage(t),this.addSpriteImage(e)}setup(){const e=this.webGLBlock.gl;this.spriteSheet.initializeContext(e),this.shaderProgram=new di(e,["attribute vec2 aVertex;","attribute vec2 aTextureCoord;","attribute float aAlpha;","varying vec2 vTextureCoord;","varying float vAlpha;","uniform mat3 uProjectionMatrix;","uniform mat3 uTransformMatrix;","void main() {","  vTextureCoord = aTextureCoord;","  vAlpha = aAlpha;","  vec3 ndc = uProjectionMatrix * ( uTransformMatrix * vec3( aVertex, 1.0 ) );","  gl_Position = vec4( ndc.xy, 0.0, 1.0 );","}"].join("\n"),["precision mediump float;","varying vec2 vTextureCoord;","varying float vAlpha;","uniform sampler2D uTexture;","void main() {","  vec4 color = texture2D( uTexture, vTextureCoord, -0.7 );","  color.a *= vAlpha;","  gl_FragColor = color;","}"].join("\n"),{attributes:["aVertex","aTextureCoord","aAlpha"],uniforms:["uTexture","uProjectionMatrix","uTransformMatrix"]}),this.vertexBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.DYNAMIC_DRAW)}onWebGLContextChange(){this.setup()}onAddToBlock(e){this.webGLBlock=e,this.setup(),e.glChangedEmitter.addListener(this.contextChangeListener)}onRemoveFromBlock(e){e.glChangedEmitter.removeListener(this.contextChangeListener)}draw(){const e=this.node._spriteInstances.length;if(0===e)return 0;this.spriteSheet.updateTexture(),this.shaderProgram.use();let t=0,i=!1;for(;30*e>this.vertexArray.length;)this.vertexArray=new Float32Array(2*this.vertexArray.length),i=!0;for(let o=0;o<e;o++){const e=this.node._spriteInstances[o],i=e.sprite.imageProperty.value,s=e.alpha*i.imageOpacity,n=this.spriteImageUVMap[i.id],r=e.matrix,A=i.offset,a=i.image.width,h=i.image.height;r.multiplyVector2(vg.setXY(-A.x,-A.y)),r.multiplyVector2(Hg.setXY(-A.x,h-A.y)),r.multiplyVector2(Wg.setXY(a-A.x,-A.y)),r.multiplyVector2(zg.setXY(a-A.x,h-A.y)),this.vertexArray[t+0]=vg.x,this.vertexArray[t+1]=vg.y,this.vertexArray[t+2]=n.minX,this.vertexArray[t+3]=n.minY,this.vertexArray[t+4]=s,this.vertexArray[t+5]=Hg.x,this.vertexArray[t+6]=Hg.y,this.vertexArray[t+7]=n.minX,this.vertexArray[t+8]=n.maxY,this.vertexArray[t+9]=s,this.vertexArray[t+10]=Wg.x,this.vertexArray[t+11]=Wg.y,this.vertexArray[t+12]=n.maxX,this.vertexArray[t+13]=n.minY,this.vertexArray[t+14]=s,this.vertexArray[t+15]=Wg.x,this.vertexArray[t+16]=Wg.y,this.vertexArray[t+17]=n.maxX,this.vertexArray[t+18]=n.minY,this.vertexArray[t+19]=s,this.vertexArray[t+20]=Hg.x,this.vertexArray[t+21]=Hg.y,this.vertexArray[t+22]=n.minX,this.vertexArray[t+23]=n.maxY,this.vertexArray[t+24]=s,this.vertexArray[t+25]=zg.x,this.vertexArray[t+26]=zg.y,this.vertexArray[t+27]=n.maxX,this.vertexArray[t+28]=n.maxY,this.vertexArray[t+29]=s,t+=30}const s=this.webGLBlock.gl;s.uniformMatrix3fv(this.shaderProgram.uniformLocations.uProjectionMatrix,!1,this.webGLBlock.projectionMatrixArray),this.instance.relativeTransform.matrix.copyToArray(this.transformMatrixArray),s.uniformMatrix3fv(this.shaderProgram.uniformLocations.uTransformMatrix,!1,this.transformMatrixArray),s.bindBuffer(s.ARRAY_BUFFER,this.vertexBuffer),i?s.bufferData(s.ARRAY_BUFFER,this.vertexArray,s.DYNAMIC_DRAW):s.bufferSubData(s.ARRAY_BUFFER,0,this.vertexArray.subarray(0,t));const n=Float32Array.BYTES_PER_ELEMENT,r=5*n;return s.vertexAttribPointer(this.shaderProgram.attributeLocations.aVertex,2,s.FLOAT,!1,r,0*n),s.vertexAttribPointer(this.shaderProgram.attributeLocations.aTextureCoord,2,s.FLOAT,!1,r,2*n),s.vertexAttribPointer(this.shaderProgram.attributeLocations.aAlpha,1,s.FLOAT,!1,r,4*n),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.spriteSheet.texture),s.uniform1i(this.shaderProgram.uniformLocations.uTexture,0),s.drawArrays(s.TRIANGLES,0,t/5),s.bindTexture(s.TEXTURE_2D,null),this.shaderProgram.unuse(),!this.hasDrawn&&Oe.Z.safari&&jg.Z.setTimeout(()=>this.markDirty(),0),this.hasDrawn=!0,1}dispose(){this.node._sprites.forEach(e=>{e.imageProperty.unlink(this.spriteChangeListener)}),this.webGLBlock&&(this.webGLBlock=null),super.dispose()}markPaintDirty(){this.markDirty()}}Xg.prototype.webglRenderer=Te.webglCustom,W.register("SpritesWebGLDrawable",Xg),Rt.mixInto(Xg);const _g=Xg;class $g extends(Ul(Ol)){paintCanvas(e,t,i){const s=e.context;(t.hasFill()||t.hasPaintableStroke())&&(e.setFont(t._font.getFont()),e.setDirection("ltr")),t.hasFill()&&(t.beforeCanvasFill(e),s.fillText(t.renderedText,0,0),t.afterCanvasFill(e)),t.hasPaintableStroke()&&(t.beforeCanvasStroke(e),s.strokeText(t.renderedText,0,0),t.afterCanvasStroke(e))}markDirtyText(){this.markPaintDirty()}markDirtyFont(){this.markPaintDirty()}markDirtyBounds(){this.markPaintDirty()}}W.register("TextCanvasDrawable",$g),Rt.mixInto($g);const ec=$g,tc=Le.Z.pool.fetch();class ic extends(og(Zl)){constructor(e,t){super(e,t),ve.prepareForTransform(this.domElement)}initialize(e,t){super.initialize(e,t),this.domElement||(this.domElement=document.createElement("div"),this.domElement.style.display="block",this.domElement.style.position="absolute",this.domElement.style.pointerEvents="none",this.domElement.style.left="0",this.domElement.style.top="0",this.domElement.setAttribute("dir","ltr"))}updateDOM(){const e=this.node,t=this.domElement;if(this.paintDirty&&(this.dirtyFont&&(t.style.font=e.getFont()),this.dirtyStroke&&(t.style.color=e.getCSSFill()),this.dirtyBounds&&(t.style.width=e.getSelfBounds().width+"px",t.style.height=e.getSelfBounds().height+"px"),this.dirtyText&&(t.textContent=e.renderedText)),this.transformDirty||this.dirtyText||this.dirtyFont||this.dirtyBounds){const i=e.getSelfBounds().minY;tc.set(this.getTransformMatrix());const s=Le.Z.translation(0,i);tc.multiplyMatrix(s),s.freeToPool(),ve.applyPreparedTransform(tc,t)}this.setToCleanState(),this.cleanPaintableState(),this.transformDirty=!1}dispose(){super.dispose()}}W.register("TextDOMDrawable",ic),Rt.mixInto(ic);const sc=ic,nc=!Oe.Z.edge,rc=Oe.Z.safari;class oc extends(og(Kl)){initialize(e,t){if(super.initialize(e,t,!0,!0),this.hasLength=!1,!this.svgElement){const e=document.createElementNS(ke,"text");if(this.text=e,rc){const t=document.createElementNS(ke,"g");t.appendChild(e),this.svgElement=t,this.workaroundRect=document.createElementNS(ke,"rect"),this.workaroundRect.setAttribute("fill","transparent"),t.appendChild(this.workaroundRect)}else this.svgElement=e;e.appendChild(document.createTextNode("")),e.setAttribute("dominant-baseline","alphabetic"),e.setAttribute("text-rendering","geometricPrecision"),e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("direction","ltr")}}updateSVGSelf(){const e=this.text;if(this.dirtyFont&&(e.setAttribute("font-family",this.node._font.getFamily()),e.setAttribute("font-size",this.node._font.getSize()),e.setAttribute("font-style",this.node._font.getStyle()),e.setAttribute("font-weight",this.node._font.getWeight()),e.setAttribute("font-stretch",this.node._font.getStretch())),this.dirtyText){let t=ve.safariEmbeddingMarkWorkaround(this.node.renderedText);Oe.Z.firefox&&(t="​"+t),e.lastChild.nodeValue=t}if(this.dirtyBounds&&nc){if("accurate"!==this.node._boundsMethod&&isFinite(this.node.selfBounds.width)?(this.hasLength||(this.hasLength=!0,e.setAttribute("lengthAdjust","spacingAndGlyphs")),e.setAttribute("textLength",this.node.selfBounds.width)):this.hasLength&&(this.hasLength=!1,e.removeAttribute("lengthAdjust"),e.removeAttribute("textLength")),rc){const e=.2,t=this.node.selfBounds.width*e,i=this.node.selfBounds.height*e;this.workaroundRect.setAttribute("x",this.node.selfBounds.minX-t),this.workaroundRect.setAttribute("y",this.node.selfBounds.minY-i),this.workaroundRect.setAttribute("width",this.node.selfBounds.width+2*t),this.workaroundRect.setAttribute("height",this.node.selfBounds.height+2*i)}}this.updateFillStrokeStyle(e)}}W.register("TextSVGDrawable",oc),Rt.mixInto(oc);const Ac=oc;class ac extends jl{initialize(e,t){super.initialize(e,t),this.contextChangeListener=this.contextChangeListener||this.onWebGLContextChange.bind(this),this.painter=null}createPainter(){return new(0,this.node.painterType)(this.webGLBlock.gl,this.node)}onWebGLContextChange(){this.painter=this.createPainter()}onAddToBlock(e){this.webGLBlock=e,this.painter=this.createPainter(),e.glChangedEmitter.addListener(this.contextChangeListener)}onRemoveFromBlock(e){e.glChangedEmitter.removeListener(this.contextChangeListener)}draw(){const e=this.instance.relativeTransform.matrix,t=this.painter.paint(e,this.webGLBlock.projectionMatrix);return t}dispose(){this.painter.dispose(),this.painter=null,this.webGLBlock&&(this.webGLBlock=null),super.dispose()}markPaintDirty(){this.markDirty()}get shaderAttributes(){return this.node.shaderAttributes}}ac.prototype.webglRenderer=Te.webglCustom,W.register("WebGLNodeDrawable",ac),Rt.mixInto(ac);const hc=ac;class lc extends xl{constructor(e,t){super(),this.initialize(e,t)}initialize(e,t){super.initialize(e),this.instance=t}stitch(e,t,i,s){}}W.register("InlineCanvasCacheDrawable",lc);const gc=lc;class cc extends xl{constructor(e,t,i,s){super(),this.initialize(e,t,i,s)}initialize(e,t,i,s){super.initialize(t),this.instance=i,this.sharedInstance=s}}W.register("SharedCanvasCacheDrawable",cc);const dc=cc;class uc{constructor(e){this.instance=e}initialize(e,t){return this.display=e,this.trail=t,this.node=t&&t.lastNode(),this.transformDirty=!0,this.nodeTransformListener=this.nodeTransformListener||this.onNodeTransformDirty.bind(this),this.matrix=this.matrix||Le.Z.identity(),this.relativeSelfDirty=!0,this.relativeChildrenListenersCount=0,this.relativePrecomputeCount=0,this.relativeChildrenPrecomputeCount=0,this.relativeFrameId=-1,this.relativeChildDirtyFrame=e?e._frameId:0,this.relativeTransformListeners=(0,Ji.Z)(this.relativeTransformListeners),this}get parent(){return this.instance.parent?this.instance.parent.relativeTransform:null}addInstance(e){e.stateless||(e.relativeTransform.hasAncestorListenerNeed()&&this.incrementTransformListenerChildren(),e.relativeTransform.hasAncestorComputeNeed()&&this.incrementTransformPrecomputeChildren()),e.relativeTransform.forceMarkTransformDirty()}removeInstance(e){e.relativeTransform.hasAncestorListenerNeed()&&this.decrementTransformListenerChildren(),e.relativeTransform.hasAncestorComputeNeed()&&this.decrementTransformPrecomputeChildren()}attachNodeListeners(){this.node.transformEmitter.addListener(this.nodeTransformListener)}detachNodeListeners(){this.node.transformEmitter.removeListener(this.nodeTransformListener)}hasDescendantListenerNeed(){return this.instance.isTransformed?this.relativeChildrenListenersCount>0:this.relativeChildrenListenersCount>0||this.relativeTransformListeners.length>0}hasAncestorListenerNeed(){return this.instance.isTransformed?this.relativeTransformListeners.length>0:this.relativeChildrenListenersCount>0||this.relativeTransformListeners.length>0}hasSelfListenerNeed(){return this.relativeTransformListeners.length>0}incrementTransformListenerChildren(){const e=this.hasAncestorListenerNeed();this.relativeChildrenListenersCount++,e!==this.hasAncestorListenerNeed()&&this.parent&&this.parent.incrementTransformListenerChildren()}decrementTransformListenerChildren(){const e=this.hasAncestorListenerNeed();this.relativeChildrenListenersCount--,e!==this.hasAncestorListenerNeed()&&this.parent&&this.parent.decrementTransformListenerChildren()}addListener(e){const t=this.hasAncestorListenerNeed();this.relativeTransformListeners.push(e),t!==this.hasAncestorListenerNeed()&&(this.parent&&this.parent.incrementTransformListenerChildren(),this.hasAncestorComputeNeed()||this.forceMarkTransformDirty())}removeListener(e){const t=this.hasAncestorListenerNeed();this.relativeTransformListeners.splice(_.indexOf(this.relativeTransformListeners,e),1),t!==this.hasAncestorListenerNeed()&&this.parent&&this.parent.decrementTransformListenerChildren()}hasDescendantComputeNeed(){return this.instance.isTransformed?this.relativeChildrenPrecomputeCount>0:this.relativeChildrenPrecomputeCount>0||this.relativePrecomputeCount>0}hasAncestorComputeNeed(){return this.instance.isTransformed?this.relativePrecomputeCount>0:this.relativeChildrenPrecomputeCount>0||this.relativePrecomputeCount>0}hasSelfComputeNeed(){return this.relativePrecomputeCount>0}incrementTransformPrecomputeChildren(){const e=this.hasAncestorComputeNeed();this.relativeChildrenPrecomputeCount++,e!==this.hasAncestorComputeNeed()&&this.parent&&this.parent.incrementTransformPrecomputeChildren()}decrementTransformPrecomputeChildren(){const e=this.hasAncestorComputeNeed();this.relativeChildrenPrecomputeCount--,e!==this.hasAncestorComputeNeed()&&this.parent&&this.parent.decrementTransformPrecomputeChildren()}addPrecompute(){const e=this.hasAncestorComputeNeed();this.relativePrecomputeCount++,e!==this.hasAncestorComputeNeed()&&(this.parent&&this.parent.incrementTransformPrecomputeChildren(),this.hasAncestorListenerNeed()||this.forceMarkTransformDirty())}removePrecompute(){const e=this.hasAncestorComputeNeed();this.relativePrecomputeCount--,e!==this.hasAncestorComputeNeed()&&this.parent&&this.parent.decrementTransformPrecomputeChildren()}onNodeTransformDirty(){this.transformDirty||this.forceMarkTransformDirty()}forceMarkTransformDirty(){this.transformDirty=!0,this.relativeSelfDirty=!0;const e=this.display._frameId;let t=this.instance.parent;for(;t&&t.relativeTransform.relativeChildDirtyFrame!==e;){const i=t.parent,s=t.isTransformed;if(t.relativeTransform.relativeChildDirtyFrame=e,null===i){this.display.markTransformRootDirty(t,s);break}if(s){this.display.markTransformRootDirty(t,!0);break}t=i}}computeRelativeTransform(){const e=this.node.getMatrix();this.instance.parent&&!this.instance.parent.isTransformed?(this.matrix.set(this.parent.matrix),this.matrix.multiplyMatrix(e)):this.matrix.set(e),this.relativeFrameId=this.display._frameId,this.relativeSelfDirty=!1}isValidationNotNeeded(){return this.hasAncestorComputeNeed()||this.relativeFrameId===this.display._frameId}validate(){if(!this.isValidationNotNeeded()&&(this.instance.parent&&!this.instance.parent.isTransformed&&this.parent.validate(),this.relativeSelfDirty)){this.computeRelativeTransform();const e=this.instance.children.length;for(let t=0;t<e;t++)this.instance.children[t].relativeTransform.relativeSelfDirty=!0}}updateTransformListenersAndCompute(e,t,i,s){let n,r;if(s)for(n=this.instance.children.length,r=0;r<n;r++)this.instance.children[r].relativeTransform.updateTransformListenersAndCompute(!1,!1,i,!1);else{const o=e||this.relativeSelfDirty,A=o||this.relativeChildDirtyFrame===i,a=this.hasDescendantComputeNeed(),h=this.hasDescendantListenerNeed(),l=this.hasSelfComputeNeed(),g=this.hasSelfListenerNeed();if(a||!o||t||(this.relativeSelfDirty=!0),!A||!a&&!h&&!l&&!g)return;if(o&&(a||l)&&this.computeRelativeTransform(),this.transformDirty&&(this.transformDirty=!1),this.notifyRelativeTransformListeners(),!this.instance.isTransformed||s){const e=o&&!(a||l);for(n=this.instance.children.length,r=0;r<n;r++)this.instance.children[r].relativeTransform.updateTransformListenersAndCompute(o,e,i,!1)}}}notifyRelativeTransformListeners(){const e=this.relativeTransformListeners.length;for(let t=0;t<e;t++)this.relativeTransformListeners[t]()}audit(e,t){}}W.register("RelativeTransform",uc);const mc=uc;class pc{constructor(e,t){this.initialize(e,t)}initialize(e,t){this.nextChangeInterval=null,this.drawableBefore=e,this.drawableAfter=t,this.collapsedEmpty=!1}dispose(){this.nextChangeInterval=null,this.drawableBefore=null,this.drawableAfter=null,this.freeToPool()}constrict(){let e=!1;if(this.isEmpty())return!0;for(;this.drawableBefore&&this.drawableBefore.nextDrawable===this.drawableBefore.oldNextDrawable;)if(this.drawableBefore=this.drawableBefore.nextDrawable,e=!0,this.drawableBefore||(this.collapsedEmpty=!0),this.isEmpty())return!0;for(;this.drawableAfter&&this.drawableAfter.previousDrawable===this.drawableAfter.oldPreviousDrawable;)if(this.drawableAfter=this.drawableAfter.previousDrawable,e=!0,this.drawableAfter||(this.collapsedEmpty=!0),this.isEmpty())return!0;return e}isEmpty(){return this.collapsedEmpty||null!==this.drawableBefore&&this.drawableBefore===this.drawableAfter}getOldInternalDrawableCount(e,t){const i=this.drawableBefore?this.drawableBefore.oldNextDrawable:e,s=this.drawableAfter;let n=0;for(let r=i;r!==s;r=r.oldNextDrawable)n++;return n}getNewInternalDrawableCount(e,t){const i=this.drawableBefore?this.drawableBefore.nextDrawable:e,s=this.drawableAfter;let n=0;for(let r=i;r!==s;r=r.nextDrawable)n++;return n}static newForDisplay(e,t,i){const s=pc.createFromPool(e,t);return i.markChangeIntervalToDispose(s),s}}W.register("ChangeInterval",pc),Rt.mixInto(pc);const Vc=pc;class Mc{constructor(e){this.instance=e}initialize(e,t){return this.display=e,this.trail=t,this.node=t&&t.lastNode(),this.selfFittable=!!t&&this.isSelfFitSupported(),this.ancestorsFittable=this.selfFittable,this.subtreeUnfittableCount=this.selfFittable?0:1,this.subtreeFittabilityChangeEmitter=this.subtreeFittabilityChangeEmitter||new te.Z,this}get parent(){return this.instance.parent?this.instance.parent.fittability:null}checkSelfFittability(){const e=this.isSelfFitSupported();this.selfFittable!==e&&this.updateSelfFittable()}isSelfFitSupported(){return!this.node.isPreventFit()}markSubtreeFittable(){if(!this.selfFittable)return;this.ancestorsFittable=!0;const e=this.instance.children;for(let t=0;t<e.length;t++)e[t].fittability.markSubtreeFittable();this.instance.updateDrawableFittability(!0)}markSubtreeUnfittable(){if(!this.ancestorsFittable)return;this.ancestorsFittable=!1;const e=this.instance.children;for(let t=0;t<e.length;t++)e[t].fittability.markSubtreeUnfittable();this.instance.updateDrawableFittability(!1)}updateSelfFittable(){const e=this.isSelfFitSupported();this.selfFittable=e,!this.selfFittable||this.parent&&!this.parent.ancestorsFittable?this.selfFittable||this.markSubtreeUnfittable():this.markSubtreeFittable(),this.selfFittable?this.decrementSubtreeUnfittableCount():this.incrementSubtreeUnfittableCount()}incrementSubtreeUnfittableCount(){this.subtreeUnfittableCount++,1===this.subtreeUnfittableCount&&(this.parent&&this.parent.incrementSubtreeUnfittableCount(),this.subtreeFittabilityChangeEmitter.emit())}decrementSubtreeUnfittableCount(){this.subtreeUnfittableCount--,0===this.subtreeUnfittableCount&&(this.parent&&this.parent.decrementSubtreeUnfittableCount(),this.subtreeFittabilityChangeEmitter.emit())}onInsert(e){this.ancestorsFittable||e.markSubtreeUnfittable(),e.subtreeUnfittableCount>0&&this.incrementSubtreeUnfittableCount()}onRemove(e){this.ancestorsFittable||e.markSubtreeFittable(),e.subtreeUnfittableCount>0&&this.decrementSubtreeUnfittableCount()}audit(){0}}W.register("Fittability",Mc);const Bc=Mc;let wc=1;class Cc{constructor(e,t,i){this.id="group"+wc++,this.initialize(e,t,i)}initialize(e,t,i){this.block=e,this.instance=t,this.node=t.trail.lastNode(),this.parent=i,this.children=(0,Ji.Z)(this.children),this.hasSelfDrawable=!1,this.selfDrawable=null,this.dirty=!0,this.willApplyTransforms=this.block.transformRootInstance.trail.nodes.length<this.instance.trail.nodes.length,this.willApplyFilters=this.block.filterRootInstance.trail.nodes.length<this.instance.trail.nodes.length,this.transformDirty=!0,this.hasTransform=void 0!==this.hasTransform&&this.hasTransform,this.transformDirtyListener=this.transformDirtyListener||this.markTransformDirty.bind(this),this.willApplyTransforms&&this.node.transformEmitter.addListener(this.transformDirtyListener),this.filterDirty=!0,this.visibilityDirty=!0,this.clipDirty=!0,this.filterElement=this.filterElement||null,this.hasOpacity=void 0!==this.hasOpacity&&this.hasOpacity,this.hasFilter=!1,this.clipDefinition=void 0!==this.clipDefinition?this.clipDefinition:null,this.clipPath=void 0!==this.clipPath?this.clipPath:null,this.filterChangeListener=this.filterChangeListener||this.onFilterChange.bind(this),this.visibilityDirtyListener=this.visibilityDirtyListener||this.onVisibleChange.bind(this),this.clipDirtyListener=this.clipDirtyListener||this.onClipChange.bind(this),this.node.visibleProperty.lazyLink(this.visibilityDirtyListener),this.willApplyFilters&&this.node.filterChangeEmitter.addListener(this.filterChangeListener),this.node.clipAreaProperty.lazyLink(this.clipDirtyListener),this.orderDirty=!0,this.orderDirtyListener=this.orderDirtyListener||this.markOrderDirty.bind(this),this.node.childrenChangedEmitter.addListener(this.orderDirtyListener),this.svgGroup||(this.svgGroup=document.createElementNS(ke,"g")),this.instance.addSVGGroup(this),this.block.markDirtyGroup(this)}addSelfDrawable(e){this.selfDrawable=e,this.svgGroup.insertBefore(e.svgElement,this.children.length?this.children[0].svgGroup:null),this.hasSelfDrawable=!0}removeSelfDrawable(e){this.hasSelfDrawable=!1,this.svgGroup.removeChild(e.svgElement),this.selfDrawable=null}addChildGroup(e){this.markOrderDirty(),e.parent=this,this.children.push(e),this.svgGroup.appendChild(e.svgGroup)}removeChildGroup(e){this.markOrderDirty(),e.parent=null,this.children.splice(_.indexOf(this.children,e),1),this.svgGroup.removeChild(e.svgGroup)}markDirty(){this.dirty||(this.dirty=!0,this.block.markDirtyGroup(this))}markOrderDirty(){this.orderDirty||(this.orderDirty=!0,this.markDirty())}markTransformDirty(){this.transformDirty||(this.transformDirty=!0,this.markDirty())}onFilterChange(){this.filterDirty||(this.filterDirty=!0,this.markDirty())}onVisibleChange(){this.visibilityDirty||(this.visibilityDirty=!0,this.markDirty())}onClipChange(){this.clipDirty||(this.clipDirty=!0,this.markDirty())}update(){if(!this.block)return;const e=this.svgGroup;if(this.dirty=!1,this.transformDirty)if(this.transformDirty=!1,this.willApplyTransforms){this.node.transform.isIdentity()?this.hasTransform&&(this.hasTransform=!1,e.removeAttribute("transform")):(this.hasTransform=!0,e.setAttribute("transform",this.node.transform.getMatrix().getSVGTransform()))}else this.hasTransform&&(this.hasTransform=!1,e.removeAttribute("transform"));if(this.visibilityDirty&&(this.visibilityDirty=!1,e.style.display=this.node.isVisible()?"":"none"),this.filterDirty){this.filterDirty=!1;const t=this.node.effectiveOpacity;this.willApplyFilters&&1!==t?(this.hasOpacity=!0,e.setAttribute("opacity",t)):this.hasOpacity&&(this.hasOpacity=!1,e.removeAttribute("opacity"));const i=this.willApplyFilters&&this.node._filters.length,s="filter-"+this.id;if(i){for(this.filterElement||(this.filterElement=document.createElementNS(ke,"filter"),this.filterElement.setAttribute("id",s));this.filterElement.firstChild;)this.filterElement.removeChild(this.filterElement.lastChild);let e=50,t="SourceGraphic";const i=this.node._filters.length;for(let s=0;s<i;s++){const n=this.node._filters[s],r=s===i-1?void 0:"e"+s;n.applySVGFilter(this.filterElement,t,r),e+=n.filterRegionPercentageIncrease,t=r}const n=`-${(0,rs.Z)(e)}%`,r=(0,rs.Z)(2*e+100)+"%";this.filterElement.setAttribute("x",n),this.filterElement.setAttribute("y",n),this.filterElement.setAttribute("width",r),this.filterElement.setAttribute("height",r)}i&&(this.hasFilter||this.block.defs.appendChild(this.filterElement),e.setAttribute("filter",`url(#${s})`),this.hasFilter=!0),this.hasFilter&&!i&&(e.removeAttribute("filter"),this.hasFilter=!1,this.block.defs.removeChild(this.filterElement))}if(this.clipDirty)if(this.clipDirty=!1,this.node.clipArea){if(!this.clipDefinition){const t="clip"+this.node.getId();this.clipDefinition=document.createElementNS(ke,"clipPath"),this.clipDefinition.setAttribute("id",t),this.clipDefinition.setAttribute("clipPathUnits","userSpaceOnUse"),this.block.defs.appendChild(this.clipDefinition),this.clipPath=document.createElementNS(ke,"path"),this.clipDefinition.appendChild(this.clipPath),e.setAttribute("clip-path",`url(#${t})`)}this.clipPath.setAttribute("d",this.node.clipArea.getSVGPath())}else this.clipDefinition&&(e.removeAttribute("clip-path"),this.block.defs.removeChild(this.clipDefinition),this.clipDefinition=null,this.clipPath=null);if(this.orderDirty){this.orderDirty=!1;let t=this.children.length-1;const i=this.instance.children;for(let s=i.length-1;s>=0;s--){const n=i[s].lookupSVGGroup(this.block);if(n){if(this.children[t]!==n){e.insertBefore(n.svgGroup,t+1>=this.children.length?null:this.children[t+1].svgGroup);const i=_.indexOf(this.children,n);this.children.splice(i,1),this.children.splice(t,0,n)}t--}}}}isReleasable(){return!this.hasSelfDrawable&&!this.children.length&&this.parent}dispose(){this.hasFilter&&(this.svgGroup.removeAttribute("filter"),this.hasFilter=!1,this.block.defs.removeChild(this.filterElement)),this.willApplyTransforms&&this.node.transformEmitter.removeListener(this.transformDirtyListener),this.node.visibleProperty.unlink(this.visibilityDirtyListener),this.willApplyFilters&&this.node.filterChangeEmitter.removeListener(this.filterChangeListener),this.node.clipAreaProperty.unlink(this.clipDirtyListener),this.node.childrenChangedEmitter.removeListener(this.orderDirtyListener),this.instance.active&&this.instance.removeSVGGroup(this),this.clipDefinition&&(this.svgGroup.removeAttribute("clip-path"),this.block.defs.removeChild(this.clipDefinition),this.clipDefinition=null,this.clipPath=null),this.parent=null,this.block=null,this.instance=null,this.node=null,(0,Ji.Z)(this.children),this.selfDrawable=null,this.freeToPool()}toString(){return`SVGGroup:${this.block.toString()}_${this.instance.toString()}`}static addDrawable(e,t){Cc.ensureGroupsToInstance(e,t.instance).addSelfDrawable(t)}static removeDrawable(e,t){t.instance.lookupSVGGroup(e).removeSelfDrawable(t),Cc.releaseGroupsToInstance(e,t.instance)}static ensureGroupsToInstance(e,t){let i=t.lookupSVGGroup(e);if(!i){const s=Cc.ensureGroupsToInstance(e,t.parent);i=Cc.createFromPool(e,t,s),s.addChildGroup(i)}return i}static releaseGroupsToInstance(e,t){const i=t.lookupSVGGroup(e);if(i.isReleasable()){const t=i.parent;t.removeChildGroup(i),Cc.releaseGroupsToInstance(e,t.instance),i.dispose()}}}W.register("SVGGroup",Cc),Rt.mixInto(Cc);const Ec=Cc;class Yc extends xl{initialize(e,t){super.initialize(t),this.display=e,this.drawableCount=0,this.used=!0,this.firstDrawable=null,this.lastDrawable=null,this.pendingFirstDrawable=null,this.pendingLastDrawable=null,this.previousBlock=null,this.nextBlock=null,this.zIndex=0}dispose(){this.display=null,this.firstDrawable=null,this.lastDrawable=null,this.pendingFirstDrawable=null,this.pendingLastDrawable=null,this.previousBlock=null,this.nextBlock=null,super.dispose()}addDrawable(e){this.drawableCount++,this.markDirtyDrawable(e)}removeDrawable(e){this.drawableCount--,this.markDirty()}onIntervalChange(e,t){}updateInterval(){this.pendingFirstDrawable===this.firstDrawable&&this.pendingLastDrawable===this.lastDrawable||(this.onIntervalChange(this.pendingFirstDrawable,this.pendingLastDrawable),this.firstDrawable=this.pendingFirstDrawable,this.lastDrawable=this.pendingLastDrawable)}notifyInterval(e,t){this.pendingFirstDrawable=e,this.pendingLastDrawable=t,this.updateInterval()}audit(e,t,i){0}}W.register("Block",Yc);const Dc=Yc,yc=Ue.Z.NOTHING.copy();class Ic extends Dc{initialize(e,t,i,s){return super.initialize(e,t),this.transformRootInstance=i,this.canBeFullDisplay=i.isDisplayRoot,this.preferredFit=s,this.fit=s,this.dirtyFit=!0,this.commonFitInstance=null,this.fitBounds=Ue.Z.NOTHING.copy(),this.oldFitBounds=Ue.Z.NOTHING.copy(),this.unfittableDrawableCount=0,this.dirtyFitListener=this.dirtyFitListener||this.markDirtyFit.bind(this),this.fittableListener=this.fittableListener||this.onFittabilityChange.bind(this),this.display.sizeProperty.lazyLink(this.dirtyFitListener),this}setFit(e){this.canBeFullDisplay||e!==Ic.FULL_DISPLAY||(e=Ic.COMMON_ANCESTOR),this.fit!==e&&(this.fit=e,this.markDirtyFit(),this.oldFitBounds.set(Ue.Z.NOTHING),e===Ic.COMMON_ANCESTOR&&this.removeCommonFitInstance())}markDirtyFit(){this.dirtyFit=!0,this.markDirty()}updateFit(){if(this.dirtyFit||this.fit!==Ic.FULL_DISPLAY)if(this.dirtyFit=!1,this.fit===Ic.COMMON_ANCESTOR&&null===this.commonFitInstance&&this.addCommonFitInstance(this.computeCommonAncestorInstance()),this.fit===Ic.COMMON_ANCESTOR&&this.commonFitInstance.fittability.subtreeUnfittableCount>0&&this.canBeFullDisplay&&(this.oldFitBounds.set(Ue.Z.NOTHING),this.fit=Ic.FULL_DISPLAY),this.fit===Ic.FULL_DISPLAY)this.fitBounds.set(Ue.Z.NOTHING),this.setSizeFullDisplay();else{if(this.fit!==Ic.COMMON_ANCESTOR)throw new Error("unknown fit");{this.fitBounds.set(this.commonFitInstance.node.getLocalBounds());let e=this.commonFitInstance;for(;e!==this.transformRootInstance;)this.fitBounds.transform(e.node.getMatrix()),e=e.parent;this.fitBounds.roundOut(),this.fitBounds.dilate(4),this.transformRootInstance.isDisplayRoot&&(yc.setMinMax(0,0,this.display.width,this.display.height),this.fitBounds.constrainBounds(yc)),this.fitBounds.isValid()||this.fitBounds.setMinMax(0,0,0,0),this.fitBounds.equals(this.oldFitBounds)||(this.oldFitBounds.set(this.fitBounds),this.setSizeFitBounds())}}}setSizeFullDisplay(){}setSizeFitBounds(){}addCommonFitInstance(e){e&&(this.commonFitInstance=e,this.commonFitInstance.fittability.subtreeFittabilityChangeEmitter.addListener(this.dirtyFitListener))}removeCommonFitInstance(){this.commonFitInstance&&(this.commonFitInstance.fittability.subtreeFittabilityChangeEmitter.removeListener(this.dirtyFitListener),this.commonFitInstance=null)}dispose(){this.display.sizeProperty.unlink(this.dirtyFitListener),this.removeCommonFitInstance(),this.transformRootInstance=null,super.dispose()}addDrawable(e){super.addDrawable(e),e.fittableProperty.lazyLink(this.fittableListener),e.fittable||this.incrementUnfittable()}removeDrawable(e){super.removeDrawable(e),e.fittableProperty.unlink(this.fittableListener),e.fittable||this.decrementUnfittable()}onFittabilityChange(e){e?this.decrementUnfittable():this.incrementUnfittable()}incrementUnfittable(){this.unfittableDrawableCount++,1===this.unfittableDrawableCount&&this.checkFitConstraints()}decrementUnfittable(){this.unfittableDrawableCount--,0===this.unfittableDrawableCount&&this.checkFitConstraints()}checkFitConstraints(){this.unfittableDrawableCount>0&&this.canBeFullDisplay?this.setFit(Ic.FULL_DISPLAY):this.setFit(this.preferredFit)}computeCommonAncestorInstance(){let e=this.firstDrawable.instance,t=this.lastDrawable.instance;const i=Math.min(e.trail.length,t.trail.length);for(;e.trail.length>i;)e=e.parent;for(;t.trail.length>i;)t=t.parent;for(;e!==t;)e=e.parent,t=t.parent;return e}onIntervalChange(e,t){super.onIntervalChange(e,t),this.fit===Ic.COMMON_ANCESTOR&&(this.removeCommonFitInstance(),this.markDirtyFit())}}W.register("FittedBlock",Ic),Ic.FULL_DISPLAY=1,Ic.COMMON_ANCESTOR=2,Ic.fitString={1:"fullDisplay",2:"commonAncestor"};const qc=Ic,Gc=new Le.Z,Qc=new Le.Z;class Sc extends qc{constructor(e,t,i,s){super(),this.initialize(e,t,i,s)}initialize(e,t,i,s){super.initialize(e,t,i,qc.COMMON_ANCESTOR),this.filterRootInstance=s,this.dirtyDrawables=(0,Ji.Z)(this.dirtyDrawables),this.domElement||(this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.canvas.style.pointerEvents="none",this.canvasId=this.canvas.id="scenery-canvas"+this.id,this.context=this.canvas.getContext("2d"),this.context.save(),this.context.miterLimit=20,this.context.miterLimit=10,this.wrapper=new Dt(this.canvas,this.context),this.domElement=this.canvas,this.wrapperStack=[this.wrapper]),this.wrapperStackIndex=0,this.filterListenerCountMap=this.filterListenerCountMap||{},ve.prepareForTransform(this.canvas),ve.unsetTransform(this.canvas),this.canvasDrawOffset=new be.Z(0,0),this.currentDrawable=null,this.clipDirty=!0,this.clipCount=0,this.backingScale=t&Te.bitmaskCanvasLowResolution?1:ve.backingScale(this.context),this.clipDirtyListener=this.markDirty.bind(this),this.opacityDirtyListener=this.markDirty.bind(this)}setSizeFullDisplay(){const e=this.display.getSize();this.canvas.width=e.width*this.backingScale,this.canvas.height=e.height*this.backingScale,this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px",this.wrapper.resetStyles(),this.canvasDrawOffset.setXY(0,0),ve.unsetTransform(this.canvas)}setSizeFitBounds(){const e=this.fitBounds.minX,t=this.fitBounds.minY;this.canvasDrawOffset.setXY(-e,-t),ve.setTransform(`matrix(1,0,0,1,${e},${t})`,this.canvas),this.canvas.width=this.fitBounds.width*this.backingScale,this.canvas.height=this.fitBounds.height*this.backingScale,this.canvas.style.width=this.fitBounds.width+"px",this.canvas.style.height=this.fitBounds.height+"px",this.wrapper.resetStyles()}update(){if(!super.update())return!1;for(;this.dirtyDrawables.length;)this.dirtyDrawables.pop().update();this.updateFit(),this.context.restore(),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.save(),this.wrapper.resetStyles(),this.currentDrawable=null;for(let e=this.firstDrawable;null!==e&&(this.renderDrawable(e),e!==this.lastDrawable);e=e.nextDrawable);return this.currentDrawable&&this.walkDown(this.currentDrawable.instance.trail,0),!0}applyClip(e){this.clipDirty=!1;const t=this.wrapperStack[this.wrapperStackIndex],i=t.context;if(i.restore(),i.save(),t.resetStyles(),this.clipCount){const t=e.instance.trail;Gc.rowMajor(this.backingScale,0,this.canvasDrawOffset.x*this.backingScale,0,this.backingScale,this.canvasDrawOffset.y*this.backingScale,0,0,1),Qc.set(this.transformRootInstance.trail.getMatrix()).invert(),Qc.multiplyMatrix(Gc).canvasSetTransform(i);for(let e=0;e<t.length;e++){const s=t.nodes[e];s.getMatrix().canvasAppendTransform(i),s.hasClipArea()&&(i.beginPath(),s.clipArea.writeToContext(i),i.clip())}}}pushWrapper(){if(this.wrapperStackIndex++,this.clipDirty=!0,this.wrapperStackIndex===this.wrapperStack.length){const e=document.createElement("canvas"),t=e.getContext("2d");t.save(),this.wrapperStack.push(new Dt(e,t))}const e=this.wrapperStack[this.wrapperStackIndex],t=e.context;e.setDimensions(this.canvas.width,this.canvas.height),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.canvas.width,this.canvas.height)}popWrapper(){this.wrapperStackIndex--,this.clipDirty=!0}walkDown(e,t){const i=this.filterRootInstance.trail.length-1;for(let s=e.length-1;s>=t;s--){const t=e.nodes[s];if(t.hasClipArea()&&(this.clipCount--,this.clipDirty=!0),s>i){if(t._filters.length){const e=this.wrapperStack[this.wrapperStackIndex],i=this.wrapperStack[this.wrapperStackIndex-1];this.popWrapper(),i.context.setTransform(1,0,0,1,0,0);const s=t._filters;let n=we.canvasFilter;for(let t=0;t<s.length;t++)n=n&&s[t].isDOMCompatible();if(n){let t="";for(let e=0;e<s.length;e++)t+=`${t?" ":""}${s[e].getCSSFilterString()}`;i.context.filter=t,i.context.drawImage(e.canvas,0,0),i.context.filter="none"}else{for(let t=0;t<s.length;t++)s[t].applyCanvasFilter(e);i.context.drawImage(e.canvas,0,0)}}if(1!==t.getEffectiveOpacity()){const e=this.wrapperStack[this.wrapperStackIndex],i=this.wrapperStack[this.wrapperStackIndex-1];this.popWrapper(),i.context.setTransform(1,0,0,1,0,0),i.context.globalAlpha=t.getEffectiveOpacity(),i.context.drawImage(e.canvas,0,0),i.context.globalAlpha=1}}}}walkUp(e,t){const i=this.filterRootInstance.trail.length-1;for(let s=t;s<e.length;s++){const t=e.nodes[s];s>i&&(1!==t.getEffectiveOpacity()&&this.pushWrapper(),t._filters.length&&this.pushWrapper()),t.hasClipArea()&&(this.clipCount++,this.clipDirty=!0)}}renderDrawable(e){if(!e.visible||0===this.canvas.width||0===this.canvas.height)return;const t=this.currentDrawable?e.instance.getBranchIndexTo(this.currentDrawable.instance):0;this.currentDrawable&&this.walkDown(this.currentDrawable.instance.trail,t),this.walkUp(e.instance.trail,t);const i=this.wrapperStack[this.wrapperStackIndex],s=i.context;this.clipDirty&&this.applyClip(e);const n=e.instance.relativeTransform.matrix;s.setTransform(this.backingScale,0,0,this.backingScale,this.canvasDrawOffset.x*this.backingScale,this.canvasDrawOffset.y*this.backingScale),e.instance!==this.transformRootInstance&&n.canvasAppendTransform(s),e.paintCanvas(i,e.instance.node,e.instance.relativeTransform.matrix),this.currentDrawable=e}dispose(){this.transformRootInstance=null,(0,Ji.Z)(this.dirtyDrawables),this.canvas.width=0,this.canvas.height=0,super.dispose()}markDirtyDrawable(e){this.dirtyDrawables.push(e),this.markDirty()}addDrawable(e){super.addDrawable(e);for(let t=e.instance;t&&t!==this.filterRootInstance;t=t.parent){const e=t.node;this.filterListenerCountMap[e.id]?this.filterListenerCountMap[e.id]++:(this.filterListenerCountMap[e.id]=1,e.filterChangeEmitter.addListener(this.opacityDirtyListener),e.clipAreaProperty.lazyLink(this.clipDirtyListener))}}removeDrawable(e){for(let t=e.instance;t&&t!==this.filterRootInstance;t=t.parent){const e=t.node;this.filterListenerCountMap[e.id]--,0===this.filterListenerCountMap[e.id]&&(delete this.filterListenerCountMap[e.id],e.clipAreaProperty.unlink(this.clipDirtyListener),e.filterChangeEmitter.removeListener(this.opacityDirtyListener))}super.removeDrawable(e)}onIntervalChange(e,t){super.onIntervalChange(e,t),this.markDirty()}onPotentiallyMovedDrawable(e){e.markDirty()}toString(){return`CanvasBlock#${this.id}-${qc.fitString[this.fit]}`}}W.register("CanvasBlock",Sc),Rt.mixInto(Sc);const Tc=Sc;class xc extends Dc{constructor(e,t){super(),this.initialize(e,t)}initialize(e,t){return super.initialize(e,t.renderer),this.domDrawable=t,this.domElement=t.domElement,this}update(){return!!super.update()&&(this.domDrawable.update(),!0)}dispose(){this.domDrawable=null,this.domElement=null,super.dispose()}markDirtyDrawable(e){this.markDirty()}addDrawable(e){super.addDrawable(e)}removeDrawable(e){super.removeDrawable(e)}}W.register("DOMBlock",xc),Rt.mixInto(xc);const kc=xc;class Fc extends qc{constructor(e,t,i,s){super(),this.initialize(e,t,i,s)}initialize(e,t,i,s){super.initialize(e,t,i,qc.COMMON_ANCESTOR),this.filterRootInstance=s,this.dirtyGradients=(0,Ji.Z)(this.dirtyGradients),this.dirtyGroups=(0,Ji.Z)(this.dirtyGroups),this.dirtyDrawables=(0,Ji.Z)(this.dirtyDrawables),this.paintCountMap=this.paintCountMap||new Pt(this.onAddPaint.bind(this),this.onRemovePaint.bind(this)),this.areReferencesReduced=!0,this.domElement||(this.svg=document.createElementNS(ke,"svg"),this.svg.style.position="absolute",this.svg.style.left="0",this.svg.style.top="0",this.svg.setAttribute("focusable",!1),this.svg.style["pointer-events"]="none",this.defs=document.createElementNS(ke,"defs"),this.svg.appendChild(this.defs),this.baseTransformGroup=document.createElementNS(ke,"g"),this.svg.appendChild(this.baseTransformGroup),this.domElement=this.svg),ve.prepareForTransform(this.svg),ve.unsetTransform(this.svg),this.baseTransformGroup.setAttribute("transform","");const n=i.trail.nodes.length>s.trail.nodes.length?s:i;return this.rootGroup=Ec.createFromPool(this,n,null),this.baseTransformGroup.appendChild(this.rootGroup.svgGroup),this}onAddPaint(e){const t=e.createSVGPaint(this);return t.definition.setAttribute("id",`${e.id}-${this.id}`),this.defs.appendChild(t.definition),t}onRemovePaint(e,t){this.defs.removeChild(t.definition),t.dispose()}incrementPaint(e){this.paintCountMap.increment(e)}decrementPaint(e){this.paintCountMap.decrement(e)}markDirtyGradient(e){this.dirtyGradients.push(e),this.markDirty()}markDirtyGroup(e){this.dirtyGroups.push(e),this.markDirty(),this.areReferencesReduced&&this.display.markForReducedReferences(this),this.areReferencesReduced=!1}markDirtyDrawable(e){this.dirtyDrawables.push(e),this.markDirty(),this.areReferencesReduced&&this.display.markForReducedReferences(this),this.areReferencesReduced=!1}setSizeFullDisplay(){this.baseTransformGroup.removeAttribute("transform"),ve.unsetTransform(this.svg);const e=this.display.getSize();this.svg.setAttribute("width",e.width),this.svg.setAttribute("height",e.height)}setSizeFitBounds(){const e=this.fitBounds.minX,t=this.fitBounds.minY;this.baseTransformGroup.setAttribute("transform",`translate(${-e},${-t})`),ve.setTransform(`matrix(1,0,0,1,${e},${t})`,this.svg),this.svg.setAttribute("width",this.fitBounds.width),this.svg.setAttribute("height",this.fitBounds.height)}update(){if(!super.update())return!1;for(;this.dirtyGroups.length;){const e=this.dirtyGroups.pop();e.block===this&&e.update()}for(;this.dirtyGradients.length;)this.dirtyGradients.pop().update();for(;this.dirtyDrawables.length;){const e=this.dirtyDrawables.pop();e.parentDrawable===this&&e.update()}return this.areReferencesReduced=!0,this.updateFit(),!0}reduceReferences(){if(this.areReferencesReduced)return;let e=0,t=0;for(;e<this.dirtyGroups.length;){const i=this.dirtyGroups[e];i.block===this&&(t!==e&&(this.dirtyGroups[t]=i),t++),e++}for(;this.dirtyGroups.length>t;)this.dirtyGroups.pop();for(e=0,t=0;e<this.dirtyDrawables.length;){const i=this.dirtyDrawables[e];i.parentDrawable===this&&(t!==e&&(this.dirtyDrawables[t]=i),t++),e++}for(;this.dirtyDrawables.length>t;)this.dirtyDrawables.pop();this.areReferencesReduced=!0}dispose(){for(this.svg.setAttribute("width","0"),this.svg.setAttribute("height","0"),this.filterRootInstance=null,(0,Ji.Z)(this.dirtyGradients),(0,Ji.Z)(this.dirtyGroups),(0,Ji.Z)(this.dirtyDrawables),this.paintCountMap.clear(),this.baseTransformGroup.removeChild(this.rootGroup.svgGroup),this.rootGroup.dispose(),this.rootGroup=null;this.defs.childNodes.length;)this.defs.removeChild(this.defs.childNodes[0]);super.dispose()}addDrawable(e){super.addDrawable(e),Ec.addDrawable(this,e),e.updateSVGBlock(this)}removeDrawable(e){Ec.removeDrawable(this,e),super.removeDrawable(e)}onIntervalChange(e,t){super.onIntervalChange(e,t)}toString(){return`SVGBlock#${this.id}-${qc.fitString[this.fit]}`}}W.register("SVGBlock",Fc),Rt.mixInto(Fc);const Rc=Fc;class Uc extends qc{constructor(e,t,i,s){super(),this.initialize(e,t,i,s)}initialize(e,t,i,s){return super.initialize(e,t,i,qc.FULL_DISPLAY),this.filterRootInstance=s,this.preserveDrawingBuffer=e._preserveDrawingBuffer,this.dirtyDrawables=(0,Ji.Z)(this.dirtyDrawables),this.spriteSheets=this.spriteSheets||[],this.projectionMatrix=this.projectionMatrix||new Le.Z,this.projectionMatrixArray=new Float32Array(9),this.customProcessor=this.customProcessor||new Pc,this.vertexColorPolygonsProcessor=this.vertexColorPolygonsProcessor||new bc(this.projectionMatrixArray),this.texturedTrianglesProcessor=this.texturedTrianglesProcessor||new Oc(this.projectionMatrixArray),this.glChangedEmitter=new te.Z,this.isContextLost=!1,this.contextLostListener=this.onContextLoss.bind(this),this.contextRestoreListener=this.onContextRestoration.bind(this),this.domElement||(this.domElement=document.createElement("div"),this.domElement.className="webgl-container",this.domElement.style.position="absolute",this.domElement.style.left="0",this.domElement.style.top="0",this.rebuildCanvas()),this.gl.clear(this.gl.COLOR_BUFFER_BIT),ve.prepareForTransform(this.canvas),ve.unsetTransform(this.canvas),this}rebuildCanvas(){const e=document.createElement("canvas"),t=this.getContextFromCanvas(e);t&&(this.canvas&&(this.domElement.removeChild(this.canvas),this.canvas.removeEventListener("webglcontextlost",this.contextLostListener,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoreListener,!1)),this.canvas=e,this.canvas.style.pointerEvents="none",this.canvasId=this.canvas.id="scenery-webgl"+this.id,this.canvas.addEventListener("webglcontextlost",this.contextLostListener,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoreListener,!1),this.domElement.appendChild(this.canvas),this.setupContext(t))}setupContext(e){this.isContextLost=!1,this.gl=e,this.backingScale=ve.backingScale(this.gl),this.display._allowBackingScaleAntialiasing&&0===e.getParameter(e.SAMPLES)&&(this.backingScale*=2),this.originalBackingScale=this.backingScale,ve.applyWebGLContextDefaults(this.gl),this.markDirty(),this.dirtyFit=!0,this.customProcessor.initializeContext(this.gl),this.vertexColorPolygonsProcessor.initializeContext(this.gl),this.texturedTrianglesProcessor.initializeContext(this.gl);for(let t=0;t<this.spriteSheets.length;t++)this.spriteSheets[t].initializeContext(this.gl);this.glChangedEmitter.emit()}delayedRebuildCanvas(){const e=this;window.setTimeout((function(){e.rebuildCanvas()}))}onContextLoss(e){this.isContextLost||(this.isContextLost=!0,e.preventDefault(),this.canvas.style.display="none",this.markDirty())}onContextRestoration(e){if(this.isContextLost){const e=this.getContextFromCanvas(this.canvas);this.setupContext(e),this.canvas.style.display=""}}getContextFromCanvas(e){const t={antialias:!0,preserveDrawingBuffer:this.preserveDrawingBuffer};return e.getContext("webgl",t)||e.getContext("experimental-webgl",t)}setSizeFullDisplay(){const e=this.display.getSize();this.canvas.width=Math.ceil(e.width*this.backingScale),this.canvas.height=Math.ceil(e.height*this.backingScale),this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px"}setSizeFitBounds(){throw new Error("setSizeFitBounds unimplemented for WebGLBlock")}update(){if(!super.update())return!1;const e=this.gl;for(this.isContextLost&&this.display._aggressiveContextRecreation&&this.delayedRebuildCanvas();this.dirtyDrawables.length;)this.dirtyDrawables.pop().update();const t=this.spriteSheets.length;for(let n=0;n<t;n++)this.spriteSheets[n].updateTexture();this.firstDrawable&&this.firstDrawable===this.lastDrawable&&this.firstDrawable.node&&null!==this.firstDrawable.node._webglScale&&this.backingScale!==this.originalBackingScale*this.firstDrawable.node._webglScale&&(this.backingScale=this.originalBackingScale*this.firstDrawable.node._webglScale,this.dirtyFit=!0),this.updateFit(),this.projectionMatrix.rowMajor(2/this.display.width,0,-1,0,-2/this.display.height,1,0,0,1),this.projectionMatrix.copyToArray(this.projectionMatrixArray),this.preserveDrawingBuffer&&e.clear(e.COLOR_BUFFER_BIT),e.viewport(0,0,this.canvas.width,this.canvas.height);let i=null,s=0;for(let n=this.firstDrawable;null!==n;n=n.nextDrawable){if(n.visible){let e=null;n.webglRenderer===Te.webglTexturedTriangles?e=this.texturedTrianglesProcessor:n.webglRenderer===Te.webglCustom?e=this.customProcessor:n.webglRenderer===Te.webglVertexColorPolygons&&(e=this.vertexColorPolygonsProcessor),e!==i&&(i&&(s+=i.deactivate()),i=e,i.activate()),i.processDrawable(n)}if(n===this.lastDrawable)break}return i&&(s+=i.deactivate()),0!==s||this.preserveDrawingBuffer||e.clear(e.COLOR_BUFFER_BIT),e.flush(),!0}dispose(){(0,Ji.Z)(this.dirtyDrawables),super.dispose()}markDirtyDrawable(e){this.dirtyDrawables.push(e),this.markDirty()}addDrawable(e){super.addDrawable(e),e.onAddToBlock(this)}removeDrawable(e){let t=0;for(;(t=this.dirtyDrawables.indexOf(e,t))>=0;)this.dirtyDrawables.splice(t,1);e.onRemoveFromBlock(this),super.removeDrawable(e)}addSpriteSheetImage(e,t,i){let s=null;const n=this.spriteSheets.length;for(let r=0;r<n;r++){if(s=this.spriteSheets[r].addImage(e,t,i),s)break}if(!s){const n=new gi(!0);if(s=n.addImage(e,t,i),n.initializeContext(this.gl),this.spriteSheets.push(n),!s)throw new Error("Attempt to load image that is too large for sprite sheets")}return s}removeSpriteSheetImage(e){e.spriteSheet.removeImage(e.image)}onIntervalChange(e,t){super.onIntervalChange(e,t),this.markDirty()}onPotentiallyMovedDrawable(e){this.markDirty()}toString(){return`WebGLBlock#${this.id}-${qc.fitString[this.fit]}`}}W.register("WebGLBlock",Uc);class Lc{activate(){}initializeContext(e){}processDrawable(e){}deactivate(){}}class Pc extends Lc{constructor(){super(),this.drawable=null}activate(){this.drawCount=0}processDrawable(e){this.drawable=e,this.draw()}deactivate(){return this.drawCount}draw(){if(this.drawable){const e=this.drawable.draw();this.drawCount+=e,this.drawable=null}}}class bc extends Lc{constructor(e){super(),this.projectionMatrixArray=e,this.lastArrayLength=128,this.vertexArray=new Float32Array(this.lastArrayLength)}initializeContext(e){this.gl=e,this.shaderProgram=new di(e,["attribute vec2 aVertex;","attribute vec4 aColor;","varying vec4 vColor;","uniform mat3 uProjectionMatrix;","void main() {","  vColor = aColor;","  vec3 ndc = uProjectionMatrix * vec3( aVertex, 1.0 );","  gl_Position = vec4( ndc.xy, 0.0, 1.0 );","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main() {","  gl_FragColor = vec4( vColor.rgb * vColor.a, vColor.a );","}"].join("\n"),{attributes:["aVertex","aColor"],uniforms:["uProjectionMatrix"]}),this.vertexBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.DYNAMIC_DRAW)}activate(){this.shaderProgram.use(),this.vertexArrayIndex=0,this.drawCount=0}processDrawable(e){if(e.includeVertices){const t=e.vertexArray;for(;t.length+this.vertexArrayIndex>this.vertexArray.length;){const e=new Float32Array(2*this.vertexArray.length);e.set(this.vertexArray),this.vertexArray=e}this.vertexArray.set(t,this.vertexArrayIndex),this.vertexArrayIndex+=t.length,this.drawCount++}}deactivate(){return this.drawCount&&this.draw(),this.shaderProgram.unuse(),this.drawCount}draw(){const e=this.gl;e.uniformMatrix3fv(this.shaderProgram.uniformLocations.uProjectionMatrix,!1,this.projectionMatrixArray),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray.length>this.lastArrayLength?e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.vertexArray.subarray(0,this.vertexArrayIndex));const t=Float32Array.BYTES_PER_ELEMENT,i=6*t;e.vertexAttribPointer(this.shaderProgram.attributeLocations.aVertex,2,e.FLOAT,!1,i,0*t),e.vertexAttribPointer(this.shaderProgram.attributeLocations.aColor,4,e.FLOAT,!1,i,2*t),e.drawArrays(e.TRIANGLES,0,this.vertexArrayIndex/6),this.vertexArrayIndex=0}}class Oc extends Lc{constructor(e){super(),this.projectionMatrixArray=e,this.lastArrayLength=128,this.vertexArray=new Float32Array(this.lastArrayLength)}initializeContext(e){this.gl=e,this.shaderProgram=new di(e,["attribute vec2 aVertex;","attribute vec2 aTextureCoord;","attribute float aAlpha;","varying vec2 vTextureCoord;","varying float vAlpha;","uniform mat3 uProjectionMatrix;","void main() {","  vTextureCoord = aTextureCoord;","  vAlpha = aAlpha;","  vec3 ndc = uProjectionMatrix * vec3( aVertex, 1.0 );","  gl_Position = vec4( ndc.xy, 0.0, 1.0 );","}"].join("\n"),["precision mediump float;","varying vec2 vTextureCoord;","varying float vAlpha;","uniform sampler2D uTexture;","void main() {","  vec4 color = texture2D( uTexture, vTextureCoord, -0.7 );","  color.a *= vAlpha;","  gl_FragColor = color;","}"].join("\n"),{attributes:["aVertex","aTextureCoord","aAlpha"],uniforms:["uTexture","uProjectionMatrix"]}),this.vertexBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.DYNAMIC_DRAW)}activate(){this.shaderProgram.use(),this.currentSpriteSheet=null,this.vertexArrayIndex=0,this.drawCount=0}processDrawable(e){if(!e.sprite)return;this.currentSpriteSheet&&e.sprite.spriteSheet!==this.currentSpriteSheet&&this.draw(),this.currentSpriteSheet=e.sprite.spriteSheet;const t=e.vertexArray;for(;t.length+this.vertexArrayIndex>this.vertexArray.length;){const e=new Float32Array(2*this.vertexArray.length);e.set(this.vertexArray),this.vertexArray=e}this.vertexArray.set(t,this.vertexArrayIndex),this.vertexArrayIndex+=t.length}deactivate(){return this.currentSpriteSheet&&this.draw(),this.shaderProgram.unuse(),this.drawCount}draw(){const e=this.gl;e.uniformMatrix3fv(this.shaderProgram.uniformLocations.uProjectionMatrix,!1,this.projectionMatrixArray),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray.length>this.lastArrayLength?e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.vertexArray.subarray(0,this.vertexArrayIndex));const t=Float32Array.BYTES_PER_ELEMENT,i=5*t;e.vertexAttribPointer(this.shaderProgram.attributeLocations.aVertex,2,e.FLOAT,!1,i,0*t),e.vertexAttribPointer(this.shaderProgram.attributeLocations.aTextureCoord,2,e.FLOAT,!1,i,2*t),e.vertexAttribPointer(this.shaderProgram.attributeLocations.aAlpha,1,e.FLOAT,!1,i,4*t),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.currentSpriteSheet.texture),e.uniform1i(this.shaderProgram.uniformLocations.uTexture,0),e.drawArrays(e.TRIANGLES,0,this.vertexArrayIndex/5),e.bindTexture(e.TEXTURE_2D,null),this.drawCount++,this.currentSpriteSheet=null,this.vertexArrayIndex=0}}Rt.mixInto(Uc);const fc=Uc;class Zc{initialize(e,t,i,s,n,r,o){this.backbone=e,this.firstDrawable=t,this.lastDrawable=i,this.touchedBlocks=(0,Ji.Z)(this.touchedBlocks)}clean(){this.backbone=null,this.firstDrawable=null,this.lastDrawable=null}recordBackboneBoundaries(){this.backbone.previousFirstDrawable=this.firstDrawable,this.backbone.previousLastDrawable=this.lastDrawable}notePendingAddition(e,t){e.notePendingAddition(this.backbone.display,t,this.backbone)}notePendingMove(e,t){e.notePendingMove(this.backbone.display,t)}notePendingRemoval(e){e.notePendingRemoval(this.backbone.display)}markBlockForDisposal(e){e.domElement.parentNode===this.backbone.domElement&&this.backbone.domElement.removeChild(e.domElement),e.markForDisposal(this.backbone.display)}removeAllBlocks(){for(;this.backbone.blocks.length;){const e=this.backbone.blocks[0];this.removeBlock(e),this.markBlockForDisposal(e)}}notifyInterval(e,t,i){e.notifyInterval(t,i),this.backbone.markDirtyDrawable(e)}markBeforeBlock(e,t){e.pendingFirstDrawable=t,this.touchedBlocks.push(e)}markAfterBlock(e,t){e.pendingLastDrawable=t,this.touchedBlocks.push(e)}updateBlockIntervals(){for(;this.touchedBlocks.length;){const e=this.touchedBlocks.pop();e.used&&(e.updateInterval(),this.backbone.markDirtyDrawable(e))}}createBlock(e,t){const i=this.backbone;let s;if(Te.isCanvas(e))s=Tc.createFromPool(i.display,e,i.transformRootInstance,i.backboneInstance);else if(Te.isSVG(e))s=Rc.createFromPool(i.display,e,i.transformRootInstance,i.backboneInstance);else if(Te.isDOM(e))s=kc.createFromPool(i.display,t);else{if(!Te.isWebGL(e))throw new Error("unsupported renderer for createBlock: "+e);s=fc.createFromPool(i.display,e,i.transformRootInstance,i.backboneInstance)}return s.setBlockBackbone(i),i.domElement.appendChild(s.domElement),i.isDisplayRoot&&s.domElement.setAttribute("aria-hidden",!0),i.markDirtyDrawable(s),s}appendBlock(e){this.backbone.blocks.push(e)}removeBlock(e){const t=_.indexOf(this.backbone.blocks,e);this.backbone.blocks.splice(t,1)}useNoBlocks(){(0,Ji.Z)(this.backbone.blocks)}reindex(){this.backbone.reindexBlocks()}auditStitch(){0}static debugIntervals(e){0}static debugDrawables(e,t,i,s,n){0}}W.register("Stitcher",Zc);const Nc=Zc;function Kc(e,t){return e.renderer!==t.renderer||Te.isDOM(e.renderer)||Te.isDOM(t.renderer)}function Jc(e){return null!==e.previousDrawable&&!Kc(e.previousDrawable,e)}function jc(e){return null!==e.nextDrawable&&!Kc(e,e.nextDrawable)}function vc(e,t,i){return e.drawableBefore?e.drawableBefore.oldNextDrawable!==e.drawableAfter:e.drawableAfter?e.drawableAfter.oldPreviousDrawable!==e.drawableBefore:null!==t}function Hc(e,t,i){const s=e.drawableBefore?e.drawableBefore.parentDrawable:null,n=e.drawableAfter?e.drawableAfter.parentDrawable:null;return(!s||!n||s!==n)&&(s?s.nextBlock!==n:n?n.previousBlock!==s:null!==t)}class Wc extends Nc{stitch(e,t,i,s,n,r,o){let A;if(this.initialize(e,t,i,s,n,r,o),this.blockOrderChanged=!1,this.reusableBlocks=(0,Ji.Z)(this.reusableBlocks),this.blockWasAdded=!1,this.recordBackboneBoundaries(),e.blocks.length){const t=e.blocks[0];e.blocks[e.blocks.length-1];for(A=r;null!==A;A=A.nextChangeInterval){if(vc(A,s)){const e=A.drawableBefore?A.drawableBefore.oldNextDrawable:s,t=A.drawableAfter?A.drawableAfter.oldPreviousDrawable:n;for(let i=e;this.notePendingRemoval(i),i!==t;i=i.oldNextDrawable);}if(Hc(A,t)){const t=null===A.drawableBefore?e.blocks[0]:A.drawableBefore.parentDrawable.nextBlock,i=null===A.drawableAfter?e.blocks[e.blocks.length-1]:A.drawableAfter.parentDrawable.previousBlock;for(let e=t;this.unuseBlock(e),e!==i;e=e.nextBlock);}}}if(t)for(A=r;null!==A;A=A.nextChangeInterval)this.processInterval(e,A,t,i);this.removeUnusedBlocks(),this.updateBlockIntervals(),null===t?this.useNoBlocks():this.blockOrderChanged&&(this.processBlockLinkedList(e,t.pendingParentDrawable,i.pendingParentDrawable),this.reindex()),this.clean(),(0,Ji.Z)(this.reusableBlocks)}processInterval(e,t,i,s){if(function(e,t,i){return e.drawableBefore?e.drawableBefore.nextDrawable!==e.drawableAfter:e.drawableAfter?e.drawableAfter.previousDrawable!==e.drawableBefore:null!==t}(t,i)){let s=t.drawableBefore?t.drawableBefore.nextDrawable:i,n=null,r=null,o=!0;for(;;){const i=s.nextDrawable,A=i===t.drawableAfter;if(n||(n=s),null===r&&s.parentDrawable&&!s.parentDrawable.used&&s.backbone===e&&s.parentDrawable.parentDrawable===e&&(r=s.parentDrawable),(A||Kc(s,i))&&(o&&this.processEdgeCases(t,Jc(n),jc(s)),this.processSubBlock(t,n,s,r,o,A),n=null,r=null,o=!1),A)break;s=i}}else{if(t.drawableBefore&&t.drawableAfter){const e=!Kc(t.drawableBefore,t.drawableAfter);this.processEdgeCases(t,e,e)}t.drawableBefore&&!jc(t.drawableBefore)?this.linkAfterDrawable(t.drawableBefore):t.drawableAfter&&!Jc(t.drawableAfter)&&this.linkBeforeDrawable(t.drawableAfter)}}processSubBlock(e,t,i,s,n,r){const o=Jc(t),A=jc(i);o&&(s=t.previousDrawable.pendingParentDrawable),A&&(s=i.nextDrawable.pendingParentDrawable),s=this.ensureUsedBlock(s,t);for(let a=t;this.notePendingAddition(a,s),a!==i;a=a.nextDrawable);o||this.linkBeforeDrawable(t),r&&!A&&this.linkAfterDrawable(i)}processEdgeCases(e,t,i){if(null!==e.drawableBefore&&null!==e.drawableAfter){const s=e.drawableBefore.pendingParentDrawable,n=e.drawableAfter.pendingParentDrawable,r=e.nextChangeInterval&&e.nextChangeInterval.drawableAfter?e.nextChangeInterval.drawableAfter.pendingParentDrawable:null;let o;s===n&&(this.blockWasAdded=!0),t&&i?o=s:this.blockWasAdded||s===n?(o=this.createBlock(e.drawableAfter.renderer,e.drawableAfter),this.blockOrderChanged=!0):o=n,n===o?this.blockWasAdded=!0:this.changeExternals(e,o),r!==n&&(this.blockWasAdded||this.unuseBlock(n),this.blockWasAdded=!1)}}changeExternals(e,t){const i=function(e){const t=e.drawableAfter;if(t){const i=t.renderer,s=e.nextChangeInterval?e.nextChangeInterval.drawableBefore.nextDrawable:null;let n=t;for(;;){const e=n.nextDrawable;if(e===s||e.renderer!==i)break;n=e}return n}return null}(e);this.notePendingMoves(t,e.drawableAfter,i),e.nextChangeInterval&&e.nextChangeInterval.drawableBefore===i||this.linkAfterDrawable(i)}notePendingMoves(e,t,i){for(let s=t;this.notePendingMove(s,e),s!==i;s=s.nextDrawable);}ensureUsedBlock(e,t){return e?e.used||this.useBlock(e):e=this.getBlockForRenderer(t.renderer,t),e}getBlockForRenderer(e,t){let i;if(!Te.isDOM(e))for(let s=this.reusableBlocks.length-1;s>=0;s--){const t=this.reusableBlocks[s];if(t.renderer===e){this.useBlockAtIndex(t,s),i=t;break}}return i||(i=this.createBlock(e,t)),this.blockOrderChanged=!0,i}unuseBlock(e){e.used&&(e.used=!1,this.reusableBlocks.push(e))}useBlock(e){this.useBlockAtIndex(e,_.indexOf(this.reusableBlocks,e))}useBlockAtIndex(e,t){this.reusableBlocks.splice(t,1),e.used=!0}removeUnusedBlocks(){for(;this.reusableBlocks.length;){const e=this.reusableBlocks.pop();this.markBlockForDisposal(e),this.blockOrderChanged=!0}}linkBeforeDrawable(e){const t=e.previousDrawable;this.linkBlocks(t?t.pendingParentDrawable:null,e.pendingParentDrawable,t,e)}linkAfterDrawable(e){const t=e.nextDrawable;this.linkBlocks(e.pendingParentDrawable,t?t.pendingParentDrawable:null,e,t)}linkBlocks(e,t,i,s){e&&(e.nextBlock!==t&&(this.blockOrderChanged=!0,e.nextBlock&&(e.nextBlock.previousBlock=null),e.nextBlock=t),this.markAfterBlock(e,i)),t&&(t.previousBlock!==e&&(this.blockOrderChanged=!0,t.previousBlock&&(t.previousBlock.nextBlock=null),t.previousBlock=e),this.markBeforeBlock(t,s))}processBlockLinkedList(e,t,i){for(;e.blocks.length;)e.blocks.pop();if(t)for(let s=t;e.blocks.push(s),s!==i;s=s.nextBlock);}}W.register("GreedyStitcher",Wc);const zc=Wc;class Xc extends Nc{stitch(e,t,i,s,n,r,o){this.initialize(e,t,i,s,n,r,o);for(let l=e.previousFirstDrawable;null!==l&&(this.notePendingRemoval(l),l!==e.previousLastDrawable);l=l.oldNextDrawable);this.recordBackboneBoundaries(),this.removeAllBlocks();let A=null,a=0,h=null;for(let l=t;null!==l&&(A&&l.renderer===a||(A&&this.notifyInterval(A,h,l.previousDrawable),a=l.renderer,A=this.createBlock(a,l),Te.isDOM(a)&&(a=0),this.appendBlock(A),h=l),this.notePendingAddition(l,A),l!==i);l=l.nextDrawable);A&&this.notifyInterval(A,h,i),this.reindex(),this.clean()}}W.register("RebuildStitcher",Xc);const _c=Xc;class $c extends xl{constructor(e,t,i,s,n){super(),this.initialize(e,t,i,s,n)}initialize(e,t,i,s,n){if(super.initialize(s),this.display=e,this.backboneInstance=t,this.transformRootInstance=i,this.filterRootAncestorInstance=t.parent?t.parent.getFilterRootInstance():t,this.transformRootAncestorInstance=t.parent?t.parent.getTransformRootInstance():t,this.willApplyTransform=this.transformRootAncestorInstance!==this.transformRootInstance,this.willApplyFilters=this.filterRootAncestorInstance!==this.backboneInstance,this.transformListener=this.transformListener||this.markTransformDirty.bind(this),this.willApplyTransform&&(this.backboneInstance.relativeTransform.addListener(this.transformListener),this.backboneInstance.relativeTransform.addPrecompute()),this.backboneVisibilityListener=this.backboneVisibilityListener||this.updateBackboneVisibility.bind(this),this.backboneInstance.relativeVisibleEmitter.addListener(this.backboneVisibilityListener),this.updateBackboneVisibility(),this.visibilityDirty=!0,this.renderer=s,this.domElement=n?e.domElement:$c.createDivBackbone(),this.isDisplayRoot=n,this.dirtyDrawables=(0,Ji.Z)(this.dirtyDrawables),ve.prepareForTransform(this.domElement),this.watchedFilterNodes=(0,Ji.Z)(this.watchedFilterNodes),this.filterDirty=!0,this.clipDirty=!0,this.filterDirtyListener=this.filterDirtyListener||this.onFilterDirty.bind(this),this.clipDirtyListener=this.clipDirtyListener||this.onClipDirty.bind(this),this.willApplyFilters)for(let r=this.backboneInstance;r!==this.filterRootAncestorInstance;r=r.parent){const e=r.node;this.watchedFilterNodes.push(e),e.filterChangeEmitter.addListener(this.filterDirtyListener),e.clipAreaProperty.lazyLink(this.clipDirtyListener)}this.lastZIndex=0,this.blocks=this.blocks||[],this.previousFirstDrawable=null,this.previousLastDrawable=null,this.removedDrawables=!1,this.stitcher=this.stitcher||new zc}dispose(){for(;this.watchedFilterNodes.length;){const e=this.watchedFilterNodes.pop();e.filterChangeEmitter.removeListener(this.filterDirtyListener),e.clipAreaProperty.unlink(this.clipDirtyListener)}if(this.backboneInstance.relativeVisibleEmitter.removeListener(this.backboneVisibilityListener),!this.removedDrawables)for(let e=this.previousFirstDrawable;null!==e&&(e.parentDrawable.removeDrawable(e),e!==this.previousLastDrawable);e=e.nextDrawable);this.markBlocksForDisposal(),this.willApplyTransform&&(this.backboneInstance.relativeTransform.removeListener(this.transformListener),this.backboneInstance.relativeTransform.removePrecompute()),this.backboneInstance=null,this.transformRootInstance=null,this.filterRootAncestorInstance=null,this.transformRootAncestorInstance=null,(0,Ji.Z)(this.dirtyDrawables),(0,Ji.Z)(this.watchedFilterNodes),this.previousFirstDrawable=null,this.previousLastDrawable=null,super.dispose()}markBlocksForDisposal(){for(;this.blocks.length;){const e=this.blocks.pop();e.domElement.parentNode===this.domElement&&this.domElement.removeChild(e.domElement),e.markForDisposal(this.display)}}updateBackboneVisibility(){this.visible=this.backboneInstance.relativeVisible,this.visibilityDirty||(this.visibilityDirty=!0,this.markDirty())}markForDisposal(e){for(let t=this.previousFirstDrawable;null!==t&&(t.notePendingRemoval(this.display),t!==this.previousLastDrawable);t=t.oldNextDrawable);this.removedDrawables=!0,super.markForDisposal(e)}markDirtyDrawable(e){this.dirtyDrawables.push(e),this.markDirty()}markTransformDirty(){ve.applyPreparedTransform(this.backboneInstance.relativeTransform.matrix,this.domElement)}onFilterDirty(){this.filterDirty||(this.filterDirty=!0,this.markDirty())}onClipDirty(){this.clipDirty||(this.clipDirty=!0,this.markDirty())}update(){if(!super.update())return!1;for(;this.dirtyDrawables.length;)this.dirtyDrawables.pop().update();if(this.filterDirty){this.filterDirty=!1;let e="";const t=this.watchedFilterNodes.length;for(let i=0;i<t;i++){const t=this.watchedFilterNodes[i],s=t.getEffectiveOpacity();for(let i=0;i<t._filters.length;i++)e+=`${e?" ":""}${t._filters[i].getCSSFilterString()}`;1!==s&&(e+=`${e?" ":""}opacity(${(0,rs.Z)(s)})`)}this.domElement.style.filter=e}return this.visibilityDirty&&(this.visibilityDirty=!1,this.domElement.style.display=this.visible?"":"none"),this.clipDirty&&(this.clipDirty=!1),!0}getFilterVisibility(){const e=this.watchedFilterNodes.length;for(let t=0;t<e;t++)if(!this.watchedFilterNodes[t].isVisible())return!1;return!0}getFilterClip(){return""}reindexBlocks(){let e=0;for(let t=0;t<this.blocks.length;t++){const i=this.blocks[t];if(i.zIndex<=e){const s=t+1<this.blocks.length&&this.blocks[t+1].zIndex-1>e?Math.ceil((e+this.blocks[t+1].zIndex)/2):e+20;i.domElement.style.zIndex=i.zIndex=s}e=i.zIndex}this.lastZIndex=e+1}stitch(e,t,i,s){if(null===i||null===s)return;let n=null,r=i,o=!1;for(;r;)o=r.constrict()||o,r.isEmpty()?n&&(n.nextChangeInterval=r.nextChangeInterval):(n||(i=r),n=r),r=r.nextChangeInterval;n&&((s=n).nextChangeInterval=null,this.stitcher.stitch(this,e,t,this.previousFirstDrawable,this.previousLastDrawable,i,s))}audit(e,t,i){0}static createDivBackbone(){const e=document.createElement("div");return e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width="0",e.style.height="0",e}static repurposeBackboneContainer(e){return"relative"===e.style.position&&"absolute"===e.style.position||(e.style.position="relative"),e.style.left="0",e.style.top="0",e}}W.register("BackboneDrawable",$c),Rt.mixInto($c);const ed=$c;class td{constructor(e,t,i){this.display=e,this.rootNode=t;const s=document.createElementNS(ke,"svg");s.style.position="absolute",s.setAttribute("class",i),s.style.top="0",s.style.left="0",s.style["pointer-events"]="none",this.svg=s,e.sizeProperty.link(e=>{var t,i;t=e.width,i=e.height,s.setAttribute("width",""+t),s.setAttribute("height",""+i),s.style.clip=`rect(0px,${t}px,${i}px,0px)`}),this.domElement=s}addShape(e,t,i){const s=document.createElementNS(ke,"path");let n=e.getSVGPath();n||(n="M0 0"),n?s.setAttribute("d",n):s.hasAttribute("d")&&s.removeAttribute("d"),s.setAttribute("style",`fill: none; stroke: ${t}; stroke-dasharray: 5, 3; stroke-dashoffset: ${i?5:0}; stroke-width: 3;`),this.svg.appendChild(s)}update(){for(;this.svg.childNodes.length;)this.svg.removeChild(this.svg.childNodes[this.svg.childNodes.length-1]);this.addShapes()}dispose(){}}W.register("ShapeBasedOverlay",td);class id extends td{constructor(e,t){super(e,t,"canvasNodeBoundsOverlay")}addShapes(){new pn(this.rootNode).eachTrailUnder(e=>{const t=e.lastNode();if(!t.isVisible())return!0;if(t instanceof er&&e.isVisible()){const i=e.getTransform();this.addShape(i.transformShape(_t.bn.bounds(t.selfBounds)),"rgba(0,255,0,0.8)",!0)}return!1})}}W.register("CanvasNodeBoundsOverlay",id);class sd extends td{constructor(e,t){super(e,t,"canvasNodeBoundsOverlay")}addShapes(){const e=this;function t(t,s){t.willApplyTransform&&(s=s.timesMatrix(t.backboneInstance.relativeTransform.matrix)),t.blocks.forEach(t=>{!function(t,s){t instanceof qc&&!t.fitBounds.isEmpty()&&e.addShape(_t.bn.bounds(t.fitBounds).transformed(s),"rgba(255,0,0,0.8)",!0);if(t.firstDrawable&&t.lastDrawable){for(let e=t.firstDrawable;e!==t.lastDrawable;e=e.nextDrawable)i(e,s);i(t.lastDrawable,s)}}(t,s)})}function i(e,i){e instanceof ed&&t(e,i)}t(this.display.rootBackbone,Le.Z.IDENTITY)}}W.register("FittedBlockBoundsOverlay",sd);let nd=Po.OUTER_FOCUS_COLOR,rd=Po.INNER_FOCUS_COLOR,od=Po.INNER_LIGHT_GROUP_FOCUS_COLOR,Ad=Po.OUTER_LIGHT_GROUP_FOCUS_COLOR;class ad{constructor(e,t,i){_defineProperty(this,"trail",null),_defineProperty(this,"node",null),_defineProperty(this,"activeHighlight",null),_defineProperty(this,"mode",null),_defineProperty(this,"groupMode",null),_defineProperty(this,"groupHighlightNode",null),_defineProperty(this,"transformTracker",null),_defineProperty(this,"groupTransformTracker",null),_defineProperty(this,"nodeModeHighlight",null),_defineProperty(this,"nodeModeHighlightLayered",!1),_defineProperty(this,"transformDirty",!0),_defineProperty(this,"highlightNode",new Zs),_defineProperty(this,"readingBlockHighlightNode",new Zs),_defineProperty(this,"addedReadingBlockHighlight",null),_defineProperty(this,"activeReadingBlockNode",null),_defineProperty(this,"readingBlockTrail",null),_defineProperty(this,"readingBlockTransformDirty",!0),_defineProperty(this,"readingBlockTransformTracker",null);const s=(0,Ce.ZP)()({pdomFocusHighlightsVisibleProperty:new bt.Z(!0),interactiveHighlightsVisibleProperty:new bt.Z(!1),readingBlockHighlightsVisibleProperty:new bt.Z(!1)},i);this.display=e,this.focusRootNode=t,this.focusRootNode.addChild(this.highlightNode),this.focusRootNode.addChild(this.readingBlockHighlightNode),this.pdomFocusHighlightsVisibleProperty=s.pdomFocusHighlightsVisibleProperty,this.interactiveHighlightsVisibleProperty=s.interactiveHighlightsVisibleProperty,this.readingBlockHighlightsVisibleProperty=s.readingBlockHighlightsVisibleProperty,this.focusDisplay=new Bd(this.focusRootNode,{allowWebGL:e.isWebGLAllowed(),allowCSSHacks:!1,accessibility:!1,interactive:!1}),this.domElement=this.focusDisplay.domElement,this.domElement.style.pointerEvents="none",this.shapeFocusHighlightPath=new Po(null),this.boundsFocusHighlightPath=new Oo(null,{useLocalBounds:!0}),this.highlightNode.addChild(this.shapeFocusHighlightPath),this.highlightNode.addChild(this.boundsFocusHighlightPath),this.groupFocusHighlightPath=new Oo(null,{useLocalBounds:!0,useGroupDilation:!0,outerLineWidth:Po.GROUP_OUTER_LINE_WIDTH,innerLineWidth:Po.GROUP_INNER_LINE_WIDTH,innerStroke:Po.OUTER_FOCUS_COLOR}),this.groupFocusHighlightParent=new Zs({children:[this.groupFocusHighlightPath]}),this.focusRootNode.addChild(this.groupFocusHighlightParent),this.readingBlockHighlightPath=new nA(null),this.readingBlockHighlightNode.addChild(this.readingBlockHighlightPath),this.boundsListener=this.onBoundsChange.bind(this),this.transformListener=this.onTransformChange.bind(this),this.domFocusListener=this.onFocusChange.bind(this),this.readingBlockTransformListener=this.onReadingBlockTransformChange.bind(this),this.focusHighlightListener=this.onFocusHighlightChange.bind(this),this.interactiveHighlightListener=this.onInteractiveHighlightChange.bind(this),this.focusHighlightsVisibleListener=this.onFocusHighlightsVisibleChange.bind(this),this.voicingHighlightsVisibleListener=this.onVoicingHighlightsVisibleChange.bind(this),this.pointerFocusListener=this.onPointerFocusChange.bind(this),this.lockedPointerFocusListener=this.onLockedPointerFocusChange.bind(this),this.readingBlockFocusListener=this.onReadingBlockFocusChange.bind(this),this.readingBlockHighlightChangeListener=this.onReadingBlockHighlightChange.bind(this),So.pdomFocusProperty.link(this.domFocusListener),e.focusManager.pointerFocusProperty.link(this.pointerFocusListener),e.focusManager.readingBlockFocusProperty.link(this.readingBlockFocusListener),e.focusManager.lockedPointerFocusProperty.link(this.lockedPointerFocusListener),this.pdomFocusHighlightsVisibleProperty.link(this.focusHighlightsVisibleListener),this.interactiveHighlightsVisibleProperty.link(this.voicingHighlightsVisibleListener)}dispose(){this.hasHighlight()&&this.deactivateHighlight(),So.pdomFocusProperty.unlink(this.domFocusListener),this.pdomFocusHighlightsVisibleProperty.unlink(this.focusHighlightsVisibleListener),this.interactiveHighlightsVisibleProperty.unlink(this.voicingHighlightsVisibleListener),this.display.focusManager.pointerFocusProperty.unlink(this.pointerFocusListener),this.display.focusManager.readingBlockFocusProperty.unlink(this.readingBlockFocusListener),this.focusDisplay.dispose()}hasHighlight(){return!!this.trail}hasReadingBlockHighlight(){return!!this.readingBlockTrail}activateHighlight(e,t,i,s,n){this.trail=e,this.node=t;const r=i;this.activeHighlight=r;let o=e;if("invisible"===r)this.mode="invisible";else if(r instanceof _t.bn)this.mode="shape",this.shapeFocusHighlightPath.visible=!0,this.shapeFocusHighlightPath.setShape(r);else if(r instanceof Zs){if(this.mode="node",r instanceof Po){r.transformSourceNode&&(o=r.getUniqueHighlightTrail(this.trail))}this.nodeModeHighlight=r,s?(this.nodeModeHighlightLayered=!0,this.nodeModeHighlight.visible=n.get()):(this.nodeModeHighlight.visible=!0,this.highlightNode.addChild(this.nodeModeHighlight))}else this.mode="bounds",this.boundsFocusHighlightPath.setShapeFromNode(this.node),this.boundsFocusHighlightPath.visible=!0,this.node.localBoundsProperty.lazyLink(this.boundsListener),this.onBoundsChange();this.transformTracker=new xr(o,{isStatic:!0}),this.transformTracker.addListener(this.transformListener),this.activateGroupHighlights(),this.updateHighlightColors(),this.transformDirty=!0}activateFocusHighlight(e,t){this.activateHighlight(e,t,t.focusHighlight,t.focusHighlightLayerable,this.pdomFocusHighlightsVisibleProperty),t.focusHighlightChangedEmitter.addListener(this.focusHighlightListener)}activateInteractiveHighlight(e,t){this.activateHighlight(e,t,t.interactiveHighlight||t.focusHighlight,t.interactiveHighlightLayerable,this.interactiveHighlightsVisibleProperty),t.interactiveHighlightChangedEmitter.addListener(this.interactiveHighlightListener),t.focusHighlightChangedEmitter.addListener(this.interactiveHighlightListener)}activateReadingBlockHighlight(e){this.readingBlockTrail=e;const t=e.lastNode();this.activeReadingBlockNode=t;const i=this.activeReadingBlockNode.readingBlockActiveHighlight;this.addedReadingBlockHighlight=i,"invisible"===i||(i instanceof _t.bn?(this.readingBlockHighlightPath.setShape(i),this.readingBlockHighlightPath.visible=!0):i instanceof Zs?this.readingBlockHighlightNode.addChild(i):(this.readingBlockHighlightPath.setShapeFromNode(this.activeReadingBlockNode),this.readingBlockHighlightPath.visible=!0)),this.readingBlockTransformTracker=new xr(this.readingBlockTrail,{isStatic:!0}),this.readingBlockTransformTracker.addListener(this.readingBlockTransformListener),this.activeReadingBlockNode.readingBlockActiveHighlightChangedEmitter.addListener(this.readingBlockHighlightChangeListener),this.readingBlockTransformDirty=!0}deactivateReadingBlockHighlight(){this.readingBlockHighlightPath.visible=!1,this.addedReadingBlockHighlight instanceof Zs&&this.readingBlockHighlightNode.removeChild(this.addedReadingBlockHighlight);const e=this.readingBlockTransformTracker;e.removeListener(this.readingBlockTransformListener),e.dispose(),this.readingBlockTransformTracker=null,this.activeReadingBlockNode.readingBlockActiveHighlightChangedEmitter.removeListener(this.readingBlockHighlightChangeListener),this.activeReadingBlockNode=null,this.readingBlockTrail=null,this.addedReadingBlockHighlight=null}deactivateHighlight(){const e=this.node;if("shape"===this.mode)this.shapeFocusHighlightPath.visible=!1;else if("node"===this.mode){const e=this.nodeModeHighlight;this.nodeModeHighlightLayered?this.nodeModeHighlightLayered=!1:this.highlightNode.removeChild(e),e.visible=!1,this.nodeModeHighlight=null}else"bounds"===this.mode&&(this.boundsFocusHighlightPath.visible=!1,e.localBoundsProperty.unlink(this.boundsListener));e.focusHighlightChangedEmitter.hasListener(this.focusHighlightListener)&&e.focusHighlightChangedEmitter.removeListener(this.focusHighlightListener);const t=e;t.isInteractiveHighlighting&&(t.interactiveHighlightChangedEmitter.hasListener(this.interactiveHighlightListener)&&t.interactiveHighlightChangedEmitter.removeListener(this.interactiveHighlightListener),t.focusHighlightChangedEmitter.hasListener(this.interactiveHighlightListener)&&t.focusHighlightChangedEmitter.removeListener(this.interactiveHighlightListener)),this.deactivateGroupHighlights(),this.trail=null,this.node=null,this.mode=null,this.activeHighlight=null,this.transformTracker.removeListener(this.transformListener),this.transformTracker.dispose(),this.transformTracker=null}activateGroupHighlights(){const e=this.trail;for(let t=0;t<e.length;t++){const i=e.nodes[t],s=i.groupFocusHighlight;if(s){const t=e.upToNode(i);this.groupTransformTracker=new xr(t),this.groupTransformTracker.addListener(this.transformListener),"boolean"==typeof s?(this.groupFocusHighlightPath.setShapeFromNode(i),this.groupFocusHighlightPath.visible=!0,this.groupHighlightNode=this.groupFocusHighlightPath,this.groupMode="bounds"):s instanceof Zs&&(this.groupHighlightNode=s,this.groupFocusHighlightParent.addChild(s),this.groupMode="node");break}}}updateHighlightColors(){"shape"===this.mode?(this.shapeFocusHighlightPath.innerHighlightColor!==ad.getInnerHighlightColor()&&this.shapeFocusHighlightPath.setInnerHighlightColor(ad.getInnerHighlightColor()),this.shapeFocusHighlightPath.outerHighlightColor!==ad.getOuterHighlightColor()&&this.shapeFocusHighlightPath.setOuterHighlightColor(ad.getOuterHighlightColor())):"bounds"===this.mode&&(this.boundsFocusHighlightPath.innerHighlightColor!==ad.getInnerHighlightColor()&&this.boundsFocusHighlightPath.setInnerHighlightColor(ad.getInnerHighlightColor()),this.boundsFocusHighlightPath.outerHighlightColor!==ad.getOuterHighlightColor()&&this.boundsFocusHighlightPath.setOuterHighlightColor(ad.getOuterHighlightColor())),this.groupMode&&(this.groupFocusHighlightPath.innerHighlightColor!==ad.getInnerGroupHighlightColor()&&this.groupFocusHighlightPath.setInnerHighlightColor(ad.getInnerGroupHighlightColor()),this.groupFocusHighlightPath.outerHighlightColor!==ad.getOuterGroupHighlightColor()&&this.groupFocusHighlightPath.setOuterHighlightColor(ad.getOuterGroupHighlightColor()))}deactivateGroupHighlights(){this.groupMode&&("bounds"===this.groupMode?this.groupFocusHighlightPath.visible=!1:"node"===this.groupMode&&this.groupFocusHighlightParent.removeChild(this.groupHighlightNode),this.groupMode=null,this.groupHighlightNode=null,this.groupTransformTracker.removeListener(this.transformListener),this.groupTransformTracker.dispose(),this.groupTransformTracker=null)}afterTransform(){"shape"===this.mode?this.shapeFocusHighlightPath.updateLineWidth():"bounds"===this.mode?this.boundsFocusHighlightPath.updateLineWidth():"node"===this.mode&&this.activeHighlight instanceof Po&&this.activeHighlight.updateLineWidth&&this.activeHighlight.updateLineWidth(this.node)}onTransformChange(){this.transformDirty=!0}onReadingBlockTransformChange(){this.readingBlockTransformDirty=!0}onBoundsChange(){this.boundsFocusHighlightPath.setShapeFromNode(this.node)}onFocusChange(e){const t=e&&e.display===this.display?e.trail:null;if(this.hasHighlight()&&this.deactivateHighlight(),t&&this.pdomFocusHighlightsVisibleProperty.value){const e=t.lastNode();this.activateFocusHighlight(t,e)}else this.display.focusManager.pointerFocusProperty.value&&this.interactiveHighlightsVisibleProperty.value&&this.updateInteractiveHighlight(this.display.focusManager.pointerFocusProperty.value)}onPointerFocusChange(e){this.display.focusManager.lockedPointerFocusProperty.value||this.display.focusManager.pdomFocusHighlightsVisibleProperty.value||this.updateInteractiveHighlight(e)}updateInteractiveHighlight(e){const t=e&&e.display===this.display?e.trail:null;this.hasHighlight()&&this.deactivateHighlight();let i=!1;if(t&&!this.display.focusManager.pdomFocusHighlightsVisibleProperty.value){const e=t.lastNode();(e.isReadingBlock&&this.readingBlockHighlightsVisibleProperty.value||!e.isReadingBlock&&this.interactiveHighlightsVisibleProperty.value)&&(this.activateInteractiveHighlight(t,e),i=!0)}!i&&So.pdomFocus&&this.pdomFocusHighlightsVisibleProperty.value&&this.onFocusChange(So.pdomFocus)}onLockedPointerFocusChange(e){this.updateInteractiveHighlight(e||this.display.focusManager.pointerFocusProperty.value)}onReadingBlockFocusChange(e){this.hasReadingBlockHighlight()&&this.deactivateReadingBlockHighlight();const t=e&&e.display===this.display?e.trail:null;t&&this.activateReadingBlockHighlight(t)}onFocusHighlightChange(){this.onFocusChange(So.pdomFocus)}onInteractiveHighlightChange(){this.updateInteractiveHighlight(this.display.focusManager.lockedPointerFocusProperty.value||this.display.focusManager.pointerFocusProperty.value)}onReadingBlockHighlightChange(){this.onReadingBlockFocusChange(this.display.focusManager.readingBlockFocusProperty.value)}onFocusHighlightsVisibleChange(){this.onFocusChange(So.pdomFocus)}onVoicingHighlightsVisibleChange(){this.onPointerFocusChange(this.display.focusManager.pointerFocusProperty.value)}update(){this.hasHighlight()&&this.transformDirty&&(this.transformDirty=!1,this.highlightNode.setMatrix(this.transformTracker.matrix),this.groupHighlightNode&&this.groupHighlightNode.setMatrix(this.groupTransformTracker.matrix),this.afterTransform()),this.hasReadingBlockHighlight()&&this.readingBlockTransformDirty&&(this.readingBlockTransformDirty=!1,this.readingBlockHighlightNode.setMatrix(this.readingBlockTransformTracker.matrix)),this.display.size.equals(this.focusDisplay.size)||this.focusDisplay.setWidthHeight(this.display.width,this.display.height),this.focusDisplay.updateDisplay()}static setInnerHighlightColor(e){rd=e}static getInnerHighlightColor(){return rd}static setOuterHilightColor(e){nd=e}static getOuterHighlightColor(){return nd}static setInnerGroupHighlightColor(e){od=e}static getInnerGroupHighlightColor(){return od}static setOuterGroupHighlightColor(e){Ad=e}static getOuterGroupHighlightColor(){return Ad}}W.register("HighlightOverlay",ad);class hd extends td{constructor(e,t){super(e,t,"hitAreaOverlay")}addShapes(){new pn(this.rootNode).eachTrailUnder(e=>{const t=e.lastNode();if(!t.isVisible()||!1===t.pickable)return!0;if(t.inputListeners.length&&e.isVisible()){const i=hd.getLocalMouseShape(t),s=hd.getLocalTouchShape(t),n=e.getMatrix();i.bounds.isEmpty()||this.addShape(i.transformed(n),"rgba(0,0,255,0.8)",!0),s.bounds.isEmpty()||this.addShape(s.transformed(n),"rgba(255,0,0,0.8)",!1)}return!1})}static getLocalMouseShape(e){let t=_t.bn.union([e.mouseArea?e.mouseArea instanceof _t.bn?e.mouseArea:_t.bn.bounds(e.mouseArea):e.getSelfShape(),...e.children.filter(t=>e.visible&&!1!==e.pickable).map(e=>hd.getLocalMouseShape(e).transformed(e.matrix))]);return e.hasClipArea()&&(t=t.shapeIntersection(e.clipArea)),t}static getLocalTouchShape(e){let t=_t.bn.union([e.touchArea?e.touchArea instanceof _t.bn?e.touchArea:_t.bn.bounds(e.touchArea):e.getSelfShape(),...e.children.filter(t=>e.visible&&!1!==e.pickable).map(e=>hd.getLocalTouchShape(e).transformed(e.matrix))]);return e.hasClipArea()&&(t=t.shapeIntersection(e.clipArea)),t}}W.register("HitAreaOverlay",hd);class ld extends td{constructor(e,t){super(e,t,"mouseTouchAreaOverlay")}addShapes(){new pn(this.rootNode).eachTrailUnder(e=>{const t=e.lastNode();if(!t.isVisible())return!0;if((t.mouseArea||t.touchArea)&&e.isVisible()){const i=e.getTransform();t.mouseArea&&this.addShape(i.transformShape(t.mouseArea instanceof Ue.Z?_t.bn.bounds(t.mouseArea):t.mouseArea),"rgba(0,0,255,0.8)",!0),t.touchArea&&this.addShape(i.transformShape(t.touchArea instanceof Ue.Z?_t.bn.bounds(t.touchArea):t.touchArea),"rgba(255,0,0,0.8)",!1)}return!1})}}W.register("PointerAreaOverlay",ld);class gd{constructor(e,t){this.display=e,this.rootNode=t,this.pointerSVGContainer=document.createElement("div"),this.pointerSVGContainer.style.position="absolute",this.pointerSVGContainer.style.top="0",this.pointerSVGContainer.style.left="0",this.pointerSVGContainer.style["pointer-events"]="none";e.sizeProperty.lazyLink(e=>{this.pointerSVGContainer.setAttribute("width",""+e.width),this.pointerSVGContainer.setAttribute("height",""+e.height),this.pointerSVGContainer.style.clip=`rect(0px,${e.width}px,${e.height}px,0px)`});const i=Le.Z.IDENTITY.copy();this.pointerAdded=e=>{const t=document.createElementNS(ke,"svg");t.style.position="absolute",t.style.top="0",t.style.left="0",t.style["pointer-events"]="none",ve.prepareForTransform(t),t.setAttribute("width","21"),t.setAttribute("height","21");const s=document.createElementNS(ke,"circle");s.setAttribute("cx","10.5"),s.setAttribute("cy","10.5"),s.setAttribute("r","10"),s.setAttribute("style","fill:black;"),s.setAttribute("style","stroke:white;"),s.setAttribute("opacity","0.4");const n=e=>ve.applyPreparedTransform(i.setToTranslation(e.x-10.5,e.y-10.5),t),r=()=>{e.isTouchLike()&&(this.pointerSVGContainer.removeChild(t),e.removeInputListener(o))},o={move:()=>{e.point&&n(e.point)},up:r,cancel:r,focus:()=>{e instanceof LA&&e.point&&(n(e.point),this.pointerSVGContainer.appendChild(t))},blur:()=>{this.pointerSVGContainer.contains(t)&&this.pointerSVGContainer.removeChild(t)}};e.addInputListener(o),o.move(),t.appendChild(s),this.pointerSVGContainer.appendChild(t)},e._input.pointerAddedEmitter.addListener(this.pointerAdded),e._input&&e._input.mouse&&this.pointerAdded(e._input.mouse),this.domElement=this.pointerSVGContainer}dispose(){this.display._input.pointerAddedEmitter.removeListener(this.pointerAdded)}update(){}}W.register("PointerOverlay",gd);let cd=1;const dd=Te.createOrderBitmask(Te.bitmaskSVG,Te.bitmaskCanvas,Te.bitmaskDOM,Te.bitmaskWebGL);class ud{constructor(e,t,i,s){this.active=!1,this.initialize(e,t,i,s)}initialize(e,t,i,s){return t.setImmutable(),this.id=this.id||cd++,this.isWebGLSupported=e.isWebGLAllowed()&&ve.isWebGLSupported,this.relativeTransform=this.relativeTransform||new mc(this),this.fittability=this.fittability||new Bc(this),this.visible=!0,this.relativeVisible=!0,this.selfVisible=!0,this.visibilityDirty=!0,this.childVisibilityDirty=!0,this.voicingVisible=!0,this.branchIndexMap=this.branchIndexMap||{},this.branchIndexReferences=(0,Ji.Z)(this.branchIndexReferences),this.addRemoveCounter=0,this.stitchChangeFrame=e._frameId,this.stitchChangeBefore=0,this.stitchChangeAfter=0,this.stitchChangeOnChildren=0,this.stitchChangeIncluded=!1,this.childInsertedListener=this.childInsertedListener||this.onChildInserted.bind(this),this.childRemovedListener=this.childRemovedListener||this.onChildRemoved.bind(this),this.childrenReorderedListener=this.childrenReorderedListener||this.onChildrenReordered.bind(this),this.visibilityListener=this.visibilityListener||this.onVisibilityChange.bind(this),this.markRenderStateDirtyListener=this.markRenderStateDirtyListener||this.markRenderStateDirty.bind(this),this.visibleEmitter=new te.Z,this.relativeVisibleEmitter=new te.Z,this.selfVisibleEmitter=new te.Z,this.canVoiceEmitter=new te.Z,this.cleanInstance(e,t),this.node.addInstance(this),this.externalReferenceCount=0,this.stateless=!0,this.isDisplayRoot=i,this.isSharedCanvasCacheRoot=s,this.preferredRenderers=0,this.isUnderCanvasCache=s,this.isBackbone=!1,this.isTransformed=!1,this.isVisibilityApplied=!1,this.isInstanceCanvasCache=!1,this.isSharedCanvasCachePlaceholder=!1,this.isSharedCanvasCacheSelf=s,this.selfRenderer=0,this.groupRenderer=0,this.sharedCacheRenderer=0,this.renderStateDirtyFrame=e._frameId,this.skipPruningFrame=e._frameId,this.active=!0,this}cleanInstance(e,t){this.display=e,this.trail=t,this.node=t?t.lastNode():null,this.parent=null,this.oldParent=null,this.children=(0,Ji.Z)(this.children),this.sharedCacheInstance=null,this.relativeTransform.initialize(e,t),this.fittability.initialize(e,t),this.instanceRemovalCheckList=(0,Ji.Z)(this.instanceRemovalCheckList),this.selfDrawable=null,this.groupDrawable=null,this.sharedCacheDrawable=null,this.firstDrawable=null,this.lastDrawable=null,this.firstInnerDrawable=null,this.lastInnerDrawable=null,this.svgGroups=(0,Ji.Z)(this.svgGroups),this.cleanSyncTreeResults()}cleanSyncTreeResults(){this.beforeStableIndex=this.children.length,this.afterStableIndex=-1,this.firstChangeInterval=null,this.lastChangeInterval=null,this.incompatibleStateChange=!1,this.groupChanged=!1,this.cascadingStateChange=!1,this.anyStateChange=!1}updateRenderingState(){const e=this.isBackbone,t=this.isTransformed,i=this.isVisibilityApplied,s=this.isInstanceCanvasCache,n=this.isSharedCanvasCacheSelf,r=this.isSharedCanvasCachePlaceholder,o=this.isUnderCanvasCache,A=this.selfRenderer,a=this.groupRenderer,h=this.sharedCacheRenderer,l=this.preferredRenderers;this.isBackbone=!1,this.isTransformed=!1,this.isVisibilityApplied=!1,this.isInstanceCanvasCache=!1,this.isSharedCanvasCacheSelf=!1,this.isSharedCanvasCachePlaceholder=!1,this.selfRenderer=0,this.groupRenderer=0,this.sharedCacheRenderer=0;const g=this.node;this.isUnderCanvasCache=this.isSharedCanvasCacheRoot||!!this.parent&&(this.parent.isUnderCanvasCache||this.parent.isInstanceCanvasCache||this.parent.isSharedCanvasCacheSelf),this.preferredRenderers=this.parent?this.parent.preferredRenderers:dd,g._renderer&&(this.preferredRenderers=Te.pushOrderBitmask(this.preferredRenderers,g._renderer));const c=this.node.hasClipArea(),d=1!==this.node.effectiveOpacity||g._usesOpacity||this.node._filters.length>0;let u=!1,m=!1;if(d)for(let B=0;B<this.node._filters.length;B++){const e=this.node._filters[B];e.isSVGCompatible()||(u=!0),e.isCanvasCompatible()||(m=!0)}const p=g._cssTransform||g._layerSplit,V=this.isDisplayRoot||!this.isUnderCanvasCache&&p,M=!V&&(d||c)&&(!u&&this.node._rendererSummary.isSubtreeRenderedExclusivelySVG(this.preferredRenderers)||!m&&this.node._rendererSummary.isSubtreeRenderedExclusivelyCanvas(this.preferredRenderers));if(!M&&(V||d||c)?(this.isBackbone=!0,this.isVisibilityApplied=!0,this.isTransformed=this.isDisplayRoot||!!g._cssTransform,this.groupRenderer=Te.bitmaskDOM):!M&&(d||c||g._canvasCache)&&(g._singleCache?this.isSharedCanvasCacheRoot?(this.isSharedCanvasCacheSelf=!0,this.sharedCacheRenderer=this.isWebGLSupported?Te.bitmaskWebGL:Te.bitmaskCanvas):this.isSharedCanvasCachePlaceholder=!0:(this.isInstanceCanvasCache=!0,this.isUnderCanvasCache=!0,this.groupRenderer=this.isWebGLSupported?Te.bitmaskWebGL:Te.bitmaskCanvas)),this.node.isPainted())if(this.isUnderCanvasCache)this.selfRenderer=Te.bitmaskCanvas;else{let e=this.node._rendererBitmask;if(!this.isWebGLSupported){e^=e&Te.bitmaskWebGL}this.selfRenderer=e&Te.bitmaskOrder(this.preferredRenderers,0)||e&Te.bitmaskOrder(this.preferredRenderers,1)||e&Te.bitmaskOrder(this.preferredRenderers,2)||e&Te.bitmaskOrder(this.preferredRenderers,3)||e&Te.bitmaskSVG||e&Te.bitmaskCanvas||e&Te.bitmaskDOM||e&Te.bitmaskWebGL||0}this.groupChanged=e!==this.isBackbone||s!==this.isInstanceCanvasCache||n!==this.isSharedCanvasCacheSelf,this.cascadingStateChange=o!==this.isUnderCanvasCache||l!==this.preferredRenderers,this.incompatibleStateChange=this.isTransformed!==t||this.isSharedCanvasCachePlaceholder!==r,this.anyStateChange=this.groupChanged||this.cascadingStateChange||this.incompatibleStateChange||A!==this.selfRenderer||a!==this.groupRenderer||h!==this.sharedCacheRenderer,i!==this.isVisibilityApplied&&(this.visibilityDirty=!0,this.parent&&this.parent.markChildVisibilityDirty()),this.fittability.checkSelfFittability()}getStateString(){return`S[ ${this.isDisplayRoot?"displayRoot ":""}${this.isBackbone?"backbone ":""}${this.isInstanceCanvasCache?"instanceCache ":""}${this.isSharedCanvasCachePlaceholder?"sharedCachePlaceholder ":""}${this.isSharedCanvasCacheSelf?"sharedCacheSelf ":""}${this.isTransformed?"TR ":""}${this.isVisibilityApplied?"VIS ":""}${this.selfRenderer?this.selfRenderer.toString(16):"-"},${this.groupRenderer?this.groupRenderer.toString(16):"-"},${this.sharedCacheRenderer?this.sharedCacheRenderer.toString(16):"-"} `+"]"}baseSyncTree(){this.syncTree(),this.cleanSyncTreeResults()}syncTree(){const e=this.stateless;if((e||this.parent&&this.parent.cascadingStateChange||this.renderStateDirtyFrame===this.display._frameId)&&this.updateRenderingState(),!e&&this.incompatibleStateChange)return!1;if(this.stateless=!1,e&&(this.isTransformed&&this.display.markTransformRootDirty(this,!0),this.attachNodeListeners()),this.isSharedCanvasCachePlaceholder)this.sharedSyncTree();else if(e||this.skipPruningFrame===this.display._frameId||this.anyStateChange){this.prepareChildInstances(e);this.firstDrawable,this.lastDrawable,this.firstInnerDrawable,this.lastInnerDrawable;const t=this.updateSelfDrawable();this.localSyncTree(t),this.groupSyncTree(e)}return!0}localSyncTree(e){const t=this.display._frameId;let i=this.selfDrawable,s=i,n=null;e&&(n=Vc.newForDisplay(null,null,this.display));let r=n,o=e?null:this.selfDrawable;for(let A=0;A<this.children.length;A++){let e=this.children[A];e.syncTree()||(e=this.updateIncompatibleChildInstance(e,A),e.syncTree());const a=e.shouldIncludeInParentDrawables();a&&e.firstDrawable&&(s?xl.connectDrawables(s,e.firstDrawable,this.display):i=e.firstDrawable,s=e.lastDrawable);const h=e.stitchChangeIncluded,l=a;e.stitchChangeIncluded=l,e.stitchChangeFrame===t&&(e.firstChangeInterval=e.lastChangeInterval=Vc.newForDisplay(null,null,this.display));const g=e.firstChangeInterval;let c=r&&null===r.drawableAfter;const d=g&&null===g.drawableBefore;if(e.stitchChangeBefore===t&&!c&&!d){const e=Vc.newForDisplay(o,null,this.display);r&&(r.nextChangeInterval=e),r=e,n=n||r,c=!0}if((h||l)&&(c?g?null===g.drawableBefore?(r.drawableAfter=g.drawableAfter,r.nextChangeInterval=g.nextChangeInterval,r=e.lastChangeInterval===g?r:e.lastChangeInterval):(r.drawableAfter=e.firstDrawable,r.nextChangeInterval=g,r=e.lastChangeInterval):r.drawableAfter=e.firstDrawable:g&&(n=n||g,null===g.drawableBefore&&(g.drawableBefore=o),r&&(r.nextChangeInterval=g),r=e.lastChangeInterval),o=r&&null===r.drawableAfter?null:e.lastDrawable?e.lastDrawable:o),A===this.children.length-1&&e.stitchChangeAfter===t&&(!r||null!==r.drawableAfter)){const e=Vc.newForDisplay(o,null,this.display);r&&(r.nextChangeInterval=e),r=e,n=n||r}e.cleanSyncTreeResults()}n||this.stitchChangeOnChildren!==this.display._frameId||0!==this.children.length||(n=r=Vc.newForDisplay(null,null,this.display)),this.firstChangeInterval=n,this.lastChangeInterval=r,this.firstDrawable=this.firstInnerDrawable=i,this.lastDrawable=this.lastInnerDrawable=s}updateSelfDrawable(){if(this.node.isPainted()){const e=this.selfRenderer;if(!this.selfDrawable||0==(this.selfDrawable.renderer&e&Te.bitmaskRendererArea))return this.selfDrawable&&this.selfDrawable.markForDisposal(this.display),this.selfDrawable=Te.createSelfDrawable(this,this.node,e,this.fittability.ancestorsFittable),!0}return!1}updateIncompatibleChildInstance(e,t){this.display.markInstanceRootForDisposal(e);const i=ud.createFromPool(this.display,this.trail.copy().addDescendant(e.node,t),!1,!1);return this.replaceInstanceWithIndex(e,i,t),i}groupSyncTree(e){const t=this.groupRenderer,i=!!t!=!!this.groupDrawable||!e&&this.groupChanged||this.groupDrawable&&this.groupDrawable.renderer!==t;i&&(this.groupDrawable&&(this.groupDrawable.markForDisposal(this.display),this.groupDrawable=null),this.firstChangeInterval=this.lastChangeInterval=Vc.newForDisplay(null,null,this.display)),t&&(this.firstDrawable&&xl.disconnectBefore(this.firstDrawable,this.display),this.lastDrawable&&xl.disconnectAfter(this.lastDrawable,this.display),this.isBackbone?(i&&(this.groupDrawable=ed.createFromPool(this.display,this,this.getTransformRootInstance(),t,this.isDisplayRoot),this.isTransformed&&this.display.markTransformRootDirty(this,!0)),this.firstChangeInterval&&this.groupDrawable.stitch(this.firstDrawable,this.lastDrawable,this.firstChangeInterval,this.lastChangeInterval)):this.isInstanceCanvasCache?(i&&(this.groupDrawable=gc.createFromPool(t,this)),this.firstChangeInterval&&this.groupDrawable.stitch(this.firstDrawable,this.lastDrawable,this.firstChangeInterval,this.lastChangeInterval)):this.isSharedCanvasCacheSelf&&i&&(this.groupDrawable=Tc.createFromPool(t,this)),this.groupDrawable.setFittable(this.fittability.ancestorsFittable),this.firstDrawable=this.lastDrawable=this.groupDrawable),i?this.firstChangeInterval=this.lastChangeInterval=Vc.newForDisplay(null,null,this.display):t&&(this.firstChangeInterval=this.lastChangeInterval=null)}sharedSyncTree(){this.ensureSharedCacheInitialized();const e=this.sharedCacheRenderer;this.sharedCacheDrawable&&this.sharedCacheDrawable.renderer===e||(this.sharedCacheDrawable&&this.sharedCacheDrawable.markForDisposal(this.display),this.sharedCacheDrawable=new dc(this.trail,e,this,this.sharedCacheInstance),this.firstDrawable=this.sharedCacheDrawable,this.lastDrawable=this.sharedCacheDrawable,this.firstChangeInterval=this.lastChangeInterval=Vc.newForDisplay(null,null,this.display))}prepareChildInstances(e){for(;this.instanceRemovalCheckList.length;){const e=this.instanceRemovalCheckList.pop();-1===e.addRemoveCounter&&(e.addRemoveCounter=0,this.display.markInstanceRootForDisposal(e))}if(e)for(let t=0;t<this.node.children.length;t++){const e=this.node.children[t];this.appendInstance(ud.createFromPool(this.display,this.trail.copy().addDescendant(e,t),!1,!1))}}ensureSharedCacheInitialized(){if(!this.sharedCacheInstance){const e=this.node.getId();this.sharedCacheInstance=this.display._sharedCanvasInstances[e],this.sharedCacheInstance||(this.sharedCacheInstance=ud.createFromPool(this.display,new pn(this.node),!1,!0),this.sharedCacheInstance.syncTree(),this.display._sharedCanvasInstances[e]=this.sharedCacheInstance,this.display.markTransformRootDirty(this.sharedCacheInstance,!0)),this.sharedCacheInstance.externalReferenceCount++,this.isTransformed&&this.display.markTransformRootDirty(this,!0)}}shouldIncludeInParentDrawables(){return this.node.isVisible()||!this.node.isExcludeInvisible()}findPreviousDrawable(e){for(let t=e-1;t>=0;t--){const e=this.children[t].lastDrawable;if(null!==e)return e}return null}findNextDrawable(e){const t=this.children.length;for(let i=e+1;i<t;i++){const e=this.children[i].firstDrawable;if(null!==e)return e}return null}appendInstance(e){this.insertInstance(e,this.children.length)}insertInstance(e,t){e.stitchChangeFrame=this.display._frameId,this.stitchChangeOnChildren=this.display._frameId,this.children.splice(t,0,e),e.parent=this,e.oldParent=this,t<=this.beforeStableIndex&&(this.beforeStableIndex=t-1),t>this.afterStableIndex?this.afterStableIndex=t+1:this.afterStableIndex++,this.fittability.onInsert(e.fittability),this.relativeTransform.addInstance(e),this.markChildVisibilityDirty()}removeInstance(e){this.removeInstanceWithIndex(e,_.indexOf(this.children,e))}removeInstanceWithIndex(e,t){const i=this.display._frameId;e.stitchChangeFrame=i,this.stitchChangeOnChildren=i,t-1>=0&&(this.children[t-1].stitchChangeAfter=i),t+1<this.children.length&&(this.children[t+1].stitchChangeBefore=i),this.children.splice(t,1),e.parent=null,e.oldParent=this,t<=this.beforeStableIndex&&(this.beforeStableIndex=t-1),t>=this.afterStableIndex?this.afterStableIndex=t:this.afterStableIndex--,this.fittability.onRemove(e.fittability),this.relativeTransform.removeInstance(e)}replaceInstanceWithIndex(e,t,i){this.removeInstanceWithIndex(e,i),this.insertInstance(t,i)}reorderInstances(e,t){const i=this.display._frameId;this.children.splice(e,t-e+1);for(let s=e;s<=t;s++){const n=this.findChildInstanceOnNode(this.node._children[s]);this.children.splice(s,0,n),n.stitchChangeFrame=i,s>e&&(n.stitchChangeAfter=i),s<t&&(n.stitchChangeBefore=i)}this.stitchChangeOnChildren=i,this.beforeStableIndex=Math.min(this.beforeStableIndex,e-1),this.afterStableIndex=Math.max(this.afterStableIndex,t+1)}findChildInstanceOnNode(e){const t=e.getInstances();for(let i=0;i<t.length;i++)if(t[i].oldParent===this)return t[i];return null}onChildInserted(e,t){let i=this.findChildInstanceOnNode(e);i?i.addRemoveCounter+=1:i=ud.createFromPool(this.display,this.trail.copy().addDescendant(e,t),!1,!1),this.insertInstance(i,t),this.markSkipPruning()}onChildRemoved(e,t){const i=this.findChildInstanceOnNode(e);i.addRemoveCounter-=1,this.instanceRemovalCheckList.push(i),this.removeInstanceWithIndex(i,t),this.markSkipPruning()}onChildrenReordered(e,t){this.reorderInstances(e,t),this.markSkipPruning()}onVisibilityChange(){this.stitchChangeFrame=this.display._frameId,this.parent&&this.parent.markSkipPruning(),this.visibilityDirty=!0,this.parent&&this.parent.markChildVisibilityDirty()}onOpacityChange(){this.markRenderStateDirty()}markChildVisibilityDirty(){this.childVisibilityDirty||(this.childVisibilityDirty=!0,this.parent&&this.parent.markChildVisibilityDirty())}updateDrawableFittability(e){this.selfDrawable&&this.selfDrawable.setFittable(e),this.groupDrawable&&this.groupDrawable.setFittable(e)}updateVisibility(e,t,i,s){this.visibilityDirty&&(s=!0);const n=this.node.isVisible(),r=this.visible,o=this.relativeVisible,A=this.selfVisible,a=this.node.voicingVisibleProperty.value,h=this.voicingVisible,l=r&&h;this.visible=e&&n,this.voicingVisible=t&&a,this.relativeVisible=i&&n,this.selfVisible=!!this.isVisibilityApplied||this.relativeVisible;const g=this.children.length;for(let d=0;d<g;d++){const e=this.children[d];(s||e.visibilityDirty||e.childVisibilityDirty)&&e.updateVisibility(this.visible,this.voicingVisible,!!this.isVisibilityApplied||this.relativeVisible,s)}this.visibilityDirty=!1,this.childVisibilityDirty=!1,this.visible!==r&&this.visibleEmitter.emit(),this.relativeVisible!==o&&this.relativeVisibleEmitter.emit(),this.selfVisible!==A&&this.selfVisibleEmitter.emit();const c=this.voicingVisible&&this.visible;c!==l&&this.canVoiceEmitter.emit(c)}getDescendantCount(){let e=this.children.length;for(let t=0;t<this.children.length;t++)e+=this.children[t].getDescendantCount();return e}addSVGGroup(e){this.svgGroups.push(e)}removeSVGGroup(e){(0,Oi.Z)(this.svgGroups,e)}lookupSVGGroup(e){const t=this.svgGroups.length;for(let i=0;i<t;i++){const t=this.svgGroups[i];if(t.block===e)return t}return null}getFilterRootInstance(){return this.isBackbone||this.isInstanceCanvasCache||!this.parent?this:this.parent.getFilterRootInstance()}getTransformRootInstance(){return this.isTransformed||!this.parent?this:this.parent.getTransformRootInstance()}getVisibilityRootInstance(){return this.isVisibilityApplied||!this.parent?this:this.parent.getVisibilityRootInstance()}attachNodeListeners(){this.relativeTransform.attachNodeListeners(),this.isSharedCanvasCachePlaceholder||(this.node.childInsertedEmitter.addListener(this.childInsertedListener),this.node.childRemovedEmitter.addListener(this.childRemovedListener),this.node.childrenReorderedEmitter.addListener(this.childrenReorderedListener),this.node.visibleProperty.lazyLink(this.visibilityListener),this.node.voicingVisibleProperty.lazyLink(this.visibilityListener),this.node.filterChangeEmitter.addListener(this.markRenderStateDirtyListener),this.node.clipAreaProperty.lazyLink(this.markRenderStateDirtyListener),this.node.instanceRefreshEmitter.addListener(this.markRenderStateDirtyListener))}detachNodeListeners(){this.relativeTransform.detachNodeListeners(),this.isSharedCanvasCachePlaceholder||(this.node.childInsertedEmitter.removeListener(this.childInsertedListener),this.node.childRemovedEmitter.removeListener(this.childRemovedListener),this.node.childrenReorderedEmitter.removeListener(this.childrenReorderedListener),this.node.visibleProperty.unlink(this.visibilityListener),this.node.voicingVisibleProperty.unlink(this.visibilityListener),this.node.filterChangeEmitter.removeListener(this.markRenderStateDirtyListener),this.node.clipAreaProperty.unlink(this.markRenderStateDirtyListener),this.node.instanceRefreshEmitter.removeListener(this.markRenderStateDirtyListener))}markRenderStateDirty(){this.renderStateDirtyFrame=this.display._frameId,this.parent&&this.parent.markSkipPruning()}markSkipPruning(){this.skipPruningFrame=this.display._frameId,this.parent&&this.parent.markSkipPruning()}getBranchIndexTo(e){const t=this.branchIndexMap[e.id];if(void 0!==t)return t;const i=this.trail.getBranchIndexTo(e.trail);return this.branchIndexMap[e.id]=i,e.branchIndexMap[this.id]=i,this.branchIndexReferences.push(e),e.branchIndexReferences.push(this),i}dispose(){for(this.active=!1;this.branchIndexReferences.length;){const e=this.branchIndexReferences.pop();delete this.branchIndexMap[e.id],delete e.branchIndexMap[this.id],(0,Oi.Z)(e.branchIndexReferences,this)}this.groupDrawable&&this.groupDrawable.disposeImmediately(this.display),this.sharedCacheDrawable&&this.sharedCacheDrawable.disposeImmediately(this.display),this.selfDrawable&&this.selfDrawable.disposeImmediately(this.display);const e=this.children.length;for(let t=0;t<e;t++)this.children[t].dispose();for(;this.instanceRemovalCheckList.length;){const e=this.instanceRemovalCheckList.pop();e.active&&e.dispose()}this.stateless||this.detachNodeListeners(),this.node.removeInstance(this),this.sharedCacheInstance&&(this.sharedCacheInstance.externalReferenceCount--,0===this.sharedCacheInstance.externalReferenceCount&&(delete this.display._sharedCanvasInstances[this.node.getId()],this.sharedCacheInstance.dispose())),this.cleanInstance(null,null),this.visibleEmitter.removeAllListeners(),this.relativeVisibleEmitter.removeAllListeners(),this.selfVisibleEmitter.removeAllListeners(),this.canVoiceEmitter.removeAllListeners(),this.freeToPool()}audit(e,t){0}auditVisibility(e){0}auditChangeIntervals(e,t,i,s){if(e){let i=e;for(;i!==t;)i=i.oldNextDrawable}if(i){let e=i;for(;e!==s;)e=e.nextDrawable}}toString(){return`${this.id}#${this.node?`${this.node.constructor.name?this.node.constructor.name:"?"}#${this.node.id}`:"-"}`}}W.register("Instance",ud),Rt.mixInto(ud);const md=ud;class pd{constructor(e){this.display=e;const t=document.createElementNS(ke,"svg");this.domElement=t,t.style.position="absolute",t.setAttribute("class","safari-workaround"),t.style.top="0",t.style.left="0",t.style["pointer-events"]="none",e.sizeProperty.link(e=>{t.setAttribute("width",""+e.width),t.setAttribute("height",""+e.height),t.style.clip=`rect(0px,${e.width}px,${e.height}px,0px)`}),this.rect=document.createElementNS(ke,"rect"),t.appendChild(this.rect),this.update()}update(){const e=wA.Z.nextDouble();this.rect.setAttribute("x",""+e),this.rect.setAttribute("y",""+e),this.rect.setAttribute("style","fill: rgba(255,200,100,0); stroke: none;"),this.display.width&&this.rect.setAttribute("width",""+(this.display.width-2*e)),this.display.height&&this.rect.setAttribute("height",""+(this.display.height-2*e))}}W.register("SafariWorkaroundOverlay",pd);const Vd={"scenery-grab-pointer":["grab","-moz-grab","-webkit-grab","pointer"],"scenery-grabbing-pointer":["grabbing","-moz-grabbing","-webkit-grabbing","pointer"]};let Md=1;class Bd{constructor(e,t){const i=(0,Ce.ZP)()({width:t&&t.container&&t.container.clientWidth||640,height:t&&t.container&&t.container.clientHeight||480,allowCSSHacks:!0,allowSafariRedrawWorkaround:!1,allowSceneOverflow:!1,defaultCursor:"default",backgroundColor:null,preserveDrawingBuffer:!1,allowWebGL:!0,accessibility:!0,supportsInteractiveHighlights:!1,interactive:!0,listenToOnlyElement:!1,batchDOMEvents:!1,assumeFullWindow:!1,aggressiveContextRecreation:!0,passiveEvents:!Oe.Z.safari&&null,allowBackingScaleAntialiasing:!0},t);this.id=Md++,this._accessible=i.accessibility,this._preserveDrawingBuffer=i.preserveDrawingBuffer,this._allowWebGL=i.allowWebGL,this._allowCSSHacks=i.allowCSSHacks,this._allowSceneOverflow=i.allowSceneOverflow,this._defaultCursor=i.defaultCursor,this.sizeProperty=new Ms.Z(new hi.Z(i.width,i.height)),this._currentSize=new hi.Z(-1,-1),this._rootNode=e,this._rootNode.addRootedDisplay(this),this._rootBackbone=null,this._domElement=i.container?ed.repurposeBackboneContainer(i.container):ed.createDivBackbone(),this._sharedCanvasInstances={},this._baseInstance=null,this._frameId=0,this._dirtyTransformRoots=[],this._dirtyTransformRootsWithoutPass=[],this._instanceRootsToDispose=[],this._reduceReferencesNeeded=[],this._drawablesToDispose=[],this._drawablesToChangeBlock=[],this._drawablesToUpdateLinks=[],this._changeIntervalsToDispose=[],this._lastCursor=null,this._currentBackgroundCSS=null,this._backgroundColor=null,this._requestAnimationFrameID=0,this._input=null,this._inputListeners=[],this._interactive=i.interactive,this._listenToOnlyElement=i.listenToOnlyElement,this._batchDOMEvents=i.batchDOMEvents,this._assumeFullWindow=i.assumeFullWindow,this._passiveEvents=i.passiveEvents,this._aggressiveContextRecreation=i.aggressiveContextRecreation,this._allowBackingScaleAntialiasing=i.allowBackingScaleAntialiasing,this._overlays=[],this._pointerOverlay=null,this._pointerAreaOverlay=null,this._hitAreaOverlay=null,this._canvasAreaBoundsOverlay=null,this._fittedBlockBoundsOverlay=null,this.applyCSSHacks(),this.setBackgroundColor(i.backgroundColor);const s=new lo;if(this.descriptionUtteranceQueue=new po(s,{initialize:this._accessible,featureSpecificAnnouncingControlPropertyName:"descriptionCanAnnounceProperty"}),Oe.Z.safari&&i.allowSafariRedrawWorkaround&&this.addOverlay(new pd(this)),this.focusManager=new So,(this._accessible||i.supportsInteractiveHighlights)&&(this._focusRootNode=new Zs,this._focusOverlay=new ad(this,this._focusRootNode,{pdomFocusHighlightsVisibleProperty:this.focusManager.pdomFocusHighlightsVisibleProperty,interactiveHighlightsVisibleProperty:this.focusManager.interactiveHighlightsVisibleProperty,readingBlockHighlightsVisibleProperty:this.focusManager.readingBlockHighlightsVisibleProperty}),this.addOverlay(this._focusOverlay)),this._accessible){this._rootPDOMInstance=yA.pool.create(null,this,new pn),GA.rebuildInstanceTree(this._rootPDOMInstance),this._domElement.appendChild(this._rootPDOMInstance.peer.primarySibling);const e=s.ariaLiveContainer;this._domElement.appendChild(e),e.style[we.userSelect]="none",this._boundHandleFullScreenNavigation=this.handleFullScreenNavigation.bind(this),Hr.keydownEmitter.addListener(this._boundHandleFullScreenNavigation)}}getDOMElement(){return this._domElement}get domElement(){return this.getDOMElement()}updateDisplay(){const e=!!this._baseInstance;for(this._input&&this._input.validatePointers(),this._accessible&&this._rootPDOMInstance.peer.updateSubtreePositioning(),this._rootNode.validateWatchedBounds(),this._baseInstance=this._baseInstance||md.createFromPool(this,new pn(this._rootNode),!0,!1),this._baseInstance.baseSyncTree(),e&&this.markTransformRootDirty(this._baseInstance,this._baseInstance.isTransformed);this._drawablesToUpdateLinks.length;)this._drawablesToUpdateLinks.pop().updateLinks();for(;this._changeIntervalsToDispose.length;)this._changeIntervalsToDispose.pop().dispose();for(this._rootBackbone=this._rootBackbone||this._baseInstance.groupDrawable;this._drawablesToChangeBlock.length;){this._drawablesToChangeBlock.pop().updateBlock();0}for(0,this.updateDirtyTransformRoots(),this._baseInstance.updateVisibility(!0,!0,!0,!1);this._instanceRootsToDispose.length;)this._instanceRootsToDispose.pop().dispose();for(0;this._drawablesToDispose.length;)this._drawablesToDispose.pop().dispose();if(this._rootBackbone.update(),this.updateCursor(),this.updateBackgroundColor(),this.updateSize(),this._overlays.length){let e=this._rootBackbone.lastZIndex;for(let t=0;t<this._overlays.length;t++){const i=this._overlays[t];i.domElement.style.zIndex=""+e++,i.update()}}for(;this._reduceReferencesNeeded.length;)this._reduceReferencesNeeded.pop().reduceReferences();this._frameId++,GA.auditPDOMDisplays(this.rootNode)}getPhetioElementAt(e){const t=this._rootNode.getPhetioMouseHit(e);return"phetioNotSelectable"===t?null:t}updateSize(){let e=!1;this.size.width!==this._currentSize.width&&(e=!0,this._currentSize.width=this.size.width,this._domElement.style.width=this.size.width+"px"),this.size.height!==this._currentSize.height&&(e=!0,this._currentSize.height=this.size.height,this._domElement.style.height=this.size.height+"px"),e&&!this._allowSceneOverflow&&(this._domElement.style.clip=`rect(0px,${this.size.width}px,${this.size.height}px,0px)`)}isWebGLAllowed(){return this._allowWebGL}get webglAllowed(){return this.isWebGLAllowed()}getRootNode(){return this._rootNode}get rootNode(){return this.getRootNode()}getRootBackbone(){return this._rootBackbone}get rootBackbone(){return this.getRootBackbone()}getSize(){return this.sizeProperty.value}get size(){return this.getSize()}getBounds(){return this.size.toBounds()}get bounds(){return this.getBounds()}setSize(e){this.sizeProperty.value=e}setWidthHeight(e,t){this.setSize(new hi.Z(e,t))}getWidth(){return this.size.width}get width(){return this.getWidth()}set width(e){this.setWidth(e)}setWidth(e){return this.getWidth()!==e&&this.setSize(new hi.Z(e,this.getHeight())),this}getHeight(){return this.size.height}get height(){return this.getHeight()}set height(e){this.setHeight(e)}setHeight(e){return this.getHeight()!==e&&this.setSize(new hi.Z(this.getWidth(),e)),this}setBackgroundColor(e){return this._backgroundColor=e,this}set backgroundColor(e){this.setBackgroundColor(e)}get backgroundColor(){return this.getBackgroundColor()}getBackgroundColor(){return this._backgroundColor}get interactive(){return this._interactive}set interactive(e){this._accessible&&e!==this._interactive&&this._rootPDOMInstance.peer.recursiveDisable(!e),this._interactive=e,!this._interactive&&this._input&&(this._input.interruptPointers(),this._input.clearBatchedEvents(),this._input.removeTemporaryPointers(),this._rootNode.interruptSubtreeInput(),this.interruptInput())}addOverlay(e){this._overlays.push(e),this._domElement.appendChild(e.domElement),e.domElement.setAttribute("aria-hidden","true")}removeOverlay(e){this._domElement.removeChild(e.domElement),this._overlays.splice(_.indexOf(this._overlays,e),1)}getPDOMRootElement(){return this._accessible?this._rootPDOMInstance.peer.primarySibling:null}get pdomRootElement(){return this.getPDOMRootElement()}isAccessible(){return this._accessible}isElementUnderPDOM(e){return this._accessible&&this.pdomRootElement.contains(e)}handleFullScreenNavigation(e){if(kt.isFullScreen()&&lt.isKeyEvent(e,lt.KEY_TAB)){const t=this.pdomRootElement;(e.shiftKey?Fi.getPreviousFocusable(t||void 0):Fi.getNextFocusable(t||void 0))===e.target&&e.preventDefault()}}getUsedRenderersBitmask(){return function e(t){let i=0;return _.each(t.blocks,t=>{t instanceof kc&&t.domDrawable instanceof ed?i|=e(t.domDrawable):i|=t.renderer}),i}(this._rootBackbone)&Te.bitmaskRendererArea}markTransformRootDirty(e,t){t?this._dirtyTransformRoots.push(e):this._dirtyTransformRootsWithoutPass.push(e)}updateDirtyTransformRoots(){for(;this._dirtyTransformRoots.length;)this._dirtyTransformRoots.pop().relativeTransform.updateTransformListenersAndCompute(!1,!1,this._frameId,!0);for(;this._dirtyTransformRootsWithoutPass.length;)this._dirtyTransformRootsWithoutPass.pop().relativeTransform.updateTransformListenersAndCompute(!1,!1,this._frameId,!1)}markDrawableChangedBlock(e){this._drawablesToChangeBlock.push(e)}markForReducedReferences(e){this._reduceReferencesNeeded.push(e)}markInstanceRootForDisposal(e){this._instanceRootsToDispose.push(e)}markDrawableForDisposal(e){this._drawablesToDispose.push(e)}markDrawableForLinksUpdate(e){this._drawablesToUpdateLinks.push(e)}markChangeIntervalToDispose(e){this._changeIntervalsToDispose.push(e)}updateBackgroundColor(){const e=null===this._backgroundColor?"":this._backgroundColor.toCSS?this._backgroundColor.toCSS():this._backgroundColor;e!==this._currentBackgroundCSS&&(this._currentBackgroundCSS=e,this._domElement.style.backgroundColor=e)}updateCursor(){if(this._input&&this._input.mouse&&this._input.mouse.point){if(this._input.mouse.cursor)return void this.setSceneCursor(this._input.mouse.cursor);const e=this._rootNode.trailUnderPointer(this._input.mouse);if(e)for(let t=e.getCursorCheckIndex();t>=0;t--){const i=e.nodes[t],s=i.getEffectiveCursor();if(s)return void this.setSceneCursor(s)}}this.setSceneCursor(this._defaultCursor)}setElementCursor(e){this._domElement.style.cursor=e,this._assumeFullWindow&&(document.body.style.cursor=e)}setSceneCursor(e){if(e!==this._lastCursor){this._lastCursor=e;const t=Vd[e];if(t)for(let e=t.length-1;e>=0;e--)this.setElementCursor(t[e]);else this.setElementCursor(e)}}applyCSSHacks(){this._allowSceneOverflow||(this._domElement.style.overflow="hidden"),this._domElement.style.msTouchAction="none",we.setStyle(this._domElement,we.fontSmoothing,"antialiased"),this._allowCSSHacks&&(document.onselectstart=()=>!1,document.body.style.msContentZooming="none",we.setStyle(this._domElement,we.userDrag,"none"),we.setStyle(this._domElement,we.userSelect,"none"),we.setStyle(this._domElement,we.touchAction,"none"),we.setStyle(this._domElement,we.touchCallout,"none"),we.setStyle(this._domElement,we.tapHighlightColor,"rgba(0,0,0,0)"))}canvasDataURL(e){this.canvasSnapshot(t=>{e(t.toDataURL())})}canvasSnapshot(e){const t=document.createElement("canvas");t.width=this.size.width,t.height=this.size.height;const i=t.getContext("2d");this._rootNode.renderToCanvas(t,i,()=>{e(t,i.getImageData(0,0,t.width,t.height))},this.domElement.style.backgroundColor)}setPointerDisplayVisible(e){e!==!!this._pointerOverlay&&(e?(this._pointerOverlay=new gd(this,this._rootNode),this.addOverlay(this._pointerOverlay)):(this.removeOverlay(this._pointerOverlay),this._pointerOverlay.dispose(),this._pointerOverlay=null))}setPointerAreaDisplayVisible(e){e!==!!this._pointerAreaOverlay&&(e?(this._pointerAreaOverlay=new ld(this,this._rootNode),this.addOverlay(this._pointerAreaOverlay)):(this.removeOverlay(this._pointerAreaOverlay),this._pointerAreaOverlay.dispose(),this._pointerAreaOverlay=null))}setHitAreaDisplayVisible(e){e!==!!this._hitAreaOverlay&&(e?(this._hitAreaOverlay=new hd(this,this._rootNode),this.addOverlay(this._hitAreaOverlay)):(this.removeOverlay(this._hitAreaOverlay),this._hitAreaOverlay.dispose(),this._hitAreaOverlay=null))}setCanvasNodeBoundsVisible(e){e!==!!this._canvasAreaBoundsOverlay&&(e?(this._canvasAreaBoundsOverlay=new id(this,this._rootNode),this.addOverlay(this._canvasAreaBoundsOverlay)):(this.removeOverlay(this._canvasAreaBoundsOverlay),this._canvasAreaBoundsOverlay.dispose(),this._canvasAreaBoundsOverlay=null))}setFittedBlockBoundsVisible(e){e!==!!this._fittedBlockBoundsOverlay&&(e?(this._fittedBlockBoundsOverlay=new sd(this,this._rootNode),this.addOverlay(this._fittedBlockBoundsOverlay)):(this.removeOverlay(this._fittedBlockBoundsOverlay),this._fittedBlockBoundsOverlay.dispose(),this._fittedBlockBoundsOverlay=null))}resizeOnWindowResize(){const e=()=>{this.setWidthHeight(window.innerWidth,window.innerHeight)};window.addEventListener("resize",e),e()}updateOnRequestAnimationFrame(e){let t=0,i=0;const s=this;!function n(){s._requestAnimationFrameID=window.requestAnimationFrame(n,s._domElement);const r=Date.now();0!==t&&(i=(r-t)/1e3),t=r,Nr.Z.emit(i),e&&e(i),s.updateDisplay()}()}cancelUpdateOnRequestAnimationFrame(){window.cancelAnimationFrame(this._requestAnimationFrameID)}initializeEvents(e){const t=new jA(this,!this._listenToOnlyElement,this._batchDOMEvents,this._assumeFullWindow,this._passiveEvents,e);this._input=t,t.connectListeners()}detachEvents(){this._input.disconnectListeners(),this._input=null}addInputListener(e){return _.includes(this._inputListeners,e)||this._inputListeners.push(e),this}removeInputListener(e){return this._inputListeners.splice(_.indexOf(this._inputListeners,e),1),this}hasInputListener(e){for(let t=0;t<this._inputListeners.length;t++)if(this._inputListeners[t]===e)return!0;return!1}getInputListeners(){return this._inputListeners.slice(0)}get inputListeners(){return this.getInputListeners()}interruptInput(){const e=this.inputListeners;for(let t=0;t<e.length;t++){const i=e[t];i.interrupt&&i.interrupt()}return this}interruptPointers(){return this._input&&this._input.interruptPointers(),this}interruptOtherPointers(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this._input&&this._input.interruptPointers(t||(null===(e=this._input.currentSceneryEvent)||void 0===e?void 0:e.pointer)||null),this}ensureNotPainting(){}loseWebGLContexts(){!function e(t){t.blocks&&t.blocks.forEach(t=>{const i=t.gl;i&&ve.loseContext(i);for(let s=t.firstDrawable;null!==s&&(e(s),s!==t.lastDrawable);s=s.nextDrawable);})}(this._rootBackbone)}inspect(){localStorage.scenerySnapshot=JSON.stringify(yl(this))}getDebugHTML(){const e="font-weight: bold; font-size: 120%; margin-top: 5px;";let t=0,i="";i+=`<div style="${e}">Display (${this.id}) Summary</div>`,i+=`${this.size.toString()} frame:${this._frameId} input:${!!this._input} cursor:${this._lastCursor}<br/>`,i+=`Nodes: ${function e(t){let i=1;for(let s=0;s<t.children.length;s++)i+=e(t.children[s]);return i}(this._rootNode)}<br/>`,i+=this._baseInstance?`Instances: ${function e(t){let i=1;for(let s=0;s<t.children.length;s++)i+=e(t.children[s]);return i}(this._baseInstance)}<br/>`:"",i+=this._rootBackbone?`Drawables: ${function e(t){let i=1;if(t.blocks)_.each(t.blocks,t=>{i+=e(t)});else if(t.firstDrawable&&t.lastDrawable){for(let s=t.firstDrawable;s!==t.lastDrawable;s=s.nextDrawable)i+=e(s);i+=e(t.lastDrawable)}return i}(this._rootBackbone)}<br/>`:"";const s={};function n(e){const t=e.constructor.name;s[t]?s[t]++:s[t]=1}i+=this._baseInstance?`Retained Drawables: ${function e(t){let i=0;t.selfDrawable&&(n(t.selfDrawable),i++),t.groupDrawable&&(n(t.groupDrawable),i++),t.sharedCacheDrawable&&(n(t.sharedCacheDrawable),i++);for(let s=0;s<t.children.length;s++)i+=e(t.children[s]);return i}(this._baseInstance)}<br/>`:"";for(const h in s)i+=`&nbsp;&nbsp;&nbsp;&nbsp;${h}: ${s[h]}<br/>`;function r(e){if(!e.firstDrawable||!e.lastDrawable)return"";const i=e.domDrawable&&e.domDrawable.blocks;let s=`<div style="margin-left: ${20*t}px">`;if(s+=e.toString(),i||(s+=` (${e.drawableCount} drawables)`),s+="</div>",t+=1,i)for(let t=0;t<e.domDrawable.blocks.length;t++)s+=r(e.domDrawable.blocks[t]);return t-=1,s}if(this._rootBackbone){i+=`<div style="${e}">Block Summary</div>`;for(let e=0;e<this._rootBackbone.blocks.length;e++)i+=r(this._rootBackbone.blocks[e])}function o(e){let t="";function i(e){t+=` <span style="color: #008">${e}</span>`}const s=e.node;t+=e.id,t+=" "+(s.constructor.name?s.constructor.name:"?"),t+=` <span style="font-weight: ${s.isPainted()?"bold":"normal"}">${s.id}</span>`,t+=s.getDebugHTMLExtras(),s.visible||i("invis"),e.visible||i("I-invis"),e.relativeVisible||i("I-rel-invis"),e.selfVisible||i("I-self-invis"),e.fittability.ancestorsFittable||i("nofit-ancestor"),e.fittability.selfFittable||i("nofit-self"),!0===s.pickable&&i("pickable"),!1===s.pickable&&i("unpickable"),e.trail.isPickable()&&i('<span style="color: #808">hits</span>'),s.getEffectiveCursor()&&i("effectiveCursor:"+s.getEffectiveCursor()),s.clipArea&&i("clipArea"),s.mouseArea&&i("mouseArea"),s.touchArea&&i("touchArea"),s.getInputListeners().length&&i("inputListeners"),s.getRenderer()&&i("renderer:"+s.getRenderer()),s.isLayerSplit()&&i("layerSplit"),s.opacity<1&&i("opacity:"+s.opacity),s.disabledOpacity<1&&i("disabledOpacity:"+s.disabledOpacity),s._boundsEventCount>0&&i(`<span style="color: #800">boundsListen:${s._boundsEventCount}:${s._boundsEventSelfCount}</span>`);let n="";switch(s.transform.getMatrix().type){case Le.h.IDENTITY:n="";break;case Le.h.TRANSLATION_2D:n="translated";break;case Le.h.SCALING:n="scale";break;case Le.h.AFFINE:n="affine";break;case Le.h.OTHER:n="other";break;default:throw new Error("invalid matrix type: "+s.transform.getMatrix().type)}return n&&(t+=` <span style="color: #88f" title="${s.transform.getMatrix().toString().replace("\n","&#10;")}">${n}</span>`),t+=` <span style="color: #888">[Trail ${e.trail.indices.join(".")}]</span>`,t+=` <span style="color: #8c8">${s._rendererSummary.bitmask.toString(16)}${s._rendererBitmask!==Te.bitmaskNodeDefault?` (${s._rendererBitmask.toString(16)})`:""}</span>`,t}function A(e){let t=e.toString();return e.visible&&(t=`<strong>${t}</strong>`),e.dirty&&(t+=e.dirty?' <span style="color: #c00;">[x]</span>':""),e.fittable||(t+=e.dirty?' <span style="color: #0c0;">[no-fit]</span>':""),t}function a(e){let s=`<div style="margin-left: ${20*t}px">`;function n(e,t){s+=` <span style="color: #888">${e}:${A(t)}</span>`}s+=o(e),e.selfDrawable&&n("self",e.selfDrawable),e.groupDrawable&&n("group",e.groupDrawable),e.sharedCacheDrawable&&n("sharedCache",e.sharedCacheDrawable),s+="</div>",i+=s,t+=1,_.each(e.children,e=>{a(e)}),t-=1}return this._baseInstance&&(i+=`<div style="${e}">Root Instance Tree</div>`,a(this._baseInstance)),_.each(this._sharedCanvasInstances,t=>{i+=`<div style="${e}">Shared Canvas Instance Tree</div>`,a(t)}),this._rootBackbone&&(i+='<div style="font-weight: bold;">Root Drawable Tree</div>',function e(s){let n=`<div style="margin-left: ${20*t}px">`;if(n+=A(s),s.instance?(n+=` <span style="color: #0a0;">(${s.instance.trail.toPathString()})</span>`,n+="&nbsp;&nbsp;&nbsp;"+o(s.instance)):s.backboneInstance&&(n+=` <span style="color: #a00;">(${s.backboneInstance.trail.toPathString()})</span>`,n+="&nbsp;&nbsp;&nbsp;"+o(s.backboneInstance)),n+="</div>",i+=n,s.blocks)t+=1,_.each(s.blocks,t=>{e(t)}),t-=1;else if(s.firstDrawable&&s.lastDrawable){t+=1;for(let t=s.firstDrawable;t!==s.lastDrawable;t=t.nextDrawable)e(t);e(s.lastDrawable),t-=1}}(this._rootBackbone)),i}getDebugURI(){return"data:text/html;charset=utf-8,"+encodeURIComponent(`<!DOCTYPE html><html lang="en"><head><title>Scenery Debug Snapshot</title></head><body style="font-size: 12px;">${this.getDebugHTML()}</body></html>
BẢN ĐỒ HÀNH CHÍNH
tkb
camera thanh son 2
THƯ VIỆN ẢNH
Hinh-27.jpg Hinh-10.jpg Hinh-43.jpg Hinh-21.jpg Hinh-5-1.jpg
THĂM DÒ Ý KIẾN

Đánh giá của bạn về website này?

CƠ QUAN BÁO CHÍ
DANH SÁCH TRƯỜNG ĐẠI HỌC - HỌC VIỆN
THỐNG KÊ
  • Đang truy cập28
  • Hôm nay5,233
  • Tháng hiện tại345,554
  • Tổng lượt truy cập3,763,998
Bạn đã không sử dụng Site, Bấm vào đây để duy trì trạng thái đăng nhập. Thời gian chờ: 60 giây