diff --git a/CHANGELOG.md b/CHANGELOG.md index 43219e36..7310fb3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # 版本更新记录 +## [2.16.91] - 2024-07-25 +- 更新 `@netless/appliance-plugin` 至 1.0.3 ## [2.16.90] - 2024-07-10 - 更新 `@netless/app-slide` 至 0.2.60 ## [2.16.89] - 2024-07-04 diff --git a/README.md b/README.md index e3bf1e45..b3b6a1f0 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ add dependency of whiteboard in the **app/build.gradle** file ```groovy dependencies { // Get the latest version number through the release notes. - implementation "com.github.netless-io:whiteboard-android:2.16.90" + implementation "com.github.netless-io:whiteboard-android:2.16.91" } ``` diff --git a/README_zh_CN.md b/README_zh_CN.md index 117138f3..e7cf2db3 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -45,7 +45,7 @@ allprojects { ```groovy dependencies { // 数字请根据最新版自行添加 - implementation "com.github.netless-io:whiteboard-android:2.16.90" + implementation "com.github.netless-io:whiteboard-android:2.16.91" } ``` diff --git a/carrot.yml b/carrot.yml index e6cca9b4..96c8ef09 100644 --- a/carrot.yml +++ b/carrot.yml @@ -1,4 +1,4 @@ - name: whiteboard-bridge repoPath: ../whiteboard-bridge repoURL: 'https://github.com/netless-io/whiteboard-bridge.git' - commit: 515cbdc + commit: fb4886c diff --git a/sdk/src/main/assets/whiteboard/515cbdc b/sdk/src/main/assets/whiteboard/fb4886c similarity index 100% rename from sdk/src/main/assets/whiteboard/515cbdc rename to sdk/src/main/assets/whiteboard/fb4886c diff --git a/sdk/src/main/assets/whiteboard/index.html b/sdk/src/main/assets/whiteboard/index.html index 42d4e941..f59ed11e 100644 --- a/sdk/src/main/assets/whiteboard/index.html +++ b/sdk/src/main/assets/whiteboard/index.html @@ -1 +1 @@ -white-sdk-bridge Application
\ No newline at end of file +white-sdk-bridge Application
\ No newline at end of file diff --git a/sdk/src/main/assets/whiteboard/netless.css b/sdk/src/main/assets/whiteboard/netless.css index 038ec84d..2cdabe3c 100644 --- a/sdk/src/main/assets/whiteboard/netless.css +++ b/sdk/src/main/assets/whiteboard/netless.css @@ -1 +1 @@ -.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{height:100%;left:0;position:absolute;top:0;width:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;font-style:normal;font-weight:400;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABDkAAsAAAAAG6gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3hY21hcAAAAYQAAADaAAADPv749/pnbHlmAAACYAAAC3AAABHQZg6OcWhlYWQAAA3QAAAAKwAAADYZw251aGhlYQAADfwAAAAdAAAAJA+RCLFobXR4AAAOHAAAABMAAACM744AAGxvY2EAAA4wAAAASAAAAEhF6kqubWF4cAAADngAAAAfAAAAIAE0AIFuYW1lAAAOmAAAASUAAAIK1cf1oHBvc3QAAA/AAAABJAAAAdPExYuNeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS7wTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGJHcRdyA4RZgQRADK3CxEAAHic7dFZbsMgAEXRS0ycyZnnOeG7y+qC8pU1dHusIOXxuoxaOlwZYWQB0Aea4quIEN4E9LzKbKjzDeM6H/mua6Lmc/p8yhg0lvdYx15ZG8uOLQOGjMp3EzqmzJizYMmKNRu27Nhz4MiJMxeu3Ljz4Ekqm7T8P52G8PP3lnTOVk++Z6iN6QZzNN1F7ptuN7eGOjDUoaGODHVsuvU8MdTO9Hd5aqgzQ50b6sJQl4a6MtS1oW4MdWuoO0PdG+rBUI+GejLUs6FeDPVqqDdDvRvqw1CfhpqM9At0iFLaAAB4nJ1YDXBTVRZ+5/22TUlJ8we0pHlJm7RJf5O8F2j6EymlSPkpxaL8U2xpa3DKj0CBhc2IW4eWKSokIoLsuMqssM64f+jA4HSdWXXXscBq67IOs3FXZ1ZYWVyRFdo899yXtIBQZ90k7717zz3v3HPPOfd854YCCj9cL9dL0RQFOqCbGJnrHb5EayiKIWN8iA/hWBblo6hUWm8TtCDwE80WMJus/irwyxOdxeB0MDb14VNJHnXYoLLSl6FfCUYO9nYPTA8Epg9090LprfbBbZ2hY0UlJUXHQp3/vtWkS6EBv8+rPMq5u9692f/dNxJNiqwC1xPE9TCUgCsSdQWgE3XQD25lkG4CN2xmTcOXWBOyser6RN6KnGbKSbmQ3+d0OI1m2W8QzLLkI2sykrWAgJJEtA8vGGW/2Q+CmT3n8zS9wZwu2DCvtuZKZN3xkrLh36yCZuUomQSqGpY8t/25VfHVhw8z4ebGBtfLb0ya9PCaDc+8dGTvk2dsh6z7WzvowlXKUSWo9MJ15a3KrEP2loOr2Ojhw6iW6hf2BDdEccQvZGpaAy7YovSwq8kr7HGllxpd71rkS6G0Sf11sl9OvMK1+jwPPODxjUwkOim9CU3ix1wNjXDfmJSEn618Bs6lpWwUpU+8PCqLMY650zjq8VhCIP17NEKTx3eaLL+s5Pi6yJWaWjTHLR1jYzPSV9VF/6Ojdb/1kO3Mk3uhHC0x6gc1BjlKQ+nQFxTYdaJkZ7ySVxLBbhR1dsboNXp1tCYKW2LRaEzpYcIx2BKNxaL0ZaUnSqfFoiNhHKR/GkX6PWUSAaJelQaqZL1EpoHNsajSEyPSoJ9IjhIxTdjHLmwZvhRDOiFTY/YeQnvrVZmiTQtGncECXtFTBZLOVwwMRgoXHAkXzMzPn1nAJJ8jYSbMDaqN2waGLzNhih/bZynUBMpIWSg7VYi7DRx2m8ALkIdRCJwI6ArJx2EI8kaDWeTQKeAFk9fjl/1AvwktjQ1P7NjyMGQyfd4vjipX6M/i52D7Cq80kqlcxEcGXRr/FEcgs0u5uGgB4VWuMFfpdn2Re6Hi3PqzmxWKsz6+ae2Pn9hXXw/fqM859UiGC0oKYYILJBqJrsn1Z1E5qOs9rQCiUQRREjm8yJcbHF5cUJufX1vAHlefw0XgUoboS3ETfQlTxBC4SOtuE8VPRJTBSCQSjZCpk7Gqzu+masaZ2y7Zjehho4F3g82BNDkAHpORG4+OCS+f6JTPmtRn/PH1kch6d04sp7AQb25aQ/pqUyXeQ8vrebG8OYQdXOQ+585u0sdW9rqalzRURiJ+9F4MweRFrKUjl1GUYhH1A27WOHw5cTFSFPMo9EeUIGnQTZHIaJ7AHLaOKsOODaNF9jkBjYG2QEsQ2xjMUAx2bBEbeTBWMHwskBjngq56S/yfgkBnWBa4K9sqKtq2t1UI8S9He5XuBRbawAdatrQEAi30Aks2+LM8WeCbalVZkWNylvJ+dqJnzVb+OHlSoKW8nPCP7Rd+CcZ2DdWAGqJ2CBFOphgywFFCFBNtfAbGtNPBCwxvygHeYMZMY9ZboBqwq/pVrsbgN5tkv152ODlbMfiqwGMBgxa4Exz3QhovRIUp6acqZmQzRq0ypDXS2TPLT02YIkQETnOE445oOGxOmXAqUJNNG7XgupMjPq2ua9asrj5yY/yuKteO1Kx0YNJTufrirLe1mZnat7OL6rnUdCWenpW6I8mAnbsY8KWs1PuSovCW9A/Z25PQ24a7cNOqgmTkLmBMgh4THgc4b9k2IVv1/g/F5nGljwPLfOgHAzJzh45V/4+WenTzmMtR5Z7us2Tys909UHqrPY7KbckoxRvRHhmVc3cJGE97uml0R1S0jdULVl7EvZtDFVBF35N9cEdjpgmAiOlFZ+Dtoh93+D3zzHr8RRNZQhnCNMNbcegOvpEwZoL+06cJQ07h+th3fZ/7PVbVC6ngTAV/KoLFuO6+2KFcU651gEb5ugPSIb1D+Xp8V4+k3sEIGnw5mYe4If4k1lFYr6SCzmM2EQ8iWtmwjnBI9kTwe1TlfAmXh7H02by9fW2gsjKwtv0aaURKil4OdV7rDL1MXIFNrhdxohcZXYTnq47WisrKitaObbf5+yvkLi5J6lCNZZ+B6GC38VNBZBDidSS/+mSvh6s+srgC8pyKMvDtt+de3c9fU76ZPfuM8ud4Kv0fyP/LqfepMT/3oZxSqpZaTa1DaQYLY8TFsHYbWYsPoRhRWfL5eSSQbhUGgGC3YLbVMk6PitTFNGpAsNrC6D1VNBKgBHMejaiuRWEWGgsSDBTJjqWIl8kJLlsaLJ2tXDr6xGfT85bM2Q06a46x2HTgvdnV8z5YDy/27J4zt6x2VtkzjoYpkq36kaBr4eQSg7tyiVweWubXZugtadl58ydapfbORfKsDTuZ0OBgx4cfdjCf5tbWNITnL120fdOi1RV1C3uKGzNdwYLcMvZ3BxoPyTOCD1XvXTp7U10gWCVmTV9b3r2z0SkGWovb2hp9I89O8a2smlyaO8muMU+dRmtzp60IzAoFpjLr1n388boLyf0dRvxhsHZ0qbWqDkwqvvpkj4l0fY6EIXRi5sQSrAvsVYwXRy4qJ2EVtD1AN7a0HWth9ymvL1xc3WTUKK/TAHA/bXDVtVWfOMfuGxGZv4Ln/jVr9jc3j1yMv0tndmyt9Vq88Y9gH1wtLX3KWjot5++jWHgAoZZkQ14wGQ20Fli71UmKJAy4xKMSTGbVdybW7FDDAut9XpD5AzWrYO7zQ8qffqF8+Ynd/clrHcdyxGy3a/3+mfNnzC/cBsveTjnTvXf1o6vzOlZw7WtqtdmPK/Errz/6NNtD72zmNOZfbmYdTGHfoofqI79Oc+R2n1lrnL6pOm0Up7kwxhTW12Amm7WYkXR2qYrF2AmgmbAsxZjwy1xpg/m1Je2vrp8v/nz2xpmlBg4E9hrMU341wVpTOh/OfmGvAnra8q6uctr60ZQHV3Q+WMQJykMj8ZsWn2QBOmmHMB+m5pDIpTFonYigiaKAhGEiAHF7EliVnQkjoLVIMPtJpBKHYd3A8GYH9jJzrWwmHx5Qjp7vDAX0suGRym1vtm/9W1/HyR8vczfMs6Sk8DSv855/5dlX9oQq52hT8syyp2rx5Id17IAyAM3wIjQPMOHzytEB64q6D5zT91yNbnx3V/nqnd017S9Y0605k3izoXLpsxde2n38yoOV9s1LcjwzNjbdX6asnBVaBj/6/DwKwPkpcqbDG7BnsXoSqWnUAmottYF6jMSdVyYZh3zVXCjwTiwwHH6sGuRiEHQGzuRX6whZkp123oy1BWE2mEfJ/tvIRtM4ZM5bDXiMsPMaAKOTyc5uL57rqyyc5y5JE5pm1i2S2iUX0CcaQ6lC6Zog7JqSqZmYlosl2K6pwNA84zRnQW6SaALYZQGW5lhCtU/W34N6o+bKfZ8cf3/Cl/+iTX3wBzpOY4mRkeNf3rptycGSshQWgGbYt5jFc2e0+DglIrwl6DVWQ7BuwaJ3Xk1J4VL5urnLl/Wf+gHU/hZoZdKNym6lG+I34FaNeZKcSpJIo2IeCVvpdsDGfKvzJnAwmeD37Ow65ZWwSowpgwX5T69s/rB55dP5BcpgDKFV8p7q2sn/1uc93bVzT/w6UrCqDTWvfCq/oCD/qZXNoUj8BL5Kp6GU017frfNXkAtiiyf/SOCEeLqnd8R/Ql9GlCRfctS6k5chvIBuQ1zCCjoCHL2DHNHIXxMJ3kQeO8lbsUXONeSfA5EjcG6/E+KdhN4bP04vBhdi883+BFBzQbxFbvZzQeY9LNBZc0FNfn5NwfDn6rCTnTw6R8o+gfpf5hCom33cRuiTlss3KHmZjD+BPN+5gXuA2ziS/Q73mLxUkpbKN/eqwz5uK0X9F3h2d1V4nGNgZGBgAOJd776+iue3+crAzc4AAje5Bfcg0xz9YHEOBiYQBQA8FQlFAHicY2BkYGBnAAGOPgaG//85+hkYGVCBMgBGGwNYAAAAeJxjYGBgYB8EmKOPgQEAQ04BfgAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhAi2COh4nGNgZGBgUGYoZWBnAAEmIOYCQgaG/2A+AwAYCQG2AHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkMl2wjAMRfOAhABlKm2h80C3+ajgCKKDY6cegP59TYBzukAL+z1Zsq8ctaJTTKPrsUQLbXQQI0EXKXroY4AbDDHCGBNMcYsZ7nCPB8yxwCOe8IwXvOIN7/jAJ76wxHfUqWX+OzgumWAjJMV17i0Ndlr6irLKO+qftdT7i6y4uFSUvCknay+lFYZIZaQcmfH/xIFdYn98bqhra1aKTM/6lWMnyaYirx1rFUQZFBkb2zJUtoXeJCeg0WnLtHeSFc3OtrnozNwqi0TkSpBMDB1nSde5oJXW23hTS2/T0LilglXX7dmFVxLnq5U0vYATHFk3zX3BOisoQHNDFDeZnqKDy9hRNawN7Vh727hFzcJ5c8TILrKZfH7tIPxAFP0BpLeJPA==) format("woff")}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-play-circle:before{content:"\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-style:normal;font-weight:400}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\f109"}.vjs-icon-square{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-square:before{content:"\f10a"}.vjs-icon-spinner{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-spinner:before{content:"\f10b"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\f10c"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\f10e"}.vjs-icon-share{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-share:before{content:"\f10f"}.vjs-icon-cog{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-cog:before{content:"\f110"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\f111"}.vjs-icon-circle-outline{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-circle-outline:before{content:"\f112"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-circle-inner-circle:before{content:"\f113"}.vjs-icon-hd{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-hd:before{content:"\f114"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\f115"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\f116"}.vjs-icon-facebook{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-facebook:before{content:"\f117"}.vjs-icon-gplus{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-gplus:before{content:"\f118"}.vjs-icon-linkedin{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-linkedin:before{content:"\f119"}.vjs-icon-twitter{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-twitter:before{content:"\f11a"}.vjs-icon-tumblr{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-tumblr:before{content:"\f11b"}.vjs-icon-pinterest{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-pinterest:before{content:"\f11c"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\f11d"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\f11e"}.vjs-icon-next-item{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-next-item:before{content:"\f11f"}.vjs-icon-previous-item{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-previous-item:before{content:"\f120"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\f121"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-style:normal;font-weight:400}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\f122"}.video-js{background-color:#000;box-sizing:border-box;color:#fff;display:block;font-family:Arial,Helvetica,sans-serif;font-size:10px;font-style:normal;font-weight:400;line-height:1;padding:0;position:relative;vertical-align:top;word-break:normal}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{height:100%!important;width:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{height:0;max-width:100%;width:100%}.video-js.vjs-16-9{padding-top:56.25%}.video-js.vjs-4-3{padding-top:75%}.video-js.vjs-9-16{padding-top:177.7777777778%}.video-js.vjs-1-1{padding-top:100%}.video-js .vjs-tech,.video-js.vjs-fill{height:100%;width:100%}.video-js .vjs-tech{left:0;position:absolute;top:0}body.vjs-full-window{height:100%;margin:0;padding:0}.vjs-full-window .video-js.vjs-fullscreen{bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;z-index:1000}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs){height:100%!important;padding-top:0!important;width:100%!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{cursor:default;opacity:.5}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{background-color:#000;color:#fff;font-family:Arial,Helvetica,sans-serif;font-size:18px;height:150px;margin:0 auto;padding:20px;text-align:center;width:300px}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{background-color:#2b333f;background-color:#2b333fb3;border:.06666em solid #fff;border-radius:.3em;cursor:pointer;display:block;font-size:3em;height:1.63332em;left:10px;line-height:1.5em;opacity:1;padding:0;position:absolute;top:10px;transition:all .4s;width:3em}.vjs-big-play-centered .vjs-big-play-button{left:50%;margin-left:-1.5em;margin-top:-.81666em;top:50%}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{background-color:#73859f;background-color:#73859f80;border-color:#fff;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-decoration:none;text-transform:none;transition:none}.vjs-control .vjs-button{height:100%;width:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),hsla(0,0%,100%,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;font-family:Arial,Helvetica,sans-serif;margin:0;overflow:auto;padding:0}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{font-size:1.2em;line-height:1.4em;list-style:none;margin:0;padding:.2em 0;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:none}.vjs-menu li.vjs-menu-title{cursor:default;font-size:1em;font-weight:700;line-height:2em;margin:0 0 .3em;padding:0;text-align:center;text-transform:uppercase}.vjs-menu-button-popup .vjs-menu{border-top-color:#2b333fb3;bottom:0;display:none;height:0;left:-3em;margin-bottom:1.5em;position:absolute;width:10em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;bottom:1.5em;max-height:15em;position:absolute;width:100%}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{overflow:hidden;transition:all .4s}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{height:100%;left:4em;margin:0;opacity:0;padding:0;position:absolute;top:0;transition:all .4s;width:auto}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{height:100%;margin:0;overflow:hidden;width:auto}.video-js .vjs-control-bar{background-color:#2b333f;background-color:#2b333fb3;bottom:0;display:none;height:3em;left:0;position:absolute;right:0;width:100%}.vjs-has-started .vjs-control-bar{display:flex;opacity:1;transition:visibility .1s,opacity .1s;visibility:visible}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s;visibility:visible}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{flex:none;height:100%;margin:0;padding:0;position:relative;text-align:center;width:4em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js .vjs-control-text{clip:rect(0 0 0 0);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{align-items:center;cursor:pointer;display:flex;flex:auto;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{align-items:center;display:flex}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;height:.3em;transition:all .2s}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{display:block;height:100%;margin:0;padding:0;position:absolute;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.3333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{background-color:#000;display:none;height:100%;position:absolute;width:1px;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{opacity:0;transition:visibility 1s,opacity 1s;visibility:hidden}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{background-color:#000;background-color:#000c;color:#fff}.video-js .vjs-slider{-webkit-touch-callout:none;background-color:#73859f;background-color:#73859f80;cursor:pointer;margin:0 .45em;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{box-shadow:0 0 1em #fff;text-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;display:flex;margin-right:1em}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{height:1px;margin-left:-1px;opacity:0;visibility:visible;width:1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s;visibility:visible}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{height:3em;margin-right:0;width:5em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{transition:width .1s;width:10em}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s;width:3em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{height:3em;opacity:1;position:relative;transition:none;visibility:visible;width:5em}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{bottom:3em;left:.5em;position:absolute}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{height:.3em;width:5em}.vjs-volume-bar.vjs-slider-vertical{height:5em;margin:1.35em auto;width:.3em}.video-js .vjs-volume-level{background-color:#fff;bottom:0;left:0;position:absolute}.video-js .vjs-volume-level:before{font-size:.9em;position:absolute;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{left:-.3em;top:-.5em;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{right:-.5em;top:-.3em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{background-color:#2b333f;background-color:#2b333fb3;bottom:8em;height:8em;width:3em}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{background-color:#000;display:none;height:1px;position:absolute;width:100%;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{height:100%;width:1px}.vjs-no-flex .vjs-volume-control .vjs-mouse-display{z-index:0}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{opacity:0;transition:visibility 1s,opacity 1s;visibility:hidden}.video-js.vjs-user-inactive.vjs-no-flex .vjs-volume-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-volume-tooltip{background-color:#000;background-color:#000c;color:#fff}.vjs-poster{background-color:#000;background-position:50% 50%;background-repeat:no-repeat;background-size:contain;bottom:0;cursor:pointer;display:inline-block;height:100%;left:0;margin:0;padding:0;position:absolute;right:0;top:0;vertical-align:middle}.vjs-has-started .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster{display:block}.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-live-control{align-items:flex-start;display:flex;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;text-align:left;width:auto}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;display:inline-flex;flex:none;font-size:1em;height:100%;line-height:3em;min-width:4em;padding-left:.5em;padding-right:.5em;width:auto}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;text-align:left;width:auto}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{color:#888;margin-right:.5em}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;padding-left:1em;padding-right:1em;width:auto}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-no-flex .vjs-current-time,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{bottom:3em;left:0;pointer-events:none;position:absolute;right:0;top:0}.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;margin-bottom:.1em;text-align:center}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-fullscreen-control,.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{height:100%;left:0;position:absolute;top:0;width:100%}.vjs-playback-rate .vjs-playback-rate-value{font-size:1.5em;line-height:2;pointer-events:none;text-align:center}.vjs-playback-rate .vjs-menu{left:0;width:4em}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-align:center;text-shadow:.05em .05em .1em #000;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{background-clip:padding-box;border:6px solid rgba(43,51,63,.7);border-radius:25px;box-sizing:border-box;display:none;height:50px;left:50%;margin:-25px 0 0 -25px;opacity:.85;position:absolute;text-align:left;top:50%;visibility:hidden;width:50px}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards;display:block}.vjs-loading-spinner:after,.vjs-loading-spinner:before{border:inherit;border-color:#fff transparent transparent;border-radius:inherit;box-sizing:inherit;content:"";height:inherit;margin:-6px;opacity:1;position:absolute;width:inherit}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{-webkit-animation-delay:.44s;animation-delay:.44s;border-top-color:#fff}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(1turn)}}@-webkit-keyframes vjs-spinner-spin{to{-webkit-transform:rotate(1turn)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{display:inline-block;margin-bottom:-.1em;vertical-align:middle}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{content:"\f10d";font-family:VideoJS;font-size:1.5em;line-height:inherit}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{display:inline-block;margin-bottom:-.1em;vertical-align:middle}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{content:" \f11d";font-family:VideoJS;font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{display:block;flex:auto}.video-js.vjs-layout-x-small.vjs-no-flex .vjs-custom-control-spacer{width:auto}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-bottom:.5em;margin-right:1em}.vjs-text-track-settings fieldset{border:none;margin:5px;padding:3px}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px}.vjs-text-track-settings .vjs-label{clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);border:0;display:block;height:1px;margin:0 0 5px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{background-image:linear-gradient(0deg,#fff 88%,#73859f);outline-style:solid;outline-width:medium}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);border-radius:2px;color:#2b333f;cursor:pointer}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{border:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:none}.video-js :focus:not(:focus-visible){outline:none}.netless-window-manager-playground{height:100%;overflow:hidden;position:relative;user-select:none;width:100%;z-index:1}.netless-window-manager-sizer{display:flex;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%;z-index:1}.netless-window-manager-sizer-horizontal{flex-direction:column}.netless-window-manager-sizer:after,.netless-window-manager-sizer:before{content:"";display:block;flex:1}.netless-window-manager-chess-sizer:after,.netless-window-manager-chess-sizer:before{background-color:#fff;background-image:linear-gradient(45deg,#b0b0b0 25%,transparent 0),linear-gradient(-45deg,#b0b0b0 25%,transparent 0),linear-gradient(45deg,transparent 75%,#b0b0b0 0),linear-gradient(-45deg,transparent 75%,#b0b0b0 0);background-position:0 0,0 10px,10px -10px,-10px 0;background-size:20px 20px}.netless-window-manager-wrapper{height:100%;overflow:hidden;position:relative;width:100%;z-index:1}.netless-window-manager-main-view{height:100%;width:100%}.netless-window-manager-cursor-eraser-image,.netless-window-manager-cursor-pencil-image{height:26px;width:26px}.netless-window-manager-cursor-selector-image{height:24px;width:24px}.netless-window-manager-cursor-selector-avatar{border:2px solid #fff;border-radius:50%;margin-bottom:2px}.netless-window-manager-cursor-selector-avatar img{width:12px}.netless-window-manager-cursor-inner{align-items:center;border-radius:4px;display:flex;flex-direction:row;font-size:12px;justify-content:center;padding-left:4px;padding-right:4px}.netless-window-manager-cursor-inner-mellow{align-items:center;border-radius:16px;display:flex;flex-direction:row;height:32px;justify-content:center;padding-left:16px;padding-right:16px}.netless-window-manager-cursor-tag-name{border-radius:4px;font-size:12px;margin-left:4px;padding:2px 8px}.netless-window-manager-cursor-mid{align-items:center;display:flex;flex-direction:column;height:26px;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;transform-origin:0 0;transition:transform .12s;user-select:none;width:26px;will-change:transform;z-index:2147483647}.netless-window-manager-cursor-pencil-offset{margin-left:-20px}.netless-window-manager-cursor-selector-offset{margin-left:-22px;margin-top:56px}.netless-window-manager-cursor-text-offset{margin-left:-30px;margin-top:18px}.netless-window-manager-cursor-shape-offset{align-items:center;display:flex;flex-direction:column;height:64px;justify-content:center;margin-left:-30px;margin-top:12px;position:absolute;width:180px}.netless-window-manager-cursor-laserPointer-image,.netless-window-manager-cursor-pencilEraser-image{margin-left:-22px;margin-top:3px}.netless-window-manager-laserPointer-pencilEraser-offset{margin-left:-18px}.netless-window-manager-pencilEraser-3-offset{margin-left:-6px;margin-top:-14px}.netless-window-manager-cursor-name{align-items:center;display:flex;height:48px;justify-content:center;position:absolute;top:-40px;width:100%}.cursor-image-wrapper{display:flex;justify-content:center}.telebox-collector{bottom:15px;right:10px}.netless-iframe-brdige-hidden,.netless-window-manager-fullscreen .netless-app-slide-footer,.netless-window-manager-fullscreen .telebox-footer-wrap,.netless-window-manager-fullscreen .telebox-max-titlebar-maximized,.netless-window-manager-fullscreen .telebox-titlebar,.netless-window-manager-fullscreen .telebox-titlebar-wrap{display:none}.tele-fancy-scrollbar{-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;overflow:auto;overflow-y:scroll;overflow-y:overlay;overscroll-behavior:contain;scrollbar-width:auto}.tele-fancy-scrollbar::-webkit-scrollbar{height:8px;width:8px}.tele-fancy-scrollbar::-webkit-scrollbar-track{background-color:initial}.tele-fancy-scrollbar::-webkit-scrollbar-thumb{background-color:#444e601a;background-color:initial;border-radius:4px;transition:background-color .4s}.tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb{background-color:#444e601a}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:active,.tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#444e6033}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical{min-height:50px}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-box{left:0;position:absolute;top:0;transition:width .4s cubic-bezier(.4,.9,.71,1.02),height .4s cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .4s ease;z-index:100}.telebox-box-main{background:#f9f9fc;border:1px solid #e3e3ec;border-radius:6px;box-shadow:0 4px 10px #2f419226;display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.telebox-titlebar-wrap{flex-shrink:0;position:relative;z-index:1}.telebox-content-wrap{align-items:center;display:flex;flex:1;justify-content:center;overflow:hidden;width:100%}.telebox-content{height:100%;position:relative;width:100%}.telebox-footer-wrap{display:flex;flex-direction:column;flex-shrink:0}.telebox-footer-wrap:before{content:"";display:block;flex:1}.telebox-resize-handle{-webkit-touch-callout:none;position:absolute;user-select:none;-webkit-user-select:none;z-index:2147483647}.telebox-n{cursor:n-resize;top:-5px}.telebox-n,.telebox-s{height:5px;left:0;width:100%}.telebox-s{bottom:-5px;cursor:s-resize}.telebox-w{cursor:w-resize;left:-5px}.telebox-e,.telebox-w{height:100%;top:0;width:5px}.telebox-e{cursor:e-resize;right:-5px}.telebox-nw{cursor:nw-resize;left:-5px}.telebox-ne,.telebox-nw{height:15px;top:-5px;width:15px}.telebox-ne{cursor:ne-resize;right:-5px}.telebox-se{cursor:se-resize;right:-5px}.telebox-se,.telebox-sw{bottom:-5px;height:15px;width:15px}.telebox-sw{cursor:sw-resize;left:-5px}.telebox-track-mask{-webkit-touch-callout:none;background:transparent;cursor:move;height:100%;left:0;position:fixed;top:0;user-select:none;-webkit-user-select:none;width:100%;z-index:2147483647}.telebox-cursor-n{cursor:n-resize}.telebox-cursor-s{cursor:s-resize}.telebox-cursor-w{cursor:w-resize}.telebox-cursor-e{cursor:e-resize}.telebox-cursor-nw{cursor:nw-resize}.telebox-cursor-ne{cursor:ne-resize}.telebox-cursor-se{cursor:se-resize}.telebox-cursor-sw{cursor:sw-resize}.telebox-maximized .telebox-resize-handles,.telebox-no-resize .telebox-resize-handles{display:none}.telebox-maximized{box-shadow:none;transition:none}.telebox-minimized{opacity:0;pointer-events:none;transition:width .05s cubic-bezier(.4,.9,.71,1.02),height .05s cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .6s ease;user-select:none}.telebox-transforming{transition:opacity .6s cubic-bezier(.7,0,.84,0);will-change:transform}.telebox-readonly .telebox-resize-handle{cursor:auto!important;pointer-events:none!important}.telebox-color-scheme-dark .telebox-box-main{background:#212126;border-color:#43434d;color:#e9e9e9}.telebox-titlebar{-webkit-touch-callout:none;align-items:center;background:#fff;border-bottom:1px solid #eeeef7;box-sizing:border-box;display:flex;height:26px;touch-action:manipulation;-webkit-user-select:none;user-select:none}.telebox-title-area{align-items:center;display:flex;flex:1;height:100%;overflow:hidden;padding-left:16px;position:relative}.telebox-title{-webkit-touch-callout:none;color:#191919;font-family:PingFangSC-Regular,PingFang SC;font-size:14px;font-weight:400;margin:0;overflow:hidden;padding:0;text-overflow:ellipsis;user-select:none;-webkit-user-select:none;white-space:nowrap;word-break:keep-all}.telebox-drag-area{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;z-index:10}.telebox-titlebar-btns{font-size:0;margin-left:auto;position:absolute;right:16px;white-space:nowrap;word-break:keep-all;z-index:10}.telebox-titlebar-btn{-webkit-touch-callout:none;background:transparent;border:none;cursor:pointer;height:22px;outline:none;padding:0;user-select:none;-webkit-user-select:none;width:22px}.telebox-titlebar-btn~.telebox-titlebar-btn{margin-left:10px}.telebox-titlebar-btn-icon{height:22px;width:22px}.telebox-readonly .telebox-titlebar-btn{cursor:not-allowed}.telebox-titlebar-icon-minimize{background:50%/cover no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjggMjgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAwaDI4djI4SDB6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZmlsbD0iI0E3QTdDQSIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNOSAxM2gxMHYxLjZIOXoiIG1hc2s9InVybCgjYikiLz48L2c+PC9zdmc+)}.telebox-titlebar-icon-maximize{background:50%/cover no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjggMjgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAwaDI4djI4SDB6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PGcgZmlsbD0iI0E3QTdDQSIgZmlsbC1ydWxlPSJub256ZXJvIiBtYXNrPSJ1cmwoI2IpIj48cGF0aCBkPSJNMjAuNDgxIDE3LjFoMS4ydjQuNTgxSDE3LjF2LTEuMmgzLjM4MVYxNy4xem0tMTQuMTktLjAwOWgxLjJ2My4zODFoMy4zOHYxLjJoLTQuNTh2LTQuNTgxek0xNy4xIDYuMTkxaDQuNTgxdjQuNThoLTEuMnYtMy4zOEgxNy4xdi0xLjJ6bS0xMC43LjEwOGg0Ljc5OHYxLjJINy41OTl2My41OTlINi40VjYuMjk5eiIvPjwvZz48L2c+PC9zdmc+)}.telebox-titlebar-icon-maximize.is-active{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjggMjgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAwaDI2djI2SDB6Ii8+PHBhdGggaWQ9ImMiIGQ9Ik0yNi44NjkgMCAyOCAxLjEzMVYyNi44N0wyNi44NjkgMjhIMS4xM0wwIDI2Ljg3VjEuMTMxTDEuMTMgMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNLTQuNjQzLTQuNjQzaDM1LjI4NnYzNS4yODZILTQuNjQzeiIgbWFzaz0idXJsKCNiKSIvPjwvZz48bWFzayBpZD0iZCIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYyIvPjwvbWFzaz48cGF0aCBkPSJNLTE3LjUxNyAxNCAxNC0xNy41MTcgNDUuNTE3IDE0IDE0IDQ1LjUxN3oiIG1hc2s9InVybCgjZCkiLz48cGF0aCBzdHJva2U9IiNBN0E3Q0EiIHN0cm9rZS13aWR0aD0iMS4yIiBkPSJNMTAuMDg5IDIxLjQ4NlYxNy43OUg2LjM5Mm0xNC45OTQtNy42aC0zLjY5N1Y2LjQ5M20zLjcxMyAxMS4zMDVoLTMuNjk3djMuNjk3TTEwLjI1IDYuMTV2My44OThINi4zNTIiLz48L2c+PC9zdmc+)}.telebox-titlebar-icon-close{background:50%/cover no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyOCAyOCI+PHBhdGggZD0iTTguMzUzIDIwLjMzMiAyMC4zMzIgOC4zNTNtMCAxMS45OEw4LjM1MyA4LjM1MiIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiNBN0E3Q0EiIHN0cm9rZS13aWR0aD0iMS40Ii8+PC9zdmc+)}.telebox-color-scheme-dark .telebox-titlebar{background:#43434d;border-bottom:none;color:#e9e9e9}.telebox-collector{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;background:#fff;background-position:50%;background-repeat:no-repeat;background-size:18px 16px;border:none;border-radius:50%;box-shadow:0 2px 6px #2f419226;cursor:pointer;display:block;font-size:0;height:40px;margin:0;outline:none;padding:0;pointer-events:none;position:absolute;-webkit-user-select:none;user-select:none;visibility:hidden;width:40px;z-index:200}.telebox-collector-visible{pointer-events:auto;visibility:visible}.telebox-collector-readonly{cursor:not-allowed}.telebox-color-scheme-dark.telebox-collector{background-color:#43434d}.telebox-max-titlebar{-webkit-touch-callout:none;display:none;left:0;position:absolute;top:0;user-select:none;-webkit-user-select:none;z-index:50000}.telebox-max-titlebar .telebox-title,.telebox-max-titlebar.telebox-max-titlebar-single-title .telebox-titles{display:none}.telebox-max-titlebar.telebox-max-titlebar-single-title .telebox-title{display:block}.telebox-max-titlebar-maximized{display:flex}.telebox-titles{-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;height:100%;margin:0;overflow-x:scroll;overflow-x:overlay;overflow-y:hidden;scrollbar-width:auto}.telebox-titles::-webkit-scrollbar{height:8px;width:8px}.telebox-titles::-webkit-scrollbar-track{background-color:initial}.telebox-titles::-webkit-scrollbar-thumb{background-color:#eeeef7cc;background-color:initial;border-radius:4px;transition:background-color .4s}.telebox-titles:hover::-webkit-scrollbar-thumb{background-color:#eeeef7cc}.telebox-titles::-webkit-scrollbar-thumb:active,.telebox-titles::-webkit-scrollbar-thumb:hover{background-color:#eeeef7}.telebox-titles::-webkit-scrollbar-thumb:vertical{min-height:50px}.telebox-titles::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-titles-content{align-items:center;display:flex;flex-wrap:nowrap;height:100%;padding:0}.telebox-titles-tab{background:transparent;border:none;border-right:1px solid #e5e5f0;color:#7b88a0;cursor:pointer;font-family:PingFangSC-Regular,PingFang SC;font-size:13px;font-weight:400;height:100%;max-width:182px;min-width:50px;outline:none;overflow:hidden;padding:0 26px 0 16px;text-overflow:ellipsis;user-select:none;white-space:nowrap;word-break:keep-all}.telebox-titles-tab-focus{color:#357bf6}.telebox-readonly .telebox-titles-tab{cursor:not-allowed}.telebox-color-scheme-dark{color-scheme:dark}.telebox-color-scheme-dark.telebox-titlebar{background:#43434d;border-bottom:none;color:#e9e9e9}.telebox-color-scheme-dark .telebox-titles-tab{border-right-color:#7b88a0}.telebox-color-scheme-dark .telebox-title{color:#e9e9e9}.teaching-aids-plugin-app-view-displayer,.teaching-aids-plugin-main-view-displayer{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}.bezier-pencil-plugin-floatbtns{align-items:center;background:#fff;border:1px solid #efefef;border-radius:4px;box-shadow:0 6px 12px #0000001f;color-scheme:light;display:flex;flex-direction:row;left:3px;pointer-events:auto;position:absolute;transform:translateY(-60px);z-index:9}.bezier-pencil-plugin-floatbtns .normal-button{height:40px;touch-action:none;width:40px}.bezier-pencil-plugin-floatbtns .button{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center}.bezier-pencil-plugin-floatbtns .button.active,.bezier-pencil-plugin-floatbtns .button:hover{background-color:#eef0f6}.bezier-pencil-plugin-floatbtns .font-colors-menu,.bezier-pencil-plugin-floatbtns .font-style-menu,.bezier-pencil-plugin-floatbtns .image-layer-menu,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu{align-items:center;background:#fff;border-radius:2px;box-shadow:0 3px 6px #0000001f;box-sizing:border-box;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;padding:4px;position:absolute;top:50px;touch-action:none}.bezier-pencil-plugin-floatbtns .font-colors-menu .normal-button,.bezier-pencil-plugin-floatbtns .font-style-menu .normal-button,.bezier-pencil-plugin-floatbtns .image-layer-menu .normal-button,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .normal-button{height:32px;touch-action:none;width:32px}.bezier-pencil-plugin-floatbtns .font-colors-menu{justify-content:space-between;width:128px}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button{align-items:center;background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;border:1px solid #fff;border-radius:50%;box-sizing:border-box;cursor:pointer;display:flex;height:20px;justify-content:center;margin:4px;width:20px}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button.active{border-color:#a7a7a7}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button .circle{border:1px solid rgba(0,0,0,.12);border-radius:50%;box-sizing:border-box;height:16px;touch-action:none;width:16px}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button .none{background-color:#fff;position:relative}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button .none:before{background-color:#0000001f;content:"";height:100%;left:50%;position:absolute;transform:rotate(45deg);width:1px}.bezier-pencil-plugin-floatbtns .font-colors-icon{flex-direction:column}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar{background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;height:2px;margin-top:-2px;width:12px}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar .color-bar-color{height:100%;width:100%}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-fill,.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring{background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;border:1px solid rgba(0,0,0,.12);border-radius:6px;height:12px;width:12px}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-fill .circle,.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring .circle{border-radius:50%;height:100%;touch-action:none;width:100%}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring{border:0}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring .circle{background-color:#fff;border-radius:50%;height:60%;touch-action:none;transform:translate(35%,30%);width:60%}.bezier-pencil-plugin-floatbtns .font-color-opacity{background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;border-radius:3px;box-sizing:border-box;height:6px;margin:5px 0 10px;position:relative;width:100px}.bezier-pencil-plugin-floatbtns .font-color-opacity .range-color{border-radius:4px;bottom:0;box-shadow:inset 0 0 1px #00000040;height:6px;left:0;right:0;top:0}.bezier-pencil-plugin-floatbtns .font-color-opacity .range-opacity{height:6px;left:-10px;position:absolute;top:0;width:120px}.bezier-pencil-plugin-floatbtns .font-color-opacity .circle{border:2px solid #fff;border-radius:50%;box-shadow:inset 0 0 1px #00000040,0 0 0 1px #0000000f;box-sizing:border-box;cursor:pointer;height:12px;position:absolute;top:-3px;touch-action:none;width:12px}.bezier-pencil-plugin-floatbtns .font-style-menu{justify-content:space-between;width:128px}.bezier-pencil-plugin-floatbtns .font-style-menu .font-style-button{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;height:20px;justify-content:center;margin:4px;width:20px}.bezier-pencil-plugin-floatbtns .font-style-menu .font-style-button.active{border-color:#a7a7a7}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-input{border:1px solid;border-radius:3px;height:20px;line-height:20px;margin-left:2px;padding:0 2px;width:25px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-input:focus{background:#eef0f6}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns{display:flex;flex-direction:column;justify-content:center;margin-left:3px;width:15px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add,.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut{height:10px;position:relative;width:10px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add:hover,.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut:hover{background:#eef0f6}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add:after,.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut:after{border-color:#999 transparent;border-style:solid;border-width:4px;content:"";position:absolute;top:0}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add{margin-bottom:3px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add:after{border-top-color:transparent}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut:after{border-bottom-color:transparent}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-menu{align-items:center;background:#fff;border:1px solid #efefef;box-shadow:0 6px 12px #0000001f;display:flex;flex-direction:column;overflow-y:auto;position:absolute;top:35px;width:50px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-menu .font-size-btn{font-size:12px;line-height:20px;text-align:center;width:100%}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-menu .font-size-btn:hover{background:#eef0f6}.bezier-pencil-plugin-floatbtns .font-size-barBtn:hover{background:#fff}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu{flex-direction:column;touch-action:none}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-tabs{display:flex;flex-direction:row;justify-content:flex-start;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-tabs .tab-button{height:24px;width:32px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content{align-items:baseline;background-color:#eef0f6;display:flex;flex:1;flex-direction:column;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button{cursor:default;display:flex;flex:1;flex-direction:row;height:32px;justify-content:flex-start;padding:5px 0;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button img{height:16px;margin:0 5px;width:16px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number{border:1px solid;border-radius:3px;flex:1;height:20px;margin-right:5px;max-width:70px;min-width:40px;padding:0 3px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns{display:flex;flex-direction:column;justify-content:center;width:15px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut{cursor:pointer;height:10px;position:relative;width:10px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add:hover,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut:hover{background:#eef0f6}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add:after,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut:after{border-color:#999 transparent;border-style:solid;border-width:4px;content:"";position:absolute;top:0}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add{margin-bottom:3px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add:after{border-top-color:transparent}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut:after{border-bottom-color:transparent}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container{background-color:#3381ff;border-radius:3px;box-sizing:border-box;flex:1;height:6px;margin:7px 6px 7px 0;position:relative;width:100px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container .range-number-color{border-radius:4px;bottom:0;box-shadow:inset 0 0 1px #00000040;height:6px;left:0;right:0;top:0}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container .range-number{cursor:pointer;height:6px;left:-6px;position:absolute;top:0;width:112px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container .circle{background-color:#3381ff;border:2px solid #fff;border-radius:50%;box-shadow:inset 0 0 1px #00000040,0 0 0 1px #0000000f;box-sizing:border-box;cursor:pointer;height:12px;position:absolute;top:-3px;touch-action:none;width:12px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .select-option-menu{align-items:center;background:#fff;border:1px solid #efefef;box-shadow:0 6px 12px #0000001f;display:flex;flex-direction:column;left:30px;position:absolute;top:60px;width:80px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .select-option-menu .select-option-btn{font-size:12px;line-height:20px;text-align:center;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .select-option-menu .select-option-btn:hover{background:#eef0f6}.index-module__Container__nLsM3{height:100%;left:0;outline:none;overflow:hidden;pointer-events:none;position:absolute;top:0;touch-action:none;width:100%}.index-module__Container__nLsM3 .index-module__CanvasBox__j2Xe-{height:100%;pointer-events:none;position:relative;width:100%}.index-module__Container__nLsM3 .index-module__CanvasBox__j2Xe- .index-module__FloatCanvas__d1YR7{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.index-module__Container__nLsM3 .index-module__CanvasBox__j2Xe- .index-module__TopFloatCanvas__7IaCw{height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.index-module__Container__nLsM3 .index-module__SnapshotBox__--eeE{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:-1}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL{height:0;left:0;pointer-events:none;position:absolute;top:0;width:0}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box{border:1px solid;box-sizing:border-box;height:100%;pointer-events:none;position:relative;width:100%;z-index:1}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .point{height:7px;pointer-events:none;position:absolute;transform:translate(-50%,-50%);width:7px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LB,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LT{left:0}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LT,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RT,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .TC{top:0}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RB,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RT{right:-7px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .BC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LB,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RB{bottom:-7px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RC{top:50%}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .BC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .TC{left:50%}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .lock{height:22px;left:-11px;pointer-events:none;position:absolute;top:-11px;width:22px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-floatCanvas-box{overflow:hidden;position:absolute;z-index:1}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-floatCanvas{height:100%;width:100%}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor-box{position:absolute;touch-action:none}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor{align-items:baseline;border:1px dashed;display:flex;flex-direction:column;font-family:sans-serif;padding:5px;pointer-events:auto;position:relative;resize:none;white-space:pre;z-index:2}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor:hover{border-style:solid}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor:focus,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor:focus-visible{outline:none}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .readOnly{border-color:transparent}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf{cursor:move;height:16px;left:0;pointer-events:auto;position:absolute;top:0;width:16px;z-index:2}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-btn{align-items:center;border-radius:8px;display:flex;height:16px;justify-content:center;left:0;position:absolute;top:0;width:16px}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-btn img{height:12px;width:12px}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer{height:100%;opacity:0;position:relative;width:100%}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer.active{opacity:1}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer img{height:100%;width:100%}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer .angle-icon{background-color:#333;border-radius:4px;color:#fff;font-size:12px;height:16px;left:-16px;position:absolute;text-align:center;top:-16px;width:30px}.index-module__Container__nLsM3 .index-module__ResizeBtn__yjvda{box-sizing:initial;left:0;position:absolute;top:0;touch-action:none;width:0;z-index:1}.index-module__Container__nLsM3 .index-module__CursorBox__2UHvI{left:0;position:absolute;top:0;z-index:2}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC{height:100%;left:0;overflow:hidden;pointer-events:none;position:absolute;top:0;transform:translateZ(0);width:100%;z-index:1}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor-box{position:absolute;touch-action:none}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor{align-items:baseline;border:1px dashed;display:flex;flex-direction:column;font-family:sans-serif;padding:5px;pointer-events:auto;position:relative;resize:none;white-space:nowrap;z-index:2}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor:hover{border-style:solid}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor:focus,.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor:focus-visible{outline:none}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .readOnly{border-color:transparent;pointer-events:none}.index-module__Container__nLsM3 .index-module__ResizeTowBox__HOllX{left:0;position:absolute;top:0;width:0}.index-module__Container__nLsM3 .index-module__ResizeTowBox__HOllX .bezier-pencil-plugin-point-btn{background-color:#fff;border:1px solid;border-radius:3px;height:5px;position:absolute;transform:translate(-50%,-50%);width:5px;z-index:2}.index-module__Container__nLsM3 .index-module__ResizeTowBox__HOllX .bezier-pencil-plugin-point-draggable-btn{cursor:move;height:8px;pointer-events:auto;position:absolute;touch-action:none;width:8px;z-index:3}.index-module__Container__nLsM3 .index-module__ResizeTowBox__HOllX .bezier-pencil-plugin-point-draggable-btn .bezier-pencil-plugin-point-draggable-btn-inner{background-color:#fff;border:1px solid;border-radius:3px;height:5px;pointer-events:none;position:absolute;transform:translate(-50%,-50%);width:5px}.index-module__Container__nLsM3 .index-module__FloatBarBtn__FJrOG{pointer-events:none;position:absolute}.cursor-box{border-radius:2px;color:#fff;height:100%;padding:4px;width:100%}.cursor-pencil-image{height:26px;width:26px}.cursor-selector-image{height:24px;width:24px}.cursor-selector-avatar{border:2px solid #fff;border-radius:50%;margin-bottom:2px}.cursor-inner{border-radius:4px;font-size:12px;padding-left:4px;padding-right:4px}.cursor-inner,.cursor-inner-mellow{align-items:center;display:flex;flex-direction:row;justify-content:center}.cursor-inner-mellow{border-radius:16px;height:32px;padding-left:16px;padding-right:16px}.cursor-tag-name{border-radius:4px;font-size:12px;margin-left:4px;padding:2px 8px}.cursor-mid{align-items:center;display:flex;flex-direction:column;height:64px;justify-content:center;position:absolute;width:180px}.cursor-pencil-offset{margin-left:-20px}.cursor-selector-offset{margin-left:-22px;margin-top:56px}.cursor-text-offset{margin-left:-30px;margin-top:18px}.cursor-shape-offset{flex-direction:column;height:64px;margin-left:-30px;margin-top:12px;position:absolute;width:180px}.cursor-name,.cursor-shape-offset{align-items:center;display:flex;justify-content:center}.cursor-name{height:48px;width:100%} \ No newline at end of file +.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{height:100%;left:0;position:absolute;top:0;width:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;font-style:normal;font-weight:400;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABDkAAsAAAAAG6gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3hY21hcAAAAYQAAADaAAADPv749/pnbHlmAAACYAAAC3AAABHQZg6OcWhlYWQAAA3QAAAAKwAAADYZw251aGhlYQAADfwAAAAdAAAAJA+RCLFobXR4AAAOHAAAABMAAACM744AAGxvY2EAAA4wAAAASAAAAEhF6kqubWF4cAAADngAAAAfAAAAIAE0AIFuYW1lAAAOmAAAASUAAAIK1cf1oHBvc3QAAA/AAAABJAAAAdPExYuNeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS7wTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGJHcRdyA4RZgQRADK3CxEAAHic7dFZbsMgAEXRS0ycyZnnOeG7y+qC8pU1dHusIOXxuoxaOlwZYWQB0Aea4quIEN4E9LzKbKjzDeM6H/mua6Lmc/p8yhg0lvdYx15ZG8uOLQOGjMp3EzqmzJizYMmKNRu27Nhz4MiJMxeu3Ljz4Ekqm7T8P52G8PP3lnTOVk++Z6iN6QZzNN1F7ptuN7eGOjDUoaGODHVsuvU8MdTO9Hd5aqgzQ50b6sJQl4a6MtS1oW4MdWuoO0PdG+rBUI+GejLUs6FeDPVqqDdDvRvqw1CfhpqM9At0iFLaAAB4nJ1YDXBTVRZ+5/22TUlJ8we0pHlJm7RJf5O8F2j6EymlSPkpxaL8U2xpa3DKj0CBhc2IW4eWKSokIoLsuMqssM64f+jA4HSdWXXXscBq67IOs3FXZ1ZYWVyRFdo899yXtIBQZ90k7717zz3v3HPPOfd854YCCj9cL9dL0RQFOqCbGJnrHb5EayiKIWN8iA/hWBblo6hUWm8TtCDwE80WMJus/irwyxOdxeB0MDb14VNJHnXYoLLSl6FfCUYO9nYPTA8Epg9090LprfbBbZ2hY0UlJUXHQp3/vtWkS6EBv8+rPMq5u9692f/dNxJNiqwC1xPE9TCUgCsSdQWgE3XQD25lkG4CN2xmTcOXWBOyser6RN6KnGbKSbmQ3+d0OI1m2W8QzLLkI2sykrWAgJJEtA8vGGW/2Q+CmT3n8zS9wZwu2DCvtuZKZN3xkrLh36yCZuUomQSqGpY8t/25VfHVhw8z4ebGBtfLb0ya9PCaDc+8dGTvk2dsh6z7WzvowlXKUSWo9MJ15a3KrEP2loOr2Ojhw6iW6hf2BDdEccQvZGpaAy7YovSwq8kr7HGllxpd71rkS6G0Sf11sl9OvMK1+jwPPODxjUwkOim9CU3ix1wNjXDfmJSEn618Bs6lpWwUpU+8PCqLMY650zjq8VhCIP17NEKTx3eaLL+s5Pi6yJWaWjTHLR1jYzPSV9VF/6Ojdb/1kO3Mk3uhHC0x6gc1BjlKQ+nQFxTYdaJkZ7ySVxLBbhR1dsboNXp1tCYKW2LRaEzpYcIx2BKNxaL0ZaUnSqfFoiNhHKR/GkX6PWUSAaJelQaqZL1EpoHNsajSEyPSoJ9IjhIxTdjHLmwZvhRDOiFTY/YeQnvrVZmiTQtGncECXtFTBZLOVwwMRgoXHAkXzMzPn1nAJJ8jYSbMDaqN2waGLzNhih/bZynUBMpIWSg7VYi7DRx2m8ALkIdRCJwI6ArJx2EI8kaDWeTQKeAFk9fjl/1AvwktjQ1P7NjyMGQyfd4vjipX6M/i52D7Cq80kqlcxEcGXRr/FEcgs0u5uGgB4VWuMFfpdn2Re6Hi3PqzmxWKsz6+ae2Pn9hXXw/fqM859UiGC0oKYYILJBqJrsn1Z1E5qOs9rQCiUQRREjm8yJcbHF5cUJufX1vAHlefw0XgUoboS3ETfQlTxBC4SOtuE8VPRJTBSCQSjZCpk7Gqzu+masaZ2y7Zjehho4F3g82BNDkAHpORG4+OCS+f6JTPmtRn/PH1kch6d04sp7AQb25aQ/pqUyXeQ8vrebG8OYQdXOQ+585u0sdW9rqalzRURiJ+9F4MweRFrKUjl1GUYhH1A27WOHw5cTFSFPMo9EeUIGnQTZHIaJ7AHLaOKsOODaNF9jkBjYG2QEsQ2xjMUAx2bBEbeTBWMHwskBjngq56S/yfgkBnWBa4K9sqKtq2t1UI8S9He5XuBRbawAdatrQEAi30Aks2+LM8WeCbalVZkWNylvJ+dqJnzVb+OHlSoKW8nPCP7Rd+CcZ2DdWAGqJ2CBFOphgywFFCFBNtfAbGtNPBCwxvygHeYMZMY9ZboBqwq/pVrsbgN5tkv152ODlbMfiqwGMBgxa4Exz3QhovRIUp6acqZmQzRq0ypDXS2TPLT02YIkQETnOE445oOGxOmXAqUJNNG7XgupMjPq2ua9asrj5yY/yuKteO1Kx0YNJTufrirLe1mZnat7OL6rnUdCWenpW6I8mAnbsY8KWs1PuSovCW9A/Z25PQ24a7cNOqgmTkLmBMgh4THgc4b9k2IVv1/g/F5nGljwPLfOgHAzJzh45V/4+WenTzmMtR5Z7us2Tys909UHqrPY7KbckoxRvRHhmVc3cJGE97uml0R1S0jdULVl7EvZtDFVBF35N9cEdjpgmAiOlFZ+Dtoh93+D3zzHr8RRNZQhnCNMNbcegOvpEwZoL+06cJQ07h+th3fZ/7PVbVC6ngTAV/KoLFuO6+2KFcU651gEb5ugPSIb1D+Xp8V4+k3sEIGnw5mYe4If4k1lFYr6SCzmM2EQ8iWtmwjnBI9kTwe1TlfAmXh7H02by9fW2gsjKwtv0aaURKil4OdV7rDL1MXIFNrhdxohcZXYTnq47WisrKitaObbf5+yvkLi5J6lCNZZ+B6GC38VNBZBDidSS/+mSvh6s+srgC8pyKMvDtt+de3c9fU76ZPfuM8ud4Kv0fyP/LqfepMT/3oZxSqpZaTa1DaQYLY8TFsHYbWYsPoRhRWfL5eSSQbhUGgGC3YLbVMk6PitTFNGpAsNrC6D1VNBKgBHMejaiuRWEWGgsSDBTJjqWIl8kJLlsaLJ2tXDr6xGfT85bM2Q06a46x2HTgvdnV8z5YDy/27J4zt6x2VtkzjoYpkq36kaBr4eQSg7tyiVweWubXZugtadl58ydapfbORfKsDTuZ0OBgx4cfdjCf5tbWNITnL120fdOi1RV1C3uKGzNdwYLcMvZ3BxoPyTOCD1XvXTp7U10gWCVmTV9b3r2z0SkGWovb2hp9I89O8a2smlyaO8muMU+dRmtzp60IzAoFpjLr1n388boLyf0dRvxhsHZ0qbWqDkwqvvpkj4l0fY6EIXRi5sQSrAvsVYwXRy4qJ2EVtD1AN7a0HWth9ymvL1xc3WTUKK/TAHA/bXDVtVWfOMfuGxGZv4Ln/jVr9jc3j1yMv0tndmyt9Vq88Y9gH1wtLX3KWjot5++jWHgAoZZkQ14wGQ20Fli71UmKJAy4xKMSTGbVdybW7FDDAut9XpD5AzWrYO7zQ8qffqF8+Ynd/clrHcdyxGy3a/3+mfNnzC/cBsveTjnTvXf1o6vzOlZw7WtqtdmPK/Errz/6NNtD72zmNOZfbmYdTGHfoofqI79Oc+R2n1lrnL6pOm0Up7kwxhTW12Amm7WYkXR2qYrF2AmgmbAsxZjwy1xpg/m1Je2vrp8v/nz2xpmlBg4E9hrMU341wVpTOh/OfmGvAnra8q6uctr60ZQHV3Q+WMQJykMj8ZsWn2QBOmmHMB+m5pDIpTFonYigiaKAhGEiAHF7EliVnQkjoLVIMPtJpBKHYd3A8GYH9jJzrWwmHx5Qjp7vDAX0suGRym1vtm/9W1/HyR8vczfMs6Sk8DSv855/5dlX9oQq52hT8syyp2rx5Id17IAyAM3wIjQPMOHzytEB64q6D5zT91yNbnx3V/nqnd017S9Y0605k3izoXLpsxde2n38yoOV9s1LcjwzNjbdX6asnBVaBj/6/DwKwPkpcqbDG7BnsXoSqWnUAmottYF6jMSdVyYZh3zVXCjwTiwwHH6sGuRiEHQGzuRX6whZkp123oy1BWE2mEfJ/tvIRtM4ZM5bDXiMsPMaAKOTyc5uL57rqyyc5y5JE5pm1i2S2iUX0CcaQ6lC6Zog7JqSqZmYlosl2K6pwNA84zRnQW6SaALYZQGW5lhCtU/W34N6o+bKfZ8cf3/Cl/+iTX3wBzpOY4mRkeNf3rptycGSshQWgGbYt5jFc2e0+DglIrwl6DVWQ7BuwaJ3Xk1J4VL5urnLl/Wf+gHU/hZoZdKNym6lG+I34FaNeZKcSpJIo2IeCVvpdsDGfKvzJnAwmeD37Ow65ZWwSowpgwX5T69s/rB55dP5BcpgDKFV8p7q2sn/1uc93bVzT/w6UrCqDTWvfCq/oCD/qZXNoUj8BL5Kp6GU017frfNXkAtiiyf/SOCEeLqnd8R/Ql9GlCRfctS6k5chvIBuQ1zCCjoCHL2DHNHIXxMJ3kQeO8lbsUXONeSfA5EjcG6/E+KdhN4bP04vBhdi883+BFBzQbxFbvZzQeY9LNBZc0FNfn5NwfDn6rCTnTw6R8o+gfpf5hCom33cRuiTlss3KHmZjD+BPN+5gXuA2ziS/Q73mLxUkpbKN/eqwz5uK0X9F3h2d1V4nGNgZGBgAOJd776+iue3+crAzc4AAje5Bfcg0xz9YHEOBiYQBQA8FQlFAHicY2BkYGBnAAGOPgaG//85+hkYGVCBMgBGGwNYAAAAeJxjYGBgYB8EmKOPgQEAQ04BfgAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhAi2COh4nGNgZGBgUGYoZWBnAAEmIOYCQgaG/2A+AwAYCQG2AHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkMl2wjAMRfOAhABlKm2h80C3+ajgCKKDY6cegP59TYBzukAL+z1Zsq8ctaJTTKPrsUQLbXQQI0EXKXroY4AbDDHCGBNMcYsZ7nCPB8yxwCOe8IwXvOIN7/jAJ76wxHfUqWX+OzgumWAjJMV17i0Ndlr6irLKO+qftdT7i6y4uFSUvCknay+lFYZIZaQcmfH/xIFdYn98bqhra1aKTM/6lWMnyaYirx1rFUQZFBkb2zJUtoXeJCeg0WnLtHeSFc3OtrnozNwqi0TkSpBMDB1nSde5oJXW23hTS2/T0LilglXX7dmFVxLnq5U0vYATHFk3zX3BOisoQHNDFDeZnqKDy9hRNawN7Vh727hFzcJ5c8TILrKZfH7tIPxAFP0BpLeJPA==) format("woff")}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-play-circle:before{content:"\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-style:normal;font-weight:400}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\f109"}.vjs-icon-square{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-square:before{content:"\f10a"}.vjs-icon-spinner{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-spinner:before{content:"\f10b"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\f10c"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\f10e"}.vjs-icon-share{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-share:before{content:"\f10f"}.vjs-icon-cog{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-cog:before{content:"\f110"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\f111"}.vjs-icon-circle-outline{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-circle-outline:before{content:"\f112"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-circle-inner-circle:before{content:"\f113"}.vjs-icon-hd{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-hd:before{content:"\f114"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\f115"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\f116"}.vjs-icon-facebook{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-facebook:before{content:"\f117"}.vjs-icon-gplus{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-gplus:before{content:"\f118"}.vjs-icon-linkedin{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-linkedin:before{content:"\f119"}.vjs-icon-twitter{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-twitter:before{content:"\f11a"}.vjs-icon-tumblr{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-tumblr:before{content:"\f11b"}.vjs-icon-pinterest{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-pinterest:before{content:"\f11c"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\f11d"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\f11e"}.vjs-icon-next-item{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-next-item:before{content:"\f11f"}.vjs-icon-previous-item{font-family:VideoJS;font-style:normal;font-weight:400}.vjs-icon-previous-item:before{content:"\f120"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-style:normal;font-weight:400}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\f121"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-style:normal;font-weight:400}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\f122"}.video-js{background-color:#000;box-sizing:border-box;color:#fff;display:block;font-family:Arial,Helvetica,sans-serif;font-size:10px;font-style:normal;font-weight:400;line-height:1;padding:0;position:relative;vertical-align:top;word-break:normal}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{height:100%!important;width:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{height:0;max-width:100%;width:100%}.video-js.vjs-16-9{padding-top:56.25%}.video-js.vjs-4-3{padding-top:75%}.video-js.vjs-9-16{padding-top:177.7777777778%}.video-js.vjs-1-1{padding-top:100%}.video-js .vjs-tech,.video-js.vjs-fill{height:100%;width:100%}.video-js .vjs-tech{left:0;position:absolute;top:0}body.vjs-full-window{height:100%;margin:0;padding:0}.vjs-full-window .video-js.vjs-fullscreen{bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;z-index:1000}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs){height:100%!important;padding-top:0!important;width:100%!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{cursor:default;opacity:.5}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{background-color:#000;color:#fff;font-family:Arial,Helvetica,sans-serif;font-size:18px;height:150px;margin:0 auto;padding:20px;text-align:center;width:300px}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{background-color:#2b333f;background-color:#2b333fb3;border:.06666em solid #fff;border-radius:.3em;cursor:pointer;display:block;font-size:3em;height:1.63332em;left:10px;line-height:1.5em;opacity:1;padding:0;position:absolute;top:10px;transition:all .4s;width:3em}.vjs-big-play-centered .vjs-big-play-button{left:50%;margin-left:-1.5em;margin-top:-.81666em;top:50%}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{background-color:#73859f;background-color:#73859f80;border-color:#fff;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-decoration:none;text-transform:none;transition:none}.vjs-control .vjs-button{height:100%;width:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),hsla(0,0%,100%,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;font-family:Arial,Helvetica,sans-serif;margin:0;overflow:auto;padding:0}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{font-size:1.2em;line-height:1.4em;list-style:none;margin:0;padding:.2em 0;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:none}.vjs-menu li.vjs-menu-title{cursor:default;font-size:1em;font-weight:700;line-height:2em;margin:0 0 .3em;padding:0;text-align:center;text-transform:uppercase}.vjs-menu-button-popup .vjs-menu{border-top-color:#2b333fb3;bottom:0;display:none;height:0;left:-3em;margin-bottom:1.5em;position:absolute;width:10em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;bottom:1.5em;max-height:15em;position:absolute;width:100%}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{overflow:hidden;transition:all .4s}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{height:100%;left:4em;margin:0;opacity:0;padding:0;position:absolute;top:0;transition:all .4s;width:auto}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{height:100%;margin:0;overflow:hidden;width:auto}.video-js .vjs-control-bar{background-color:#2b333f;background-color:#2b333fb3;bottom:0;display:none;height:3em;left:0;position:absolute;right:0;width:100%}.vjs-has-started .vjs-control-bar{display:flex;opacity:1;transition:visibility .1s,opacity .1s;visibility:visible}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s;visibility:visible}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{flex:none;height:100%;margin:0;padding:0;position:relative;text-align:center;width:4em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js .vjs-control-text{clip:rect(0 0 0 0);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{align-items:center;cursor:pointer;display:flex;flex:auto;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{align-items:center;display:flex}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;height:.3em;transition:all .2s}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{display:block;height:100%;margin:0;padding:0;position:absolute;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.3333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{background-color:#000;display:none;height:100%;position:absolute;width:1px;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{opacity:0;transition:visibility 1s,opacity 1s;visibility:hidden}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{background-color:#000;background-color:#000c;color:#fff}.video-js .vjs-slider{-webkit-touch-callout:none;background-color:#73859f;background-color:#73859f80;cursor:pointer;margin:0 .45em;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{box-shadow:0 0 1em #fff;text-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;display:flex;margin-right:1em}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{height:1px;margin-left:-1px;opacity:0;visibility:visible;width:1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s;visibility:visible}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{height:3em;margin-right:0;width:5em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{transition:width .1s;width:10em}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s;width:3em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{height:3em;opacity:1;position:relative;transition:none;visibility:visible;width:5em}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{bottom:3em;left:.5em;position:absolute}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{height:.3em;width:5em}.vjs-volume-bar.vjs-slider-vertical{height:5em;margin:1.35em auto;width:.3em}.video-js .vjs-volume-level{background-color:#fff;bottom:0;left:0;position:absolute}.video-js .vjs-volume-level:before{font-size:.9em;position:absolute;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{left:-.3em;top:-.5em;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{right:-.5em;top:-.3em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{background-color:#2b333f;background-color:#2b333fb3;bottom:8em;height:8em;width:3em}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{background-color:#000;display:none;height:1px;position:absolute;width:100%;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{height:100%;width:1px}.vjs-no-flex .vjs-volume-control .vjs-mouse-display{z-index:0}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{opacity:0;transition:visibility 1s,opacity 1s;visibility:hidden}.video-js.vjs-user-inactive.vjs-no-flex .vjs-volume-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-volume-tooltip{background-color:#000;background-color:#000c;color:#fff}.vjs-poster{background-color:#000;background-position:50% 50%;background-repeat:no-repeat;background-size:contain;bottom:0;cursor:pointer;display:inline-block;height:100%;left:0;margin:0;padding:0;position:absolute;right:0;top:0;vertical-align:middle}.vjs-has-started .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster{display:block}.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-live-control{align-items:flex-start;display:flex;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;text-align:left;width:auto}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;display:inline-flex;flex:none;font-size:1em;height:100%;line-height:3em;min-width:4em;padding-left:.5em;padding-right:.5em;width:auto}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;text-align:left;width:auto}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{color:#888;margin-right:.5em}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;padding-left:1em;padding-right:1em;width:auto}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-no-flex .vjs-current-time,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{bottom:3em;left:0;pointer-events:none;position:absolute;right:0;top:0}.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;margin-bottom:.1em;text-align:center}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-fullscreen-control,.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{height:100%;left:0;position:absolute;top:0;width:100%}.vjs-playback-rate .vjs-playback-rate-value{font-size:1.5em;line-height:2;pointer-events:none;text-align:center}.vjs-playback-rate .vjs-menu{left:0;width:4em}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-align:center;text-shadow:.05em .05em .1em #000;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{background-clip:padding-box;border:6px solid rgba(43,51,63,.7);border-radius:25px;box-sizing:border-box;display:none;height:50px;left:50%;margin:-25px 0 0 -25px;opacity:.85;position:absolute;text-align:left;top:50%;visibility:hidden;width:50px}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards;display:block}.vjs-loading-spinner:after,.vjs-loading-spinner:before{border:inherit;border-color:#fff transparent transparent;border-radius:inherit;box-sizing:inherit;content:"";height:inherit;margin:-6px;opacity:1;position:absolute;width:inherit}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{-webkit-animation-delay:.44s;animation-delay:.44s;border-top-color:#fff}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(1turn)}}@-webkit-keyframes vjs-spinner-spin{to{-webkit-transform:rotate(1turn)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{display:inline-block;margin-bottom:-.1em;vertical-align:middle}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{content:"\f10d";font-family:VideoJS;font-size:1.5em;line-height:inherit}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{display:inline-block;margin-bottom:-.1em;vertical-align:middle}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{content:" \f11d";font-family:VideoJS;font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{display:block;flex:auto}.video-js.vjs-layout-x-small.vjs-no-flex .vjs-custom-control-spacer{width:auto}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-bottom:.5em;margin-right:1em}.vjs-text-track-settings fieldset{border:none;margin:5px;padding:3px}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px}.vjs-text-track-settings .vjs-label{clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);border:0;display:block;height:1px;margin:0 0 5px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{background-image:linear-gradient(0deg,#fff 88%,#73859f);outline-style:solid;outline-width:medium}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);border-radius:2px;color:#2b333f;cursor:pointer}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{border:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:none}.video-js :focus:not(:focus-visible){outline:none}.netless-window-manager-playground{height:100%;overflow:hidden;position:relative;user-select:none;width:100%;z-index:1}.netless-window-manager-sizer{display:flex;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%;z-index:1}.netless-window-manager-sizer-horizontal{flex-direction:column}.netless-window-manager-sizer:after,.netless-window-manager-sizer:before{content:"";display:block;flex:1}.netless-window-manager-chess-sizer:after,.netless-window-manager-chess-sizer:before{background-color:#fff;background-image:linear-gradient(45deg,#b0b0b0 25%,transparent 0),linear-gradient(-45deg,#b0b0b0 25%,transparent 0),linear-gradient(45deg,transparent 75%,#b0b0b0 0),linear-gradient(-45deg,transparent 75%,#b0b0b0 0);background-position:0 0,0 10px,10px -10px,-10px 0;background-size:20px 20px}.netless-window-manager-wrapper{height:100%;overflow:hidden;position:relative;width:100%;z-index:1}.netless-window-manager-main-view{height:100%;width:100%}.netless-window-manager-cursor-eraser-image,.netless-window-manager-cursor-pencil-image{height:26px;width:26px}.netless-window-manager-cursor-selector-image{height:24px;width:24px}.netless-window-manager-cursor-selector-avatar{border:2px solid #fff;border-radius:50%;margin-bottom:2px}.netless-window-manager-cursor-selector-avatar img{width:12px}.netless-window-manager-cursor-inner{align-items:center;border-radius:4px;display:flex;flex-direction:row;font-size:12px;justify-content:center;padding-left:4px;padding-right:4px}.netless-window-manager-cursor-inner-mellow{align-items:center;border-radius:16px;display:flex;flex-direction:row;height:32px;justify-content:center;padding-left:16px;padding-right:16px}.netless-window-manager-cursor-tag-name{border-radius:4px;font-size:12px;margin-left:4px;padding:2px 8px}.netless-window-manager-cursor-mid{align-items:center;display:flex;flex-direction:column;height:26px;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;transform-origin:0 0;transition:transform .12s;user-select:none;width:26px;will-change:transform;z-index:2147483647}.netless-window-manager-cursor-pencil-offset{margin-left:-20px}.netless-window-manager-cursor-selector-offset{margin-left:-22px;margin-top:56px}.netless-window-manager-cursor-text-offset{margin-left:-30px;margin-top:18px}.netless-window-manager-cursor-shape-offset{align-items:center;display:flex;flex-direction:column;height:64px;justify-content:center;margin-left:-30px;margin-top:12px;position:absolute;width:180px}.netless-window-manager-cursor-laserPointer-image,.netless-window-manager-cursor-pencilEraser-image{margin-left:-22px;margin-top:3px}.netless-window-manager-laserPointer-pencilEraser-offset{margin-left:-18px}.netless-window-manager-pencilEraser-3-offset{margin-left:-6px;margin-top:-14px}.netless-window-manager-cursor-name{align-items:center;display:flex;height:48px;justify-content:center;position:absolute;top:-40px;width:100%}.cursor-image-wrapper{display:flex;justify-content:center}.telebox-collector{bottom:15px;right:10px}.netless-iframe-brdige-hidden,.netless-window-manager-fullscreen .netless-app-slide-footer,.netless-window-manager-fullscreen .telebox-footer-wrap,.netless-window-manager-fullscreen .telebox-max-titlebar-maximized,.netless-window-manager-fullscreen .telebox-titlebar,.netless-window-manager-fullscreen .telebox-titlebar-wrap{display:none}.tele-fancy-scrollbar{-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;overflow:auto;overflow-y:scroll;overflow-y:overlay;overscroll-behavior:contain;scrollbar-width:auto}.tele-fancy-scrollbar::-webkit-scrollbar{height:8px;width:8px}.tele-fancy-scrollbar::-webkit-scrollbar-track{background-color:initial}.tele-fancy-scrollbar::-webkit-scrollbar-thumb{background-color:#444e601a;background-color:initial;border-radius:4px;transition:background-color .4s}.tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb{background-color:#444e601a}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:active,.tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#444e6033}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical{min-height:50px}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-box{left:0;position:absolute;top:0;transition:width .4s cubic-bezier(.4,.9,.71,1.02),height .4s cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .4s ease;z-index:100}.telebox-box-main{background:#f9f9fc;border:1px solid #e3e3ec;border-radius:6px;box-shadow:0 4px 10px #2f419226;display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.telebox-titlebar-wrap{flex-shrink:0;position:relative;z-index:1}.telebox-content-wrap{align-items:center;display:flex;flex:1;justify-content:center;overflow:hidden;width:100%}.telebox-content{height:100%;position:relative;width:100%}.telebox-footer-wrap{display:flex;flex-direction:column;flex-shrink:0}.telebox-footer-wrap:before{content:"";display:block;flex:1}.telebox-resize-handle{-webkit-touch-callout:none;position:absolute;user-select:none;-webkit-user-select:none;z-index:2147483647}.telebox-n{cursor:n-resize;top:-5px}.telebox-n,.telebox-s{height:5px;left:0;width:100%}.telebox-s{bottom:-5px;cursor:s-resize}.telebox-w{cursor:w-resize;left:-5px}.telebox-e,.telebox-w{height:100%;top:0;width:5px}.telebox-e{cursor:e-resize;right:-5px}.telebox-nw{cursor:nw-resize;left:-5px}.telebox-ne,.telebox-nw{height:15px;top:-5px;width:15px}.telebox-ne{cursor:ne-resize;right:-5px}.telebox-se{cursor:se-resize;right:-5px}.telebox-se,.telebox-sw{bottom:-5px;height:15px;width:15px}.telebox-sw{cursor:sw-resize;left:-5px}.telebox-track-mask{-webkit-touch-callout:none;background:transparent;cursor:move;height:100%;left:0;position:fixed;top:0;user-select:none;-webkit-user-select:none;width:100%;z-index:2147483647}.telebox-cursor-n{cursor:n-resize}.telebox-cursor-s{cursor:s-resize}.telebox-cursor-w{cursor:w-resize}.telebox-cursor-e{cursor:e-resize}.telebox-cursor-nw{cursor:nw-resize}.telebox-cursor-ne{cursor:ne-resize}.telebox-cursor-se{cursor:se-resize}.telebox-cursor-sw{cursor:sw-resize}.telebox-maximized .telebox-resize-handles,.telebox-no-resize .telebox-resize-handles{display:none}.telebox-maximized{box-shadow:none;transition:none}.telebox-minimized{opacity:0;pointer-events:none;transition:width .05s cubic-bezier(.4,.9,.71,1.02),height .05s cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .6s ease;user-select:none}.telebox-transforming{transition:opacity .6s cubic-bezier(.7,0,.84,0);will-change:transform}.telebox-readonly .telebox-resize-handle{cursor:auto!important;pointer-events:none!important}.telebox-color-scheme-dark .telebox-box-main{background:#212126;border-color:#43434d;color:#e9e9e9}.telebox-titlebar{-webkit-touch-callout:none;align-items:center;background:#fff;border-bottom:1px solid #eeeef7;box-sizing:border-box;display:flex;height:26px;touch-action:manipulation;-webkit-user-select:none;user-select:none}.telebox-title-area{align-items:center;display:flex;flex:1;height:100%;overflow:hidden;padding-left:16px;position:relative}.telebox-title{-webkit-touch-callout:none;color:#191919;font-family:PingFangSC-Regular,PingFang SC;font-size:14px;font-weight:400;margin:0;overflow:hidden;padding:0;text-overflow:ellipsis;user-select:none;-webkit-user-select:none;white-space:nowrap;word-break:keep-all}.telebox-drag-area{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;z-index:10}.telebox-titlebar-btns{font-size:0;margin-left:auto;position:absolute;right:16px;white-space:nowrap;word-break:keep-all;z-index:10}.telebox-titlebar-btn{-webkit-touch-callout:none;background:transparent;border:none;cursor:pointer;height:22px;outline:none;padding:0;user-select:none;-webkit-user-select:none;width:22px}.telebox-titlebar-btn~.telebox-titlebar-btn{margin-left:10px}.telebox-titlebar-btn-icon{height:22px;width:22px}.telebox-readonly .telebox-titlebar-btn{cursor:not-allowed}.telebox-titlebar-icon-minimize{background:50%/cover no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjggMjgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAwaDI4djI4SDB6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZmlsbD0iI0E3QTdDQSIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNOSAxM2gxMHYxLjZIOXoiIG1hc2s9InVybCgjYikiLz48L2c+PC9zdmc+)}.telebox-titlebar-icon-maximize{background:50%/cover no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjggMjgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAwaDI4djI4SDB6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PGcgZmlsbD0iI0E3QTdDQSIgZmlsbC1ydWxlPSJub256ZXJvIiBtYXNrPSJ1cmwoI2IpIj48cGF0aCBkPSJNMjAuNDgxIDE3LjFoMS4ydjQuNTgxSDE3LjF2LTEuMmgzLjM4MVYxNy4xem0tMTQuMTktLjAwOWgxLjJ2My4zODFoMy4zOHYxLjJoLTQuNTh2LTQuNTgxek0xNy4xIDYuMTkxaDQuNTgxdjQuNThoLTEuMnYtMy4zOEgxNy4xdi0xLjJ6bS0xMC43LjEwOGg0Ljc5OHYxLjJINy41OTl2My41OTlINi40VjYuMjk5eiIvPjwvZz48L2c+PC9zdmc+)}.telebox-titlebar-icon-maximize.is-active{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjggMjgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAwaDI2djI2SDB6Ii8+PHBhdGggaWQ9ImMiIGQ9Ik0yNi44NjkgMCAyOCAxLjEzMVYyNi44N0wyNi44NjkgMjhIMS4xM0wwIDI2Ljg3VjEuMTMxTDEuMTMgMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNLTQuNjQzLTQuNjQzaDM1LjI4NnYzNS4yODZILTQuNjQzeiIgbWFzaz0idXJsKCNiKSIvPjwvZz48bWFzayBpZD0iZCIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYyIvPjwvbWFzaz48cGF0aCBkPSJNLTE3LjUxNyAxNCAxNC0xNy41MTcgNDUuNTE3IDE0IDE0IDQ1LjUxN3oiIG1hc2s9InVybCgjZCkiLz48cGF0aCBzdHJva2U9IiNBN0E3Q0EiIHN0cm9rZS13aWR0aD0iMS4yIiBkPSJNMTAuMDg5IDIxLjQ4NlYxNy43OUg2LjM5Mm0xNC45OTQtNy42aC0zLjY5N1Y2LjQ5M20zLjcxMyAxMS4zMDVoLTMuNjk3djMuNjk3TTEwLjI1IDYuMTV2My44OThINi4zNTIiLz48L2c+PC9zdmc+)}.telebox-titlebar-icon-close{background:50%/cover no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyOCAyOCI+PHBhdGggZD0iTTguMzUzIDIwLjMzMiAyMC4zMzIgOC4zNTNtMCAxMS45OEw4LjM1MyA4LjM1MiIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiNBN0E3Q0EiIHN0cm9rZS13aWR0aD0iMS40Ii8+PC9zdmc+)}.telebox-color-scheme-dark .telebox-titlebar{background:#43434d;border-bottom:none;color:#e9e9e9}.telebox-collector{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;background:#fff;background-position:50%;background-repeat:no-repeat;background-size:18px 16px;border:none;border-radius:50%;box-shadow:0 2px 6px #2f419226;cursor:pointer;display:block;font-size:0;height:40px;margin:0;outline:none;padding:0;pointer-events:none;position:absolute;-webkit-user-select:none;user-select:none;visibility:hidden;width:40px;z-index:200}.telebox-collector-visible{pointer-events:auto;visibility:visible}.telebox-collector-readonly{cursor:not-allowed}.telebox-color-scheme-dark.telebox-collector{background-color:#43434d}.telebox-max-titlebar{-webkit-touch-callout:none;display:none;left:0;position:absolute;top:0;user-select:none;-webkit-user-select:none;z-index:50000}.telebox-max-titlebar .telebox-title,.telebox-max-titlebar.telebox-max-titlebar-single-title .telebox-titles{display:none}.telebox-max-titlebar.telebox-max-titlebar-single-title .telebox-title{display:block}.telebox-max-titlebar-maximized{display:flex}.telebox-titles{-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;height:100%;margin:0;overflow-x:scroll;overflow-x:overlay;overflow-y:hidden;scrollbar-width:auto}.telebox-titles::-webkit-scrollbar{height:8px;width:8px}.telebox-titles::-webkit-scrollbar-track{background-color:initial}.telebox-titles::-webkit-scrollbar-thumb{background-color:#eeeef7cc;background-color:initial;border-radius:4px;transition:background-color .4s}.telebox-titles:hover::-webkit-scrollbar-thumb{background-color:#eeeef7cc}.telebox-titles::-webkit-scrollbar-thumb:active,.telebox-titles::-webkit-scrollbar-thumb:hover{background-color:#eeeef7}.telebox-titles::-webkit-scrollbar-thumb:vertical{min-height:50px}.telebox-titles::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-titles-content{align-items:center;display:flex;flex-wrap:nowrap;height:100%;padding:0}.telebox-titles-tab{background:transparent;border:none;border-right:1px solid #e5e5f0;color:#7b88a0;cursor:pointer;font-family:PingFangSC-Regular,PingFang SC;font-size:13px;font-weight:400;height:100%;max-width:182px;min-width:50px;outline:none;overflow:hidden;padding:0 26px 0 16px;text-overflow:ellipsis;user-select:none;white-space:nowrap;word-break:keep-all}.telebox-titles-tab-focus{color:#357bf6}.telebox-readonly .telebox-titles-tab{cursor:not-allowed}.telebox-color-scheme-dark{color-scheme:dark}.telebox-color-scheme-dark.telebox-titlebar{background:#43434d;border-bottom:none;color:#e9e9e9}.telebox-color-scheme-dark .telebox-titles-tab{border-right-color:#7b88a0}.telebox-color-scheme-dark .telebox-title{color:#e9e9e9}.teaching-aids-plugin-app-view-displayer,.teaching-aids-plugin-main-view-displayer{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}.bezier-pencil-plugin-floatbtns{align-items:center;background:#fff;border:1px solid #efefef;border-radius:4px;box-shadow:0 6px 12px #0000001f;color-scheme:light;display:flex;flex-direction:row;left:3px;pointer-events:auto;position:absolute;transform:translateY(-60px);z-index:9}.bezier-pencil-plugin-floatbtns .normal-button{height:40px;touch-action:none;width:40px}.bezier-pencil-plugin-floatbtns .button{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center}.bezier-pencil-plugin-floatbtns .button.active,.bezier-pencil-plugin-floatbtns .button:hover{background-color:#eef0f6}.bezier-pencil-plugin-floatbtns .font-colors-menu,.bezier-pencil-plugin-floatbtns .font-style-menu,.bezier-pencil-plugin-floatbtns .image-layer-menu,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu{align-items:center;background:#fff;border-radius:2px;box-shadow:0 3px 6px #0000001f;box-sizing:border-box;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;padding:4px;position:absolute;top:50px;touch-action:none}.bezier-pencil-plugin-floatbtns .font-colors-menu .normal-button,.bezier-pencil-plugin-floatbtns .font-style-menu .normal-button,.bezier-pencil-plugin-floatbtns .image-layer-menu .normal-button,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .normal-button{height:32px;touch-action:none;width:32px}.bezier-pencil-plugin-floatbtns .font-colors-menu{justify-content:space-between;width:128px}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button{align-items:center;background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;border:1px solid #fff;border-radius:50%;box-sizing:border-box;cursor:pointer;display:flex;height:20px;justify-content:center;margin:4px;width:20px}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button.active{border-color:#a7a7a7}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button .circle{border:1px solid rgba(0,0,0,.12);border-radius:50%;box-sizing:border-box;height:16px;touch-action:none;width:16px}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button .none{background-color:#fff;position:relative}.bezier-pencil-plugin-floatbtns .font-colors-menu .font-color-button .none:before{background-color:#0000001f;content:"";height:100%;left:50%;position:absolute;transform:rotate(45deg);width:1px}.bezier-pencil-plugin-floatbtns .font-colors-icon{flex-direction:column}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar{background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;height:2px;margin-top:-2px;width:12px}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar .color-bar-color{height:100%;width:100%}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-fill,.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring{background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;border:1px solid rgba(0,0,0,.12);border-radius:6px;height:12px;width:12px}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-fill .circle,.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring .circle{border-radius:50%;height:100%;touch-action:none;width:100%}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring{border:0}.bezier-pencil-plugin-floatbtns .font-colors-icon .color-bar-ring .circle{background-color:#fff;border-radius:50%;height:60%;touch-action:none;transform:translate(35%,30%);width:60%}.bezier-pencil-plugin-floatbtns .font-color-opacity{background-image:conic-gradient(rgba(0,0,0,.06) 0 25%,transparent 0 50%,rgba(0,0,0,.06) 0 75%,transparent 0);background-size:6px 6px;border-radius:3px;box-sizing:border-box;height:6px;margin:5px 0 10px;position:relative;width:100px}.bezier-pencil-plugin-floatbtns .font-color-opacity .range-color{border-radius:4px;bottom:0;box-shadow:inset 0 0 1px #00000040;height:6px;left:0;right:0;top:0}.bezier-pencil-plugin-floatbtns .font-color-opacity .range-opacity{height:6px;left:-10px;position:absolute;top:0;width:120px}.bezier-pencil-plugin-floatbtns .font-color-opacity .circle{border:2px solid #fff;border-radius:50%;box-shadow:inset 0 0 1px #00000040,0 0 0 1px #0000000f;box-sizing:border-box;cursor:pointer;height:12px;position:absolute;top:-3px;touch-action:none;width:12px}.bezier-pencil-plugin-floatbtns .font-style-menu{justify-content:space-between;width:128px}.bezier-pencil-plugin-floatbtns .font-style-menu .font-style-button{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;height:20px;justify-content:center;margin:4px;width:20px}.bezier-pencil-plugin-floatbtns .font-style-menu .font-style-button.active{border-color:#a7a7a7}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-input{border:1px solid;border-radius:3px;height:20px;line-height:20px;margin-left:2px;padding:0 2px;width:25px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-input:focus{background:#eef0f6}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns{display:flex;flex-direction:column;justify-content:center;margin-left:3px;width:15px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add,.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut{height:10px;position:relative;width:10px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add:hover,.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut:hover{background:#eef0f6}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add:after,.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut:after{border-color:#999 transparent;border-style:solid;border-width:4px;content:"";position:absolute;top:0}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add{margin-bottom:3px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-add:after{border-top-color:transparent}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-btns .font-size-cut:after{border-bottom-color:transparent}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-menu{align-items:center;background:#fff;border:1px solid #efefef;box-shadow:0 6px 12px #0000001f;display:flex;flex-direction:column;overflow-y:auto;position:absolute;top:35px;width:50px}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-menu .font-size-btn{font-size:12px;line-height:20px;text-align:center;width:100%}.bezier-pencil-plugin-floatbtns .font-size-barBtn .font-size-menu .font-size-btn:hover{background:#eef0f6}.bezier-pencil-plugin-floatbtns .font-size-barBtn:hover{background:#fff}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu{flex-direction:column;touch-action:none}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-tabs{display:flex;flex-direction:row;justify-content:flex-start;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-tabs .tab-button{height:24px;width:32px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content{align-items:baseline;background-color:#eef0f6;display:flex;flex:1;flex-direction:column;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button{cursor:default;display:flex;flex:1;flex-direction:row;height:32px;justify-content:flex-start;padding:5px 0;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button img{height:16px;margin:0 5px;width:16px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number{border:1px solid;border-radius:3px;flex:1;height:20px;margin-right:5px;max-width:70px;min-width:40px;padding:0 3px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns{display:flex;flex-direction:column;justify-content:center;width:15px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut{cursor:pointer;height:10px;position:relative;width:10px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add:hover,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut:hover{background:#eef0f6}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add:after,.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut:after{border-color:#999 transparent;border-style:solid;border-width:4px;content:"";position:absolute;top:0}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add{margin-bottom:3px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-add:after{border-top-color:transparent}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .input-number-btns .input-number-cut:after{border-bottom-color:transparent}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container{background-color:#3381ff;border-radius:3px;box-sizing:border-box;flex:1;height:6px;margin:7px 6px 7px 0;position:relative;width:100px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container .range-number-color{border-radius:4px;bottom:0;box-shadow:inset 0 0 1px #00000040;height:6px;left:0;right:0;top:0}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container .range-number{cursor:pointer;height:6px;left:-6px;position:absolute;top:0;width:112px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .range-number-container .circle{background-color:#3381ff;border:2px solid #fff;border-radius:50%;box-shadow:inset 0 0 1px #00000040,0 0 0 1px #0000000f;box-sizing:border-box;cursor:pointer;height:12px;position:absolute;top:-3px;touch-action:none;width:12px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .select-option-menu{align-items:center;background:#fff;border:1px solid #efefef;box-shadow:0 6px 12px #0000001f;display:flex;flex-direction:column;left:30px;position:absolute;top:60px;width:80px}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .select-option-menu .select-option-btn{font-size:12px;line-height:20px;text-align:center;width:100%}.bezier-pencil-plugin-floatbtns .shapeOpt-sub-menu .shapeOpt-sub-menu-content .input-button .select-option-menu .select-option-btn:hover{background:#eef0f6}.index-module__Container__nLsM3{height:100%;left:0;outline:none;overflow:hidden;pointer-events:none;position:absolute;top:0;touch-action:none;width:100%}.index-module__Container__nLsM3 *{touch-action:none}.index-module__Container__nLsM3 .index-module__CanvasBox__j2Xe-{height:100%;pointer-events:none;position:relative;width:100%}.index-module__Container__nLsM3 .index-module__CanvasBox__j2Xe- .index-module__FloatCanvas__d1YR7{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.index-module__Container__nLsM3 .index-module__CanvasBox__j2Xe- .index-module__TopFloatCanvas__7IaCw{height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.index-module__Container__nLsM3 .index-module__SnapshotBox__--eeE{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:-1}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL{height:0;left:0;pointer-events:none;position:absolute;top:0;width:0}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box{border:1px solid;box-sizing:border-box;height:100%;pointer-events:none;position:relative;width:100%;z-index:1}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .point{height:7px;pointer-events:none;position:absolute;transform:translate(-50%,-50%);width:7px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .point-dot{background-color:#fff;border:1px solid;border-radius:3px;height:5px;margin:-1px 0 0 -1px;width:5px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LB,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LT{left:0}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LT,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RT,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .TC{top:0}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RB,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RT{right:-7px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .BC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LB,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RB{bottom:-7px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .LC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .RC{top:50%}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .BC,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .TC{left:50%}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-hightlight-box .lock{height:22px;left:-11px;pointer-events:none;position:absolute;top:-11px;width:22px}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-floatCanvas-box{overflow:hidden;position:absolute;z-index:1}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .bezier-pencil-plugin-floatCanvas{height:100%;width:100%}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor-box{position:absolute;touch-action:none}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor{align-items:baseline;border:1px dashed;display:flex;flex-direction:column;font-family:sans-serif;padding:5px;pointer-events:auto;position:relative;resize:none;white-space:pre;z-index:2}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor:hover{border-style:solid}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor:focus,.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .editor:focus-visible{outline:none}.index-module__Container__nLsM3 .index-module__FloatBar__cm-EL .readOnly{border-color:transparent}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf{cursor:move;height:16px;left:0;pointer-events:auto;position:absolute;top:0;width:16px;z-index:2}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-btn{align-items:center;border-radius:8px;display:flex;height:16px;justify-content:center;left:0;position:absolute;top:0;width:16px}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-btn img{height:12px;width:12px}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer{height:100%;opacity:0;position:relative;width:100%}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer.active{opacity:1}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer img{height:100%;width:100%}.index-module__Container__nLsM3 .index-module__RotateBtn__HSSkf .bezier-pencil-plugin-rotate-mouse-pointer .angle-icon{background-color:#333;border-radius:4px;color:#fff;font-size:12px;height:16px;left:-16px;position:absolute;text-align:center;top:-16px;width:30px}.index-module__Container__nLsM3 .index-module__ResizeBtn__yjvda{box-sizing:initial;left:0;position:absolute;top:0;touch-action:none;width:0;z-index:1}.index-module__Container__nLsM3 .index-module__CursorBox__2UHvI{left:0;position:absolute;top:0;z-index:2}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC{height:100%;left:0;overflow:hidden;pointer-events:none;position:absolute;top:0;transform:translateZ(0);width:100%;z-index:1}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor-box{position:absolute;touch-action:none}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor{align-items:baseline;border:1px dashed;display:flex;flex-direction:column;font-family:sans-serif;padding:5px;pointer-events:auto;position:relative;resize:none;white-space:nowrap;z-index:2}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor:hover{border-style:solid}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor:focus,.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .editor:focus-visible{outline:none}.index-module__Container__nLsM3 .index-module__TextEditorContainer__Qm8KC .readOnly{border-color:transparent;pointer-events:none}.index-module__Container__nLsM3 .index-module__ResizeTowBox__HOllX{left:0;position:absolute;top:0;width:0}.index-module__Container__nLsM3 .index-module__ResizeTowBox__HOllX .bezier-pencil-plugin-point-btn{background-color:#fff;border:1px solid;border-radius:3px;height:5px;position:absolute;transform:translate(-50%,-50%);width:5px;z-index:2}.index-module__Container__nLsM3 .index-module__ResizeTowBox__HOllX .bezier-pencil-plugin-point-draggable-btn{cursor:move;height:10px;margin-left:-5px;margin-top:-5px;pointer-events:auto;position:absolute;touch-action:none;width:10px;z-index:3}.index-module__Container__nLsM3 .index-module__FloatBarBtn__FJrOG{pointer-events:none;position:absolute}.cursor-box{border-radius:2px;color:#fff;height:100%;padding:4px;width:100%}.cursor-pencil-image{height:26px;width:26px}.cursor-selector-image{height:24px;width:24px}.cursor-selector-avatar{border:2px solid #fff;border-radius:50%;margin-bottom:2px}.cursor-inner{border-radius:4px;font-size:12px;padding-left:4px;padding-right:4px}.cursor-inner,.cursor-inner-mellow{align-items:center;display:flex;flex-direction:row;justify-content:center}.cursor-inner-mellow{border-radius:16px;height:32px;padding-left:16px;padding-right:16px}.cursor-tag-name{border-radius:4px;font-size:12px;margin-left:4px;padding:2px 8px}.cursor-mid{align-items:center;display:flex;flex-direction:column;height:64px;justify-content:center;position:absolute;width:180px}.cursor-pencil-offset{margin-left:-20px}.cursor-selector-offset{margin-left:-22px;margin-top:56px}.cursor-text-offset{margin-left:-30px;margin-top:18px}.cursor-shape-offset{flex-direction:column;height:64px;margin-left:-30px;margin-top:12px;position:absolute;width:180px}.cursor-name,.cursor-shape-offset{align-items:center;display:flex;justify-content:center}.cursor-name{height:48px;width:100%} \ No newline at end of file diff --git a/sdk/src/main/assets/whiteboard/netless.554ad672.js b/sdk/src/main/assets/whiteboard/netless.f21653ed.js similarity index 67% rename from sdk/src/main/assets/whiteboard/netless.554ad672.js rename to sdk/src/main/assets/whiteboard/netless.f21653ed.js index 3612a1d1..5870b089 100644 --- a/sdk/src/main/assets/whiteboard/netless.554ad672.js +++ b/sdk/src/main/assets/whiteboard/netless.f21653ed.js @@ -1,4 +1,4 @@ -"use strict";(self.webpackChunkwhiteboard_bridge=self.webpackChunkwhiteboard_bridge||[]).push([[83],{39927:function(e,t,r){r.r(t)},19418:function(e,t,r){r.r(t)},24496:function(e,t,r){function n(e){var t="function"==typeof Map?new Map:void 0;return n=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return i(e,arguments,b(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},n(e)}function i(e,t,r){return i=_()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&v(i,r.prototype),i},i.apply(null,arguments)}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){return function(e){if(Array.isArray(e))return E(e)}(e)||s(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function u(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){u(o,n,i,a,s,"next",e)}function s(e){u(o,n,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){return d(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||k(e,t)||h()}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){if(Array.isArray(e))return e}function f(e,t,r){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=b(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}},f(e,t,r||e)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function g(e){var t=_();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function m(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function k(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function k(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.x&&e=this.y&&te.right?e.right:this.right)<=r)return!1;var n=this.ye.bottom?e.bottom:this.bottom)>n}var i=this.left,o=this.right,a=this.top,s=this.bottom;if(o<=i||s<=a)return!1;var u=l[0].set(e.left,e.top),c=l[1].set(e.left,e.bottom),h=l[2].set(e.right,e.top),d=l[3].set(e.right,e.bottom);if(h.x<=u.x||c.y<=u.y)return!1;var f=Math.sign(t.a*t.d-t.b*t.c);if(0===f)return!1;if(t.apply(u,u),t.apply(c,c),t.apply(h,h),t.apply(d,d),Math.max(u.x,c.x,h.x,d.x)<=i||Math.min(u.x,c.x,h.x,d.x)>=o||Math.max(u.y,c.y,h.y,d.y)<=a||Math.min(u.y,c.y,h.y,d.y)>=s)return!1;var p=f*(c.y-u.y),v=f*(u.x-c.x),g=p*i+v*a,m=p*o+v*a,y=p*i+v*s,_=p*o+v*s;if(Math.max(g,m,y,_)<=p*u.x+v*u.y||Math.min(g,m,y,_)>=p*d.x+v*d.y)return!1;var b=f*(u.y-h.y),x=f*(h.x-u.x),w=b*i+x*a,S=b*o+x*a,T=b*i+x*s,M=b*o+x*s;return!(Math.max(w,S,T,M)<=b*u.x+x*u.y||Math.min(w,S,T,M)>=b*d.x+x*d.y)},e.prototype.pad=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.x-=e,this.y-=t,this.width+=2*e,this.height+=2*t,this},e.prototype.fit=function(e){var t=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(r-t,0),this.y=n,this.height=Math.max(i-n,0),this},e.prototype.ceil=function(e,t){void 0===e&&(e=1),void 0===t&&(t=.001);var r=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=r-this.x,this.height=n-this.y,this},e.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=r-t,this.y=n,this.height=i-n,this},e.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),h=function(){function e(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),this.x=e,this.y=t,this.radius=r,this.type=n.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(e,t){if(this.radius<=0)return!1;var r=this.radius*this.radius,n=this.x-e,i=this.y-t;return(n*=n)+(i*=i)<=r},e.prototype.getBounds=function(){return new c(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},e.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},e}(),d=function(){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=e,this.y=t,this.width=r,this.height=i,this.type=n.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var r=(e-this.x)/this.width,n=(t-this.y)/this.height;return(r*=r)+(n*=n)<=1},e.prototype.getBounds=function(){return new c(this.x-this.width,this.y-this.height,this.width,this.height)},e.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),f=function(){function e(){for(var e=arguments,t=[],r=0;rt!=l>t&&e<(t-s)/(l-s)*(u-a)+a&&(r=!r)}return r},e.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(e,t){return e+", "+t}),"")+"]"},e}(),p=function(){function e(e,t,r,i,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=20),this.x=e,this.y=t,this.width=r,this.height=i,this.radius=o,this.type=n.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+r&&t<=this.y+this.height-r||e>=this.x+r&&e<=this.x+this.width-r)return!0;var n=e-(this.x+r),i=t-(this.y+r),o=r*r;if(n*n+i*i<=o)return!0;if((n=e-(this.x+this.width-r))*n+i*i<=o)return!0;if(n*n+(i=t-(this.y+this.height-r))*i<=o)return!0;if((n=e-(this.x+r))*n+i*i<=o)return!0}return!1},e.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},e}(),v=function(){function e(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this._x=r,this._y=n,this.cb=e,this.scope=t}return e.prototype.clone=function(t,r){return void 0===t&&(t=this.cb),void 0===r&&(r=this.scope),new e(t,r,this._x,this._y)},e.prototype.set=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this._x===e&&this._y===t||(this._x=e,this._y=t,this.cb.call(this.scope)),this},e.prototype.copyFrom=function(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},e.prototype.copyTo=function(e){return e.set(this._x,this._y),e},e.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},e.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),e}(),g=function(){function e(e,t,r,n,i,o){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===i&&(i=0),void 0===o&&(o=0),this.array=null,this.a=e,this.b=t,this.c=r,this.d=n,this.tx=i,this.ty=o}return e.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},e.prototype.set=function(e,t,r,n,i,o){return this.a=e,this.b=t,this.c=r,this.d=n,this.tx=i,this.ty=o,this},e.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var r=t||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},e.prototype.apply=function(e,t){t=t||new u;var r=e.x,n=e.y;return t.x=this.a*r+this.c*n+this.tx,t.y=this.b*r+this.d*n+this.ty,t},e.prototype.applyInverse=function(e,t){t=t||new u;var r=1/(this.a*this.d+this.c*-this.b),n=e.x,i=e.y;return t.x=this.d*r*n+-this.c*r*i+(this.ty*this.c-this.tx*this.d)*r,t.y=this.a*r*i+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,t},e.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},e.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},e.prototype.rotate=function(e){var t=Math.cos(e),r=Math.sin(e),n=this.a,i=this.c,o=this.tx;return this.a=n*t-this.b*r,this.b=n*r+this.b*t,this.c=i*t-this.d*r,this.d=i*r+this.d*t,this.tx=o*t-this.ty*r,this.ty=o*r+this.ty*t,this},e.prototype.append=function(e){var t=this.a,r=this.b,n=this.c,i=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*r+e.b*i,this.c=e.c*t+e.d*n,this.d=e.c*r+e.d*i,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*r+e.ty*i+this.ty,this},e.prototype.setTransform=function(e,t,r,n,i,o,a,s,u){return this.a=Math.cos(a+u)*i,this.b=Math.sin(a+u)*i,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=e-(r*this.a+n*this.c),this.ty=t-(r*this.b+n*this.d),this},e.prototype.prepend=function(e){var t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){var r=this.a,n=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},e.prototype.decompose=function(e){var t=this.a,r=this.b,n=this.c,i=this.d,a=e.pivot,s=-Math.atan2(-n,i),u=Math.atan2(r,t),l=Math.abs(s+u);return l<1e-5||Math.abs(o-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=s,e.skew.y=u),e.scale.x=Math.sqrt(t*t+r*r),e.scale.y=Math.sqrt(n*n+i*i),e.position.x=this.tx+(a.x*t+a.y*n),e.position.y=this.ty+(a.x*r+a.y*i),e},e.prototype.invert=function(){var e=this.a,t=this.b,r=this.c,n=this.d,i=this.tx,o=e*n-t*r;return this.a=n/o,this.b=-t/o,this.c=-r/o,this.d=e/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(e*this.ty-t*i)/o,this},e.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},e.prototype.clone=function(){var t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},e.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},e.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},e.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(e,"IDENTITY",{get:function(){return new e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"TEMP_MATRIX",{get:function(){return new e},enumerable:!1,configurable:!0}),e}(),m=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],y=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],_=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],b=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],x=[],w=[],S=Math.sign;!function(){for(var e=0;e<16;e++){var t=[];x.push(t);for(var r=0;r<16;r++)for(var n=S(m[e]*m[r]+_[e]*y[r]),i=S(y[e]*m[r]+b[e]*y[r]),o=S(m[e]*_[r]+_[e]*b[r]),a=S(y[e]*_[r]+b[e]*b[r]),s=0;s<16;s++)if(m[s]===n&&y[s]===i&&_[s]===o&&b[s]===a){t.push(s);break}}for(e=0;e<16;e++){var u=new g;u.set(m[e],y[e],_[e],b[e],0,0),w.push(u)}}();var T={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(e){return m[e]},uY:function(e){return y[e]},vX:function(e){return _[e]},vY:function(e){return b[e]},inv:function(e){return 8&e?15&e:7&-e},add:function(e,t){return x[e][t]},sub:function(e,t){return x[e][T.inv(t)]},rotate180:function(e){return 4^e},isVertical:function(e){return 2==(3&e)},byDirection:function(e,t){return 2*Math.abs(e)<=Math.abs(t)?t>=0?T.S:T.N:2*Math.abs(t)<=Math.abs(e)?e>0?T.E:T.W:t>0?e>0?T.SE:T.SW:e>0?T.NE:T.NW},matrixAppendRotationInv:function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=w[T.inv(t)];i.tx=r,i.ty=n,e.append(i)}},M=function(){function e(){this.worldTransform=new g,this.localTransform=new g,this.position=new v(this.onChange,this,0,0),this.scale=new v(this.onChange,this,1,1),this.pivot=new v(this.onChange,this,0,0),this.skew=new v(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return e.prototype.onChange=function(){this._localID++},e.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},e.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},e.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},e.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var r=e.worldTransform,n=this.worldTransform;n.a=t.a*r.a+t.b*r.c,n.b=t.a*r.b+t.b*r.d,n.c=t.c*r.a+t.d*r.c,n.d=t.c*r.b+t.d*r.d,n.tx=t.tx*r.a+t.ty*r.c+r.tx,n.ty=t.tx*r.b+t.ty*r.d+r.ty,this._parentID=e._worldID,this._worldID++}},e.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(e.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),e.IDENTITY=new e,e}()},function(e,t,r){r.d(t,"a",(function(){return nt})),r.d(t,"b",(function(){return A})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return ct})),r.d(t,"e",(function(){return vt})),r.d(t,"f",(function(){return yt})),r.d(t,"g",(function(){return ht})),r.d(t,"h",(function(){return z})),r.d(t,"i",(function(){return v})),r.d(t,"j",(function(){return x})),r.d(t,"k",(function(){return Ne})),r.d(t,"l",(function(){return G})),r.d(t,"m",(function(){return K})),r.d(t,"n",(function(){return Ae})),r.d(t,"o",(function(){return H})),r.d(t,"p",(function(){return R})),r.d(t,"q",(function(){return at})),r.d(t,"r",(function(){return Ce})),r.d(t,"s",(function(){return Pe})),r.d(t,"t",(function(){return O})),r.d(t,"u",(function(){return Re})),r.d(t,"v",(function(){return $})),r.d(t,"w",(function(){return M})),r.d(t,"x",(function(){return dt})),r.d(t,"y",(function(){return st})),r.d(t,"z",(function(){return lt})),r.d(t,"A",(function(){return ut}));var n=r(4),i=r(0),o=r(3),a=r(12),s=r(7),u=r(1); +var n,i,o=2*Math.PI,a=180/Math.PI,s=Math.PI/180;(i=n||(n={}))[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC";var u=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=0,this.y=0,this.x=e,this.y=t}return e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copyFrom=function(e){return this.set(e.x,e.y),this},e.prototype.copyTo=function(e){return e.set(this.x,this.y),e},e.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},e.prototype.set=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.x=e,this.y=t,this},e.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},e}(),l=[new u,new u,new u,new u],c=function(){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(e),this.y=Number(t),this.width=Number(r),this.height=Number(i),this.type=n.RECT}return Object.defineProperty(e.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EMPTY",{get:function(){return new e(0,0,0,0)},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this},e.prototype.copyTo=function(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},e.prototype.contains=function(e,t){return!(this.width<=0||this.height<=0)&&e>=this.x&&e=this.y&&te.right?e.right:this.right)<=r)return!1;var n=this.ye.bottom?e.bottom:this.bottom)>n}var i=this.left,o=this.right,a=this.top,s=this.bottom;if(o<=i||s<=a)return!1;var u=l[0].set(e.left,e.top),c=l[1].set(e.left,e.bottom),h=l[2].set(e.right,e.top),d=l[3].set(e.right,e.bottom);if(h.x<=u.x||c.y<=u.y)return!1;var f=Math.sign(t.a*t.d-t.b*t.c);if(0===f)return!1;if(t.apply(u,u),t.apply(c,c),t.apply(h,h),t.apply(d,d),Math.max(u.x,c.x,h.x,d.x)<=i||Math.min(u.x,c.x,h.x,d.x)>=o||Math.max(u.y,c.y,h.y,d.y)<=a||Math.min(u.y,c.y,h.y,d.y)>=s)return!1;var p=f*(c.y-u.y),v=f*(u.x-c.x),g=p*i+v*a,m=p*o+v*a,y=p*i+v*s,_=p*o+v*s;if(Math.max(g,m,y,_)<=p*u.x+v*u.y||Math.min(g,m,y,_)>=p*d.x+v*d.y)return!1;var b=f*(u.y-h.y),x=f*(h.x-u.x),w=b*i+x*a,S=b*o+x*a,T=b*i+x*s,M=b*o+x*s;return!(Math.max(w,S,T,M)<=b*u.x+x*u.y||Math.min(w,S,T,M)>=b*d.x+x*d.y)},e.prototype.pad=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.x-=e,this.y-=t,this.width+=2*e,this.height+=2*t,this},e.prototype.fit=function(e){var t=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(r-t,0),this.y=n,this.height=Math.max(i-n,0),this},e.prototype.ceil=function(e,t){void 0===e&&(e=1),void 0===t&&(t=.001);var r=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=r-this.x,this.height=n-this.y,this},e.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=r-t,this.y=n,this.height=i-n,this},e.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),h=function(){function e(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),this.x=e,this.y=t,this.radius=r,this.type=n.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(e,t){if(this.radius<=0)return!1;var r=this.radius*this.radius,n=this.x-e,i=this.y-t;return(n*=n)+(i*=i)<=r},e.prototype.getBounds=function(){return new c(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},e.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},e}(),d=function(){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=e,this.y=t,this.width=r,this.height=i,this.type=n.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var r=(e-this.x)/this.width,n=(t-this.y)/this.height;return(r*=r)+(n*=n)<=1},e.prototype.getBounds=function(){return new c(this.x-this.width,this.y-this.height,this.width,this.height)},e.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),f=function(){function e(){for(var e=arguments,t=[],r=0;rt!=l>t&&e<(t-s)/(l-s)*(u-a)+a&&(r=!r)}return r},e.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(e,t){return e+", "+t}),"")+"]"},e}(),p=function(){function e(e,t,r,i,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=20),this.x=e,this.y=t,this.width=r,this.height=i,this.radius=o,this.type=n.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+r&&t<=this.y+this.height-r||e>=this.x+r&&e<=this.x+this.width-r)return!0;var n=e-(this.x+r),i=t-(this.y+r),o=r*r;if(n*n+i*i<=o)return!0;if((n=e-(this.x+this.width-r))*n+i*i<=o)return!0;if(n*n+(i=t-(this.y+this.height-r))*i<=o)return!0;if((n=e-(this.x+r))*n+i*i<=o)return!0}return!1},e.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},e}(),v=function(){function e(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this._x=r,this._y=n,this.cb=e,this.scope=t}return e.prototype.clone=function(t,r){return void 0===t&&(t=this.cb),void 0===r&&(r=this.scope),new e(t,r,this._x,this._y)},e.prototype.set=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this._x===e&&this._y===t||(this._x=e,this._y=t,this.cb.call(this.scope)),this},e.prototype.copyFrom=function(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},e.prototype.copyTo=function(e){return e.set(this._x,this._y),e},e.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},e.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),e}(),g=function(){function e(e,t,r,n,i,o){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===i&&(i=0),void 0===o&&(o=0),this.array=null,this.a=e,this.b=t,this.c=r,this.d=n,this.tx=i,this.ty=o}return e.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},e.prototype.set=function(e,t,r,n,i,o){return this.a=e,this.b=t,this.c=r,this.d=n,this.tx=i,this.ty=o,this},e.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var r=t||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},e.prototype.apply=function(e,t){t=t||new u;var r=e.x,n=e.y;return t.x=this.a*r+this.c*n+this.tx,t.y=this.b*r+this.d*n+this.ty,t},e.prototype.applyInverse=function(e,t){t=t||new u;var r=1/(this.a*this.d+this.c*-this.b),n=e.x,i=e.y;return t.x=this.d*r*n+-this.c*r*i+(this.ty*this.c-this.tx*this.d)*r,t.y=this.a*r*i+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,t},e.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},e.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},e.prototype.rotate=function(e){var t=Math.cos(e),r=Math.sin(e),n=this.a,i=this.c,o=this.tx;return this.a=n*t-this.b*r,this.b=n*r+this.b*t,this.c=i*t-this.d*r,this.d=i*r+this.d*t,this.tx=o*t-this.ty*r,this.ty=o*r+this.ty*t,this},e.prototype.append=function(e){var t=this.a,r=this.b,n=this.c,i=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*r+e.b*i,this.c=e.c*t+e.d*n,this.d=e.c*r+e.d*i,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*r+e.ty*i+this.ty,this},e.prototype.setTransform=function(e,t,r,n,i,o,a,s,u){return this.a=Math.cos(a+u)*i,this.b=Math.sin(a+u)*i,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=e-(r*this.a+n*this.c),this.ty=t-(r*this.b+n*this.d),this},e.prototype.prepend=function(e){var t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){var r=this.a,n=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},e.prototype.decompose=function(e){var t=this.a,r=this.b,n=this.c,i=this.d,a=e.pivot,s=-Math.atan2(-n,i),u=Math.atan2(r,t),l=Math.abs(s+u);return l<1e-5||Math.abs(o-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=s,e.skew.y=u),e.scale.x=Math.sqrt(t*t+r*r),e.scale.y=Math.sqrt(n*n+i*i),e.position.x=this.tx+(a.x*t+a.y*n),e.position.y=this.ty+(a.x*r+a.y*i),e},e.prototype.invert=function(){var e=this.a,t=this.b,r=this.c,n=this.d,i=this.tx,o=e*n-t*r;return this.a=n/o,this.b=-t/o,this.c=-r/o,this.d=e/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(e*this.ty-t*i)/o,this},e.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},e.prototype.clone=function(){var t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},e.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},e.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},e.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(e,"IDENTITY",{get:function(){return new e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"TEMP_MATRIX",{get:function(){return new e},enumerable:!1,configurable:!0}),e}(),m=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],y=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],_=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],b=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],x=[],w=[],S=Math.sign;!function(){for(var e=0;e<16;e++){var t=[];x.push(t);for(var r=0;r<16;r++)for(var n=S(m[e]*m[r]+_[e]*y[r]),i=S(y[e]*m[r]+b[e]*y[r]),o=S(m[e]*_[r]+_[e]*b[r]),a=S(y[e]*_[r]+b[e]*b[r]),s=0;s<16;s++)if(m[s]===n&&y[s]===i&&_[s]===o&&b[s]===a){t.push(s);break}}for(e=0;e<16;e++){var u=new g;u.set(m[e],y[e],_[e],b[e],0,0),w.push(u)}}();var T={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(e){return m[e]},uY:function(e){return y[e]},vX:function(e){return _[e]},vY:function(e){return b[e]},inv:function(e){return 8&e?15&e:7&-e},add:function(e,t){return x[e][t]},sub:function(e,t){return x[e][T.inv(t)]},rotate180:function(e){return 4^e},isVertical:function(e){return 2==(3&e)},byDirection:function(e,t){return 2*Math.abs(e)<=Math.abs(t)?t>=0?T.S:T.N:2*Math.abs(t)<=Math.abs(e)?e>0?T.E:T.W:t>0?e>0?T.SE:T.SW:e>0?T.NE:T.NW},matrixAppendRotationInv:function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=w[T.inv(t)];i.tx=r,i.ty=n,e.append(i)}},M=function(){function e(){this.worldTransform=new g,this.localTransform=new g,this.position=new v(this.onChange,this,0,0),this.scale=new v(this.onChange,this,1,1),this.pivot=new v(this.onChange,this,0,0),this.skew=new v(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return e.prototype.onChange=function(){this._localID++},e.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},e.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},e.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},e.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var r=e.worldTransform,n=this.worldTransform;n.a=t.a*r.a+t.b*r.c,n.b=t.a*r.b+t.b*r.d,n.c=t.c*r.a+t.d*r.c,n.d=t.c*r.b+t.d*r.d,n.tx=t.tx*r.a+t.ty*r.c+r.tx,n.ty=t.tx*r.b+t.ty*r.d+r.ty,this._parentID=e._worldID,this._worldID++}},e.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(e.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),e.IDENTITY=new e,e}()},function(e,t,r){r.d(t,"a",(function(){return nt})),r.d(t,"b",(function(){return I})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return ct})),r.d(t,"e",(function(){return vt})),r.d(t,"f",(function(){return yt})),r.d(t,"g",(function(){return ht})),r.d(t,"h",(function(){return z})),r.d(t,"i",(function(){return v})),r.d(t,"j",(function(){return x})),r.d(t,"k",(function(){return Ne})),r.d(t,"l",(function(){return G})),r.d(t,"m",(function(){return K})),r.d(t,"n",(function(){return Ie})),r.d(t,"o",(function(){return H})),r.d(t,"p",(function(){return R})),r.d(t,"q",(function(){return at})),r.d(t,"r",(function(){return Ce})),r.d(t,"s",(function(){return Pe})),r.d(t,"t",(function(){return O})),r.d(t,"u",(function(){return Re})),r.d(t,"v",(function(){return $})),r.d(t,"w",(function(){return M})),r.d(t,"x",(function(){return dt})),r.d(t,"y",(function(){return st})),r.d(t,"z",(function(){return lt})),r.d(t,"A",(function(){return ut}));var n=r(4),i=r(0),o=r(3),a=r(12),s=r(7),u=r(1); /*! * @pixi/core - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -35,14 +35,14 @@ var n,i,o=2*Math.PI,a=180/Math.PI,s=Math.PI/180;(i=n||(n={}))[i.POLY=0]="POLY",i See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. - ***************************************************************************** */var h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function d(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var f=function(){return(f=Object.assign||function(e){for(var t,r=arguments,n=1,i=arguments.length;n0&&f>0,a.textureCacheIds=[],a.destroyed=!1,a.resource=null,a._batchEnabled=0,a._batchLocation=0,a.parentTextureArray=null,a.setResource(t),a}return d(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var r;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)},t.prototype.setRealSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Object(o.isPow2)(this.realWidth)&&Object(o.isPow2)(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete o.BaseTextureCache[this.cacheId],delete o.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,r,i){void 0===i&&(i=n.b.STRICT_TEXTURE_CACHE);var a="string"==typeof e,s=null;if(a)s=e;else{if(!e._pixiId){var u=r&&r.pixiIdPrefix||"pixiid";e._pixiId=u+"_"+Object(o.uid)()}s=e._pixiId}var l=o.BaseTextureCache[s];if(a&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||((l=new t(e,r)).cacheId=s,t.addToCache(l,s)),l},t.fromBuffer=function(e,r,n,o){e=e||new Float32Array(r*n*4);var a=new v(e,{width:r,height:n}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(g,o||{width:r,height:n,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),o.BaseTextureCache[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),o.BaseTextureCache[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=o.BaseTextureCache[e];if(t){var r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete o.BaseTextureCache[e],t}}else if(e&&e.textureCacheIds){for(var n=0;n0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,r,n){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(b),M=function(e){function t(r,n){var i=this;if(n=n||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var a=r[0].src||r[0];b.crossOrigin(o,a,n.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(r)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(b),k=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(b);l.push(S,k,x,M,T,v,w,_);var E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.upload=function(e,t,r){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return r.width===o&&r.height===a?n.texSubImage2D(t.target,0,0,0,o,a,t.format,r.type,this.data):(r.width=o,r.height=a,n.texImage2D(t.target,0,r.internalFormat,o,a,0,t.format,r.type,this.data)),!0},t}(v),I=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new a.a("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new m(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new m(new E(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&t.textureCacheIds.splice(r,1),delete o.TextureCache[e],t}}else if(e&&e.textureCacheIds){for(var n=0;nthis.baseTexture.width,a=r+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+n+" = "+(t+n)+" > "+this.baseTexture.width,l="Y: "+r+" + "+i+" = "+(r+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=n&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new m),N(t._EMPTY),N(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),t._WHITE=new t(new m(new x(e))),N(t._WHITE),N(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(o.EventEmitter),R=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return d(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,r){void 0===r&&(r=!0);var n=this.baseTexture.resolution,i=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var r=arguments,n=[],i=1;i1?-n:-1:(a=((65535&(e=Object(o.nextPow2)(e)))<<16|65535&(t=Object(o.nextPow2)(t)))>>>0,n>1&&(a+=4294967296*n)),this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(e,t,n)),s.filterPoolKey=a,s.setResolution(r),s},e.prototype.getFilterTexture=function(e,t,r){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var r=this.texturePool[t];if(r)for(var n=0;n0&&e.height>0,this.texturePool)if(Number(t)<0){var r=this.texturePool[t];if(r)for(var n=0;n1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),r[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}r[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var r=this.renderer,n=r.renderTexture,o=r.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,n.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,r,n){var o=this.renderer;o.state.set(e.state),this.bindAndClear(r,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var r=this.activeState,n=r.sourceFrame,i=r.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,n.x,n.y),s=t.worldTransform.copyTo(u.d.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,r,n){return void 0===r&&(r=1),void 0===n&&(n=i.l.NONE),this.texturePool.getOptimalTexture(e,t,r,n)},e.prototype.getFilterTexture=function(e,t,r){if("number"==typeof e){var n=e;e=t,t=n}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var r=q[0],n=q[1],i=q[2],o=q[3];r.set(t.left,t.top),n.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(r,r),e.apply(n,n),e.apply(i,i),e.apply(o,o);var a=Math.min(r.x,n.x,i.x,o.x),s=Math.min(r.y,n.y,i.y,o.y),u=Math.max(r.x,n.x,i.x,o.x),l=Math.max(r.y,n.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,r,n,i){if(!(e.width<=0||e.height<=0||r.width<=0||r.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?Q.copyFrom(i):Q.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),K=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),J=function(){function e(e){this.renderer=e,this.emptyRenderer=new K(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var r=this.renderer.texture.boundTextures,n=t-1;n>=0;--n)e[n]=r[n]||null,e[n]&&(e[n]._batchLocation=n)},e.prototype.boundArray=function(e,t,r,n){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(r=e.getContext("webgl2",t)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=r||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),re=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ne=new u.j,ie=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new I(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new u.j,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;n.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,r=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,r){void 0===r&&(r=0);var n=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==r&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=r),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,r)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>r,u=t.height>>r,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>r,u=e.height>>r,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,r,n){var i=this.viewport;e=Math.round(e),t=Math.round(t),r=Math.round(r),n=Math.round(n),i.width===r&&i.height===n&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=r,i.height=n,this.gl.viewport(e,t,r,n))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,r,n,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,r,n),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,r=new re(t.createFramebuffer());return r.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(e),e.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(e){var t=this.gl,r=e.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,r.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.RGBA8,e.width,e.height)),r.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),r.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var n=e.colorTextures,i=n.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(n.msaaBuffer=n.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.RGBA8,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(r.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a=[],s=0;s1&&r.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?n.stencil&&(r.deleteRenderbuffer(n.stencil),n.stencil=null):(n.stencil=n.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,n.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,r=i.l.NONE;if(e<=1||null===t)return r;for(var n=0;n=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&n.deleteRenderbuffer(r.msaaBuffer),r.stencil&&n.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r0&&(t+="\nelse "),r=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),pe=t}return pe}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);de=t.precision?i.m.HIGH:i.m.MEDIUM}}return de}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,r,n){var i=t+r,a=o.ProgramCache[i];return a||(o.ProgramCache[i]=a=new e(t,r,n)),a},e}(),Ce=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof $?t:new $(t):new $({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var r in t.uniforms){var n=t.uniforms[r];if(n.group&&this.checkUniformExists(e,n))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,r,n){return new e(Ae.from(t,r),n)},e}(),Pe=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),Ne=function(e){function t(r,i,o){var a=this,s=Ae.from(r||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=n.b.FILTER_RESOLUTION,a.multisample=n.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new Pe,a}return d(t,e),t.prototype.apply=function(e,t,r,n,i){e.applyFilter(this,t,r,n)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(Ce),Oe=new u.d,Re=function(){function e(e,t){this._texture=e,this.mapCoord=new u.d,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var r=this.mapCoord,n=0;n1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var r=e.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(t.isMatrixRotated(r.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,r,n,i,o){t.isMatrixRotated(o)||((o=o?ze.copyFrom(o):ze.identity()).translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}(je),Fe=function(e){function t(t){var r=e.call(this,t)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return d(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,r=this.renderer.gl,n=e._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),e._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,n,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(je),Ue=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new u.d,this.transform=null}return e.prototype.update=function(e,t,r,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,n),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,r,n){var i=this.projectionMatrix,o=n?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),We=new u.j,Ge=new u.j,Ve=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new u.j,this.destinationFrame=new u.j,this.viewportFrame=new u.j}return e.prototype.bind=function(e,t,r){void 0===e&&(e=null);var n,i,o,a=this.renderer;this.current=e,e?(o=(n=e.baseTexture).resolution,t||(We.width=e.frame.width,We.height=e.frame.height,t=We),r||(Ge.x=e.frame.x,Ge.y=e.frame.y,Ge.width=t.width,Ge.height=t.height,r=Ge),i=n.framebuffer):(o=a.resolution,t||(We.width=a.screen.width,We.height=a.screen.height,t=We),r||((r=We).width=t.width,r.height=t.height));var s=this.viewportFrame;s.x=r.x*o,s.y=r.y*o,s.width=r.width*o,s.height=r.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(r,t,o,!i),e?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(r)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var r=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,i=r.width!==n.width||r.height!==n.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function He(e,t,r,n,i){r.buffer.update(i)}var Ye={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},$e={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var Xe=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var qe=0,Qe={textureCount:0,uboCount:0},Ze=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=qe++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof xe)return xe;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");xe=!0===e({a:"b"},"a","b")}catch(e){xe=!1}return xe}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var r=e.program,n=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==r&&(this.program=r,this.gl.useProgram(n.program)),t||(Qe.textureCount=0,Qe.uboCount=0,this.syncUniformGroup(e.uniformGroup,Qe)),n},e.prototype.setUniforms=function(e){var t=this.shader.program,r=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(r.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var r=this.getGlProgram();e.static&&e.dirtyId===r.uniformDirtyGroups[e.id]||(r.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,r,t))},e.prototype.syncUniforms=function(e,t,r){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,r)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var r,n=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!=0&&n<16){var s=n%r%16;n+=s,i+=s}n+r>16?(i=16*Math.ceil(i/16),a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var r=[];for(var n in e)t[n]&&r.push(t[n]);return r.sort((function(e,t){return e.index-t.index})),r}(e.uniforms,t)),n=r.uboElements,i=r.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=me(s.data.type),p=Math.max($e[s.data.type]/16,1),v=f/p,g=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+g+";\n }\n\n ")}else{var m=Ye[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+m+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,r){var n=e.uniforms,i=[r+"-"];for(var o in n)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,r=e.program,n=function(e,t){var r,n,i,o,a=ue(e,e.VERTEX_SHADER,t.vertexSrc),s=ue(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(n=u,i=a,o=s,(r=e).getProgramParameter(n,r.LINK_STATUS)||(r.getShaderParameter(i,r.COMPILE_STATUS)||le(r,i),r.getShaderParameter(o,r.COMPILE_STATUS)||le(r,o),console.error("PixiJS Error: Could not initialize shader."),""!==r.getProgramInfoLog(n)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(n)))),t.attributeData=function(e,t){for(var r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,r++;this.stateId=e.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,r=!1,n=0;nthis.maxIdle&&(e.destroyTexture(i,!0),t[n]=null,r=!0)}if(r){var o=0;for(n=0;n=0;n--)this.unload(e.children[n])},e.prototype.destroy=function(){this.renderer=null},e}(),et=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},tt=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new m,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,r,n,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=M,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((r={})[i.h.RGBA]=e.RGBA8,r[i.h.RGB]=e.RGB8,r[i.h.RG]=e.RG8,r[i.h.RED]=e.R8,r[i.h.RGBA_INTEGER]=e.RGBA8UI,r[i.h.RGB_INTEGER]=e.RGB8UI,r[i.h.RG_INTEGER]=e.RG8UI,r[i.h.RED_INTEGER]=e.R8UI,r[i.h.ALPHA]=e.ALPHA,r[i.h.LUMINANCE]=e.LUMINANCE,r[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,r),t[i.r.BYTE]=((n={})[i.h.RGBA]=e.RGBA8_SNORM,n[i.h.RGB]=e.RGB8_SNORM,n[i.h.RG]=e.RG8_SNORM,n[i.h.RED]=e.R8_SNORM,n[i.h.RGBA_INTEGER]=e.RGBA8I,n[i.h.RGB_INTEGER]=e.RGB8I,n[i.h.RG_INTEGER]=e.RG8I,n[i.h.RED_INTEGER]=e.R8I,n),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((g={})[i.h.RGB]=e.RGB9_E5,g),t[i.r.UNSIGNED_INT_24_8]=((m={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,m),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),T=t):((_={})[i.r.UNSIGNED_BYTE]=((b={})[i.h.RGBA]=e.RGBA,b[i.h.RGB]=e.RGB,b[i.h.ALPHA]=e.ALPHA,b[i.h.LUMINANCE]=e.LUMINANCE,b[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,b),_[i.r.UNSIGNED_SHORT_5_6_5]=((x={})[i.h.RGB]=e.RGB,x),_[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),_[i.r.UNSIGNED_SHORT_5_5_5_1]=((S={})[i.h.RGBA]=e.RGBA,S),T=_),T);var k=M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=k;for(var E=0;E=0;--o){var a=t[o];a&&a._glTextures[n].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new et(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var r,n;t.internalFormat=null!==(n=null===(r=this.internalFormats[e.type])||void 0===r?void 0:r[e.format])&&void 0!==n?n:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var r=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(r,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,o=e.realHeight,a=r.gl;(t.width!==n||t.height!==o||t.dirtyId<0)&&(t.width=n,t.height=o,a.texImage2D(e.target,0,t.internalFormat,n,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var r=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),r.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var n=this.managedTextures.indexOf(e);-1!==n&&Object(o.removeItems)(this.managedTextures,n,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==i.k.POW2&&2===this.webGLVersion||e.isPowerOfTwo?t.mipmap=e.mipmap>=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var r=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&r.generateMipmap(e.target),r.texParameteri(e.target,r.TEXTURE_WRAP_S,t.wrapMode),r.texParameteri(e.target,r.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(e.target,r.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),rt=new u.d,nt=function(e){function t(t,r){void 0===t&&(t=i.n.UNKNOWN);var a=e.call(this)||this;return r=Object.assign({},n.b.RENDER_OPTIONS,r),a.options=r,a.type=t,a.screen=new u.j(0,0,r.width,r.height),a.view=r.view||document.createElement("canvas"),a.resolution=r.resolution||n.b.RESOLUTION,a.useContextAlpha=r.useContextAlpha,a.autoDensity=!!r.autoDensity,a.preserveDrawingBuffer=r.preserveDrawingBuffer,a.clearBeforeRender=r.clearBeforeRender,a._backgroundColor=0,a._backgroundColorRgba=[0,0,0,1],a._backgroundColorString="#000000",a.backgroundColor=r.backgroundColor||a._backgroundColor,a.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&(Object(o.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),a.useContextAlpha=r.transparent,a.backgroundAlpha=r.transparent?0:1),a._lastObjectRendered=null,a.plugins={},a}return d(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var r=this.view.width/this.resolution,n=this.view.height/this.resolution;this.screen.width=r,this.screen.height=n,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=n+"px"),this.emit("resize",r,n)},t.prototype.generateTexture=function(e,t,r,n){void 0===t&&(t={}),"number"==typeof t&&(Object(o.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:r,region:n});var i=t.region,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),r=0;r=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var r=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var n in this[t]=r,this.runners)this.runners[n].add(r);return this},t.prototype.render=function(e,t){var r,n,i,a;if(t&&(t instanceof R?(Object(o.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),r=t,n=arguments[2],i=arguments[3],a=arguments[4]):(r=t.renderTexture,n=t.clear,i=t.transform,a=t.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(r||(this._lastObjectRendered=e),!a){var s=e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==n?n:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,r,n,i){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,n,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return Object(o.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,r){t.__plugins=t.__plugins||{},t.__plugins[e]=r},t}(nt);function st(e){return at.create(e)}var ut="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",lt="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",ct=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},ht=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,r=this.MAX_TEXTURES,n=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++m._globalBatch,u=0,l=n[0],c=0;i.copyBoundTextures(o,r);for(var h=0;h=r&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,h),c=h,l=n[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h0&&(t+="\nelse "),r-1){var r=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");d=!0}}function v(){return void 0===h&&(h=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:n.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!r||!r.getContextAttributes().stencil);if(r){var o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,i}catch(e){return!1}}()),h}var g={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",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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",rebeccapurple:"#663399",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"};function m(e,t){return void 0===t&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function y(e){var t=e.toString(16);return"#"+("000000".substring(0,6-t.length)+t)}function _(e){return"string"==typeof e&&"#"===(e=g[e.toLowerCase()]||e)[0]&&(e=e.slice(1)),parseInt(e,16)}function b(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}var x=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[l.b.NORMAL_NPM]=l.b.NORMAL,e[l.b.ADD_NPM]=l.b.ADD,e[l.b.SCREEN_NPM]=l.b.SCREEN,t[l.b.NORMAL]=l.b.NORMAL_NPM,t[l.b.ADD]=l.b.ADD_NPM,t[l.b.SCREEN]=l.b.SCREEN_NPM;var n=[];return n.push(t),n.push(e),n}();function w(e,t){return x[t?1:0][e]}function S(e,t,r,n){return r=r||new Float32Array(4),n||void 0===n?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=t,r}function T(e,t){if(1===t)return(255*t<<24)+e;if(0===t)return 0;var r=e>>16&255,n=e>>8&255,i=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((n=n*t+.5|0)<<8)+(i*t+.5|0)}function M(e,t,r,n){return(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(n||void 0===n)&&(r[0]*=t,r[1]*=t,r[2]*=t),r[3]=t,r}function k(e,t){void 0===t&&(t=null);var r=6*e;if((t=t||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+r);for(var n=0,i=0;n>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)}function P(e){return!(e&e-1||!e)}function N(e){var t=(e>65535?1:0)<<4,r=((e>>>=t)>255?1:0)<<3;return t|=r,t|=r=((e>>>=r)>15?1:0)<<2,(t|=r=((e>>>=r)>3?1:0)<<1)|(e>>>=r)>>1}function O(e,t,r){var n,i=e.length;if(!(t>=i||0===r)){var o=i-(r=t+r>i?i-t:r);for(n=t;n1&&"undefined"==typeof MSStream},B=function(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=t.userAgent,n=r.split("[FBAN");void 0!==n[1]&&(r=n[0]),void 0!==(n=r.split("Twitter"))[1]&&(r=n[0]);var i,o=(i=r,function(e){return e.test(i)}),a={apple:{phone:o(S)&&!o(P),ipod:o(T),tablet:!o(S)&&(o(M)||z(t))&&!o(P),universal:o(k),device:(o(S)||o(T)||o(M)||o(k)||z(t))&&!o(P)},amazon:{phone:o(A),tablet:!o(A)&&o(C),device:o(A)||o(C)},android:{phone:!o(P)&&o(A)||!o(P)&&o(E),tablet:!o(P)&&!o(A)&&!o(E)&&(o(C)||o(I)),device:!o(P)&&(o(A)||o(C)||o(E)||o(I))||o(/\bokhttp\b/i)},windows:{phone:o(P),tablet:o(N),device:o(P)||o(N)},other:{blackberry:o(O),blackberry10:o(R),opera:o(D),firefox:o(j),chrome:o(L),device:o(O)||o(R)||o(D)||o(j)||o(L)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}(globalThis.navigator); + ***************************************************************************** */var h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function d(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var f=function(){return(f=Object.assign||function(e){for(var t,r=arguments,n=1,i=arguments.length;n0&&f>0,a.textureCacheIds=[],a.destroyed=!1,a.resource=null,a._batchEnabled=0,a._batchLocation=0,a.parentTextureArray=null,a.setResource(t),a}return d(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var r;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)},t.prototype.setRealSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Object(o.isPow2)(this.realWidth)&&Object(o.isPow2)(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete o.BaseTextureCache[this.cacheId],delete o.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,r,i){void 0===i&&(i=n.b.STRICT_TEXTURE_CACHE);var a="string"==typeof e,s=null;if(a)s=e;else{if(!e._pixiId){var u=r&&r.pixiIdPrefix||"pixiid";e._pixiId=u+"_"+Object(o.uid)()}s=e._pixiId}var l=o.BaseTextureCache[s];if(a&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||((l=new t(e,r)).cacheId=s,t.addToCache(l,s)),l},t.fromBuffer=function(e,r,n,o){e=e||new Float32Array(r*n*4);var a=new v(e,{width:r,height:n}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(g,o||{width:r,height:n,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),o.BaseTextureCache[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),o.BaseTextureCache[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=o.BaseTextureCache[e];if(t){var r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete o.BaseTextureCache[e],t}}else if(e&&e.textureCacheIds){for(var n=0;n0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,r,n){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(b),M=function(e){function t(r,n){var i=this;if(n=n||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var a=r[0].src||r[0];b.crossOrigin(o,a,n.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(r)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(b),k=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(b);l.push(S,k,x,M,T,v,w,_);var E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.upload=function(e,t,r){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return r.width===o&&r.height===a?n.texSubImage2D(t.target,0,0,0,o,a,t.format,r.type,this.data):(r.width=o,r.height=a,n.texImage2D(t.target,0,r.internalFormat,o,a,0,t.format,r.type,this.data)),!0},t}(v),A=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new a.a("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new m(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new m(new E(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&t.textureCacheIds.splice(r,1),delete o.TextureCache[e],t}}else if(e&&e.textureCacheIds){for(var n=0;nthis.baseTexture.width,a=r+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+n+" = "+(t+n)+" > "+this.baseTexture.width,l="Y: "+r+" + "+i+" = "+(r+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=n&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new m),N(t._EMPTY),N(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),t._WHITE=new t(new m(new x(e))),N(t._WHITE),N(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(o.EventEmitter),R=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return d(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,r){void 0===r&&(r=!0);var n=this.baseTexture.resolution,i=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var r=arguments,n=[],i=1;i1?-n:-1:(a=((65535&(e=Object(o.nextPow2)(e)))<<16|65535&(t=Object(o.nextPow2)(t)))>>>0,n>1&&(a+=4294967296*n)),this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(e,t,n)),s.filterPoolKey=a,s.setResolution(r),s},e.prototype.getFilterTexture=function(e,t,r){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var r=this.texturePool[t];if(r)for(var n=0;n0&&e.height>0,this.texturePool)if(Number(t)<0){var r=this.texturePool[t];if(r)for(var n=0;n1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),r[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}r[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var r=this.renderer,n=r.renderTexture,o=r.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,n.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,r,n){var o=this.renderer;o.state.set(e.state),this.bindAndClear(r,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var r=this.activeState,n=r.sourceFrame,i=r.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,n.x,n.y),s=t.worldTransform.copyTo(u.d.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,r,n){return void 0===r&&(r=1),void 0===n&&(n=i.l.NONE),this.texturePool.getOptimalTexture(e,t,r,n)},e.prototype.getFilterTexture=function(e,t,r){if("number"==typeof e){var n=e;e=t,t=n}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var r=q[0],n=q[1],i=q[2],o=q[3];r.set(t.left,t.top),n.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(r,r),e.apply(n,n),e.apply(i,i),e.apply(o,o);var a=Math.min(r.x,n.x,i.x,o.x),s=Math.min(r.y,n.y,i.y,o.y),u=Math.max(r.x,n.x,i.x,o.x),l=Math.max(r.y,n.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,r,n,i){if(!(e.width<=0||e.height<=0||r.width<=0||r.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?Q.copyFrom(i):Q.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),K=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),J=function(){function e(e){this.renderer=e,this.emptyRenderer=new K(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var r=this.renderer.texture.boundTextures,n=t-1;n>=0;--n)e[n]=r[n]||null,e[n]&&(e[n]._batchLocation=n)},e.prototype.boundArray=function(e,t,r,n){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(r=e.getContext("webgl2",t)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=r||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),re=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ne=new u.j,ie=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new A(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new u.j,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;n.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,r=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,r){void 0===r&&(r=0);var n=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==r&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=r),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,r)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>r,u=t.height>>r,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>r,u=e.height>>r,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,r,n){var i=this.viewport;e=Math.round(e),t=Math.round(t),r=Math.round(r),n=Math.round(n),i.width===r&&i.height===n&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=r,i.height=n,this.gl.viewport(e,t,r,n))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,r,n,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,r,n),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,r=new re(t.createFramebuffer());return r.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(e),e.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(e){var t=this.gl,r=e.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,r.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.RGBA8,e.width,e.height)),r.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),r.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var n=e.colorTextures,i=n.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(n.msaaBuffer=n.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.RGBA8,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(r.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a=[],s=0;s1&&r.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?n.stencil&&(r.deleteRenderbuffer(n.stencil),n.stencil=null):(n.stencil=n.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,n.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,r=i.l.NONE;if(e<=1||null===t)return r;for(var n=0;n=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&n.deleteRenderbuffer(r.msaaBuffer),r.stencil&&n.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r0&&(t+="\nelse "),r=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),pe=t}return pe}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);de=t.precision?i.m.HIGH:i.m.MEDIUM}}return de}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,r,n){var i=t+r,a=o.ProgramCache[i];return a||(o.ProgramCache[i]=a=new e(t,r,n)),a},e}(),Ce=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof $?t:new $(t):new $({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var r in t.uniforms){var n=t.uniforms[r];if(n.group&&this.checkUniformExists(e,n))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,r,n){return new e(Ie.from(t,r),n)},e}(),Pe=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),Ne=function(e){function t(r,i,o){var a=this,s=Ie.from(r||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=n.b.FILTER_RESOLUTION,a.multisample=n.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new Pe,a}return d(t,e),t.prototype.apply=function(e,t,r,n,i){e.applyFilter(this,t,r,n)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(Ce),Oe=new u.d,Re=function(){function e(e,t){this._texture=e,this.mapCoord=new u.d,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var r=this.mapCoord,n=0;n1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var r=e.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(t.isMatrixRotated(r.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,r,n,i,o){t.isMatrixRotated(o)||((o=o?ze.copyFrom(o):ze.identity()).translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}(je),Fe=function(e){function t(t){var r=e.call(this,t)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return d(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,r=this.renderer.gl,n=e._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),e._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,n,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(je),Ue=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new u.d,this.transform=null}return e.prototype.update=function(e,t,r,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,n),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,r,n){var i=this.projectionMatrix,o=n?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),We=new u.j,Ge=new u.j,Ve=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new u.j,this.destinationFrame=new u.j,this.viewportFrame=new u.j}return e.prototype.bind=function(e,t,r){void 0===e&&(e=null);var n,i,o,a=this.renderer;this.current=e,e?(o=(n=e.baseTexture).resolution,t||(We.width=e.frame.width,We.height=e.frame.height,t=We),r||(Ge.x=e.frame.x,Ge.y=e.frame.y,Ge.width=t.width,Ge.height=t.height,r=Ge),i=n.framebuffer):(o=a.resolution,t||(We.width=a.screen.width,We.height=a.screen.height,t=We),r||((r=We).width=t.width,r.height=t.height));var s=this.viewportFrame;s.x=r.x*o,s.y=r.y*o,s.width=r.width*o,s.height=r.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(r,t,o,!i),e?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(r)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var r=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,i=r.width!==n.width||r.height!==n.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function He(e,t,r,n,i){r.buffer.update(i)}var Ye={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},$e={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var Xe=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var qe=0,Qe={textureCount:0,uboCount:0},Ze=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=qe++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof xe)return xe;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");xe=!0===e({a:"b"},"a","b")}catch(e){xe=!1}return xe}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var r=e.program,n=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==r&&(this.program=r,this.gl.useProgram(n.program)),t||(Qe.textureCount=0,Qe.uboCount=0,this.syncUniformGroup(e.uniformGroup,Qe)),n},e.prototype.setUniforms=function(e){var t=this.shader.program,r=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(r.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var r=this.getGlProgram();e.static&&e.dirtyId===r.uniformDirtyGroups[e.id]||(r.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,r,t))},e.prototype.syncUniforms=function(e,t,r){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,r)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var r,n=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!=0&&n<16){var s=n%r%16;n+=s,i+=s}n+r>16?(i=16*Math.ceil(i/16),a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var r=[];for(var n in e)t[n]&&r.push(t[n]);return r.sort((function(e,t){return e.index-t.index})),r}(e.uniforms,t)),n=r.uboElements,i=r.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=me(s.data.type),p=Math.max($e[s.data.type]/16,1),v=f/p,g=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+g+";\n }\n\n ")}else{var m=Ye[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+m+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,r){var n=e.uniforms,i=[r+"-"];for(var o in n)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,r=e.program,n=function(e,t){var r,n,i,o,a=ue(e,e.VERTEX_SHADER,t.vertexSrc),s=ue(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(n=u,i=a,o=s,(r=e).getProgramParameter(n,r.LINK_STATUS)||(r.getShaderParameter(i,r.COMPILE_STATUS)||le(r,i),r.getShaderParameter(o,r.COMPILE_STATUS)||le(r,o),console.error("PixiJS Error: Could not initialize shader."),""!==r.getProgramInfoLog(n)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(n)))),t.attributeData=function(e,t){for(var r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,r++;this.stateId=e.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,r=!1,n=0;nthis.maxIdle&&(e.destroyTexture(i,!0),t[n]=null,r=!0)}if(r){var o=0;for(n=0;n=0;n--)this.unload(e.children[n])},e.prototype.destroy=function(){this.renderer=null},e}(),et=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},tt=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new m,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,r,n,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=M,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((r={})[i.h.RGBA]=e.RGBA8,r[i.h.RGB]=e.RGB8,r[i.h.RG]=e.RG8,r[i.h.RED]=e.R8,r[i.h.RGBA_INTEGER]=e.RGBA8UI,r[i.h.RGB_INTEGER]=e.RGB8UI,r[i.h.RG_INTEGER]=e.RG8UI,r[i.h.RED_INTEGER]=e.R8UI,r[i.h.ALPHA]=e.ALPHA,r[i.h.LUMINANCE]=e.LUMINANCE,r[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,r),t[i.r.BYTE]=((n={})[i.h.RGBA]=e.RGBA8_SNORM,n[i.h.RGB]=e.RGB8_SNORM,n[i.h.RG]=e.RG8_SNORM,n[i.h.RED]=e.R8_SNORM,n[i.h.RGBA_INTEGER]=e.RGBA8I,n[i.h.RGB_INTEGER]=e.RGB8I,n[i.h.RG_INTEGER]=e.RG8I,n[i.h.RED_INTEGER]=e.R8I,n),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((g={})[i.h.RGB]=e.RGB9_E5,g),t[i.r.UNSIGNED_INT_24_8]=((m={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,m),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),T=t):((_={})[i.r.UNSIGNED_BYTE]=((b={})[i.h.RGBA]=e.RGBA,b[i.h.RGB]=e.RGB,b[i.h.ALPHA]=e.ALPHA,b[i.h.LUMINANCE]=e.LUMINANCE,b[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,b),_[i.r.UNSIGNED_SHORT_5_6_5]=((x={})[i.h.RGB]=e.RGB,x),_[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),_[i.r.UNSIGNED_SHORT_5_5_5_1]=((S={})[i.h.RGBA]=e.RGBA,S),T=_),T);var k=M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=k;for(var E=0;E=0;--o){var a=t[o];a&&a._glTextures[n].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new et(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var r,n;t.internalFormat=null!==(n=null===(r=this.internalFormats[e.type])||void 0===r?void 0:r[e.format])&&void 0!==n?n:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var r=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(r,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,o=e.realHeight,a=r.gl;(t.width!==n||t.height!==o||t.dirtyId<0)&&(t.width=n,t.height=o,a.texImage2D(e.target,0,t.internalFormat,n,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var r=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),r.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var n=this.managedTextures.indexOf(e);-1!==n&&Object(o.removeItems)(this.managedTextures,n,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==i.k.POW2&&2===this.webGLVersion||e.isPowerOfTwo?t.mipmap=e.mipmap>=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var r=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&r.generateMipmap(e.target),r.texParameteri(e.target,r.TEXTURE_WRAP_S,t.wrapMode),r.texParameteri(e.target,r.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(e.target,r.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),rt=new u.d,nt=function(e){function t(t,r){void 0===t&&(t=i.n.UNKNOWN);var a=e.call(this)||this;return r=Object.assign({},n.b.RENDER_OPTIONS,r),a.options=r,a.type=t,a.screen=new u.j(0,0,r.width,r.height),a.view=r.view||document.createElement("canvas"),a.resolution=r.resolution||n.b.RESOLUTION,a.useContextAlpha=r.useContextAlpha,a.autoDensity=!!r.autoDensity,a.preserveDrawingBuffer=r.preserveDrawingBuffer,a.clearBeforeRender=r.clearBeforeRender,a._backgroundColor=0,a._backgroundColorRgba=[0,0,0,1],a._backgroundColorString="#000000",a.backgroundColor=r.backgroundColor||a._backgroundColor,a.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&(Object(o.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),a.useContextAlpha=r.transparent,a.backgroundAlpha=r.transparent?0:1),a._lastObjectRendered=null,a.plugins={},a}return d(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var r=this.view.width/this.resolution,n=this.view.height/this.resolution;this.screen.width=r,this.screen.height=n,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=n+"px"),this.emit("resize",r,n)},t.prototype.generateTexture=function(e,t,r,n){void 0===t&&(t={}),"number"==typeof t&&(Object(o.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:r,region:n});var i=t.region,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),r=0;r=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var r=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var n in this[t]=r,this.runners)this.runners[n].add(r);return this},t.prototype.render=function(e,t){var r,n,i,a;if(t&&(t instanceof R?(Object(o.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),r=t,n=arguments[2],i=arguments[3],a=arguments[4]):(r=t.renderTexture,n=t.clear,i=t.transform,a=t.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(r||(this._lastObjectRendered=e),!a){var s=e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==n?n:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,r,n,i){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,n,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return Object(o.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,r){t.__plugins=t.__plugins||{},t.__plugins[e]=r},t}(nt);function st(e){return at.create(e)}var ut="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",lt="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",ct=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},ht=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,r=this.MAX_TEXTURES,n=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++m._globalBatch,u=0,l=n[0],c=0;i.copyBoundTextures(o,r);for(var h=0;h=r&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,h),c=h,l=n[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h0&&(t+="\nelse "),r-1){var r=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");d=!0}}function v(){return void 0===h&&(h=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:n.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!r||!r.getContextAttributes().stencil);if(r){var o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,i}catch(e){return!1}}()),h}var g={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",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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",rebeccapurple:"#663399",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"};function m(e,t){return void 0===t&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function y(e){var t=e.toString(16);return"#"+("000000".substring(0,6-t.length)+t)}function _(e){return"string"==typeof e&&"#"===(e=g[e.toLowerCase()]||e)[0]&&(e=e.slice(1)),parseInt(e,16)}function b(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}var x=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[l.b.NORMAL_NPM]=l.b.NORMAL,e[l.b.ADD_NPM]=l.b.ADD,e[l.b.SCREEN_NPM]=l.b.SCREEN,t[l.b.NORMAL]=l.b.NORMAL_NPM,t[l.b.ADD]=l.b.ADD_NPM,t[l.b.SCREEN]=l.b.SCREEN_NPM;var n=[];return n.push(t),n.push(e),n}();function w(e,t){return x[t?1:0][e]}function S(e,t,r,n){return r=r||new Float32Array(4),n||void 0===n?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=t,r}function T(e,t){if(1===t)return(255*t<<24)+e;if(0===t)return 0;var r=e>>16&255,n=e>>8&255,i=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((n=n*t+.5|0)<<8)+(i*t+.5|0)}function M(e,t,r,n){return(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(n||void 0===n)&&(r[0]*=t,r[1]*=t,r[2]*=t),r[3]=t,r}function k(e,t){void 0===t&&(t=null);var r=6*e;if((t=t||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+r);for(var n=0,i=0;n>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)}function P(e){return!(e&e-1||!e)}function N(e){var t=(e>65535?1:0)<<4,r=((e>>>=t)>255?1:0)<<3;return t|=r,t|=r=((e>>>=r)>15?1:0)<<2,(t|=r=((e>>>=r)>3?1:0)<<1)|(e>>>=r)>>1}function O(e,t,r){var n,i=e.length;if(!(t>=i||0===r)){var o=i-(r=t+r>i?i-t:r);for(n=t;n1&&"undefined"==typeof MSStream},B=function(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=t.userAgent,n=r.split("[FBAN");void 0!==n[1]&&(r=n[0]),void 0!==(n=r.split("Twitter"))[1]&&(r=n[0]);var i,o=(i=r,function(e){return e.test(i)}),a={apple:{phone:o(S)&&!o(P),ipod:o(T),tablet:!o(S)&&(o(M)||z(t))&&!o(P),universal:o(k),device:(o(S)||o(T)||o(M)||o(k)||z(t))&&!o(P)},amazon:{phone:o(I),tablet:!o(I)&&o(C),device:o(I)||o(C)},android:{phone:!o(P)&&o(I)||!o(P)&&o(E),tablet:!o(P)&&!o(I)&&!o(E)&&(o(C)||o(A)),device:!o(P)&&(o(I)||o(C)||o(E)||o(A))||o(/\bokhttp\b/i)},windows:{phone:o(P),tablet:o(N),device:o(P)||o(N)},other:{blackberry:o(O),blackberry10:o(R),opera:o(D),firefox:o(j),chrome:o(L),device:o(O)||o(R)||o(D)||o(j)||o(L)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}(globalThis.navigator); /*! * @pixi/settings - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC * * @pixi/settings is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */(w=n||(n={}))[w.WEBGL_LEGACY=0]="WEBGL_LEGACY",w[w.WEBGL=1]="WEBGL",w[w.WEBGL2=2]="WEBGL2",function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(i||(i={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(o||(o={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(a||(a={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(s||(s={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(u||(u={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(l||(l={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(c||(c={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(h||(h={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(d||(d={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(p||(p={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(v||(v={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(g||(g={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(m||(m={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(y||(y={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(_||(_={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(b||(b={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(x||(x={}));var F={MIPMAP_TEXTURES:p.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:b.NONE,SPRITE_MAX_TEXTURES:function(e){var t,r=!0;(B.tablet||B.phone)&&(B.apple.device&&(t=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(t[1],10)<11&&(r=!1),B.android.device&&(t=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(t[1],10)<7&&(r=!1));return r?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:m.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:f.CLAMP,SCALE_MODE:d.LINEAR,PRECISION_VERTEX:y.HIGH,PRECISION_FRAGMENT:B.apple.device?y.HIGH:y.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!B.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},function(e,t,r){r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return N})),r.d(t,"c",(function(){return A})),r.d(t,"d",(function(){return C}));var n=r(4),i=r(1),o=r(3); + */(w=n||(n={}))[w.WEBGL_LEGACY=0]="WEBGL_LEGACY",w[w.WEBGL=1]="WEBGL",w[w.WEBGL2=2]="WEBGL2",function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(i||(i={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(o||(o={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(a||(a={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(s||(s={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(u||(u={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(l||(l={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(c||(c={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(h||(h={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(d||(d={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(p||(p={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(v||(v={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(g||(g={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(m||(m={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(y||(y={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(_||(_={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(b||(b={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(x||(x={}));var F={MIPMAP_TEXTURES:p.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:b.NONE,SPRITE_MAX_TEXTURES:function(e){var t,r=!0;(B.tablet||B.phone)&&(B.apple.device&&(t=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(t[1],10)<11&&(r=!1),B.android.device&&(t=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(t[1],10)<7&&(r=!1));return r?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:m.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:f.CLAMP,SCALE_MODE:d.LINEAR,PRECISION_VERTEX:y.HIGH,PRECISION_FRAGMENT:B.apple.device?y.HIGH:y.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!B.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},function(e,t,r){r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return N})),r.d(t,"c",(function(){return I})),r.d(t,"d",(function(){return C}));var n=r(4),i=r(1),o=r(3); /*! * @pixi/display - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -63,14 +63,14 @@ var n,i,o=2*Math.PI,a=180/Math.PI,s=Math.PI/180;(i=n||(n={}))[i.POLY=0]="POLY",i See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. - ***************************************************************************** */function u(e,t){function r(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M,k,E,I,A=function(e){function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new i.m,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new a,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return u(t,e),t.mixin=function(e){for(var r=Object.keys(e),n=0;n1)for(var n=0;nthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),n=this.getChildIndex(t);this.children[r]=t,this.children[n]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);Object(o.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],r=0;r1)for(var n=0;n0&&i<=t){r=this.children.splice(n,i);for(var o=0;o1&&this.children.sort(P),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&r.height>0){var n,i;if(this.cullArea?(n=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(n=this.getBounds(!0)),n&&r.intersects(n,i))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;o1)for(var n=0;nthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),n=this.getChildIndex(t);this.children[r]=t,this.children[n]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);Object(o.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],r=0;r1)for(var n=0;n0&&i<=t){r=this.children.splice(n,i);for(var o=0;o1&&this.children.sort(P),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&r.height>0){var n,i;if(this.cullArea?(n=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(n=this.getBounds(!0)),n&&r.intersects(n,i))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;ot.priority){e.connect(r);break}r=t,t=t.next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){var t;if(void 0===e&&(e=performance.now()),e>this.lastTime){if((t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var r=e-this._lastFrame|0;if(r>16)+(65280&e)+((255&e)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;Object(u.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(n.r),g=function(e){function t(t,r,i){var a=e.call(this)||this,s=new n.h(t),u=new n.h(r,!0),l=new n.h(i,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,o.r.FLOAT).addAttribute("aTextureCoord",u,2,!1,o.r.FLOAT).addIndex(l),a._updateId=-1,a}return c(t,e),Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(n.l)},function(e,t){e.exports="precision mediump float;\nattribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord() {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tfilterCoord = aVertexPosition * outputFrame.zw;\n}\n"},function(e,t,r){r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p}));var n=r(2),i=r(3),o=r(1),a=r(0),s=r(4),u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},l=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,r=e.maskObject||e;t.context.save();var n=this._foundShapes;if(this.recursiveFindShapes(r,n),n.length>0){var i=t.context;i.beginPath();for(var o=0;o0){for(c=0,d=u[0],f=u[1],p=2;p+2=0;p-=2)t.lineTo(u[p],u[p+1]);l[v].shape.closeStroke&&t.closePath()}}u[0]===u[u.length-2]&&u[1]===u[u.length-1]&&t.closePath()}else if(s.type===o.l.RECT)t.rect(s.x,s.y,s.width,s.height),t.closePath();else if(s.type===o.l.CIRC)t.arc(s.x,s.y,s.radius,0,2*Math.PI),t.closePath();else if(s.type===o.l.ELIP){var g=2*s.width,m=2*s.height,y=s.x-g/2,_=s.y-m/2,b=g/2*.5522848,x=m/2*.5522848,w=y+g,S=_+m,T=y+g/2,M=_+m/2;t.moveTo(y,M),t.bezierCurveTo(y,M-x,T-b,_,T,_),t.bezierCurveTo(T+b,_,w,M-x,w,M),t.bezierCurveTo(w,M+x,T+b,S,T,S),t.bezierCurveTo(T-b,S,y,M+x,y,M),t.closePath()}else if(s.type===o.l.RREC){var k=s.x,E=s.y,I=s.width,A=s.height,C=s.radius,P=Math.min(I,A)/2;C=C>P?P:C,t.moveTo(k,E+C),t.lineTo(k,E+A-C),t.quadraticCurveTo(k,E+A,k+C,E+A),t.lineTo(k+I-C,E+A),t.quadraticCurveTo(k+I,E+A,k+I,E+A-C),t.lineTo(k+I,E+C),t.quadraticCurveTo(k+I,E,k+I-C,E),t.lineTo(k+C,E),t.quadraticCurveTo(k,E,k,E+C),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function c(e){var t=document.createElement("canvas");t.width=6,t.height=1;var r=t.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,6,1),t}function h(){if("undefined"==typeof document)return!1;var e=c("#ff00ff"),t=c("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var n=r.getContext("2d");n.globalCompositeOperation="multiply",n.drawImage(e,0,0),n.drawImage(t,2,0);var i=n.getImageData(2,0,1,1);if(!i)return!1;var o=i.data;return 255===o[0]&&0===o[1]&&0===o[2]}var d=new o.d,f=function(e){function t(r){var n,o=e.call(this,a.n.CANVAS,r)||this;if(o.refresh=!0,o.maskManager=new l(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===n&&(n=[]),h()?(n[a.b.NORMAL]="source-over",n[a.b.ADD]="lighter",n[a.b.MULTIPLY]="multiply",n[a.b.SCREEN]="screen",n[a.b.OVERLAY]="overlay",n[a.b.DARKEN]="darken",n[a.b.LIGHTEN]="lighten",n[a.b.COLOR_DODGE]="color-dodge",n[a.b.COLOR_BURN]="color-burn",n[a.b.HARD_LIGHT]="hard-light",n[a.b.SOFT_LIGHT]="soft-light",n[a.b.DIFFERENCE]="difference",n[a.b.EXCLUSION]="exclusion",n[a.b.HUE]="hue",n[a.b.SATURATION]="saturate",n[a.b.COLOR]="color",n[a.b.LUMINOSITY]="luminosity"):(n[a.b.NORMAL]="source-over",n[a.b.ADD]="lighter",n[a.b.MULTIPLY]="source-over",n[a.b.SCREEN]="source-over",n[a.b.OVERLAY]="source-over",n[a.b.DARKEN]="source-over",n[a.b.LIGHTEN]="source-over",n[a.b.COLOR_DODGE]="source-over",n[a.b.COLOR_BURN]="source-over",n[a.b.HARD_LIGHT]="source-over",n[a.b.SOFT_LIGHT]="source-over",n[a.b.DIFFERENCE]="source-over",n[a.b.EXCLUSION]="source-over",n[a.b.HUE]="source-over",n[a.b.SATURATION]="source-over",n[a.b.COLOR]="source-over",n[a.b.LUMINOSITY]="source-over"),n[a.b.NORMAL_NPM]=n[a.b.NORMAL],n[a.b.ADD_NPM]=n[a.b.ADD],n[a.b.SCREEN_NPM]=n[a.b.SCREEN],n[a.b.SRC_IN]="source-in",n[a.b.SRC_OUT]="source-out",n[a.b.SRC_ATOP]="source-atop",n[a.b.DST_OVER]="destination-over",n[a.b.DST_IN]="destination-in",n[a.b.DST_OUT]="destination-out",n[a.b.DST_ATOP]="destination-atop",n[a.b.XOR]="xor",n[a.b.SUBTRACT]="source-over",n),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var s=o.rootContext;s.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":s.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":s.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":s.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(t.__plugins),Object(i.sayHello)("Canvas"),o.resize(o.options.width,o.options.height),o}return function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.addSystem=function(){return this},t.prototype.render=function(e,t){if(this.view){var r,o,s,u;t&&(t instanceof n.p||t instanceof n.b?(Object(i.deprecation)("6.0.0","CanvasRenderer#render arguments changed, use options instead."),r=t,o=arguments[2],s=arguments[3],u=arguments[4]):(r=t.renderTexture,o=t.clear,s=t.transform,u=t.skipUpdateTransform)),this.renderingToScreen=!r,this.emit("prerender");var l=this.resolution;r?((r=r.castToBaseTexture())._canvasRenderTarget||(r._canvasRenderTarget=new i.CanvasRenderTarget(r.width,r.height,r.resolution),r.resource=new n.j(r._canvasRenderTarget.canvas),r.valid=!0),this.context=r._canvasRenderTarget.context,this.resolution=r._canvasRenderTarget.resolution):this.context=this.rootContext;var c=this.context;if(this._projTransform=s||null,r||(this._lastObjectRendered=e),!u){var h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}if(c.save(),c.setTransform(1,0,0,1,0,0),c.globalAlpha=1,this._activeBlendMode=a.b.NORMAL,this._outerBlend=!1,c.globalCompositeOperation=this.blendModes[a.b.NORMAL],void 0!==o?o:this.clearBeforeRender)if(this.renderingToScreen)c.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(c.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,c.fillStyle=this._backgroundColorString,c.fillRect(0,0,this.width,this.height),c.globalAlpha=1);else{(r=r)._canvasRenderTarget.clear();var d=r.clearColor;d[3]>0&&(c.globalAlpha=this.useContextAlpha?d[3]:1,c.fillStyle=Object(i.hex2string)(Object(i.rgb2hex)(d)),c.fillRect(0,0,r.realWidth,r.realHeight),c.globalAlpha=1)}var f=this.context;this.context=c,e.renderCanvas(this),this.context=f,c.restore(),this.resolution=l,this._projTransform=null,this.emit("postrender")}},t.prototype.setContextTransform=function(e,t,r){var n=e,i=this._projTransform,o=this.resolution;r=r||o,i&&((n=d).copyFrom(e),n.prepend(i)),t?this.context.setTransform(n.a*r,n.b*r,n.c*r,n.d*r,n.tx*o|0,n.ty*o|0):this.context.setTransform(n.a*r,n.b*r,n.c*r,n.d*r,n.tx*o,n.ty*o)},t.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),e&&(r.globalAlpha=this.useContextAlpha?t:1,r.fillStyle=e,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},t.prototype.setBlendMode=function(e,t){var r=e===a.b.SRC_IN||e===a.b.SRC_OUT||e===a.b.DST_IN||e===a.b.DST_ATOP;!t&&r&&(e=a.b.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[e])},t.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=s.b.SCALE_MODE===a.p.LINEAR)},t.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},t.registerPlugin=function(e,r){t.__plugins=t.__plugins||{},t.__plugins[e]=r},t}(n.a),p={canvas:null,getTintedCanvas:function(e,t){var r=e.texture,n="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);r.tintCache=r.tintCache||{};var i,o=r.tintCache[n];if(o){if(o.tintId===r._updateID)return r.tintCache[n];i=r.tintCache[n]}else i=document.createElement("canvas");if(p.tintMethod(r,t,i),i.tintId=r._updateID,p.convertTintToImage){var a=new Image;a.src=i.toDataURL(),r.tintCache[n]=a}else r.tintCache[n]=i;return i},getTintedPattern:function(e,t){var r="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);e.patternCache=e.patternCache||{};var n=e.patternCache[r];return n&&n.tintId===e._updateID||(p.canvas||(p.canvas=document.createElement("canvas")),p.tintMethod(e,t,p.canvas),(n=p.canvas.getContext("2d").createPattern(p.canvas,"repeat")).tintId=e._updateID,e.patternCache[r]=n),n},tintWithMultiply:function(e,t,r){var n=r.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),n.save(),n.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();n.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore()},tintWithOverlay:function(e,t,r){var n=r.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),n.save(),n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore()},tintWithPerPixel:function(e,t,r){var n=r.getContext("2d"),o=e._frame.clone(),a=e.baseTexture.resolution;o.x*=a,o.y*=a,o.width*=a,o.height*=a,r.width=Math.ceil(o.width),r.height=Math.ceil(o.height),n.save(),n.globalCompositeOperation="copy",n.drawImage(e.baseTexture.getDrawableSource(),o.x,o.y,o.width,o.height,0,0,o.width,o.height),n.restore();for(var s=Object(i.hex2rgb)(t),u=s[0],l=s[1],c=s[2],h=n.getImageData(0,0,o.width,o.height),d=h.data,f=0;ft.priority){e.connect(r);break}r=t,t=t.next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){var t;if(void 0===e&&(e=performance.now()),e>this.lastTime){if((t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var r=e-this._lastFrame|0;if(r>16)+(65280&e)+((255&e)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;Object(u.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(n.r),g=function(e){function t(t,r,i){var a=e.call(this)||this,s=new n.h(t),u=new n.h(r,!0),l=new n.h(i,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,o.r.FLOAT).addAttribute("aTextureCoord",u,2,!1,o.r.FLOAT).addIndex(l),a._updateId=-1,a}return c(t,e),Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(n.l)},function(e,t){e.exports="precision mediump float;\nattribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord() {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tfilterCoord = aVertexPosition * outputFrame.zw;\n}\n"},function(e,t,r){r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p}));var n=r(2),i=r(3),o=r(1),a=r(0),s=r(4),u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},l=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,r=e.maskObject||e;t.context.save();var n=this._foundShapes;if(this.recursiveFindShapes(r,n),n.length>0){var i=t.context;i.beginPath();for(var o=0;o0){for(c=0,d=u[0],f=u[1],p=2;p+2=0;p-=2)t.lineTo(u[p],u[p+1]);l[v].shape.closeStroke&&t.closePath()}}u[0]===u[u.length-2]&&u[1]===u[u.length-1]&&t.closePath()}else if(s.type===o.l.RECT)t.rect(s.x,s.y,s.width,s.height),t.closePath();else if(s.type===o.l.CIRC)t.arc(s.x,s.y,s.radius,0,2*Math.PI),t.closePath();else if(s.type===o.l.ELIP){var g=2*s.width,m=2*s.height,y=s.x-g/2,_=s.y-m/2,b=g/2*.5522848,x=m/2*.5522848,w=y+g,S=_+m,T=y+g/2,M=_+m/2;t.moveTo(y,M),t.bezierCurveTo(y,M-x,T-b,_,T,_),t.bezierCurveTo(T+b,_,w,M-x,w,M),t.bezierCurveTo(w,M+x,T+b,S,T,S),t.bezierCurveTo(T-b,S,y,M+x,y,M),t.closePath()}else if(s.type===o.l.RREC){var k=s.x,E=s.y,A=s.width,I=s.height,C=s.radius,P=Math.min(A,I)/2;C=C>P?P:C,t.moveTo(k,E+C),t.lineTo(k,E+I-C),t.quadraticCurveTo(k,E+I,k+C,E+I),t.lineTo(k+A-C,E+I),t.quadraticCurveTo(k+A,E+I,k+A,E+I-C),t.lineTo(k+A,E+C),t.quadraticCurveTo(k+A,E,k+A-C,E),t.lineTo(k+C,E),t.quadraticCurveTo(k,E,k,E+C),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function c(e){var t=document.createElement("canvas");t.width=6,t.height=1;var r=t.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,6,1),t}function h(){if("undefined"==typeof document)return!1;var e=c("#ff00ff"),t=c("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var n=r.getContext("2d");n.globalCompositeOperation="multiply",n.drawImage(e,0,0),n.drawImage(t,2,0);var i=n.getImageData(2,0,1,1);if(!i)return!1;var o=i.data;return 255===o[0]&&0===o[1]&&0===o[2]}var d=new o.d,f=function(e){function t(r){var n,o=e.call(this,a.n.CANVAS,r)||this;if(o.refresh=!0,o.maskManager=new l(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===n&&(n=[]),h()?(n[a.b.NORMAL]="source-over",n[a.b.ADD]="lighter",n[a.b.MULTIPLY]="multiply",n[a.b.SCREEN]="screen",n[a.b.OVERLAY]="overlay",n[a.b.DARKEN]="darken",n[a.b.LIGHTEN]="lighten",n[a.b.COLOR_DODGE]="color-dodge",n[a.b.COLOR_BURN]="color-burn",n[a.b.HARD_LIGHT]="hard-light",n[a.b.SOFT_LIGHT]="soft-light",n[a.b.DIFFERENCE]="difference",n[a.b.EXCLUSION]="exclusion",n[a.b.HUE]="hue",n[a.b.SATURATION]="saturate",n[a.b.COLOR]="color",n[a.b.LUMINOSITY]="luminosity"):(n[a.b.NORMAL]="source-over",n[a.b.ADD]="lighter",n[a.b.MULTIPLY]="source-over",n[a.b.SCREEN]="source-over",n[a.b.OVERLAY]="source-over",n[a.b.DARKEN]="source-over",n[a.b.LIGHTEN]="source-over",n[a.b.COLOR_DODGE]="source-over",n[a.b.COLOR_BURN]="source-over",n[a.b.HARD_LIGHT]="source-over",n[a.b.SOFT_LIGHT]="source-over",n[a.b.DIFFERENCE]="source-over",n[a.b.EXCLUSION]="source-over",n[a.b.HUE]="source-over",n[a.b.SATURATION]="source-over",n[a.b.COLOR]="source-over",n[a.b.LUMINOSITY]="source-over"),n[a.b.NORMAL_NPM]=n[a.b.NORMAL],n[a.b.ADD_NPM]=n[a.b.ADD],n[a.b.SCREEN_NPM]=n[a.b.SCREEN],n[a.b.SRC_IN]="source-in",n[a.b.SRC_OUT]="source-out",n[a.b.SRC_ATOP]="source-atop",n[a.b.DST_OVER]="destination-over",n[a.b.DST_IN]="destination-in",n[a.b.DST_OUT]="destination-out",n[a.b.DST_ATOP]="destination-atop",n[a.b.XOR]="xor",n[a.b.SUBTRACT]="source-over",n),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var s=o.rootContext;s.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":s.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":s.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":s.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(t.__plugins),Object(i.sayHello)("Canvas"),o.resize(o.options.width,o.options.height),o}return function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.addSystem=function(){return this},t.prototype.render=function(e,t){if(this.view){var r,o,s,u;t&&(t instanceof n.p||t instanceof n.b?(Object(i.deprecation)("6.0.0","CanvasRenderer#render arguments changed, use options instead."),r=t,o=arguments[2],s=arguments[3],u=arguments[4]):(r=t.renderTexture,o=t.clear,s=t.transform,u=t.skipUpdateTransform)),this.renderingToScreen=!r,this.emit("prerender");var l=this.resolution;r?((r=r.castToBaseTexture())._canvasRenderTarget||(r._canvasRenderTarget=new i.CanvasRenderTarget(r.width,r.height,r.resolution),r.resource=new n.j(r._canvasRenderTarget.canvas),r.valid=!0),this.context=r._canvasRenderTarget.context,this.resolution=r._canvasRenderTarget.resolution):this.context=this.rootContext;var c=this.context;if(this._projTransform=s||null,r||(this._lastObjectRendered=e),!u){var h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}if(c.save(),c.setTransform(1,0,0,1,0,0),c.globalAlpha=1,this._activeBlendMode=a.b.NORMAL,this._outerBlend=!1,c.globalCompositeOperation=this.blendModes[a.b.NORMAL],void 0!==o?o:this.clearBeforeRender)if(this.renderingToScreen)c.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(c.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,c.fillStyle=this._backgroundColorString,c.fillRect(0,0,this.width,this.height),c.globalAlpha=1);else{(r=r)._canvasRenderTarget.clear();var d=r.clearColor;d[3]>0&&(c.globalAlpha=this.useContextAlpha?d[3]:1,c.fillStyle=Object(i.hex2string)(Object(i.rgb2hex)(d)),c.fillRect(0,0,r.realWidth,r.realHeight),c.globalAlpha=1)}var f=this.context;this.context=c,e.renderCanvas(this),this.context=f,c.restore(),this.resolution=l,this._projTransform=null,this.emit("postrender")}},t.prototype.setContextTransform=function(e,t,r){var n=e,i=this._projTransform,o=this.resolution;r=r||o,i&&((n=d).copyFrom(e),n.prepend(i)),t?this.context.setTransform(n.a*r,n.b*r,n.c*r,n.d*r,n.tx*o|0,n.ty*o|0):this.context.setTransform(n.a*r,n.b*r,n.c*r,n.d*r,n.tx*o,n.ty*o)},t.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),e&&(r.globalAlpha=this.useContextAlpha?t:1,r.fillStyle=e,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},t.prototype.setBlendMode=function(e,t){var r=e===a.b.SRC_IN||e===a.b.SRC_OUT||e===a.b.DST_IN||e===a.b.DST_ATOP;!t&&r&&(e=a.b.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[e])},t.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=s.b.SCALE_MODE===a.p.LINEAR)},t.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},t.registerPlugin=function(e,r){t.__plugins=t.__plugins||{},t.__plugins[e]=r},t}(n.a),p={canvas:null,getTintedCanvas:function(e,t){var r=e.texture,n="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);r.tintCache=r.tintCache||{};var i,o=r.tintCache[n];if(o){if(o.tintId===r._updateID)return r.tintCache[n];i=r.tintCache[n]}else i=document.createElement("canvas");if(p.tintMethod(r,t,i),i.tintId=r._updateID,p.convertTintToImage){var a=new Image;a.src=i.toDataURL(),r.tintCache[n]=a}else r.tintCache[n]=i;return i},getTintedPattern:function(e,t){var r="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);e.patternCache=e.patternCache||{};var n=e.patternCache[r];return n&&n.tintId===e._updateID||(p.canvas||(p.canvas=document.createElement("canvas")),p.tintMethod(e,t,p.canvas),(n=p.canvas.getContext("2d").createPattern(p.canvas,"repeat")).tintId=e._updateID,e.patternCache[r]=n),n},tintWithMultiply:function(e,t,r){var n=r.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),n.save(),n.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();n.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore()},tintWithOverlay:function(e,t,r){var n=r.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),n.save(),n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore()},tintWithPerPixel:function(e,t,r){var n=r.getContext("2d"),o=e._frame.clone(),a=e.baseTexture.resolution;o.x*=a,o.y*=a,o.width*=a,o.height*=a,r.width=Math.ceil(o.width),r.height=Math.ceil(o.height),n.save(),n.globalCompositeOperation="copy",n.drawImage(e.baseTexture.getDrawableSource(),o.x,o.y,o.width,o.height,0,0,o.width,o.height),n.restore();for(var s=Object(i.hex2rgb)(t),u=s[0],l=s[1],c=s[2],h=n.getImageData(0,0,o.width,o.height),d=h.data,f=0;f8)throw new Error("max arguments reached");var u=this,l=u.name,c=u.items;this._aliasCount++;for(var h=0,d=c.length;h0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},e.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},e.prototype.remove=function(e){var t=this.items.indexOf(e);return-1!==t&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},e.prototype.contains=function(e){return-1!==this.items.indexOf(e)},e.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},e.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e}();Object.defineProperties(n.prototype,{dispatch:{value:n.prototype.emit},run:{value:n.prototype.emit}})},function(e,t,r){var n=r(20),i=r(15);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==n(e)}},function(e,t,r){var n=r(51),i="object"==("undefined"==typeof self?"undefined":T(self))&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},function(e,t){e.exports=function(e){return null!=e&&"object"==T(e)}},function(e,t,r){r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return c}));var n=r(8),i=r(0),o=r(2),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function s(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(e){function t(t,r,n,i){void 0===t&&(t=100),void 0===r&&(r=100),void 0===n&&(n=10),void 0===i&&(i=10);var o=e.call(this)||this;return o.segWidth=n,o.segHeight=i,o.width=t,o.height=r,o.build(),o}return s(t,e),t.prototype.build=function(){for(var e=this.segWidth*this.segHeight,t=[],r=[],n=[],i=this.segWidth-1,o=this.segHeight-1,a=this.width/i,s=this.height/o,u=0;u0){var d=s.x-e[c].x,f=s.y-e[c].y,p=Math.sqrt(d*d+f*f);s=e[c],a+=p/u}else a=c/(l-1);i[h]=a,i[h+1]=0,i[h+2]=a,i[h+3]=1}var v=0;for(c=0;c0?this.textureScale*this._width/2:this._width/2;n/=c,i/=c,n*=h,i*=h,o[l]=u.x+n,o[l+1]=u.y+i,o[l+2]=u.x-n,o[l+3]=u.y-i,r=u}this.buffers[0].update()}},t.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},t}(n.b),c=function(e){function t(t,r,o){void 0===o&&(o=0);var a=this,s=new l(t.height,r,o),u=new n.c(t);return o>0&&(t.baseTexture.wrapMode=i.s.REPEAT),(a=e.call(this,s,u)||this).autoUpdate=!0,a}return s(t,e),t.prototype._render=function(t){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),e.prototype._render.call(this,t)},t}(n.a),h=function(e){function t(t,r,i){var a=this,s=new u(t.width,t.height,r,i),l=new n.c(o.t.WHITE);return(a=e.call(this,s,l)||this).texture=t,a.autoResize=!0,a}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var e=this.geometry,t=this.shader.texture,r=t.width,n=t.height;!this.autoResize||e.width===r&&e.height===n||(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())},Object.defineProperty(t.prototype,"texture",{get:function(){return this.shader.texture},set:function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),e.prototype._render.call(this,t)},t.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),e.prototype.destroy.call(this,t)},t}(n.a),d=function(e){function t(t,r,i,a,s){void 0===t&&(t=o.t.EMPTY);var u=this,l=new n.b(r,i,a);l.getBuffer("aVertexPosition").static=!1;var c=new n.c(t);return(u=e.call(this,l,c,null,s)||this).autoUpdate=!0,u}return s(t,e),Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),e.prototype._render.call(this,t)},t}(n.a),f=function(e){function t(t,r,n,i,a){void 0===r&&(r=10),void 0===n&&(n=10),void 0===i&&(i=10),void 0===a&&(a=10);var s=e.call(this,o.t.WHITE,4,4)||this;return s._origWidth=t.orig.width,s._origHeight=t.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=i,s._topHeight=n,s._bottomHeight=a,s.texture=t,s}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype.updateHorizontalVertices=function(){var e=this.vertices,t=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*t,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*t,e[25]=e[27]=e[29]=e[31]=this._height},t.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*t,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*t,e[6]=e[14]=e[22]=e[30]=this._width},t.prototype._getMinScale=function(){var e=this._leftWidth+this._rightWidth,t=this._width>e?1:this._width/e,r=this._topHeight+this._bottomHeight,n=this._height>r?1:this._height/r;return Math.min(t,n)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),t.prototype._refresh=function(){var e=this.texture,t=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var r=1/this._origWidth,n=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=r*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-r*this._rightWidth,t[9]=t[11]=t[13]=t[15]=n*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-n*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},t}(h)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":T(window))&&(r=window)}e.exports=r},function(e,t,r){var n;!function(i){function o(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e,t,r,n,i,a){return o((s=o(o(t,e),o(n,a)))<<(u=i)|s>>>32-u,r);var s,u}function s(e,t,r,n,i,o,s){return a(t&r|~t&n,e,t,i,o,s)}function u(e,t,r,n,i,o,s){return a(t&n|r&~n,e,t,i,o,s)}function l(e,t,r,n,i,o,s){return a(t^r^n,e,t,i,o,s)}function c(e,t,r,n,i,o,s){return a(r^(t|~n),e,t,i,o,s)}function h(e,t){var r,n,i,a,h;e[t>>5]|=128<>>9<<4)]=t;var d=1732584193,f=-271733879,p=-1732584194,v=271733878;for(r=0;r>5]>>>t%32&255);return r}function f(e){var t,r=[];for(r[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+"0123456789abcdef".charAt(15&t);return n}function v(e){return unescape(encodeURIComponent(e))}function g(e){return d(h(f(t=v(e)),8*t.length));var t}function m(e,t){return function(e,t){var r,n,i=f(e),o=[],a=[];for(o[15]=a[15]=void 0,i.length>16&&(i=h(i,8*e.length)),r=0;r<16;r+=1)o[r]=909522486^i[r],a[r]=1549556828^i[r];return n=h(o.concat(f(t)),512+8*t.length),d(h(a.concat(n),640))}(v(e),v(t))}function y(e,t,r){return t?r?m(t,e):p(m(t,e)):r?g(e):p(g(e))}void 0===(n=function(){return y}.call(t,r,t,e))||(e.exports=n)}()},function(e,t){e.exports="precision mediump float;\nattribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord() {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tfilterCoord = aVertexPosition * outputFrame.zw;\n}\n"},function(e,t,r){var n=r(25),i=r(137),o=r(138),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t){e.exports=function(e){var t=T(e);return null!=e&&("object"==t||"function"==t)}},function(e,t,r){var n=r(162),i=r(165);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},function(e,t,r){(function(t){e.exports=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};t[a][0].call(l.exports,(function(e){return i(t[a][1][e]||e)}),l,l.exports,e,t,r,n)}return r[a].exports}for(var o=!1,a=0;ae.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function x(e){return o([function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),_(e)})).then((function(){return function(e){p(e);for(var t=d[e.name],r=t.forages,n=0;n=43)}})).catch((function(){return!1}))).then((function(e){return h=e}));var t}(s.db).then((function(e){return e?t:(r=t,new a((function(e,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)})));var r})):t})).then((function(t){M(n._dbInfo,"readwrite",(function(o,a){if(o)return i(o);try{var s=a.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,r),i},removeItem:function(e,t){var r=this;e=l(e);var n=new a((function(t,n){r.ready().then((function(){M(r._dbInfo,"readwrite",(function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){n(a.error)},o.onabort=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){M(t._dbInfo,"readwrite",(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){M(t._dbInfo,"readonly",(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new a((function(t,n){e<0?t(null):r.ready().then((function(){M(r._dbInfo,"readonly",(function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===e||s?t(r.key):(s=!0,r.advance(e)):t(null)},u.onerror=function(){n(u.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){M(t._dbInfo,"readonly",(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];o.onsuccess=function(){var t=o.result;t?(a.push(t.key),t.continue()):e(a)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=c.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,o=this;if(e.name){var u=e.name===r.name&&o._dbInfo.db,l=u?a.resolve(o._dbInfo.db):y(e).then((function(t){var r=d[e.name],n=r.forages;r.db=t;for(var i=0;i>4,c[u++]=(15&n)<<4|i>>2,c[u++]=(3&i)<<6|63&o;return l}function O(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=E[(3&r[t])<<4|r[t+1]>>4],n+=E[(15&r[t+1])<<2|r[t+2]>>6],n+=E[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var R={serialize:function(e,t){var r="";if(e&&(r=P.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===P.call(e.buffer))){var n,i="__lfsc__:";e instanceof ArrayBuffer?(n=e,i+="arbf"):(n=e.buffer,"[object Int8Array]"===r?i+="si08":"[object Uint8Array]"===r?i+="ui08":"[object Uint8ClampedArray]"===r?i+="uic8":"[object Int16Array]"===r?i+="si16":"[object Uint16Array]"===r?i+="ur16":"[object Int32Array]"===r?i+="si32":"[object Uint32Array]"===r?i+="ui32":"[object Float32Array]"===r?i+="fl32":"[object Float64Array]"===r?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+O(n))}else if("[object Blob]"===r){var o=new FileReader;o.onload=function(){var r="~~local_forage_type~"+e.type+"~"+O(this.result);t("__lfsc__:blob"+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,A))return JSON.parse(e);var t,r=e.substring(C),n=e.substring(A,C);if("blob"===n&&I.test(r)){var i=r.match(I);t=i[1],r=r.substring(i[0].length)}var a=N(r);switch(n){case"arbf":return a;case"blob":return o([a],{type:t});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:N,bufferToString:O};function D(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function L(e,t,r,n,i,o){e.executeSql(r,n,i,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?o(e,a):D(e,t,(function(){e.executeSql(r,n,i,o)}),o)}),o):o(e,a)}),o)}function j(e,t,r,n){var i=this;e=l(e);var o=new a((function(o,a){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,l){l?a(l):u.db.transaction((function(r){L(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void o(j.apply(i,[e,s,r,n-1]));a(t)}}))}))})).catch(a)}));return s(o,r),o}function z(e){return new a((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],o=0;o0?(this._dbInfo=t,t.serializer=R,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,o=localStorage.length,a=1,s=0;s=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return s(r,e),r},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return s(n,t),n},keys:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):a.reject("Invalid arguments"),t),n}},W=function(e,t){for(var r,n,i=e.length,o=0;o=t||r<0||g&&e-p>=c}function x(){var e,r,n=i();if(b(n))return w(n);d=setTimeout(x,(r=t-((e=n)-f),g?s(r,c-(e-p)):r))}function w(e){return d=void 0,m&&u?y(e):(u=l=void 0,h)}function S(){var e=i(),r=b(e);if(u=arguments,l=this,f=e,r){if(void 0===d)return _(f);if(g)return clearTimeout(d),d=setTimeout(x,t),y(f)}return void 0===d&&(d=setTimeout(x,t)),h}return t=o(t)||0,n(r)&&(v=!!r.leading,c=(g="maxWait"in r)?a(o(r.maxWait)||0,t):c,m="trailing"in r?!!r.trailing:m),S.cancel=function(){void 0!==d&&clearTimeout(d),p=0,u=f=l=d=void 0},S.flush=function(){return void 0===d?h:w(i())},S}},function(e,t,r){var n=r(14).Symbol;e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){var n=r(152),i=r(153),o=r(154),a=r(155),s=r(156);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,v=String.fromCharCode;function g(e){throw RangeError(f[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function y(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(d,".")).split("."),t).join(".")}function _(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=36)e=p(e/35);return p(n+36*e/(e+38))}function S(e){var t,r,n,i,o,a,s,u,c,h,d,f=[],v=e.length,m=0,y=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&g("not-basic"),f.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=v&&g("invalid-input"),((u=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>p((l-m)/a))&&g("overflow"),m+=u*a,!(u<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>p(l/(h=36-c))&&g("overflow"),a*=h;_=w(m-o,t=f.length+1,0==o),p(m/t)>l-y&&g("overflow"),y+=p(m/t),m%=t,f.splice(m++,0,y)}return b(f)}function M(e){var t,r,n,i,o,a,s,u,c,h,d,f,m,y,b,S=[];for(f=(e=_(e)).length,t=128,r=0,o=72,a=0;a=t&&dp((l-r)/(m=n+1))&&g("overflow"),r+=(s-t)*m,t=s,a=0;al&&g("overflow"),d==t){for(u=r,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)b=u-h,y=36-h,S.push(v(x(h+b%y,0))),u=p(b/y);S.push(v(x(u,0))),o=w(r,m,n==i),r=0,++n}++r,++t}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:S,encode:M,toASCII:function(e){return y(e,(function(e){return h.test(e)?"xn--"+M(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},n&&i)if(e.exports==n)i.exports=a;else for(s in a)a.hasOwnProperty(s)&&(n[s]=a[s]);else r.punycode=a}(u)})),d=function(e){return"string"==typeof e},f=function(e){return"object"==T(e)&&null!==e},p=function(e){return null===e};function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var g=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u=0?(l=f.substr(0,p),c=f.substr(p+1)):(l=f,c=""),h=decodeURIComponent(l),d=decodeURIComponent(c),v(i,h)?Array.isArray(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i},m=function(e){switch(T(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},y=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==T(e)?Object.keys(e).map((function(n){var i=encodeURIComponent(m(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(m(e))})).join(t):i+encodeURIComponent(m(e[n]))})).join(t):n?encodeURIComponent(m(n))+r+encodeURIComponent(m(e)):""},_=l((function(e,t){t.decode=t.parse=g,t.encode=t.stringify=y})),b=D;function x(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var w=/^([a-z0-9.+-]+:)/i,S=/:[0-9]*$/,M=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,k=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),E=["'"].concat(k),I=["%","/","?",";","#"].concat(E),A=["/","?","#"],C=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,N={javascript:!0,"javascript:":!0},O={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function D(e,t,r){if(e&&f(e)&&e instanceof x)return e;var n=new x;return n.parse(e,t,r),n}x.prototype.parse=function(e,t,r){if(!d(e))throw new TypeError("Parameter 'url' must be a string, not "+T(e));var n=e.indexOf("?"),i=-1!==n&&n127?k+="x":k+=S[D];if(!k.match(C)){var j=b.slice(0,g),z=b.slice(g+1),B=S.match(P);B&&(j.push(B[1]),z.unshift(B[2])),z.length&&(a="/"+z.join(".")+a),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=h.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!N[l])for(g=0,x=E.length;g0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift())),r.search=e.search,r.query=e.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=w.slice(-1)[0],M=(r.host||e.host||w.length>1)&&("."===T||".."===T)||""===T,k=0,E=w.length;E>=0;E--)"."===(T=w[E])?w.splice(E,1):".."===T?(w.splice(E,1),k++):k&&(w.splice(E,1),k--);if(!_&&!b)for(;k--;k)w.unshift("..");!_||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),M&&"/"!==w.join("/").substr(-1)&&w.push("");var I,A=""===w[0]||w[0]&&"/"===w[0].charAt(0);return S&&(r.hostname=r.host=A?"":w.length?w.shift():"",(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift())),(_=_||r.host&&w.length)&&!A&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},x.prototype.parseHost=function(){var e=this.host,t=S.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}; +var n=function(){function e(e){this.items=[],this._name=e,this._aliasCount=0}return e.prototype.emit=function(e,t,r,n,i,o,a,s){if(arguments.length>8)throw new Error("max arguments reached");var u=this,l=u.name,c=u.items;this._aliasCount++;for(var h=0,d=c.length;h0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},e.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},e.prototype.remove=function(e){var t=this.items.indexOf(e);return-1!==t&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},e.prototype.contains=function(e){return-1!==this.items.indexOf(e)},e.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},e.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e}();Object.defineProperties(n.prototype,{dispatch:{value:n.prototype.emit},run:{value:n.prototype.emit}})},function(e,t,r){var n=r(20),i=r(15);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==n(e)}},function(e,t,r){var n=r(51),i="object"==("undefined"==typeof self?"undefined":T(self))&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},function(e,t){e.exports=function(e){return null!=e&&"object"==T(e)}},function(e,t,r){r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return c}));var n=r(8),i=r(0),o=r(2),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function s(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(e){function t(t,r,n,i){void 0===t&&(t=100),void 0===r&&(r=100),void 0===n&&(n=10),void 0===i&&(i=10);var o=e.call(this)||this;return o.segWidth=n,o.segHeight=i,o.width=t,o.height=r,o.build(),o}return s(t,e),t.prototype.build=function(){for(var e=this.segWidth*this.segHeight,t=[],r=[],n=[],i=this.segWidth-1,o=this.segHeight-1,a=this.width/i,s=this.height/o,u=0;u0){var d=s.x-e[c].x,f=s.y-e[c].y,p=Math.sqrt(d*d+f*f);s=e[c],a+=p/u}else a=c/(l-1);i[h]=a,i[h+1]=0,i[h+2]=a,i[h+3]=1}var v=0;for(c=0;c0?this.textureScale*this._width/2:this._width/2;n/=c,i/=c,n*=h,i*=h,o[l]=u.x+n,o[l+1]=u.y+i,o[l+2]=u.x-n,o[l+3]=u.y-i,r=u}this.buffers[0].update()}},t.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},t}(n.b),c=function(e){function t(t,r,o){void 0===o&&(o=0);var a=this,s=new l(t.height,r,o),u=new n.c(t);return o>0&&(t.baseTexture.wrapMode=i.s.REPEAT),(a=e.call(this,s,u)||this).autoUpdate=!0,a}return s(t,e),t.prototype._render=function(t){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),e.prototype._render.call(this,t)},t}(n.a),h=function(e){function t(t,r,i){var a=this,s=new u(t.width,t.height,r,i),l=new n.c(o.t.WHITE);return(a=e.call(this,s,l)||this).texture=t,a.autoResize=!0,a}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var e=this.geometry,t=this.shader.texture,r=t.width,n=t.height;!this.autoResize||e.width===r&&e.height===n||(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())},Object.defineProperty(t.prototype,"texture",{get:function(){return this.shader.texture},set:function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),e.prototype._render.call(this,t)},t.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),e.prototype.destroy.call(this,t)},t}(n.a),d=function(e){function t(t,r,i,a,s){void 0===t&&(t=o.t.EMPTY);var u=this,l=new n.b(r,i,a);l.getBuffer("aVertexPosition").static=!1;var c=new n.c(t);return(u=e.call(this,l,c,null,s)||this).autoUpdate=!0,u}return s(t,e),Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),e.prototype._render.call(this,t)},t}(n.a),f=function(e){function t(t,r,n,i,a){void 0===r&&(r=10),void 0===n&&(n=10),void 0===i&&(i=10),void 0===a&&(a=10);var s=e.call(this,o.t.WHITE,4,4)||this;return s._origWidth=t.orig.width,s._origHeight=t.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=i,s._topHeight=n,s._bottomHeight=a,s.texture=t,s}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype.updateHorizontalVertices=function(){var e=this.vertices,t=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*t,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*t,e[25]=e[27]=e[29]=e[31]=this._height},t.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*t,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*t,e[6]=e[14]=e[22]=e[30]=this._width},t.prototype._getMinScale=function(){var e=this._leftWidth+this._rightWidth,t=this._width>e?1:this._width/e,r=this._topHeight+this._bottomHeight,n=this._height>r?1:this._height/r;return Math.min(t,n)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),t.prototype._refresh=function(){var e=this.texture,t=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var r=1/this._origWidth,n=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=r*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-r*this._rightWidth,t[9]=t[11]=t[13]=t[15]=n*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-n*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},t}(h)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":T(window))&&(r=window)}e.exports=r},function(e,t,r){var n;!function(i){function o(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e,t,r,n,i,a){return o((s=o(o(t,e),o(n,a)))<<(u=i)|s>>>32-u,r);var s,u}function s(e,t,r,n,i,o,s){return a(t&r|~t&n,e,t,i,o,s)}function u(e,t,r,n,i,o,s){return a(t&n|r&~n,e,t,i,o,s)}function l(e,t,r,n,i,o,s){return a(t^r^n,e,t,i,o,s)}function c(e,t,r,n,i,o,s){return a(r^(t|~n),e,t,i,o,s)}function h(e,t){var r,n,i,a,h;e[t>>5]|=128<>>9<<4)]=t;var d=1732584193,f=-271733879,p=-1732584194,v=271733878;for(r=0;r>5]>>>t%32&255);return r}function f(e){var t,r=[];for(r[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+"0123456789abcdef".charAt(15&t);return n}function v(e){return unescape(encodeURIComponent(e))}function g(e){return d(h(f(t=v(e)),8*t.length));var t}function m(e,t){return function(e,t){var r,n,i=f(e),o=[],a=[];for(o[15]=a[15]=void 0,i.length>16&&(i=h(i,8*e.length)),r=0;r<16;r+=1)o[r]=909522486^i[r],a[r]=1549556828^i[r];return n=h(o.concat(f(t)),512+8*t.length),d(h(a.concat(n),640))}(v(e),v(t))}function y(e,t,r){return t?r?m(t,e):p(m(t,e)):r?g(e):p(g(e))}void 0===(n=function(){return y}.call(t,r,t,e))||(e.exports=n)}()},function(e,t){e.exports="precision mediump float;\nattribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord() {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tfilterCoord = aVertexPosition * outputFrame.zw;\n}\n"},function(e,t,r){var n=r(25),i=r(137),o=r(138),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t){e.exports=function(e){var t=T(e);return null!=e&&("object"==t||"function"==t)}},function(e,t,r){var n=r(162),i=r(165);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},function(e,t,r){(function(t){e.exports=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};t[a][0].call(l.exports,(function(e){return i(t[a][1][e]||e)}),l,l.exports,e,t,r,n)}return r[a].exports}for(var o=!1,a=0;ae.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function x(e){return o([function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),_(e)})).then((function(){return function(e){p(e);for(var t=d[e.name],r=t.forages,n=0;n=43)}})).catch((function(){return!1}))).then((function(e){return h=e}));var t}(s.db).then((function(e){return e?t:(r=t,new a((function(e,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)})));var r})):t})).then((function(t){M(n._dbInfo,"readwrite",(function(o,a){if(o)return i(o);try{var s=a.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,r),i},removeItem:function(e,t){var r=this;e=l(e);var n=new a((function(t,n){r.ready().then((function(){M(r._dbInfo,"readwrite",(function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){n(a.error)},o.onabort=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){M(t._dbInfo,"readwrite",(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){M(t._dbInfo,"readonly",(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new a((function(t,n){e<0?t(null):r.ready().then((function(){M(r._dbInfo,"readonly",(function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===e||s?t(r.key):(s=!0,r.advance(e)):t(null)},u.onerror=function(){n(u.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){M(t._dbInfo,"readonly",(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];o.onsuccess=function(){var t=o.result;t?(a.push(t.key),t.continue()):e(a)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=c.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,o=this;if(e.name){var u=e.name===r.name&&o._dbInfo.db,l=u?a.resolve(o._dbInfo.db):y(e).then((function(t){var r=d[e.name],n=r.forages;r.db=t;for(var i=0;i>4,c[u++]=(15&n)<<4|i>>2,c[u++]=(3&i)<<6|63&o;return l}function O(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=E[(3&r[t])<<4|r[t+1]>>4],n+=E[(15&r[t+1])<<2|r[t+2]>>6],n+=E[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var R={serialize:function(e,t){var r="";if(e&&(r=P.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===P.call(e.buffer))){var n,i="__lfsc__:";e instanceof ArrayBuffer?(n=e,i+="arbf"):(n=e.buffer,"[object Int8Array]"===r?i+="si08":"[object Uint8Array]"===r?i+="ui08":"[object Uint8ClampedArray]"===r?i+="uic8":"[object Int16Array]"===r?i+="si16":"[object Uint16Array]"===r?i+="ur16":"[object Int32Array]"===r?i+="si32":"[object Uint32Array]"===r?i+="ui32":"[object Float32Array]"===r?i+="fl32":"[object Float64Array]"===r?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+O(n))}else if("[object Blob]"===r){var o=new FileReader;o.onload=function(){var r="~~local_forage_type~"+e.type+"~"+O(this.result);t("__lfsc__:blob"+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,I))return JSON.parse(e);var t,r=e.substring(C),n=e.substring(I,C);if("blob"===n&&A.test(r)){var i=r.match(A);t=i[1],r=r.substring(i[0].length)}var a=N(r);switch(n){case"arbf":return a;case"blob":return o([a],{type:t});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:N,bufferToString:O};function D(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function L(e,t,r,n,i,o){e.executeSql(r,n,i,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?o(e,a):D(e,t,(function(){e.executeSql(r,n,i,o)}),o)}),o):o(e,a)}),o)}function j(e,t,r,n){var i=this;e=l(e);var o=new a((function(o,a){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,l){l?a(l):u.db.transaction((function(r){L(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void o(j.apply(i,[e,s,r,n-1]));a(t)}}))}))})).catch(a)}));return s(o,r),o}function z(e){return new a((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],o=0;o0?(this._dbInfo=t,t.serializer=R,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,o=localStorage.length,a=1,s=0;s=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return s(r,e),r},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return s(n,t),n},keys:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):a.reject("Invalid arguments"),t),n}},W=function(e,t){for(var r,n,i=e.length,o=0;o=t||r<0||g&&e-p>=c}function x(){var e,r,n=i();if(b(n))return w(n);d=setTimeout(x,(r=t-((e=n)-f),g?s(r,c-(e-p)):r))}function w(e){return d=void 0,m&&u?y(e):(u=l=void 0,h)}function S(){var e=i(),r=b(e);if(u=arguments,l=this,f=e,r){if(void 0===d)return _(f);if(g)return clearTimeout(d),d=setTimeout(x,t),y(f)}return void 0===d&&(d=setTimeout(x,t)),h}return t=o(t)||0,n(r)&&(v=!!r.leading,c=(g="maxWait"in r)?a(o(r.maxWait)||0,t):c,m="trailing"in r?!!r.trailing:m),S.cancel=function(){void 0!==d&&clearTimeout(d),p=0,u=f=l=d=void 0},S.flush=function(){return void 0===d?h:w(i())},S}},function(e,t,r){var n=r(14).Symbol;e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){var n=r(152),i=r(153),o=r(154),a=r(155),s=r(156);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,v=String.fromCharCode;function g(e){throw RangeError(f[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function y(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(d,".")).split("."),t).join(".")}function _(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=36)e=p(e/35);return p(n+36*e/(e+38))}function S(e){var t,r,n,i,o,a,s,u,c,h,d,f=[],v=e.length,m=0,y=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&g("not-basic"),f.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=v&&g("invalid-input"),((u=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>p((l-m)/a))&&g("overflow"),m+=u*a,!(u<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>p(l/(h=36-c))&&g("overflow"),a*=h;_=w(m-o,t=f.length+1,0==o),p(m/t)>l-y&&g("overflow"),y+=p(m/t),m%=t,f.splice(m++,0,y)}return b(f)}function M(e){var t,r,n,i,o,a,s,u,c,h,d,f,m,y,b,S=[];for(f=(e=_(e)).length,t=128,r=0,o=72,a=0;a=t&&dp((l-r)/(m=n+1))&&g("overflow"),r+=(s-t)*m,t=s,a=0;al&&g("overflow"),d==t){for(u=r,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)b=u-h,y=36-h,S.push(v(x(h+b%y,0))),u=p(b/y);S.push(v(x(u,0))),o=w(r,m,n==i),r=0,++n}++r,++t}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:S,encode:M,toASCII:function(e){return y(e,(function(e){return h.test(e)?"xn--"+M(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},n&&i)if(e.exports==n)i.exports=a;else for(s in a)a.hasOwnProperty(s)&&(n[s]=a[s]);else r.punycode=a}(u)})),d=function(e){return"string"==typeof e},f=function(e){return"object"==T(e)&&null!==e},p=function(e){return null===e};function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var g=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u=0?(l=f.substr(0,p),c=f.substr(p+1)):(l=f,c=""),h=decodeURIComponent(l),d=decodeURIComponent(c),v(i,h)?Array.isArray(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i},m=function(e){switch(T(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},y=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==T(e)?Object.keys(e).map((function(n){var i=encodeURIComponent(m(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(m(e))})).join(t):i+encodeURIComponent(m(e[n]))})).join(t):n?encodeURIComponent(m(n))+r+encodeURIComponent(m(e)):""},_=l((function(e,t){t.decode=t.parse=g,t.encode=t.stringify=y})),b=D;function x(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var w=/^([a-z0-9.+-]+:)/i,S=/:[0-9]*$/,M=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,k=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),E=["'"].concat(k),A=["%","/","?",";","#"].concat(E),I=["/","?","#"],C=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,N={javascript:!0,"javascript:":!0},O={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function D(e,t,r){if(e&&f(e)&&e instanceof x)return e;var n=new x;return n.parse(e,t,r),n}x.prototype.parse=function(e,t,r){if(!d(e))throw new TypeError("Parameter 'url' must be a string, not "+T(e));var n=e.indexOf("?"),i=-1!==n&&n127?k+="x":k+=S[D];if(!k.match(C)){var j=b.slice(0,g),z=b.slice(g+1),B=S.match(P);B&&(j.push(B[1]),z.unshift(B[2])),z.length&&(a="/"+z.join(".")+a),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=h.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!N[l])for(g=0,x=E.length;g0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),r.search=e.search,r.query=e.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=w.slice(-1)[0],M=(r.host||e.host||w.length>1)&&("."===T||".."===T)||""===T,k=0,E=w.length;E>=0;E--)"."===(T=w[E])?w.splice(E,1):".."===T?(w.splice(E,1),k++):k&&(w.splice(E,1),k--);if(!_&&!b)for(;k--;k)w.unshift("..");!_||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),M&&"/"!==w.join("/").substr(-1)&&w.push("");var A,I=""===w[0]||w[0]&&"/"===w[0].charAt(0);return S&&(r.hostname=r.host=I?"":w.length?w.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),(_=_||r.host&&w.length)&&!I&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},x.prototype.parseHost=function(){var e=this.host,t=S.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}; /*! * @pixi/utils - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -107,7 +107,7 @@ var L={parse:b,format:function(e){return d(e)&&(e=D(e)),e instanceof x?e.format( See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. - ***************************************************************************** */var xe=function(e,t){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function we(e,t){function r(){this.constructor=e}xe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Se=function(){return(Se=Object.assign||function(e){for(var t,r=arguments,n=1,i=arguments.length;n0&&h>0,o.textureCacheIds=[],o.destroyed=!1,o.resource=null,o._batchEnabled=0,o._batchLocation=0,o.parentTextureArray=null,o.setResource(t),o}return we(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var r;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)},t.prototype.setRealSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=W(this.realWidth)&&W(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Z[this.cacheId],delete Q[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,r,i){void 0===i&&(i=n.b.STRICT_TEXTURE_CACHE);var o="string"==typeof e,a=null;if(o)a=e;else{if(!e._pixiId){var s=r&&r.pixiIdPrefix||"pixiid";e._pixiId=s+"_"+H()}a=e._pixiId}var u=Z[a];if(o&&i&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||((u=new t(e,r)).cacheId=a,t.addToCache(u,a)),u},t.fromBuffer=function(e,r,n,o){e=e||new Float32Array(r*n*4);var a=new Me(e,{width:r,height:n}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(ke,o||{width:r,height:n,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),Z[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),Z[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=Z[e];if(t){var r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete Z[e],t}}else if(e&&e.textureCacheIds){for(var n=0;n0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,r,n){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(Ce),De=function(e){function t(r,n){var i=this;if(n=n||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var a=r[0].src||r[0];Ce.crossOrigin(o,a,n.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(r)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(Ce),Le=function(e){function t(t){return e.call(this,t)||this}return we(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(Ce);_e.push(Oe,Le,Pe,De,Re,Me,Ne,Ae);var je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return we(t,e),t.prototype.upload=function(e,t,r){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return r.width===o&&r.height===a?n.texSubImage2D(t.target,0,0,0,o,a,t.format,r.type,this.data):(r.width=o,r.height=a,n.texImage2D(t.target,0,r.internalFormat,o,a,0,t.format,r.type,this.data)),!0},t}(Me),ze=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new te("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new Ee(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Ee(new je(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&t.textureCacheIds.splice(r,1),delete Q[e],t}}else if(e&&e.textureCacheIds){for(var n=0;nthis.baseTexture.width,a=r+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+n+" = "+(t+n)+" > "+this.baseTexture.width,l="Y: "+r+" + "+i+" = "+(r+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=n&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new Ee),We(t._EMPTY),We(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),t._WHITE=new t(new Ee(new Pe(e))),We(t._WHITE),We(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(c),Ve=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return we(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,r){void 0===r&&(r=!0);var n=this.baseTexture.resolution,i=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var r=arguments,n=[],i=1;i1?-n:-1:(o=((65535&(e=U(e)))<<16|65535&(t=U(t)))>>>0,n>1&&(o+=4294967296*n)),this.texturePool[o]||(this.texturePool[o]=[]);var a=this.texturePool[o].pop();return a||(a=this.createTexture(e,t,n)),a.filterPoolKey=o,a.setResolution(r),a},e.prototype.getFilterTexture=function(e,t,r){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var r=this.texturePool[t];if(r)for(var n=0;n0&&e.height>0,this.texturePool)if(Number(t)<0){var r=this.texturePool[t];if(r)for(var n=0;n1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),r[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}r[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var r=this.renderer,n=r.renderTexture,o=r.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,n.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,r,n){var o=this.renderer;o.state.set(e.state),this.bindAndClear(r,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var r=this.activeState,n=r.sourceFrame,i=r.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,n.x,n.y),s=t.worldTransform.copyTo(ce.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,r,n){return void 0===r&&(r=1),void 0===n&&(n=i.l.NONE),this.texturePool.getOptimalTexture(e,t,r,n)},e.prototype.getFilterTexture=function(e,t,r){if("number"==typeof e){var n=e;e=t,t=n}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var r=ot[0],n=ot[1],i=ot[2],o=ot[3];r.set(t.left,t.top),n.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(r,r),e.apply(n,n),e.apply(i,i),e.apply(o,o);var a=Math.min(r.x,n.x,i.x,o.x),s=Math.min(r.y,n.y,i.y,o.y),u=Math.max(r.x,n.x,i.x,o.x),l=Math.max(r.y,n.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,r,n,i){if(!(e.width<=0||e.height<=0||r.width<=0||r.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?at.copyFrom(i):at.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),ut=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),lt=function(){function e(e){this.renderer=e,this.emptyRenderer=new ut(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var r=this.renderer.texture.boundTextures,n=t-1;n>=0;--n)e[n]=r[n]||null,e[n]&&(e[n]._batchLocation=n)},e.prototype.boundArray=function(e,t,r,n){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(r=e.getContext("webgl2",t)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=r||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),dt=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ft=new ue,pt=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new ze(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ue,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;n.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,r=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,r){void 0===r&&(r=0);var n=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==r&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=r),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,r)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>r,u=t.height>>r,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>r,u=e.height>>r,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,r,n){var i=this.viewport;e=Math.round(e),t=Math.round(t),r=Math.round(r),n=Math.round(n),i.width===r&&i.height===n&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=r,i.height=n,this.gl.viewport(e,t,r,n))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,r,n,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,r,n),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,r=new dt(t.createFramebuffer());return r.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(e),e.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(e){var t=this.gl,r=e.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,r.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.RGBA8,e.width,e.height)),r.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),r.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var n=e.colorTextures,i=n.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(n.msaaBuffer=n.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.RGBA8,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(r.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a=[],s=0;s1&&r.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?n.stencil&&(r.deleteRenderbuffer(n.stencil),n.stencil=null):(n.stencil=n.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,n.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,r=i.l.NONE;if(e<=1||null===t)return r;for(var n=0;n=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&n.deleteRenderbuffer(r.msaaBuffer),r.stencil&&n.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r0&&(t+="\nelse "),r=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),Tt=t}return Tt}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);wt=t.precision?i.m.HIGH:i.m.MEDIUM}}return wt}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,r,n){var i=t+r,o=q[i];return o||(q[i]=o=new e(t,r,n)),o},e}(),Ft=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof nt?t:new nt(t):new nt({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var r in t.uniforms){var n=t.uniforms[r];if(n.group&&this.checkUniformExists(e,n))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,r,n){return new e(Bt.from(t,r),n)},e}(),Ut=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),Wt=function(e){function t(r,i,o){var a=this,s=Bt.from(r||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=n.b.FILTER_RESOLUTION,a.multisample=n.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new Ut,a}return we(t,e),t.prototype.apply=function(e,t,r,n,i){e.applyFilter(this,t,r,n)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(Ft),Gt=new ce,Vt=function(){function e(e,t){this._texture=e,this.mapCoord=new ce,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var r=this.mapCoord,n=0;n1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var r=e.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(t.isMatrixRotated(r.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,r,n,i,o){t.isMatrixRotated(o)||((o=o?Xt.copyFrom(o):Xt.identity()).translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}($t),Qt=function(e){function t(t){var r=e.call(this,t)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return we(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,r=this.renderer.gl,n=e._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),e._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,n,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}($t),Zt=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ce,this.transform=null}return e.prototype.update=function(e,t,r,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,n),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,r,n){var i=this.projectionMatrix,o=n?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Kt=new ue,Jt=new ue,er=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ue,this.destinationFrame=new ue,this.viewportFrame=new ue}return e.prototype.bind=function(e,t,r){void 0===e&&(e=null);var n,i,o,a=this.renderer;this.current=e,e?(o=(n=e.baseTexture).resolution,t||(Kt.width=e.frame.width,Kt.height=e.frame.height,t=Kt),r||(Jt.x=e.frame.x,Jt.y=e.frame.y,Jt.width=t.width,Jt.height=t.height,r=Jt),i=n.framebuffer):(o=a.resolution,t||(Kt.width=a.screen.width,Kt.height=a.screen.height,t=Kt),r||((r=Kt).width=t.width,r.height=t.height));var s=this.viewportFrame;s.x=r.x*o,s.y=r.y*o,s.width=r.width*o,s.height=r.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(r,t,o,!i),e?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(r)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var r=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,i=r.width!==n.width||r.height!==n.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function tr(e,t,r,n,i){r.buffer.update(i)}var rr={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},nr={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var ir=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var or=0,ar={textureCount:0,uboCount:0},sr=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=or++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof Pt)return Pt;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");Pt=!0===e({a:"b"},"a","b")}catch(e){Pt=!1}return Pt}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var r=e.program,n=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==r&&(this.program=r,this.gl.useProgram(n.program)),t||(ar.textureCount=0,ar.uboCount=0,this.syncUniformGroup(e.uniformGroup,ar)),n},e.prototype.setUniforms=function(e){var t=this.shader.program,r=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(r.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var r=this.getGlProgram();e.static&&e.dirtyId===r.uniformDirtyGroups[e.id]||(r.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,r,t))},e.prototype.syncUniforms=function(e,t,r){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,r)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var r,n=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!=0&&n<16){var s=n%r%16;n+=s,i+=s}n+r>16?(i=16*Math.ceil(i/16),a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var r=[];for(var n in e)t[n]&&r.push(t[n]);return r.sort((function(e,t){return e.index-t.index})),r}(e.uniforms,t)),n=r.uboElements,i=r.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=Et(s.data.type),p=Math.max(nr[s.data.type]/16,1),v=f/p,g=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+g+";\n }\n\n ")}else{var m=rr[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+m+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,r){var n=e.uniforms,i=[r+"-"];for(var o in n)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,r=e.program,n=function(e,t){var r,n,i,o,a=yt(e,e.VERTEX_SHADER,t.vertexSrc),s=yt(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(n=u,i=a,o=s,(r=e).getProgramParameter(n,r.LINK_STATUS)||(r.getShaderParameter(i,r.COMPILE_STATUS)||_t(r,i),r.getShaderParameter(o,r.COMPILE_STATUS)||_t(r,o),console.error("PixiJS Error: Could not initialize shader."),""!==r.getProgramInfoLog(n)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(n)))),t.attributeData=function(e,t){for(var r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,r++;this.stateId=e.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,r=!1,n=0;nthis.maxIdle&&(e.destroyTexture(i,!0),t[n]=null,r=!0)}if(r){var o=0;for(n=0;n=0;n--)this.unload(e.children[n])},e.prototype.destroy=function(){this.renderer=null},e}(),cr=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},hr=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ee,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,r,n,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=M,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((r={})[i.h.RGBA]=e.RGBA8,r[i.h.RGB]=e.RGB8,r[i.h.RG]=e.RG8,r[i.h.RED]=e.R8,r[i.h.RGBA_INTEGER]=e.RGBA8UI,r[i.h.RGB_INTEGER]=e.RGB8UI,r[i.h.RG_INTEGER]=e.RG8UI,r[i.h.RED_INTEGER]=e.R8UI,r[i.h.ALPHA]=e.ALPHA,r[i.h.LUMINANCE]=e.LUMINANCE,r[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,r),t[i.r.BYTE]=((n={})[i.h.RGBA]=e.RGBA8_SNORM,n[i.h.RGB]=e.RGB8_SNORM,n[i.h.RG]=e.RG8_SNORM,n[i.h.RED]=e.R8_SNORM,n[i.h.RGBA_INTEGER]=e.RGBA8I,n[i.h.RGB_INTEGER]=e.RGB8I,n[i.h.RG_INTEGER]=e.RG8I,n[i.h.RED_INTEGER]=e.R8I,n),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((g={})[i.h.RGB]=e.RGB9_E5,g),t[i.r.UNSIGNED_INT_24_8]=((m={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,m),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),T=t):((_={})[i.r.UNSIGNED_BYTE]=((b={})[i.h.RGBA]=e.RGBA,b[i.h.RGB]=e.RGB,b[i.h.ALPHA]=e.ALPHA,b[i.h.LUMINANCE]=e.LUMINANCE,b[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,b),_[i.r.UNSIGNED_SHORT_5_6_5]=((x={})[i.h.RGB]=e.RGB,x),_[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),_[i.r.UNSIGNED_SHORT_5_5_5_1]=((S={})[i.h.RGBA]=e.RGBA,S),T=_),T);var k=M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=k;for(var E=0;E=0;--o){var a=t[o];a&&a._glTextures[n].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new cr(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var r,n;t.internalFormat=null!==(n=null===(r=this.internalFormats[e.type])||void 0===r?void 0:r[e.format])&&void 0!==n?n:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var r=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(r,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,o=e.realHeight,a=r.gl;(t.width!==n||t.height!==o||t.dirtyId<0)&&(t.width=n,t.height=o,a.texImage2D(e.target,0,t.internalFormat,n,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var r=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),r.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var n=this.managedTextures.indexOf(e);-1!==n&&function(e,t,r){var n,i=e.length;if(!(t>=i||0===r)){var o=i-(r=t+r>i?i-t:r);for(n=t;n=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var r=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&r.generateMipmap(e.target),r.texParameteri(e.target,r.TEXTURE_WRAP_S,t.wrapMode),r.texParameteri(e.target,r.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(e.target,r.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),dr=new ce,fr=function(e){function t(t,r){void 0===t&&(t=i.n.UNKNOWN);var o=e.call(this)||this;return r=Object.assign({},n.b.RENDER_OPTIONS,r),o.options=r,o.type=t,o.screen=new ue(0,0,r.width,r.height),o.view=r.view||document.createElement("canvas"),o.resolution=r.resolution||n.b.RESOLUTION,o.useContextAlpha=r.useContextAlpha,o.autoDensity=!!r.autoDensity,o.preserveDrawingBuffer=r.preserveDrawingBuffer,o.clearBeforeRender=r.clearBeforeRender,o._backgroundColor=0,o._backgroundColorRgba=[0,0,0,1],o._backgroundColorString="#000000",o.backgroundColor=r.backgroundColor||o._backgroundColor,o.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&($("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),o.useContextAlpha=r.transparent,o.backgroundAlpha=r.transparent?0:1),o._lastObjectRendered=null,o.plugins={},o}return we(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var r=this.view.width/this.resolution,n=this.view.height/this.resolution;this.screen.width=r,this.screen.height=n,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=n+"px"),this.emit("resize",r,n)},t.prototype.generateTexture=function(e,t,r,n){void 0===t&&(t={}),"number"==typeof t&&($("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:r,region:n});var i=t.region,o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i>16&255)/255,n[1]=(r>>8&255)/255,n[2]=(255&r)/255},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(c),pr=function(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},vr=function(){function e(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return e.prototype.destroy=function(){this.renderer=null},e.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},e.prototype.bind=function(e){var t=this.gl,r=this.CONTEXT_UID,n=e._glBuffers[r]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)},e.prototype.bindBufferBase=function(e,t){var r=this.gl,n=this.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var i=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,i.buffer)}},e.prototype.bindBufferRange=function(e,t,r){var n=this.gl,i=this.CONTEXT_UID;r=r||0;var o=e._glBuffers[i]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,256*r,256)},e.prototype.update=function(e){var t=this.gl,r=this.CONTEXT_UID,n=e._glBuffers[r];if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),r=0;r-1){var r=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");z=!0}}(2===n.context.webGLVersion?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}we(t,e),t.create=function(e){if(void 0===j&&(j=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:n.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!r||!r.getContextAttributes().stencil);if(r){var o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,i}catch(e){return!1}}()),j)return new t(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},t.prototype.contextChange=function(){var e,t=this.gl;if(1===this.context.webGLVersion){var r=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,r)}else r=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,r);e>=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var r=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var n in this[t]=r,this.runners)this.runners[n].add(r);return this},t.prototype.render=function(e,t){var r,n,i,o;if(t&&(t instanceof Ve?($("6.0.0","Renderer#render arguments changed, use options instead."),r=t,n=arguments[2],i=arguments[3],o=arguments[4]):(r=t.renderTexture,n=t.clear,i=t.transform,o=t.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(r||(this._lastObjectRendered=e),!o){var a=e.enableTempParent();e.updateTransform(),e.disableTempParent(a)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==n?n:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,r,n,i){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,n,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return $("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,r){t.__plugins=t.__plugins||{},t.__plugins[e]=r}}(fr);var gr=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},mr=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,r=this.MAX_TEXTURES,n=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++Ee._globalBatch,u=0,l=n[0],c=0;i.copyBoundTextures(o,r);for(var h=0;h=r&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,h),c=h,l=n[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h>16&255,n=e>>8&255,i=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((n=n*t+.5|0)<<8)+(i*t+.5|0)}(e._tintRGB,d):e._tintRGB+(255*d<<24),p=0;p0&&(t+="\nelse "),r0){var E=e.worldTransform,I=E.a,A=E.b,C=E.c,P=E.d,N=(b+x+w)/3,O=(S+T+M)/3,R=b-N,D=S-O,L=I*R+C*D,j=A*R+P*D,z=Math.sqrt(L*L+j*j),B=1+k/z;b=N+R*B,S=O+D*B,L=I*(R=x-N)+C*(D=T-O),j=A*R+P*D,x=N+R*(B=1+k/(z=Math.sqrt(L*L+j*j))),T=O+D*B,L=I*(R=w-N)+C*(D=M-O),j=A*R+P*D,w=N+R*(B=1+k/(z=Math.sqrt(L*L+j*j))),M=O+D*B}i.save(),i.beginPath(),i.moveTo(b,S),i.lineTo(x,T),i.lineTo(w,M),i.closePath(),i.clip();var F=p*y+m*g+v*_-y*g-m*v-p*_,U=b*y+m*w+x*_-y*w-m*x-b*_,W=p*x+b*g+v*w-x*g-b*v-p*w,G=p*y*w+m*x*g+b*v*_-b*y*g-m*v*w-p*x*_,V=S*y+m*M+T*_-y*M-m*T-S*_,H=p*T+S*g+v*M-T*g-S*v-p*M,Y=p*y*M+m*T*g+S*v*_-S*y*g-m*v*M-p*T*_;i.transform(U/F,V/F,W/F,H/F,G/F,Y/F),i.drawImage(f,0,0,h*c.resolution,d*c.resolution,0,0,h,d),i.restore(),this.renderer.invalidateBlendMode()}},e.prototype.renderMeshFlat=function(e){var t=this.renderer.context,r=e.geometry.getBuffer("aVertexPosition").data,n=r.length/2;t.beginPath();for(var i=1;i",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(145);function _(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+T(e));var o=e.indexOf("?"),s=-1!==o&&o127?R+="x":R+=O[D];if(!R.match(f)){var j=P.slice(0,I),z=P.slice(I+1),B=O.match(p);B&&(j.push(B[1]),z.unshift(B[2])),z.length&&(_="/"+z.join(".")+_),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=n.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!v[w])for(I=0,N=c.length;I0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=S.slice(-1)[0],k=(r.host||e.host||S.length>1)&&("."===M||".."===M)||""===M,E=0,I=S.length;I>=0;I--)"."===(M=S[I])?S.splice(I,1):".."===M?(S.splice(I,1),E++):E&&(S.splice(I,1),E--);if(!x&&!w)for(;E--;E)S.unshift("..");!x||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var A,C=""===S[0]||S[0]&&"/"===S[0].charAt(0);return T&&(r.hostname=r.host=C?"":S.length?S.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),(x=x||r.host&&S.length)&&!C&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(22)(r(14),"Map");e.exports=n},function(e,t,r){var n=r(187),i=r(62),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},function(e,t,r){var n=r(63),i=r(194),o=r(67);e.exports=function(e){return o(e)?n(e):i(e)}},function(e,t,r){(function(e){var n=r(14),i=r(191),o=t&&!t.nodeType&&t,a=o&&"object"==T(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u}).call(this,r(26)(e))},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(51),i=t&&!t.nodeType&&t,o=i&&"object"==T(e)&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,r(26)(e))},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(63),i=r(210),o=r(67);e.exports=function(e){return o(e)?n(e,!0):i(e)}},function(e,t,r){var n=r(58);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},function(e,t){e.exports="#define PI 3.14159265\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvUv = uv;\n\tfloat pixelHeight = (galleryHeight * 1.2) + 8.0;\n\tfloat pixelY = (pixelHeight * 0.5) - position.y;\n\tvPixelY = pixelY;\n\tvec4 newPosition = vec4(position, 1.0);\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D galleryTexture;\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvec4 color;\n\tif ((vPixelY >= 0.0) && (vPixelY <= galleryHeight)) {\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, 1.0 - (vPixelY / galleryHeight)));\n\t}\n\telse if ((vPixelY > galleryHeight) && (vPixelY < (galleryHeight + 8.0))) {\n\t\tcolor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tfloat alpha = 1.0 - ((vPixelY - (galleryHeight + 8.0)) / (galleryHeight * 0.2));\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, ((vPixelY - galleryHeight) + 8.0) / galleryHeight));\n\t\tcolor.a = alpha;\n\t\tvec4 shadow = vec4(0.0, 0.0, 0.0, 1.0);\n\t\tcolor = blendSrcOver(color, shadow);\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t,r){var n=r(148);e.exports=function(e,t){t=t||{};var r=new n,i=t.inPlace||!1,o=e.map((function(e){return i?e:{width:e.width,height:e.height,item:e}}));o=o.sort((function(e,t){return t.width*t.height-e.width*e.height})),r.fit(o);var a={width:o.reduce((function(e,t){return Math.max(e,t.x+t.width)}),0),height:o.reduce((function(e,t){return Math.max(e,t.y+t.height)}),0)};return i||(a.items=o),a}},function(e,t,r){var n=r(205);e.exports=function(e){return n(e,5)}},function(e,t,r){(function(t){var r="object"==T(t)&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(17))},function(e,t,r){var n=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,r,n,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),l.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n80*r){n=s=e[0],o=u=e[1];for(var _=r;_s&&(s=l),c>u&&(u=c);f=0!==(f=Math.max(s-n,u-o))?32767/f:0}return a(m,y,r,n,o,f,0),y}function i(e,t,r,n,i){var o,a;if(i===I(e,t,r,n)>0)for(o=t;o=t;o-=n)a=M(o,e[o],e[o+1],a);return a&&_(a,a.next)&&(k(a),a=a.next),a}function o(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!_(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(k(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function a(e,t,r,n,i,h,d){if(e){!d&&h&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,u,l=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(e,n,i,h);for(var f,v,g=e;e.prev!==e.next;)if(f=e.prev,v=e.next,h?u(e,n,i,h):s(e))t.push(f.i/r|0),t.push(e.i/r|0),t.push(v.i/r|0),k(e),e=v.next,g=v.next;else if((e=v)===g){d?1===d?a(e=l(o(e),t,r),t,r,n,i,h,2):2===d&&c(e,t,r,n,i,h):a(o(e),t,r,n,i,h,1);break}}}function s(e){var t=e.prev,r=e,n=e.next;if(y(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,u=r.y,l=n.y,c=io?i>a?i:a:o>a?o:a,f=s>u?s>l?s:l:u>l?u:l,p=n.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&g(i,s,o,u,a,l,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function u(e,t,r,n){var i=e.prev,o=e,a=e.next;if(y(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,h=o.y,d=a.y,f=su?s>l?s:l:u>l?u:l,_=c>h?c>d?c:d:h>d?h:d,b=p(f,v,t,r,n),x=p(m,_,t,r,n),w=e.prevZ,S=e.nextZ;w&&w.z>=b&&S&&S.z<=x;){if(w.x>=f&&w.x<=m&&w.y>=v&&w.y<=_&&w!==i&&w!==a&&g(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,S.x>=f&&S.x<=m&&S.y>=v&&S.y<=_&&S!==i&&S!==a&&g(s,c,u,h,l,d,S.x,S.y)&&y(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;w&&w.z>=b;){if(w.x>=f&&w.x<=m&&w.y>=v&&w.y<=_&&w!==i&&w!==a&&g(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=x;){if(S.x>=f&&S.x<=m&&S.y>=v&&S.y<=_&&S!==i&&S!==a&&g(s,c,u,h,l,d,S.x,S.y)&&y(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function l(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!_(i,a)&&b(i,n,n.next,a)&&S(i,a)&&S(a,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(a.i/r|0),k(n),k(n.next),n=e=a),n=n.next}while(n!==e);return o(n)}function c(e,t,r,n,i,s){var u=e;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&m(u,l)){var c=T(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,t,r,n,i,s,0),void a(c,t,r,n,i,s,0)}l=l.next}u=u.next}while(u!==e)}function h(e,t){return e.x-t.x}function d(e,t){var r=function(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a&&(a=s,r=n.x=n.x&&n.x>=c&&i!==n.x&&g(or.x||n.x===r.x&&f(r,n)))&&(r=n,d=u)),n=n.next}while(n!==l);return r}(e,t);if(!r)return t;var n=T(r,e);return o(n,n.next),o(r,r.next)}function f(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function p(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,r=e;do{(t.x=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&b(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(S(e,t)&&S(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||_(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function _(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,r,n){var i=w(y(e,t,r)),o=w(y(e,t,n)),a=w(y(r,n,e)),s=w(y(r,n,t));return i!==o&&a!==s||!(0!==i||!x(e,r,t))||!(0!==o||!x(e,n,t))||!(0!==a||!x(r,e,n))||!(0!==s||!x(r,t,n))}function x(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function w(e){return e>0?1:e<0?-1:0}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function T(e,t){var r=new E(e.i,e.x,e.y),n=new E(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function M(e,t,r,n){var i=new E(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function k(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function E(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,r,n){for(var i=0,o=t,a=r-n;o0&&(n+=e[i-1].length,r.holes.push(n))}return r}},function(e,t,r){var n=r(27),i=r(157),o=r(158),a=r(159),s=r(160),u=r(161);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(166),i=r(173),o=r(175),a=r(176),s=r(177);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tc))return!1;var d=u.get(e),f=u.get(t);if(d&&f)return d==t&&f==e;var p=-1,v=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++p-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(34),i=r(65);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},function(e,t,r){var n=r(69),i=r(37),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){var n=r(207);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},function(e,t,r){var n=r(61),i=r(71),o=r(39),a=r(62),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:a;e.exports=s},function(e,t,r){var n=r(66)(Object.getPrototypeOf,Object);e.exports=n},function(e,t){e.exports="varying vec2 vUv;\nvoid main() {\n\tvUv = uv;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform float lines[26];\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float direction;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat middleAlpha = 0.0;\n\tfloat endAlpha = 0.0;\n\tfloat headLength = 0.0;\n\tif (timePercent < 0.5) {\n\t\tmiddleAlpha = 1.0;\n\t\tendAlpha = 1.0 - (timePercent / 0.5);\n\t}\n\telse {\n\t\tmiddleAlpha = 1.0 - ((timePercent - 0.5) / 0.5);\n\t\tendAlpha = 0.0;\n\t}\n\tfor (int i = 0; i < 26; i++) {\n\t\tfloat halfDis = lines[i] / 2.0;\n\t\tfloat middle = headLength + halfDis;\n\t\theadLength += lines[i];\n\t\tif ((direction > 0.9) && (direction < 1.1)) {\n\t\t\tif (abs(vUv.y - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.y - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (abs(vUv.x - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.x - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tvec2 uv = vec2(vUv.x, vUv.y);\n\tmaxR = length(transform(vec2(1.0, 1.0)));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tdist = length(transform(uv));\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvec2 transformTo(vec2 uv, vec2 origin) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(origin.x, (origin.y * height) / width);\n}\nvec2 offset(float progress[4], float band, float amp, float radius, vec2 centerPosition) {\n\tvec2 tc = vUv.xy;\n\tvec2 uv = vec2(0.0, 0.0);\n\tvec2 p;\n\tfloat len;\n\tvec2 uv_offset;\n\tfloat wave_width = band * radius;\n\tfor (int i = 0; i < 4; i += 1) {\n\t\tif (progress[i] == -1.0) {\n\t\t\tcontinue;\n\t\t}\n\t\tp = tc - centerPosition;\n\t\tp.x = (p.x * width) / height;\n\t\tlen = length(p);\n\t\tfloat current_progress = progress[i];\n\t\tfloat current_radius = radius * current_progress;\n\t\tfloat damp_factor = 1.0;\n\t\tif (current_progress > .5) {\n\t\t\tdamp_factor = (1.0 - current_progress) * 2.0;\n\t\t}\n\t\tfloat cut_factor = clamp((wave_width * damp_factor) - abs(current_radius - len), 0.0, 1.0);\n\t\tfloat waves_factor = (4.0 * len) / radius;\n\t\tuv_offset = (((p / len) * cos((waves_factor - (current_progress * 10.0)) * 3.14)) * amp) * cut_factor;\n\t\tuv += uv_offset;\n\t}\n\treturn uv;\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tfloat progress[4];\n\tvec2 uv = vUv.xy;\n\tvec2 uvOffset = vec2(0.0, 0.0);\n\tvec2 startPosition = vec2(0.5, 0.5);\n\tfloat redius = 2.0;\n\tif (option == 1) {\n\t\tstartPosition = vec2(0.0, 0.0);\n\t}\n\telse if (option == 2) {\n\t\tstartPosition = vec2(1.0, 0.0);\n\t}\n\telse if (option == 3) {\n\t\tstartPosition = vec2(1.0, 1.0);\n\t}\n\telse if (option == 4) {\n\t\tstartPosition = vec2(0.0, 1.0);\n\t}\n\tmaxR = length(transformTo(vec2(1.0, 1.0), vec2(0.0, 0.0)));\n\tif (option == 0) {\n\t\tmaxR = maxR / 2.0;\n\t\tredius = redius / 2.0;\n\t}\n\tdist = length(transformTo(uv, startPosition));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tfor (int i = 0; i < 4; i++) {\n\t\tprogress[i] = timePercent + (0.1 * float(i));\n\t\tif (progress[i] < 0.0) {\n\t\t\tprogress[i] = 0.0;\n\t\t}\n\t}\n\tuvOffset = offset(progress, 0.2, 0.3, redius, startPosition);\n\tvec4 srcColor = texture2D(texturePrev, fract(vUv + uvOffset));\n\tvec4 distColor = texture2D(textureNext, fract(vUv + uvOffset));\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = option > 1 ? true : false;\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 0.5;\n\t\trectEnd = isRevert ? 0.5 : 1.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 0.5) + 0.5 : 1.0 - (((timePercent - 0.33) / 0.33) * 0.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 0.5 : 0.0;\n\t\trectEnd = isRevert ? 1.0 : 0.5;\n\t}\n\tfloat changAxis = (option % 2) == 0 ? vUv.x : vUv.y;\n\tif (changAxis >= rectEnd) {\n\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t}\n\telse if (changAxis <= rectStart) {\n\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t}\n\telse {\n\t\tsrcColor.a = alphaStart + (((changAxis - rectStart) / 0.5) * (alphaEnd - alphaStart));\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform sampler2D dissolveTexture;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 dissolveColor = texture2D(dissolveTexture, vUv);\n\tif (dissolveColor.r == 0.0) {\n\t\tresult = srcColor;\n\t}\n\telse {\n\t\tresult = distColor;\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (timePercent < 0.5) {\n\t\tfloat stagePercent = timePercent / 0.5;\n\t\tresult = srcColor + (stagePercent * (1.0 - srcColor));\n\t}\n\telse {\n\t\tfloat stagePercent = (timePercent - 0.5) / 0.5;\n\t\tresult = 1.0 - (stagePercent * (1.0 - distColor));\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (option == 1) {\n\t\tif (timePercent < 0.5) {\n\t\t\tsrcColor.rgb *= (1.0 - (timePercent * 2.0));\n\t\t\tgl_FragColor = srcColor;\n\t\t}\n\t\telse {\n\t\t\tdistColor.rgb *= ((timePercent - 0.5) * 2.0);\n\t\t\tgl_FragColor = distColor;\n\t\t}\n\t}\n\telse {\n\t\tsrcColor.a = 1.0 - timePercent;\n\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t}\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat changeAxis = (option % 2) == 1 ? vUv.x : vUv.y;\n\tbool changeAxisX = (option % 2) == 1;\n\tbool isRevert = option > 1;\n\tfloat line;\n\tif (isRevert) {\n\t\tline = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 3);\n\t}\n\telse {\n\t\tline = interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 3);\n\t}\n\tvec2 uv = vUv.xy;\n\tif (changeAxis > line) {\n\t\tif (changeAxisX) {\n\t\t\tuv.x -= line;\n\t\t}\n\t\telse {\n\t\t\tuv.y -= line;\n\t\t}\n\t}\n\telse {\n\t\tif (changeAxisX) {\n\t\t\tuv.x += (1.0 - line);\n\t\t}\n\t\telse {\n\t\t\tuv.y += (1.0 - line);\n\t\t}\n\t}\n\tif (isRevert) {\n\t\tresult = changeAxis > line ? texture2D(textureNext, uv) : texture2D(texturePrev, uv);\n\t}\n\telse {\n\t\tresult = changeAxis > line ? texture2D(texturePrev, uv) : texture2D(textureNext, uv);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool orient;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 rectLeft = direction ? vec2(0.25, 0.0) : vec2(0.25, 0.5);\n\tvec2 rectRight = direction ? vec2(1, 0.75) : vec2(0.5, 0.75);\n\tvec2 alphaLeft = vec2(1.0, 1.0);\n\tvec2 alphaRight = vec2(1.0, 1.0);\n\tif (timePercent <= 0.333) {\n\t\talphaLeft.y = 1.0 - (timePercent / 0.333);\n\t\talphaRight.x = 1.0 - (timePercent / 0.333);\n\t}\n\telse if ((timePercent <= 0.666) && (timePercent > 0.333)) {\n\t\trectLeft.x = direction ? (((timePercent - 0.333) / 0.333) * 0.25) + rectLeft.x : rectLeft.x - (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectLeft.y = direction ? rectLeft.x - 0.25 : rectLeft.x + 0.25;\n\t\trectRight.y = direction ? rectRight.y - (((timePercent - 0.333) / 0.333) * 0.25) : rectRight.y + (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectRight.x = direction ? rectRight.y + 0.25 : rectRight.y - 0.25;\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t}\n\telse {\n\t\trectLeft = direction ? vec2(0.5, 0.25) : vec2(0.0, 0.25);\n\t\trectRight = direction ? vec2(0.75, 0.5) : vec2(0.75, 1.0);\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t\talphaLeft.x = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t\talphaRight.y = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t}\n\tfloat axis = orient ? vUv.x : vUv.y;\n\tif (direction) {\n\t\tif ((axis < rectLeft.y) || (axis > rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse if ((axis > rectLeft.x) && (axis < rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis < rectLeft.x) && (axis > rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.y - (((axis - rectLeft.y) / (rectLeft.x - rectLeft.y)) * (alphaLeft.y - alphaLeft.x));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.x - (((rectRight.x - axis) / (rectLeft.x - rectLeft.y)) * (alphaRight.x - alphaRight.y));\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tif ((axis < rectLeft.x) || (axis > rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse if ((axis > rectLeft.y) && (axis < rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis >= rectLeft.x) && (axis <= rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.x - (((axis - rectLeft.x) / (rectLeft.y - rectLeft.x)) * (alphaLeft.x - alphaLeft.y));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.y - (((rectRight.y - axis) / (rectLeft.y - rectLeft.x)) * (alphaRight.y - alphaRight.x));\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool thruBlk;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 uv4 = vec4(vUv.xy, 1.0, 1.0);\n\tfloat scale;\n\tfloat transform;\n\tif (timePercent < 0.5) {\n\t\tscale = 1.0 - ((timePercent / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\telse {\n\t\tscale = 0.95 + (((timePercent - 0.5) / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\tmat4 matrix = mat4(scale, 0.0, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, transform, transform, 0.0, 1.0);\n\tvec4 uv = matrix * uv4;\n\tvec4 srcColor = texture2D(texturePrev, uv.xy);\n\tvec4 distColor = texture2D(textureNext, uv.xy);\n\tvec4 result = timePercent < 0.5 ? srcColor : distColor;\n\tvec3 start;\n\tvec3 end;\n\tvec3 middleColor = thruBlk ? vec3(0.0, 0.0, 0.0) : vec3(1.0, 1.0, 1.0);\n\tif ((timePercent < 0.25) || (timePercent > 0.75)) {\n\t\tresult *= 1.0;\n\t}\n\telse if ((timePercent >= 0.25) && (timePercent <= 0.5)) {\n\t\tif (timePercent <= 0.375) {\n\t\t\tstart = result.rgb;\n\t\t\tend = start + (((timePercent - 0.25) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb + (((timePercent - 0.375) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\telse if ((timePercent > 0.5) && (timePercent <= 0.75)) {\n\t\tif (timePercent < 0.625) {\n\t\t\tstart = middleColor - (((timePercent - 0.5) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb;\n\t\t\tend = middleColor - (((timePercent - 0.625) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x <= lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionX > 0) && (vUv.x >= lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionY < 0) && (vUv.y <= lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionY > 0) && (vUv.y >= lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x > lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionX > 0) && (vUv.x < lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionY < 0) && (vUv.y > lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionY > 0) && (vUv.y < lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 result;\n\tfloat resultAlpha;\n\tif (timePercent < 0.5) {\n\t\tresult = srcColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(0.0, 1.0, 0.0, 0.5, timePercent, 0);\n\t\tresultAlpha = srcColor.a;\n\t}\n\telse {\n\t\tresult = distColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(1.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t\tresultAlpha = distColor.a;\n\t}\n\tresult *= yuv2rgb;\n\tgl_FragColor = vec4(result.rgb, resultAlpha);\n}\n"},function(e,t){e.exports="uniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute vec2 segment;\nattribute float times;\nattribute int option;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec2 segmentOrigin = vec2(((segment.x + 0.5) * segmentWidth) - (width * 0.5), (height * 0.5) - ((1.0 * (segment.y + 0.5)) * segmentHeight));\n\tif (timePercent > times) {\n\t\tfloat percent = (timePercent - times) / 0.7;\n\t\tif (percent > 1.0) {\n\t\t\tpercent = 1.0;\n\t\t}\n\t\tif (percent > 0.5) {\n\t\t\tpercent += 1.0;\n\t\t}\n\t\tmat4 matrix = mat4(cos((-1.0 * percent) * 3.14), 0.0, sin((-1.0 * percent) * 3.14), 0.0, 0.0, 1.0, 0.0, 0.0, -sin((-1.0 * percent) * 3.14), 0.0, cos((-1.0 * percent) * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\tif (option == 1) {\n\t\t\tmatrix = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(percent * 3.14), -sin(percent * 3.14), 0.0, 0.0, sin(percent * 3.13), cos(percent * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\t}\n\t\tnewPosition.x -= segmentOrigin.x;\n\t\tnewPosition.y -= segmentOrigin.y;\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += segmentOrigin.x;\n\t\tnewPosition.y += segmentOrigin.y;\n\t\tif (segment.x < (horizontalSegments / 2.0)) {\n\t\t\tfakePercent = percent - (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t\telse {\n\t\t\tfakePercent = percent + (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (fakePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif ((fakePercent < 0.5) && (fakePercent > 0.35)) {\n\t\tcolor.a = 0.5;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform float duration;\nattribute vec2 segment;\nattribute float times;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tmat4 matrix;\n\tfloat stagePercent;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfTimePercent = (timePercent - times) / (4.0 / 5.0);\n\tif (selfTimePercent < 0.0) {\n\t\tselfTimePercent = 0.0;\n\t}\n\telse if (selfTimePercent > 1.0) {\n\t\tselfTimePercent = 1.0;\n\t}\n\tif (selfTimePercent < (2.0 / 5.0)) {\n\t\tstagePercent = selfTimePercent / (2.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 0.5);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t}\n\telse if ((selfTimePercent >= (2.0 / 5.0)) && (selfTimePercent < (3.0 / 5.0))) {\n\t\tstagePercent = (selfTimePercent - (2.0 / 5.0)) / (1.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tnewPosition = rotateY((-1.0 * PI) * 0.5) * newPosition;\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 2.0);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= (width * stagePercent);\n\t}\n\telse {\n\t\tfloat offset = (((newPosition.x + (0.5 * width)) / width) * 2.0) / 5.0;\n\t\tstagePercent = (selfTimePercent - (1.0 / 5.0)) / ((2.0 / 5.0) + offset);\n\t\tif (stagePercent > 1.0) {\n\t\t\tstagePercent = 1.0;\n\t\t}\n\t\tvec4 vvUvv = vec4(vUv.x - 0.5, vUv.y - 0.5, 0.0, 1.0);\n\t\tvvUvv = rotateY(-1.0 * PI) * vvUvv;\n\t\tvUv = vvUvv.xy + 0.5;\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY((((-1.0 * stagePercent) * PI) * 0.5) - (PI * 2.5));\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= width;\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tvUv = uv;\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (timePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif (timePercent < 0.0001) {\n\t\tcolor = srcColor;\n\t}\n\telse if (timePercent > 0.9999) {\n\t\tcolor = distColor;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float index;\nattribute float type;\nattribute float delay;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segments;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tvType = type;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfPercent = (timePercent - delay) / 0.7;\n\trotatePercent = selfPercent;\n\tif (selfPercent < 0.0) {\n\t\tselfPercent = 0.0;\n\t}\n\telse if (selfPercent > 1.0) {\n\t\tselfPercent = 1.0;\n\t}\n\tfloat offsetX = ((segments * segmentWidth) * 0.5) - ((index + 0.5) * segmentWidth);\n\tfloat offsetZ = segmentWidth * 0.5;\n\tnewPosition.x += offsetX;\n\tnewPosition.z += offsetZ;\n\tnewPosition.x *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition.z *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition = rotateY((PI * 0.5) * selfPercent) * newPosition;\n\tnewPosition.x -= offsetX;\n\tnewPosition.z -= offsetZ;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 srcYuv;\n\tvec3 distYuv;\n\tif (rotatePercent < 0.5) {\n\t\tdistYuv = distColor.rgb * rgb2yuv;\n\t\tdistYuv.r *= (1.0 - (abs(rotatePercent - 0.5) / 0.5));\n\t\tdistColor = vec4(distYuv * yuv2rgb, distColor.a);\n\t}\n\telse {\n\t\tsrcYuv = distColor.rgb * rgb2yuv;\n\t\tsrcYuv.r *= (abs(rotatePercent - 0.5) / 0.5);\n\t\tsrcColor = vec4(srcYuv * yuv2rgb, srcColor.a);\n\t}\n\tvec4 color = vType < 0.5 ? srcColor : distColor;\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float easeInFloat(float t, float b, float c, float d) {\n\tt = t / d;\n\treturn ((c * t) * t) + b;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.141592653\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute float isLeft;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvUv = uv;\n\tfloat scaleX;\n\tfloat transform;\n\tfloat displacement;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec4 glPosition = (projectionMatrix * modelViewMatrix) * newPosition;\n\tfloat crestCount = 24.0;\n\tfloat width = horizontalSegments * segmentWidth;\n\tfloat height = verticalSegments * segmentHeight;\n\tfloat heightFactor = (newPosition.y + (height * 0.5)) / height;\n\tfloat scaleY = interpolationFloat(1.0, 1.05, 0.0, 0.11, timePercent, 0);\n\tnewPosition.y += (height * 0.5);\n\tnewPosition.y *= scaleY;\n\tnewPosition.y -= (height * 0.5);\n\tnewPosition.y += 10.0;\n\tif ((timePercent > 0.0) && (timePercent < 0.333)) {\n\t\tfloat delay = (1.0 - heightFactor) * 0.1;\n\t\tscaleX = interpolationFloat(1.0, 0.5, 0.0 + delay, 0.333, timePercent, 1);\n\t}\n\telse if ((timePercent >= 0.333) && (timePercent < 0.5)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.25, 0.333, 0.5, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if ((timePercent >= 0.5) && (timePercent < 0.583)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.25, 0.5, 0.5, 0.583, timePercent, 1);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if (timePercent >= 0.583) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.75, 0.583, 0.666, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop + incr;\n\t}\n\tif (timePercent > 0.583) {\n\t\tdisplacement = (isLeft < 0.5 ? 1.0 : -1.0) * interpolationFloat(0.0, width / 2.0, 0.583, 1.0, timePercent, 0);\n\t}\n\tfloat ampTop = interpolationFloat(0.0, 1.0, 0.0, 0.11, timePercent, 0);\n\tfloat ampBottom = interpolationFloat(0.0, 1.0, 0.11, 0.22, timePercent, 0);\n\tfloat amp = ampBottom + (heightFactor * abs(ampBottom - ampTop));\n\tfloat foo = newPosition.x * ((crestCount * PI) / width);\n\tnewPosition.z = (amp * cos(foo + (PI / 2.0))) * 20.0;\n\ttransform = (isLeft < 0.5 ? -1.0 : 1.0) * (width * 0.5);\n\tnewPosition.x += transform;\n\tnewPosition.x *= scaleX;\n\tnewPosition.x -= transform;\n\tnewPosition.x += displacement;\n\tshadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (newPosition.z < 15.0) {\n\t\tfloat alpha = 0.3 * (1.0 - ((newPosition.z + 20.0) / 35.0));\n\t\tshadow.a = alpha * amp;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = blendSrcOver(shadow, srcColor);\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265\nuniform float timePercent;\nuniform float aCoefficient;\nuniform float zCurveLimit;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat curve;\n\tfloat progress = option == 1 ? halfWidth - newPosition.x : newPosition.x + halfWidth;\n\tfloat aStart = interpolationFloat(0.00000009, aCoefficient, 0.0, 0.5, timePercent, 0);\n\tfloat aEnd = 0.0000009;\n\tfloat zStart = interpolationFloat(0.0, zCurveLimit, 0.0, 0.5, timePercent, 0);\n\tfloat zEnd = 0.0;\n\tfloat a = interpolationFloat(aStart, aEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat z = interpolationFloat(zStart, zEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.z -= (((-a * newPosition.y) * newPosition.y) + z);\n\tfloat scaleYStart = interpolationFloat(1.0, 0.8, 0.0, 0.5, timePercent, 0);\n\tfloat scaleYEnd = 1.0;\n\tfloat scaleY = interpolationFloat(scaleYStart, scaleYEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.y += halfHeight;\n\tnewPosition.y *= scaleY;\n\tfloat angle = interpolationFloat(0.0, -((2.0 * PI) / 3.0), 0.111, 1.0, timePercent, 1);\n\tmat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tnewPosition = rotateX * newPosition;\n\tnewPosition.y -= halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, alpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec2 shadowPosition = vec2(position.xy);\n\tfloat presetAngle = option == 1 ? 0.77 : 0.27;\n\tfloat rotateAngle = PI * presetAngle;\n\tfloat min_r = halfWidth * 0.05;\n\tshadowPosition = rotateOrigin(rotateAngle) * shadowPosition;\n\tvec4 newPosition = vec4(shadowPosition.xy, position.z, 1.0);\n\tfloat line = interpolationFloat(0.0, halfWidth * 2.8, 0.0, 1.0, timePercent, 1);\n\tfloat dis2BaseLine = halfWidth - newPosition.x;\n\tfloat dis2Line = line - dis2BaseLine;\n\tfloat L = line <= (halfWidth * 2.0) ? line : halfWidth * 2.0;\n\tfloat r = L / PI;\n\tr = r < min_r ? min_r : r;\n\tfloat angle = dis2Line / r;\n\tif (((dis2Line > 0.0) && (dis2Line < (line * 0.5))) && (r > min_r)) {\n\t\tshadowAlpha = interpolationFloat(0.0, 0.3, 0.0, line * 0.5, dis2Line, 0);\n\t}\n\telse {\n\t\tshadowAlpha = 0.0;\n\t}\n\tif (dis2BaseLine < line) {\n\t\tnewPosition.x = ((sin(angle) * r) + halfWidth) - line;\n\t\tnewPosition.z = (r - (cos(angle) * r)) * 0.5;\n\t}\n\tvec2 finalPosition = vec2(newPosition.xy);\n\tfinalPosition = rotateOrigin(-rotateAngle) * finalPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(finalPosition.xy, newPosition.z, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, shadowAlpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateX(float angle) {\n\treturn mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat progress = option == 0 ? halfWidth - newPosition.x : halfWidth + newPosition.x;\n\tfloat delay = interpolationFloat(0.0, 0.08, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat arc = halfHeight - newPosition.y;\n\tfloat L;\n\tif (timePercent < 0.8) {\n\t\tL = interpolationFloat(halfHeight * 4.0, halfHeight * 22.0, 0.3 + delay, 0.8, timePercent, 0);\n\t}\n\telse {\n\t\tL = interpolationFloat(halfHeight * 22.0, halfHeight * 300.0, 0.8, 1.0, timePercent, 0);\n\t}\n\tfloat r = L / (2.0 * PI);\n\tfloat angle = PI - (arc / r);\n\tfloat y = sin(angle) * r;\n\tfloat z = cos(angle) * r;\n\tnewPosition.y = halfHeight - y;\n\tnewPosition.z = (z + r) * 0.45;\n\tfloat rotateAngle = interpolationFloat(-PI * 0.5, 0.0, 0.0 + delay, 0.4, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(rotateAngle) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate1 = interpolationFloat(0.0, PI * 0.03, 0.75, 0.9, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate1) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate2 = interpolationFloat(0.0, -PI * 0.03, 0.8, 1.0, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate2) * newPosition;\n\tnewPosition.y += halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tgl_FragColor = blendSrcOver(shadow, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat shadowAngle = PI / 6.0;\n\tfloat clockAngle;\n\tvec2 a;\n\tvec2 b = transform(vUv);\n\tfloat angle;\n\tif (timePercent < 0.5) {\n\t\ta = vec2(0.0, 0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI, 0.0, 0.5, timePercent, 0);\n\t\tif (b.x > 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t}\n\telse {\n\t\ta = vec2(0.0, -0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI + shadowAngle, 0.5, 1.0, timePercent, 0);\n\t\tif (b.x <= 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uv = vUv;\n\tbool useSrc = false;\n\tvec2 row;\n\tfloat delay = 0.02;\n\tbool isVert = bool(option);\n\tint segmentCount = isVert ? 10 : 7;\n\tfloat axis = isVert ? uv.y : uv.x;\n\tfloat compareAxis = isVert ? uv.x : uv.y;\n\tfor (int i = 0; i < segmentCount; i++) {\n\t\tfloat fi = float(i);\n\t\trow.r = (fi * 1.0) / float(segmentCount);\n\t\trow.g = (float(i + 1) * 1.0) / float(segmentCount);\n\t\tif ((compareAxis <= row.g) && (compareAxis > row.r)) {\n\t\t\tif ((i % 2) == 0) {\n\t\t\t\tfloat line = interpolationFloat(0.0, 1.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\taxis -= line;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfloat line = interpolationFloat(1.0, 0.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\taxis = (1.0 - line) + axis;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (isVert) {\n\t\tuv.y = axis;\n\t}\n\telse {\n\t\tuv.x = axis;\n\t}\n\tvec4 srcColor = texture2D(texturePrev, uv);\n\tvec4 distColor = texture2D(textureNext, uv);\n\tgl_FragColor = useSrc ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uvSrc = vUv;\n\tvec2 uvDist = vUv;\n\tfloat scaleSrc = option == 1 ? interpolationFloat(1.0, 2.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(1.0, 0.1, 0.0, 1.0, timePercent, 0);\n\tfloat scaleDist = option == 1 ? interpolationFloat(0.1, 1.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(2.0, 1.0, 0.0, 1.0, timePercent, 0);\n\tuvSrc -= 0.5;\n\tuvSrc *= scaleSrc;\n\tuvSrc += 0.5;\n\tuvDist -= 0.5;\n\tuvDist *= scaleDist;\n\tuvDist += 0.5;\n\tvec4 srcColor = texture2D(texturePrev, uvSrc);\n\tsrcColor.a = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 0);\n\tvec4 distColor;\n\tif ((((uvDist.x > 1.0) || (uvDist.x < 0.0)) || (uvDist.y > 1.0)) || (uvDist.y < 0.0)) {\n\t\tdistColor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tdistColor = texture2D(textureNext, uvDist);\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\tif (option == 1) {\n\t\tangle *= -1.0;\n\t}\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat stageOneAngle = PI / 14.0;\n\tfloat stageTwoAngle = (PI * 12.0) / 14.0;\n\tfloat stage_1 = 0.1;\n\tfloat stage_2 = 0.8;\n\tif (timePercent < 0.5) {\n\t\tnewPosition.z = interpolationFloat(0.0, -100.0, 0.0, 0.5, timePercent, 0);\n\t}\n\telse {\n\t\tnewPosition.z = interpolationFloat(-100.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t}\n\tif (timePercent < stage_1) {\n\t\tfloat angle = interpolationFloat(0.0, stageOneAngle, 0.0, stage_1, timePercent, 0);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x -= halfWidth;\n\t}\n\telse if ((timePercent >= stage_1) && (timePercent < stage_2)) {\n\t\tif (timePercent > 0.5) {\n\t\t\tnewPosition *= rotateY(PI);\n\t\t}\n\t\tfloat offset = halfWidth - (sin((PI * 0.5) - stageOneAngle) * halfWidth);\n\t\tfloat angle = interpolationFloat(0.0, stageTwoAngle, stage_1, stage_2, timePercent, 0);\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(stageOneAngle);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition.x += interpolationFloat(0.0, 2.0 * offset, stage_1, stage_2, timePercent, 0);\n\t}\n\telse {\n\t\tfloat angle = interpolationFloat(-stageOneAngle, 0.0, stage_2, 1.0, timePercent, 0);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tgl_FragColor = timePercent < 0.5 ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = (option == 3) || (option == 2);\n\tbool rotateParam = (option == 3) || (option == 1);\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 1.5;\n\t\trectEnd = isRevert ? 0.5 : 2.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 1.5) + 0.5 : 2.0 - (((timePercent - 0.33) / 0.33) * 1.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 1.5 : 0.0;\n\t\trectEnd = isRevert ? 2.0 : 0.5;\n\t}\n\tif (!rotateParam) {\n\t\trectStart -= 1.0;\n\t\trectEnd -= 1.0;\n\t}\n\tfloat rotate = rotateParam ? PI * 0.25 : PI * 0.75;\n\tvec2 rotateUv = vUv * rotateOrigin(rotate);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 startPoint = vec2(rectStart, 0.0) * rotateOrigin(rotate);\n\tvec2 endPoint = vec2(rectEnd, 0.0) * rotateOrigin(rotate);\n\tif (rotateParam) {\n\t\tif (rotateUv.x >= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x <= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((rotateUv.x - startPoint.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\telse {\n\t\tif (rotateUv.x <= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x >= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((startPoint.x - rotateUv.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float left;\nuniform float timePercent;\nuniform float offset;\nvarying vec2 vUv;\nuniform float option;\nvoid main() {\n\tvUv = uv;\n\tfloat angle;\n\tif (left > 0.0) {\n\t\tangle = (PI / 6.0) * timePercent;\n\t}\n\telse {\n\t\tangle = (-PI / 6.0) * timePercent;\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\tangle = (-PI / 6.0) * timePercent;\n\t\t}\n\t\telse {\n\t\t\tangle = (PI / 6.0) * timePercent;\n\t\t}\n\t}\n\tvec4 newPosition = vec4(position, 1.0);\n\tmat4 transform;\n\tmat4 rotateY = mat4(cos(angle), 0.0, -sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, sin(angle), 0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tif (option > 0.5) {\n\t\trotateY = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), -sin(angle), 0.0, 0.0, sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, offset * timePercent, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -offset * timePercent, 0.0, 1.0);\n\t\t}\n\t}\n\telse {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t}\n\tnewPosition = transform * newPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D prevTexture;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 color = texture2D(prevTexture, vUv);\n\tcolor.a = 1.0 - timePercent;\n\tgl_FragColor = color;\n}\n"},function(e,t,r){(function(e){var n=r(109),i=r(110),o=setTimeout;function a(e){return Boolean(e&&void 0!==e.length)}function s(){}function u(e){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function l(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,u._immediateFn((function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var n;try{n=r(e._value)}catch(e){return void h(t.promise,e)}c(t.promise,n)}else(1===e._state?c:h)(t.promise,e._value)}))):e._deferreds.push(t)}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==T(t)||"function"==typeof t)){var r=t.then;if(t instanceof u)return e._state=3,e._value=t,void d(e);if("function"==typeof r)return void p((n=r,i=t,function(){n.apply(i,arguments)}),e)}e._state=1,e._value=t,d(e)}catch(t){h(e,t)}var n,i}function h(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&u._immediateFn((function(){e._handled||u._unhandledRejectionFn(e._value)}));for(var t=0,r=e._deferreds.length;t0&&h>0,o.textureCacheIds=[],o.destroyed=!1,o.resource=null,o._batchEnabled=0,o._batchLocation=0,o.parentTextureArray=null,o.setResource(t),o}return we(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var r;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)},t.prototype.setRealSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=W(this.realWidth)&&W(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Z[this.cacheId],delete Q[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,r,i){void 0===i&&(i=n.b.STRICT_TEXTURE_CACHE);var o="string"==typeof e,a=null;if(o)a=e;else{if(!e._pixiId){var s=r&&r.pixiIdPrefix||"pixiid";e._pixiId=s+"_"+H()}a=e._pixiId}var u=Z[a];if(o&&i&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||((u=new t(e,r)).cacheId=a,t.addToCache(u,a)),u},t.fromBuffer=function(e,r,n,o){e=e||new Float32Array(r*n*4);var a=new Me(e,{width:r,height:n}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(ke,o||{width:r,height:n,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),Z[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),Z[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=Z[e];if(t){var r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete Z[e],t}}else if(e&&e.textureCacheIds){for(var n=0;n0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,r,n){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(Ce),De=function(e){function t(r,n){var i=this;if(n=n||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var a=r[0].src||r[0];Ce.crossOrigin(o,a,n.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(r)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(Ce),Le=function(e){function t(t){return e.call(this,t)||this}return we(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(Ce);_e.push(Oe,Le,Pe,De,Re,Me,Ne,Ie);var je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return we(t,e),t.prototype.upload=function(e,t,r){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return r.width===o&&r.height===a?n.texSubImage2D(t.target,0,0,0,o,a,t.format,r.type,this.data):(r.width=o,r.height=a,n.texImage2D(t.target,0,r.internalFormat,o,a,0,t.format,r.type,this.data)),!0},t}(Me),ze=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new te("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new Ee(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Ee(new je(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&t.textureCacheIds.splice(r,1),delete Q[e],t}}else if(e&&e.textureCacheIds){for(var n=0;nthis.baseTexture.width,a=r+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+n+" = "+(t+n)+" > "+this.baseTexture.width,l="Y: "+r+" + "+i+" = "+(r+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=n&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new Ee),We(t._EMPTY),We(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),t._WHITE=new t(new Ee(new Pe(e))),We(t._WHITE),We(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(c),Ve=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return we(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,r){void 0===r&&(r=!0);var n=this.baseTexture.resolution,i=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var r=arguments,n=[],i=1;i1?-n:-1:(o=((65535&(e=U(e)))<<16|65535&(t=U(t)))>>>0,n>1&&(o+=4294967296*n)),this.texturePool[o]||(this.texturePool[o]=[]);var a=this.texturePool[o].pop();return a||(a=this.createTexture(e,t,n)),a.filterPoolKey=o,a.setResolution(r),a},e.prototype.getFilterTexture=function(e,t,r){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var r=this.texturePool[t];if(r)for(var n=0;n0&&e.height>0,this.texturePool)if(Number(t)<0){var r=this.texturePool[t];if(r)for(var n=0;n1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),r[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}r[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var r=this.renderer,n=r.renderTexture,o=r.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,n.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,r,n){var o=this.renderer;o.state.set(e.state),this.bindAndClear(r,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var r=this.activeState,n=r.sourceFrame,i=r.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,n.x,n.y),s=t.worldTransform.copyTo(ce.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,r,n){return void 0===r&&(r=1),void 0===n&&(n=i.l.NONE),this.texturePool.getOptimalTexture(e,t,r,n)},e.prototype.getFilterTexture=function(e,t,r){if("number"==typeof e){var n=e;e=t,t=n}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,r||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var r=ot[0],n=ot[1],i=ot[2],o=ot[3];r.set(t.left,t.top),n.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(r,r),e.apply(n,n),e.apply(i,i),e.apply(o,o);var a=Math.min(r.x,n.x,i.x,o.x),s=Math.min(r.y,n.y,i.y,o.y),u=Math.max(r.x,n.x,i.x,o.x),l=Math.max(r.y,n.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,r,n,i){if(!(e.width<=0||e.height<=0||r.width<=0||r.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?at.copyFrom(i):at.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),ut=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),lt=function(){function e(e){this.renderer=e,this.emptyRenderer=new ut(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var r=this.renderer.texture.boundTextures,n=t-1;n>=0;--n)e[n]=r[n]||null,e[n]&&(e[n]._batchLocation=n)},e.prototype.boundArray=function(e,t,r,n){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(r=e.getContext("webgl2",t)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=r||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),dt=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ft=new ue,pt=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new ze(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ue,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;n.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,r=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,r){void 0===r&&(r=0);var n=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==r&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=r),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,r)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>r,u=t.height>>r,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>r,u=e.height>>r,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,r,n){var i=this.viewport;e=Math.round(e),t=Math.round(t),r=Math.round(r),n=Math.round(n),i.width===r&&i.height===n&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=r,i.height=n,this.gl.viewport(e,t,r,n))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,r,n,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,r,n),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,r=new dt(t.createFramebuffer());return r.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(e),e.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(e){var t=this.gl,r=e.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,r.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.RGBA8,e.width,e.height)),r.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),r.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var n=e.colorTextures,i=n.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(n.msaaBuffer=n.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.RGBA8,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(r.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a=[],s=0;s1&&r.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?n.stencil&&(r.deleteRenderbuffer(n.stencil),n.stencil=null):(n.stencil=n.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,n.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,r=i.l.NONE;if(e<=1||null===t)return r;for(var n=0;n=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&n.deleteRenderbuffer(r.msaaBuffer),r.stencil&&n.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r0&&(t+="\nelse "),r=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),Tt=t}return Tt}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);wt=t.precision?i.m.HIGH:i.m.MEDIUM}}return wt}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,r,n){var i=t+r,o=q[i];return o||(q[i]=o=new e(t,r,n)),o},e}(),Ft=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof nt?t:new nt(t):new nt({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var r in t.uniforms){var n=t.uniforms[r];if(n.group&&this.checkUniformExists(e,n))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,r,n){return new e(Bt.from(t,r),n)},e}(),Ut=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),Wt=function(e){function t(r,i,o){var a=this,s=Bt.from(r||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=n.b.FILTER_RESOLUTION,a.multisample=n.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new Ut,a}return we(t,e),t.prototype.apply=function(e,t,r,n,i){e.applyFilter(this,t,r,n)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(Ft),Gt=new ce,Vt=function(){function e(e,t){this._texture=e,this.mapCoord=new ce,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var r=this.mapCoord,n=0;n1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var r=e.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(t.isMatrixRotated(r.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,r,n,i,o){t.isMatrixRotated(o)||((o=o?Xt.copyFrom(o):Xt.identity()).translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}($t),Qt=function(e){function t(t){var r=e.call(this,t)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return we(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,r=this.renderer.gl,n=e._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),e._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,n,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}($t),Zt=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ce,this.transform=null}return e.prototype.update=function(e,t,r,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,n),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,r,n){var i=this.projectionMatrix,o=n?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Kt=new ue,Jt=new ue,er=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ue,this.destinationFrame=new ue,this.viewportFrame=new ue}return e.prototype.bind=function(e,t,r){void 0===e&&(e=null);var n,i,o,a=this.renderer;this.current=e,e?(o=(n=e.baseTexture).resolution,t||(Kt.width=e.frame.width,Kt.height=e.frame.height,t=Kt),r||(Jt.x=e.frame.x,Jt.y=e.frame.y,Jt.width=t.width,Jt.height=t.height,r=Jt),i=n.framebuffer):(o=a.resolution,t||(Kt.width=a.screen.width,Kt.height=a.screen.height,t=Kt),r||((r=Kt).width=t.width,r.height=t.height));var s=this.viewportFrame;s.x=r.x*o,s.y=r.y*o,s.width=r.width*o,s.height=r.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(r,t,o,!i),e?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(r)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var r=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,i=r.width!==n.width||r.height!==n.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function tr(e,t,r,n,i){r.buffer.update(i)}var rr={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},nr={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var ir=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var or=0,ar={textureCount:0,uboCount:0},sr=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=or++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof Pt)return Pt;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");Pt=!0===e({a:"b"},"a","b")}catch(e){Pt=!1}return Pt}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var r=e.program,n=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==r&&(this.program=r,this.gl.useProgram(n.program)),t||(ar.textureCount=0,ar.uboCount=0,this.syncUniformGroup(e.uniformGroup,ar)),n},e.prototype.setUniforms=function(e){var t=this.shader.program,r=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(r.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var r=this.getGlProgram();e.static&&e.dirtyId===r.uniformDirtyGroups[e.id]||(r.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,r,t))},e.prototype.syncUniforms=function(e,t,r){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,r)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var r,n=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!=0&&n<16){var s=n%r%16;n+=s,i+=s}n+r>16?(i=16*Math.ceil(i/16),a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var r=[];for(var n in e)t[n]&&r.push(t[n]);return r.sort((function(e,t){return e.index-t.index})),r}(e.uniforms,t)),n=r.uboElements,i=r.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=Et(s.data.type),p=Math.max(nr[s.data.type]/16,1),v=f/p,g=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+g+";\n }\n\n ")}else{var m=rr[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+m+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,r){var n=e.uniforms,i=[r+"-"];for(var o in n)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,r=e.program,n=function(e,t){var r,n,i,o,a=yt(e,e.VERTEX_SHADER,t.vertexSrc),s=yt(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(n=u,i=a,o=s,(r=e).getProgramParameter(n,r.LINK_STATUS)||(r.getShaderParameter(i,r.COMPILE_STATUS)||_t(r,i),r.getShaderParameter(o,r.COMPILE_STATUS)||_t(r,o),console.error("PixiJS Error: Could not initialize shader."),""!==r.getProgramInfoLog(n)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(n)))),t.attributeData=function(e,t){for(var r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,r++;this.stateId=e.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,r=!1,n=0;nthis.maxIdle&&(e.destroyTexture(i,!0),t[n]=null,r=!0)}if(r){var o=0;for(n=0;n=0;n--)this.unload(e.children[n])},e.prototype.destroy=function(){this.renderer=null},e}(),cr=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},hr=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ee,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,r,n,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=M,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((r={})[i.h.RGBA]=e.RGBA8,r[i.h.RGB]=e.RGB8,r[i.h.RG]=e.RG8,r[i.h.RED]=e.R8,r[i.h.RGBA_INTEGER]=e.RGBA8UI,r[i.h.RGB_INTEGER]=e.RGB8UI,r[i.h.RG_INTEGER]=e.RG8UI,r[i.h.RED_INTEGER]=e.R8UI,r[i.h.ALPHA]=e.ALPHA,r[i.h.LUMINANCE]=e.LUMINANCE,r[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,r),t[i.r.BYTE]=((n={})[i.h.RGBA]=e.RGBA8_SNORM,n[i.h.RGB]=e.RGB8_SNORM,n[i.h.RG]=e.RG8_SNORM,n[i.h.RED]=e.R8_SNORM,n[i.h.RGBA_INTEGER]=e.RGBA8I,n[i.h.RGB_INTEGER]=e.RGB8I,n[i.h.RG_INTEGER]=e.RG8I,n[i.h.RED_INTEGER]=e.R8I,n),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((g={})[i.h.RGB]=e.RGB9_E5,g),t[i.r.UNSIGNED_INT_24_8]=((m={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,m),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),T=t):((_={})[i.r.UNSIGNED_BYTE]=((b={})[i.h.RGBA]=e.RGBA,b[i.h.RGB]=e.RGB,b[i.h.ALPHA]=e.ALPHA,b[i.h.LUMINANCE]=e.LUMINANCE,b[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,b),_[i.r.UNSIGNED_SHORT_5_6_5]=((x={})[i.h.RGB]=e.RGB,x),_[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),_[i.r.UNSIGNED_SHORT_5_5_5_1]=((S={})[i.h.RGBA]=e.RGBA,S),T=_),T);var k=M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=k;for(var E=0;E=0;--o){var a=t[o];a&&a._glTextures[n].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new cr(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var r,n;t.internalFormat=null!==(n=null===(r=this.internalFormats[e.type])||void 0===r?void 0:r[e.format])&&void 0!==n?n:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var r=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(r,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,o=e.realHeight,a=r.gl;(t.width!==n||t.height!==o||t.dirtyId<0)&&(t.width=n,t.height=o,a.texImage2D(e.target,0,t.internalFormat,n,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var r=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),r.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var n=this.managedTextures.indexOf(e);-1!==n&&function(e,t,r){var n,i=e.length;if(!(t>=i||0===r)){var o=i-(r=t+r>i?i-t:r);for(n=t;n=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var r=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&r.generateMipmap(e.target),r.texParameteri(e.target,r.TEXTURE_WRAP_S,t.wrapMode),r.texParameteri(e.target,r.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(e.target,r.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?r.LINEAR:r.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),dr=new ce,fr=function(e){function t(t,r){void 0===t&&(t=i.n.UNKNOWN);var o=e.call(this)||this;return r=Object.assign({},n.b.RENDER_OPTIONS,r),o.options=r,o.type=t,o.screen=new ue(0,0,r.width,r.height),o.view=r.view||document.createElement("canvas"),o.resolution=r.resolution||n.b.RESOLUTION,o.useContextAlpha=r.useContextAlpha,o.autoDensity=!!r.autoDensity,o.preserveDrawingBuffer=r.preserveDrawingBuffer,o.clearBeforeRender=r.clearBeforeRender,o._backgroundColor=0,o._backgroundColorRgba=[0,0,0,1],o._backgroundColorString="#000000",o.backgroundColor=r.backgroundColor||o._backgroundColor,o.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&($("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),o.useContextAlpha=r.transparent,o.backgroundAlpha=r.transparent?0:1),o._lastObjectRendered=null,o.plugins={},o}return we(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var r=this.view.width/this.resolution,n=this.view.height/this.resolution;this.screen.width=r,this.screen.height=n,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=n+"px"),this.emit("resize",r,n)},t.prototype.generateTexture=function(e,t,r,n){void 0===t&&(t={}),"number"==typeof t&&($("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:r,region:n});var i=t.region,o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i>16&255)/255,n[1]=(r>>8&255)/255,n[2]=(255&r)/255},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(c),pr=function(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},vr=function(){function e(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return e.prototype.destroy=function(){this.renderer=null},e.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},e.prototype.bind=function(e){var t=this.gl,r=this.CONTEXT_UID,n=e._glBuffers[r]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)},e.prototype.bindBufferBase=function(e,t){var r=this.gl,n=this.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var i=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,i.buffer)}},e.prototype.bindBufferRange=function(e,t,r){var n=this.gl,i=this.CONTEXT_UID;r=r||0;var o=e._glBuffers[i]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,256*r,256)},e.prototype.update=function(e){var t=this.gl,r=this.CONTEXT_UID,n=e._glBuffers[r];if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),r=0;r-1){var r=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");z=!0}}(2===n.context.webGLVersion?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}we(t,e),t.create=function(e){if(void 0===j&&(j=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:n.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!r||!r.getContextAttributes().stencil);if(r){var o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,i}catch(e){return!1}}()),j)return new t(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},t.prototype.contextChange=function(){var e,t=this.gl;if(1===this.context.webGLVersion){var r=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,r)}else r=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,r);e>=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var r=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var n in this[t]=r,this.runners)this.runners[n].add(r);return this},t.prototype.render=function(e,t){var r,n,i,o;if(t&&(t instanceof Ve?($("6.0.0","Renderer#render arguments changed, use options instead."),r=t,n=arguments[2],i=arguments[3],o=arguments[4]):(r=t.renderTexture,n=t.clear,i=t.transform,o=t.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(r||(this._lastObjectRendered=e),!o){var a=e.enableTempParent();e.updateTransform(),e.disableTempParent(a)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==n?n:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,r,n,i){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,n,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return $("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,r){t.__plugins=t.__plugins||{},t.__plugins[e]=r}}(fr);var gr=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},mr=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,r=this.MAX_TEXTURES,n=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++Ee._globalBatch,u=0,l=n[0],c=0;i.copyBoundTextures(o,r);for(var h=0;h=r&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,h),c=h,l=n[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,r),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h>16&255,n=e>>8&255,i=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((n=n*t+.5|0)<<8)+(i*t+.5|0)}(e._tintRGB,d):e._tintRGB+(255*d<<24),p=0;p0&&(t+="\nelse "),r0){var E=e.worldTransform,A=E.a,I=E.b,C=E.c,P=E.d,N=(b+x+w)/3,O=(S+T+M)/3,R=b-N,D=S-O,L=A*R+C*D,j=I*R+P*D,z=Math.sqrt(L*L+j*j),B=1+k/z;b=N+R*B,S=O+D*B,L=A*(R=x-N)+C*(D=T-O),j=I*R+P*D,x=N+R*(B=1+k/(z=Math.sqrt(L*L+j*j))),T=O+D*B,L=A*(R=w-N)+C*(D=M-O),j=I*R+P*D,w=N+R*(B=1+k/(z=Math.sqrt(L*L+j*j))),M=O+D*B}i.save(),i.beginPath(),i.moveTo(b,S),i.lineTo(x,T),i.lineTo(w,M),i.closePath(),i.clip();var F=p*y+m*g+v*_-y*g-m*v-p*_,U=b*y+m*w+x*_-y*w-m*x-b*_,W=p*x+b*g+v*w-x*g-b*v-p*w,G=p*y*w+m*x*g+b*v*_-b*y*g-m*v*w-p*x*_,V=S*y+m*M+T*_-y*M-m*T-S*_,H=p*T+S*g+v*M-T*g-S*v-p*M,Y=p*y*M+m*T*g+S*v*_-S*y*g-m*v*M-p*T*_;i.transform(U/F,V/F,W/F,H/F,G/F,Y/F),i.drawImage(f,0,0,h*c.resolution,d*c.resolution,0,0,h,d),i.restore(),this.renderer.invalidateBlendMode()}},e.prototype.renderMeshFlat=function(e){var t=this.renderer.context,r=e.geometry.getBuffer("aVertexPosition").data,n=r.length/2;t.beginPath();for(var i=1;i",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(145);function _(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+T(e));var o=e.indexOf("?"),s=-1!==o&&o127?R+="x":R+=O[D];if(!R.match(f)){var j=P.slice(0,A),z=P.slice(A+1),B=O.match(p);B&&(j.push(B[1]),z.unshift(B[2])),z.length&&(_="/"+z.join(".")+_),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=n.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!v[w])for(A=0,N=c.length;A0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=S.slice(-1)[0],k=(r.host||e.host||S.length>1)&&("."===M||".."===M)||""===M,E=0,A=S.length;A>=0;A--)"."===(M=S[A])?S.splice(A,1):".."===M?(S.splice(A,1),E++):E&&(S.splice(A,1),E--);if(!x&&!w)for(;E--;E)S.unshift("..");!x||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var I,C=""===S[0]||S[0]&&"/"===S[0].charAt(0);return T&&(r.hostname=r.host=C?"":S.length?S.shift():"",(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift())),(x=x||r.host&&S.length)&&!C&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(22)(r(14),"Map");e.exports=n},function(e,t,r){var n=r(187),i=r(62),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},function(e,t,r){var n=r(63),i=r(194),o=r(67);e.exports=function(e){return o(e)?n(e):i(e)}},function(e,t,r){(function(e){var n=r(14),i=r(191),o=t&&!t.nodeType&&t,a=o&&"object"==T(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u}).call(this,r(26)(e))},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(51),i=t&&!t.nodeType&&t,o=i&&"object"==T(e)&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,r(26)(e))},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(63),i=r(210),o=r(67);e.exports=function(e){return o(e)?n(e,!0):i(e)}},function(e,t,r){var n=r(58);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},function(e,t){e.exports="#define PI 3.14159265\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvUv = uv;\n\tfloat pixelHeight = (galleryHeight * 1.2) + 8.0;\n\tfloat pixelY = (pixelHeight * 0.5) - position.y;\n\tvPixelY = pixelY;\n\tvec4 newPosition = vec4(position, 1.0);\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D galleryTexture;\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvec4 color;\n\tif ((vPixelY >= 0.0) && (vPixelY <= galleryHeight)) {\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, 1.0 - (vPixelY / galleryHeight)));\n\t}\n\telse if ((vPixelY > galleryHeight) && (vPixelY < (galleryHeight + 8.0))) {\n\t\tcolor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tfloat alpha = 1.0 - ((vPixelY - (galleryHeight + 8.0)) / (galleryHeight * 0.2));\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, ((vPixelY - galleryHeight) + 8.0) / galleryHeight));\n\t\tcolor.a = alpha;\n\t\tvec4 shadow = vec4(0.0, 0.0, 0.0, 1.0);\n\t\tcolor = blendSrcOver(color, shadow);\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t,r){var n=r(148);e.exports=function(e,t){t=t||{};var r=new n,i=t.inPlace||!1,o=e.map((function(e){return i?e:{width:e.width,height:e.height,item:e}}));o=o.sort((function(e,t){return t.width*t.height-e.width*e.height})),r.fit(o);var a={width:o.reduce((function(e,t){return Math.max(e,t.x+t.width)}),0),height:o.reduce((function(e,t){return Math.max(e,t.y+t.height)}),0)};return i||(a.items=o),a}},function(e,t,r){var n=r(205);e.exports=function(e){return n(e,5)}},function(e,t,r){(function(t){var r="object"==T(t)&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(17))},function(e,t,r){var n=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,r,n,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),l.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n80*r){n=s=e[0],o=u=e[1];for(var _=r;_s&&(s=l),c>u&&(u=c);f=0!==(f=Math.max(s-n,u-o))?32767/f:0}return a(m,y,r,n,o,f,0),y}function i(e,t,r,n,i){var o,a;if(i===A(e,t,r,n)>0)for(o=t;o=t;o-=n)a=M(o,e[o],e[o+1],a);return a&&_(a,a.next)&&(k(a),a=a.next),a}function o(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!_(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(k(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function a(e,t,r,n,i,h,d){if(e){!d&&h&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,u,l=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(e,n,i,h);for(var f,v,g=e;e.prev!==e.next;)if(f=e.prev,v=e.next,h?u(e,n,i,h):s(e))t.push(f.i/r|0),t.push(e.i/r|0),t.push(v.i/r|0),k(e),e=v.next,g=v.next;else if((e=v)===g){d?1===d?a(e=l(o(e),t,r),t,r,n,i,h,2):2===d&&c(e,t,r,n,i,h):a(o(e),t,r,n,i,h,1);break}}}function s(e){var t=e.prev,r=e,n=e.next;if(y(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,u=r.y,l=n.y,c=io?i>a?i:a:o>a?o:a,f=s>u?s>l?s:l:u>l?u:l,p=n.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&g(i,s,o,u,a,l,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function u(e,t,r,n){var i=e.prev,o=e,a=e.next;if(y(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,h=o.y,d=a.y,f=su?s>l?s:l:u>l?u:l,_=c>h?c>d?c:d:h>d?h:d,b=p(f,v,t,r,n),x=p(m,_,t,r,n),w=e.prevZ,S=e.nextZ;w&&w.z>=b&&S&&S.z<=x;){if(w.x>=f&&w.x<=m&&w.y>=v&&w.y<=_&&w!==i&&w!==a&&g(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,S.x>=f&&S.x<=m&&S.y>=v&&S.y<=_&&S!==i&&S!==a&&g(s,c,u,h,l,d,S.x,S.y)&&y(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;w&&w.z>=b;){if(w.x>=f&&w.x<=m&&w.y>=v&&w.y<=_&&w!==i&&w!==a&&g(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=x;){if(S.x>=f&&S.x<=m&&S.y>=v&&S.y<=_&&S!==i&&S!==a&&g(s,c,u,h,l,d,S.x,S.y)&&y(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function l(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!_(i,a)&&b(i,n,n.next,a)&&S(i,a)&&S(a,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(a.i/r|0),k(n),k(n.next),n=e=a),n=n.next}while(n!==e);return o(n)}function c(e,t,r,n,i,s){var u=e;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&m(u,l)){var c=T(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,t,r,n,i,s,0),void a(c,t,r,n,i,s,0)}l=l.next}u=u.next}while(u!==e)}function h(e,t){return e.x-t.x}function d(e,t){var r=function(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a&&(a=s,r=n.x=n.x&&n.x>=c&&i!==n.x&&g(or.x||n.x===r.x&&f(r,n)))&&(r=n,d=u)),n=n.next}while(n!==l);return r}(e,t);if(!r)return t;var n=T(r,e);return o(n,n.next),o(r,r.next)}function f(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function p(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,r=e;do{(t.x=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&b(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(S(e,t)&&S(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||_(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function _(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,r,n){var i=w(y(e,t,r)),o=w(y(e,t,n)),a=w(y(r,n,e)),s=w(y(r,n,t));return i!==o&&a!==s||!(0!==i||!x(e,r,t))||!(0!==o||!x(e,n,t))||!(0!==a||!x(r,e,n))||!(0!==s||!x(r,t,n))}function x(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function w(e){return e>0?1:e<0?-1:0}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function T(e,t){var r=new E(e.i,e.x,e.y),n=new E(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function M(e,t,r,n){var i=new E(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function k(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function E(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(e,t,r,n){for(var i=0,o=t,a=r-n;o0&&(n+=e[i-1].length,r.holes.push(n))}return r}},function(e,t,r){var n=r(27),i=r(157),o=r(158),a=r(159),s=r(160),u=r(161);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(166),i=r(173),o=r(175),a=r(176),s=r(177);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tc))return!1;var d=u.get(e),f=u.get(t);if(d&&f)return d==t&&f==e;var p=-1,v=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++p-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(34),i=r(65);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},function(e,t,r){var n=r(69),i=r(37),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){var n=r(207);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},function(e,t,r){var n=r(61),i=r(71),o=r(39),a=r(62),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:a;e.exports=s},function(e,t,r){var n=r(66)(Object.getPrototypeOf,Object);e.exports=n},function(e,t){e.exports="varying vec2 vUv;\nvoid main() {\n\tvUv = uv;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform float lines[26];\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float direction;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat middleAlpha = 0.0;\n\tfloat endAlpha = 0.0;\n\tfloat headLength = 0.0;\n\tif (timePercent < 0.5) {\n\t\tmiddleAlpha = 1.0;\n\t\tendAlpha = 1.0 - (timePercent / 0.5);\n\t}\n\telse {\n\t\tmiddleAlpha = 1.0 - ((timePercent - 0.5) / 0.5);\n\t\tendAlpha = 0.0;\n\t}\n\tfor (int i = 0; i < 26; i++) {\n\t\tfloat halfDis = lines[i] / 2.0;\n\t\tfloat middle = headLength + halfDis;\n\t\theadLength += lines[i];\n\t\tif ((direction > 0.9) && (direction < 1.1)) {\n\t\t\tif (abs(vUv.y - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.y - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (abs(vUv.x - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.x - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tvec2 uv = vec2(vUv.x, vUv.y);\n\tmaxR = length(transform(vec2(1.0, 1.0)));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tdist = length(transform(uv));\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvec2 transformTo(vec2 uv, vec2 origin) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(origin.x, (origin.y * height) / width);\n}\nvec2 offset(float progress[4], float band, float amp, float radius, vec2 centerPosition) {\n\tvec2 tc = vUv.xy;\n\tvec2 uv = vec2(0.0, 0.0);\n\tvec2 p;\n\tfloat len;\n\tvec2 uv_offset;\n\tfloat wave_width = band * radius;\n\tfor (int i = 0; i < 4; i += 1) {\n\t\tif (progress[i] == -1.0) {\n\t\t\tcontinue;\n\t\t}\n\t\tp = tc - centerPosition;\n\t\tp.x = (p.x * width) / height;\n\t\tlen = length(p);\n\t\tfloat current_progress = progress[i];\n\t\tfloat current_radius = radius * current_progress;\n\t\tfloat damp_factor = 1.0;\n\t\tif (current_progress > .5) {\n\t\t\tdamp_factor = (1.0 - current_progress) * 2.0;\n\t\t}\n\t\tfloat cut_factor = clamp((wave_width * damp_factor) - abs(current_radius - len), 0.0, 1.0);\n\t\tfloat waves_factor = (4.0 * len) / radius;\n\t\tuv_offset = (((p / len) * cos((waves_factor - (current_progress * 10.0)) * 3.14)) * amp) * cut_factor;\n\t\tuv += uv_offset;\n\t}\n\treturn uv;\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tfloat progress[4];\n\tvec2 uv = vUv.xy;\n\tvec2 uvOffset = vec2(0.0, 0.0);\n\tvec2 startPosition = vec2(0.5, 0.5);\n\tfloat redius = 2.0;\n\tif (option == 1) {\n\t\tstartPosition = vec2(0.0, 0.0);\n\t}\n\telse if (option == 2) {\n\t\tstartPosition = vec2(1.0, 0.0);\n\t}\n\telse if (option == 3) {\n\t\tstartPosition = vec2(1.0, 1.0);\n\t}\n\telse if (option == 4) {\n\t\tstartPosition = vec2(0.0, 1.0);\n\t}\n\tmaxR = length(transformTo(vec2(1.0, 1.0), vec2(0.0, 0.0)));\n\tif (option == 0) {\n\t\tmaxR = maxR / 2.0;\n\t\tredius = redius / 2.0;\n\t}\n\tdist = length(transformTo(uv, startPosition));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tfor (int i = 0; i < 4; i++) {\n\t\tprogress[i] = timePercent + (0.1 * float(i));\n\t\tif (progress[i] < 0.0) {\n\t\t\tprogress[i] = 0.0;\n\t\t}\n\t}\n\tuvOffset = offset(progress, 0.2, 0.3, redius, startPosition);\n\tvec4 srcColor = texture2D(texturePrev, fract(vUv + uvOffset));\n\tvec4 distColor = texture2D(textureNext, fract(vUv + uvOffset));\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = option > 1 ? true : false;\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 0.5;\n\t\trectEnd = isRevert ? 0.5 : 1.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 0.5) + 0.5 : 1.0 - (((timePercent - 0.33) / 0.33) * 0.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 0.5 : 0.0;\n\t\trectEnd = isRevert ? 1.0 : 0.5;\n\t}\n\tfloat changAxis = (option % 2) == 0 ? vUv.x : vUv.y;\n\tif (changAxis >= rectEnd) {\n\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t}\n\telse if (changAxis <= rectStart) {\n\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t}\n\telse {\n\t\tsrcColor.a = alphaStart + (((changAxis - rectStart) / 0.5) * (alphaEnd - alphaStart));\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform sampler2D dissolveTexture;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 dissolveColor = texture2D(dissolveTexture, vUv);\n\tif (dissolveColor.r == 0.0) {\n\t\tresult = srcColor;\n\t}\n\telse {\n\t\tresult = distColor;\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (timePercent < 0.5) {\n\t\tfloat stagePercent = timePercent / 0.5;\n\t\tresult = srcColor + (stagePercent * (1.0 - srcColor));\n\t}\n\telse {\n\t\tfloat stagePercent = (timePercent - 0.5) / 0.5;\n\t\tresult = 1.0 - (stagePercent * (1.0 - distColor));\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (option == 1) {\n\t\tif (timePercent < 0.5) {\n\t\t\tsrcColor.rgb *= (1.0 - (timePercent * 2.0));\n\t\t\tgl_FragColor = srcColor;\n\t\t}\n\t\telse {\n\t\t\tdistColor.rgb *= ((timePercent - 0.5) * 2.0);\n\t\t\tgl_FragColor = distColor;\n\t\t}\n\t}\n\telse {\n\t\tsrcColor.a = 1.0 - timePercent;\n\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t}\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat changeAxis = (option % 2) == 1 ? vUv.x : vUv.y;\n\tbool changeAxisX = (option % 2) == 1;\n\tbool isRevert = option > 1;\n\tfloat line;\n\tif (isRevert) {\n\t\tline = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 3);\n\t}\n\telse {\n\t\tline = interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 3);\n\t}\n\tvec2 uv = vUv.xy;\n\tif (changeAxis > line) {\n\t\tif (changeAxisX) {\n\t\t\tuv.x -= line;\n\t\t}\n\t\telse {\n\t\t\tuv.y -= line;\n\t\t}\n\t}\n\telse {\n\t\tif (changeAxisX) {\n\t\t\tuv.x += (1.0 - line);\n\t\t}\n\t\telse {\n\t\t\tuv.y += (1.0 - line);\n\t\t}\n\t}\n\tif (isRevert) {\n\t\tresult = changeAxis > line ? texture2D(textureNext, uv) : texture2D(texturePrev, uv);\n\t}\n\telse {\n\t\tresult = changeAxis > line ? texture2D(texturePrev, uv) : texture2D(textureNext, uv);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool orient;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 rectLeft = direction ? vec2(0.25, 0.0) : vec2(0.25, 0.5);\n\tvec2 rectRight = direction ? vec2(1, 0.75) : vec2(0.5, 0.75);\n\tvec2 alphaLeft = vec2(1.0, 1.0);\n\tvec2 alphaRight = vec2(1.0, 1.0);\n\tif (timePercent <= 0.333) {\n\t\talphaLeft.y = 1.0 - (timePercent / 0.333);\n\t\talphaRight.x = 1.0 - (timePercent / 0.333);\n\t}\n\telse if ((timePercent <= 0.666) && (timePercent > 0.333)) {\n\t\trectLeft.x = direction ? (((timePercent - 0.333) / 0.333) * 0.25) + rectLeft.x : rectLeft.x - (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectLeft.y = direction ? rectLeft.x - 0.25 : rectLeft.x + 0.25;\n\t\trectRight.y = direction ? rectRight.y - (((timePercent - 0.333) / 0.333) * 0.25) : rectRight.y + (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectRight.x = direction ? rectRight.y + 0.25 : rectRight.y - 0.25;\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t}\n\telse {\n\t\trectLeft = direction ? vec2(0.5, 0.25) : vec2(0.0, 0.25);\n\t\trectRight = direction ? vec2(0.75, 0.5) : vec2(0.75, 1.0);\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t\talphaLeft.x = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t\talphaRight.y = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t}\n\tfloat axis = orient ? vUv.x : vUv.y;\n\tif (direction) {\n\t\tif ((axis < rectLeft.y) || (axis > rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse if ((axis > rectLeft.x) && (axis < rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis < rectLeft.x) && (axis > rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.y - (((axis - rectLeft.y) / (rectLeft.x - rectLeft.y)) * (alphaLeft.y - alphaLeft.x));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.x - (((rectRight.x - axis) / (rectLeft.x - rectLeft.y)) * (alphaRight.x - alphaRight.y));\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tif ((axis < rectLeft.x) || (axis > rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse if ((axis > rectLeft.y) && (axis < rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis >= rectLeft.x) && (axis <= rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.x - (((axis - rectLeft.x) / (rectLeft.y - rectLeft.x)) * (alphaLeft.x - alphaLeft.y));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.y - (((rectRight.y - axis) / (rectLeft.y - rectLeft.x)) * (alphaRight.y - alphaRight.x));\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool thruBlk;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 uv4 = vec4(vUv.xy, 1.0, 1.0);\n\tfloat scale;\n\tfloat transform;\n\tif (timePercent < 0.5) {\n\t\tscale = 1.0 - ((timePercent / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\telse {\n\t\tscale = 0.95 + (((timePercent - 0.5) / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\tmat4 matrix = mat4(scale, 0.0, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, transform, transform, 0.0, 1.0);\n\tvec4 uv = matrix * uv4;\n\tvec4 srcColor = texture2D(texturePrev, uv.xy);\n\tvec4 distColor = texture2D(textureNext, uv.xy);\n\tvec4 result = timePercent < 0.5 ? srcColor : distColor;\n\tvec3 start;\n\tvec3 end;\n\tvec3 middleColor = thruBlk ? vec3(0.0, 0.0, 0.0) : vec3(1.0, 1.0, 1.0);\n\tif ((timePercent < 0.25) || (timePercent > 0.75)) {\n\t\tresult *= 1.0;\n\t}\n\telse if ((timePercent >= 0.25) && (timePercent <= 0.5)) {\n\t\tif (timePercent <= 0.375) {\n\t\t\tstart = result.rgb;\n\t\t\tend = start + (((timePercent - 0.25) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb + (((timePercent - 0.375) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\telse if ((timePercent > 0.5) && (timePercent <= 0.75)) {\n\t\tif (timePercent < 0.625) {\n\t\t\tstart = middleColor - (((timePercent - 0.5) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb;\n\t\t\tend = middleColor - (((timePercent - 0.625) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x <= lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionX > 0) && (vUv.x >= lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionY < 0) && (vUv.y <= lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionY > 0) && (vUv.y >= lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x > lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionX > 0) && (vUv.x < lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionY < 0) && (vUv.y > lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionY > 0) && (vUv.y < lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 result;\n\tfloat resultAlpha;\n\tif (timePercent < 0.5) {\n\t\tresult = srcColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(0.0, 1.0, 0.0, 0.5, timePercent, 0);\n\t\tresultAlpha = srcColor.a;\n\t}\n\telse {\n\t\tresult = distColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(1.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t\tresultAlpha = distColor.a;\n\t}\n\tresult *= yuv2rgb;\n\tgl_FragColor = vec4(result.rgb, resultAlpha);\n}\n"},function(e,t){e.exports="uniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute vec2 segment;\nattribute float times;\nattribute int option;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec2 segmentOrigin = vec2(((segment.x + 0.5) * segmentWidth) - (width * 0.5), (height * 0.5) - ((1.0 * (segment.y + 0.5)) * segmentHeight));\n\tif (timePercent > times) {\n\t\tfloat percent = (timePercent - times) / 0.7;\n\t\tif (percent > 1.0) {\n\t\t\tpercent = 1.0;\n\t\t}\n\t\tif (percent > 0.5) {\n\t\t\tpercent += 1.0;\n\t\t}\n\t\tmat4 matrix = mat4(cos((-1.0 * percent) * 3.14), 0.0, sin((-1.0 * percent) * 3.14), 0.0, 0.0, 1.0, 0.0, 0.0, -sin((-1.0 * percent) * 3.14), 0.0, cos((-1.0 * percent) * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\tif (option == 1) {\n\t\t\tmatrix = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(percent * 3.14), -sin(percent * 3.14), 0.0, 0.0, sin(percent * 3.13), cos(percent * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\t}\n\t\tnewPosition.x -= segmentOrigin.x;\n\t\tnewPosition.y -= segmentOrigin.y;\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += segmentOrigin.x;\n\t\tnewPosition.y += segmentOrigin.y;\n\t\tif (segment.x < (horizontalSegments / 2.0)) {\n\t\t\tfakePercent = percent - (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t\telse {\n\t\t\tfakePercent = percent + (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (fakePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif ((fakePercent < 0.5) && (fakePercent > 0.35)) {\n\t\tcolor.a = 0.5;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform float duration;\nattribute vec2 segment;\nattribute float times;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tmat4 matrix;\n\tfloat stagePercent;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfTimePercent = (timePercent - times) / (4.0 / 5.0);\n\tif (selfTimePercent < 0.0) {\n\t\tselfTimePercent = 0.0;\n\t}\n\telse if (selfTimePercent > 1.0) {\n\t\tselfTimePercent = 1.0;\n\t}\n\tif (selfTimePercent < (2.0 / 5.0)) {\n\t\tstagePercent = selfTimePercent / (2.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 0.5);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t}\n\telse if ((selfTimePercent >= (2.0 / 5.0)) && (selfTimePercent < (3.0 / 5.0))) {\n\t\tstagePercent = (selfTimePercent - (2.0 / 5.0)) / (1.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tnewPosition = rotateY((-1.0 * PI) * 0.5) * newPosition;\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 2.0);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= (width * stagePercent);\n\t}\n\telse {\n\t\tfloat offset = (((newPosition.x + (0.5 * width)) / width) * 2.0) / 5.0;\n\t\tstagePercent = (selfTimePercent - (1.0 / 5.0)) / ((2.0 / 5.0) + offset);\n\t\tif (stagePercent > 1.0) {\n\t\t\tstagePercent = 1.0;\n\t\t}\n\t\tvec4 vvUvv = vec4(vUv.x - 0.5, vUv.y - 0.5, 0.0, 1.0);\n\t\tvvUvv = rotateY(-1.0 * PI) * vvUvv;\n\t\tvUv = vvUvv.xy + 0.5;\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY((((-1.0 * stagePercent) * PI) * 0.5) - (PI * 2.5));\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= width;\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tvUv = uv;\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (timePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif (timePercent < 0.0001) {\n\t\tcolor = srcColor;\n\t}\n\telse if (timePercent > 0.9999) {\n\t\tcolor = distColor;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float index;\nattribute float type;\nattribute float delay;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segments;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tvType = type;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfPercent = (timePercent - delay) / 0.7;\n\trotatePercent = selfPercent;\n\tif (selfPercent < 0.0) {\n\t\tselfPercent = 0.0;\n\t}\n\telse if (selfPercent > 1.0) {\n\t\tselfPercent = 1.0;\n\t}\n\tfloat offsetX = ((segments * segmentWidth) * 0.5) - ((index + 0.5) * segmentWidth);\n\tfloat offsetZ = segmentWidth * 0.5;\n\tnewPosition.x += offsetX;\n\tnewPosition.z += offsetZ;\n\tnewPosition.x *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition.z *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition = rotateY((PI * 0.5) * selfPercent) * newPosition;\n\tnewPosition.x -= offsetX;\n\tnewPosition.z -= offsetZ;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 srcYuv;\n\tvec3 distYuv;\n\tif (rotatePercent < 0.5) {\n\t\tdistYuv = distColor.rgb * rgb2yuv;\n\t\tdistYuv.r *= (1.0 - (abs(rotatePercent - 0.5) / 0.5));\n\t\tdistColor = vec4(distYuv * yuv2rgb, distColor.a);\n\t}\n\telse {\n\t\tsrcYuv = distColor.rgb * rgb2yuv;\n\t\tsrcYuv.r *= (abs(rotatePercent - 0.5) / 0.5);\n\t\tsrcColor = vec4(srcYuv * yuv2rgb, srcColor.a);\n\t}\n\tvec4 color = vType < 0.5 ? srcColor : distColor;\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float easeInFloat(float t, float b, float c, float d) {\n\tt = t / d;\n\treturn ((c * t) * t) + b;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.141592653\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute float isLeft;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvUv = uv;\n\tfloat scaleX;\n\tfloat transform;\n\tfloat displacement;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec4 glPosition = (projectionMatrix * modelViewMatrix) * newPosition;\n\tfloat crestCount = 24.0;\n\tfloat width = horizontalSegments * segmentWidth;\n\tfloat height = verticalSegments * segmentHeight;\n\tfloat heightFactor = (newPosition.y + (height * 0.5)) / height;\n\tfloat scaleY = interpolationFloat(1.0, 1.05, 0.0, 0.11, timePercent, 0);\n\tnewPosition.y += (height * 0.5);\n\tnewPosition.y *= scaleY;\n\tnewPosition.y -= (height * 0.5);\n\tnewPosition.y += 10.0;\n\tif ((timePercent > 0.0) && (timePercent < 0.333)) {\n\t\tfloat delay = (1.0 - heightFactor) * 0.1;\n\t\tscaleX = interpolationFloat(1.0, 0.5, 0.0 + delay, 0.333, timePercent, 1);\n\t}\n\telse if ((timePercent >= 0.333) && (timePercent < 0.5)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.25, 0.333, 0.5, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if ((timePercent >= 0.5) && (timePercent < 0.583)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.25, 0.5, 0.5, 0.583, timePercent, 1);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if (timePercent >= 0.583) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.75, 0.583, 0.666, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop + incr;\n\t}\n\tif (timePercent > 0.583) {\n\t\tdisplacement = (isLeft < 0.5 ? 1.0 : -1.0) * interpolationFloat(0.0, width / 2.0, 0.583, 1.0, timePercent, 0);\n\t}\n\tfloat ampTop = interpolationFloat(0.0, 1.0, 0.0, 0.11, timePercent, 0);\n\tfloat ampBottom = interpolationFloat(0.0, 1.0, 0.11, 0.22, timePercent, 0);\n\tfloat amp = ampBottom + (heightFactor * abs(ampBottom - ampTop));\n\tfloat foo = newPosition.x * ((crestCount * PI) / width);\n\tnewPosition.z = (amp * cos(foo + (PI / 2.0))) * 20.0;\n\ttransform = (isLeft < 0.5 ? -1.0 : 1.0) * (width * 0.5);\n\tnewPosition.x += transform;\n\tnewPosition.x *= scaleX;\n\tnewPosition.x -= transform;\n\tnewPosition.x += displacement;\n\tshadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (newPosition.z < 15.0) {\n\t\tfloat alpha = 0.3 * (1.0 - ((newPosition.z + 20.0) / 35.0));\n\t\tshadow.a = alpha * amp;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = blendSrcOver(shadow, srcColor);\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265\nuniform float timePercent;\nuniform float aCoefficient;\nuniform float zCurveLimit;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat curve;\n\tfloat progress = option == 1 ? halfWidth - newPosition.x : newPosition.x + halfWidth;\n\tfloat aStart = interpolationFloat(0.00000009, aCoefficient, 0.0, 0.5, timePercent, 0);\n\tfloat aEnd = 0.0000009;\n\tfloat zStart = interpolationFloat(0.0, zCurveLimit, 0.0, 0.5, timePercent, 0);\n\tfloat zEnd = 0.0;\n\tfloat a = interpolationFloat(aStart, aEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat z = interpolationFloat(zStart, zEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.z -= (((-a * newPosition.y) * newPosition.y) + z);\n\tfloat scaleYStart = interpolationFloat(1.0, 0.8, 0.0, 0.5, timePercent, 0);\n\tfloat scaleYEnd = 1.0;\n\tfloat scaleY = interpolationFloat(scaleYStart, scaleYEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.y += halfHeight;\n\tnewPosition.y *= scaleY;\n\tfloat angle = interpolationFloat(0.0, -((2.0 * PI) / 3.0), 0.111, 1.0, timePercent, 1);\n\tmat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tnewPosition = rotateX * newPosition;\n\tnewPosition.y -= halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, alpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec2 shadowPosition = vec2(position.xy);\n\tfloat presetAngle = option == 1 ? 0.77 : 0.27;\n\tfloat rotateAngle = PI * presetAngle;\n\tfloat min_r = halfWidth * 0.05;\n\tshadowPosition = rotateOrigin(rotateAngle) * shadowPosition;\n\tvec4 newPosition = vec4(shadowPosition.xy, position.z, 1.0);\n\tfloat line = interpolationFloat(0.0, halfWidth * 2.8, 0.0, 1.0, timePercent, 1);\n\tfloat dis2BaseLine = halfWidth - newPosition.x;\n\tfloat dis2Line = line - dis2BaseLine;\n\tfloat L = line <= (halfWidth * 2.0) ? line : halfWidth * 2.0;\n\tfloat r = L / PI;\n\tr = r < min_r ? min_r : r;\n\tfloat angle = dis2Line / r;\n\tif (((dis2Line > 0.0) && (dis2Line < (line * 0.5))) && (r > min_r)) {\n\t\tshadowAlpha = interpolationFloat(0.0, 0.3, 0.0, line * 0.5, dis2Line, 0);\n\t}\n\telse {\n\t\tshadowAlpha = 0.0;\n\t}\n\tif (dis2BaseLine < line) {\n\t\tnewPosition.x = ((sin(angle) * r) + halfWidth) - line;\n\t\tnewPosition.z = (r - (cos(angle) * r)) * 0.5;\n\t}\n\tvec2 finalPosition = vec2(newPosition.xy);\n\tfinalPosition = rotateOrigin(-rotateAngle) * finalPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(finalPosition.xy, newPosition.z, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, shadowAlpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateX(float angle) {\n\treturn mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat progress = option == 0 ? halfWidth - newPosition.x : halfWidth + newPosition.x;\n\tfloat delay = interpolationFloat(0.0, 0.08, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat arc = halfHeight - newPosition.y;\n\tfloat L;\n\tif (timePercent < 0.8) {\n\t\tL = interpolationFloat(halfHeight * 4.0, halfHeight * 22.0, 0.3 + delay, 0.8, timePercent, 0);\n\t}\n\telse {\n\t\tL = interpolationFloat(halfHeight * 22.0, halfHeight * 300.0, 0.8, 1.0, timePercent, 0);\n\t}\n\tfloat r = L / (2.0 * PI);\n\tfloat angle = PI - (arc / r);\n\tfloat y = sin(angle) * r;\n\tfloat z = cos(angle) * r;\n\tnewPosition.y = halfHeight - y;\n\tnewPosition.z = (z + r) * 0.45;\n\tfloat rotateAngle = interpolationFloat(-PI * 0.5, 0.0, 0.0 + delay, 0.4, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(rotateAngle) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate1 = interpolationFloat(0.0, PI * 0.03, 0.75, 0.9, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate1) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate2 = interpolationFloat(0.0, -PI * 0.03, 0.8, 1.0, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate2) * newPosition;\n\tnewPosition.y += halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tgl_FragColor = blendSrcOver(shadow, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat shadowAngle = PI / 6.0;\n\tfloat clockAngle;\n\tvec2 a;\n\tvec2 b = transform(vUv);\n\tfloat angle;\n\tif (timePercent < 0.5) {\n\t\ta = vec2(0.0, 0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI, 0.0, 0.5, timePercent, 0);\n\t\tif (b.x > 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t}\n\telse {\n\t\ta = vec2(0.0, -0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI + shadowAngle, 0.5, 1.0, timePercent, 0);\n\t\tif (b.x <= 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uv = vUv;\n\tbool useSrc = false;\n\tvec2 row;\n\tfloat delay = 0.02;\n\tbool isVert = bool(option);\n\tint segmentCount = isVert ? 10 : 7;\n\tfloat axis = isVert ? uv.y : uv.x;\n\tfloat compareAxis = isVert ? uv.x : uv.y;\n\tfor (int i = 0; i < segmentCount; i++) {\n\t\tfloat fi = float(i);\n\t\trow.r = (fi * 1.0) / float(segmentCount);\n\t\trow.g = (float(i + 1) * 1.0) / float(segmentCount);\n\t\tif ((compareAxis <= row.g) && (compareAxis > row.r)) {\n\t\t\tif ((i % 2) == 0) {\n\t\t\t\tfloat line = interpolationFloat(0.0, 1.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\taxis -= line;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfloat line = interpolationFloat(1.0, 0.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\taxis = (1.0 - line) + axis;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (isVert) {\n\t\tuv.y = axis;\n\t}\n\telse {\n\t\tuv.x = axis;\n\t}\n\tvec4 srcColor = texture2D(texturePrev, uv);\n\tvec4 distColor = texture2D(textureNext, uv);\n\tgl_FragColor = useSrc ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uvSrc = vUv;\n\tvec2 uvDist = vUv;\n\tfloat scaleSrc = option == 1 ? interpolationFloat(1.0, 2.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(1.0, 0.1, 0.0, 1.0, timePercent, 0);\n\tfloat scaleDist = option == 1 ? interpolationFloat(0.1, 1.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(2.0, 1.0, 0.0, 1.0, timePercent, 0);\n\tuvSrc -= 0.5;\n\tuvSrc *= scaleSrc;\n\tuvSrc += 0.5;\n\tuvDist -= 0.5;\n\tuvDist *= scaleDist;\n\tuvDist += 0.5;\n\tvec4 srcColor = texture2D(texturePrev, uvSrc);\n\tsrcColor.a = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 0);\n\tvec4 distColor;\n\tif ((((uvDist.x > 1.0) || (uvDist.x < 0.0)) || (uvDist.y > 1.0)) || (uvDist.y < 0.0)) {\n\t\tdistColor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tdistColor = texture2D(textureNext, uvDist);\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\tif (option == 1) {\n\t\tangle *= -1.0;\n\t}\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat stageOneAngle = PI / 14.0;\n\tfloat stageTwoAngle = (PI * 12.0) / 14.0;\n\tfloat stage_1 = 0.1;\n\tfloat stage_2 = 0.8;\n\tif (timePercent < 0.5) {\n\t\tnewPosition.z = interpolationFloat(0.0, -100.0, 0.0, 0.5, timePercent, 0);\n\t}\n\telse {\n\t\tnewPosition.z = interpolationFloat(-100.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t}\n\tif (timePercent < stage_1) {\n\t\tfloat angle = interpolationFloat(0.0, stageOneAngle, 0.0, stage_1, timePercent, 0);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x -= halfWidth;\n\t}\n\telse if ((timePercent >= stage_1) && (timePercent < stage_2)) {\n\t\tif (timePercent > 0.5) {\n\t\t\tnewPosition *= rotateY(PI);\n\t\t}\n\t\tfloat offset = halfWidth - (sin((PI * 0.5) - stageOneAngle) * halfWidth);\n\t\tfloat angle = interpolationFloat(0.0, stageTwoAngle, stage_1, stage_2, timePercent, 0);\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(stageOneAngle);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition.x += interpolationFloat(0.0, 2.0 * offset, stage_1, stage_2, timePercent, 0);\n\t}\n\telse {\n\t\tfloat angle = interpolationFloat(-stageOneAngle, 0.0, stage_2, 1.0, timePercent, 0);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tgl_FragColor = timePercent < 0.5 ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = (option == 3) || (option == 2);\n\tbool rotateParam = (option == 3) || (option == 1);\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 1.5;\n\t\trectEnd = isRevert ? 0.5 : 2.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 1.5) + 0.5 : 2.0 - (((timePercent - 0.33) / 0.33) * 1.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 1.5 : 0.0;\n\t\trectEnd = isRevert ? 2.0 : 0.5;\n\t}\n\tif (!rotateParam) {\n\t\trectStart -= 1.0;\n\t\trectEnd -= 1.0;\n\t}\n\tfloat rotate = rotateParam ? PI * 0.25 : PI * 0.75;\n\tvec2 rotateUv = vUv * rotateOrigin(rotate);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 startPoint = vec2(rectStart, 0.0) * rotateOrigin(rotate);\n\tvec2 endPoint = vec2(rectEnd, 0.0) * rotateOrigin(rotate);\n\tif (rotateParam) {\n\t\tif (rotateUv.x >= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x <= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((rotateUv.x - startPoint.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\telse {\n\t\tif (rotateUv.x <= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x >= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((startPoint.x - rotateUv.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float left;\nuniform float timePercent;\nuniform float offset;\nvarying vec2 vUv;\nuniform float option;\nvoid main() {\n\tvUv = uv;\n\tfloat angle;\n\tif (left > 0.0) {\n\t\tangle = (PI / 6.0) * timePercent;\n\t}\n\telse {\n\t\tangle = (-PI / 6.0) * timePercent;\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\tangle = (-PI / 6.0) * timePercent;\n\t\t}\n\t\telse {\n\t\t\tangle = (PI / 6.0) * timePercent;\n\t\t}\n\t}\n\tvec4 newPosition = vec4(position, 1.0);\n\tmat4 transform;\n\tmat4 rotateY = mat4(cos(angle), 0.0, -sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, sin(angle), 0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tif (option > 0.5) {\n\t\trotateY = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), -sin(angle), 0.0, 0.0, sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, offset * timePercent, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -offset * timePercent, 0.0, 1.0);\n\t\t}\n\t}\n\telse {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t}\n\tnewPosition = transform * newPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D prevTexture;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 color = texture2D(prevTexture, vUv);\n\tcolor.a = 1.0 - timePercent;\n\tgl_FragColor = color;\n}\n"},function(e,t,r){(function(e){var n=r(109),i=r(110),o=setTimeout;function a(e){return Boolean(e&&void 0!==e.length)}function s(){}function u(e){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function l(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,u._immediateFn((function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var n;try{n=r(e._value)}catch(e){return void h(t.promise,e)}c(t.promise,n)}else(1===e._state?c:h)(t.promise,e._value)}))):e._deferreds.push(t)}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==T(t)||"function"==typeof t)){var r=t.then;if(t instanceof u)return e._state=3,e._value=t,void d(e);if("function"==typeof r)return void p((n=r,i=t,function(){n.apply(i,arguments)}),e)}e._state=1,e._value=t,d(e)}catch(t){h(e,t)}var n,i}function h(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&u._immediateFn((function(){e._handled||u._unhandledRejectionFn(e._value)}));for(var t=0,r=e._deferreds.length;t0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array)}).call(this,r(17))},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(141),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(17))},function(e,t,r){(function(e,t){!function(e,r){if(!e.setImmediate){var n,i,o,a,s,u=1,l={},c=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r1)for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function v(e){throw new RangeError(d[e])}function g(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function m(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+g((e=e.replace(h,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)})).join("")}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;n+=36)e=f(e/35);return f(n+36*e/(e+38))}function w(e){var t,r,n,i,o,a,s,l,c,h,d,p=[],g=e.length,m=0,y=128,b=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&v("not-basic"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=g&&v("invalid-input"),((l=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>f((u-m)/a))&&v("overflow"),m+=l*a,!(l<(c=s<=b?1:s>=b+26?26:s-b));s+=36)a>f(u/(h=36-c))&&v("overflow"),a*=h;b=x(m-o,t=p.length+1,0==o),f(m/t)>u-y&&v("overflow"),y+=f(m/t),m%=t,p.splice(m++,0,y)}return _(p)}function S(e){var t,r,n,i,o,a,s,l,c,h,d,g,m,_,w,S=[];for(g=(e=y(e)).length,t=128,r=0,o=72,a=0;a=t&&df((u-r)/(m=n+1))&&v("overflow"),r+=(s-t)*m,t=s,a=0;au&&v("overflow"),d==t){for(l=r,c=36;!(l<(h=c<=o?1:c>=o+26?26:c-o));c+=36)w=l-h,_=36-h,S.push(p(b(h+w%_,0))),l=f(w/_);S.push(p(b(l,0))),o=x(r,m,n==i),r=0,++n}++r,++t}return S.join("")}s={version:"1.4.1",ucs2:{decode:y,encode:_},decode:w,encode:S,toASCII:function(e){return m(e,(function(e){return c.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return m(e,(function(e){return l.test(e)?w(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(26)(e),r(17))},function(e,t,r){e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==T(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){t.decode=t.parse=r(146),t.encode=t.stringify=r(147)},function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c=0?(h=v.substr(0,g),d=v.substr(g+1)):(h=v,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),n(a,f)?i(a[f])?a[f].push(p):a[f]=[a[f],p]:a[f]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){var n=function(e){switch(T(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==T(e)?o(a(e),(function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[a]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n0?e[0].width:0,s=o>0?e[0].height:0;for(this.root={x:0,y:0,width:a,height:s},t=0;t=this.root.width+e,o=r&&this.root.width>=this.root.height+t;return i?this.growRight(e,t):o?this.growDown(e,t):n?this.growRight(e,t):r?this.growDown(e,t):null},growRight:function(e,t){var r;return this.root={used:!0,x:0,y:0,width:this.root.width+e,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:e,height:this.root.height}},(r=this.findNode(this.root,e,t))?this.splitNode(r,e,t):null},growDown:function(e,t){var r;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+t,down:{x:0,y:this.root.height,width:this.root.width,height:t},right:this.root},(r=this.findNode(this.root,e,t))?this.splitNode(r,e,t):null}},e.exports=r},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){var n=r(151),i=r(15);e.exports=function e(t,r,o,a,s){return t===r||(null==t||null==r||!i(t)&&!i(r)?t!=t&&r!=r:n(t,r,o,a,e,s))}},function(e,t,r){var n=r(54),i=r(57),o=r(183),a=r(186),s=r(32),u=r(31),l=r(41),c=r(64),h="[object Object]",d=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,f,p,v){var g=u(e),m=u(t),y=g?"[object Array]":s(e),_=m?"[object Array]":s(t),b=(y="[object Arguments]"==y?h:y)==h,x=(_="[object Arguments]"==_?h:_)==h,w=y==_;if(w&&l(e)){if(!l(t))return!1;g=!0,b=!1}if(w&&!b)return v||(v=new n),g||c(e)?i(e,t,r,f,p,v):o(e,t,y,r,f,p,v);if(!(1&r)){var S=b&&d.call(e,"__wrapped__"),T=x&&d.call(t,"__wrapped__");if(S||T){var M=S?e.value():e,k=T?t.value():t;return v||(v=new n),p(M,k,r,f,v)}}return!!w&&(v||(v=new n),a(e,t,r,f,p,v))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(28),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},function(e,t,r){var n=r(28);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(28);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(28);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},function(e,t,r){var n=r(27);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(27),i=r(38),o=r(56);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(34),i=r(163),o=r(21),a=r(55),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,h=l.hasOwnProperty,d=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?d:s).test(a(e))}},function(e,t,r){var n,i=r(164),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},function(e,t,r){var n=r(14)["__core-js_shared__"];e.exports=n},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(167),i=r(27),o=r(38);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},function(e,t,r){var n=r(168),i=r(169),o=r(170),a=r(171),s=r(172);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&r|128]+i[r>>8&255]+"-"+i[r>>16&255]+i[r>>24&255]+i[255&n]+i[n>>8&255]+i[n>>16&255]+i[n>>24&255]).toUpperCase()}for(var _=r(23),w=function(){function e(){x(this,e)}return S(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var r=this._listeners[e];if(void 0!==r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var r=t.slice(0),n=0,i=r.length;n0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array)}).call(this,r(17))},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(141),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(17))},function(e,t,r){(function(e,t){!function(e,r){if(!e.setImmediate){var n,i,o,a,s,u=1,l={},c=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r1)for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function v(e){throw new RangeError(d[e])}function g(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function m(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+g((e=e.replace(h,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)})).join("")}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;n+=36)e=f(e/35);return f(n+36*e/(e+38))}function w(e){var t,r,n,i,o,a,s,l,c,h,d,p=[],g=e.length,m=0,y=128,b=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&v("not-basic"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=g&&v("invalid-input"),((l=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>f((u-m)/a))&&v("overflow"),m+=l*a,!(l<(c=s<=b?1:s>=b+26?26:s-b));s+=36)a>f(u/(h=36-c))&&v("overflow"),a*=h;b=x(m-o,t=p.length+1,0==o),f(m/t)>u-y&&v("overflow"),y+=f(m/t),m%=t,p.splice(m++,0,y)}return _(p)}function S(e){var t,r,n,i,o,a,s,l,c,h,d,g,m,_,w,S=[];for(g=(e=y(e)).length,t=128,r=0,o=72,a=0;a=t&&df((u-r)/(m=n+1))&&v("overflow"),r+=(s-t)*m,t=s,a=0;au&&v("overflow"),d==t){for(l=r,c=36;!(l<(h=c<=o?1:c>=o+26?26:c-o));c+=36)w=l-h,_=36-h,S.push(p(b(h+w%_,0))),l=f(w/_);S.push(p(b(l,0))),o=x(r,m,n==i),r=0,++n}++r,++t}return S.join("")}s={version:"1.4.1",ucs2:{decode:y,encode:_},decode:w,encode:S,toASCII:function(e){return m(e,(function(e){return c.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return m(e,(function(e){return l.test(e)?w(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(26)(e),r(17))},function(e,t,r){e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==T(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){t.decode=t.parse=r(146),t.encode=t.stringify=r(147)},function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c=0?(h=v.substr(0,g),d=v.substr(g+1)):(h=v,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),n(a,f)?i(a[f])?a[f].push(p):a[f]=[a[f],p]:a[f]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){var n=function(e){switch(T(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==T(e)?o(a(e),(function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[a]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n0?e[0].width:0,s=o>0?e[0].height:0;for(this.root={x:0,y:0,width:a,height:s},t=0;t=this.root.width+e,o=r&&this.root.width>=this.root.height+t;return i?this.growRight(e,t):o?this.growDown(e,t):n?this.growRight(e,t):r?this.growDown(e,t):null},growRight:function(e,t){var r;return this.root={used:!0,x:0,y:0,width:this.root.width+e,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:e,height:this.root.height}},(r=this.findNode(this.root,e,t))?this.splitNode(r,e,t):null},growDown:function(e,t){var r;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+t,down:{x:0,y:this.root.height,width:this.root.width,height:t},right:this.root},(r=this.findNode(this.root,e,t))?this.splitNode(r,e,t):null}},e.exports=r},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){var n=r(151),i=r(15);e.exports=function e(t,r,o,a,s){return t===r||(null==t||null==r||!i(t)&&!i(r)?t!=t&&r!=r:n(t,r,o,a,e,s))}},function(e,t,r){var n=r(54),i=r(57),o=r(183),a=r(186),s=r(32),u=r(31),l=r(41),c=r(64),h="[object Object]",d=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,f,p,v){var g=u(e),m=u(t),y=g?"[object Array]":s(e),_=m?"[object Array]":s(t),b=(y="[object Arguments]"==y?h:y)==h,x=(_="[object Arguments]"==_?h:_)==h,w=y==_;if(w&&l(e)){if(!l(t))return!1;g=!0,b=!1}if(w&&!b)return v||(v=new n),g||c(e)?i(e,t,r,f,p,v):o(e,t,y,r,f,p,v);if(!(1&r)){var S=b&&d.call(e,"__wrapped__"),T=x&&d.call(t,"__wrapped__");if(S||T){var M=S?e.value():e,k=T?t.value():t;return v||(v=new n),p(M,k,r,f,v)}}return!!w&&(v||(v=new n),a(e,t,r,f,p,v))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(28),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},function(e,t,r){var n=r(28);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(28);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(28);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},function(e,t,r){var n=r(27);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(27),i=r(38),o=r(56);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(34),i=r(163),o=r(21),a=r(55),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,h=l.hasOwnProperty,d=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?d:s).test(a(e))}},function(e,t,r){var n,i=r(164),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},function(e,t,r){var n=r(14)["__core-js_shared__"];e.exports=n},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(167),i=r(27),o=r(38);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},function(e,t,r){var n=r(168),i=r(169),o=r(170),a=r(171),s=r(172);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&r|128]+i[r>>8&255]+"-"+i[r>>16&255]+i[r>>24&255]+i[255&n]+i[n>>8&255]+i[n>>16&255]+i[n>>24&255]).toUpperCase()}for(var _=r(23),w=function(){function e(){x(this,e)}return S(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var r=this._listeners[e];if(void 0!==r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var r=t.slice(0),n=0,i=r.length;n>8&255]+E[e>>16&255]+E[e>>24&255]+"-"+E[255&t]+E[t>>8&255]+"-"+E[t>>16&15|64]+E[t>>24&255]+"-"+E[63&r|128]+E[r>>8&255]+"-"+E[r>>16&255]+E[r>>24&255]+E[255&n]+E[n>>8&255]+E[n>>16&255]+E[n>>24&255]).toUpperCase()}function N(e,t,r){return Math.max(t,Math.min(r,e))}function O(e,t,r){return(1-r)*e+r*t}function R(e){return 0==(e&e-1)&&0!==e}function L(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;x(this,e),this.x=t,this.y=r}return S(e,[{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*r-o*n+e.x,this.y=i*n+o*r+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}}]),e}();j.prototype.isVector2=!0;var z,B=function(){function e(){x(this,e),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return S(e,[{key:"set",value:function(e,t,r,n,i,o,a,s,u){var l=this.elements;return l[0]=e,l[1]=n,l[2]=a,l[3]=t,l[4]=i,l[5]=s,l[6]=r,l[7]=o,l[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}},{key:"extractBasis",value:function(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[3],s=r[6],u=r[1],l=r[4],c=r[7],h=r[2],d=r[5],f=r[8],p=n[0],v=n[3],g=n[6],m=n[1],y=n[4],_=n[7],b=n[2],x=n[5],w=n[8];return i[0]=o*p+a*m+s*b,i[3]=o*v+a*y+s*x,i[6]=o*g+a*_+s*w,i[1]=u*p+l*m+c*b,i[4]=u*v+l*y+c*x,i[7]=u*g+l*_+c*w,i[2]=h*p+d*m+f*b,i[5]=h*v+d*y+f*x,i[8]=h*g+d*_+f*w,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8];return t*o*l-t*a*u-r*i*l+r*a*s+n*i*u-n*o*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=l*o-a*u,h=a*s-l*i,d=u*i-o*s,f=t*c+r*h+n*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);var p=1/f;return e[0]=c*p,e[1]=(n*u-l*r)*p,e[2]=(a*r-n*o)*p,e[3]=h*p,e[4]=(l*t-n*s)*p,e[5]=(n*i-a*t)*p,e[6]=d*p,e[7]=(r*s-u*t)*p,e[8]=(o*t-r*i)*p,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,r,n,i,o,a){var s=Math.cos(i),u=Math.sin(i);return this.set(r*s,r*u,-r*(s*o+u*a)+o+e,-n*u,n*s,-n*(-u*o+s*a)+a+t,0,0,1),this}},{key:"scale",value:function(e,t){var r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),r=Math.sin(e),n=this.elements,i=n[0],o=n[3],a=n[6],s=n[1],u=n[4],l=n[7];return n[0]=t*i+r*s,n[3]=t*o+r*u,n[6]=t*a+r*l,n[1]=-r*i+t*s,n[4]=-r*o+t*u,n[7]=-r*a+t*l,this}},{key:"translate",value:function(e,t){var r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}},{key:"equals",value:function(e){for(var t=this.elements,r=e.elements,n=0;n<9;n++)if(t[n]!==r[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<9;r++)this.elements[r]=e[r+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}]),e}();B.prototype.isMatrix3=!0;var F=function(){function e(){x(this,e)}return S(e,null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===z&&(z=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),z.width=e.width,z.height=e.height;var r=z.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=z}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}]),e}(),U=0,W=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.DEFAULT_IMAGE,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:3e3;return x(this,r),e=t.call(this),Object.defineProperty(y(e),"id",{value:U++}),e.uuid=P(),e.name="",e.image=n,e.mipmaps=[],e.mapping=i,e.wrapS=o,e.wrapT=a,e.magFilter=s,e.minFilter=u,e.anisotropy=h,e.format=l,e.internalFormat=null,e.type=c,e.offset=new j(0,0),e.repeat=new j(1,1),e.center=new j(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new B,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.encoding=d,e.version=0,e.onUpdate=null,e}return S(r,[{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=P()),!t&&void 0===e.images[n.uuid]){var i;if(Array.isArray(n)){i=[];for(var o=0,a=n.length;o1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),r}(w);function G(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?F.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}W.DEFAULT_IMAGE=void 0,W.DEFAULT_MAPPING=300,W.prototype.isTexture=!0;var V=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;x(this,e),this.x=t,this.y=r,this.z=n,this.w=i}return S(e,[{key:"set",value:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,r=this.y,n=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*t+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*t+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*t+o[7]*r+o[11]*n+o[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,r,n,i,o=e.elements,a=o[0],s=o[4],u=o[8],l=o[1],c=o[5],h=o[9],d=o[2],f=o[6],p=o[10];if(Math.abs(s-l)<.01&&Math.abs(u-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+l)<.1&&Math.abs(u+d)<.1&&Math.abs(h+f)<.1&&Math.abs(a+c+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var v=(a+1)/2,g=(c+1)/2,m=(p+1)/2,y=(s+l)/4,_=(u+d)/4,b=(h+f)/4;return v>g&&v>m?v<.01?(r=0,n=.707106781,i=.707106781):(n=y/(r=Math.sqrt(v)),i=_/r):g>m?g<.01?(r=.707106781,n=0,i=.707106781):(r=y/(n=Math.sqrt(g)),i=b/n):m<.01?(r=.707106781,n=.707106781,i=0):(r=_/(i=Math.sqrt(m)),n=b/i),this.set(r,n,i,t),this}var x=Math.sqrt((f-h)*(f-h)+(u-d)*(u-d)+(l-s)*(l-s));return Math.abs(x)<.001&&(x=1),this.x=(f-h)/x,this.y=(u-d)/x,this.z=(l-s)/x,this.w=Math.acos((a+c+p-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}}]),e}();V.prototype.isVector4=!0;var H=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return x(this,r),(i=t.call(this)).width=e,i.height=n,i.depth=1,i.scissor=new V(0,0,e,n),i.scissorTest=!1,i.viewport=new V(0,0,e,n),i.texture=new W(void 0,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.encoding),i.texture.image={width:e,height:n,depth:1},i.texture.generateMipmaps=void 0!==o.generateMipmaps&&o.generateMipmaps,i.texture.minFilter=void 0!==o.minFilter?o.minFilter:1006,i.depthBuffer=void 0===o.depthBuffer||o.depthBuffer,i.stencilBuffer=void 0!==o.stencilBuffer&&o.stencilBuffer,i.depthTexture=void 0!==o.depthTexture?o.depthTexture:null,i}return S(r,[{key:"setTexture",value:function(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}},{key:"setSize",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.width===e&&this.height===t&&this.depth===r||(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=D({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),r}(w);H.prototype.isWebGLRenderTarget=!0,function(e){p(r,e);var t=g(r);function r(e,n,i){var o;x(this,r);var a=(o=t.call(this,e,n)).texture;o.texture=[];for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(var n=0,i=this.texture.length;n0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;x(this,e),this._x=t,this._y=r,this._z=n,this._w=i}return S(e,[{key:"set",value:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,u=a(r/2),l=a(n/2),c=a(i/2),h=s(r/2),d=s(n/2),f=s(i/2);switch(o){case"XYZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"YXZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"ZXY":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"ZYX":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"YZX":this._x=h*l*c+u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c-h*d*f;break;case"XZY":this._x=h*l*c-u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,r=t[0],n=t[4],i=t[8],o=t[1],a=t[5],s=t[9],u=t[2],l=t[6],c=t[10],h=r+a+c;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(l-s)*d,this._y=(i-u)*d,this._z=(o-n)*d}else if(r>a&&r>c){var f=2*Math.sqrt(1+r-a-c);this._w=(l-s)/f,this._x=.25*f,this._y=(n+o)/f,this._z=(i+u)/f}else if(a>c){var p=2*Math.sqrt(1+a-r-c);this._w=(i-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(s+l)/p}else{var v=2*Math.sqrt(1+c-r-a);this._w=(o-n)/v,this._x=(i+u)/v,this._y=(s+l)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(N(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var r=this.angleTo(e);if(0===r)return this;var n=Math.min(1,t/r);return this.slerp(e,n),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var r=e._x,n=e._y,i=e._z,o=e._w,a=t._x,s=t._y,u=t._z,l=t._w;return this._x=r*l+o*a+n*u-i*s,this._y=n*l+o*s+i*a-r*u,this._z=i*l+o*u+r*s-n*a,this._w=o*l-r*a-n*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*e._w+r*e._x+n*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=n,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-t;return this._w=u*o+t*this._w,this._x=u*r+t*this._x,this._y=u*n+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),c=Math.atan2(l,a),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=o*h+this._w*d,this._x=r*h+this._x*d,this._y=n*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,r){this.copy(e).slerp(t,r)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}],[{key:"slerp",value:function(e,t,r,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),r.slerpQuaternions(e,t,n)}},{key:"slerpFlat",value:function(e,t,r,n,i,o,a){var s=r[n+0],u=r[n+1],l=r[n+2],c=r[n+3],h=i[o+0],d=i[o+1],f=i[o+2],p=i[o+3];if(0===a)return e[t+0]=s,e[t+1]=u,e[t+2]=l,void(e[t+3]=c);if(1===a)return e[t+0]=h,e[t+1]=d,e[t+2]=f,void(e[t+3]=p);if(c!==p||s!==h||u!==d||l!==f){var v=1-a,g=s*h+u*d+l*f+c*p,m=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var _=Math.sqrt(y),b=Math.atan2(_,g*m);v=Math.sin(v*b)/_,a=Math.sin(a*b)/_}var x=a*m;if(s=s*v+h*x,u=u*v+d*x,l=l*v+f*x,c=c*v+p*x,v===1-a){var w=1/Math.sqrt(s*s+u*u+l*l+c*c);s*=w,u*=w,l*=w,c*=w}}e[t]=s,e[t+1]=u,e[t+2]=l,e[t+3]=c}},{key:"multiplyQuaternionsFlat",value:function(e,t,r,n,i,o){var a=r[n],s=r[n+1],u=r[n+2],l=r[n+3],c=i[o],h=i[o+1],d=i[o+2],f=i[o+3];return e[t]=a*f+l*c+s*d-u*h,e[t+1]=s*f+l*h+u*c-a*d,e[t+2]=u*f+l*d+a*h-s*c,e[t+3]=l*f-a*c-s*h-u*d,e}}]),e}();$.prototype.isQuaternion=!0;var X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;x(this,e),this.x=t,this.y=r,this.z=n}return S(e,[{key:"set",value:function(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Q.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(Q.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,o=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*o,this}},{key:"applyQuaternion",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=e.w,u=s*t+o*n-a*r,l=s*r+a*t-i*n,c=s*n+i*r-o*t,h=-i*t-o*r-a*n;return this.x=u*s+h*-i+l*-a-c*-o,this.y=l*s+h*-o+c*-i-u*-a,this.z=c*s+h*-a+u*-o-l*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var r=e.x,n=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}},{key:"projectOnPlane",value:function(e){return q.copy(this).projectOnVector(e),this.sub(q)}},{key:"reflect",value:function(e){return this.sub(q.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var r=this.dot(e)/t;return Math.acos(N(r,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,r){var n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),e}();X.prototype.isVector3=!0;var q=new X,Q=new $,Z=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X(1/0,1/0,1/0),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X(-1/0,-1/0,-1/0);x(this,e),this.min=t,this.max=r}return S(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.length;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,r,n),this.max.set(i,o,a),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.count;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,r,n),this.max.set(i,o,a),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,J),J.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(se),ue.subVectors(this.max,se),te.subVectors(e.a,se),re.subVectors(e.b,se),ne.subVectors(e.c,se),ie.subVectors(re,te),oe.subVectors(ne,re),ae.subVectors(te,ne);var t=[0,-ie.z,ie.y,0,-oe.z,oe.y,0,-ae.z,ae.y,ie.z,0,-ie.x,oe.z,0,-oe.x,ae.z,0,-ae.x,-ie.y,ie.x,0,-oe.y,oe.x,0,-ae.y,ae.x,0];return!!he(t,te,re,ne,ue)&&(!!he(t=[1,0,0,0,1,0,0,0,1],te,re,ne,ue)&&(le.crossVectors(ie,oe),he(t=[le.x,le.y,le.z],te,re,ne,ue)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return J.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return this.getCenter(e.center),e.radius=.5*this.getSize(J).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(K[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),K[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),K[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),K[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),K[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),K[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),K[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),K[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(K)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}();Z.prototype.isBox3=!0;var K=[new X,new X,new X,new X,new X,new X,new X,new X],J=new X,ee=new Z,te=new X,re=new X,ne=new X,ie=new X,oe=new X,ae=new X,se=new X,ue=new X,le=new X,ce=new X;function he(e,t,r,n,i){for(var o=0,a=e.length-3;o<=a;o+=3){ce.fromArray(e,o);var s=i.x*Math.abs(ce.x)+i.y*Math.abs(ce.y)+i.z*Math.abs(ce.z),u=t.dot(ce),l=r.dot(ce),c=n.dot(ce);if(Math.max(-Math.max(u,l,c),Math.min(u,l,c))>s)return!1}return!0}var de=new Z,fe=new X,pe=new X,ve=new X,ge=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;x(this,e),this.center=t,this.radius=r}return S(e,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var r=this.center;void 0!==t?r.copy(t):de.setFromPoints(e).getCenter(r);for(var n=0,i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){ve.subVectors(e,this.center);var t=ve.lengthSq();if(t>this.radius*this.radius){var r=Math.sqrt(t),n=.5*(r-this.radius);this.center.add(ve.multiplyScalar(n/r)),this.radius+=n}return this}},{key:"union",value:function(e){return pe.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(fe.copy(e.center).add(pe)),this.expandByPoint(fe.copy(e.center).sub(pe)),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),me=new X,ye=new X,_e=new X,be=new X,xe=new X,we=new X,Se=new X,Te=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X(0,0,-1);x(this,e),this.origin=t,this.direction=r}return S(e,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,me)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=me.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(me.copy(this.direction).multiplyScalar(t).add(this.origin),me.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,r,n){ye.copy(e).add(t).multiplyScalar(.5),_e.copy(t).sub(e).normalize(),be.copy(this.origin).sub(ye);var i,o,a,s,u=.5*e.distanceTo(t),l=-this.direction.dot(_e),c=be.dot(this.direction),h=-be.dot(_e),d=be.lengthSq(),f=Math.abs(1-l*l);if(f>0)if(o=l*c-h,s=u*f,(i=l*h-c)>=0)if(o>=-s)if(o<=s){var p=1/f;a=(i*=p)*(i+l*(o*=p)+2*c)+o*(l*i+o+2*h)+d}else o=u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o=-u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-l*u+c)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+d):a=-(i=Math.max(0,-(l*u+c)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d;else o=l>0?-u:u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;return r&&r.copy(this.direction).multiplyScalar(i).add(this.origin),n&&n.copy(_e).multiplyScalar(o).add(ye),a}},{key:"intersectSphere",value:function(e,t){me.subVectors(e.center,this.origin);var r=me.dot(this.direction),n=me.dot(me)-r*r,i=e.radius*e.radius;if(n>i)return null;var o=Math.sqrt(i-n),a=r-o,s=r+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}},{key:"intersectPlane",value:function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var r,n,i,o,a,s,u=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,h=this.origin;return u>=0?(r=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(r=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),l>=0?(i=(e.min.y-h.y)*l,o=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,o=(e.min.y-h.y)*l),r>o||i>n?null:((i>r||r!=r)&&(r=i),(o=0?(a=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(a=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),r>s||a>n?null:((a>r||r!=r)&&(r=a),(s=0?r:n,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,me)}},{key:"intersectTriangle",value:function(e,t,r,n,i){xe.subVectors(t,e),we.subVectors(r,e),Se.crossVectors(xe,we);var o,a=this.direction.dot(Se);if(a>0){if(n)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}be.subVectors(this.origin,e);var s=o*this.direction.dot(we.crossVectors(be,we));if(s<0)return null;var u=o*this.direction.dot(xe.cross(be));if(u<0)return null;if(s+u>a)return null;var l=-o*be.dot(Se);return l<0?null:this.at(l/a,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),Me=function(){function e(){x(this,e),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return S(e,[{key:"set",value:function(e,t,r,n,i,o,a,s,u,l,c,h,d,f,p,v){var g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=u,g[6]=l,g[10]=c,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,r=e.elements,n=1/ke.setFromMatrixColumn(e,0).length(),i=1/ke.setFromMatrixColumn(e,1).length(),o=1/ke.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,o=Math.cos(r),a=Math.sin(r),s=Math.cos(n),u=Math.sin(n),l=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=o*l,d=o*c,f=a*l,p=a*c;t[0]=s*l,t[4]=-s*c,t[8]=u,t[1]=d+f*u,t[5]=h-p*u,t[9]=-a*s,t[2]=p-h*u,t[6]=f+d*u,t[10]=o*s}else if("YXZ"===e.order){var v=s*l,g=s*c,m=u*l,y=u*c;t[0]=v+y*a,t[4]=m*a-g,t[8]=o*u,t[1]=o*c,t[5]=o*l,t[9]=-a,t[2]=g*a-m,t[6]=y+v*a,t[10]=o*s}else if("ZXY"===e.order){var _=s*l,b=s*c,x=u*l,w=u*c;t[0]=_-w*a,t[4]=-o*c,t[8]=x+b*a,t[1]=b+x*a,t[5]=o*l,t[9]=w-_*a,t[2]=-o*u,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var S=o*l,T=o*c,M=a*l,k=a*c;t[0]=s*l,t[4]=M*u-T,t[8]=S*u+k,t[1]=s*c,t[5]=k*u+S,t[9]=T*u-M,t[2]=-u,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var E=o*s,I=o*u,A=a*s,C=a*u;t[0]=s*l,t[4]=C-E*c,t[8]=A*c+I,t[1]=c,t[5]=o*l,t[9]=-a*l,t[2]=-u*l,t[6]=I*c+A,t[10]=E-C*c}else if("XZY"===e.order){var P=o*s,N=o*u,O=a*s,R=a*u;t[0]=s*l,t[4]=-c,t[8]=u*l,t[1]=P*c+R,t[5]=o*l,t[9]=N*c-O,t[2]=O*c-N,t[6]=a*l,t[10]=R*c+P}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Ie,e,Ae)}},{key:"lookAt",value:function(e,t,r){var n=this.elements;return Ne.subVectors(e,t),0===Ne.lengthSq()&&(Ne.z=1),Ne.normalize(),Ce.crossVectors(r,Ne),0===Ce.lengthSq()&&(1===Math.abs(r.z)?Ne.x+=1e-4:Ne.z+=1e-4,Ne.normalize(),Ce.crossVectors(r,Ne)),Ce.normalize(),Pe.crossVectors(Ne,Ce),n[0]=Ce.x,n[4]=Pe.x,n[8]=Ne.x,n[1]=Ce.y,n[5]=Pe.y,n[9]=Ne.y,n[2]=Ce.z,n[6]=Pe.z,n[10]=Ne.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[4],s=r[8],u=r[12],l=r[1],c=r[5],h=r[9],d=r[13],f=r[2],p=r[6],v=r[10],g=r[14],m=r[3],y=r[7],_=r[11],b=r[15],x=n[0],w=n[4],S=n[8],T=n[12],M=n[1],k=n[5],E=n[9],I=n[13],A=n[2],C=n[6],P=n[10],N=n[14],O=n[3],R=n[7],D=n[11],L=n[15];return i[0]=o*x+a*M+s*A+u*O,i[4]=o*w+a*k+s*C+u*R,i[8]=o*S+a*E+s*P+u*D,i[12]=o*T+a*I+s*N+u*L,i[1]=l*x+c*M+h*A+d*O,i[5]=l*w+c*k+h*C+d*R,i[9]=l*S+c*E+h*P+d*D,i[13]=l*T+c*I+h*N+d*L,i[2]=f*x+p*M+v*A+g*O,i[6]=f*w+p*k+v*C+g*R,i[10]=f*S+p*E+v*P+g*D,i[14]=f*T+p*I+v*N+g*L,i[3]=m*x+y*M+_*A+b*O,i[7]=m*w+y*k+_*C+b*R,i[11]=m*S+y*E+_*P+b*D,i[15]=m*T+y*I+_*N+b*L,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],o=e[1],a=e[5],s=e[9],u=e[13],l=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+i*s*c-n*u*c-i*a*h+r*u*h+n*a*d-r*s*d)+e[7]*(+t*s*d-t*u*h+i*o*h-n*o*d+n*u*l-i*s*l)+e[11]*(+t*u*c-t*a*d-i*o*c+r*o*d+i*a*l-r*u*l)+e[15]*(-n*a*l-t*s*c+t*a*h+n*o*c-r*o*h+r*s*l)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,r){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],d=e[11],f=e[12],p=e[13],v=e[14],g=e[15],m=c*v*u-p*h*u+p*s*d-a*v*d-c*s*g+a*h*g,y=f*h*u-l*v*u-f*s*d+o*v*d+l*s*g-o*h*g,_=l*p*u-f*c*u+f*a*d-o*p*d-l*a*g+o*c*g,b=f*c*s-l*p*s-f*a*h+o*p*h+l*a*v-o*c*v,x=t*m+r*y+n*_+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var w=1/x;return e[0]=m*w,e[1]=(p*h*i-c*v*i-p*n*d+r*v*d+c*n*g-r*h*g)*w,e[2]=(a*v*i-p*s*i+p*n*u-r*v*u-a*n*g+r*s*g)*w,e[3]=(c*s*i-a*h*i-c*n*u+r*h*u+a*n*d-r*s*d)*w,e[4]=y*w,e[5]=(l*v*i-f*h*i+f*n*d-t*v*d-l*n*g+t*h*g)*w,e[6]=(f*s*i-o*v*i-f*n*u+t*v*u+o*n*g-t*s*g)*w,e[7]=(o*h*i-l*s*i+l*n*u-t*h*u-o*n*d+t*s*d)*w,e[8]=_*w,e[9]=(f*c*i-l*p*i-f*r*d+t*p*d+l*r*g-t*c*g)*w,e[10]=(o*p*i-f*a*i+f*r*u-t*p*u-o*r*g+t*a*g)*w,e[11]=(l*a*i-o*c*i-l*r*u+t*c*u+o*r*d-t*a*d)*w,e[12]=b*w,e[13]=(l*p*n-f*c*n+f*r*h-t*p*h-l*r*v+t*c*v)*w,e[14]=(f*a*n-o*p*n-f*r*s+t*p*s+o*r*v-t*a*v)*w,e[15]=(o*c*n-l*a*n+l*r*s-t*c*s-o*r*h+t*a*h)*w,this}},{key:"scale",value:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))}},{key:"makeTranslation",value:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=1-r,o=e.x,a=e.y,s=e.z,u=i*o,l=i*a;return this.set(u*o+r,u*a-n*s,u*s+n*a,0,u*a+n*s,l*a+r,l*s-n*o,0,u*s-n*a,l*s+n*o,i*s*s+r,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,r,n,i,o){return this.set(1,r,i,0,e,1,o,0,t,n,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,r){var n=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,u=i+i,l=o+o,c=a+a,h=i*u,d=i*l,f=i*c,p=o*l,v=o*c,g=a*c,m=s*u,y=s*l,_=s*c,b=r.x,x=r.y,w=r.z;return n[0]=(1-(p+g))*b,n[1]=(d+_)*b,n[2]=(f-y)*b,n[3]=0,n[4]=(d-_)*x,n[5]=(1-(h+g))*x,n[6]=(v+m)*x,n[7]=0,n[8]=(f+y)*w,n[9]=(v-m)*w,n[10]=(1-(h+p))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}},{key:"decompose",value:function(e,t,r){var n=this.elements,i=ke.set(n[0],n[1],n[2]).length(),o=ke.set(n[4],n[5],n[6]).length(),a=ke.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],Ee.copy(this);var s=1/i,u=1/o,l=1/a;return Ee.elements[0]*=s,Ee.elements[1]*=s,Ee.elements[2]*=s,Ee.elements[4]*=u,Ee.elements[5]*=u,Ee.elements[6]*=u,Ee.elements[8]*=l,Ee.elements[9]*=l,Ee.elements[10]*=l,t.setFromRotationMatrix(Ee),r.x=i,r.y=o,r.z=a,this}},{key:"makePerspective",value:function(e,t,r,n,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),u=2*i/(r-n),l=(t+e)/(t-e),c=(r+n)/(r-n),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=u,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}},{key:"makeOrthographic",value:function(e,t,r,n,i,o){var a=this.elements,s=1/(t-e),u=1/(r-n),l=1/(o-i),c=(t+e)*s,h=(r+n)*u,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,r=e.elements,n=0;n<16;n++)if(t[n]!==r[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<16;r++)this.elements[r]=e[r+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}]),e}();Me.prototype.isMatrix4=!0;var ke=new X,Ee=new Me,Ie=new X(0,0,0),Ae=new X(1,1,1),Ce=new X,Pe=new X,Ne=new X,Oe=new Me,Re=new $,De=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;x(this,e),this._x=t,this._y=r,this._z=n,this._order=i}return S(e,[{key:"set",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=r,this._order=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.elements,i=n[0],o=n[4],a=n[8],s=n[1],u=n[5],l=n[9],c=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(N(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-N(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(s,u)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(N(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-N(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(N(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-N(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,r){return Oe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Oe,t,r)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return Re.setFromEuler(this),this.setFromQuaternion(Re,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new X(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}]),e}();De.prototype.isEuler=!0,De.DefaultOrder="XYZ",De.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Le=function(){function e(){x(this,e),this.mask=1}return S(e,[{key:"set",value:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){n.children=[];for(var f=0;f0){n.animations=[];for(var p=0;p0&&(r.geometries=g),m.length>0&&(r.materials=m),y.length>0&&(r.textures=y),_.length>0&&(r.images=_),b.length>0&&(r.shapes=b),x.length>0&&(r.skeletons=x),w.length>0&&(r.animations=w)}return r.object=n,r;function S(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:new X,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new X;x(this,e),this.a=t,this.b=r,this.c=n}return S(e,[{key:"set",value:function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}},{key:"setFromPointsAndIndices",value:function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return Ze.subVectors(this.c,this.b),Ke.subVectors(this.a,this.b),.5*Ze.cross(Ke).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,r){return e.getBarycoord(t,this.a,this.b,this.c,r)}},{key:"getUV",value:function(t,r,n,i,o){return e.getUV(t,this.a,this.b,this.c,r,n,i,o)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var r,n,i=this.a,o=this.b,a=this.c;tt.subVectors(o,i),rt.subVectors(a,i),it.subVectors(e,i);var s=tt.dot(it),u=rt.dot(it);if(s<=0&&u<=0)return t.copy(i);ot.subVectors(e,o);var l=tt.dot(ot),c=rt.dot(ot);if(l>=0&&c<=l)return t.copy(o);var h=s*c-l*u;if(h<=0&&s>=0&&l<=0)return r=s/(s-l),t.copy(i).addScaledVector(tt,r);at.subVectors(e,a);var d=tt.dot(at),f=rt.dot(at);if(f>=0&&d<=f)return t.copy(a);var p=d*u-s*f;if(p<=0&&u>=0&&f<=0)return n=u/(u-f),t.copy(i).addScaledVector(rt,n);var v=l*f-d*c;if(v<=0&&c-l>=0&&d-f>=0)return nt.subVectors(a,o),n=(c-l)/(c-l+(d-f)),t.copy(o).addScaledVector(nt,n);var g=1/(v+p+h);return r=p*g,n=h*g,t.copy(i).addScaledVector(tt,r).addScaledVector(rt,n)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,r,n){n.subVectors(r,t),Ze.subVectors(e,t),n.cross(Ze);var i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,r,n,i){Ze.subVectors(n,t),Ke.subVectors(r,t),Je.subVectors(e,t);var o=Ze.dot(Ze),a=Ze.dot(Ke),s=Ze.dot(Je),u=Ke.dot(Ke),l=Ke.dot(Je),c=o*u-a*a;if(0===c)return i.set(-2,-1,-1);var h=1/c,d=(u*s-a*l)*h,f=(o*l-a*s)*h;return i.set(1-d-f,f,d)}},{key:"containsPoint",value:function(e,t,r,n){return this.getBarycoord(e,t,r,n,et),et.x>=0&&et.y>=0&&et.x+et.y<=1}},{key:"getUV",value:function(e,t,r,n,i,o,a,s){return this.getBarycoord(e,t,r,n,et),s.set(0,0),s.addScaledVector(i,et.x),s.addScaledVector(o,et.y),s.addScaledVector(a,et.z),s}},{key:"isFrontFacing",value:function(e,t,r,n){return Ze.subVectors(r,t),Ke.subVectors(e,t),Ze.cross(Ke).dot(n)<0}}]),e}(),ut=0,lt=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),e=t.call(this),Object.defineProperty(y(e),"id",{value:ut++}),e.uuid=P(),e.name="",e.type="Material",e.fog=!0,e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=7680,e.stencilZFail=7680,e.stencilZPass=7680,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaTest=0,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e}return S(r,[{key:"onBuild",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var r=e[t];if(void 0!==r)if("shading"!==t){var n=this[t];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===r;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(r.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(r.blending=this.blending),0!==this.side&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(r.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.morphNormals&&(r.morphNormals=!0),!0===this.flatShading&&(r.flatShading=this.flatShading),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),t){var i=n(e.textures),o=n(e.images);i.length>0&&(r.textures=i),o.length>0&&(r.images=o)}return r}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,r=null;if(null!==t){var n=t.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=t[i].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),r}(w);lt.prototype.isMaterial=!0;var ct={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ht={h:0,s:0,l:0},dt={h:0,s:0,l:0};function ft(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}function pt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var gt=function(){function e(t,r,n){return x(this,e),void 0===r&&void 0===n?this.set(t):this.setRGB(t,r,n)}return S(e,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,r){return this.r=e,this.g=t,this.b=r,this}},{key:"setHSL",value:function(e,t,r){if(e=function(e,t){return(e%t+t)%t}(e,1),t=N(t,0,1),r=N(r,0,1),0===t)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=ft(i,n,e+1/3),this.g=ft(i,n,e),this.b=ft(i,n,e-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){var n,i=r[1],o=r[2];switch(i){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[4]),this;if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[4]),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){var a=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,u=parseInt(n[3],10)/100;return t(n[4]),this.setHSL(a,s,u)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){var l=r[1],c=l.length;if(3===c)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}},{key:"setColorName",value:function(e){var t=ct[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=pt(e.r),this.g=pt(e.g),this.b=pt(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=vt(e.r),this.g=vt(e.g),this.b=vt(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t,r,n=this.r,i=this.g,o=this.b,a=Math.max(n,i,o),s=Math.min(n,i,o),u=(s+a)/2;if(s===a)t=0,r=0;else{var l=a-s;switch(r=u<=.5?l/(a+s):l/(2-a-s),a){case n:t=(i-o)/l+(i1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),e}();gt.NAMES=ct,gt.prototype.isColor=!0,gt.prototype.r=1,gt.prototype.g=1,gt.prototype.b=1;var mt=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="MeshBasicMaterial",n.color=new gt(16777215),n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.combine=0,n.reflectivity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.morphTargets=!1,n.setValues(e),n}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this}}]),r}(lt);mt.prototype.isMeshBasicMaterial=!0;var yt=new X,_t=new j,bt=function(){function e(t,r,n){if(x(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=r,this.count=void 0!==t?t.length/r:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}return S(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,r){e*=this.itemSize,r*=t.itemSize;for(var n=0,i=this.itemSize;n1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getX",value:function(e){return this.array[e*this.itemSize]}},{key:"setX",value:function(e,t){return this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){return this.array[e*this.itemSize+1]}},{key:"setY",value:function(e,t){return this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){return this.array[e*this.itemSize+2]}},{key:"setZ",value:function(e,t){return this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){return this.array[e*this.itemSize+3]}},{key:"setW",value:function(e,t){return this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this}},{key:"setXYZ",value:function(e,t,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this}},{key:"setXYZW",value:function(e,t,r,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();bt.prototype.isBufferAttribute=!0;var xt=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Uint16Array(e),n,i)}return r}(bt),wt=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Int32Array(e),n,i)}return r}(bt),St=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Uint32Array(e),n,i)}return r}(bt);(function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Uint16Array(e),n,i)}return r})(bt).prototype.isFloat16BufferAttribute=!0;var Tt=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Float32Array(e),n,i)}return r}(bt);function Mt(e){if(0===e.length)return-1/0;for(var t=e[0],r=1,n=e.length;rt&&(t=e[r]);return t}var kt=0,Et=new Me,It=new Qe,At=new X,Ct=new Z,Pt=new Z,Nt=new X,Ot=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),e=t.call(this),Object.defineProperty(y(e),"id",{value:kt++}),e.uuid=P(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return S(r,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(Mt(e)>65535?St:xt)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:r})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var n=(new B).getNormalMatrix(e);r.applyNormalMatrix(n),r.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return Et.makeRotationFromQuaternion(e),this.applyMatrix4(Et),this}},{key:"rotateX",value:function(e){return Et.makeRotationX(e),this.applyMatrix4(Et),this}},{key:"rotateY",value:function(e){return Et.makeRotationY(e),this.applyMatrix4(Et),this}},{key:"rotateZ",value:function(e){return Et.makeRotationZ(e),this.applyMatrix4(Et),this}},{key:"translate",value:function(e,t,r){return Et.makeTranslation(e,t,r),this.applyMatrix4(Et),this}},{key:"scale",value:function(e,t,r){return Et.makeScale(e,t,r),this.applyMatrix4(Et),this}},{key:"lookAt",value:function(e){return It.lookAt(e),It.updateMatrix(),this.applyMatrix4(It.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(At).negate(),this.translate(At.x,At.y,At.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],r=0,n=e.length;r0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var i=this.attributes;for(var o in i){var a=i[o];e.data.attributes[o]=a.toJSON(e.data)}var s={},u=!1;for(var l in this.morphAttributes){for(var c=this.morphAttributes[l],h=[],d=0,f=c.length;d0&&(s[l]=h,u=!0)}u&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;v.length>0&&(e.data.groups=JSON.parse(JSON.stringify(v)));var g=this.boundingSphere;return null!==g&&(e.data.boundingSphere={center:g.center.toArray(),radius:g.radius}),e}},{key:"clone",value:function(){return(new r).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone(t));var n=e.attributes;for(var i in n){var o=n[i];this.setAttribute(i,o.clone(t))}var a=e.morphAttributes;for(var s in a){for(var u=[],l=a[s],c=0,h=l.length;c0&&void 0!==arguments[0]?arguments[0]:new Ot,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mt;return x(this,r),(e=t.call(this)).type="Mesh",e.geometry=n,e.material=i,e.updateMorphTargets(),e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,r=Object.keys(t);if(r.length>0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=n.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"raycast",value:function(e,t){var r,n=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===n.boundingSphere&&n.computeBoundingSphere(),Lt.copy(n.boundingSphere),Lt.applyMatrix4(o),!1!==e.ray.intersectsSphere(Lt)&&(Rt.copy(o).invert(),Dt.copy(e.ray).applyMatrix4(Rt),null===n.boundingBox||!1!==Dt.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var a=n.index,s=n.attributes.position,u=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,h=n.attributes.uv2,d=n.groups,f=n.drawRange;if(null!==a)if(Array.isArray(i))for(var p=0,v=d.length;pr.far?null:{distance:u,point:Qt.clone(),object:e}}(e,t,r,n,jt,zt,Bt,qt);if(m){s&&(Yt.fromBufferAttribute(s,l),$t.fromBufferAttribute(s,c),Xt.fromBufferAttribute(s,h),m.uv=st.getUV(qt,jt,zt,Bt,Yt,$t,Xt,new j)),u&&(Yt.fromBufferAttribute(u,l),$t.fromBufferAttribute(u,c),Xt.fromBufferAttribute(u,h),m.uv2=st.getUV(qt,jt,zt,Bt,Yt,$t,Xt,new j));var y={a:l,b:c,c:h,normal:new X,materialIndex:0};st.getNormal(jt,zt,Bt,y.normal),m.face=y}return m}Zt.prototype.isMesh=!0;var Jt=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;x(this,r),(e=t.call(this)).type="BoxGeometry",e.parameters={width:n,height:i,depth:o,widthSegments:a,heightSegments:s,depthSegments:u};var l=y(e);a=Math.floor(a),s=Math.floor(s),u=Math.floor(u);var c=[],h=[],d=[],f=[],p=0,v=0;function g(e,t,r,n,i,o,a,s,u,g,m){for(var y=o/u,_=a/g,b=o/2,x=a/2,w=s/2,S=u+1,T=g+1,M=0,k=0,E=new X,I=0;I0?1:-1,d.push(E.x,E.y,E.z),f.push(C/u),f.push(1-I/g),M+=1}for(var N=0;N0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var o={};for(var a in this.extensions)!0===this.extensions[a]&&(o[a]=!0);return Object.keys(o).length>0&&(t.extensions=o),t}}]),r}(lt);nr.prototype.isShaderMaterial=!0;var ir=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="Camera",e.matrixWorldInverse=new Me,e.projectionMatrix=new Me,e.projectionMatrixInverse=new Me,e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(e){f(b(r.prototype),"updateMatrixWorld",this).call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,t){f(b(r.prototype),"updateWorldMatrix",this).call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),r}(Qe);ir.prototype.isCamera=!0;var or=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;return x(this,r),(e=t.call(this)).type="PerspectiveCamera",e.fov=n,e.zoom=1,e.near=o,e.far=a,e.focus=10,e.aspect=i,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}},{key:"setFocalLength",value:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*C*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*A*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*C*Math.atan(Math.tan(.5*A*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"setViewOffset",value:function(e,t,r,n,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,t=e*Math.tan(.5*A*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*n/a,t-=o.offsetY*r/s,n*=o.width/a,r*=o.height/s}var u=this.filmOffset;0!==u&&(i+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}]),r}(ir);or.prototype.isPerspectiveCamera=!0;var ar=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;if(x(this,r),(o=t.call(this)).type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return m(o,void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."));o.renderTarget=i;var a=new or(90,1,e,n);a.layers=o.layers,a.up.set(0,-1,0),a.lookAt(new X(1,0,0)),o.add(a);var s=new or(90,1,e,n);s.layers=o.layers,s.up.set(0,-1,0),s.lookAt(new X(-1,0,0)),o.add(s);var u=new or(90,1,e,n);u.layers=o.layers,u.up.set(0,0,1),u.lookAt(new X(0,1,0)),o.add(u);var l=new or(90,1,e,n);l.layers=o.layers,l.up.set(0,0,-1),l.lookAt(new X(0,-1,0)),o.add(l);var c=new or(90,1,e,n);c.layers=o.layers,c.up.set(0,-1,0),c.lookAt(new X(0,0,1)),o.add(c);var h=new or(90,1,e,n);return h.layers=o.layers,h.up.set(0,-1,0),h.lookAt(new X(0,0,-1)),o.add(h),m(o)}return S(r,[{key:"update",value:function(e,t){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,n=c(this.children,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],l=n[5],h=e.xr.enabled,d=e.getRenderTarget();e.xr.enabled=!1;var f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,o),e.setRenderTarget(r,2),e.render(t,a),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,u),r.texture.generateMipmaps=f,e.setRenderTarget(r,5),e.render(t,l),e.setRenderTarget(d),e.xr.enabled=h}}]),r}(Qe),sr=function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c,h){var d;return x(this,r),(d=t.call(this,e=void 0!==e?e:[],n=void 0!==n?n:301,i,o,a,s,u=void 0!==u?u:1022,l,c,h))._needsFlipEnvMap=!0,d.flipY=!1,d}return S(r,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}]),r}(W);sr.prototype.isCubeTexture=!0;var ur=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),Number.isInteger(n)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),n=i),o=t.call(this,e,e,n),n=n||{},o.texture=new sr(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),o.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,o.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,o.texture._needsFlipEnvMap=!1,o}return S(r,[{key:"fromEquirectangularTexture",value:function(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var r={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new Jt(5,5,5),a=new nr({name:"CubemapFromEquirect",uniforms:er(r),vertexShader:n,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;var s=new Zt(o,a),u=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new ar(1,10,this).update(e,s),t.minFilter=u,s.geometry.dispose(),s.material.dispose(),this}},{key:"clear",value:function(e,t,r,n){for(var i=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,n);e.setRenderTarget(i)}}]),r}(H);ur.prototype.isWebGLCubeRenderTarget=!0;var lr=new X,cr=new X,hr=new B,dr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X(1,0,0),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;x(this,e),this.normal=t,this.constant=r}return S(e,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,r){var n=lr.subVectors(r,t).cross(cr.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(e,t){var r=e.delta(lr),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?null:t.copy(r).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var r=t||hr.getNormalMatrix(e),n=this.coplanarPoint(lr).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();dr.prototype.isPlane=!0;var fr=new ge,pr=new X,vr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new dr,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new dr,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new dr,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new dr,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new dr,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new dr;x(this,e),this.planes=[t,r,n,i,o,a]}return S(e,[{key:"set",value:function(e,t,r,n,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this}},{key:"copy",value:function(e){for(var t=this.planes,r=0;r<6;r++)t[r].copy(e.planes[r]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,r=e.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6],c=r[7],h=r[8],d=r[9],f=r[10],p=r[11],v=r[12],g=r[13],m=r[14],y=r[15];return t[0].setComponents(a-n,c-s,p-h,y-v).normalize(),t[1].setComponents(a+n,c+s,p+h,y+v).normalize(),t[2].setComponents(a+i,c+u,p+d,y+g).normalize(),t[3].setComponents(a-i,c-u,p-d,y-g).normalize(),t[4].setComponents(a-o,c-l,p-f,y-m).normalize(),t[5].setComponents(a+o,c+l,p+f,y+m).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),fr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(fr)}},{key:"intersectsSprite",value:function(e){return fr.center.set(0,0,0),fr.radius=.7071067811865476,fr.applyMatrix4(e.matrixWorld),this.intersectsSphere(fr)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,r=e.center,n=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(r)0?e.max.x:e.min.x,pr.y=n.normal.y>0?e.max.y:e.min.y,pr.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(pr)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();function gr(){var e=null,t=!1,r=null,n=null;function i(t,o){r(t,o),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function mr(e,t){var r=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var o=n.get(t);(!o||o.version0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;x(this,r),(e=t.call(this)).type="PlaneGeometry",e.parameters={width:n,height:i,widthSegments:o,heightSegments:a};for(var s=n/2,u=i/2,l=Math.floor(o),c=Math.floor(a),h=l+1,d=c+1,f=n/l,p=i/c,v=[],g=[],m=[],y=[],_=0;_ 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSNMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition.xyz / vWorldPosition.w;\n\tvec3 v = normalize( cameraPosition - pos );\n\tfloat ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity );\n\tvec3 transmission = transmissionFactor * getIBLVolumeRefraction(\n\t\tnormal, v, roughnessFactor, material.diffuseColor, totalSpecular,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec4 vWorldPosition;\n\tvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) {\n\t\tvec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length(vec3(modelMatrix[0].xyz));\n\t\tmodelScale.y = length(vec3(modelMatrix[1].xyz));\n\t\tmodelScale.z = length(vec3(modelMatrix[2].xyz));\n\t\treturn normalize(refractionVector) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness(float roughness, float ior) {\n\t\treturn roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n\t}\n\tvec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) {\n\t\tfloat framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior);\n\t\treturn texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb;\n\t}\n\tvec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) {\n\t\tif (attenuationDistance == 0.0) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance;\n\t\t\tvec3 transmittance = exp(-attenuationCoefficient * transmissionDistance);\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix);\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0);\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior);\n\t\tvec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance);\n\t\treturn (1.0 - specularColor) * attenuatedColor * baseColor;\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform vec3 attenuationColor;\n\tuniform float attenuationDistance;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#ifdef USE_TRANSMISSION\n\tvarying vec4 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition;\n#endif\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},br={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new B},uv2Transform:{value:new B},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new j(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new B}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new j(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new B}}},xr={basic:{uniforms:tr([br.common,br.specularmap,br.envmap,br.aomap,br.lightmap,br.fog]),vertexShader:_r.meshbasic_vert,fragmentShader:_r.meshbasic_frag},lambert:{uniforms:tr([br.common,br.specularmap,br.envmap,br.aomap,br.lightmap,br.emissivemap,br.fog,br.lights,{emissive:{value:new gt(0)}}]),vertexShader:_r.meshlambert_vert,fragmentShader:_r.meshlambert_frag},phong:{uniforms:tr([br.common,br.specularmap,br.envmap,br.aomap,br.lightmap,br.emissivemap,br.bumpmap,br.normalmap,br.displacementmap,br.fog,br.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:_r.meshphong_vert,fragmentShader:_r.meshphong_frag},standard:{uniforms:tr([br.common,br.envmap,br.aomap,br.lightmap,br.emissivemap,br.bumpmap,br.normalmap,br.displacementmap,br.roughnessmap,br.metalnessmap,br.fog,br.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_r.meshphysical_vert,fragmentShader:_r.meshphysical_frag},toon:{uniforms:tr([br.common,br.aomap,br.lightmap,br.emissivemap,br.bumpmap,br.normalmap,br.displacementmap,br.gradientmap,br.fog,br.lights,{emissive:{value:new gt(0)}}]),vertexShader:_r.meshtoon_vert,fragmentShader:_r.meshtoon_frag},matcap:{uniforms:tr([br.common,br.bumpmap,br.normalmap,br.displacementmap,br.fog,{matcap:{value:null}}]),vertexShader:_r.meshmatcap_vert,fragmentShader:_r.meshmatcap_frag},points:{uniforms:tr([br.points,br.fog]),vertexShader:_r.points_vert,fragmentShader:_r.points_frag},dashed:{uniforms:tr([br.common,br.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_r.linedashed_vert,fragmentShader:_r.linedashed_frag},depth:{uniforms:tr([br.common,br.displacementmap]),vertexShader:_r.depth_vert,fragmentShader:_r.depth_frag},normal:{uniforms:tr([br.common,br.bumpmap,br.normalmap,br.displacementmap,{opacity:{value:1}}]),vertexShader:_r.normal_vert,fragmentShader:_r.normal_frag},sprite:{uniforms:tr([br.sprite,br.fog]),vertexShader:_r.sprite_vert,fragmentShader:_r.sprite_frag},background:{uniforms:{uvTransform:{value:new B},t2D:{value:null}},vertexShader:_r.background_vert,fragmentShader:_r.background_frag},cube:{uniforms:tr([br.envmap,{opacity:{value:1}}]),vertexShader:_r.cube_vert,fragmentShader:_r.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_r.equirect_vert,fragmentShader:_r.equirect_frag},distanceRGBA:{uniforms:tr([br.common,br.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_r.distanceRGBA_vert,fragmentShader:_r.distanceRGBA_frag},shadow:{uniforms:tr([br.lights,br.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:_r.shadow_vert,fragmentShader:_r.shadow_frag}};function wr(e,t,r,n,i){var o,a,s=new gt(0),u=0,l=null,c=0,h=null;function d(e,t){r.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(e),d(s,u=t)},getClearAlpha:function(){return u},setClearAlpha:function(e){d(s,u=e)},render:function(r,i){var f=!1,p=!0===i.isScene?i.background:null;p&&p.isTexture&&(p=t.get(p));var v=e.xr,g=v.getSession&&v.getSession();g&&"additive"===g.environmentBlendMode&&(p=null),null===p?d(s,u):p&&p.isColor&&(d(p,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&(p.isCubeTexture||306===p.mapping)?(void 0===a&&((a=new Zt(new Jt(1,1,1),new nr({name:"BackgroundCubeMaterial",uniforms:er(xr.cube.uniforms),vertexShader:xr.cube.vertexShader,fragmentShader:xr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),a.material.uniforms.envMap.value=p,a.material.uniforms.flipEnvMap.value=p.isCubeTexture&&p._needsFlipEnvMap?-1:1,l===p&&c===p.version&&h===e.toneMapping||(a.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),r.unshift(a,a.geometry,a.material,0,0,null)):p&&p.isTexture&&(void 0===o&&((o=new Zt(new yr(2,2),new nr({name:"BackgroundMaterial",uniforms:er(xr.background.uniforms),vertexShader:xr.background.vertexShader,fragmentShader:xr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),o.material.uniforms.uvTransform.value.copy(p.matrix),l===p&&c===p.version&&h===e.toneMapping||(o.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),r.unshift(o,o.geometry,o.material,0,0,null))}}}function Sr(e,t,r,n){var i=e.getParameter(34921),o=n.isWebGL2?null:t.get("OES_vertex_array_object"),a=n.isWebGL2||null!==o,s={},u=d(null),l=u;function c(t){return n.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return n.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){for(var t=[],r=[],n=[],o=0;o=0){var y=u[h];if(void 0!==y){var _=y.normalized,b=y.itemSize,x=r.get(y);if(void 0===x)continue;var w=x.buffer,S=x.type,T=x.bytesPerElement;if(y.isInterleavedBufferAttribute){var M=y.data,k=M.stride,E=y.offset;M&&M.isInstancedInterleavedBuffer?(v(d,M.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=M.meshPerAttribute*M.count)):p(d),e.bindBuffer(34962,w),m(d,b,S,_,k*T,E*T)}else y.isInstancedBufferAttribute?(v(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):p(d),e.bindBuffer(34962,w),m(d,b,S,_,0,0)}else if("instanceMatrix"===h){var I=r.get(i.instanceMatrix);if(void 0===I)continue;var A=I.buffer,C=I.type;v(d+0,1),v(d+1,1),v(d+2,1),v(d+3,1),e.bindBuffer(34962,A),e.vertexAttribPointer(d+0,4,C,!1,64,0),e.vertexAttribPointer(d+1,4,C,!1,64,16),e.vertexAttribPointer(d+2,4,C,!1,64,32),e.vertexAttribPointer(d+3,4,C,!1,64,48)}else if("instanceColor"===h){var P=r.get(i.instanceColor);if(void 0===P)continue;var N=P.buffer,O=P.type;v(d,1),e.bindBuffer(34962,N),e.vertexAttribPointer(d,3,O,!1,12,0)}else if(void 0!==c){var R=c[h];if(void 0!==R)switch(R.length){case 2:e.vertexAttrib2fv(d,R);break;case 3:e.vertexAttrib3fv(d,R);break;case 4:e.vertexAttrib4fv(d,R);break;default:e.vertexAttrib1fv(d,R)}}}}g()}}(i,u,h,y),null!==_&&e.bindBuffer(34963,r.get(_).buffer))},reset:y,resetDefaultState:_,dispose:function(){for(var e in y(),s){var t=s[e];for(var r in t){var n=t[r];for(var i in n)h(n[i].object),delete n[i];delete t[r]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var r in t){var n=t[r];for(var i in n)h(n[i].object),delete n[i];delete t[r]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var r=s[t];if(void 0!==r[e.id]){var n=r[e.id];for(var i in n)h(n[i].object),delete n[i];delete r[e.id]}}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:g}}function Tr(e,t,r,n){var i,o=n.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,n){e.drawArrays(i,t,n),r.update(n,i,1)},this.renderInstances=function(n,a,s){if(0!==s){var u,l;if(o)u=e,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](i,n,a,s),r.update(a,i,s)}}}function Mr(e,t,r){var n;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==r.precision?r.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=o||t.has("WEBGL_draw_buffers"),l=!0===r.logarithmicDepthBuffer,c=e.getParameter(34930),h=e.getParameter(35660),d=e.getParameter(3379),f=e.getParameter(34076),p=e.getParameter(34921),v=e.getParameter(36347),g=e.getParameter(36348),m=e.getParameter(36349),y=h>0,_=o||t.has("OES_texture_float");return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){var r=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:y&&_,maxSamples:o?e.getParameter(36183):0}}function kr(e){var t=this,r=null,n=0,i=!1,o=!1,a=new dr,s=new B,u={value:null,needsUpdate:!1};function l(){u.value!==r&&(u.value=r,u.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function c(e,r,n,i){var o=null!==e?e.length:0,l=null;if(0!==o){if(l=u.value,!0!==i||null===l){var c=n+4*o,h=r.matrixWorldInverse;s.getNormalMatrix(h),(null===l||l.length0){var s=e.getRenderTarget(),u=new ur(a.height/2);return u.fromEquirectangularTexture(e,i),t.set(i,u),e.setRenderTarget(s),i.addEventListener("dispose",n),r(u.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function Ir(e){var t={};function r(r){if(void 0!==t[r])return t[r];var n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float")},get:function(e){var t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Ar(e,t,r,n){var i={},o=new WeakMap;function a(e){var s=e.target;for(var u in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[u]);s.removeEventListener("dispose",a),delete i[s.id];var l=o.get(s);l&&(t.remove(l),o.delete(s)),n.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,r.memory.geometries--}function s(e){var r=[],n=e.index,i=e.attributes.position,a=0;if(null!==n){var s=n.array;a=n.version;for(var u=0,l=s.length;u65535?St:xt)(r,1);_.version=a;var b=o.get(e);b&&t.remove(b),o.set(e,_)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,r.memory.geometries++),t},update:function(e){var r=e.attributes;for(var n in r)t.update(r[n],34962);var i=e.morphAttributes;for(var o in i)for(var a=i[o],s=0,u=a.length;s0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),(e=t.call(this,null)).image={data:n,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return r}(W);Lr.prototype.isDataTexture2DArray=!0;var jr=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),(e=t.call(this,null)).image={data:n,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return r}(W);jr.prototype.isDataTexture3D=!0;var zr=new W,Br=new Lr,Fr=new jr,Ur=new sr,Wr=[],Gr=[],Vr=new Float32Array(16),Hr=new Float32Array(9),Yr=new Float32Array(4);function $r(e,t,r){var n=e[0];if(n<=0||n>0)return e;var i=t*r,o=Wr[i];if(void 0===o&&(o=new Float32Array(i),Wr[i]=o),0!==t){n.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=r,e[a].toArray(o,s)}return o}function Xr(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;r/gm;function Kn(e){return e.replace(Zn,Jn)}function Jn(e,t){var r=_r[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return Kn(r)}var ei=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ti=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ri(e){return e.replace(ti,ii).replace(ei,ni)}function ni(e,t,r,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ii(e,t,r,n)}function ii(e,t,r,n){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,v=r.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission>0)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Xn).join("\n")}(r),g=function(e){var t=[];for(var r in e){var n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(s),m=a.createProgram(),y=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?((i=[g].filter(Xn).join("\n")).length>0&&(i+="\n"),(o=[v,g].filter(Xn).join("\n")).length>0&&(o+="\n")):(i=[oi(r),"#define SHADER_NAME "+r.shaderName,g,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+d:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Xn).join("\n"),o=[v,oi(r),"#define SHADER_NAME "+r.shaderName,g,r.alphaTest?"#define ALPHATEST "+r.alphaTest+(r.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.envMap?"#define "+d:"",r.envMap?"#define "+f:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.sheen?"#define USE_SHEEN":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==r.toneMapping?"#define TONE_MAPPING":"",0!==r.toneMapping?_r.tonemapping_pars_fragment:"",0!==r.toneMapping?$n("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",_r.encodings_pars_fragment,r.map?Hn("mapTexelToLinear",r.mapEncoding):"",r.matcap?Hn("matcapTexelToLinear",r.matcapEncoding):"",r.envMap?Hn("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMap?Hn("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.lightMap?Hn("lightMapTexelToLinear",r.lightMapEncoding):"",Yn("linearToOutputTexel",r.outputEncoding),r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Xn).join("\n")),u=Qn(u=qn(u=Kn(u),r),r),l=Qn(l=qn(l=Kn(l),r),r),u=ri(u),l=ri(l),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(y="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in","300 es"===r.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===r.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var _,b,x=y+o+l,w=Un(a,35633,y+i+u),S=Un(a,35632,x);if(a.attachShader(m,w),a.attachShader(m,S),void 0!==r.index0AttributeName?a.bindAttribLocation(m,0,r.index0AttributeName):!0===r.morphTargets&&a.bindAttribLocation(m,0,"position"),a.linkProgram(m),e.debug.checkShaderErrors){var T=a.getProgramInfoLog(m).trim(),M=a.getShaderInfoLog(w).trim(),k=a.getShaderInfoLog(S).trim(),E=!0,I=!0;if(!1===a.getProgramParameter(m,35714)){E=!1;var A=Vn(a,w,"vertex"),C=Vn(a,S,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,A,C)}else""!==T?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):""!==M&&""!==k||(I=!1);I&&(this.diagnostics={runnable:E,programLog:T,vertexShader:{log:M,prefix:i},fragmentShader:{log:k,prefix:o}})}return a.deleteShader(w),a.deleteShader(S),this.getUniforms=function(){return void 0===_&&(_=new Fn(a,m)),_},this.getAttributes=function(){return void 0===b&&(b=function(e,t){for(var r={},n=e.getProgramParameter(t,35721),i=0;i0,maxBones:T,useVertexTexture:l,morphTargets:i.morphTargets,morphNormals:i.morphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||r.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)r.push(n),r.push(t.defines[n]);if(!1===t.isRawShaderMaterial){for(var i=0;i0?i.push(c):!0===r.transparent?o.push(c):n.push(c)},unshift:function(e,t,r,a,u,l){var c=s(e,t,r,a,u,l);r.transmission>0?i.unshift(c):!0===r.transparent?o.unshift(c):n.unshift(c)},finish:function(){for(var e=r,n=t.length;e1&&n.sort(e||li),i.length>1&&i.sort(t||ci),o.length>1&&o.sort(t||ci)}}}function di(e){var t=new WeakMap;return{get:function(r,n){var i;return!1===t.has(r)?(i=new hi(e),t.set(r,[i])):n>=t.get(r).length?(i=new hi(e),t.get(r).push(i)):i=t.get(r)[n],i},dispose:function(){t=new WeakMap}}}function fi(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":r={direction:new X,color:new gt};break;case"SpotLight":r={position:new X,direction:new X,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new X,color:new gt,distance:0,decay:0};break;case"HemisphereLight":r={direction:new X,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":r={color:new gt,position:new X,halfWidth:new X,halfHeight:new X}}return e[t.id]=r,r}}}var pi=0;function vi(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function gi(e,t){for(var r=new fi,n=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)i.probe.push(new X);var a=new X,s=new Me,u=new Me;return{setup:function(o){for(var a=0,s=0,u=0,l=0;l<9;l++)i.probe[l].set(0,0,0);var c=0,h=0,d=0,f=0,p=0,v=0,g=0,m=0;o.sort(vi);for(var y=0,_=o.length;y<_;y++){var b=o[y],x=b.color,w=b.intensity,S=b.distance,T=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)a+=x.r*w,s+=x.g*w,u+=x.b*w;else if(b.isLightProbe)for(var M=0;M<9;M++)i.probe[M].addScaledVector(b.sh.coefficients[M],w);else if(b.isDirectionalLight){var k=r.get(b);if(k.color.copy(b.color).multiplyScalar(b.intensity),b.castShadow){var E=b.shadow,I=n.get(b);I.shadowBias=E.bias,I.shadowNormalBias=E.normalBias,I.shadowRadius=E.radius,I.shadowMapSize=E.mapSize,i.directionalShadow[c]=I,i.directionalShadowMap[c]=T,i.directionalShadowMatrix[c]=b.shadow.matrix,v++}i.directional[c]=k,c++}else if(b.isSpotLight){var A=r.get(b);if(A.position.setFromMatrixPosition(b.matrixWorld),A.color.copy(x).multiplyScalar(w),A.distance=S,A.coneCos=Math.cos(b.angle),A.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),A.decay=b.decay,b.castShadow){var C=b.shadow,P=n.get(b);P.shadowBias=C.bias,P.shadowNormalBias=C.normalBias,P.shadowRadius=C.radius,P.shadowMapSize=C.mapSize,i.spotShadow[d]=P,i.spotShadowMap[d]=T,i.spotShadowMatrix[d]=b.shadow.matrix,m++}i.spot[d]=A,d++}else if(b.isRectAreaLight){var N=r.get(b);N.color.copy(x).multiplyScalar(w),N.halfWidth.set(.5*b.width,0,0),N.halfHeight.set(0,.5*b.height,0),i.rectArea[f]=N,f++}else if(b.isPointLight){var O=r.get(b);if(O.color.copy(b.color).multiplyScalar(b.intensity),O.distance=b.distance,O.decay=b.decay,b.castShadow){var R=b.shadow,D=n.get(b);D.shadowBias=R.bias,D.shadowNormalBias=R.normalBias,D.shadowRadius=R.radius,D.shadowMapSize=R.mapSize,D.shadowCameraNear=R.camera.near,D.shadowCameraFar=R.camera.far,i.pointShadow[h]=D,i.pointShadowMap[h]=T,i.pointShadowMatrix[h]=b.shadow.matrix,g++}i.point[h]=O,h++}else if(b.isHemisphereLight){var L=r.get(b);L.skyColor.copy(b.color).multiplyScalar(w),L.groundColor.copy(b.groundColor).multiplyScalar(w),i.hemi[p]=L,p++}}f>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=br.LTC_FLOAT_1,i.rectAreaLTC2=br.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=br.LTC_HALF_1,i.rectAreaLTC2=br.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=u;var j=i.hash;j.directionalLength===c&&j.pointLength===h&&j.spotLength===d&&j.rectAreaLength===f&&j.hemiLength===p&&j.numDirectionalShadows===v&&j.numPointShadows===g&&j.numSpotShadows===m||(i.directional.length=c,i.spot.length=d,i.rectArea.length=f,i.point.length=h,i.hemi.length=p,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=m,i.spotShadowMap.length=m,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=g,i.spotShadowMatrix.length=m,j.directionalLength=c,j.pointLength=h,j.spotLength=d,j.rectAreaLength=f,j.hemiLength=p,j.numDirectionalShadows=v,j.numPointShadows=g,j.numSpotShadows=m,i.version=pi++)},setupView:function(e,t){for(var r=0,n=0,o=0,l=0,c=0,h=t.matrixWorldInverse,d=0,f=e.length;d1&&void 0!==arguments[1]?arguments[1]:0;return!1===r.has(n)?(i=new mi(e,t),r.set(n,[i])):o>=r.get(n).length?(i=new mi(e,t),r.get(n).push(i)):i=r.get(n)[o],i},dispose:function(){r=new WeakMap}}}var _i=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="MeshDepthMaterial",n.depthPacking=3200,n.morphTargets=!1,n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.wireframe=!1,n.wireframeLinewidth=1,n.fog=!1,n.setValues(e),n}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.depthPacking=e.depthPacking,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}]),r}(lt);_i.prototype.isMeshDepthMaterial=!0;var bi=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="MeshDistanceMaterial",n.referencePosition=new X,n.nearDistance=1,n.farDistance=1e3,n.morphTargets=!1,n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.fog=!1,n.setValues(e),n}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}]),r}(lt);function xi(e,t,r){var n=new vr,i=new j,o=new j,a=new V,s=[],u=[],l={},c=r.maxTextureSize,h={0:1,1:0,2:2},d=new nr({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new j},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;var p=new Ot;p.setAttribute("position",new bt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var v=new Zt(p,d),g=this;function m(r,n){var i=t.update(v);d.uniforms.shadow_pass.value=r.map.texture,d.uniforms.resolution.value=r.mapSize,d.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,i,d,v,null),f.uniforms.shadow_pass.value=r.mapPass.texture,f.uniforms.resolution.value=r.mapSize,f.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,i,f,v,null)}function y(e){var t=e<<0,r=s[t];return void 0===r&&(r=new _i({depthPacking:3201,morphTargets:e}),s[t]=r),r}function _(e){var t=e<<0,r=u[t];return void 0===r&&(r=new bi({morphTargets:e}),u[t]=r),r}function b(t,r,n,i,o,a,s){var u=null,c=y,d=t.customDepthMaterial;if(!0===i.isPointLight&&(c=_,d=t.customDistanceMaterial),void 0===d){var f=!1;!0===n.morphTargets&&(f=r.morphAttributes&&r.morphAttributes.position&&r.morphAttributes.position.length>0),u=c(f)}else u=d;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var p=u.uuid,v=n.uuid,g=l[p];void 0===g&&(g={},l[p]=g);var m=g[v];void 0===m&&(m=u.clone(),g[v]=m),u=m}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=3===s?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function x(r,i,o,a,s){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===s)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,r.matrixWorld);var u=t.update(r),l=r.material;if(Array.isArray(l))for(var c=u.groups,h=0,d=c.length;hc||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/_.x),i.x=o.x*_.x,y.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/_.y),i.y=o.y*_.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};y.map=new H(i.x,i.y,b),y.map.texture.name=v.name+".shadowMap",y.mapPass=new H(i.x,i.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){y.map=new H(i.x,i.y,{minFilter:1003,magFilter:1003,format:1023}),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var w=y.getViewportCount(),S=0;S=1):-1!==I.indexOf("OpenGL ES")&&(E=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),k=E>=2);var A=null,C={},P=e.getParameter(3088),N=e.getParameter(2978),O=(new V).fromArray(P),R=(new V).fromArray(N);function D(t,r,n){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;an||e.height>n)&&(i=n/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?L:Math.floor,a=o(i*e.width),u=o(i*e.height);void 0===s&&(s=v(a,u));var l=r?v(a,u):s;return l.width=a,l.height=u,l.getContext("2d").drawImage(e,0,0,a,u),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+u+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function m(e){return R(e.width)&&R(e.height)}function y(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function _(t,r,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;e.generateMipmap(t),n.get(r).__maxMipLevel=Math.log2(Math.max(i,o,a))}function b(r,n,i){if(!1===u)return n;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}var o=n;return 6403===n&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===n&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===n&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function x(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){var r,i,o=t.target;o.removeEventListener("dispose",w),r=o,void 0!==(i=n.get(r)).__webglInit&&(e.deleteTexture(i.__webglTexture),n.remove(r)),o.isVideoTexture&&f.delete(o),a.memory.textures--}function S(t){var r=t.target;r.removeEventListener("dispose",S),function(t){var r=t.texture,i=n.get(t),o=n.get(r);if(t){if(void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),a.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var s=0;s<6;s++)e.deleteFramebuffer(i.__webglFramebuffer[s]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[s]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(var u=0,l=r.length;u0&&s.__version!==e.version){var u=e.image;if(void 0===u)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==u.complete)return void P(s,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(33984+t),r.bindTexture(3553,s.__webglTexture)}function k(t,i){var a=n.get(t);t.version>0&&a.__version!==t.version?function(t,n,i){if(6===n.image.length){C(t,n),r.activeTexture(33984+i),r.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);for(var a=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),s=n.image[0]&&n.image[0].isDataTexture,l=[],h=0;h<6;h++)l[h]=a||s?s?n.image[h].image:n.image[h]:g(n.image[h],!1,!0,c);var d,f=l[0],p=m(f)||u,v=o.convert(n.format),x=o.convert(n.type),w=b(n.internalFormat,v,x);if(A(34067,n,p),a){for(var S=0;S<6;S++){d=l[S].mipmaps;for(var T=0;T1||n.get(o).__currentAnisotropy)&&(e.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function C(t,r){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),a.memory.textures++)}function P(t,n,i){var a=3553;n.isDataTexture2DArray&&(a=35866),n.isDataTexture3D&&(a=32879),C(t,n),r.activeTexture(33984+i),r.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);var s,l=function(e){return!u&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(n)&&!1===m(n.image),c=g(n.image,l,!1,h),d=m(c)||u,f=o.convert(n.format),p=o.convert(n.type),v=b(n.internalFormat,f,p);A(a,n,d);var x=n.mipmaps;if(n.isDepthTexture)v=6402,u?v=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===v&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,p=o.convert(n.type)),1027===n.format&&6402===v&&(v=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,p=o.convert(n.type))),r.texImage2D(3553,0,v,c.width,c.height,0,f,p,null);else if(n.isDataTexture)if(x.length>0&&d){for(var w=0,S=x.length;w0&&d){for(var k=0,E=x.length;k=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=M,this.setTexture2DArray=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?P(i,e,t):(r.activeTexture(33984+t),r.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?P(i,e,t):(r.activeTexture(33984+t),r.bindTexture(32879,i.__webglTexture))},this.setTextureCube=k,this.setupRenderTarget=function(t){var s=t.texture,l=n.get(t),c=n.get(s);t.addEventListener("dispose",S),!0!==t.isWebGLMultipleRenderTargets&&(c.__webglTexture=e.createTexture(),c.__version=s.version,a.memory.textures++);var h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,f=!0===t.isWebGLMultisampleRenderTarget,p=s.isDataTexture3D||s.isDataTexture2DArray,v=m(t)||u;if(!u||1022!==s.format||1015!==s.type&&1016!==s.type||(s.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){l.__webglFramebuffer=[];for(var g=0;g<6;g++)l.__webglFramebuffer[g]=e.createFramebuffer()}else if(l.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers)for(var x=t.texture,w=0,T=x.length;w0&&void 0!==arguments[0]?arguments[0]:[];return x(this,r),(e=t.call(this)).cameras=n,e}return r}(or);Mi.prototype.isArrayCamera=!0;var ki=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="Group",e}return r}(Qe);ki.prototype.isGroup=!0;var Ei={type:"move"},Ii=function(){function e(){x(this,e),this._targetRay=null,this._grip=null,this._hand=null}return S(e,[{key:"getHandSpace",value:function(){return null===this._hand&&(this._hand=new ki,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}},{key:"getTargetRaySpace",value:function(){return null===this._targetRay&&(this._targetRay=new ki,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}},{key:"getGripSpace",value:function(){return null===this._grip&&(this._grip=new ki,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X),this._grip}},{key:"dispatchEvent",value:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}},{key:"disconnect",value:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}},{key:"update",value:function(e,t,r){var n=null,i=null,o=null,a=this._targetRay,s=this._grip,u=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==a&&(null!==(n=t.getPose(e.targetRaySpace,r))&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ei))),u&&e.hand){o=!0;var l,c=M(e.hand.values());try{for(c.s();!(l=c.n()).done;){var h=l.value,d=t.getJointPose(h,r);if(void 0===u.joints[h.jointName]){var f=new ki;f.matrixAutoUpdate=!1,f.visible=!1,u.joints[h.jointName]=f,u.add(f)}var p=u.joints[h.jointName];null!==d&&(p.matrix.fromArray(d.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=d.radius),p.visible=null!==d}}catch(e){c.e(e)}finally{c.f()}var v=u.joints["index-finger-tip"],g=u.joints["thumb-tip"],m=v.position.distanceTo(g.position);u.inputState.pinching&&m>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&m<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(null!==(i=t.getPose(e.gripSpace,r))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==n),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==o),this}}]),e}(),Ai=function(e){p(r,e);var t=g(r);function r(e,n){var i;x(this,r);var o=y(i=t.call(this)),a=e.state,s=null,u=1,c=null,h="local-floor",d=null,f=null,p=null,v=null,g=[],m=new Map,_=new or;_.layers.enable(1),_.viewport=new V;var b=new or;b.layers.enable(2),b.viewport=new V;var w=[_,b],S=new Mi;S.layers.enable(1),S.layers.enable(2);var T=null,M=null;function k(e){var t=m.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function E(){m.forEach((function(e,t){e.disconnect(t)})),m.clear(),T=null,M=null,a.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),O.stop(),o.isPresenting=!1,o.dispatchEvent({type:"sessionend"})}function I(e){for(var t=s.inputSources,r=0;r0&&(e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)}(e,n,a):r(e,n)):n.isMeshMatcapMaterial?(t(e,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDepthMaterial?(t(e,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDistanceMaterial?(t(e,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,n)):n.isMeshNormalMaterial?(t(e,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,n)):n.isPointsMaterial?function(e,t,r,n){var i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*n,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,n,i,o):n.isSpriteMaterial?function(e,t){var r;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(e,n):n.isShadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Pi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=void 0!==e.canvas?e.canvas:function(){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),r=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,u=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,d=null,f=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;var v=this,g=!1,m=0,y=0,_=null,b=-1,x=null,w=new V,S=new V,T=null,M=t.width,k=t.height,E=1,I=null,A=null,C=new V(0,0,M,k),P=new V(0,0,M,k),N=!1,O=[],R=new vr,D=!1,L=!1,j=null,z=new Me,B=new X,F={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function U(){return null===_?E:1}var W,G,$,q,Q,Z,K,J,ee,te,re,ne,ie,oe,ae,se,ue,le,ce,he,de,fe,pe=r;function ve(e,r){for(var n=0;n0&&Ie(n,e,t),i.length>0&&function(e,t,r,n){if(null===j){var i=!0===a&&!0===G.isWebGL2;j=new(i?Y:H)(1024,1024,{generateMipmaps:!0,type:null!==de.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}var o=v.getRenderTarget();v.setRenderTarget(j),v.clear();var s=v.toneMapping;v.toneMapping=0,Ie(e,r,n),v.toneMapping=s,Z.updateMultisampleRenderTarget(j),Z.updateRenderTargetMipmap(j),v.setRenderTarget(o),Ie(t,r,n)}(n,i,e,t),o.length>0&&Ie(o,e,t),null!==_&&(Z.updateMultisampleRenderTarget(_),Z.updateRenderTargetMipmap(_)),!0===e.isScene&&e.onAfterRender(v,e,t),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1),fe.resetDefaultState(),b=-1,x=null,p.pop(),d=p.length>0?p[p.length-1]:null,f.pop(),h=f.length>0?f[f.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return m},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return _},this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;_=e,m=t,y=r,e&&void 0===Q.get(e).__webglFramebuffer&&Z.setupRenderTarget(e);var n=null,i=!1,o=!1;if(e){var a=e.texture;(a.isDataTexture3D||a.isDataTexture2DArray)&&(o=!0);var s=Q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(n=s[t],i=!0):n=e.isWebGLMultisampleRenderTarget?Q.get(e).__webglMultisampledFramebuffer:s,w.copy(e.viewport),S.copy(e.scissor),T=e.scissorTest}else w.copy(C).multiplyScalar(E).floor(),S.copy(P).multiplyScalar(E).floor(),T=N;if($.bindFramebuffer(36160,n)&&G.drawBuffers){var u=!1;if(e)if(e.isWebGLMultipleRenderTargets){var l=e.texture;if(O.length!==l.length||36064!==O[0]){for(var c=0,h=l.length;c=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&pe.readPixels(t,r,n,i,de.convert(l),de.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{var d=null!==_?Q.get(_).__webglFramebuffer:null;$.bindFramebuffer(36160,d)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Math.pow(2,-r),i=Math.floor(t.image.width*n),o=Math.floor(t.image.height*n),a=de.convert(t.format);G.isWebGL2&&(6407===a&&(a=32849),6408===a&&(a=32856)),Z.setTexture2D(t,0),pe.copyTexImage2D(3553,r,a,e.x,e.y,i,o,0),$.unbindTexture()},this.copyTextureToTexture=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.image.width,o=t.image.height,a=de.convert(r.format),s=de.convert(r.type);Z.setTexture2D(r,0),pe.pixelStorei(37440,r.flipY),pe.pixelStorei(37441,r.premultiplyAlpha),pe.pixelStorei(3317,r.unpackAlignment),t.isDataTexture?pe.texSubImage2D(3553,n,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?pe.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):pe.texSubImage2D(3553,n,e.x,e.y,a,s,t.image),0===n&&r.generateMipmaps&&pe.generateMipmap(3553),$.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(v.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var o,a=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,u=e.max.z-e.min.z+1,l=de.convert(n.format),c=de.convert(n.type);if(n.isDataTexture3D)Z.setTexture3D(n,0),o=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Z.setTexture2DArray(n,0),o=35866}pe.pixelStorei(37440,n.flipY),pe.pixelStorei(37441,n.premultiplyAlpha),pe.pixelStorei(3317,n.unpackAlignment);var h=pe.getParameter(3314),d=pe.getParameter(32878),f=pe.getParameter(3316),p=pe.getParameter(3315),g=pe.getParameter(32877),m=r.isCompressedTexture?r.mipmaps[0]:r.image;pe.pixelStorei(3314,m.width),pe.pixelStorei(32878,m.height),pe.pixelStorei(3316,e.min.x),pe.pixelStorei(3315,e.min.y),pe.pixelStorei(32877,e.min.z),r.isDataTexture||r.isDataTexture3D?pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,m.data):r.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),pe.compressedTexSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,m.data)):pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,m),pe.pixelStorei(3314,h),pe.pixelStorei(32878,d),pe.pixelStorei(3316,f),pe.pixelStorei(3315,p),pe.pixelStorei(32877,g),0===i&&n.generateMipmaps&&pe.generateMipmap(o),$.unbindTexture()}},this.initTexture=function(e){Z.setTexture2D(e,0),$.unbindTexture()},this.resetState=function(){m=0,y=0,_=null,$.reset(),fe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r})(Pi).prototype.isWebGL1Renderer=!0;var Ni=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:y(e)})),e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),r}(Qe);Ni.prototype.isScene=!0;var Oi=function(){function e(t,r){x(this,e),this.array=t,this.stride=r,this.count=void 0!==t?t.length/r:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=P()}return S(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,r){e*=this.stride,r*=t.stride;for(var n=0,i=this.stride;n1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"clone",value:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"toJSON",value:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();Oi.prototype.isInterleavedBuffer=!0;var Ri=new X,Di=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];x(this,e),this.name="",this.data=t,this.itemSize=r,this.offset=n,this.normalized=!0===i}return S(e,[{key:"applyMatrix4",value:function(e){for(var t=0,r=this.data.count;te.far||t.push({distance:s,point:zi.clone(),uv:st.getUV(zi,Vi,Hi,Yi,$i,Xi,qi,new j),face:null,object:this})}}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}]),r}(Qe);function Zi(e,t,r,n,i,o){Ui.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(Wi.x=o*Ui.x-i*Ui.y,Wi.y=i*Ui.x+o*Ui.y):Wi.copy(Ui),e.copy(t),e.x+=Wi.x,e.y+=Wi.y,e.applyMatrix4(Gi)}Qi.prototype.isSprite=!0;var Ki=new X,Ji=new V,eo=new V,to=new X,ro=new Me,no=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="SkinnedMesh",i.bindMode="attached",i.bindMatrix=new Me,i.bindMatrixInverse=new Me,i}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}},{key:"bind",value:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}},{key:"pose",value:function(){this.skeleton.pose()}},{key:"normalizeSkinWeights",value:function(){for(var e=new V,t=this.geometry.attributes.skinWeight,r=0,n=t.count;r0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1003,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1003,f=arguments.length>10?arguments[10]:void 0,p=arguments.length>11?arguments[11]:void 0;return x(this,r),(e=t.call(this,null,u,l,c,h,d,a,s,f,p)).image={data:n,width:i,height:o},e.magFilter=h,e.minFilter=d,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return r}(W);io.prototype.isDataTexture=!0;var oo=new Me,ao=new Me,so=[],uo=new Zt,lo=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n)).instanceMatrix=new bt(new Float32Array(16*i),16),o.instanceColor=null,o.count=i,o.frustumCulled=!1,o}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}},{key:"getColorAt",value:function(e,t){t.fromArray(this.instanceColor.array,3*e)}},{key:"getMatrixAt",value:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)}},{key:"raycast",value:function(e,t){var r=this.matrixWorld,n=this.count;if(uo.geometry=this.geometry,uo.material=this.material,void 0!==uo.material)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Ot,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new co;return x(this,r),(e=t.call(this)).type="Line",e.geometry=n,e.material=i,e.updateMorphTargets(),e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,r=[0],n=1,i=t.count;ns)){h.applyMatrix4(this.matrixWorld);var _=e.ray.origin.distanceTo(h);_e.far||t.push({distance:_,point:c.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var b=Math.max(0,o.start),x=Math.min(p.count,o.start+o.count)-1;bs)){h.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(h);we.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,r=Object.keys(t);if(r.length>0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=n.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),r}(Qe);mo.prototype.isLine=!0;var yo=new X,_o=new X,bo=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="LineSegments",i}return S(r,[{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,r=[],n=0,i=t.count;n0&&void 0!==arguments[0]?arguments[0]:new Ot,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wo;return x(this,r),(e=t.call(this)).type="Points",e.geometry=n,e.material=i,e.updateMorphTargets(),e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"raycast",value:function(e,t){var r=this.geometry,n=this.matrixWorld,i=e.params.Points.threshold,o=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),Mo.copy(r.boundingSphere),Mo.applyMatrix4(n),Mo.radius+=i,!1!==e.ray.intersectsSphere(Mo)){So.copy(n).invert(),To.copy(e.ray).applyMatrix4(So);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a;if(r.isBufferGeometry){var u=r.index,l=r.attributes.position;if(null!==u)for(var c=Math.max(0,o.start),h=Math.min(u.count,o.start+o.count);c0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=n.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),r}(Qe);function Io(e,t,r,n,i,o,a){var s=To.distanceSqToPoint(e);if(si.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:a})}}Eo.prototype.isPoints=!0,function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c){var h;x(this,r),(h=t.call(this,e,n,i,o,a,s,u,l,c)).format=void 0!==u?u:1022,h.minFilter=void 0!==s?s:1006,h.magFilter=void 0!==a?a:1006,h.generateMipmaps=!1;var d=y(h);return"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){d.needsUpdate=!0,e.requestVideoFrameCallback(t)})),h}return S(r,[{key:"clone",value:function(){return new this.constructor(this.image).copy(this)}},{key:"update",value:function(){var e=this.image;"requestVideoFrameCallback"in e==!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}]),r}(W).prototype.isVideoTexture=!0;var Ao=function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c,h,d,f){var p;return x(this,r),(p=t.call(this,null,s,u,l,c,h,o,a,d,f)).image={width:n,height:i},p.mipmaps=e,p.flipY=!1,p.generateMipmaps=!1,p}return r}(W);Ao.prototype.isCompressedTexture=!0,function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c){var h;return x(this,r),(h=t.call(this,e,n,i,o,a,s,u,l,c)).needsUpdate=!0,h}return r}(W).prototype.isCanvasTexture=!0,function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c,h){var d;if(x(this,r),1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),(d=t.call(this,null,o,a,s,u,l,h,i,c)).image={width:e,height:n},d.magFilter=void 0!==u?u:1003,d.minFilter=void 0!==l?l:1003,d.flipY=!1,d.generateMipmaps=!1,d}return r}(W).prototype.isDepthTexture=!0,new X,new X,new X,new st;var Co=function(){function e(){x(this,e),this.type="Curve",this.arcLengthDivisions=200}return S(e,[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var r=this.getUtoTmapping(e);return this.getPoint(r,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,r=[],n=this.getPoint(0),i=0;r.push(0);for(var o=1;o<=e;o++)i+=(t=this.getPoint(o/e)).distanceTo(n),r.push(i),n=t;return this.cacheArcLengths=r,r}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var r,n=this.getLengths(),i=0,o=n.length;r=t||e*n[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=n[i=Math.floor(s+(u-s)/2)]-r)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(n[i=u]===r)return i/(o-1);var l=n[i];return(i+(r-l)/(n[i+1]-l))/(o-1)}},{key:"getTangent",value:function(e,t){var r=e-1e-4,n=e+1e-4;r<0&&(r=0),n>1&&(n=1);var i=this.getPoint(r),o=this.getPoint(n),a=t||(i.isVector2?new j:new X);return a.copy(o).sub(i).normalize(),a}},{key:"getTangentAt",value:function(e,t){var r=this.getUtoTmapping(e);return this.getTangent(r,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var r=new X,n=[],i=[],o=[],a=new X,s=new Me,u=0;u<=e;u++){var l=u/e;n[u]=this.getTangentAt(l,new X),n[u].normalize()}i[0]=new X,o[0]=new X;var c=Number.MAX_VALUE,h=Math.abs(n[0].x),d=Math.abs(n[0].y),f=Math.abs(n[0].z);h<=c&&(c=h,r.set(1,0,0)),d<=c&&(c=d,r.set(0,1,0)),f<=c&&r.set(0,0,1),a.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],a),o[0].crossVectors(n[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(n[p-1],n[p]),a.length()>Number.EPSILON){a.normalize();var v=Math.acos(N(n[p-1].dot(n[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(a,v))}o[p].crossVectors(n[p],i[p])}if(!0===t){var g=Math.acos(N(i[0].dot(i[e]),-1,1));g/=e,n[0].dot(a.crossVectors(i[0],i[e]))>0&&(g=-g);for(var m=1;m<=e;m++)i[m].applyMatrix4(s.makeRotationAxis(n[m],g*m)),o[m].crossVectors(n[m],i[m])}return{tangents:n,normals:i,binormals:o}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}]),e}(),Po=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return x(this,r),(e=t.call(this)).type="EllipseCurve",e.aX=n,e.aY=i,e.xRadius=o,e.yRadius=a,e.aStartAngle=s,e.aEndAngle=u,e.aClockwise=l,e.aRotation=c,e}return S(r,[{key:"getPoint",value:function(e,t){for(var r=t||new j,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)n;)i-=n;i0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return x(this,r),(e=t.call(this)).type="CatmullRomCurve3",e.points=n,e.closed=i,e.curveType=o,e.tension=a,e}return S(r,[{key:"getPoint",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,i=n,o=this.points,a=o.length,s=(a-(this.closed?0:1))*e,u=Math.floor(s),l=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/a)+1)*a:0===l&&u===a-1&&(u=a-2,l=1),this.closed||u>0?t=o[(u-1)%a]:(Ro.subVectors(o[0],o[1]).add(o[0]),t=Ro);var c=o[u%a],h=o[(u+1)%a];if(this.closed||u+20&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new j;return x(this,r),(e=t.call(this)).type="CubicBezierCurve",e.v0=n,e.v1=i,e.v2=o,e.v3=a,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t,n=this.v0,i=this.v1,o=this.v2,a=this.v3;return r.set(Uo(e,n.x,i.x,o.x,a.x),Uo(e,n.y,i.y,o.y,a.y)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),r}(Co);Wo.prototype.isCubicBezierCurve=!0;var Go=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new X,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new X;return x(this,r),(e=t.call(this)).type="CubicBezierCurve3",e.v0=n,e.v1=i,e.v2=o,e.v3=a,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,r=t,n=this.v0,i=this.v1,o=this.v2,a=this.v3;return r.set(Uo(e,n.x,i.x,o.x,a.x),Uo(e,n.y,i.y,o.y,a.y),Uo(e,n.z,i.z,o.z,a.z)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),r}(Co);Go.prototype.isCubicBezierCurve3=!0;var Vo=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j;return x(this,r),(e=t.call(this)).type="LineCurve",e.v1=n,e.v2=i,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e,t){var r=t||new j;return r.copy(this.v2).sub(this.v1).normalize(),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co);Vo.prototype.isLineCurve=!0;var Ho=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j;return x(this,r),(e=t.call(this)).type="QuadraticBezierCurve",e.v0=n,e.v1=i,e.v2=o,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t,n=this.v0,i=this.v1,o=this.v2;return r.set(Fo(e,n.x,i.x,o.x),Fo(e,n.y,i.y,o.y)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co);Ho.prototype.isQuadraticBezierCurve=!0;var Yo=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new X;return x(this,r),(e=t.call(this)).type="QuadraticBezierCurve3",e.v0=n,e.v1=i,e.v2=o,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,r=t,n=this.v0,i=this.v1,o=this.v2;return r.set(Fo(e,n.x,i.x,o.x),Fo(e,n.y,i.y,o.y),Fo(e,n.z,i.z,o.z)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co);Yo.prototype.isQuadraticBezierCurve3=!0;var $o=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return x(this,r),(e=t.call(this)).type="SplineCurve",e.points=n,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t,n=this.points,i=(n.length-1)*e,o=Math.floor(i),a=i-o,s=n[0===o?o:o-1],u=n[o],l=n[o>n.length-2?n.length-1:o+1],c=n[o>n.length-3?n.length-1:o+2];return r.set(Bo(a,s.x,u.x,l.x,c.x),Bo(a,s.y,u.y,l.y,c.y)),r}},{key:"copy",value:function(e){f(b(r.prototype),"copy",this).call(this,e),this.points=[];for(var t=0,n=e.points.length;t0&&void 0!==arguments[0]?arguments[0]:new X,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X;return x(this,r),(e=t.call(this)).type="LineCurve3",e.isLineCurve3=!0,e.v1=n,e.v2=i,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co),QuadraticBezierCurve:Ho,QuadraticBezierCurve3:Yo,SplineCurve:$o});function qo(e,t,r,n,i){var o,a;if(i===function(e,t,r,n){for(var i=0,o=t,a=r-n;o0)for(o=t;o=t;o-=n)a=ga(o,e[o],e[o+1],a);return a&&ca(a,a.next)&&(ma(a),a=a.next),a}function Qo(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!ca(n,n.next)&&0!==la(n.prev,n,n.next))n=n.next;else{if(ma(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function Zo(e,t,r,n,i,o,a){if(e){!a&&o&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=oa(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,u,l=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(e,n,i,o);for(var s,u,l=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?Jo(e,n,i,o):Ko(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),ma(e),e=u.next,l=u.next;else if((e=u)===l){a?1===a?Zo(e=ea(Qo(e),t,r),t,r,n,i,o,2):2===a&&ta(e,t,r,n,i,o):Zo(Qo(e),t,r,n,i,o,1);break}}}function Ko(e){var t=e.prev,r=e,n=e.next;if(la(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(sa(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&la(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Jo(e,t,r,n){var i=e.prev,o=e,a=e.next;if(la(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=oa(s,u,t,r,n),d=oa(l,c,t,r,n),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ea(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!ca(i,o)&&ha(i,n,n.next,o)&&pa(i,o)&&pa(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),ma(n),ma(n.next),n=e=o),n=n.next}while(n!==e);return Qo(n)}function ta(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ua(a,s)){var u=va(a,s);return a=Qo(a,a.next),u=Qo(u,u.next),Zo(a,t,r,n,i,o),void Zo(u,t,r,n,i,o)}s=s.next}a=a.next}while(a!==e)}function ra(e,t){return e.x-t.x}function na(e,t){if(t=function(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&sa(or.x||n.x===r.x&&ia(r,n)))&&(r=n,d=u)),n=n.next}while(n!==l);return r}(e,t)){var r=va(t,e);Qo(t,t.next),Qo(r,r.next)}}function ia(e,t){return la(e.prev,e,t.prev)<0&&la(t.next,e,e.next)<0}function oa(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function aa(e){var t=e,r=e;do{(t.x=0&&(e-a)*(n-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function ua(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&ha(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(pa(e,t)&&pa(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(la(e.prev,e,t.prev)||la(e,t.prev,t))||ca(e,t)&&la(e.prev,e,e.next)>0&&la(t.prev,t,t.next)>0)}function la(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function ca(e,t){return e.x===t.x&&e.y===t.y}function ha(e,t,r,n){var i=fa(la(e,t,r)),o=fa(la(e,t,n)),a=fa(la(r,n,e)),s=fa(la(r,n,t));return i!==o&&a!==s||!(0!==i||!da(e,r,t))||!(0!==o||!da(e,n,t))||!(0!==a||!da(r,e,n))||!(0!==s||!da(r,t,n))}function da(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function fa(e){return e>0?1:e<0?-1:0}function pa(e,t){return la(e.prev,e,e.next)<0?la(e,t,e.next)>=0&&la(e,e.prev,t)>=0:la(e,t,e.prev)<0||la(e,e.next,t)<0}function va(e,t){var r=new ya(e.i,e.x,e.y),n=new ya(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function ga(e,t,r,n){var i=new ya(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ma(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ya(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var _a=function(){function e(){x(this,e)}return S(e,null,[{key:"area",value:function(e){for(var t=e.length,r=0,n=t-1,i=0;i2&&void 0!==arguments[2]?arguments[2]:2,c=t&&t.length,h=c?t[0]*l:e.length,d=qo(e,0,h,l,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(e,t,r,n){var i,o,a,s=[];for(i=0,o=t.length;i80*l){r=i=e[0],n=o=e[1];for(var p=l;pi&&(i=a),s>o&&(o=s);u=0!==(u=Math.max(i-r,o-n))?1/u:0}return Zo(d,f,l,r,n,u),f}(r,n),u=0;u2&&e[t-1].equals(e[0])&&e.pop()}function xa(e,t){for(var r=0;rNumber.EPSILON){var d=Math.sqrt(c),f=Math.sqrt(u*u+l*l),p=t.x-s/d,v=t.y+a/d,g=((r.x-l/f-p)*l-(r.y+u/f-v)*u)/(a*l-s*u),m=(n=p+a*g-e.x)*n+(i=v+s*g-e.y)*i;if(m<=2)return new j(n,i);o=Math.sqrt(m/2)}else{var y=!1;a>Number.EPSILON?u>Number.EPSILON&&(y=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(n=-s,i=a,o=Math.sqrt(c)):(n=a,i=s,o=Math.sqrt(c/2))}return new j(n/o,i/o)}for(var z=[],B=0,F=A.length,U=F-1,W=B+1;B=0;_e--){for(var be=_e/f,xe=c*Math.cos(be*Math.PI/2),we=h*Math.sin(be*Math.PI/2)+d,Se=0,Te=A.length;Se=0;){var n=r,o=r-1;o<0&&(o=e.length-1);for(var a=0,s=i+2*f;a1&&void 0!==arguments[1]?arguments[1]:12;x(this,r),(n=t.call(this)).type="ShapeGeometry",n.parameters={shapes:e,curveSegments:i};var o=[],a=[],s=[],u=[],l=0,c=0;if(!1===Array.isArray(e))d(e);else for(var h=0;h4&&void 0!==arguments[4]?arguments[4]:30,o=e.clone();o.name=t;for(var a=[],s=0;s=n)){c.push(u.times[d]);for(var p=0;po.tracks[g].times[0]&&(v=o.tracks[g].times[0]);for(var m=0;m1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;n<=0&&(n=30);for(var i=r.tracks.length,o=t/n,a=function(t){var n=r.tracks[t],i=n.ValueTypeName;if("bool"===i||"string"===i)return"continue";var a=e.tracks.find((function(e){return e.name===n.name&&e.ValueTypeName===i}));if(void 0===a)return"continue";var s=0,u=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=u/3);var l=0,c=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=c/3);var h=n.times.length-1,d=void 0;if(o<=n.times[0]){var f=s,p=u-s;d=Da.arraySlice(n.values,f,p)}else if(o>=n.times[h]){var v=h*u+s,g=v+u-s;d=Da.arraySlice(n.values,v,g)}else{var m=n.createInterpolant(),y=s,_=u-s;m.evaluate(o),d=Da.arraySlice(m.resultBuffer,y,_)}"quaternion"===i&&(new $).fromArray(d).normalize().conjugate().toArray(d);for(var b=a.times.length,x=0;x=i)break e;var s=t[1];e=(i=t[--r-1]))break t}o=r,r=0}for(;r>>1;et;)--o;if(++o,0!==i||o!==n){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Da.arraySlice(r,i,o),this.values=Da.arraySlice(this.values,i*a,o*a)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=r[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==n&&Da.isTypedArray(n))for(var u=0,l=n.length;u!==l;++u){var c=n[u];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,c),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=Da.arraySlice(this.times),t=Da.arraySlice(this.values),r=this.getValueSize(),n=2302===this.getInterpolation(),i=e.length-1,o=1,a=1;a0){e[o]=e[i];for(var m=i*r,y=o*r,_=0;_!==r;++_)t[y+_]=t[m+_];++o}return o!==e.length?(this.times=Da.arraySlice(e,0,o),this.values=Da.arraySlice(t,0,o*r)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=Da.arraySlice(this.times,0),t=Da.arraySlice(this.values,0),r=new this.constructor(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}],[{key:"toJSON",value:function(e){var t,r=e.constructor;if(r.toJSON!==this.toJSON)t=r.toJSON(e);else{t={name:e.name,times:Da.convertArray(e.times,Array),values:Da.convertArray(e.values,Array)};var n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}}]),e}();Fa.prototype.TimeBufferType=Float32Array,Fa.prototype.ValueBufferType=Float32Array,Fa.prototype.DefaultInterpolation=2301;var Ua=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Ua.prototype.ValueTypeName="bool",Ua.prototype.ValueBufferType=Array,Ua.prototype.DefaultInterpolation=2300,Ua.prototype.InterpolantFactoryMethodLinear=void 0,Ua.prototype.InterpolantFactoryMethodSmooth=void 0;var Wa=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Wa.prototype.ValueTypeName="color";var Ga=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Ga.prototype.ValueTypeName="number";var Va=function(e){p(r,e);var t=g(r);function r(e,n,i,o){return x(this,r),t.call(this,e,n,i,o)}return S(r,[{key:"interpolate_",value:function(e,t,r,n){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(r-t)/(n-t),u=e*a,l=u+a;u!==l;u+=4)$.slerpFlat(i,0,o,u-a,o,u,s);return i}}]),r}(La),Ha=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new Va(this.times,this.values,this.getValueSize(),e)}}]),r}(Fa);Ha.prototype.ValueTypeName="quaternion",Ha.prototype.DefaultInterpolation=2301,Ha.prototype.InterpolantFactoryMethodSmooth=void 0;var Ya=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Ya.prototype.ValueTypeName="string",Ya.prototype.ValueBufferType=Array,Ya.prototype.DefaultInterpolation=2300,Ya.prototype.InterpolantFactoryMethodLinear=void 0,Ya.prototype.InterpolantFactoryMethodSmooth=void 0;var $a=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);$a.prototype.ValueTypeName="vector";var Xa=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;x(this,e),this.name=t,this.tracks=n,this.duration=r,this.blendMode=i,this.uuid=P(),this.duration<0&&this.resetDuration()}return S(e,[{key:"resetDuration",value:function(){for(var e=0,t=0,r=this.tracks.length;t!==r;++t){var n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}},{key:"trim",value:function(){for(var e=0;e1){var l=u[1],c=n[l];c||(n[l]=c=[]),c.push(s)}}var h=[];for(var d in n)h.push(this.CreateFromMorphTargetSequence(d,n[d],t,r));return h}},{key:"parseAnimation",value:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(e,t,r,n,i){if(0!==r.length){var o=[],a=[];Da.flattenJSON(r,o,a,n),0!==o.length&&i.push(new e(t,o,a))}},n=[],i=e.name||"default",o=e.fps||30,a=e.blendMode,s=e.length||-1,u=e.hierarchy||[],l=0;l0||0===e.search(/^data\:image\/jpeg/);i.format=n?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),r,n),i}}]),r}(Ka),is=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return S(r,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Vo(t,e))}},{key:"getPoint",value:function(e){for(var t=e*this.getLength(),r=this.getCurveLengths(),n=0;n=t){var i=r[n]-t,o=this.curves[n],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}n++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,r=0,n=this.curves.length;r0&&void 0!==arguments[0]?arguments[0]:40,t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,r=[],n=0,i=this.curves;n1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r}},{key:"copy",value:function(e){f(b(r.prototype),"copy",this).call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t0){var l=u.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(u);var c=u.getPoint(1);return this.currentPoint.copy(c),this}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}]),r}(is),as=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).uuid=P(),n.type="Shape",n.holes=[],n}return S(r,[{key:"getPointsHoles",value:function(e){for(var t=[],r=0,n=this.holes.length;r1&&void 0!==arguments[1]?arguments[1]:1;return x(this,r),(n=t.call(this)).type="Light",n.color=new gt(e),n.intensity=i,n}return S(r,[{key:"dispose",value:function(){}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}]),r}(Qe);ss.prototype.isLight=!0;var us=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,i)).type="HemisphereLight",o.position.copy(Qe.DefaultUp),o.updateMatrix(),o.groundColor=new gt(n),o}return S(r,[{key:"copy",value:function(e){return ss.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}]),r}(ss);us.prototype.isHemisphereLight=!0;var ls=new Me,cs=new X,hs=new X,ds=function(){function e(t){x(this,e),this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new j(512,512),this.map=null,this.mapPass=null,this.matrix=new Me,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new vr,this._frameExtents=new j(1,1),this._viewportCount=1,this._viewports=[new V(0,0,1,1)]}return S(e,[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var t=this.camera,r=this.matrix;cs.setFromMatrixPosition(e.matrixWorld),t.position.copy(cs),hs.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(hs),t.updateMatrixWorld(),ls.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ls),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(t.projectionMatrix),r.multiply(t.matrixWorldInverse)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}]),e}(),fs=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this,new or(50,1,.5,500))).focus=1,e}return S(r,[{key:"updateMatrices",value:function(e){var t=this.camera,n=2*C*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;n===t.fov&&i===t.aspect&&o===t.far||(t.fov=n,t.aspect=i,t.far=o,t.updateProjectionMatrix()),f(b(r.prototype),"updateMatrices",this).call(this,e)}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.focus=e.focus,this}}]),r}(ds);fs.prototype.isSpotLightShadow=!0;var ps=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return x(this,r),(i=t.call(this,e,n)).type="SpotLight",i.position.copy(Qe.DefaultUp),i.updateMatrix(),i.target=new Qe,i.distance=o,i.angle=a,i.penumbra=s,i.decay=u,i.shadow=new fs,i}return S(r,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}]),r}(ss);ps.prototype.isSpotLight=!0;var vs=new Me,gs=new X,ms=new X,ys=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this,new or(90,1,.5,500)))._frameExtents=new j(4,2),e._viewportCount=6,e._viewports=[new V(2,1,1,1),new V(0,1,1,1),new V(3,1,1,1),new V(1,1,1,1),new V(3,0,1,1),new V(1,0,1,1)],e._cubeDirections=[new X(1,0,0),new X(-1,0,0),new X(0,0,1),new X(0,0,-1),new X(0,1,0),new X(0,-1,0)],e._cubeUps=[new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,0,1),new X(0,0,-1)],e}return S(r,[{key:"updateMatrices",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.camera,n=this.matrix,i=e.distance||r.far;i!==r.far&&(r.far=i,r.updateProjectionMatrix()),gs.setFromMatrixPosition(e.matrixWorld),r.position.copy(gs),ms.copy(r.position),ms.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(ms),r.updateMatrixWorld(),n.makeTranslation(-gs.x,-gs.y,-gs.z),vs.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vs)}}]),r}(ds);ys.prototype.isPointLightShadow=!0;var _s=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),(i=t.call(this,e,n)).type="PointLight",i.distance=o,i.decay=a,i.shadow=new ys,i}return S(r,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}]),r}(ss);_s.prototype.isPointLight=!0;var bs=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return x(this,r),(e=t.call(this)).type="OrthographicCamera",e.zoom=1,e.view=null,e.left=n,e.right=i,e.top=o,e.bottom=a,e.near=s,e.far=u,e.updateProjectionMatrix(),e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,t,r,n,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2,i=r-e,o=r+e,a=n+t,s=n-t;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=u*this.view.offsetX)+u*this.view.width,s=(a-=l*this.view.offsetY)-l*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}]),r}(ir);bs.prototype.isOrthographicCamera=!0;var xs=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.call(this,new bs(-5,5,5,-5,.5,500))}return r}(ds);xs.prototype.isDirectionalLightShadow=!0;var ws=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="DirectionalLight",i.position.copy(Qe.DefaultUp),i.updateMatrix(),i.target=new Qe,i.shadow=new xs,i}return S(r,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}]),r}(ss);ws.prototype.isDirectionalLight=!0;var Ss=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="AmbientLight",i}return r}(ss);Ss.prototype.isAmbientLight=!0;var Ts=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return x(this,r),(i=t.call(this,e,n)).type="RectAreaLight",i.width=o,i.height=a,i}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.width=e.width,this.height=e.height,this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}]),r}(ss);Ts.prototype.isRectAreaLight=!0;var Ms=function(){function e(){x(this,e),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new X)}return S(e,[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var r=e.x,n=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*n),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],r*n*1.092548),t.addScaledVector(o[5],n*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],r*i*1.092548),t.addScaledVector(o[8],.546274*(r*r-n*n)),t}},{key:"getIrradianceAt",value:function(e,t){var r=e.x,n=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*n),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*r),t.addScaledVector(o[4],.858086*r*n),t.addScaledVector(o[5],.858086*n*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*r*i),t.addScaledVector(o[8],.429043*(r*r-n*n)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.coefficients,n=0;n<9;n++)r[n].fromArray(e,t+3*n);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.coefficients,n=0;n<9;n++)r[n].toArray(e,t+3*n);return e}}],[{key:"getBasisAt",value:function(e,t){var r=e.x,n=e.y,i=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*i,t[3]=.488603*r,t[4]=1.092548*r*n,t[5]=1.092548*n*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*r*i,t[8]=.546274*(r*r-n*n)}}]),e}();Ms.prototype.isSphericalHarmonics3=!0;var ks=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ms,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return x(this,r),(e=t.call(this,void 0,i)).sh=n,e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.sh.copy(e.sh),this}},{key:"fromJSON",value:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.sh=this.sh.toArray(),t}}]),r}(ss);ks.prototype.isLightProbe=!0;var Es=function(){function e(){x(this,e)}return S(e,null,[{key:"decodeText",value:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;r3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),"number"==typeof i&&(a=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),(o=t.call(this,e,n,i)).meshPerAttribute=a,o}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}]),r}(bt);Cs.prototype.isInstancedBufferAttribute=!0,function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),n=t.call(this,e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),n.options={premultiplyAlpha:"none"},n}return S(r,[{key:"setOptions",value:function(e){return this.options=e,this}},{key:"load",value:function(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=Qa.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(r){Qa.add(e,r),t&&t(r),i.manager.itemEnd(e)})).catch((function(t){n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}]),r}(Ka).prototype.isImageBitmapLoader=!0;var Ps=function(e){p(r,e);var t=g(r);function r(e){return x(this,r),t.call(this,e)}return S(r,[{key:"load",value:function(e,t,r,n){var i=this,o=new es(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(r){try{var o=r.slice(0);(void 0===As&&(As=new(window.AudioContext||window.webkitAudioContext)),As).decodeAudioData(o,(function(e){t(e)}))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}}]),r}(Ka);(function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;x(this,r),i=t.call(this,void 0,o);var a=(new gt).set(e),s=(new gt).set(n),u=new X(a.r,a.g,a.b),l=new X(s.r,s.g,s.b),c=Math.sqrt(Math.PI),h=c*Math.sqrt(.75);return i.sh.coefficients[0].copy(u).add(l).multiplyScalar(c),i.sh.coefficients[1].copy(u).sub(l).multiplyScalar(h),i}return r})(ks).prototype.isHemisphereLightProbe=!0,function(e){p(r,e);var t=g(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;x(this,r),n=t.call(this,void 0,i);var o=(new gt).set(e);return n.sh.coefficients[0].set(o.r,o.g,o.b).multiplyScalar(2*Math.sqrt(Math.PI)),n}return r}(ks).prototype.isAmbientLightProbe=!0;var Ns=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="Audio",n.listener=e,n.context=e.context,n.gain=n.context.createGain(),n.gain.connect(e.getInput()),n.autoplay=!1,n.buffer=null,n.detune=0,n.loop=!1,n.loopStart=0,n.loopEnd=0,n.offset=0,n.duration=void 0,n.playbackRate=1,n.isPlaying=!1,n.hasPlaybackControl=!0,n.source=null,n.sourceType="empty",n._startedAt=0,n._progress=0,n._connected=!1,n.filters=[],n}return S(r,[{key:"getOutput",value:function(){return this.gain}},{key:"setNodeSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}},{key:"setMediaElementSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}},{key:"setMediaStreamSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}},{key:"setBuffer",value:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"connect",value:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(var u=t,l=t+t;u!==l;++u)if(r[u]!==r[u+t]){a.setValue(r,n);break}}},{key:"saveOriginalState",value:function(){var e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(var i=r,o=n;i!==o;++i)t[i]=t[n+i%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}},{key:"restoreOriginalState",value:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}},{key:"_setAdditiveIdentityNumeric",value:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,r=e;r=.5)for(var o=0;o!==i;++o)e[t+o]=e[r+o]}},{key:"_slerp",value:function(e,t,r,n){$.slerpFlat(e,t,e,t,e,r,n)}},{key:"_slerpAdditive",value:function(e,t,r,n,i){var o=this._workIndex*i;$.multiplyQuaternionsFlat(e,o,e,t,e,r),$.slerpFlat(e,t,e,t,e,o,n)}},{key:"_lerp",value:function(e,t,r,n,i){for(var o=1-n,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[r+a]*n}}},{key:"_lerpAdditive",value:function(e,t,r,n,i){for(var o=0;o!==i;++o){var a=t+o;e[a]=e[a]+e[r+o]*n}}}]),e}(),Rs=new RegExp("[\\[\\]\\.:\\/]","g"),Ds="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ls=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),js=/(WCOD+)?/.source.replace("WCOD",Ds),zs=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Bs=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Fs=new RegExp("^"+Ls+js+zs+Bs+"$"),Us=["material","materials","bones"],Ws=function(){function e(t,r,n){x(this,e),this.path=r,this.parsedPath=n||e.parseTrackName(r),this.node=e.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return S(e,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(e,t){e[t]=this.node[this.propertyName]}},{key:"_getValue_array",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)e[t++]=r[n]}},{key:"_getValue_arrayElement",value:function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(e,t){this.resolvedProperty.toArray(e,t)}},{key:"_setValue_direct",value:function(e,t){this.targetObject[this.propertyName]=e[t]}},{key:"_setValue_direct_setNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++]}},{key:"_setValue_array_setNeedsUpdate",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(e,t){this.resolvedProperty.fromArray(e,t)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(e,t){this.bind(),this.getValue(e,t)}},{key:"_setValue_unbound",value:function(e,t){this.bind(),this.setValue(e,t)}},{key:"bind",value:function(){var t=this.node,r=this.parsedPath,n=r.objectName,i=r.propertyName,o=r.propertyIndex;if(t||(t=e.findNode(this.rootNode,r.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=r.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.blendMode;x(this,e),this._mixer=t,this._clip=r,this._localRoot=n,this.blendMode=i;for(var o=r.tracks,a=o.length,s=new Array(a),u={endingStart:2400,endingEnd:2400},l=0;l!==a;++l){var c=o[l].createInterpolant(null);s[l]=c,c.settings=u}this._interpolantSettings=u,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return S(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){var n=this._clip.duration,i=e._clip.duration,o=i/n,a=n/i;e.warp(1,o,t),this.warp(a,1,t)}return this}},{key:"crossFadeTo",value:function(e,t,r){return e.crossFadeFrom(this,t,r)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,r){var n=this._mixer,i=n.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+r,u[0]=e/o,u[1]=t/o,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,r,n){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*r;if(o<0||0===r)return;this._startTime=null,t=r*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0){var u=this._interpolants,l=this._propertyBindings;if(2501===this.blendMode)for(var c=0,h=u.length;c!==h;++c)u[c].evaluate(a),l[c].accumulateAdditive(s);else for(var d=0,f=u.length;d!==f;++d)u[d].evaluate(a),l[d].accumulate(n,s)}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var r=this._timeScaleInterpolant;null!==r&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,r=this.loop,n=this.time+e,i=this._loopCount,o=2202===r;if(0===e)return-1===i?n:o&&1==(1&i)?t-n:n;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n>=t||n<0){var a=Math.floor(n/t);n-=t*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=n;if(o&&1==(1&i))return t-n}return n}},{key:"_setEndings",value:function(e,t,r){var n=this._interpolantSettings;r?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}},{key:"_scheduleFading",value:function(e,t,r){var n=this._mixer,i=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=r,this}}]),e}();(function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this))._root=e,n._initMemoryManager(),n._accuIndex=0,n.time=0,n.timeScale=1,n}return S(r,[{key:"_bindAction",value:function(e,t){var r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,o=e._propertyBindings,a=e._interpolants,s=r.uuid,u=this._bindingsByRootAndName,l=u[s];void 0===l&&(l={},u[s]=l);for(var c=0;c!==i;++c){var h=n[c],d=h.name,f=l[d];if(void 0!==f)o[c]=f;else{if(void 0!==(f=o[c])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=t&&t._propertyBindings[c].binding.parsedPath;++(f=new Os(Ws.create(r,d,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(f,s,d),o[c]=f}a[c].resultBuffer=f.buffer}}},{key:"_activateAction",value:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}},{key:"_deactivateAction",value:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,r=0,n=t.length;r!==n;++r){var i=t[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}},{key:"_initMemoryManager",value:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}},{key:"_isActiveAction",value:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}},{key:"update",value:function(e){e*=this.timeScale;for(var t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==r;++a)t[a]._update(n,e,i,o);for(var s=this._bindings,u=this._nActiveBindings,l=0;l!==u;++l)s[l].apply(o);return this}},{key:"setTime",value:function(e){this.time=0;for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:1;return x(this,r),(i=t.call(this,e,n)).meshPerAttribute=o,i}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"clone",value:function(e){var t=f(b(r.prototype),"clone",this).call(this,e);return t.meshPerAttribute=this.meshPerAttribute,t}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}]),r}(Oi).prototype.isInstancedInterleavedBuffer=!0,new j,new X,new X,function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).material=e,n.render=function(){},n.hasPositions=!1,n.hasNormals=!1,n.hasColors=!1,n.hasUvs=!1,n.positionArray=null,n.normalArray=null,n.colorArray=null,n.uvArray=null,n.count=0,n}return r}(Qe).prototype.isImmediateRenderObject=!0;var Vs=new X,Hs=new Me,Ys=new Me,$s=new Float32Array(1);new Int32Array($s.buffer);var Xs=[.125,.215,.35,.446,.526,.582],qs=5+Xs.length,Qs=new mt({side:1,depthWrite:!1,depthTest:!1});new Zt(new Jt,Qs),function(){for(var e=[],t=[],r=[],n=8,i=0;i4?a=Xs[i-8+4-1]:0==i&&(a=0),r.push(a);for(var s=1/(o-1),u=-s/2,l=1+s/2,c=[u,u,l,u,l,l,u,u,l,l,u,l],h=new Float32Array(108),d=new Float32Array(72),f=new Float32Array(36),p=0;p<6;p++){var v=p%3*2/3-1,g=p>2?0:-1,m=[v,g,0,v+2/3,g,0,v+2/3,g+1,0,v,g,0,v+2/3,g+1,0,v,g+1,0];h.set(m,18*p),d.set(c,12*p);var y=[p,p,p,p,p,p];f.set(y,6*p)}var _=new Ot;_.setAttribute("position",new bt(h,3)),_.setAttribute("uv",new bt(d,2)),_.setAttribute("faceIndex",new bt(f,1)),e.push(_),n>4&&n--}}(),Co.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Co.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},os.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;x(this,r),o=new gt(o),a=new gt(a);for(var s=i/2,u=n/i,l=n/2,c=[],h=[],d=0,f=0,p=-l;d<=i;d++,p+=u){c.push(-l,0,p,l,0,p),c.push(p,0,-l,p,0,l);var v=d===s?o:a;v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3}var g=new Ot;return g.setAttribute("position",new Tt(c,3)),g.setAttribute("color",new Tt(h,3)),(e=t.call(this,g,new co({vertexColors:!0,toneMapped:!1}))).type="GridHelper",e}return r}(bo).prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r);for(var i=function e(t){var r=[];t&&t.isBone&&r.push(t);for(var n=0;n=.3&&e<.7){var r=(e-.3)/.4;this.isRight?(this.group.position.z=-1*(.25*this.height+.55*this.height*r),this.group.position.x=-1*(this.width+this.gap)*r):(this.group.position.z=-1*(.25*this.height+.55*this.height*r),this.group.position.x=(this.width+this.gap)*r)}else{var n=(e-.7)/.3;this.isRight?(this.group.position.x=-1*(this.width+this.gap),this.group.position.z=.8*this.height*-1*(1-n),this.group.rotation.y=Math.PI/12*-1*(1-n)):(this.group.position.x=this.width+this.gap,this.group.position.z=.8*this.height*-1*(1-n),this.group.rotation.y=Math.PI/12*(1-n))}}},{key:"isRight",get:function(){var e=this.options.find((function(e){return"dir"===e.name}));return!e||"r"===e.value}}]),e}(),Switch:function(){function e(){x(this,e),this.camera=new Du,this.duration=6e3,this.options=[],this.prevMesh=new Zt,this.nextMesh=new Zt,this.width=100,this.height=100,this.depth=1,this.prevDepth=1}return S(e,[{key:"addObjects",value:function(e){e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"dispose",value:function(){Array.isArray(this.prevMesh.material)?this.prevMesh.material.forEach((function(e){return e.dispose()})):this.prevMesh.material.dispose(),this.prevMesh.geometry.dispose(),Array.isArray(this.nextMesh.material)?this.nextMesh.material.forEach((function(e){return e.dispose()})):this.nextMesh.material.dispose(),this.nextMesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=new mt({map:e});this.nextMesh.material=t}},{key:"setPrevTexture",value:function(e){var t=new mt({map:e});this.prevMesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t),this.width=e,this.height=t,this.depth=t/2;var r=new yr(e,t,1,1);this.prevMesh.geometry=r;var n=new yr(e,t,1,1);this.nextMesh.geometry=n,this.prevDepth=this.prevMesh.position.z}},{key:"updateAnimation",value:function(e){var t=this.options.find((function(e){return"dir"===e.name}));if(e<.5){var r=e/.5;this.prevMesh.position.x=this.width/2*r,this.prevMesh.rotation.y=-Math.PI/10*r,this.nextMesh.position.x=-this.width/2*r,this.nextMesh.rotation.y=Math.PI/10*r,this.nextMesh.position.z=this.prevDepth-this.depth*(1-r)}else{var n=(e-.5)/.5;this.prevMesh.position.x=this.width/2*(1-n),this.prevMesh.rotation.y=-Math.PI/10*(1-n),this.prevMesh.position.z=this.prevDepth-this.depth*n,this.nextMesh.position.x=-this.width/2*(1-n),this.nextMesh.rotation.y=Math.PI/10*(1-n)}if(t&&"l"===t.value)if(e<.5){var i=e/.5;this.prevMesh.position.x=-this.width/2*i,this.prevMesh.rotation.y=Math.PI/10*i,this.nextMesh.position.x=this.width/2*i,this.nextMesh.rotation.y=-Math.PI/10*i}else{var o=(e-.5)/.5;this.prevMesh.position.x=-this.width/2*(1-o),this.prevMesh.rotation.y=Math.PI/10*(1-o),this.nextMesh.position.x=this.width/2*(1-o),this.nextMesh.rotation.y=-Math.PI/10*(1-o)}}}]),e}(),Prism:function(){function e(){x(this,e),this.camera=new Du,this.duration=6e3,this.preset=null,this.presetZ=0,this.mesh=new Zt,this.width=100,this.height=100}return S(e,[{key:"addObjects",value:function(e){this.mesh.geometry=this.box,e.add(this.mesh)}},{key:"dispose",value:function(){Array.isArray(this.mesh.material)?this.mesh.material.forEach((function(e){return e.dispose()})):this.mesh.material.dispose(),this.mesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new mt({map:e})),t.push(new mt({map:e})),t.push(new mt({map:e})),this.mesh.material=t}},{key:"setPrevTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new mt({map:e})),t.push(new mt({map:e})),t.push(new mt({map:e})),this.mesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.mesh,t),this.mesh.position.z-=e/2,this.width=e,this.height=t,this.box=new Jt(e,t,e,1,1,1),this.mesh.geometry=this.box}},{key:"updateAnimation",value:function(e){null===this.preset&&(this.preset=e>0?0:Math.PI/2,this.presetZ=this.mesh.position.z);var t=Math.PI/2*e,r=(Math.sqrt(2)-1)*(this.width/2);this.mesh.rotation.y=this.preset+t,this.mesh.position.z=e<=.5?this.presetZ-e/.5*r:this.presetZ-(1-(e-.5)/.5)*r}}]),e}(),Doors:function(){function e(){x(this,e),this.camera=new Du,this.duration=1600,this.options=[],this.width=100,this.preMaterial=new nr({fragmentShader:Pl.a,vertexShader:Al.a,uniforms:{prevTexture:{value:ou},timePercent:{value:0},offset:{value:0}}}),this.prevGeometry=new Ot,this.prevMesh=new Zt,this.nextMesh=new Zt}return S(e,[{key:"addObjects",value:function(e){this.prevMesh.material=this.preMaterial,this.prevMesh.geometry=this.prevGeometry,this.prevMesh.material.transparent=!0,e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"setNextTexture",value:function(e){this.nextMesh.material=new mt({map:e})}},{key:"setPrevTexture",value:function(e){this.preMaterial.uniforms.prevTexture.value=e}},{key:"setSize",value:function(e,t){this.width=e,this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t);var r=e/2,n=t/2;this.preMaterial.uniforms.offset.value=e/2,this.prevGeometry.setIndex([0,1,2,3,4,5,6,7,8,9,10,11]);var i=this.options.find((function(e){return"dir"===e.name})),o=i&&"vert"===i.value?0:1;this.preMaterial.uniforms.option={value:o},1===o?(this.prevGeometry.setAttribute("position",new Tt([-r,n,0,-r,0,0,r,n,0,-r,0,0,r,0,0,r,n,0,-r,0,0,-r,-n,0,r,0,0,-r,-n,0,r,-n,0,r,0,0],3)),this.prevGeometry.setAttribute("uv",new Tt([0,1,0,.5,1,1,0,.5,1,.5,1,1,0,.5,0,0,1,.5,0,0,1,0,1,.5],2))):(this.prevGeometry.setAttribute("position",new Tt([-r,n,0,-r,-n,0,0,n,0,-r,-n,0,0,-n,0,0,n,0,0,n,0,0,-n,0,r,n,0,0,-n,0,r,-n,0,r,n,0],3)),this.prevGeometry.setAttribute("uv",new Tt([0,1,0,0,.5,1,0,0,.5,0,.5,1,.5,1,.5,0,1,1,.5,0,1,0,1,1],2))),this.prevGeometry.setAttribute("left",new Tt([1,1,1,1,1,1,0,0,0,0,0,0],1)),this.nextMesh.geometry=new yr(e,t,1,1),this.nextMesh.position.z=this.prevMesh.position.z-e/4}},{key:"updateAnimation",value:function(e){this.preMaterial.uniforms.timePercent.value=e,this.nextMesh.position.z=this.prevMesh.position.z-(1-e)*(this.width/4)}},{key:"dispose",value:function(){}}]),e}()},Ol=function(){function e(){var t=this;x(this,e),this.startTime=0,this.lastTime=0,this.lastFPSTime=0,this.renderingDuration=16,this.reverse=!1,this.scene=new Ni,this.delay=0,this.easeFn=iu.linear,this.preset=null,this.onTransactionEnd=function(){},this.isTransactionStartApplied=!1,this.prevTexture=null,this.nextTexture=null,this.animationId=null,this.config=null,this.renderer=new Pi({alpha:!0,premultipliedAlpha:!0}),this.isPlaying=!1,this.animate=function(){var e,r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.fps(i)){t.renderer.clear(),i>t.delay&&0===t.lastTime&&(t.lastTime=i,t.startTime=i);var o=0;t.lastTime>0&&o<1&&(o=t.easeFn(i-t.startTime,0,1,null!==(r=null===(e=t.preset)||void 0===e?void 0:e.duration)&&void 0!==r?r:0)),o>1&&(o=1),null===(n=t.preset)||void 0===n||n.updateAnimation(t.reverse?1-o:o),t.rerender(),t.isTransactionStartApplied||(t.isTransactionStartApplied=!0),o<1?t.animationId=window.requestAnimationFrame(t.animate):t.onTransactionEnd()}else t.animationId=window.requestAnimationFrame(t.animate)}}return S(e,[{key:"initPlayer",value:function(e){this.config=e,this.reverse=e.reverse,e.delay&&Number.isInteger(e.delay)&&(this.delay=e.delay),e.easeFn&&(this.easeFn=iu[e.easeFn]),e.maxFPS&&Number.isInteger(e.maxFPS)&&e.maxFPS>0&&(this.renderingDuration=Math.ceil(1e3/e.maxFPS)),this.startTime=0,this.lastTime=0,this.scene.clear(),this.renderer.shadowMap.enabled=!0,this.renderer.autoClear=!1,this.renderer.setClearColor(e.clearColor||0),this.isTransactionStartApplied=!1,this.renderer.setSize(e.stageWidth,e.stageHeight),this.preset=new Nl[e.presetType],e.options&&(this.preset.options=e.options),e.duration&&Number.isInteger(e.duration)&&(this.preset.duration=e.duration),this.preset.setSize(e.stageWidth,e.stageHeight)}},{key:"setPrevTexture",value:function(e){var t,r,n,i;e.needsUpdate=!0,this.reverse?(this.nextTexture=e,null===(t=this.preset)||void 0===t||t.setNextTexture(e)):(this.prevTexture=e,null===(r=this.preset)||void 0===r||r.setPrevTexture(e)),null===(n=this.preset)||void 0===n||n.addObjects(this.scene),null===(i=this.preset)||void 0===i||i.updateAnimation(this.reverse?1:0),this.rerender()}},{key:"setNextTexture",value:function(e){var t,r;e.needsUpdate=!0,this.reverse?(this.prevTexture=e,null===(t=this.preset)||void 0===t||t.setPrevTexture(e)):(this.nextTexture=e,null===(r=this.preset)||void 0===r||r.setNextTexture(e))}},{key:"play",value:function(){var e=this;return new Promise((function(t){e.onTransactionEnd=t,e.animate(),e.isPlaying=!0}))}},{key:"rerender",value:function(){var e;this.renderer.clear(),(null===(e=this.preset)||void 0===e?void 0:e.camera.camera)&&this.renderer.render(this.scene,this.preset.camera.camera)}},{key:"fps",value:function(e){return e<=0||(this.lastFPSTime<0||e-this.lastFPSTime>=this.renderingDuration)&&(this.lastFPSTime=e,!0)}},{key:"skip",value:function(){var e;null===(e=this.preset)||void 0===e||e.updateAnimation(this.reverse?0:1),this.rerender(),this.dispose(),this.onTransactionEnd()}},{key:"dispose",value:function(){var e,t,r;window.cancelAnimationFrame(this.animationId),this.renderer.clear(),this.isPlaying=!1,null===(e=this.preset)||void 0===e||e.dispose(),null===(t=this.prevTexture)||void 0===t||t.dispose(),null===(r=this.nextTexture)||void 0===r||r.dispose();for(var n=this.scene.children.length-1;n>=0;n--){var i=this.scene.children[n];this.scene.remove(i)}this.scene.background=null}},{key:"destroy",value:function(){this.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose()}}]),e}();r(139);var Rl=r(3),Dl=r(5);Dl.c.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var Ll=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Rl.isMobile.tablet||Rl.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2..toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var r=0;r title : "+e.title+"
tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,r=t.width,n=t.height;e.x+e.width>r&&(e.width=r-e.x),e.y+e.height>n&&(e.height=n-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2..toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,r=e.target.displayObject,n=t.eventData;t.dispatchEvent(r,"click",n),t.dispatchEvent(r,"pointertap",n),t.dispatchEvent(r,"tap",n)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,r=e.target.displayObject,n=t.eventData;t.dispatchEvent(r,"mouseover",n)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,r=e.target.displayObject,n=t.eventData;t.dispatchEvent(r,"mouseout",n)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}(),jl=r(1),zl=r(7),Bl=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new jl.g,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(e.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),e.prototype.getLocalPosition=function(e,t,r){return e.worldTransform.applyInverse(r||this.global,t)},e.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},e.prototype.reset=function(){this.isPrimary=!1},e}(),Fl=function(e,t){return(Fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},Ul=function(){function e(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return e.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},e.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},e}(),Wl=function(){function e(t){this._pointerId=t,this._flags=e.FLAGS.NONE}return e.prototype._doSet=function(e,t){this._flags=t?this._flags|e:this._flags&~e},Object.defineProperty(e.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"none",{get:function(){return this._flags===e.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"over",{get:function(){return 0!=(this._flags&e.FLAGS.OVER)},set:function(t){this._doSet(e.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightDown",{get:function(){return 0!=(this._flags&e.FLAGS.RIGHT_DOWN)},set:function(t){this._doSet(e.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftDown",{get:function(){return 0!=(this._flags&e.FLAGS.LEFT_DOWN)},set:function(t){this._doSet(e.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),e.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),e}(),Gl=function(){function e(){this._tempPoint=new jl.g}return e.prototype.recursiveFindHit=function(e,t,r,n,i){if(!t||!t.visible)return!1;var o=e.data.global,a=!1,s=i=t.interactive||i,u=!0;if(t.hitArea?(n&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(n=!1,u=!1)),s=!1):t._mask&&n&&(t._mask.containsPoint&&t._mask.containsPoint(o)||(n=!1)),u&&t.interactiveChildren&&t.children)for(var l=t.children,c=l.length-1;c>=0;c--){var h=l[c],d=this.recursiveFindHit(e,h,r,n,s);if(d){if(!h.parent)continue;s=!1,d&&(e.target&&(n=!1),a=!0)}}return i&&(n&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(a=!0),t.interactive&&(a&&!e.target&&(e.target=t),r&&r(e,t,!!a))),a},e.prototype.findHit=function(e,t,r,n){this.recursiveFindHit(e,t,r,n,!1)},e}(),Vl={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(e){e?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Dl.c.mixin(Vl);var Hl={target:null,data:{global:null}},Yl=function(e){function t(t,r){var n=e.call(this)||this;return r=r||{},n.renderer=t,n.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,n.interactionFrequency=r.interactionFrequency||10,n.mouse=new Bl,n.mouse.identifier=1,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[1]=n.mouse,n.interactionDataPool=[],n.eventData=new Ul,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new Gl,n._tempDisplayObject=new Dl.d,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return function(e,t){function r(){this.constructor=e}Fl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return Hl.target=null,Hl.data.global=e,t||(t=this.lastObjectRendered),this.processInteractive(Hl,t,null,!0),Hl.target},t.prototype.setTargetElement=function(e,t){void 0===t&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(zl.a.system.add(this.tickerUpdate,this,zl.c.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(zl.a.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,this._deltaTime>8&255]+E[e>>16&255]+E[e>>24&255]+"-"+E[255&t]+E[t>>8&255]+"-"+E[t>>16&15|64]+E[t>>24&255]+"-"+E[63&r|128]+E[r>>8&255]+"-"+E[r>>16&255]+E[r>>24&255]+E[255&n]+E[n>>8&255]+E[n>>16&255]+E[n>>24&255]).toUpperCase()}function N(e,t,r){return Math.max(t,Math.min(r,e))}function O(e,t,r){return(1-r)*e+r*t}function R(e){return 0==(e&e-1)&&0!==e}function L(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;x(this,e),this.x=t,this.y=r}return S(e,[{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*r-o*n+e.x,this.y=i*n+o*r+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}}]),e}();j.prototype.isVector2=!0;var z,B=function(){function e(){x(this,e),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return S(e,[{key:"set",value:function(e,t,r,n,i,o,a,s,u){var l=this.elements;return l[0]=e,l[1]=n,l[2]=a,l[3]=t,l[4]=i,l[5]=s,l[6]=r,l[7]=o,l[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}},{key:"extractBasis",value:function(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[3],s=r[6],u=r[1],l=r[4],c=r[7],h=r[2],d=r[5],f=r[8],p=n[0],v=n[3],g=n[6],m=n[1],y=n[4],_=n[7],b=n[2],x=n[5],w=n[8];return i[0]=o*p+a*m+s*b,i[3]=o*v+a*y+s*x,i[6]=o*g+a*_+s*w,i[1]=u*p+l*m+c*b,i[4]=u*v+l*y+c*x,i[7]=u*g+l*_+c*w,i[2]=h*p+d*m+f*b,i[5]=h*v+d*y+f*x,i[8]=h*g+d*_+f*w,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8];return t*o*l-t*a*u-r*i*l+r*a*s+n*i*u-n*o*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=l*o-a*u,h=a*s-l*i,d=u*i-o*s,f=t*c+r*h+n*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);var p=1/f;return e[0]=c*p,e[1]=(n*u-l*r)*p,e[2]=(a*r-n*o)*p,e[3]=h*p,e[4]=(l*t-n*s)*p,e[5]=(n*i-a*t)*p,e[6]=d*p,e[7]=(r*s-u*t)*p,e[8]=(o*t-r*i)*p,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,r,n,i,o,a){var s=Math.cos(i),u=Math.sin(i);return this.set(r*s,r*u,-r*(s*o+u*a)+o+e,-n*u,n*s,-n*(-u*o+s*a)+a+t,0,0,1),this}},{key:"scale",value:function(e,t){var r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),r=Math.sin(e),n=this.elements,i=n[0],o=n[3],a=n[6],s=n[1],u=n[4],l=n[7];return n[0]=t*i+r*s,n[3]=t*o+r*u,n[6]=t*a+r*l,n[1]=-r*i+t*s,n[4]=-r*o+t*u,n[7]=-r*a+t*l,this}},{key:"translate",value:function(e,t){var r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}},{key:"equals",value:function(e){for(var t=this.elements,r=e.elements,n=0;n<9;n++)if(t[n]!==r[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<9;r++)this.elements[r]=e[r+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}]),e}();B.prototype.isMatrix3=!0;var F=function(){function e(){x(this,e)}return S(e,null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===z&&(z=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),z.width=e.width,z.height=e.height;var r=z.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=z}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}]),e}(),U=0,W=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.DEFAULT_IMAGE,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:3e3;return x(this,r),e=t.call(this),Object.defineProperty(y(e),"id",{value:U++}),e.uuid=P(),e.name="",e.image=n,e.mipmaps=[],e.mapping=i,e.wrapS=o,e.wrapT=a,e.magFilter=s,e.minFilter=u,e.anisotropy=h,e.format=l,e.internalFormat=null,e.type=c,e.offset=new j(0,0),e.repeat=new j(1,1),e.center=new j(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new B,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.encoding=d,e.version=0,e.onUpdate=null,e}return S(r,[{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=P()),!t&&void 0===e.images[n.uuid]){var i;if(Array.isArray(n)){i=[];for(var o=0,a=n.length;o1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),r}(w);function G(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?F.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}W.DEFAULT_IMAGE=void 0,W.DEFAULT_MAPPING=300,W.prototype.isTexture=!0;var V=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;x(this,e),this.x=t,this.y=r,this.z=n,this.w=i}return S(e,[{key:"set",value:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,r=this.y,n=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*t+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*t+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*t+o[7]*r+o[11]*n+o[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,r,n,i,o=e.elements,a=o[0],s=o[4],u=o[8],l=o[1],c=o[5],h=o[9],d=o[2],f=o[6],p=o[10];if(Math.abs(s-l)<.01&&Math.abs(u-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+l)<.1&&Math.abs(u+d)<.1&&Math.abs(h+f)<.1&&Math.abs(a+c+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var v=(a+1)/2,g=(c+1)/2,m=(p+1)/2,y=(s+l)/4,_=(u+d)/4,b=(h+f)/4;return v>g&&v>m?v<.01?(r=0,n=.707106781,i=.707106781):(n=y/(r=Math.sqrt(v)),i=_/r):g>m?g<.01?(r=.707106781,n=0,i=.707106781):(r=y/(n=Math.sqrt(g)),i=b/n):m<.01?(r=.707106781,n=.707106781,i=0):(r=_/(i=Math.sqrt(m)),n=b/i),this.set(r,n,i,t),this}var x=Math.sqrt((f-h)*(f-h)+(u-d)*(u-d)+(l-s)*(l-s));return Math.abs(x)<.001&&(x=1),this.x=(f-h)/x,this.y=(u-d)/x,this.z=(l-s)/x,this.w=Math.acos((a+c+p-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}}]),e}();V.prototype.isVector4=!0;var H=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return x(this,r),(i=t.call(this)).width=e,i.height=n,i.depth=1,i.scissor=new V(0,0,e,n),i.scissorTest=!1,i.viewport=new V(0,0,e,n),i.texture=new W(void 0,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.encoding),i.texture.image={width:e,height:n,depth:1},i.texture.generateMipmaps=void 0!==o.generateMipmaps&&o.generateMipmaps,i.texture.minFilter=void 0!==o.minFilter?o.minFilter:1006,i.depthBuffer=void 0===o.depthBuffer||o.depthBuffer,i.stencilBuffer=void 0!==o.stencilBuffer&&o.stencilBuffer,i.depthTexture=void 0!==o.depthTexture?o.depthTexture:null,i}return S(r,[{key:"setTexture",value:function(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}},{key:"setSize",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.width===e&&this.height===t&&this.depth===r||(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=D({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),r}(w);H.prototype.isWebGLRenderTarget=!0,function(e){p(r,e);var t=g(r);function r(e,n,i){var o;x(this,r);var a=(o=t.call(this,e,n)).texture;o.texture=[];for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(var n=0,i=this.texture.length;n0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;x(this,e),this._x=t,this._y=r,this._z=n,this._w=i}return S(e,[{key:"set",value:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,u=a(r/2),l=a(n/2),c=a(i/2),h=s(r/2),d=s(n/2),f=s(i/2);switch(o){case"XYZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"YXZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"ZXY":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"ZYX":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"YZX":this._x=h*l*c+u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c-h*d*f;break;case"XZY":this._x=h*l*c-u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,r=t[0],n=t[4],i=t[8],o=t[1],a=t[5],s=t[9],u=t[2],l=t[6],c=t[10],h=r+a+c;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(l-s)*d,this._y=(i-u)*d,this._z=(o-n)*d}else if(r>a&&r>c){var f=2*Math.sqrt(1+r-a-c);this._w=(l-s)/f,this._x=.25*f,this._y=(n+o)/f,this._z=(i+u)/f}else if(a>c){var p=2*Math.sqrt(1+a-r-c);this._w=(i-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(s+l)/p}else{var v=2*Math.sqrt(1+c-r-a);this._w=(o-n)/v,this._x=(i+u)/v,this._y=(s+l)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(N(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var r=this.angleTo(e);if(0===r)return this;var n=Math.min(1,t/r);return this.slerp(e,n),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var r=e._x,n=e._y,i=e._z,o=e._w,a=t._x,s=t._y,u=t._z,l=t._w;return this._x=r*l+o*a+n*u-i*s,this._y=n*l+o*s+i*a-r*u,this._z=i*l+o*u+r*s-n*a,this._w=o*l-r*a-n*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*e._w+r*e._x+n*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=n,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-t;return this._w=u*o+t*this._w,this._x=u*r+t*this._x,this._y=u*n+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),c=Math.atan2(l,a),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=o*h+this._w*d,this._x=r*h+this._x*d,this._y=n*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,r){this.copy(e).slerp(t,r)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}],[{key:"slerp",value:function(e,t,r,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),r.slerpQuaternions(e,t,n)}},{key:"slerpFlat",value:function(e,t,r,n,i,o,a){var s=r[n+0],u=r[n+1],l=r[n+2],c=r[n+3],h=i[o+0],d=i[o+1],f=i[o+2],p=i[o+3];if(0===a)return e[t+0]=s,e[t+1]=u,e[t+2]=l,void(e[t+3]=c);if(1===a)return e[t+0]=h,e[t+1]=d,e[t+2]=f,void(e[t+3]=p);if(c!==p||s!==h||u!==d||l!==f){var v=1-a,g=s*h+u*d+l*f+c*p,m=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var _=Math.sqrt(y),b=Math.atan2(_,g*m);v=Math.sin(v*b)/_,a=Math.sin(a*b)/_}var x=a*m;if(s=s*v+h*x,u=u*v+d*x,l=l*v+f*x,c=c*v+p*x,v===1-a){var w=1/Math.sqrt(s*s+u*u+l*l+c*c);s*=w,u*=w,l*=w,c*=w}}e[t]=s,e[t+1]=u,e[t+2]=l,e[t+3]=c}},{key:"multiplyQuaternionsFlat",value:function(e,t,r,n,i,o){var a=r[n],s=r[n+1],u=r[n+2],l=r[n+3],c=i[o],h=i[o+1],d=i[o+2],f=i[o+3];return e[t]=a*f+l*c+s*d-u*h,e[t+1]=s*f+l*h+u*c-a*d,e[t+2]=u*f+l*d+a*h-s*c,e[t+3]=l*f-a*c-s*h-u*d,e}}]),e}();$.prototype.isQuaternion=!0;var X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;x(this,e),this.x=t,this.y=r,this.z=n}return S(e,[{key:"set",value:function(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Q.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(Q.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,o=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*o,this}},{key:"applyQuaternion",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=e.w,u=s*t+o*n-a*r,l=s*r+a*t-i*n,c=s*n+i*r-o*t,h=-i*t-o*r-a*n;return this.x=u*s+h*-i+l*-a-c*-o,this.y=l*s+h*-o+c*-i-u*-a,this.z=c*s+h*-a+u*-o-l*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var r=e.x,n=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}},{key:"projectOnPlane",value:function(e){return q.copy(this).projectOnVector(e),this.sub(q)}},{key:"reflect",value:function(e){return this.sub(q.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var r=this.dot(e)/t;return Math.acos(N(r,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,r){var n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),e}();X.prototype.isVector3=!0;var q=new X,Q=new $,Z=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X(1/0,1/0,1/0),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X(-1/0,-1/0,-1/0);x(this,e),this.min=t,this.max=r}return S(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.length;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,r,n),this.max.set(i,o,a),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.count;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,r,n),this.max.set(i,o,a),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,J),J.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(se),ue.subVectors(this.max,se),te.subVectors(e.a,se),re.subVectors(e.b,se),ne.subVectors(e.c,se),ie.subVectors(re,te),oe.subVectors(ne,re),ae.subVectors(te,ne);var t=[0,-ie.z,ie.y,0,-oe.z,oe.y,0,-ae.z,ae.y,ie.z,0,-ie.x,oe.z,0,-oe.x,ae.z,0,-ae.x,-ie.y,ie.x,0,-oe.y,oe.x,0,-ae.y,ae.x,0];return!!he(t,te,re,ne,ue)&&(!!he(t=[1,0,0,0,1,0,0,0,1],te,re,ne,ue)&&(le.crossVectors(ie,oe),he(t=[le.x,le.y,le.z],te,re,ne,ue)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return J.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return this.getCenter(e.center),e.radius=.5*this.getSize(J).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(K[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),K[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),K[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),K[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),K[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),K[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),K[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),K[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(K)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}();Z.prototype.isBox3=!0;var K=[new X,new X,new X,new X,new X,new X,new X,new X],J=new X,ee=new Z,te=new X,re=new X,ne=new X,ie=new X,oe=new X,ae=new X,se=new X,ue=new X,le=new X,ce=new X;function he(e,t,r,n,i){for(var o=0,a=e.length-3;o<=a;o+=3){ce.fromArray(e,o);var s=i.x*Math.abs(ce.x)+i.y*Math.abs(ce.y)+i.z*Math.abs(ce.z),u=t.dot(ce),l=r.dot(ce),c=n.dot(ce);if(Math.max(-Math.max(u,l,c),Math.min(u,l,c))>s)return!1}return!0}var de=new Z,fe=new X,pe=new X,ve=new X,ge=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;x(this,e),this.center=t,this.radius=r}return S(e,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var r=this.center;void 0!==t?r.copy(t):de.setFromPoints(e).getCenter(r);for(var n=0,i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){ve.subVectors(e,this.center);var t=ve.lengthSq();if(t>this.radius*this.radius){var r=Math.sqrt(t),n=.5*(r-this.radius);this.center.add(ve.multiplyScalar(n/r)),this.radius+=n}return this}},{key:"union",value:function(e){return pe.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(fe.copy(e.center).add(pe)),this.expandByPoint(fe.copy(e.center).sub(pe)),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),me=new X,ye=new X,_e=new X,be=new X,xe=new X,we=new X,Se=new X,Te=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X(0,0,-1);x(this,e),this.origin=t,this.direction=r}return S(e,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,me)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=me.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(me.copy(this.direction).multiplyScalar(t).add(this.origin),me.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,r,n){ye.copy(e).add(t).multiplyScalar(.5),_e.copy(t).sub(e).normalize(),be.copy(this.origin).sub(ye);var i,o,a,s,u=.5*e.distanceTo(t),l=-this.direction.dot(_e),c=be.dot(this.direction),h=-be.dot(_e),d=be.lengthSq(),f=Math.abs(1-l*l);if(f>0)if(o=l*c-h,s=u*f,(i=l*h-c)>=0)if(o>=-s)if(o<=s){var p=1/f;a=(i*=p)*(i+l*(o*=p)+2*c)+o*(l*i+o+2*h)+d}else o=u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o=-u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-l*u+c)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+d):a=-(i=Math.max(0,-(l*u+c)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d;else o=l>0?-u:u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;return r&&r.copy(this.direction).multiplyScalar(i).add(this.origin),n&&n.copy(_e).multiplyScalar(o).add(ye),a}},{key:"intersectSphere",value:function(e,t){me.subVectors(e.center,this.origin);var r=me.dot(this.direction),n=me.dot(me)-r*r,i=e.radius*e.radius;if(n>i)return null;var o=Math.sqrt(i-n),a=r-o,s=r+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}},{key:"intersectPlane",value:function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var r,n,i,o,a,s,u=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,h=this.origin;return u>=0?(r=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(r=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),l>=0?(i=(e.min.y-h.y)*l,o=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,o=(e.min.y-h.y)*l),r>o||i>n?null:((i>r||r!=r)&&(r=i),(o=0?(a=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(a=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),r>s||a>n?null:((a>r||r!=r)&&(r=a),(s=0?r:n,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,me)}},{key:"intersectTriangle",value:function(e,t,r,n,i){xe.subVectors(t,e),we.subVectors(r,e),Se.crossVectors(xe,we);var o,a=this.direction.dot(Se);if(a>0){if(n)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}be.subVectors(this.origin,e);var s=o*this.direction.dot(we.crossVectors(be,we));if(s<0)return null;var u=o*this.direction.dot(xe.cross(be));if(u<0)return null;if(s+u>a)return null;var l=-o*be.dot(Se);return l<0?null:this.at(l/a,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),Me=function(){function e(){x(this,e),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return S(e,[{key:"set",value:function(e,t,r,n,i,o,a,s,u,l,c,h,d,f,p,v){var g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=u,g[6]=l,g[10]=c,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,r=e.elements,n=1/ke.setFromMatrixColumn(e,0).length(),i=1/ke.setFromMatrixColumn(e,1).length(),o=1/ke.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,o=Math.cos(r),a=Math.sin(r),s=Math.cos(n),u=Math.sin(n),l=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=o*l,d=o*c,f=a*l,p=a*c;t[0]=s*l,t[4]=-s*c,t[8]=u,t[1]=d+f*u,t[5]=h-p*u,t[9]=-a*s,t[2]=p-h*u,t[6]=f+d*u,t[10]=o*s}else if("YXZ"===e.order){var v=s*l,g=s*c,m=u*l,y=u*c;t[0]=v+y*a,t[4]=m*a-g,t[8]=o*u,t[1]=o*c,t[5]=o*l,t[9]=-a,t[2]=g*a-m,t[6]=y+v*a,t[10]=o*s}else if("ZXY"===e.order){var _=s*l,b=s*c,x=u*l,w=u*c;t[0]=_-w*a,t[4]=-o*c,t[8]=x+b*a,t[1]=b+x*a,t[5]=o*l,t[9]=w-_*a,t[2]=-o*u,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var S=o*l,T=o*c,M=a*l,k=a*c;t[0]=s*l,t[4]=M*u-T,t[8]=S*u+k,t[1]=s*c,t[5]=k*u+S,t[9]=T*u-M,t[2]=-u,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var E=o*s,A=o*u,I=a*s,C=a*u;t[0]=s*l,t[4]=C-E*c,t[8]=I*c+A,t[1]=c,t[5]=o*l,t[9]=-a*l,t[2]=-u*l,t[6]=A*c+I,t[10]=E-C*c}else if("XZY"===e.order){var P=o*s,N=o*u,O=a*s,R=a*u;t[0]=s*l,t[4]=-c,t[8]=u*l,t[1]=P*c+R,t[5]=o*l,t[9]=N*c-O,t[2]=O*c-N,t[6]=a*l,t[10]=R*c+P}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Ae,e,Ie)}},{key:"lookAt",value:function(e,t,r){var n=this.elements;return Ne.subVectors(e,t),0===Ne.lengthSq()&&(Ne.z=1),Ne.normalize(),Ce.crossVectors(r,Ne),0===Ce.lengthSq()&&(1===Math.abs(r.z)?Ne.x+=1e-4:Ne.z+=1e-4,Ne.normalize(),Ce.crossVectors(r,Ne)),Ce.normalize(),Pe.crossVectors(Ne,Ce),n[0]=Ce.x,n[4]=Pe.x,n[8]=Ne.x,n[1]=Ce.y,n[5]=Pe.y,n[9]=Ne.y,n[2]=Ce.z,n[6]=Pe.z,n[10]=Ne.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[4],s=r[8],u=r[12],l=r[1],c=r[5],h=r[9],d=r[13],f=r[2],p=r[6],v=r[10],g=r[14],m=r[3],y=r[7],_=r[11],b=r[15],x=n[0],w=n[4],S=n[8],T=n[12],M=n[1],k=n[5],E=n[9],A=n[13],I=n[2],C=n[6],P=n[10],N=n[14],O=n[3],R=n[7],D=n[11],L=n[15];return i[0]=o*x+a*M+s*I+u*O,i[4]=o*w+a*k+s*C+u*R,i[8]=o*S+a*E+s*P+u*D,i[12]=o*T+a*A+s*N+u*L,i[1]=l*x+c*M+h*I+d*O,i[5]=l*w+c*k+h*C+d*R,i[9]=l*S+c*E+h*P+d*D,i[13]=l*T+c*A+h*N+d*L,i[2]=f*x+p*M+v*I+g*O,i[6]=f*w+p*k+v*C+g*R,i[10]=f*S+p*E+v*P+g*D,i[14]=f*T+p*A+v*N+g*L,i[3]=m*x+y*M+_*I+b*O,i[7]=m*w+y*k+_*C+b*R,i[11]=m*S+y*E+_*P+b*D,i[15]=m*T+y*A+_*N+b*L,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],o=e[1],a=e[5],s=e[9],u=e[13],l=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+i*s*c-n*u*c-i*a*h+r*u*h+n*a*d-r*s*d)+e[7]*(+t*s*d-t*u*h+i*o*h-n*o*d+n*u*l-i*s*l)+e[11]*(+t*u*c-t*a*d-i*o*c+r*o*d+i*a*l-r*u*l)+e[15]*(-n*a*l-t*s*c+t*a*h+n*o*c-r*o*h+r*s*l)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,r){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],d=e[11],f=e[12],p=e[13],v=e[14],g=e[15],m=c*v*u-p*h*u+p*s*d-a*v*d-c*s*g+a*h*g,y=f*h*u-l*v*u-f*s*d+o*v*d+l*s*g-o*h*g,_=l*p*u-f*c*u+f*a*d-o*p*d-l*a*g+o*c*g,b=f*c*s-l*p*s-f*a*h+o*p*h+l*a*v-o*c*v,x=t*m+r*y+n*_+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var w=1/x;return e[0]=m*w,e[1]=(p*h*i-c*v*i-p*n*d+r*v*d+c*n*g-r*h*g)*w,e[2]=(a*v*i-p*s*i+p*n*u-r*v*u-a*n*g+r*s*g)*w,e[3]=(c*s*i-a*h*i-c*n*u+r*h*u+a*n*d-r*s*d)*w,e[4]=y*w,e[5]=(l*v*i-f*h*i+f*n*d-t*v*d-l*n*g+t*h*g)*w,e[6]=(f*s*i-o*v*i-f*n*u+t*v*u+o*n*g-t*s*g)*w,e[7]=(o*h*i-l*s*i+l*n*u-t*h*u-o*n*d+t*s*d)*w,e[8]=_*w,e[9]=(f*c*i-l*p*i-f*r*d+t*p*d+l*r*g-t*c*g)*w,e[10]=(o*p*i-f*a*i+f*r*u-t*p*u-o*r*g+t*a*g)*w,e[11]=(l*a*i-o*c*i-l*r*u+t*c*u+o*r*d-t*a*d)*w,e[12]=b*w,e[13]=(l*p*n-f*c*n+f*r*h-t*p*h-l*r*v+t*c*v)*w,e[14]=(f*a*n-o*p*n-f*r*s+t*p*s+o*r*v-t*a*v)*w,e[15]=(o*c*n-l*a*n+l*r*s-t*c*s-o*r*h+t*a*h)*w,this}},{key:"scale",value:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))}},{key:"makeTranslation",value:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=1-r,o=e.x,a=e.y,s=e.z,u=i*o,l=i*a;return this.set(u*o+r,u*a-n*s,u*s+n*a,0,u*a+n*s,l*a+r,l*s-n*o,0,u*s-n*a,l*s+n*o,i*s*s+r,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,r,n,i,o){return this.set(1,r,i,0,e,1,o,0,t,n,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,r){var n=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,u=i+i,l=o+o,c=a+a,h=i*u,d=i*l,f=i*c,p=o*l,v=o*c,g=a*c,m=s*u,y=s*l,_=s*c,b=r.x,x=r.y,w=r.z;return n[0]=(1-(p+g))*b,n[1]=(d+_)*b,n[2]=(f-y)*b,n[3]=0,n[4]=(d-_)*x,n[5]=(1-(h+g))*x,n[6]=(v+m)*x,n[7]=0,n[8]=(f+y)*w,n[9]=(v-m)*w,n[10]=(1-(h+p))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}},{key:"decompose",value:function(e,t,r){var n=this.elements,i=ke.set(n[0],n[1],n[2]).length(),o=ke.set(n[4],n[5],n[6]).length(),a=ke.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],Ee.copy(this);var s=1/i,u=1/o,l=1/a;return Ee.elements[0]*=s,Ee.elements[1]*=s,Ee.elements[2]*=s,Ee.elements[4]*=u,Ee.elements[5]*=u,Ee.elements[6]*=u,Ee.elements[8]*=l,Ee.elements[9]*=l,Ee.elements[10]*=l,t.setFromRotationMatrix(Ee),r.x=i,r.y=o,r.z=a,this}},{key:"makePerspective",value:function(e,t,r,n,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),u=2*i/(r-n),l=(t+e)/(t-e),c=(r+n)/(r-n),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=u,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}},{key:"makeOrthographic",value:function(e,t,r,n,i,o){var a=this.elements,s=1/(t-e),u=1/(r-n),l=1/(o-i),c=(t+e)*s,h=(r+n)*u,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,r=e.elements,n=0;n<16;n++)if(t[n]!==r[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<16;r++)this.elements[r]=e[r+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}]),e}();Me.prototype.isMatrix4=!0;var ke=new X,Ee=new Me,Ae=new X(0,0,0),Ie=new X(1,1,1),Ce=new X,Pe=new X,Ne=new X,Oe=new Me,Re=new $,De=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;x(this,e),this._x=t,this._y=r,this._z=n,this._order=i}return S(e,[{key:"set",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=r,this._order=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.elements,i=n[0],o=n[4],a=n[8],s=n[1],u=n[5],l=n[9],c=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(N(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-N(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(s,u)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(N(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-N(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(N(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-N(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,r){return Oe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Oe,t,r)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return Re.setFromEuler(this),this.setFromQuaternion(Re,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new X(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}]),e}();De.prototype.isEuler=!0,De.DefaultOrder="XYZ",De.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Le=function(){function e(){x(this,e),this.mask=1}return S(e,[{key:"set",value:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){n.children=[];for(var f=0;f0){n.animations=[];for(var p=0;p0&&(r.geometries=g),m.length>0&&(r.materials=m),y.length>0&&(r.textures=y),_.length>0&&(r.images=_),b.length>0&&(r.shapes=b),x.length>0&&(r.skeletons=x),w.length>0&&(r.animations=w)}return r.object=n,r;function S(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:new X,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new X;x(this,e),this.a=t,this.b=r,this.c=n}return S(e,[{key:"set",value:function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}},{key:"setFromPointsAndIndices",value:function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return Ze.subVectors(this.c,this.b),Ke.subVectors(this.a,this.b),.5*Ze.cross(Ke).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,r){return e.getBarycoord(t,this.a,this.b,this.c,r)}},{key:"getUV",value:function(t,r,n,i,o){return e.getUV(t,this.a,this.b,this.c,r,n,i,o)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var r,n,i=this.a,o=this.b,a=this.c;tt.subVectors(o,i),rt.subVectors(a,i),it.subVectors(e,i);var s=tt.dot(it),u=rt.dot(it);if(s<=0&&u<=0)return t.copy(i);ot.subVectors(e,o);var l=tt.dot(ot),c=rt.dot(ot);if(l>=0&&c<=l)return t.copy(o);var h=s*c-l*u;if(h<=0&&s>=0&&l<=0)return r=s/(s-l),t.copy(i).addScaledVector(tt,r);at.subVectors(e,a);var d=tt.dot(at),f=rt.dot(at);if(f>=0&&d<=f)return t.copy(a);var p=d*u-s*f;if(p<=0&&u>=0&&f<=0)return n=u/(u-f),t.copy(i).addScaledVector(rt,n);var v=l*f-d*c;if(v<=0&&c-l>=0&&d-f>=0)return nt.subVectors(a,o),n=(c-l)/(c-l+(d-f)),t.copy(o).addScaledVector(nt,n);var g=1/(v+p+h);return r=p*g,n=h*g,t.copy(i).addScaledVector(tt,r).addScaledVector(rt,n)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,r,n){n.subVectors(r,t),Ze.subVectors(e,t),n.cross(Ze);var i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,r,n,i){Ze.subVectors(n,t),Ke.subVectors(r,t),Je.subVectors(e,t);var o=Ze.dot(Ze),a=Ze.dot(Ke),s=Ze.dot(Je),u=Ke.dot(Ke),l=Ke.dot(Je),c=o*u-a*a;if(0===c)return i.set(-2,-1,-1);var h=1/c,d=(u*s-a*l)*h,f=(o*l-a*s)*h;return i.set(1-d-f,f,d)}},{key:"containsPoint",value:function(e,t,r,n){return this.getBarycoord(e,t,r,n,et),et.x>=0&&et.y>=0&&et.x+et.y<=1}},{key:"getUV",value:function(e,t,r,n,i,o,a,s){return this.getBarycoord(e,t,r,n,et),s.set(0,0),s.addScaledVector(i,et.x),s.addScaledVector(o,et.y),s.addScaledVector(a,et.z),s}},{key:"isFrontFacing",value:function(e,t,r,n){return Ze.subVectors(r,t),Ke.subVectors(e,t),Ze.cross(Ke).dot(n)<0}}]),e}(),ut=0,lt=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),e=t.call(this),Object.defineProperty(y(e),"id",{value:ut++}),e.uuid=P(),e.name="",e.type="Material",e.fog=!0,e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=7680,e.stencilZFail=7680,e.stencilZPass=7680,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaTest=0,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e}return S(r,[{key:"onBuild",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var r=e[t];if(void 0!==r)if("shading"!==t){var n=this[t];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===r;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(r.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(r.blending=this.blending),0!==this.side&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(r.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.morphNormals&&(r.morphNormals=!0),!0===this.flatShading&&(r.flatShading=this.flatShading),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),t){var i=n(e.textures),o=n(e.images);i.length>0&&(r.textures=i),o.length>0&&(r.images=o)}return r}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,r=null;if(null!==t){var n=t.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=t[i].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),r}(w);lt.prototype.isMaterial=!0;var ct={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ht={h:0,s:0,l:0},dt={h:0,s:0,l:0};function ft(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}function pt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var gt=function(){function e(t,r,n){return x(this,e),void 0===r&&void 0===n?this.set(t):this.setRGB(t,r,n)}return S(e,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,r){return this.r=e,this.g=t,this.b=r,this}},{key:"setHSL",value:function(e,t,r){if(e=function(e,t){return(e%t+t)%t}(e,1),t=N(t,0,1),r=N(r,0,1),0===t)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=ft(i,n,e+1/3),this.g=ft(i,n,e),this.b=ft(i,n,e-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){var n,i=r[1],o=r[2];switch(i){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[4]),this;if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[4]),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){var a=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,u=parseInt(n[3],10)/100;return t(n[4]),this.setHSL(a,s,u)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){var l=r[1],c=l.length;if(3===c)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}},{key:"setColorName",value:function(e){var t=ct[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=pt(e.r),this.g=pt(e.g),this.b=pt(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=vt(e.r),this.g=vt(e.g),this.b=vt(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t,r,n=this.r,i=this.g,o=this.b,a=Math.max(n,i,o),s=Math.min(n,i,o),u=(s+a)/2;if(s===a)t=0,r=0;else{var l=a-s;switch(r=u<=.5?l/(a+s):l/(2-a-s),a){case n:t=(i-o)/l+(i1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),e}();gt.NAMES=ct,gt.prototype.isColor=!0,gt.prototype.r=1,gt.prototype.g=1,gt.prototype.b=1;var mt=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="MeshBasicMaterial",n.color=new gt(16777215),n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.combine=0,n.reflectivity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.morphTargets=!1,n.setValues(e),n}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this}}]),r}(lt);mt.prototype.isMeshBasicMaterial=!0;var yt=new X,_t=new j,bt=function(){function e(t,r,n){if(x(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=r,this.count=void 0!==t?t.length/r:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}return S(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,r){e*=this.itemSize,r*=t.itemSize;for(var n=0,i=this.itemSize;n1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getX",value:function(e){return this.array[e*this.itemSize]}},{key:"setX",value:function(e,t){return this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){return this.array[e*this.itemSize+1]}},{key:"setY",value:function(e,t){return this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){return this.array[e*this.itemSize+2]}},{key:"setZ",value:function(e,t){return this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){return this.array[e*this.itemSize+3]}},{key:"setW",value:function(e,t){return this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this}},{key:"setXYZ",value:function(e,t,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this}},{key:"setXYZW",value:function(e,t,r,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();bt.prototype.isBufferAttribute=!0;var xt=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Uint16Array(e),n,i)}return r}(bt),wt=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Int32Array(e),n,i)}return r}(bt),St=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Uint32Array(e),n,i)}return r}(bt);(function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Uint16Array(e),n,i)}return r})(bt).prototype.isFloat16BufferAttribute=!0;var Tt=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,new Float32Array(e),n,i)}return r}(bt);function Mt(e){if(0===e.length)return-1/0;for(var t=e[0],r=1,n=e.length;rt&&(t=e[r]);return t}var kt=0,Et=new Me,At=new Qe,It=new X,Ct=new Z,Pt=new Z,Nt=new X,Ot=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),e=t.call(this),Object.defineProperty(y(e),"id",{value:kt++}),e.uuid=P(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return S(r,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(Mt(e)>65535?St:xt)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:r})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var n=(new B).getNormalMatrix(e);r.applyNormalMatrix(n),r.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return Et.makeRotationFromQuaternion(e),this.applyMatrix4(Et),this}},{key:"rotateX",value:function(e){return Et.makeRotationX(e),this.applyMatrix4(Et),this}},{key:"rotateY",value:function(e){return Et.makeRotationY(e),this.applyMatrix4(Et),this}},{key:"rotateZ",value:function(e){return Et.makeRotationZ(e),this.applyMatrix4(Et),this}},{key:"translate",value:function(e,t,r){return Et.makeTranslation(e,t,r),this.applyMatrix4(Et),this}},{key:"scale",value:function(e,t,r){return Et.makeScale(e,t,r),this.applyMatrix4(Et),this}},{key:"lookAt",value:function(e){return At.lookAt(e),At.updateMatrix(),this.applyMatrix4(At.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(It).negate(),this.translate(It.x,It.y,It.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],r=0,n=e.length;r0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var i=this.attributes;for(var o in i){var a=i[o];e.data.attributes[o]=a.toJSON(e.data)}var s={},u=!1;for(var l in this.morphAttributes){for(var c=this.morphAttributes[l],h=[],d=0,f=c.length;d0&&(s[l]=h,u=!0)}u&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;v.length>0&&(e.data.groups=JSON.parse(JSON.stringify(v)));var g=this.boundingSphere;return null!==g&&(e.data.boundingSphere={center:g.center.toArray(),radius:g.radius}),e}},{key:"clone",value:function(){return(new r).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone(t));var n=e.attributes;for(var i in n){var o=n[i];this.setAttribute(i,o.clone(t))}var a=e.morphAttributes;for(var s in a){for(var u=[],l=a[s],c=0,h=l.length;c0&&void 0!==arguments[0]?arguments[0]:new Ot,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mt;return x(this,r),(e=t.call(this)).type="Mesh",e.geometry=n,e.material=i,e.updateMorphTargets(),e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,r=Object.keys(t);if(r.length>0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=n.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"raycast",value:function(e,t){var r,n=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===n.boundingSphere&&n.computeBoundingSphere(),Lt.copy(n.boundingSphere),Lt.applyMatrix4(o),!1!==e.ray.intersectsSphere(Lt)&&(Rt.copy(o).invert(),Dt.copy(e.ray).applyMatrix4(Rt),null===n.boundingBox||!1!==Dt.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var a=n.index,s=n.attributes.position,u=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,h=n.attributes.uv2,d=n.groups,f=n.drawRange;if(null!==a)if(Array.isArray(i))for(var p=0,v=d.length;pr.far?null:{distance:u,point:Qt.clone(),object:e}}(e,t,r,n,jt,zt,Bt,qt);if(m){s&&(Yt.fromBufferAttribute(s,l),$t.fromBufferAttribute(s,c),Xt.fromBufferAttribute(s,h),m.uv=st.getUV(qt,jt,zt,Bt,Yt,$t,Xt,new j)),u&&(Yt.fromBufferAttribute(u,l),$t.fromBufferAttribute(u,c),Xt.fromBufferAttribute(u,h),m.uv2=st.getUV(qt,jt,zt,Bt,Yt,$t,Xt,new j));var y={a:l,b:c,c:h,normal:new X,materialIndex:0};st.getNormal(jt,zt,Bt,y.normal),m.face=y}return m}Zt.prototype.isMesh=!0;var Jt=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;x(this,r),(e=t.call(this)).type="BoxGeometry",e.parameters={width:n,height:i,depth:o,widthSegments:a,heightSegments:s,depthSegments:u};var l=y(e);a=Math.floor(a),s=Math.floor(s),u=Math.floor(u);var c=[],h=[],d=[],f=[],p=0,v=0;function g(e,t,r,n,i,o,a,s,u,g,m){for(var y=o/u,_=a/g,b=o/2,x=a/2,w=s/2,S=u+1,T=g+1,M=0,k=0,E=new X,A=0;A0?1:-1,d.push(E.x,E.y,E.z),f.push(C/u),f.push(1-A/g),M+=1}for(var N=0;N0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var o={};for(var a in this.extensions)!0===this.extensions[a]&&(o[a]=!0);return Object.keys(o).length>0&&(t.extensions=o),t}}]),r}(lt);nr.prototype.isShaderMaterial=!0;var ir=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="Camera",e.matrixWorldInverse=new Me,e.projectionMatrix=new Me,e.projectionMatrixInverse=new Me,e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(e){f(b(r.prototype),"updateMatrixWorld",this).call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,t){f(b(r.prototype),"updateWorldMatrix",this).call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),r}(Qe);ir.prototype.isCamera=!0;var or=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;return x(this,r),(e=t.call(this)).type="PerspectiveCamera",e.fov=n,e.zoom=1,e.near=o,e.far=a,e.focus=10,e.aspect=i,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}},{key:"setFocalLength",value:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*C*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*I*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*C*Math.atan(Math.tan(.5*I*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"setViewOffset",value:function(e,t,r,n,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,t=e*Math.tan(.5*I*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*n/a,t-=o.offsetY*r/s,n*=o.width/a,r*=o.height/s}var u=this.filmOffset;0!==u&&(i+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}]),r}(ir);or.prototype.isPerspectiveCamera=!0;var ar=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;if(x(this,r),(o=t.call(this)).type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return m(o,void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."));o.renderTarget=i;var a=new or(90,1,e,n);a.layers=o.layers,a.up.set(0,-1,0),a.lookAt(new X(1,0,0)),o.add(a);var s=new or(90,1,e,n);s.layers=o.layers,s.up.set(0,-1,0),s.lookAt(new X(-1,0,0)),o.add(s);var u=new or(90,1,e,n);u.layers=o.layers,u.up.set(0,0,1),u.lookAt(new X(0,1,0)),o.add(u);var l=new or(90,1,e,n);l.layers=o.layers,l.up.set(0,0,-1),l.lookAt(new X(0,-1,0)),o.add(l);var c=new or(90,1,e,n);c.layers=o.layers,c.up.set(0,-1,0),c.lookAt(new X(0,0,1)),o.add(c);var h=new or(90,1,e,n);return h.layers=o.layers,h.up.set(0,-1,0),h.lookAt(new X(0,0,-1)),o.add(h),m(o)}return S(r,[{key:"update",value:function(e,t){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,n=c(this.children,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],l=n[5],h=e.xr.enabled,d=e.getRenderTarget();e.xr.enabled=!1;var f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,o),e.setRenderTarget(r,2),e.render(t,a),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,u),r.texture.generateMipmaps=f,e.setRenderTarget(r,5),e.render(t,l),e.setRenderTarget(d),e.xr.enabled=h}}]),r}(Qe),sr=function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c,h){var d;return x(this,r),(d=t.call(this,e=void 0!==e?e:[],n=void 0!==n?n:301,i,o,a,s,u=void 0!==u?u:1022,l,c,h))._needsFlipEnvMap=!0,d.flipY=!1,d}return S(r,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}]),r}(W);sr.prototype.isCubeTexture=!0;var ur=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),Number.isInteger(n)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),n=i),o=t.call(this,e,e,n),n=n||{},o.texture=new sr(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),o.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,o.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,o.texture._needsFlipEnvMap=!1,o}return S(r,[{key:"fromEquirectangularTexture",value:function(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var r={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new Jt(5,5,5),a=new nr({name:"CubemapFromEquirect",uniforms:er(r),vertexShader:n,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;var s=new Zt(o,a),u=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new ar(1,10,this).update(e,s),t.minFilter=u,s.geometry.dispose(),s.material.dispose(),this}},{key:"clear",value:function(e,t,r,n){for(var i=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,n);e.setRenderTarget(i)}}]),r}(H);ur.prototype.isWebGLCubeRenderTarget=!0;var lr=new X,cr=new X,hr=new B,dr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X(1,0,0),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;x(this,e),this.normal=t,this.constant=r}return S(e,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,r){var n=lr.subVectors(r,t).cross(cr.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(e,t){var r=e.delta(lr),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?null:t.copy(r).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var r=t||hr.getNormalMatrix(e),n=this.coplanarPoint(lr).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();dr.prototype.isPlane=!0;var fr=new ge,pr=new X,vr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new dr,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new dr,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new dr,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new dr,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new dr,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new dr;x(this,e),this.planes=[t,r,n,i,o,a]}return S(e,[{key:"set",value:function(e,t,r,n,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this}},{key:"copy",value:function(e){for(var t=this.planes,r=0;r<6;r++)t[r].copy(e.planes[r]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,r=e.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6],c=r[7],h=r[8],d=r[9],f=r[10],p=r[11],v=r[12],g=r[13],m=r[14],y=r[15];return t[0].setComponents(a-n,c-s,p-h,y-v).normalize(),t[1].setComponents(a+n,c+s,p+h,y+v).normalize(),t[2].setComponents(a+i,c+u,p+d,y+g).normalize(),t[3].setComponents(a-i,c-u,p-d,y-g).normalize(),t[4].setComponents(a-o,c-l,p-f,y-m).normalize(),t[5].setComponents(a+o,c+l,p+f,y+m).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),fr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(fr)}},{key:"intersectsSprite",value:function(e){return fr.center.set(0,0,0),fr.radius=.7071067811865476,fr.applyMatrix4(e.matrixWorld),this.intersectsSphere(fr)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,r=e.center,n=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(r)0?e.max.x:e.min.x,pr.y=n.normal.y>0?e.max.y:e.min.y,pr.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(pr)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();function gr(){var e=null,t=!1,r=null,n=null;function i(t,o){r(t,o),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function mr(e,t){var r=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var o=n.get(t);(!o||o.version0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;x(this,r),(e=t.call(this)).type="PlaneGeometry",e.parameters={width:n,height:i,widthSegments:o,heightSegments:a};for(var s=n/2,u=i/2,l=Math.floor(o),c=Math.floor(a),h=l+1,d=c+1,f=n/l,p=i/c,v=[],g=[],m=[],y=[],_=0;_ 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSNMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition.xyz / vWorldPosition.w;\n\tvec3 v = normalize( cameraPosition - pos );\n\tfloat ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity );\n\tvec3 transmission = transmissionFactor * getIBLVolumeRefraction(\n\t\tnormal, v, roughnessFactor, material.diffuseColor, totalSpecular,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec4 vWorldPosition;\n\tvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) {\n\t\tvec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length(vec3(modelMatrix[0].xyz));\n\t\tmodelScale.y = length(vec3(modelMatrix[1].xyz));\n\t\tmodelScale.z = length(vec3(modelMatrix[2].xyz));\n\t\treturn normalize(refractionVector) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness(float roughness, float ior) {\n\t\treturn roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n\t}\n\tvec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) {\n\t\tfloat framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior);\n\t\treturn texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb;\n\t}\n\tvec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) {\n\t\tif (attenuationDistance == 0.0) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance;\n\t\t\tvec3 transmittance = exp(-attenuationCoefficient * transmissionDistance);\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix);\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0);\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior);\n\t\tvec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance);\n\t\treturn (1.0 - specularColor) * attenuatedColor * baseColor;\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform vec3 attenuationColor;\n\tuniform float attenuationDistance;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#ifdef USE_TRANSMISSION\n\tvarying vec4 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition;\n#endif\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},br={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new B},uv2Transform:{value:new B},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new j(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new B}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new j(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new B}}},xr={basic:{uniforms:tr([br.common,br.specularmap,br.envmap,br.aomap,br.lightmap,br.fog]),vertexShader:_r.meshbasic_vert,fragmentShader:_r.meshbasic_frag},lambert:{uniforms:tr([br.common,br.specularmap,br.envmap,br.aomap,br.lightmap,br.emissivemap,br.fog,br.lights,{emissive:{value:new gt(0)}}]),vertexShader:_r.meshlambert_vert,fragmentShader:_r.meshlambert_frag},phong:{uniforms:tr([br.common,br.specularmap,br.envmap,br.aomap,br.lightmap,br.emissivemap,br.bumpmap,br.normalmap,br.displacementmap,br.fog,br.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:_r.meshphong_vert,fragmentShader:_r.meshphong_frag},standard:{uniforms:tr([br.common,br.envmap,br.aomap,br.lightmap,br.emissivemap,br.bumpmap,br.normalmap,br.displacementmap,br.roughnessmap,br.metalnessmap,br.fog,br.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_r.meshphysical_vert,fragmentShader:_r.meshphysical_frag},toon:{uniforms:tr([br.common,br.aomap,br.lightmap,br.emissivemap,br.bumpmap,br.normalmap,br.displacementmap,br.gradientmap,br.fog,br.lights,{emissive:{value:new gt(0)}}]),vertexShader:_r.meshtoon_vert,fragmentShader:_r.meshtoon_frag},matcap:{uniforms:tr([br.common,br.bumpmap,br.normalmap,br.displacementmap,br.fog,{matcap:{value:null}}]),vertexShader:_r.meshmatcap_vert,fragmentShader:_r.meshmatcap_frag},points:{uniforms:tr([br.points,br.fog]),vertexShader:_r.points_vert,fragmentShader:_r.points_frag},dashed:{uniforms:tr([br.common,br.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_r.linedashed_vert,fragmentShader:_r.linedashed_frag},depth:{uniforms:tr([br.common,br.displacementmap]),vertexShader:_r.depth_vert,fragmentShader:_r.depth_frag},normal:{uniforms:tr([br.common,br.bumpmap,br.normalmap,br.displacementmap,{opacity:{value:1}}]),vertexShader:_r.normal_vert,fragmentShader:_r.normal_frag},sprite:{uniforms:tr([br.sprite,br.fog]),vertexShader:_r.sprite_vert,fragmentShader:_r.sprite_frag},background:{uniforms:{uvTransform:{value:new B},t2D:{value:null}},vertexShader:_r.background_vert,fragmentShader:_r.background_frag},cube:{uniforms:tr([br.envmap,{opacity:{value:1}}]),vertexShader:_r.cube_vert,fragmentShader:_r.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_r.equirect_vert,fragmentShader:_r.equirect_frag},distanceRGBA:{uniforms:tr([br.common,br.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_r.distanceRGBA_vert,fragmentShader:_r.distanceRGBA_frag},shadow:{uniforms:tr([br.lights,br.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:_r.shadow_vert,fragmentShader:_r.shadow_frag}};function wr(e,t,r,n,i){var o,a,s=new gt(0),u=0,l=null,c=0,h=null;function d(e,t){r.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(e),d(s,u=t)},getClearAlpha:function(){return u},setClearAlpha:function(e){d(s,u=e)},render:function(r,i){var f=!1,p=!0===i.isScene?i.background:null;p&&p.isTexture&&(p=t.get(p));var v=e.xr,g=v.getSession&&v.getSession();g&&"additive"===g.environmentBlendMode&&(p=null),null===p?d(s,u):p&&p.isColor&&(d(p,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&(p.isCubeTexture||306===p.mapping)?(void 0===a&&((a=new Zt(new Jt(1,1,1),new nr({name:"BackgroundCubeMaterial",uniforms:er(xr.cube.uniforms),vertexShader:xr.cube.vertexShader,fragmentShader:xr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),a.material.uniforms.envMap.value=p,a.material.uniforms.flipEnvMap.value=p.isCubeTexture&&p._needsFlipEnvMap?-1:1,l===p&&c===p.version&&h===e.toneMapping||(a.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),r.unshift(a,a.geometry,a.material,0,0,null)):p&&p.isTexture&&(void 0===o&&((o=new Zt(new yr(2,2),new nr({name:"BackgroundMaterial",uniforms:er(xr.background.uniforms),vertexShader:xr.background.vertexShader,fragmentShader:xr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),o.material.uniforms.uvTransform.value.copy(p.matrix),l===p&&c===p.version&&h===e.toneMapping||(o.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),r.unshift(o,o.geometry,o.material,0,0,null))}}}function Sr(e,t,r,n){var i=e.getParameter(34921),o=n.isWebGL2?null:t.get("OES_vertex_array_object"),a=n.isWebGL2||null!==o,s={},u=d(null),l=u;function c(t){return n.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return n.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){for(var t=[],r=[],n=[],o=0;o=0){var y=u[h];if(void 0!==y){var _=y.normalized,b=y.itemSize,x=r.get(y);if(void 0===x)continue;var w=x.buffer,S=x.type,T=x.bytesPerElement;if(y.isInterleavedBufferAttribute){var M=y.data,k=M.stride,E=y.offset;M&&M.isInstancedInterleavedBuffer?(v(d,M.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=M.meshPerAttribute*M.count)):p(d),e.bindBuffer(34962,w),m(d,b,S,_,k*T,E*T)}else y.isInstancedBufferAttribute?(v(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):p(d),e.bindBuffer(34962,w),m(d,b,S,_,0,0)}else if("instanceMatrix"===h){var A=r.get(i.instanceMatrix);if(void 0===A)continue;var I=A.buffer,C=A.type;v(d+0,1),v(d+1,1),v(d+2,1),v(d+3,1),e.bindBuffer(34962,I),e.vertexAttribPointer(d+0,4,C,!1,64,0),e.vertexAttribPointer(d+1,4,C,!1,64,16),e.vertexAttribPointer(d+2,4,C,!1,64,32),e.vertexAttribPointer(d+3,4,C,!1,64,48)}else if("instanceColor"===h){var P=r.get(i.instanceColor);if(void 0===P)continue;var N=P.buffer,O=P.type;v(d,1),e.bindBuffer(34962,N),e.vertexAttribPointer(d,3,O,!1,12,0)}else if(void 0!==c){var R=c[h];if(void 0!==R)switch(R.length){case 2:e.vertexAttrib2fv(d,R);break;case 3:e.vertexAttrib3fv(d,R);break;case 4:e.vertexAttrib4fv(d,R);break;default:e.vertexAttrib1fv(d,R)}}}}g()}}(i,u,h,y),null!==_&&e.bindBuffer(34963,r.get(_).buffer))},reset:y,resetDefaultState:_,dispose:function(){for(var e in y(),s){var t=s[e];for(var r in t){var n=t[r];for(var i in n)h(n[i].object),delete n[i];delete t[r]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var r in t){var n=t[r];for(var i in n)h(n[i].object),delete n[i];delete t[r]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var r=s[t];if(void 0!==r[e.id]){var n=r[e.id];for(var i in n)h(n[i].object),delete n[i];delete r[e.id]}}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:g}}function Tr(e,t,r,n){var i,o=n.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,n){e.drawArrays(i,t,n),r.update(n,i,1)},this.renderInstances=function(n,a,s){if(0!==s){var u,l;if(o)u=e,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](i,n,a,s),r.update(a,i,s)}}}function Mr(e,t,r){var n;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==r.precision?r.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=o||t.has("WEBGL_draw_buffers"),l=!0===r.logarithmicDepthBuffer,c=e.getParameter(34930),h=e.getParameter(35660),d=e.getParameter(3379),f=e.getParameter(34076),p=e.getParameter(34921),v=e.getParameter(36347),g=e.getParameter(36348),m=e.getParameter(36349),y=h>0,_=o||t.has("OES_texture_float");return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){var r=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:y&&_,maxSamples:o?e.getParameter(36183):0}}function kr(e){var t=this,r=null,n=0,i=!1,o=!1,a=new dr,s=new B,u={value:null,needsUpdate:!1};function l(){u.value!==r&&(u.value=r,u.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function c(e,r,n,i){var o=null!==e?e.length:0,l=null;if(0!==o){if(l=u.value,!0!==i||null===l){var c=n+4*o,h=r.matrixWorldInverse;s.getNormalMatrix(h),(null===l||l.length0){var s=e.getRenderTarget(),u=new ur(a.height/2);return u.fromEquirectangularTexture(e,i),t.set(i,u),e.setRenderTarget(s),i.addEventListener("dispose",n),r(u.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function Ar(e){var t={};function r(r){if(void 0!==t[r])return t[r];var n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float")},get:function(e){var t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Ir(e,t,r,n){var i={},o=new WeakMap;function a(e){var s=e.target;for(var u in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[u]);s.removeEventListener("dispose",a),delete i[s.id];var l=o.get(s);l&&(t.remove(l),o.delete(s)),n.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,r.memory.geometries--}function s(e){var r=[],n=e.index,i=e.attributes.position,a=0;if(null!==n){var s=n.array;a=n.version;for(var u=0,l=s.length;u65535?St:xt)(r,1);_.version=a;var b=o.get(e);b&&t.remove(b),o.set(e,_)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,r.memory.geometries++),t},update:function(e){var r=e.attributes;for(var n in r)t.update(r[n],34962);var i=e.morphAttributes;for(var o in i)for(var a=i[o],s=0,u=a.length;s0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),(e=t.call(this,null)).image={data:n,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return r}(W);Lr.prototype.isDataTexture2DArray=!0;var jr=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),(e=t.call(this,null)).image={data:n,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return r}(W);jr.prototype.isDataTexture3D=!0;var zr=new W,Br=new Lr,Fr=new jr,Ur=new sr,Wr=[],Gr=[],Vr=new Float32Array(16),Hr=new Float32Array(9),Yr=new Float32Array(4);function $r(e,t,r){var n=e[0];if(n<=0||n>0)return e;var i=t*r,o=Wr[i];if(void 0===o&&(o=new Float32Array(i),Wr[i]=o),0!==t){n.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=r,e[a].toArray(o,s)}return o}function Xr(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;r/gm;function Kn(e){return e.replace(Zn,Jn)}function Jn(e,t){var r=_r[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return Kn(r)}var ei=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ti=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ri(e){return e.replace(ti,ii).replace(ei,ni)}function ni(e,t,r,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ii(e,t,r,n)}function ii(e,t,r,n){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,v=r.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission>0)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Xn).join("\n")}(r),g=function(e){var t=[];for(var r in e){var n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(s),m=a.createProgram(),y=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?((i=[g].filter(Xn).join("\n")).length>0&&(i+="\n"),(o=[v,g].filter(Xn).join("\n")).length>0&&(o+="\n")):(i=[oi(r),"#define SHADER_NAME "+r.shaderName,g,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+d:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Xn).join("\n"),o=[v,oi(r),"#define SHADER_NAME "+r.shaderName,g,r.alphaTest?"#define ALPHATEST "+r.alphaTest+(r.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.envMap?"#define "+d:"",r.envMap?"#define "+f:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.sheen?"#define USE_SHEEN":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==r.toneMapping?"#define TONE_MAPPING":"",0!==r.toneMapping?_r.tonemapping_pars_fragment:"",0!==r.toneMapping?$n("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",_r.encodings_pars_fragment,r.map?Hn("mapTexelToLinear",r.mapEncoding):"",r.matcap?Hn("matcapTexelToLinear",r.matcapEncoding):"",r.envMap?Hn("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMap?Hn("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.lightMap?Hn("lightMapTexelToLinear",r.lightMapEncoding):"",Yn("linearToOutputTexel",r.outputEncoding),r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Xn).join("\n")),u=Qn(u=qn(u=Kn(u),r),r),l=Qn(l=qn(l=Kn(l),r),r),u=ri(u),l=ri(l),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(y="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in","300 es"===r.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===r.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var _,b,x=y+o+l,w=Un(a,35633,y+i+u),S=Un(a,35632,x);if(a.attachShader(m,w),a.attachShader(m,S),void 0!==r.index0AttributeName?a.bindAttribLocation(m,0,r.index0AttributeName):!0===r.morphTargets&&a.bindAttribLocation(m,0,"position"),a.linkProgram(m),e.debug.checkShaderErrors){var T=a.getProgramInfoLog(m).trim(),M=a.getShaderInfoLog(w).trim(),k=a.getShaderInfoLog(S).trim(),E=!0,A=!0;if(!1===a.getProgramParameter(m,35714)){E=!1;var I=Vn(a,w,"vertex"),C=Vn(a,S,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,I,C)}else""!==T?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):""!==M&&""!==k||(A=!1);A&&(this.diagnostics={runnable:E,programLog:T,vertexShader:{log:M,prefix:i},fragmentShader:{log:k,prefix:o}})}return a.deleteShader(w),a.deleteShader(S),this.getUniforms=function(){return void 0===_&&(_=new Fn(a,m)),_},this.getAttributes=function(){return void 0===b&&(b=function(e,t){for(var r={},n=e.getProgramParameter(t,35721),i=0;i0,maxBones:T,useVertexTexture:l,morphTargets:i.morphTargets,morphNormals:i.morphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||r.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)r.push(n),r.push(t.defines[n]);if(!1===t.isRawShaderMaterial){for(var i=0;i0?i.push(c):!0===r.transparent?o.push(c):n.push(c)},unshift:function(e,t,r,a,u,l){var c=s(e,t,r,a,u,l);r.transmission>0?i.unshift(c):!0===r.transparent?o.unshift(c):n.unshift(c)},finish:function(){for(var e=r,n=t.length;e1&&n.sort(e||li),i.length>1&&i.sort(t||ci),o.length>1&&o.sort(t||ci)}}}function di(e){var t=new WeakMap;return{get:function(r,n){var i;return!1===t.has(r)?(i=new hi(e),t.set(r,[i])):n>=t.get(r).length?(i=new hi(e),t.get(r).push(i)):i=t.get(r)[n],i},dispose:function(){t=new WeakMap}}}function fi(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":r={direction:new X,color:new gt};break;case"SpotLight":r={position:new X,direction:new X,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new X,color:new gt,distance:0,decay:0};break;case"HemisphereLight":r={direction:new X,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":r={color:new gt,position:new X,halfWidth:new X,halfHeight:new X}}return e[t.id]=r,r}}}var pi=0;function vi(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function gi(e,t){for(var r=new fi,n=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)i.probe.push(new X);var a=new X,s=new Me,u=new Me;return{setup:function(o){for(var a=0,s=0,u=0,l=0;l<9;l++)i.probe[l].set(0,0,0);var c=0,h=0,d=0,f=0,p=0,v=0,g=0,m=0;o.sort(vi);for(var y=0,_=o.length;y<_;y++){var b=o[y],x=b.color,w=b.intensity,S=b.distance,T=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)a+=x.r*w,s+=x.g*w,u+=x.b*w;else if(b.isLightProbe)for(var M=0;M<9;M++)i.probe[M].addScaledVector(b.sh.coefficients[M],w);else if(b.isDirectionalLight){var k=r.get(b);if(k.color.copy(b.color).multiplyScalar(b.intensity),b.castShadow){var E=b.shadow,A=n.get(b);A.shadowBias=E.bias,A.shadowNormalBias=E.normalBias,A.shadowRadius=E.radius,A.shadowMapSize=E.mapSize,i.directionalShadow[c]=A,i.directionalShadowMap[c]=T,i.directionalShadowMatrix[c]=b.shadow.matrix,v++}i.directional[c]=k,c++}else if(b.isSpotLight){var I=r.get(b);if(I.position.setFromMatrixPosition(b.matrixWorld),I.color.copy(x).multiplyScalar(w),I.distance=S,I.coneCos=Math.cos(b.angle),I.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),I.decay=b.decay,b.castShadow){var C=b.shadow,P=n.get(b);P.shadowBias=C.bias,P.shadowNormalBias=C.normalBias,P.shadowRadius=C.radius,P.shadowMapSize=C.mapSize,i.spotShadow[d]=P,i.spotShadowMap[d]=T,i.spotShadowMatrix[d]=b.shadow.matrix,m++}i.spot[d]=I,d++}else if(b.isRectAreaLight){var N=r.get(b);N.color.copy(x).multiplyScalar(w),N.halfWidth.set(.5*b.width,0,0),N.halfHeight.set(0,.5*b.height,0),i.rectArea[f]=N,f++}else if(b.isPointLight){var O=r.get(b);if(O.color.copy(b.color).multiplyScalar(b.intensity),O.distance=b.distance,O.decay=b.decay,b.castShadow){var R=b.shadow,D=n.get(b);D.shadowBias=R.bias,D.shadowNormalBias=R.normalBias,D.shadowRadius=R.radius,D.shadowMapSize=R.mapSize,D.shadowCameraNear=R.camera.near,D.shadowCameraFar=R.camera.far,i.pointShadow[h]=D,i.pointShadowMap[h]=T,i.pointShadowMatrix[h]=b.shadow.matrix,g++}i.point[h]=O,h++}else if(b.isHemisphereLight){var L=r.get(b);L.skyColor.copy(b.color).multiplyScalar(w),L.groundColor.copy(b.groundColor).multiplyScalar(w),i.hemi[p]=L,p++}}f>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=br.LTC_FLOAT_1,i.rectAreaLTC2=br.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=br.LTC_HALF_1,i.rectAreaLTC2=br.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=u;var j=i.hash;j.directionalLength===c&&j.pointLength===h&&j.spotLength===d&&j.rectAreaLength===f&&j.hemiLength===p&&j.numDirectionalShadows===v&&j.numPointShadows===g&&j.numSpotShadows===m||(i.directional.length=c,i.spot.length=d,i.rectArea.length=f,i.point.length=h,i.hemi.length=p,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=m,i.spotShadowMap.length=m,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=g,i.spotShadowMatrix.length=m,j.directionalLength=c,j.pointLength=h,j.spotLength=d,j.rectAreaLength=f,j.hemiLength=p,j.numDirectionalShadows=v,j.numPointShadows=g,j.numSpotShadows=m,i.version=pi++)},setupView:function(e,t){for(var r=0,n=0,o=0,l=0,c=0,h=t.matrixWorldInverse,d=0,f=e.length;d1&&void 0!==arguments[1]?arguments[1]:0;return!1===r.has(n)?(i=new mi(e,t),r.set(n,[i])):o>=r.get(n).length?(i=new mi(e,t),r.get(n).push(i)):i=r.get(n)[o],i},dispose:function(){r=new WeakMap}}}var _i=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="MeshDepthMaterial",n.depthPacking=3200,n.morphTargets=!1,n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.wireframe=!1,n.wireframeLinewidth=1,n.fog=!1,n.setValues(e),n}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.depthPacking=e.depthPacking,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}]),r}(lt);_i.prototype.isMeshDepthMaterial=!0;var bi=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="MeshDistanceMaterial",n.referencePosition=new X,n.nearDistance=1,n.farDistance=1e3,n.morphTargets=!1,n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.fog=!1,n.setValues(e),n}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}]),r}(lt);function xi(e,t,r){var n=new vr,i=new j,o=new j,a=new V,s=[],u=[],l={},c=r.maxTextureSize,h={0:1,1:0,2:2},d=new nr({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new j},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;var p=new Ot;p.setAttribute("position",new bt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var v=new Zt(p,d),g=this;function m(r,n){var i=t.update(v);d.uniforms.shadow_pass.value=r.map.texture,d.uniforms.resolution.value=r.mapSize,d.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,i,d,v,null),f.uniforms.shadow_pass.value=r.mapPass.texture,f.uniforms.resolution.value=r.mapSize,f.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,i,f,v,null)}function y(e){var t=e<<0,r=s[t];return void 0===r&&(r=new _i({depthPacking:3201,morphTargets:e}),s[t]=r),r}function _(e){var t=e<<0,r=u[t];return void 0===r&&(r=new bi({morphTargets:e}),u[t]=r),r}function b(t,r,n,i,o,a,s){var u=null,c=y,d=t.customDepthMaterial;if(!0===i.isPointLight&&(c=_,d=t.customDistanceMaterial),void 0===d){var f=!1;!0===n.morphTargets&&(f=r.morphAttributes&&r.morphAttributes.position&&r.morphAttributes.position.length>0),u=c(f)}else u=d;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var p=u.uuid,v=n.uuid,g=l[p];void 0===g&&(g={},l[p]=g);var m=g[v];void 0===m&&(m=u.clone(),g[v]=m),u=m}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=3===s?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function x(r,i,o,a,s){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===s)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,r.matrixWorld);var u=t.update(r),l=r.material;if(Array.isArray(l))for(var c=u.groups,h=0,d=c.length;hc||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/_.x),i.x=o.x*_.x,y.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/_.y),i.y=o.y*_.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};y.map=new H(i.x,i.y,b),y.map.texture.name=v.name+".shadowMap",y.mapPass=new H(i.x,i.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){y.map=new H(i.x,i.y,{minFilter:1003,magFilter:1003,format:1023}),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var w=y.getViewportCount(),S=0;S=1):-1!==A.indexOf("OpenGL ES")&&(E=parseFloat(/^OpenGL ES (\d)/.exec(A)[1]),k=E>=2);var I=null,C={},P=e.getParameter(3088),N=e.getParameter(2978),O=(new V).fromArray(P),R=(new V).fromArray(N);function D(t,r,n){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;an||e.height>n)&&(i=n/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?L:Math.floor,a=o(i*e.width),u=o(i*e.height);void 0===s&&(s=v(a,u));var l=r?v(a,u):s;return l.width=a,l.height=u,l.getContext("2d").drawImage(e,0,0,a,u),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+u+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function m(e){return R(e.width)&&R(e.height)}function y(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function _(t,r,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;e.generateMipmap(t),n.get(r).__maxMipLevel=Math.log2(Math.max(i,o,a))}function b(r,n,i){if(!1===u)return n;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}var o=n;return 6403===n&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===n&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===n&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function x(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){var r,i,o=t.target;o.removeEventListener("dispose",w),r=o,void 0!==(i=n.get(r)).__webglInit&&(e.deleteTexture(i.__webglTexture),n.remove(r)),o.isVideoTexture&&f.delete(o),a.memory.textures--}function S(t){var r=t.target;r.removeEventListener("dispose",S),function(t){var r=t.texture,i=n.get(t),o=n.get(r);if(t){if(void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),a.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var s=0;s<6;s++)e.deleteFramebuffer(i.__webglFramebuffer[s]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[s]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(var u=0,l=r.length;u0&&s.__version!==e.version){var u=e.image;if(void 0===u)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==u.complete)return void P(s,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(33984+t),r.bindTexture(3553,s.__webglTexture)}function k(t,i){var a=n.get(t);t.version>0&&a.__version!==t.version?function(t,n,i){if(6===n.image.length){C(t,n),r.activeTexture(33984+i),r.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);for(var a=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),s=n.image[0]&&n.image[0].isDataTexture,l=[],h=0;h<6;h++)l[h]=a||s?s?n.image[h].image:n.image[h]:g(n.image[h],!1,!0,c);var d,f=l[0],p=m(f)||u,v=o.convert(n.format),x=o.convert(n.type),w=b(n.internalFormat,v,x);if(I(34067,n,p),a){for(var S=0;S<6;S++){d=l[S].mipmaps;for(var T=0;T1||n.get(o).__currentAnisotropy)&&(e.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function C(t,r){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),a.memory.textures++)}function P(t,n,i){var a=3553;n.isDataTexture2DArray&&(a=35866),n.isDataTexture3D&&(a=32879),C(t,n),r.activeTexture(33984+i),r.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);var s,l=function(e){return!u&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(n)&&!1===m(n.image),c=g(n.image,l,!1,h),d=m(c)||u,f=o.convert(n.format),p=o.convert(n.type),v=b(n.internalFormat,f,p);I(a,n,d);var x=n.mipmaps;if(n.isDepthTexture)v=6402,u?v=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===v&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,p=o.convert(n.type)),1027===n.format&&6402===v&&(v=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,p=o.convert(n.type))),r.texImage2D(3553,0,v,c.width,c.height,0,f,p,null);else if(n.isDataTexture)if(x.length>0&&d){for(var w=0,S=x.length;w0&&d){for(var k=0,E=x.length;k=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=M,this.setTexture2DArray=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?P(i,e,t):(r.activeTexture(33984+t),r.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?P(i,e,t):(r.activeTexture(33984+t),r.bindTexture(32879,i.__webglTexture))},this.setTextureCube=k,this.setupRenderTarget=function(t){var s=t.texture,l=n.get(t),c=n.get(s);t.addEventListener("dispose",S),!0!==t.isWebGLMultipleRenderTargets&&(c.__webglTexture=e.createTexture(),c.__version=s.version,a.memory.textures++);var h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,f=!0===t.isWebGLMultisampleRenderTarget,p=s.isDataTexture3D||s.isDataTexture2DArray,v=m(t)||u;if(!u||1022!==s.format||1015!==s.type&&1016!==s.type||(s.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){l.__webglFramebuffer=[];for(var g=0;g<6;g++)l.__webglFramebuffer[g]=e.createFramebuffer()}else if(l.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers)for(var x=t.texture,w=0,T=x.length;w0&&void 0!==arguments[0]?arguments[0]:[];return x(this,r),(e=t.call(this)).cameras=n,e}return r}(or);Mi.prototype.isArrayCamera=!0;var ki=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="Group",e}return r}(Qe);ki.prototype.isGroup=!0;var Ei={type:"move"},Ai=function(){function e(){x(this,e),this._targetRay=null,this._grip=null,this._hand=null}return S(e,[{key:"getHandSpace",value:function(){return null===this._hand&&(this._hand=new ki,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}},{key:"getTargetRaySpace",value:function(){return null===this._targetRay&&(this._targetRay=new ki,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}},{key:"getGripSpace",value:function(){return null===this._grip&&(this._grip=new ki,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X),this._grip}},{key:"dispatchEvent",value:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}},{key:"disconnect",value:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}},{key:"update",value:function(e,t,r){var n=null,i=null,o=null,a=this._targetRay,s=this._grip,u=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==a&&(null!==(n=t.getPose(e.targetRaySpace,r))&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ei))),u&&e.hand){o=!0;var l,c=M(e.hand.values());try{for(c.s();!(l=c.n()).done;){var h=l.value,d=t.getJointPose(h,r);if(void 0===u.joints[h.jointName]){var f=new ki;f.matrixAutoUpdate=!1,f.visible=!1,u.joints[h.jointName]=f,u.add(f)}var p=u.joints[h.jointName];null!==d&&(p.matrix.fromArray(d.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=d.radius),p.visible=null!==d}}catch(e){c.e(e)}finally{c.f()}var v=u.joints["index-finger-tip"],g=u.joints["thumb-tip"],m=v.position.distanceTo(g.position);u.inputState.pinching&&m>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&m<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(null!==(i=t.getPose(e.gripSpace,r))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==n),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==o),this}}]),e}(),Ii=function(e){p(r,e);var t=g(r);function r(e,n){var i;x(this,r);var o=y(i=t.call(this)),a=e.state,s=null,u=1,c=null,h="local-floor",d=null,f=null,p=null,v=null,g=[],m=new Map,_=new or;_.layers.enable(1),_.viewport=new V;var b=new or;b.layers.enable(2),b.viewport=new V;var w=[_,b],S=new Mi;S.layers.enable(1),S.layers.enable(2);var T=null,M=null;function k(e){var t=m.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function E(){m.forEach((function(e,t){e.disconnect(t)})),m.clear(),T=null,M=null,a.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),O.stop(),o.isPresenting=!1,o.dispatchEvent({type:"sessionend"})}function A(e){for(var t=s.inputSources,r=0;r0&&(e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)}(e,n,a):r(e,n)):n.isMeshMatcapMaterial?(t(e,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDepthMaterial?(t(e,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDistanceMaterial?(t(e,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,n)):n.isMeshNormalMaterial?(t(e,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,n)):n.isPointsMaterial?function(e,t,r,n){var i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*n,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,n,i,o):n.isSpriteMaterial?function(e,t){var r;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(e,n):n.isShadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Pi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=void 0!==e.canvas?e.canvas:function(){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),r=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,u=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,d=null,f=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;var v=this,g=!1,m=0,y=0,_=null,b=-1,x=null,w=new V,S=new V,T=null,M=t.width,k=t.height,E=1,A=null,I=null,C=new V(0,0,M,k),P=new V(0,0,M,k),N=!1,O=[],R=new vr,D=!1,L=!1,j=null,z=new Me,B=new X,F={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function U(){return null===_?E:1}var W,G,$,q,Q,Z,K,J,ee,te,re,ne,ie,oe,ae,se,ue,le,ce,he,de,fe,pe=r;function ve(e,r){for(var n=0;n0&&Ae(n,e,t),i.length>0&&function(e,t,r,n){if(null===j){var i=!0===a&&!0===G.isWebGL2;j=new(i?Y:H)(1024,1024,{generateMipmaps:!0,type:null!==de.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}var o=v.getRenderTarget();v.setRenderTarget(j),v.clear();var s=v.toneMapping;v.toneMapping=0,Ae(e,r,n),v.toneMapping=s,Z.updateMultisampleRenderTarget(j),Z.updateRenderTargetMipmap(j),v.setRenderTarget(o),Ae(t,r,n)}(n,i,e,t),o.length>0&&Ae(o,e,t),null!==_&&(Z.updateMultisampleRenderTarget(_),Z.updateRenderTargetMipmap(_)),!0===e.isScene&&e.onAfterRender(v,e,t),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1),fe.resetDefaultState(),b=-1,x=null,p.pop(),d=p.length>0?p[p.length-1]:null,f.pop(),h=f.length>0?f[f.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return m},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return _},this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;_=e,m=t,y=r,e&&void 0===Q.get(e).__webglFramebuffer&&Z.setupRenderTarget(e);var n=null,i=!1,o=!1;if(e){var a=e.texture;(a.isDataTexture3D||a.isDataTexture2DArray)&&(o=!0);var s=Q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(n=s[t],i=!0):n=e.isWebGLMultisampleRenderTarget?Q.get(e).__webglMultisampledFramebuffer:s,w.copy(e.viewport),S.copy(e.scissor),T=e.scissorTest}else w.copy(C).multiplyScalar(E).floor(),S.copy(P).multiplyScalar(E).floor(),T=N;if($.bindFramebuffer(36160,n)&&G.drawBuffers){var u=!1;if(e)if(e.isWebGLMultipleRenderTargets){var l=e.texture;if(O.length!==l.length||36064!==O[0]){for(var c=0,h=l.length;c=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&pe.readPixels(t,r,n,i,de.convert(l),de.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{var d=null!==_?Q.get(_).__webglFramebuffer:null;$.bindFramebuffer(36160,d)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Math.pow(2,-r),i=Math.floor(t.image.width*n),o=Math.floor(t.image.height*n),a=de.convert(t.format);G.isWebGL2&&(6407===a&&(a=32849),6408===a&&(a=32856)),Z.setTexture2D(t,0),pe.copyTexImage2D(3553,r,a,e.x,e.y,i,o,0),$.unbindTexture()},this.copyTextureToTexture=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.image.width,o=t.image.height,a=de.convert(r.format),s=de.convert(r.type);Z.setTexture2D(r,0),pe.pixelStorei(37440,r.flipY),pe.pixelStorei(37441,r.premultiplyAlpha),pe.pixelStorei(3317,r.unpackAlignment),t.isDataTexture?pe.texSubImage2D(3553,n,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?pe.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):pe.texSubImage2D(3553,n,e.x,e.y,a,s,t.image),0===n&&r.generateMipmaps&&pe.generateMipmap(3553),$.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(v.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var o,a=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,u=e.max.z-e.min.z+1,l=de.convert(n.format),c=de.convert(n.type);if(n.isDataTexture3D)Z.setTexture3D(n,0),o=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Z.setTexture2DArray(n,0),o=35866}pe.pixelStorei(37440,n.flipY),pe.pixelStorei(37441,n.premultiplyAlpha),pe.pixelStorei(3317,n.unpackAlignment);var h=pe.getParameter(3314),d=pe.getParameter(32878),f=pe.getParameter(3316),p=pe.getParameter(3315),g=pe.getParameter(32877),m=r.isCompressedTexture?r.mipmaps[0]:r.image;pe.pixelStorei(3314,m.width),pe.pixelStorei(32878,m.height),pe.pixelStorei(3316,e.min.x),pe.pixelStorei(3315,e.min.y),pe.pixelStorei(32877,e.min.z),r.isDataTexture||r.isDataTexture3D?pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,m.data):r.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),pe.compressedTexSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,m.data)):pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,m),pe.pixelStorei(3314,h),pe.pixelStorei(32878,d),pe.pixelStorei(3316,f),pe.pixelStorei(3315,p),pe.pixelStorei(32877,g),0===i&&n.generateMipmaps&&pe.generateMipmap(o),$.unbindTexture()}},this.initTexture=function(e){Z.setTexture2D(e,0),$.unbindTexture()},this.resetState=function(){m=0,y=0,_=null,$.reset(),fe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r})(Pi).prototype.isWebGL1Renderer=!0;var Ni=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:y(e)})),e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),r}(Qe);Ni.prototype.isScene=!0;var Oi=function(){function e(t,r){x(this,e),this.array=t,this.stride=r,this.count=void 0!==t?t.length/r:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=P()}return S(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,r){e*=this.stride,r*=t.stride;for(var n=0,i=this.stride;n1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"clone",value:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"toJSON",value:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();Oi.prototype.isInterleavedBuffer=!0;var Ri=new X,Di=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];x(this,e),this.name="",this.data=t,this.itemSize=r,this.offset=n,this.normalized=!0===i}return S(e,[{key:"applyMatrix4",value:function(e){for(var t=0,r=this.data.count;te.far||t.push({distance:s,point:zi.clone(),uv:st.getUV(zi,Vi,Hi,Yi,$i,Xi,qi,new j),face:null,object:this})}}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}]),r}(Qe);function Zi(e,t,r,n,i,o){Ui.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(Wi.x=o*Ui.x-i*Ui.y,Wi.y=i*Ui.x+o*Ui.y):Wi.copy(Ui),e.copy(t),e.x+=Wi.x,e.y+=Wi.y,e.applyMatrix4(Gi)}Qi.prototype.isSprite=!0;var Ki=new X,Ji=new V,eo=new V,to=new X,ro=new Me,no=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="SkinnedMesh",i.bindMode="attached",i.bindMatrix=new Me,i.bindMatrixInverse=new Me,i}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}},{key:"bind",value:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}},{key:"pose",value:function(){this.skeleton.pose()}},{key:"normalizeSkinWeights",value:function(){for(var e=new V,t=this.geometry.attributes.skinWeight,r=0,n=t.count;r0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1003,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1003,f=arguments.length>10?arguments[10]:void 0,p=arguments.length>11?arguments[11]:void 0;return x(this,r),(e=t.call(this,null,u,l,c,h,d,a,s,f,p)).image={data:n,width:i,height:o},e.magFilter=h,e.minFilter=d,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return r}(W);io.prototype.isDataTexture=!0;var oo=new Me,ao=new Me,so=[],uo=new Zt,lo=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n)).instanceMatrix=new bt(new Float32Array(16*i),16),o.instanceColor=null,o.count=i,o.frustumCulled=!1,o}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}},{key:"getColorAt",value:function(e,t){t.fromArray(this.instanceColor.array,3*e)}},{key:"getMatrixAt",value:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)}},{key:"raycast",value:function(e,t){var r=this.matrixWorld,n=this.count;if(uo.geometry=this.geometry,uo.material=this.material,void 0!==uo.material)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Ot,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new co;return x(this,r),(e=t.call(this)).type="Line",e.geometry=n,e.material=i,e.updateMorphTargets(),e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,r=[0],n=1,i=t.count;ns)){h.applyMatrix4(this.matrixWorld);var _=e.ray.origin.distanceTo(h);_e.far||t.push({distance:_,point:c.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var b=Math.max(0,o.start),x=Math.min(p.count,o.start+o.count)-1;bs)){h.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(h);we.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,r=Object.keys(t);if(r.length>0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=n.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),r}(Qe);mo.prototype.isLine=!0;var yo=new X,_o=new X,bo=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="LineSegments",i}return S(r,[{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,r=[],n=0,i=t.count;n0&&void 0!==arguments[0]?arguments[0]:new Ot,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wo;return x(this,r),(e=t.call(this)).type="Points",e.geometry=n,e.material=i,e.updateMorphTargets(),e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"raycast",value:function(e,t){var r=this.geometry,n=this.matrixWorld,i=e.params.Points.threshold,o=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),Mo.copy(r.boundingSphere),Mo.applyMatrix4(n),Mo.radius+=i,!1!==e.ray.intersectsSphere(Mo)){So.copy(n).invert(),To.copy(e.ray).applyMatrix4(So);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a;if(r.isBufferGeometry){var u=r.index,l=r.attributes.position;if(null!==u)for(var c=Math.max(0,o.start),h=Math.min(u.count,o.start+o.count);c0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=n.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),r}(Qe);function Ao(e,t,r,n,i,o,a){var s=To.distanceSqToPoint(e);if(si.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:a})}}Eo.prototype.isPoints=!0,function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c){var h;x(this,r),(h=t.call(this,e,n,i,o,a,s,u,l,c)).format=void 0!==u?u:1022,h.minFilter=void 0!==s?s:1006,h.magFilter=void 0!==a?a:1006,h.generateMipmaps=!1;var d=y(h);return"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){d.needsUpdate=!0,e.requestVideoFrameCallback(t)})),h}return S(r,[{key:"clone",value:function(){return new this.constructor(this.image).copy(this)}},{key:"update",value:function(){var e=this.image;"requestVideoFrameCallback"in e==!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}]),r}(W).prototype.isVideoTexture=!0;var Io=function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c,h,d,f){var p;return x(this,r),(p=t.call(this,null,s,u,l,c,h,o,a,d,f)).image={width:n,height:i},p.mipmaps=e,p.flipY=!1,p.generateMipmaps=!1,p}return r}(W);Io.prototype.isCompressedTexture=!0,function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c){var h;return x(this,r),(h=t.call(this,e,n,i,o,a,s,u,l,c)).needsUpdate=!0,h}return r}(W).prototype.isCanvasTexture=!0,function(e){p(r,e);var t=g(r);function r(e,n,i,o,a,s,u,l,c,h){var d;if(x(this,r),1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),(d=t.call(this,null,o,a,s,u,l,h,i,c)).image={width:e,height:n},d.magFilter=void 0!==u?u:1003,d.minFilter=void 0!==l?l:1003,d.flipY=!1,d.generateMipmaps=!1,d}return r}(W).prototype.isDepthTexture=!0,new X,new X,new X,new st;var Co=function(){function e(){x(this,e),this.type="Curve",this.arcLengthDivisions=200}return S(e,[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var r=this.getUtoTmapping(e);return this.getPoint(r,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,r=[],n=this.getPoint(0),i=0;r.push(0);for(var o=1;o<=e;o++)i+=(t=this.getPoint(o/e)).distanceTo(n),r.push(i),n=t;return this.cacheArcLengths=r,r}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var r,n=this.getLengths(),i=0,o=n.length;r=t||e*n[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=n[i=Math.floor(s+(u-s)/2)]-r)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(n[i=u]===r)return i/(o-1);var l=n[i];return(i+(r-l)/(n[i+1]-l))/(o-1)}},{key:"getTangent",value:function(e,t){var r=e-1e-4,n=e+1e-4;r<0&&(r=0),n>1&&(n=1);var i=this.getPoint(r),o=this.getPoint(n),a=t||(i.isVector2?new j:new X);return a.copy(o).sub(i).normalize(),a}},{key:"getTangentAt",value:function(e,t){var r=this.getUtoTmapping(e);return this.getTangent(r,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var r=new X,n=[],i=[],o=[],a=new X,s=new Me,u=0;u<=e;u++){var l=u/e;n[u]=this.getTangentAt(l,new X),n[u].normalize()}i[0]=new X,o[0]=new X;var c=Number.MAX_VALUE,h=Math.abs(n[0].x),d=Math.abs(n[0].y),f=Math.abs(n[0].z);h<=c&&(c=h,r.set(1,0,0)),d<=c&&(c=d,r.set(0,1,0)),f<=c&&r.set(0,0,1),a.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],a),o[0].crossVectors(n[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(n[p-1],n[p]),a.length()>Number.EPSILON){a.normalize();var v=Math.acos(N(n[p-1].dot(n[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(a,v))}o[p].crossVectors(n[p],i[p])}if(!0===t){var g=Math.acos(N(i[0].dot(i[e]),-1,1));g/=e,n[0].dot(a.crossVectors(i[0],i[e]))>0&&(g=-g);for(var m=1;m<=e;m++)i[m].applyMatrix4(s.makeRotationAxis(n[m],g*m)),o[m].crossVectors(n[m],i[m])}return{tangents:n,normals:i,binormals:o}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}]),e}(),Po=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return x(this,r),(e=t.call(this)).type="EllipseCurve",e.aX=n,e.aY=i,e.xRadius=o,e.yRadius=a,e.aStartAngle=s,e.aEndAngle=u,e.aClockwise=l,e.aRotation=c,e}return S(r,[{key:"getPoint",value:function(e,t){for(var r=t||new j,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)n;)i-=n;i0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return x(this,r),(e=t.call(this)).type="CatmullRomCurve3",e.points=n,e.closed=i,e.curveType=o,e.tension=a,e}return S(r,[{key:"getPoint",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,i=n,o=this.points,a=o.length,s=(a-(this.closed?0:1))*e,u=Math.floor(s),l=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/a)+1)*a:0===l&&u===a-1&&(u=a-2,l=1),this.closed||u>0?t=o[(u-1)%a]:(Ro.subVectors(o[0],o[1]).add(o[0]),t=Ro);var c=o[u%a],h=o[(u+1)%a];if(this.closed||u+20&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new j;return x(this,r),(e=t.call(this)).type="CubicBezierCurve",e.v0=n,e.v1=i,e.v2=o,e.v3=a,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t,n=this.v0,i=this.v1,o=this.v2,a=this.v3;return r.set(Uo(e,n.x,i.x,o.x,a.x),Uo(e,n.y,i.y,o.y,a.y)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),r}(Co);Wo.prototype.isCubicBezierCurve=!0;var Go=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new X,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new X;return x(this,r),(e=t.call(this)).type="CubicBezierCurve3",e.v0=n,e.v1=i,e.v2=o,e.v3=a,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,r=t,n=this.v0,i=this.v1,o=this.v2,a=this.v3;return r.set(Uo(e,n.x,i.x,o.x,a.x),Uo(e,n.y,i.y,o.y,a.y),Uo(e,n.z,i.z,o.z,a.z)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),r}(Co);Go.prototype.isCubicBezierCurve3=!0;var Vo=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j;return x(this,r),(e=t.call(this)).type="LineCurve",e.v1=n,e.v2=i,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e,t){var r=t||new j;return r.copy(this.v2).sub(this.v1).normalize(),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co);Vo.prototype.isLineCurve=!0;var Ho=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j;return x(this,r),(e=t.call(this)).type="QuadraticBezierCurve",e.v0=n,e.v1=i,e.v2=o,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t,n=this.v0,i=this.v1,o=this.v2;return r.set(Fo(e,n.x,i.x,o.x),Fo(e,n.y,i.y,o.y)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co);Ho.prototype.isQuadraticBezierCurve=!0;var Yo=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new X,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new X;return x(this,r),(e=t.call(this)).type="QuadraticBezierCurve3",e.v0=n,e.v1=i,e.v2=o,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,r=t,n=this.v0,i=this.v1,o=this.v2;return r.set(Fo(e,n.x,i.x,o.x),Fo(e,n.y,i.y,o.y),Fo(e,n.z,i.z,o.z)),r}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co);Yo.prototype.isQuadraticBezierCurve3=!0;var $o=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return x(this,r),(e=t.call(this)).type="SplineCurve",e.points=n,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,r=t,n=this.points,i=(n.length-1)*e,o=Math.floor(i),a=i-o,s=n[0===o?o:o-1],u=n[o],l=n[o>n.length-2?n.length-1:o+1],c=n[o>n.length-3?n.length-1:o+2];return r.set(Bo(a,s.x,u.x,l.x,c.x),Bo(a,s.y,u.y,l.y,c.y)),r}},{key:"copy",value:function(e){f(b(r.prototype),"copy",this).call(this,e),this.points=[];for(var t=0,n=e.points.length;t0&&void 0!==arguments[0]?arguments[0]:new X,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X;return x(this,r),(e=t.call(this)).type="LineCurve3",e.isLineCurve3=!0,e.v1=n,e.v2=i,e}return S(r,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new X,r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),r}(Co),QuadraticBezierCurve:Ho,QuadraticBezierCurve3:Yo,SplineCurve:$o});function qo(e,t,r,n,i){var o,a;if(i===function(e,t,r,n){for(var i=0,o=t,a=r-n;o0)for(o=t;o=t;o-=n)a=ga(o,e[o],e[o+1],a);return a&&ca(a,a.next)&&(ma(a),a=a.next),a}function Qo(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!ca(n,n.next)&&0!==la(n.prev,n,n.next))n=n.next;else{if(ma(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function Zo(e,t,r,n,i,o,a){if(e){!a&&o&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=oa(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,u,l=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(e,n,i,o);for(var s,u,l=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?Jo(e,n,i,o):Ko(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),ma(e),e=u.next,l=u.next;else if((e=u)===l){a?1===a?Zo(e=ea(Qo(e),t,r),t,r,n,i,o,2):2===a&&ta(e,t,r,n,i,o):Zo(Qo(e),t,r,n,i,o,1);break}}}function Ko(e){var t=e.prev,r=e,n=e.next;if(la(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(sa(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&la(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Jo(e,t,r,n){var i=e.prev,o=e,a=e.next;if(la(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=oa(s,u,t,r,n),d=oa(l,c,t,r,n),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ea(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!ca(i,o)&&ha(i,n,n.next,o)&&pa(i,o)&&pa(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),ma(n),ma(n.next),n=e=o),n=n.next}while(n!==e);return Qo(n)}function ta(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ua(a,s)){var u=va(a,s);return a=Qo(a,a.next),u=Qo(u,u.next),Zo(a,t,r,n,i,o),void Zo(u,t,r,n,i,o)}s=s.next}a=a.next}while(a!==e)}function ra(e,t){return e.x-t.x}function na(e,t){if(t=function(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&sa(or.x||n.x===r.x&&ia(r,n)))&&(r=n,d=u)),n=n.next}while(n!==l);return r}(e,t)){var r=va(t,e);Qo(t,t.next),Qo(r,r.next)}}function ia(e,t){return la(e.prev,e,t.prev)<0&&la(t.next,e,e.next)<0}function oa(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function aa(e){var t=e,r=e;do{(t.x=0&&(e-a)*(n-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function ua(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&ha(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(pa(e,t)&&pa(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(la(e.prev,e,t.prev)||la(e,t.prev,t))||ca(e,t)&&la(e.prev,e,e.next)>0&&la(t.prev,t,t.next)>0)}function la(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function ca(e,t){return e.x===t.x&&e.y===t.y}function ha(e,t,r,n){var i=fa(la(e,t,r)),o=fa(la(e,t,n)),a=fa(la(r,n,e)),s=fa(la(r,n,t));return i!==o&&a!==s||!(0!==i||!da(e,r,t))||!(0!==o||!da(e,n,t))||!(0!==a||!da(r,e,n))||!(0!==s||!da(r,t,n))}function da(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function fa(e){return e>0?1:e<0?-1:0}function pa(e,t){return la(e.prev,e,e.next)<0?la(e,t,e.next)>=0&&la(e,e.prev,t)>=0:la(e,t,e.prev)<0||la(e,e.next,t)<0}function va(e,t){var r=new ya(e.i,e.x,e.y),n=new ya(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function ga(e,t,r,n){var i=new ya(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ma(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ya(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var _a=function(){function e(){x(this,e)}return S(e,null,[{key:"area",value:function(e){for(var t=e.length,r=0,n=t-1,i=0;i2&&void 0!==arguments[2]?arguments[2]:2,c=t&&t.length,h=c?t[0]*l:e.length,d=qo(e,0,h,l,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(e,t,r,n){var i,o,a,s=[];for(i=0,o=t.length;i80*l){r=i=e[0],n=o=e[1];for(var p=l;pi&&(i=a),s>o&&(o=s);u=0!==(u=Math.max(i-r,o-n))?1/u:0}return Zo(d,f,l,r,n,u),f}(r,n),u=0;u2&&e[t-1].equals(e[0])&&e.pop()}function xa(e,t){for(var r=0;rNumber.EPSILON){var d=Math.sqrt(c),f=Math.sqrt(u*u+l*l),p=t.x-s/d,v=t.y+a/d,g=((r.x-l/f-p)*l-(r.y+u/f-v)*u)/(a*l-s*u),m=(n=p+a*g-e.x)*n+(i=v+s*g-e.y)*i;if(m<=2)return new j(n,i);o=Math.sqrt(m/2)}else{var y=!1;a>Number.EPSILON?u>Number.EPSILON&&(y=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(n=-s,i=a,o=Math.sqrt(c)):(n=a,i=s,o=Math.sqrt(c/2))}return new j(n/o,i/o)}for(var z=[],B=0,F=I.length,U=F-1,W=B+1;B=0;_e--){for(var be=_e/f,xe=c*Math.cos(be*Math.PI/2),we=h*Math.sin(be*Math.PI/2)+d,Se=0,Te=I.length;Se=0;){var n=r,o=r-1;o<0&&(o=e.length-1);for(var a=0,s=i+2*f;a1&&void 0!==arguments[1]?arguments[1]:12;x(this,r),(n=t.call(this)).type="ShapeGeometry",n.parameters={shapes:e,curveSegments:i};var o=[],a=[],s=[],u=[],l=0,c=0;if(!1===Array.isArray(e))d(e);else for(var h=0;h4&&void 0!==arguments[4]?arguments[4]:30,o=e.clone();o.name=t;for(var a=[],s=0;s=n)){c.push(u.times[d]);for(var p=0;po.tracks[g].times[0]&&(v=o.tracks[g].times[0]);for(var m=0;m1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;n<=0&&(n=30);for(var i=r.tracks.length,o=t/n,a=function(t){var n=r.tracks[t],i=n.ValueTypeName;if("bool"===i||"string"===i)return"continue";var a=e.tracks.find((function(e){return e.name===n.name&&e.ValueTypeName===i}));if(void 0===a)return"continue";var s=0,u=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=u/3);var l=0,c=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=c/3);var h=n.times.length-1,d=void 0;if(o<=n.times[0]){var f=s,p=u-s;d=Da.arraySlice(n.values,f,p)}else if(o>=n.times[h]){var v=h*u+s,g=v+u-s;d=Da.arraySlice(n.values,v,g)}else{var m=n.createInterpolant(),y=s,_=u-s;m.evaluate(o),d=Da.arraySlice(m.resultBuffer,y,_)}"quaternion"===i&&(new $).fromArray(d).normalize().conjugate().toArray(d);for(var b=a.times.length,x=0;x=i)break e;var s=t[1];e=(i=t[--r-1]))break t}o=r,r=0}for(;r>>1;et;)--o;if(++o,0!==i||o!==n){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Da.arraySlice(r,i,o),this.values=Da.arraySlice(this.values,i*a,o*a)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=r[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==n&&Da.isTypedArray(n))for(var u=0,l=n.length;u!==l;++u){var c=n[u];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,c),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=Da.arraySlice(this.times),t=Da.arraySlice(this.values),r=this.getValueSize(),n=2302===this.getInterpolation(),i=e.length-1,o=1,a=1;a0){e[o]=e[i];for(var m=i*r,y=o*r,_=0;_!==r;++_)t[y+_]=t[m+_];++o}return o!==e.length?(this.times=Da.arraySlice(e,0,o),this.values=Da.arraySlice(t,0,o*r)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=Da.arraySlice(this.times,0),t=Da.arraySlice(this.values,0),r=new this.constructor(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}],[{key:"toJSON",value:function(e){var t,r=e.constructor;if(r.toJSON!==this.toJSON)t=r.toJSON(e);else{t={name:e.name,times:Da.convertArray(e.times,Array),values:Da.convertArray(e.values,Array)};var n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}}]),e}();Fa.prototype.TimeBufferType=Float32Array,Fa.prototype.ValueBufferType=Float32Array,Fa.prototype.DefaultInterpolation=2301;var Ua=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Ua.prototype.ValueTypeName="bool",Ua.prototype.ValueBufferType=Array,Ua.prototype.DefaultInterpolation=2300,Ua.prototype.InterpolantFactoryMethodLinear=void 0,Ua.prototype.InterpolantFactoryMethodSmooth=void 0;var Wa=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Wa.prototype.ValueTypeName="color";var Ga=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Ga.prototype.ValueTypeName="number";var Va=function(e){p(r,e);var t=g(r);function r(e,n,i,o){return x(this,r),t.call(this,e,n,i,o)}return S(r,[{key:"interpolate_",value:function(e,t,r,n){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(r-t)/(n-t),u=e*a,l=u+a;u!==l;u+=4)$.slerpFlat(i,0,o,u-a,o,u,s);return i}}]),r}(La),Ha=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new Va(this.times,this.values,this.getValueSize(),e)}}]),r}(Fa);Ha.prototype.ValueTypeName="quaternion",Ha.prototype.DefaultInterpolation=2301,Ha.prototype.InterpolantFactoryMethodSmooth=void 0;var Ya=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);Ya.prototype.ValueTypeName="string",Ya.prototype.ValueBufferType=Array,Ya.prototype.DefaultInterpolation=2300,Ya.prototype.InterpolantFactoryMethodLinear=void 0,Ya.prototype.InterpolantFactoryMethodSmooth=void 0;var $a=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}(Fa);$a.prototype.ValueTypeName="vector";var Xa=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;x(this,e),this.name=t,this.tracks=n,this.duration=r,this.blendMode=i,this.uuid=P(),this.duration<0&&this.resetDuration()}return S(e,[{key:"resetDuration",value:function(){for(var e=0,t=0,r=this.tracks.length;t!==r;++t){var n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}},{key:"trim",value:function(){for(var e=0;e1){var l=u[1],c=n[l];c||(n[l]=c=[]),c.push(s)}}var h=[];for(var d in n)h.push(this.CreateFromMorphTargetSequence(d,n[d],t,r));return h}},{key:"parseAnimation",value:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(e,t,r,n,i){if(0!==r.length){var o=[],a=[];Da.flattenJSON(r,o,a,n),0!==o.length&&i.push(new e(t,o,a))}},n=[],i=e.name||"default",o=e.fps||30,a=e.blendMode,s=e.length||-1,u=e.hierarchy||[],l=0;l0||0===e.search(/^data\:image\/jpeg/);i.format=n?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),r,n),i}}]),r}(Ka),is=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return S(r,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Vo(t,e))}},{key:"getPoint",value:function(e){for(var t=e*this.getLength(),r=this.getCurveLengths(),n=0;n=t){var i=r[n]-t,o=this.curves[n],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}n++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,r=0,n=this.curves.length;r0&&void 0!==arguments[0]?arguments[0]:40,t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,r=[],n=0,i=this.curves;n1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r}},{key:"copy",value:function(e){f(b(r.prototype),"copy",this).call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t0){var l=u.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(u);var c=u.getPoint(1);return this.currentPoint.copy(c),this}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return f(b(r.prototype),"fromJSON",this).call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}]),r}(is),as=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).uuid=P(),n.type="Shape",n.holes=[],n}return S(r,[{key:"getPointsHoles",value:function(e){for(var t=[],r=0,n=this.holes.length;r1&&void 0!==arguments[1]?arguments[1]:1;return x(this,r),(n=t.call(this)).type="Light",n.color=new gt(e),n.intensity=i,n}return S(r,[{key:"dispose",value:function(){}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}]),r}(Qe);ss.prototype.isLight=!0;var us=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,i)).type="HemisphereLight",o.position.copy(Qe.DefaultUp),o.updateMatrix(),o.groundColor=new gt(n),o}return S(r,[{key:"copy",value:function(e){return ss.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}]),r}(ss);us.prototype.isHemisphereLight=!0;var ls=new Me,cs=new X,hs=new X,ds=function(){function e(t){x(this,e),this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new j(512,512),this.map=null,this.mapPass=null,this.matrix=new Me,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new vr,this._frameExtents=new j(1,1),this._viewportCount=1,this._viewports=[new V(0,0,1,1)]}return S(e,[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var t=this.camera,r=this.matrix;cs.setFromMatrixPosition(e.matrixWorld),t.position.copy(cs),hs.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(hs),t.updateMatrixWorld(),ls.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ls),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(t.projectionMatrix),r.multiply(t.matrixWorldInverse)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}]),e}(),fs=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this,new or(50,1,.5,500))).focus=1,e}return S(r,[{key:"updateMatrices",value:function(e){var t=this.camera,n=2*C*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;n===t.fov&&i===t.aspect&&o===t.far||(t.fov=n,t.aspect=i,t.far=o,t.updateProjectionMatrix()),f(b(r.prototype),"updateMatrices",this).call(this,e)}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.focus=e.focus,this}}]),r}(ds);fs.prototype.isSpotLightShadow=!0;var ps=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return x(this,r),(i=t.call(this,e,n)).type="SpotLight",i.position.copy(Qe.DefaultUp),i.updateMatrix(),i.target=new Qe,i.distance=o,i.angle=a,i.penumbra=s,i.decay=u,i.shadow=new fs,i}return S(r,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}]),r}(ss);ps.prototype.isSpotLight=!0;var vs=new Me,gs=new X,ms=new X,ys=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this,new or(90,1,.5,500)))._frameExtents=new j(4,2),e._viewportCount=6,e._viewports=[new V(2,1,1,1),new V(0,1,1,1),new V(3,1,1,1),new V(1,1,1,1),new V(3,0,1,1),new V(1,0,1,1)],e._cubeDirections=[new X(1,0,0),new X(-1,0,0),new X(0,0,1),new X(0,0,-1),new X(0,1,0),new X(0,-1,0)],e._cubeUps=[new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,0,1),new X(0,0,-1)],e}return S(r,[{key:"updateMatrices",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.camera,n=this.matrix,i=e.distance||r.far;i!==r.far&&(r.far=i,r.updateProjectionMatrix()),gs.setFromMatrixPosition(e.matrixWorld),r.position.copy(gs),ms.copy(r.position),ms.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(ms),r.updateMatrixWorld(),n.makeTranslation(-gs.x,-gs.y,-gs.z),vs.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vs)}}]),r}(ds);ys.prototype.isPointLightShadow=!0;var _s=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),(i=t.call(this,e,n)).type="PointLight",i.distance=o,i.decay=a,i.shadow=new ys,i}return S(r,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}]),r}(ss);_s.prototype.isPointLight=!0;var bs=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return x(this,r),(e=t.call(this)).type="OrthographicCamera",e.zoom=1,e.view=null,e.left=n,e.right=i,e.top=o,e.bottom=a,e.near=s,e.far=u,e.updateProjectionMatrix(),e}return S(r,[{key:"copy",value:function(e,t){return f(b(r.prototype),"copy",this).call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,t,r,n,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2,i=r-e,o=r+e,a=n+t,s=n-t;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=u*this.view.offsetX)+u*this.view.width,s=(a-=l*this.view.offsetY)-l*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}]),r}(ir);bs.prototype.isOrthographicCamera=!0;var xs=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.call(this,new bs(-5,5,5,-5,.5,500))}return r}(ds);xs.prototype.isDirectionalLightShadow=!0;var ws=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="DirectionalLight",i.position.copy(Qe.DefaultUp),i.updateMatrix(),i.target=new Qe,i.shadow=new xs,i}return S(r,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}]),r}(ss);ws.prototype.isDirectionalLight=!0;var Ss=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).type="AmbientLight",i}return r}(ss);Ss.prototype.isAmbientLight=!0;var Ts=function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return x(this,r),(i=t.call(this,e,n)).type="RectAreaLight",i.width=o,i.height=a,i}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.width=e.width,this.height=e.height,this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}]),r}(ss);Ts.prototype.isRectAreaLight=!0;var Ms=function(){function e(){x(this,e),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new X)}return S(e,[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var r=e.x,n=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*n),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],r*n*1.092548),t.addScaledVector(o[5],n*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],r*i*1.092548),t.addScaledVector(o[8],.546274*(r*r-n*n)),t}},{key:"getIrradianceAt",value:function(e,t){var r=e.x,n=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*n),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*r),t.addScaledVector(o[4],.858086*r*n),t.addScaledVector(o[5],.858086*n*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*r*i),t.addScaledVector(o[8],.429043*(r*r-n*n)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.coefficients,n=0;n<9;n++)r[n].fromArray(e,t+3*n);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.coefficients,n=0;n<9;n++)r[n].toArray(e,t+3*n);return e}}],[{key:"getBasisAt",value:function(e,t){var r=e.x,n=e.y,i=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*i,t[3]=.488603*r,t[4]=1.092548*r*n,t[5]=1.092548*n*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*r*i,t[8]=.546274*(r*r-n*n)}}]),e}();Ms.prototype.isSphericalHarmonics3=!0;var ks=function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ms,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return x(this,r),(e=t.call(this,void 0,i)).sh=n,e}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.sh.copy(e.sh),this}},{key:"fromJSON",value:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.object.sh=this.sh.toArray(),t}}]),r}(ss);ks.prototype.isLightProbe=!0;var Es=function(){function e(){x(this,e)}return S(e,null,[{key:"decodeText",value:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;r3&&void 0!==arguments[3]?arguments[3]:1;return x(this,r),"number"==typeof i&&(a=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),(o=t.call(this,e,n,i)).meshPerAttribute=a,o}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"toJSON",value:function(){var e=f(b(r.prototype),"toJSON",this).call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}]),r}(bt);Cs.prototype.isInstancedBufferAttribute=!0,function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),n=t.call(this,e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),n.options={premultiplyAlpha:"none"},n}return S(r,[{key:"setOptions",value:function(e){return this.options=e,this}},{key:"load",value:function(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=Qa.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(r){Qa.add(e,r),t&&t(r),i.manager.itemEnd(e)})).catch((function(t){n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}]),r}(Ka).prototype.isImageBitmapLoader=!0;var Ps=function(e){p(r,e);var t=g(r);function r(e){return x(this,r),t.call(this,e)}return S(r,[{key:"load",value:function(e,t,r,n){var i=this,o=new es(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(r){try{var o=r.slice(0);(void 0===Is&&(Is=new(window.AudioContext||window.webkitAudioContext)),Is).decodeAudioData(o,(function(e){t(e)}))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}}]),r}(Ka);(function(e){p(r,e);var t=g(r);function r(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;x(this,r),i=t.call(this,void 0,o);var a=(new gt).set(e),s=(new gt).set(n),u=new X(a.r,a.g,a.b),l=new X(s.r,s.g,s.b),c=Math.sqrt(Math.PI),h=c*Math.sqrt(.75);return i.sh.coefficients[0].copy(u).add(l).multiplyScalar(c),i.sh.coefficients[1].copy(u).sub(l).multiplyScalar(h),i}return r})(ks).prototype.isHemisphereLightProbe=!0,function(e){p(r,e);var t=g(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;x(this,r),n=t.call(this,void 0,i);var o=(new gt).set(e);return n.sh.coefficients[0].set(o.r,o.g,o.b).multiplyScalar(2*Math.sqrt(Math.PI)),n}return r}(ks).prototype.isAmbientLightProbe=!0;var Ns=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).type="Audio",n.listener=e,n.context=e.context,n.gain=n.context.createGain(),n.gain.connect(e.getInput()),n.autoplay=!1,n.buffer=null,n.detune=0,n.loop=!1,n.loopStart=0,n.loopEnd=0,n.offset=0,n.duration=void 0,n.playbackRate=1,n.isPlaying=!1,n.hasPlaybackControl=!0,n.source=null,n.sourceType="empty",n._startedAt=0,n._progress=0,n._connected=!1,n.filters=[],n}return S(r,[{key:"getOutput",value:function(){return this.gain}},{key:"setNodeSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}},{key:"setMediaElementSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}},{key:"setMediaStreamSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}},{key:"setBuffer",value:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"connect",value:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(var u=t,l=t+t;u!==l;++u)if(r[u]!==r[u+t]){a.setValue(r,n);break}}},{key:"saveOriginalState",value:function(){var e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(var i=r,o=n;i!==o;++i)t[i]=t[n+i%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}},{key:"restoreOriginalState",value:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}},{key:"_setAdditiveIdentityNumeric",value:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,r=e;r=.5)for(var o=0;o!==i;++o)e[t+o]=e[r+o]}},{key:"_slerp",value:function(e,t,r,n){$.slerpFlat(e,t,e,t,e,r,n)}},{key:"_slerpAdditive",value:function(e,t,r,n,i){var o=this._workIndex*i;$.multiplyQuaternionsFlat(e,o,e,t,e,r),$.slerpFlat(e,t,e,t,e,o,n)}},{key:"_lerp",value:function(e,t,r,n,i){for(var o=1-n,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[r+a]*n}}},{key:"_lerpAdditive",value:function(e,t,r,n,i){for(var o=0;o!==i;++o){var a=t+o;e[a]=e[a]+e[r+o]*n}}}]),e}(),Rs=new RegExp("[\\[\\]\\.:\\/]","g"),Ds="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ls=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),js=/(WCOD+)?/.source.replace("WCOD",Ds),zs=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Bs=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Fs=new RegExp("^"+Ls+js+zs+Bs+"$"),Us=["material","materials","bones"],Ws=function(){function e(t,r,n){x(this,e),this.path=r,this.parsedPath=n||e.parseTrackName(r),this.node=e.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return S(e,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(e,t){e[t]=this.node[this.propertyName]}},{key:"_getValue_array",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)e[t++]=r[n]}},{key:"_getValue_arrayElement",value:function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(e,t){this.resolvedProperty.toArray(e,t)}},{key:"_setValue_direct",value:function(e,t){this.targetObject[this.propertyName]=e[t]}},{key:"_setValue_direct_setNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++]}},{key:"_setValue_array_setNeedsUpdate",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(e,t){this.resolvedProperty.fromArray(e,t)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(e,t){this.bind(),this.getValue(e,t)}},{key:"_setValue_unbound",value:function(e,t){this.bind(),this.setValue(e,t)}},{key:"bind",value:function(){var t=this.node,r=this.parsedPath,n=r.objectName,i=r.propertyName,o=r.propertyIndex;if(t||(t=e.findNode(this.rootNode,r.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=r.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.blendMode;x(this,e),this._mixer=t,this._clip=r,this._localRoot=n,this.blendMode=i;for(var o=r.tracks,a=o.length,s=new Array(a),u={endingStart:2400,endingEnd:2400},l=0;l!==a;++l){var c=o[l].createInterpolant(null);s[l]=c,c.settings=u}this._interpolantSettings=u,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return S(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){var n=this._clip.duration,i=e._clip.duration,o=i/n,a=n/i;e.warp(1,o,t),this.warp(a,1,t)}return this}},{key:"crossFadeTo",value:function(e,t,r){return e.crossFadeFrom(this,t,r)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,r){var n=this._mixer,i=n.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+r,u[0]=e/o,u[1]=t/o,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,r,n){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*r;if(o<0||0===r)return;this._startTime=null,t=r*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0){var u=this._interpolants,l=this._propertyBindings;if(2501===this.blendMode)for(var c=0,h=u.length;c!==h;++c)u[c].evaluate(a),l[c].accumulateAdditive(s);else for(var d=0,f=u.length;d!==f;++d)u[d].evaluate(a),l[d].accumulate(n,s)}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var r=this._timeScaleInterpolant;null!==r&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,r=this.loop,n=this.time+e,i=this._loopCount,o=2202===r;if(0===e)return-1===i?n:o&&1==(1&i)?t-n:n;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n>=t||n<0){var a=Math.floor(n/t);n-=t*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=n;if(o&&1==(1&i))return t-n}return n}},{key:"_setEndings",value:function(e,t,r){var n=this._interpolantSettings;r?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}},{key:"_scheduleFading",value:function(e,t,r){var n=this._mixer,i=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=r,this}}]),e}();(function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this))._root=e,n._initMemoryManager(),n._accuIndex=0,n.time=0,n.timeScale=1,n}return S(r,[{key:"_bindAction",value:function(e,t){var r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,o=e._propertyBindings,a=e._interpolants,s=r.uuid,u=this._bindingsByRootAndName,l=u[s];void 0===l&&(l={},u[s]=l);for(var c=0;c!==i;++c){var h=n[c],d=h.name,f=l[d];if(void 0!==f)o[c]=f;else{if(void 0!==(f=o[c])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=t&&t._propertyBindings[c].binding.parsedPath;++(f=new Os(Ws.create(r,d,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(f,s,d),o[c]=f}a[c].resultBuffer=f.buffer}}},{key:"_activateAction",value:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}},{key:"_deactivateAction",value:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,r=0,n=t.length;r!==n;++r){var i=t[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}},{key:"_initMemoryManager",value:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}},{key:"_isActiveAction",value:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}},{key:"update",value:function(e){e*=this.timeScale;for(var t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==r;++a)t[a]._update(n,e,i,o);for(var s=this._bindings,u=this._nActiveBindings,l=0;l!==u;++l)s[l].apply(o);return this}},{key:"setTime",value:function(e){this.time=0;for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:1;return x(this,r),(i=t.call(this,e,n)).meshPerAttribute=o,i}return S(r,[{key:"copy",value:function(e){return f(b(r.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"clone",value:function(e){var t=f(b(r.prototype),"clone",this).call(this,e);return t.meshPerAttribute=this.meshPerAttribute,t}},{key:"toJSON",value:function(e){var t=f(b(r.prototype),"toJSON",this).call(this,e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}]),r}(Oi).prototype.isInstancedInterleavedBuffer=!0,new j,new X,new X,function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this)).material=e,n.render=function(){},n.hasPositions=!1,n.hasNormals=!1,n.hasColors=!1,n.hasUvs=!1,n.positionArray=null,n.normalArray=null,n.colorArray=null,n.uvArray=null,n.count=0,n}return r}(Qe).prototype.isImmediateRenderObject=!0;var Vs=new X,Hs=new Me,Ys=new Me,$s=new Float32Array(1);new Int32Array($s.buffer);var Xs=[.125,.215,.35,.446,.526,.582],qs=5+Xs.length,Qs=new mt({side:1,depthWrite:!1,depthTest:!1});new Zt(new Jt,Qs),function(){for(var e=[],t=[],r=[],n=8,i=0;i4?a=Xs[i-8+4-1]:0==i&&(a=0),r.push(a);for(var s=1/(o-1),u=-s/2,l=1+s/2,c=[u,u,l,u,l,l,u,u,l,l,u,l],h=new Float32Array(108),d=new Float32Array(72),f=new Float32Array(36),p=0;p<6;p++){var v=p%3*2/3-1,g=p>2?0:-1,m=[v,g,0,v+2/3,g,0,v+2/3,g+1,0,v,g,0,v+2/3,g+1,0,v,g+1,0];h.set(m,18*p),d.set(c,12*p);var y=[p,p,p,p,p,p];f.set(y,6*p)}var _=new Ot;_.setAttribute("position",new bt(h,3)),_.setAttribute("uv",new bt(d,2)),_.setAttribute("faceIndex",new bt(f,1)),e.push(_),n>4&&n--}}(),Co.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Co.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},os.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},function(e){p(r,e);var t=g(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;x(this,r),o=new gt(o),a=new gt(a);for(var s=i/2,u=n/i,l=n/2,c=[],h=[],d=0,f=0,p=-l;d<=i;d++,p+=u){c.push(-l,0,p,l,0,p),c.push(p,0,-l,p,0,l);var v=d===s?o:a;v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3}var g=new Ot;return g.setAttribute("position",new Tt(c,3)),g.setAttribute("color",new Tt(h,3)),(e=t.call(this,g,new co({vertexColors:!0,toneMapped:!1}))).type="GridHelper",e}return r}(bo).prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r);for(var i=function e(t){var r=[];t&&t.isBone&&r.push(t);for(var n=0;n=.3&&e<.7){var r=(e-.3)/.4;this.isRight?(this.group.position.z=-1*(.25*this.height+.55*this.height*r),this.group.position.x=-1*(this.width+this.gap)*r):(this.group.position.z=-1*(.25*this.height+.55*this.height*r),this.group.position.x=(this.width+this.gap)*r)}else{var n=(e-.7)/.3;this.isRight?(this.group.position.x=-1*(this.width+this.gap),this.group.position.z=.8*this.height*-1*(1-n),this.group.rotation.y=Math.PI/12*-1*(1-n)):(this.group.position.x=this.width+this.gap,this.group.position.z=.8*this.height*-1*(1-n),this.group.rotation.y=Math.PI/12*(1-n))}}},{key:"isRight",get:function(){var e=this.options.find((function(e){return"dir"===e.name}));return!e||"r"===e.value}}]),e}(),Switch:function(){function e(){x(this,e),this.camera=new Du,this.duration=6e3,this.options=[],this.prevMesh=new Zt,this.nextMesh=new Zt,this.width=100,this.height=100,this.depth=1,this.prevDepth=1}return S(e,[{key:"addObjects",value:function(e){e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"dispose",value:function(){Array.isArray(this.prevMesh.material)?this.prevMesh.material.forEach((function(e){return e.dispose()})):this.prevMesh.material.dispose(),this.prevMesh.geometry.dispose(),Array.isArray(this.nextMesh.material)?this.nextMesh.material.forEach((function(e){return e.dispose()})):this.nextMesh.material.dispose(),this.nextMesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=new mt({map:e});this.nextMesh.material=t}},{key:"setPrevTexture",value:function(e){var t=new mt({map:e});this.prevMesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t),this.width=e,this.height=t,this.depth=t/2;var r=new yr(e,t,1,1);this.prevMesh.geometry=r;var n=new yr(e,t,1,1);this.nextMesh.geometry=n,this.prevDepth=this.prevMesh.position.z}},{key:"updateAnimation",value:function(e){var t=this.options.find((function(e){return"dir"===e.name}));if(e<.5){var r=e/.5;this.prevMesh.position.x=this.width/2*r,this.prevMesh.rotation.y=-Math.PI/10*r,this.nextMesh.position.x=-this.width/2*r,this.nextMesh.rotation.y=Math.PI/10*r,this.nextMesh.position.z=this.prevDepth-this.depth*(1-r)}else{var n=(e-.5)/.5;this.prevMesh.position.x=this.width/2*(1-n),this.prevMesh.rotation.y=-Math.PI/10*(1-n),this.prevMesh.position.z=this.prevDepth-this.depth*n,this.nextMesh.position.x=-this.width/2*(1-n),this.nextMesh.rotation.y=Math.PI/10*(1-n)}if(t&&"l"===t.value)if(e<.5){var i=e/.5;this.prevMesh.position.x=-this.width/2*i,this.prevMesh.rotation.y=Math.PI/10*i,this.nextMesh.position.x=this.width/2*i,this.nextMesh.rotation.y=-Math.PI/10*i}else{var o=(e-.5)/.5;this.prevMesh.position.x=-this.width/2*(1-o),this.prevMesh.rotation.y=Math.PI/10*(1-o),this.nextMesh.position.x=this.width/2*(1-o),this.nextMesh.rotation.y=-Math.PI/10*(1-o)}}}]),e}(),Prism:function(){function e(){x(this,e),this.camera=new Du,this.duration=6e3,this.preset=null,this.presetZ=0,this.mesh=new Zt,this.width=100,this.height=100}return S(e,[{key:"addObjects",value:function(e){this.mesh.geometry=this.box,e.add(this.mesh)}},{key:"dispose",value:function(){Array.isArray(this.mesh.material)?this.mesh.material.forEach((function(e){return e.dispose()})):this.mesh.material.dispose(),this.mesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new mt({map:e})),t.push(new mt({map:e})),t.push(new mt({map:e})),this.mesh.material=t}},{key:"setPrevTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new mt({map:e})),t.push(new mt({map:e})),t.push(new mt({map:e})),this.mesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.mesh,t),this.mesh.position.z-=e/2,this.width=e,this.height=t,this.box=new Jt(e,t,e,1,1,1),this.mesh.geometry=this.box}},{key:"updateAnimation",value:function(e){null===this.preset&&(this.preset=e>0?0:Math.PI/2,this.presetZ=this.mesh.position.z);var t=Math.PI/2*e,r=(Math.sqrt(2)-1)*(this.width/2);this.mesh.rotation.y=this.preset+t,this.mesh.position.z=e<=.5?this.presetZ-e/.5*r:this.presetZ-(1-(e-.5)/.5)*r}}]),e}(),Doors:function(){function e(){x(this,e),this.camera=new Du,this.duration=1600,this.options=[],this.width=100,this.preMaterial=new nr({fragmentShader:Pl.a,vertexShader:Il.a,uniforms:{prevTexture:{value:ou},timePercent:{value:0},offset:{value:0}}}),this.prevGeometry=new Ot,this.prevMesh=new Zt,this.nextMesh=new Zt}return S(e,[{key:"addObjects",value:function(e){this.prevMesh.material=this.preMaterial,this.prevMesh.geometry=this.prevGeometry,this.prevMesh.material.transparent=!0,e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"setNextTexture",value:function(e){this.nextMesh.material=new mt({map:e})}},{key:"setPrevTexture",value:function(e){this.preMaterial.uniforms.prevTexture.value=e}},{key:"setSize",value:function(e,t){this.width=e,this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t);var r=e/2,n=t/2;this.preMaterial.uniforms.offset.value=e/2,this.prevGeometry.setIndex([0,1,2,3,4,5,6,7,8,9,10,11]);var i=this.options.find((function(e){return"dir"===e.name})),o=i&&"vert"===i.value?0:1;this.preMaterial.uniforms.option={value:o},1===o?(this.prevGeometry.setAttribute("position",new Tt([-r,n,0,-r,0,0,r,n,0,-r,0,0,r,0,0,r,n,0,-r,0,0,-r,-n,0,r,0,0,-r,-n,0,r,-n,0,r,0,0],3)),this.prevGeometry.setAttribute("uv",new Tt([0,1,0,.5,1,1,0,.5,1,.5,1,1,0,.5,0,0,1,.5,0,0,1,0,1,.5],2))):(this.prevGeometry.setAttribute("position",new Tt([-r,n,0,-r,-n,0,0,n,0,-r,-n,0,0,-n,0,0,n,0,0,n,0,0,-n,0,r,n,0,0,-n,0,r,-n,0,r,n,0],3)),this.prevGeometry.setAttribute("uv",new Tt([0,1,0,0,.5,1,0,0,.5,0,.5,1,.5,1,.5,0,1,1,.5,0,1,0,1,1],2))),this.prevGeometry.setAttribute("left",new Tt([1,1,1,1,1,1,0,0,0,0,0,0],1)),this.nextMesh.geometry=new yr(e,t,1,1),this.nextMesh.position.z=this.prevMesh.position.z-e/4}},{key:"updateAnimation",value:function(e){this.preMaterial.uniforms.timePercent.value=e,this.nextMesh.position.z=this.prevMesh.position.z-(1-e)*(this.width/4)}},{key:"dispose",value:function(){}}]),e}()},Ol=function(){function e(){var t=this;x(this,e),this.startTime=0,this.lastTime=0,this.lastFPSTime=0,this.renderingDuration=16,this.reverse=!1,this.scene=new Ni,this.delay=0,this.easeFn=iu.linear,this.preset=null,this.onTransactionEnd=function(){},this.isTransactionStartApplied=!1,this.prevTexture=null,this.nextTexture=null,this.animationId=null,this.config=null,this.renderer=new Pi({alpha:!0,premultipliedAlpha:!0}),this.isPlaying=!1,this.animate=function(){var e,r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.fps(i)){t.renderer.clear(),i>t.delay&&0===t.lastTime&&(t.lastTime=i,t.startTime=i);var o=0;t.lastTime>0&&o<1&&(o=t.easeFn(i-t.startTime,0,1,null!==(r=null===(e=t.preset)||void 0===e?void 0:e.duration)&&void 0!==r?r:0)),o>1&&(o=1),null===(n=t.preset)||void 0===n||n.updateAnimation(t.reverse?1-o:o),t.rerender(),t.isTransactionStartApplied||(t.isTransactionStartApplied=!0),o<1?t.animationId=window.requestAnimationFrame(t.animate):t.onTransactionEnd()}else t.animationId=window.requestAnimationFrame(t.animate)}}return S(e,[{key:"initPlayer",value:function(e){this.config=e,this.reverse=e.reverse,e.delay&&Number.isInteger(e.delay)&&(this.delay=e.delay),e.easeFn&&(this.easeFn=iu[e.easeFn]),e.maxFPS&&Number.isInteger(e.maxFPS)&&e.maxFPS>0&&(this.renderingDuration=Math.ceil(1e3/e.maxFPS)),this.startTime=0,this.lastTime=0,this.scene.clear(),this.renderer.shadowMap.enabled=!0,this.renderer.autoClear=!1,this.renderer.setClearColor(e.clearColor||0),this.isTransactionStartApplied=!1,this.renderer.setSize(e.stageWidth,e.stageHeight),this.preset=new Nl[e.presetType],e.options&&(this.preset.options=e.options),e.duration&&Number.isInteger(e.duration)&&(this.preset.duration=e.duration),this.preset.setSize(e.stageWidth,e.stageHeight)}},{key:"setPrevTexture",value:function(e){var t,r,n,i;e.needsUpdate=!0,this.reverse?(this.nextTexture=e,null===(t=this.preset)||void 0===t||t.setNextTexture(e)):(this.prevTexture=e,null===(r=this.preset)||void 0===r||r.setPrevTexture(e)),null===(n=this.preset)||void 0===n||n.addObjects(this.scene),null===(i=this.preset)||void 0===i||i.updateAnimation(this.reverse?1:0),this.rerender()}},{key:"setNextTexture",value:function(e){var t,r;e.needsUpdate=!0,this.reverse?(this.prevTexture=e,null===(t=this.preset)||void 0===t||t.setPrevTexture(e)):(this.nextTexture=e,null===(r=this.preset)||void 0===r||r.setNextTexture(e))}},{key:"play",value:function(){var e=this;return new Promise((function(t){e.onTransactionEnd=t,e.animate(),e.isPlaying=!0}))}},{key:"rerender",value:function(){var e;this.renderer.clear(),(null===(e=this.preset)||void 0===e?void 0:e.camera.camera)&&this.renderer.render(this.scene,this.preset.camera.camera)}},{key:"fps",value:function(e){return e<=0||(this.lastFPSTime<0||e-this.lastFPSTime>=this.renderingDuration)&&(this.lastFPSTime=e,!0)}},{key:"skip",value:function(){var e;null===(e=this.preset)||void 0===e||e.updateAnimation(this.reverse?0:1),this.rerender(),this.dispose(),this.onTransactionEnd()}},{key:"dispose",value:function(){var e,t,r;window.cancelAnimationFrame(this.animationId),this.renderer.clear(),this.isPlaying=!1,null===(e=this.preset)||void 0===e||e.dispose(),null===(t=this.prevTexture)||void 0===t||t.dispose(),null===(r=this.nextTexture)||void 0===r||r.dispose();for(var n=this.scene.children.length-1;n>=0;n--){var i=this.scene.children[n];this.scene.remove(i)}this.scene.background=null}},{key:"destroy",value:function(){this.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose()}}]),e}();r(139);var Rl=r(3),Dl=r(5);Dl.c.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var Ll=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Rl.isMobile.tablet||Rl.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2..toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var r=0;r title : "+e.title+"
tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,r=t.width,n=t.height;e.x+e.width>r&&(e.width=r-e.x),e.y+e.height>n&&(e.height=n-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2..toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,r=e.target.displayObject,n=t.eventData;t.dispatchEvent(r,"click",n),t.dispatchEvent(r,"pointertap",n),t.dispatchEvent(r,"tap",n)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,r=e.target.displayObject,n=t.eventData;t.dispatchEvent(r,"mouseover",n)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,r=e.target.displayObject,n=t.eventData;t.dispatchEvent(r,"mouseout",n)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}(),jl=r(1),zl=r(7),Bl=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new jl.g,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(e.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),e.prototype.getLocalPosition=function(e,t,r){return e.worldTransform.applyInverse(r||this.global,t)},e.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},e.prototype.reset=function(){this.isPrimary=!1},e}(),Fl=function(e,t){return(Fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},Ul=function(){function e(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return e.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},e.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},e}(),Wl=function(){function e(t){this._pointerId=t,this._flags=e.FLAGS.NONE}return e.prototype._doSet=function(e,t){this._flags=t?this._flags|e:this._flags&~e},Object.defineProperty(e.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"none",{get:function(){return this._flags===e.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"over",{get:function(){return 0!=(this._flags&e.FLAGS.OVER)},set:function(t){this._doSet(e.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightDown",{get:function(){return 0!=(this._flags&e.FLAGS.RIGHT_DOWN)},set:function(t){this._doSet(e.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftDown",{get:function(){return 0!=(this._flags&e.FLAGS.LEFT_DOWN)},set:function(t){this._doSet(e.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),e.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),e}(),Gl=function(){function e(){this._tempPoint=new jl.g}return e.prototype.recursiveFindHit=function(e,t,r,n,i){if(!t||!t.visible)return!1;var o=e.data.global,a=!1,s=i=t.interactive||i,u=!0;if(t.hitArea?(n&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(n=!1,u=!1)),s=!1):t._mask&&n&&(t._mask.containsPoint&&t._mask.containsPoint(o)||(n=!1)),u&&t.interactiveChildren&&t.children)for(var l=t.children,c=l.length-1;c>=0;c--){var h=l[c],d=this.recursiveFindHit(e,h,r,n,s);if(d){if(!h.parent)continue;s=!1,d&&(e.target&&(n=!1),a=!0)}}return i&&(n&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(a=!0),t.interactive&&(a&&!e.target&&(e.target=t),r&&r(e,t,!!a))),a},e.prototype.findHit=function(e,t,r,n){this.recursiveFindHit(e,t,r,n,!1)},e}(),Vl={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(e){e?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Dl.c.mixin(Vl);var Hl={target:null,data:{global:null}},Yl=function(e){function t(t,r){var n=e.call(this)||this;return r=r||{},n.renderer=t,n.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,n.interactionFrequency=r.interactionFrequency||10,n.mouse=new Bl,n.mouse.identifier=1,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[1]=n.mouse,n.interactionDataPool=[],n.eventData=new Ul,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new Gl,n._tempDisplayObject=new Dl.d,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return function(e,t){function r(){this.constructor=e}Fl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return Hl.target=null,Hl.data.global=e,t||(t=this.lastObjectRendered),this.processInteractive(Hl,t,null,!0),Hl.target},t.prototype.setTargetElement=function(e,t){void 0===t&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(zl.a.system.add(this.tickerUpdate,this,zl.c.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(zl.a.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,this._deltaTime1&&"undefined"==typeof MSStream},Pc=function(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=t.userAgent,n=r.split("[FBAN");void 0!==n[1]&&(r=n[0]),void 0!==(n=r.split("Twitter"))[1]&&(r=n[0]);var i,o=(i=r,function(e){return e.test(i)}),a={apple:{phone:o(vc)&&!o(Sc),ipod:o(gc),tablet:!o(vc)&&(o(mc)||Cc(t))&&!o(Sc),universal:o(yc),device:(o(vc)||o(gc)||o(mc)||o(yc)||Cc(t))&&!o(Sc)},amazon:{phone:o(xc),tablet:!o(xc)&&o(wc),device:o(xc)||o(wc)},android:{phone:!o(Sc)&&o(xc)||!o(Sc)&&o(_c),tablet:!o(Sc)&&!o(xc)&&!o(_c)&&(o(wc)||o(bc)),device:!o(Sc)&&(o(xc)||o(wc)||o(_c)||o(bc))||o(/\bokhttp\b/i)},windows:{phone:o(Sc),tablet:o(Tc),device:o(Sc)||o(Tc)},other:{blackberry:o(Mc),blackberry10:o(kc),opera:o(Ec),firefox:o(Ac),chrome:o(Ic),device:o(Mc)||o(kc)||o(Ec)||o(Ac)||o(Ic)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}(globalThis.navigator); +var Ql,Zl,Kl,Jl,ec,tc,rc,nc,ic,oc,ac,sc,uc,lc,cc,hc,dc,fc,pc,vc=/iPhone/i,gc=/iPod/i,mc=/iPad/i,yc=/\biOS-universal(?:.+)Mac\b/i,_c=/\bAndroid(?:.+)Mobile\b/i,bc=/Android/i,xc=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,wc=/Silk/i,Sc=/Windows Phone/i,Tc=/\bWindows(?:.+)ARM\b/i,Mc=/BlackBerry/i,kc=/BB10/i,Ec=/Opera Mini/i,Ac=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ic=/Mobile(?:.+)Firefox\b/i,Cc=function(e){return void 0!==e&&"MacIntel"===e.platform&&"number"==typeof e.maxTouchPoints&&e.maxTouchPoints>1&&"undefined"==typeof MSStream},Pc=function(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=t.userAgent,n=r.split("[FBAN");void 0!==n[1]&&(r=n[0]),void 0!==(n=r.split("Twitter"))[1]&&(r=n[0]);var i,o=(i=r,function(e){return e.test(i)}),a={apple:{phone:o(vc)&&!o(Sc),ipod:o(gc),tablet:!o(vc)&&(o(mc)||Cc(t))&&!o(Sc),universal:o(yc),device:(o(vc)||o(gc)||o(mc)||o(yc)||Cc(t))&&!o(Sc)},amazon:{phone:o(xc),tablet:!o(xc)&&o(wc),device:o(xc)||o(wc)},android:{phone:!o(Sc)&&o(xc)||!o(Sc)&&o(_c),tablet:!o(Sc)&&!o(xc)&&!o(_c)&&(o(wc)||o(bc)),device:!o(Sc)&&(o(xc)||o(wc)||o(_c)||o(bc))||o(/\bokhttp\b/i)},windows:{phone:o(Sc),tablet:o(Tc),device:o(Sc)||o(Tc)},other:{blackberry:o(Mc),blackberry10:o(kc),opera:o(Ec),firefox:o(Ic),chrome:o(Ac),device:o(Mc)||o(kc)||o(Ec)||o(Ic)||o(Ac)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}(globalThis.navigator); /*! * @pixi/settings - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -156,7 +156,7 @@ var Ql,Zl,Kl,Jl,ec,tc,rc,nc,ic,oc,ac,sc,uc,lc,cc,hc,dc,fc,pc,vc=/iPhone/i,gc=/iP * * @pixi/compressed-textures is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */!function(e){e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"}(kh||(kh={}));var Ih=((Mh={})[kh.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,Mh[kh.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,Mh[kh.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,Mh[kh.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,Mh[kh.COMPRESSED_R11_EAC]=.5,Mh[kh.COMPRESSED_SIGNED_R11_EAC]=.5,Mh[kh.COMPRESSED_RG11_EAC]=1,Mh[kh.COMPRESSED_SIGNED_RG11_EAC]=1,Mh[kh.COMPRESSED_RGB8_ETC2]=.5,Mh[kh.COMPRESSED_RGBA8_ETC2_EAC]=1,Mh[kh.COMPRESSED_SRGB8_ETC2]=.5,Mh[kh.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,Mh[kh.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,Mh[kh.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,Mh[kh.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,Mh[kh.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,Mh[kh.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,Mh[kh.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,Mh[kh.COMPRESSED_RGB_ETC1_WEBGL]=.5,Mh[kh.COMPRESSED_RGB_ATC_WEBGL]=.5,Mh[kh.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,Mh[kh.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,Mh),Ah=function(e,t){return(Ah=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)}; + */!function(e){e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"}(kh||(kh={}));var Ah=((Mh={})[kh.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,Mh[kh.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,Mh[kh.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,Mh[kh.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,Mh[kh.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,Mh[kh.COMPRESSED_R11_EAC]=.5,Mh[kh.COMPRESSED_SIGNED_R11_EAC]=.5,Mh[kh.COMPRESSED_RG11_EAC]=1,Mh[kh.COMPRESSED_SIGNED_RG11_EAC]=1,Mh[kh.COMPRESSED_RGB8_ETC2]=.5,Mh[kh.COMPRESSED_RGBA8_ETC2_EAC]=1,Mh[kh.COMPRESSED_SRGB8_ETC2]=.5,Mh[kh.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,Mh[kh.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,Mh[kh.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,Mh[kh.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,Mh[kh.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,Mh[kh.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,Mh[kh.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,Mh[kh.COMPRESSED_RGB_ETC1_WEBGL]=.5,Mh[kh.COMPRESSED_RGB_ATC_WEBGL]=.5,Mh[kh.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,Mh[kh.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,Mh),Ih=function(e,t){return(Ih=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)}; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -170,7 +170,7 @@ var Ql,Zl,Kl,Jl,ec,tc,rc,nc,ic,oc,ac,sc,uc,lc,cc,hc,dc,fc,pc,vc=/iPhone/i,gc=/iP See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. - ***************************************************************************** */function Ch(e,t){function r(){this.constructor=e}Ah(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Ph,Nh,Oh=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i.format=n.format,i.levels=n.levels||1,i._width=n.width,i._height=n.height,i._extension=t._formatToExtension(i.format),(n.levelBuffers||i.buffer)&&(i._levelBuffers=n.levelBuffers||t._createLevelBuffers(r instanceof Uint8Array?r:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}return Ch(t,e),t.prototype.upload=function(e,t,r){var n=e.gl;if(!e.context.extensions[this._extension])throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var i=0,o=this.levels;i=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},t._createLevelBuffers=function(e,t,r,n,i,o,a){for(var s=new Array(r),u=e.byteOffset,l=o,c=a,h=l+n-1&~(n-1),d=c+i-1&~(i-1),f=h*d*Ih[t],p=0;p1?l:h,levelHeight:r>1?c:d,levelBuffer:new Uint8Array(e.buffer,u,f)},u+=f,f=(h=(l=l>>1||1)+n-1&~(n-1))*(d=(c=c>>1||1)+i-1&~(i-1))*Ih[t];return s},t}(function(e){function t(t,r){void 0===r&&(r={width:1,height:1,autoLoad:!0});var n,i,o=this;return"string"==typeof t?(n=t,i=new Uint8Array):(n=null,i=t),(o=e.call(this,i,r)||this).origin=n,o.buffer=i?new $l.x(i):null,o.origin&&!1!==r.autoLoad&&o.load(),i&&i.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return Ch(t,e),t.prototype.onBlobLoaded=function(e){},t.prototype.load=function(){return e=this,void 0,r=function(){var e;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>=1,x>>>=1;var S=148;for(w=0;w1||0!==o?w:T,levelHeight:f>1||0!==o?S:M,levelBuffer:new Uint8Array(r,A,x)},A+=x}k=(k+=I+4)%4!=0?k+4-k%4:k,x=(T=(w=w>>1||1)+4-1&-4)*(M=(S=S>>1||1)+4-1&-4)*v}return 0!==o?{uncompressed:y.map((function(t){var r=t[0].levelBuffer,n=!1;return o===Eh.r.FLOAT?r=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===Eh.r.UNSIGNED_INT?(n=!0,r=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===Eh.r.INT&&(n=!0,r=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new $l.i(r,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:n?e.convertFormatToInteger(a):a}})),kvData:b}:{compressed:y.map((function(e){return new Oh(null,{format:s,width:u,height:l,levels:f,levelBuffers:e})})),kvData:b}},e.validate=function(e,t){for(var r=0;rt-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u16384&&(n=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=t,o._batchSize=n,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=Eh.b.NORMAL,o.autoResize=i,o.roundPixels=!0,o.baseTexture=null,o.setProperties(r),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return Qh(t,e),t.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},t.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,Object(Rl.hex2rgb)(e,this.tintRgb)},enumerable:!1,configurable:!0}),t.prototype.render=function(e){var t=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return t.onChildrenChange(0)}))),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},t.prototype.onChildrenChange=function(e){for(var t=Math.floor(e/this._batchSize);this._bufferUpdateIDs.lengthr&&!e.autoResize&&(o=r);var a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));var s=t[0]._texture.baseTexture;this.state.blendMode=Object(Rl.correctBlendMode)(e.blendMode,s.alphaMode),i.state.set(this.state);var u=i.gl,l=e.worldTransform.copyTo(this.tempMatrix);l.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=l.toArray(!0),this.shader.uniforms.uColor=Object(Rl.premultiplyRgba)(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,s.alphaMode),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);for(var c=!1,h=0,d=0;hn&&(f=n),d>=a.length&&a.push(this._generateOneMoreBuffer(e));var p=a[d];p.uploadDynamic(t,h,f);var v=e._bufferUpdateIDs[d]||0;(c=c||p._updateID0,l=s.alpha,c=l<1&&u?Object(Rl.premultiplyTint)(s._tintRGB,l):s._tintRGB+(255*l<<24);n[o]=c,n[o+i]=c,n[o+2*i]=c,n[o+3*i]=c,o+=4*i}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},t}($l.m),rd=r(4);!function(e){e.MITER="miter",e.BEVEL="bevel",e.ROUND="round"}(Zh||(Zh={})),function(e){e.BUTT="butt",e.ROUND="round",e.SQUARE="square"}(Kh||(Kh={}));var nd={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(e,t){if(void 0===t&&(t=20),!this.adaptive||!e||isNaN(e))return t;var r=Math.ceil(e/this.maxLength);return rthis.maxSegments&&(r=this.maxSegments),r}},id=function(){function e(){this.color=16777215,this.alpha=1,this.texture=$l.t.WHITE,this.matrix=null,this.visible=!1,this.reset()}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},e.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=$l.t.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),od=function(e,t){return(od=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function ad(e,t){function r(){this.constructor=e}od(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function sd(e,t){var r,n;void 0===t&&(t=!1);var i=e.length;if(!(i<6)){for(var o=0,a=0,s=e[i-2],u=e[i-1];a0||t&&o<=0){var h=i/2;for(a=h+h%2;a=6){sd(r,!1);for(var a=[],s=0;s=0&&a>=0&&n>=0&&i>=0){var f=Math.ceil(2.3*Math.sqrt(o+a)),p=8*f+(n?4:0)+(i?4:0);if(s.length=p,0!==p){if(0===f)return s.length=8,s[0]=s[6]=t+n,s[1]=s[3]=r+i,s[2]=s[4]=t-n,void(s[5]=s[7]=r-i);var v,g,m=0,y=4*f+(n?2:0)+2,_=y,b=p,x=t+(v=n+o),w=t-v,S=r+(g=i);if(s[m++]=x,s[m++]=S,s[--y]=S,s[--y]=w,i){var T=r-g;s[_++]=w,s[_++]=T,s[--b]=T,s[--b]=x}for(var M=1;Mh&&(h+=2*Math.PI);var d=c,f=h-c,p=Math.abs(f),v=Math.sqrt(u*u+l*l),g=1+(15*p*Math.sqrt(v)/Math.PI>>0),m=f/g;if(d+=m,s){a.push(e,t),a.push(r,n);for(var y=1,_=d;yy?(B?(d.push(H,Y),d.push(x+M*N,w+k*N),d.push(H,Y),d.push(x+E*N,w+I*N)):(d.push(x-M*P,w-k*P),d.push($,X),d.push(x-E*P,w-I*P),d.push($,X)),p+=2):o.join===Zh.ROUND?B?(d.push(H,Y),d.push(x+M*N,w+k*N),p+=pd(x,w,x+M*N,w+k*N,x+E*N,w+I*N,d,!0)+4,d.push(H,Y),d.push(x+E*N,w+I*N)):(d.push(x-M*P,w-k*P),d.push($,X),p+=pd(x,w,x-M*P,w-k*P,x-E*P,w-I*P,d,!1)+4,d.push(x-E*P,w-I*P),d.push($,X)):(d.push(H,Y),d.push($,X)):(d.push(x-M*P,w-k*P),d.push(x+M*N,w+k*N),o.join===Zh.ROUND?p+=B?pd(x,w,x+M*N,w+k*N,x+E*N,w+I*N,d,!0)+2:pd(x,w,x-M*P,w-k*P,x-E*P,w-I*P,d,!1)+2:o.join===Zh.MITER&&V/m<=y&&(B?(d.push($,X),d.push($,X)):(d.push(H,Y),d.push(H,Y)),p+=2),d.push(x-E*P,w-I*P),d.push(x+E*N,w+I*N),p+=2)}}_=n[2*(f-2)],b=n[2*(f-2)+1],x=n[2*(f-1)],M=-(b-(w=n[2*(f-1)+1])),k=_-x,M/=A=Math.sqrt(M*M+k*k),k/=A,M*=g,k*=g,d.push(x-M*P,w-k*P),d.push(x+M*N,w+k*N),u||(o.cap===Kh.ROUND?p+=pd(x-M*(P-N)*.5,w-k*(P-N)*.5,x-M*P,w-k*P,x+M*N,w+k*N,d,!1)+2:o.cap===Kh.SQUARE&&(p+=fd(x,w,M,k,P,N,!1,d)));var Q=t.indices,Z=nd.epsilon*nd.epsilon;for(O=v;Oc*s}},e.arc=function(e,t,r,n,i,o,a,s,u){for(var l=a-o,c=nd._segmentsCount(Math.abs(l)*i,40*Math.ceil(Math.abs(l)/jl.f)),h=l/(2*c),d=2*h,f=Math.cos(h),p=Math.sin(h),v=c-1,g=v%1/v,m=0;m<=v;++m){var y=h+o+d*(m+g*m),_=Math.cos(y),b=-Math.sin(y);u.push((f*_+p*b)*i+r,(f*-b+p*_)*i+n)}},e}(),_d=function(){function e(){}return e.curveLength=function(e,t,r,n,i,o,a,s){for(var u=0,l=0,c=0,h=0,d=0,f=0,p=0,v=0,g=0,m=0,y=0,_=e,b=t,x=1;x<=10;++x)m=_-(v=(p=(f=(d=1-(l=x/10))*d)*d)*e+3*f*l*r+3*d*(c=l*l)*i+(h=c*l)*a),y=b-(g=p*t+3*f*l*n+3*d*c*o+h*s),_=v,b=g,u+=Math.sqrt(m*m+y*y);return u},e.curveTo=function(t,r,n,i,o,a,s){var u=s[s.length-2],l=s[s.length-1];s.length-=2;var c=nd._segmentsCount(e.curveLength(u,l,t,r,n,i,o,a)),h=0,d=0,f=0,p=0,v=0;s.push(u,l);for(var g=1,m=0;g<=c;++g)f=(d=(h=1-(m=g/c))*h)*h,v=(p=m*m)*m,s.push(f*u+3*d*m*t+3*h*p*n+v*o,f*l+3*d*m*r+3*h*p*i+v*a)},e}(),bd=function(){function e(){}return e.curveLength=function(e,t,r,n,i,o){var a=e-2*r+i,s=t-2*n+o,u=2*r-2*e,l=2*n-2*t,c=4*(a*a+s*s),h=4*(a*u+s*l),d=u*u+l*l,f=2*Math.sqrt(c+h+d),p=Math.sqrt(c),v=2*c*p,g=2*Math.sqrt(d),m=h/p;return(v*f+p*h*(f-g)+(4*d*c-h*h)*Math.log((2*p+m+f)/(m+g)))/(4*v)},e.curveTo=function(t,r,n,i,o){for(var a=o[o.length-2],s=o[o.length-1],u=nd._segmentsCount(e.curveLength(a,s,t,r,n,i)),l=0,c=0,h=1;h<=u;++h){var d=h/u;l=a+(t-a)*d,c=s+(r-s)*d,o.push(l+(t+(n-t)*d-l)*d,c+(r+(i-r)*d-c)*d)}},e}(),xd=function(){function e(){this.reset()}return e.prototype.begin=function(e,t,r){this.reset(),this.style=e,this.start=t,this.attribStart=r},e.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},e.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},e}(),wd=((gd={})[jl.l.POLY]=ud,gd[jl.l.CIRC]=ld,gd[jl.l.ELIP]=ld,gd[jl.l.RECT]={build:function(e){var t=e.shape,r=t.x,n=t.y,i=t.width,o=t.height,a=e.points;a.length=0,a.push(r,n,r+i,n,r+i,n+o,r,n+o)},triangulate:function(e,t){var r=e.points,n=t.points,i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},gd[jl.l.RREC]=dd,gd),Sd=[],Td=[],Md=function(){function e(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=r,this.fillStyle=t,this.matrix=n,this.type=e.type}return e.prototype.clone=function(){return new e(this.shape,this.fillStyle,this.lineStyle,this.matrix)},e.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},e}(),kd=new jl.g,Ed=new Dl.a,Id=function(e){function t(){var t=e.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new Dl.a,t.boundsDirty=-1,t}return ad(t,e),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),t.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var e=0;e0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},t.prototype.drawShape=function(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null);var i=new Md(e,t,r,n);return this.graphicsData.push(i),this.dirty++,this},t.prototype.drawHole=function(e,t){if(void 0===t&&(t=null),!this.graphicsData.length)return null;var r=new Md(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this},t.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t0&&(i=(n=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535&&e;this.indicesUint16=m?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},t.prototype._compareStyles=function(e,t){return!(!e||!t)&&e.texture.baseTexture===t.texture.baseTexture&&e.color+e.alpha===t.color+t.alpha&&!!e.native==!!t.native},t.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,t=this.graphicsData.length;e131070)return!1;for(var e=this.batches,r=0;r0&&((i=Td.pop())||((i=new $l.d).texArray=new $l.g),this.drawCalls.push(i)),i.start=c,i.size=0,i.texArray.count=0,i.type=l),f.touched=1,f._batchEnabled=e,f._batchLocation=o,f.wrapMode=Eh.s.REPEAT,i.texArray.elements[i.texArray.count++]=f,o++)),i.size+=h.size,c+=h.size,s=f._batchLocation,this.addColors(r,d.color,d.alpha,h.attribSize,h.attribStart),this.addTextureIds(n,s,h.attribSize,h.attribStart)}$l.c._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,t=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(3*e.length*4),o=new Float32Array(i),a=new Uint32Array(i),s=0,u=0;u>16)+(65280&t)+((255&t)<<16),a=Object(Rl.premultiplyTint)(o,r);e.length=Math.max(e.length,i+n);for(var s=0;s0&&e.alpha>0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:t},e)):this._lineStyle.reset(),this},t.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new jl.h,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new jl.h,this.currentPath.closeStroke=!1},t.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},t.prototype.moveTo=function(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this},t.prototype.lineTo=function(e,t){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return n===e&&i===t||r.push(e,t),this},t.prototype._initCurve=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[e,t]):this.moveTo(e,t)},t.prototype.quadraticCurveTo=function(e,t,r,n){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),bd.curveTo(e,t,r,n,i),this},t.prototype.bezierCurveTo=function(e,t,r,n,i,o){return this._initCurve(),_d.curveTo(e,t,r,n,i,o,this.currentPath.points),this},t.prototype.arcTo=function(e,t,r,n,i){this._initCurve(e,t);var o=this.currentPath.points,a=yd.curveTo(e,t,r,n,i,o);if(a){var s=a.cx,u=a.cy,l=a.radius,c=a.startAngle,h=a.endAngle,d=a.anticlockwise;this.arc(s,u,l,c,h,d)}return this},t.prototype.arc=function(e,t,r,n,i,o){if(void 0===o&&(o=!1),n===i)return this;if(!o&&i<=n?i+=jl.f:o&&n<=i&&(n+=jl.f),i-n==0)return this;var a=e+Math.cos(n)*r,s=t+Math.sin(n)*r,u=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){var c=Math.abs(l[l.length-2]-a),h=Math.abs(l[l.length-1]-s);c0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:t},e)):this._fillStyle.reset(),this},t.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},t.prototype.drawRect=function(e,t,r,n){return this.drawShape(new jl.j(e,t,r,n))},t.prototype.drawRoundedRect=function(e,t,r,n,i){return this.drawShape(new jl.k(e,t,r,n,i))},t.prototype.drawCircle=function(e,t,r){return this.drawShape(new jl.a(e,t,r))},t.prototype.drawEllipse=function(e,t,r,n){return this.drawShape(new jl.c(e,t,r,n))},t.prototype.drawPolygon=function(){for(var e,t=arguments,r=[],n=0;n>16&255)/255*i,o.tint[1]=(n>>8&255)/255*i,o.tint[2]=(255&n)/255*i,o.tint[3]=i,e.shader.bind(t),e.geometry.bind(r,t),e.state.set(this.state);for(var s=0,u=a.length;s>16)+(65280&i)+((255&i)<<16)}}},t.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var t=this.transform.worldTransform,r=t.a,n=t.b,i=t.c,o=t.d,a=t.tx,s=t.ty,u=this._geometry.points,l=this.vertexData,c=0,h=0;h=n&&Rd.x=i&&Rd.y>16)+(65280&e)+((255&e)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||$l.t.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),t}(Dl.b),jd=function(e,t){return(jd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};!function(e){e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(md||(md={}));var zd={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:md.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Bd=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Fd=function(){function e(e){this.styleID=0,this.reset(),Gd(this,e,e)}return e.prototype.clone=function(){var t={};return Gd(t,this,zd),new e(t)},e.prototype.reset=function(){Gd(this,zd,zd)},Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=Wd(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=Wd(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){(function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var r=0;r=0;r--){var n=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&Bd.indexOf(n)<0&&(n='"'+n+'"'),t[r]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},e}();function Ud(e){return"number"==typeof e?Object(Rl.hex2string)(e):("string"==typeof e&&0===e.indexOf("0x")&&(e=e.replace("0x","#")),e)}function Wd(e){if(Array.isArray(e)){for(var t=0;tp)if(""!==a&&(s+=e.addLine(a),a="",o=0),e.canBreakWords(m,r.breakWords))for(var x=e.wordWrapSplit(m),w=0;wp&&(s+=e.addLine(a),f=!1,a="",o=0),a+=S,o+=E}else{a.length>0&&(s+=e.addLine(a),a="",o=0);var I=g===v.length-1;s+=e.addLine(m,!I),f=!1,a="",o=0}else b+o>p&&(f=!1,s+=e.addLine(a),a="",o=0),(a.length>0||!e.isBreakingSpace(m)||f)&&(a+=m,o+=b)}return s+e.addLine(a,!1)},e.addLine=function(t,r){return void 0===r&&(r=!0),t=e.trimRight(t),r?t+"\n":t},e.getFromCache=function(e,t,r,n){var i=r[e];if("number"!=typeof i){var o=e.length*t;i=n.measureText(e).width+o,r[e]=i}return i},e.collapseSpaces=function(e){return"normal"===e||"pre-line"===e},e.collapseNewlines=function(e){return"normal"===e},e.trimRight=function(t){if("string"!=typeof t)return"";for(var r=t.length-1;r>=0;r--){var n=t[r];if(!e.isBreakingSpace(n))break;t=t.slice(0,-1)}return t},e.isNewline=function(t){return"string"==typeof t&&e._newlines.indexOf(t.charCodeAt(0))>=0},e.isBreakingSpace=function(t,r){return"string"==typeof t&&e._breakingSpaces.indexOf(t.charCodeAt(0))>=0},e.tokenize=function(t){var r=[],n="";if("string"!=typeof t)return r;for(var i=0;is;--d){for(v=0;v0&&p>v&&(g=(v+p)/2);var m=v+f,y=r.lineHeight*(d+1),_=m;d+1=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},t._createLevelBuffers=function(e,t,r,n,i,o,a){for(var s=new Array(r),u=e.byteOffset,l=o,c=a,h=l+n-1&~(n-1),d=c+i-1&~(i-1),f=h*d*Ah[t],p=0;p1?l:h,levelHeight:r>1?c:d,levelBuffer:new Uint8Array(e.buffer,u,f)},u+=f,f=(h=(l=l>>1||1)+n-1&~(n-1))*(d=(c=c>>1||1)+i-1&~(i-1))*Ah[t];return s},t}(function(e){function t(t,r){void 0===r&&(r={width:1,height:1,autoLoad:!0});var n,i,o=this;return"string"==typeof t?(n=t,i=new Uint8Array):(n=null,i=t),(o=e.call(this,i,r)||this).origin=n,o.buffer=i?new $l.x(i):null,o.origin&&!1!==r.autoLoad&&o.load(),i&&i.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return Ch(t,e),t.prototype.onBlobLoaded=function(e){},t.prototype.load=function(){return e=this,void 0,r=function(){var e;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>=1,x>>>=1;var S=148;for(w=0;w1||0!==o?w:T,levelHeight:f>1||0!==o?S:M,levelBuffer:new Uint8Array(r,I,x)},I+=x}k=(k+=A+4)%4!=0?k+4-k%4:k,x=(T=(w=w>>1||1)+4-1&-4)*(M=(S=S>>1||1)+4-1&-4)*v}return 0!==o?{uncompressed:y.map((function(t){var r=t[0].levelBuffer,n=!1;return o===Eh.r.FLOAT?r=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===Eh.r.UNSIGNED_INT?(n=!0,r=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===Eh.r.INT&&(n=!0,r=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new $l.i(r,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:n?e.convertFormatToInteger(a):a}})),kvData:b}:{compressed:y.map((function(e){return new Oh(null,{format:s,width:u,height:l,levels:f,levelBuffers:e})})),kvData:b}},e.validate=function(e,t){for(var r=0;rt-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u16384&&(n=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=t,o._batchSize=n,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=Eh.b.NORMAL,o.autoResize=i,o.roundPixels=!0,o.baseTexture=null,o.setProperties(r),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return Qh(t,e),t.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},t.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,Object(Rl.hex2rgb)(e,this.tintRgb)},enumerable:!1,configurable:!0}),t.prototype.render=function(e){var t=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return t.onChildrenChange(0)}))),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},t.prototype.onChildrenChange=function(e){for(var t=Math.floor(e/this._batchSize);this._bufferUpdateIDs.lengthr&&!e.autoResize&&(o=r);var a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));var s=t[0]._texture.baseTexture;this.state.blendMode=Object(Rl.correctBlendMode)(e.blendMode,s.alphaMode),i.state.set(this.state);var u=i.gl,l=e.worldTransform.copyTo(this.tempMatrix);l.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=l.toArray(!0),this.shader.uniforms.uColor=Object(Rl.premultiplyRgba)(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,s.alphaMode),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);for(var c=!1,h=0,d=0;hn&&(f=n),d>=a.length&&a.push(this._generateOneMoreBuffer(e));var p=a[d];p.uploadDynamic(t,h,f);var v=e._bufferUpdateIDs[d]||0;(c=c||p._updateID0,l=s.alpha,c=l<1&&u?Object(Rl.premultiplyTint)(s._tintRGB,l):s._tintRGB+(255*l<<24);n[o]=c,n[o+i]=c,n[o+2*i]=c,n[o+3*i]=c,o+=4*i}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},t}($l.m),rd=r(4);!function(e){e.MITER="miter",e.BEVEL="bevel",e.ROUND="round"}(Zh||(Zh={})),function(e){e.BUTT="butt",e.ROUND="round",e.SQUARE="square"}(Kh||(Kh={}));var nd={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(e,t){if(void 0===t&&(t=20),!this.adaptive||!e||isNaN(e))return t;var r=Math.ceil(e/this.maxLength);return rthis.maxSegments&&(r=this.maxSegments),r}},id=function(){function e(){this.color=16777215,this.alpha=1,this.texture=$l.t.WHITE,this.matrix=null,this.visible=!1,this.reset()}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},e.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=$l.t.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),od=function(e,t){return(od=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function ad(e,t){function r(){this.constructor=e}od(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function sd(e,t){var r,n;void 0===t&&(t=!1);var i=e.length;if(!(i<6)){for(var o=0,a=0,s=e[i-2],u=e[i-1];a0||t&&o<=0){var h=i/2;for(a=h+h%2;a=6){sd(r,!1);for(var a=[],s=0;s=0&&a>=0&&n>=0&&i>=0){var f=Math.ceil(2.3*Math.sqrt(o+a)),p=8*f+(n?4:0)+(i?4:0);if(s.length=p,0!==p){if(0===f)return s.length=8,s[0]=s[6]=t+n,s[1]=s[3]=r+i,s[2]=s[4]=t-n,void(s[5]=s[7]=r-i);var v,g,m=0,y=4*f+(n?2:0)+2,_=y,b=p,x=t+(v=n+o),w=t-v,S=r+(g=i);if(s[m++]=x,s[m++]=S,s[--y]=S,s[--y]=w,i){var T=r-g;s[_++]=w,s[_++]=T,s[--b]=T,s[--b]=x}for(var M=1;Mh&&(h+=2*Math.PI);var d=c,f=h-c,p=Math.abs(f),v=Math.sqrt(u*u+l*l),g=1+(15*p*Math.sqrt(v)/Math.PI>>0),m=f/g;if(d+=m,s){a.push(e,t),a.push(r,n);for(var y=1,_=d;yy?(B?(d.push(H,Y),d.push(x+M*N,w+k*N),d.push(H,Y),d.push(x+E*N,w+A*N)):(d.push(x-M*P,w-k*P),d.push($,X),d.push(x-E*P,w-A*P),d.push($,X)),p+=2):o.join===Zh.ROUND?B?(d.push(H,Y),d.push(x+M*N,w+k*N),p+=pd(x,w,x+M*N,w+k*N,x+E*N,w+A*N,d,!0)+4,d.push(H,Y),d.push(x+E*N,w+A*N)):(d.push(x-M*P,w-k*P),d.push($,X),p+=pd(x,w,x-M*P,w-k*P,x-E*P,w-A*P,d,!1)+4,d.push(x-E*P,w-A*P),d.push($,X)):(d.push(H,Y),d.push($,X)):(d.push(x-M*P,w-k*P),d.push(x+M*N,w+k*N),o.join===Zh.ROUND?p+=B?pd(x,w,x+M*N,w+k*N,x+E*N,w+A*N,d,!0)+2:pd(x,w,x-M*P,w-k*P,x-E*P,w-A*P,d,!1)+2:o.join===Zh.MITER&&V/m<=y&&(B?(d.push($,X),d.push($,X)):(d.push(H,Y),d.push(H,Y)),p+=2),d.push(x-E*P,w-A*P),d.push(x+E*N,w+A*N),p+=2)}}_=n[2*(f-2)],b=n[2*(f-2)+1],x=n[2*(f-1)],M=-(b-(w=n[2*(f-1)+1])),k=_-x,M/=I=Math.sqrt(M*M+k*k),k/=I,M*=g,k*=g,d.push(x-M*P,w-k*P),d.push(x+M*N,w+k*N),u||(o.cap===Kh.ROUND?p+=pd(x-M*(P-N)*.5,w-k*(P-N)*.5,x-M*P,w-k*P,x+M*N,w+k*N,d,!1)+2:o.cap===Kh.SQUARE&&(p+=fd(x,w,M,k,P,N,!1,d)));var Q=t.indices,Z=nd.epsilon*nd.epsilon;for(O=v;Oc*s}},e.arc=function(e,t,r,n,i,o,a,s,u){for(var l=a-o,c=nd._segmentsCount(Math.abs(l)*i,40*Math.ceil(Math.abs(l)/jl.f)),h=l/(2*c),d=2*h,f=Math.cos(h),p=Math.sin(h),v=c-1,g=v%1/v,m=0;m<=v;++m){var y=h+o+d*(m+g*m),_=Math.cos(y),b=-Math.sin(y);u.push((f*_+p*b)*i+r,(f*-b+p*_)*i+n)}},e}(),_d=function(){function e(){}return e.curveLength=function(e,t,r,n,i,o,a,s){for(var u=0,l=0,c=0,h=0,d=0,f=0,p=0,v=0,g=0,m=0,y=0,_=e,b=t,x=1;x<=10;++x)m=_-(v=(p=(f=(d=1-(l=x/10))*d)*d)*e+3*f*l*r+3*d*(c=l*l)*i+(h=c*l)*a),y=b-(g=p*t+3*f*l*n+3*d*c*o+h*s),_=v,b=g,u+=Math.sqrt(m*m+y*y);return u},e.curveTo=function(t,r,n,i,o,a,s){var u=s[s.length-2],l=s[s.length-1];s.length-=2;var c=nd._segmentsCount(e.curveLength(u,l,t,r,n,i,o,a)),h=0,d=0,f=0,p=0,v=0;s.push(u,l);for(var g=1,m=0;g<=c;++g)f=(d=(h=1-(m=g/c))*h)*h,v=(p=m*m)*m,s.push(f*u+3*d*m*t+3*h*p*n+v*o,f*l+3*d*m*r+3*h*p*i+v*a)},e}(),bd=function(){function e(){}return e.curveLength=function(e,t,r,n,i,o){var a=e-2*r+i,s=t-2*n+o,u=2*r-2*e,l=2*n-2*t,c=4*(a*a+s*s),h=4*(a*u+s*l),d=u*u+l*l,f=2*Math.sqrt(c+h+d),p=Math.sqrt(c),v=2*c*p,g=2*Math.sqrt(d),m=h/p;return(v*f+p*h*(f-g)+(4*d*c-h*h)*Math.log((2*p+m+f)/(m+g)))/(4*v)},e.curveTo=function(t,r,n,i,o){for(var a=o[o.length-2],s=o[o.length-1],u=nd._segmentsCount(e.curveLength(a,s,t,r,n,i)),l=0,c=0,h=1;h<=u;++h){var d=h/u;l=a+(t-a)*d,c=s+(r-s)*d,o.push(l+(t+(n-t)*d-l)*d,c+(r+(i-r)*d-c)*d)}},e}(),xd=function(){function e(){this.reset()}return e.prototype.begin=function(e,t,r){this.reset(),this.style=e,this.start=t,this.attribStart=r},e.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},e.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},e}(),wd=((gd={})[jl.l.POLY]=ud,gd[jl.l.CIRC]=ld,gd[jl.l.ELIP]=ld,gd[jl.l.RECT]={build:function(e){var t=e.shape,r=t.x,n=t.y,i=t.width,o=t.height,a=e.points;a.length=0,a.push(r,n,r+i,n,r+i,n+o,r,n+o)},triangulate:function(e,t){var r=e.points,n=t.points,i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},gd[jl.l.RREC]=dd,gd),Sd=[],Td=[],Md=function(){function e(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=r,this.fillStyle=t,this.matrix=n,this.type=e.type}return e.prototype.clone=function(){return new e(this.shape,this.fillStyle,this.lineStyle,this.matrix)},e.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},e}(),kd=new jl.g,Ed=new Dl.a,Ad=function(e){function t(){var t=e.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new Dl.a,t.boundsDirty=-1,t}return ad(t,e),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),t.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var e=0;e0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},t.prototype.drawShape=function(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null);var i=new Md(e,t,r,n);return this.graphicsData.push(i),this.dirty++,this},t.prototype.drawHole=function(e,t){if(void 0===t&&(t=null),!this.graphicsData.length)return null;var r=new Md(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this},t.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t0&&(i=(n=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535&&e;this.indicesUint16=m?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},t.prototype._compareStyles=function(e,t){return!(!e||!t)&&e.texture.baseTexture===t.texture.baseTexture&&e.color+e.alpha===t.color+t.alpha&&!!e.native==!!t.native},t.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,t=this.graphicsData.length;e131070)return!1;for(var e=this.batches,r=0;r0&&((i=Td.pop())||((i=new $l.d).texArray=new $l.g),this.drawCalls.push(i)),i.start=c,i.size=0,i.texArray.count=0,i.type=l),f.touched=1,f._batchEnabled=e,f._batchLocation=o,f.wrapMode=Eh.s.REPEAT,i.texArray.elements[i.texArray.count++]=f,o++)),i.size+=h.size,c+=h.size,s=f._batchLocation,this.addColors(r,d.color,d.alpha,h.attribSize,h.attribStart),this.addTextureIds(n,s,h.attribSize,h.attribStart)}$l.c._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,t=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(3*e.length*4),o=new Float32Array(i),a=new Uint32Array(i),s=0,u=0;u>16)+(65280&t)+((255&t)<<16),a=Object(Rl.premultiplyTint)(o,r);e.length=Math.max(e.length,i+n);for(var s=0;s0&&e.alpha>0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:t},e)):this._lineStyle.reset(),this},t.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new jl.h,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new jl.h,this.currentPath.closeStroke=!1},t.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},t.prototype.moveTo=function(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this},t.prototype.lineTo=function(e,t){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return n===e&&i===t||r.push(e,t),this},t.prototype._initCurve=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[e,t]):this.moveTo(e,t)},t.prototype.quadraticCurveTo=function(e,t,r,n){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),bd.curveTo(e,t,r,n,i),this},t.prototype.bezierCurveTo=function(e,t,r,n,i,o){return this._initCurve(),_d.curveTo(e,t,r,n,i,o,this.currentPath.points),this},t.prototype.arcTo=function(e,t,r,n,i){this._initCurve(e,t);var o=this.currentPath.points,a=yd.curveTo(e,t,r,n,i,o);if(a){var s=a.cx,u=a.cy,l=a.radius,c=a.startAngle,h=a.endAngle,d=a.anticlockwise;this.arc(s,u,l,c,h,d)}return this},t.prototype.arc=function(e,t,r,n,i,o){if(void 0===o&&(o=!1),n===i)return this;if(!o&&i<=n?i+=jl.f:o&&n<=i&&(n+=jl.f),i-n==0)return this;var a=e+Math.cos(n)*r,s=t+Math.sin(n)*r,u=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){var c=Math.abs(l[l.length-2]-a),h=Math.abs(l[l.length-1]-s);c0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:t},e)):this._fillStyle.reset(),this},t.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},t.prototype.drawRect=function(e,t,r,n){return this.drawShape(new jl.j(e,t,r,n))},t.prototype.drawRoundedRect=function(e,t,r,n,i){return this.drawShape(new jl.k(e,t,r,n,i))},t.prototype.drawCircle=function(e,t,r){return this.drawShape(new jl.a(e,t,r))},t.prototype.drawEllipse=function(e,t,r,n){return this.drawShape(new jl.c(e,t,r,n))},t.prototype.drawPolygon=function(){for(var e,t=arguments,r=[],n=0;n>16&255)/255*i,o.tint[1]=(n>>8&255)/255*i,o.tint[2]=(255&n)/255*i,o.tint[3]=i,e.shader.bind(t),e.geometry.bind(r,t),e.state.set(this.state);for(var s=0,u=a.length;s>16)+(65280&i)+((255&i)<<16)}}},t.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var t=this.transform.worldTransform,r=t.a,n=t.b,i=t.c,o=t.d,a=t.tx,s=t.ty,u=this._geometry.points,l=this.vertexData,c=0,h=0;h=n&&Rd.x=i&&Rd.y>16)+(65280&e)+((255&e)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||$l.t.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),t}(Dl.b),jd=function(e,t){return(jd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};!function(e){e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(md||(md={}));var zd={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:md.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Bd=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Fd=function(){function e(e){this.styleID=0,this.reset(),Gd(this,e,e)}return e.prototype.clone=function(){var t={};return Gd(t,this,zd),new e(t)},e.prototype.reset=function(){Gd(this,zd,zd)},Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=Wd(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=Wd(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){(function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var r=0;r=0;r--){var n=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&Bd.indexOf(n)<0&&(n='"'+n+'"'),t[r]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},e}();function Ud(e){return"number"==typeof e?Object(Rl.hex2string)(e):("string"==typeof e&&0===e.indexOf("0x")&&(e=e.replace("0x","#")),e)}function Wd(e){if(Array.isArray(e)){for(var t=0;tp)if(""!==a&&(s+=e.addLine(a),a="",o=0),e.canBreakWords(m,r.breakWords))for(var x=e.wordWrapSplit(m),w=0;wp&&(s+=e.addLine(a),f=!1,a="",o=0),a+=S,o+=E}else{a.length>0&&(s+=e.addLine(a),a="",o=0);var A=g===v.length-1;s+=e.addLine(m,!A),f=!1,a="",o=0}else b+o>p&&(f=!1,s+=e.addLine(a),a="",o=0),(a.length>0||!e.isBreakingSpace(m)||f)&&(a+=m,o+=b)}return s+e.addLine(a,!1)},e.addLine=function(t,r){return void 0===r&&(r=!0),t=e.trimRight(t),r?t+"\n":t},e.getFromCache=function(e,t,r,n){var i=r[e];if("number"!=typeof i){var o=e.length*t;i=n.measureText(e).width+o,r[e]=i}return i},e.collapseSpaces=function(e){return"normal"===e||"pre-line"===e},e.collapseNewlines=function(e){return"normal"===e},e.trimRight=function(t){if("string"!=typeof t)return"";for(var r=t.length-1;r>=0;r--){var n=t[r];if(!e.isBreakingSpace(n))break;t=t.slice(0,-1)}return t},e.isNewline=function(t){return"string"==typeof t&&e._newlines.indexOf(t.charCodeAt(0))>=0},e.isBreakingSpace=function(t,r){return"string"==typeof t&&e._breakingSpaces.indexOf(t.charCodeAt(0))>=0},e.tokenize=function(t){var r=[],n="";if("string"!=typeof t)return r;for(var i=0;is;--d){for(v=0;v0&&p>v&&(g=(v+p)/2);var m=v+f,y=r.lineHeight*(d+1),_=m;d+10},e}();function qd(e,t){var r=!1;if(e&&e._textures&&e._textures.length)for(var n=0;n=0;t--)this.add(e.children[t]);return this},e.prototype.destroy=function(){this.ticking&&zl.a.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}();function nf(e,t){return t instanceof $l.c&&(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0)}function of(e,t){if(!(t instanceof Nd))return!1;var r=t.geometry;t.finishPoly(),r.updateBatches();for(var n=r.batches,i=0;i=n&&df.x=i&&df.y1?$l.r.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",t):$l.r.from(pf,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",t)},t.prototype.render=function(e){var t=this.renderer,r=this.quad,n=r.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);var i=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;(n=r.uvs)[0]=n[6]=-i,n[1]=n[3]=-o,n[2]=n[4]=1-i,n[5]=n[7]=1-o,r.invalidate();var a=e._texture,s=a.baseTexture,u=e.tileTransform.localTransform,l=e.uvMatrix,c=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;c&&(s._glTextures[t.CONTEXT_UID]?c=s.wrapMode!==Eh.s.CLAMP:s.wrapMode===Eh.s.CLAMP&&(s.wrapMode=Eh.s.REPEAT));var h=c?this.simpleShader:this.shader,d=a.width,f=a.height,p=e._width,v=e._height;vf.set(u.a*d/p,u.b*d/v,u.c*f/p,u.d*f/v,u.tx/p,u.ty/v),vf.invert(),c?vf.prepend(l.mapCoord):(h.uniforms.uMapCoord=l.mapCoord.toArray(!0),h.uniforms.uClampFrame=l.uClampFrame,h.uniforms.uClampOffset=l.uClampOffset),h.uniforms.uTransform=vf.toArray(!0),h.uniforms.uColor=Object(Rl.premultiplyTintToRgba)(e.tint,e.worldAlpha,h.uniforms.uColor,s.alphaMode),h.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),h.uniforms.uSampler=a,t.shader.bind(h),t.geometry.bind(r),this.state.blendMode=Object(Rl.correctBlendMode)(e.blendMode,s.alphaMode),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t}($l.m),mf=r(8),yf=function(e,t){return(yf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},_f=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},bf=function(){function e(){}return e.test=function(e){return"string"==typeof e&&0===e.indexOf("info face=")},e.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in t){var i=t[n].match(/^[a-z]+/gm)[0],o=t[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var u=o[s].split("="),l=u[0],c=u[1].replace(/"/gm,""),h=parseFloat(c),d=isNaN(h)?c:h;a[l]=d}r[i].push(a)}var f=new _f;return r.info.forEach((function(e){return f.info.push({face:e.face,size:parseInt(e.size,10)})})),r.common.forEach((function(e){return f.common.push({lineHeight:parseInt(e.lineHeight,10)})})),r.page.forEach((function(e){return f.page.push({id:parseInt(e.id,10),file:e.file})})),r.char.forEach((function(e){return f.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})})),r.kerning.forEach((function(e){return f.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})})),r.distanceField.forEach((function(e){return f.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})})),f},e}(),xf=function(){function e(){}return e.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},e.parse=function(e){for(var t=new _f,r=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),i=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),s=e.getElementsByTagName("distanceField"),u=0;u")>-1){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return xf.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return xf.parse(t)},e}(),Sf=[bf,xf,wf];function Tf(e){for(var t=0;t=l-T*s){if(0===y)throw new Error("[BitmapFont] textureHeight "+l+"px is too small for "+h.fontSize+"px fonts");--x,p=null,v=null,g=null,y=0,m=0,_=0}else if(_=Math.max(T+w.fontProperties.descent,_),M*s+m>=d)--x,y+=_*s,y=Math.ceil(y),m=0,_=0;else{Mf(p,v,w,m,y,s,h);var k=Ef(w.text);f.char.push({id:k,page:b.length-1,x:m/s,y:y/s,width:M,height:T,xoffset:0,yoffset:0,xadvance:Math.ceil(S-(h.dropShadow?h.dropShadowDistance:0)-(h.stroke?h.strokeThickness:0))}),m+=(M+2*a)*s,m=Math.ceil(m)}}x=0;for(var E=c.length;x0&&n.x>u&&(++g,Object(Rl.removeItems)(i,1+p-g,1+_-p),_=p,p=-1,o.push(v),a.push(i.length>0?i[i.length-1].prevSpaces:0),d=Math.max(d,v),f++,n.x=0,n.y+=t.lineHeight,c=null,y=0)}}else o.push(h),a.push(-1),d=Math.max(d,h),++f,++g,n.x=0,n.y+=t.lineHeight,c=null,y=0}var S=s[s.length-1];"\r"!==S&&"\n"!==S&&(/(?:\s)/.test(S)&&(h=v),o.push(h),d=Math.max(d,h),a.push(-1));var T=[];for(_=0;_<=f;_++){var M=0;"right"===this._align?M=d-o[_]:"center"===this._align?M=(d-o[_])/2:"justify"===this._align&&(M=a[_]<0?0:(d-o[_])/a[_]),T.push(M)}var k=i.length,E={},I=[],A=this._activePagesMeshData;for(_=0;_6*L)||q.vertices.length<2*mf.a.BATCHABLE_SIZE)q.vertices=new Float32Array(8*L),q.uvs=new Float32Array(8*L),q.indices=new Uint16Array(6*L);else for(var j=q.total,z=q.vertices,B=4*j*2;B=n&&(t=e-a-1),o+=s=s.replace("%value%",r[t].toString()),o+="\n"}return(i=i.replace("%blur%",o)).replace("%size%",e.toString())}(o);return(a=e.call(this,s,u)||this).horizontal=t,a.resolution=i,a._quality=0,a.quality=n,a.blur=r,a}return Lf(t,e),t.prototype.apply=function(e,t,r,n){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/t.width):this.uniforms.strength=1/r.height*(r.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)e.applyFilter(this,t,r,n);else{var i=e.getFilterTexture(),o=e.renderer,a=t,s=i;this.state.blend=!1,e.applyFilter(this,a,s,Qf.CLEAR);for(var u=1;u 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",r)||this).alpha=1,t}return function(e,t){function r(){this.constructor=e}ap(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype._loadMatrix=function(e,t){void 0===t&&(t=!1);var r=e;t&&(this._multiply(r,this.uniforms.m,e),r=this._colorMatrix(r)),this.uniforms.m=r},t.prototype._multiply=function(e,t,r){return e[0]=t[0]*r[0]+t[1]*r[5]+t[2]*r[10]+t[3]*r[15],e[1]=t[0]*r[1]+t[1]*r[6]+t[2]*r[11]+t[3]*r[16],e[2]=t[0]*r[2]+t[1]*r[7]+t[2]*r[12]+t[3]*r[17],e[3]=t[0]*r[3]+t[1]*r[8]+t[2]*r[13]+t[3]*r[18],e[4]=t[0]*r[4]+t[1]*r[9]+t[2]*r[14]+t[3]*r[19]+t[4],e[5]=t[5]*r[0]+t[6]*r[5]+t[7]*r[10]+t[8]*r[15],e[6]=t[5]*r[1]+t[6]*r[6]+t[7]*r[11]+t[8]*r[16],e[7]=t[5]*r[2]+t[6]*r[7]+t[7]*r[12]+t[8]*r[17],e[8]=t[5]*r[3]+t[6]*r[8]+t[7]*r[13]+t[8]*r[18],e[9]=t[5]*r[4]+t[6]*r[9]+t[7]*r[14]+t[8]*r[19]+t[9],e[10]=t[10]*r[0]+t[11]*r[5]+t[12]*r[10]+t[13]*r[15],e[11]=t[10]*r[1]+t[11]*r[6]+t[12]*r[11]+t[13]*r[16],e[12]=t[10]*r[2]+t[11]*r[7]+t[12]*r[12]+t[13]*r[17],e[13]=t[10]*r[3]+t[11]*r[8]+t[12]*r[13]+t[13]*r[18],e[14]=t[10]*r[4]+t[11]*r[9]+t[12]*r[14]+t[13]*r[19]+t[14],e[15]=t[15]*r[0]+t[16]*r[5]+t[17]*r[10]+t[18]*r[15],e[16]=t[15]*r[1]+t[16]*r[6]+t[17]*r[11]+t[18]*r[16],e[17]=t[15]*r[2]+t[16]*r[7]+t[17]*r[12]+t[18]*r[17],e[18]=t[15]*r[3]+t[16]*r[8]+t[17]*r[13]+t[18]*r[18],e[19]=t[15]*r[4]+t[16]*r[9]+t[17]*r[14]+t[18]*r[19]+t[19],e},t.prototype._colorMatrix=function(e){var t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t},t.prototype.brightness=function(e,t){var r=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.tint=function(e,t){var r=[(e>>16&255)/255,0,0,0,0,0,(e>>8&255)/255,0,0,0,0,0,(255&e)/255,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.greyscale=function(e,t){var r=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},t.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var r=Math.cos(e),n=Math.sin(e),i=1/3,o=(0,Math.sqrt)(i),a=[r+(1-r)*i,i*(1-r)-o*n,i*(1-r)+o*n,0,0,i*(1-r)+o*n,r+i*(1-r),i*(1-r)-o*n,0,0,i*(1-r)-o*n,i*(1-r)+o*n,r+i*(1-r),0,0,0,0,0,1,0];this._loadMatrix(a,t)},t.prototype.contrast=function(e,t){var r=(e||0)+1,n=-.5*(r-1),i=[r,0,0,0,n,0,r,0,0,n,0,0,r,0,n,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.saturate=function(e,t){void 0===e&&(e=0);var r=2*e/3+1,n=-.5*(r-1),i=[r,n,n,0,0,n,r,n,0,0,n,n,r,0,0,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)},t.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},t.prototype.technicolor=function(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)},t.prototype.polaroid=function(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)},t.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},t.prototype.kodachrome=function(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)},t.prototype.browni=function(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)},t.prototype.vintage=function(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)},t.prototype.colorTone=function(e,t,r,n,i){var o=((r=r||16770432)>>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((n=n||3375104)>>16&255)/255,l=(n>>8&255)/255,c=(255&n)/255,h=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,l,c,t=t||.15,0,o-u,a-l,s-c,0,0];this._loadMatrix(h,i)},t.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},t.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}($l.k);sp.prototype.grayscale=sp.prototype.greyscale; +var $d=function(e,t){return($d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},Xd=function(){function e(e){this.maxItemsPerFrame=e,this.itemsLeft=0}return e.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},e.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},e}();function qd(e,t){var r=!1;if(e&&e._textures&&e._textures.length)for(var n=0;n=0;t--)this.add(e.children[t]);return this},e.prototype.destroy=function(){this.ticking&&zl.a.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}();function nf(e,t){return t instanceof $l.c&&(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0)}function of(e,t){if(!(t instanceof Nd))return!1;var r=t.geometry;t.finishPoly(),r.updateBatches();for(var n=r.batches,i=0;i=n&&df.x=i&&df.y1?$l.r.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",t):$l.r.from(pf,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",t)},t.prototype.render=function(e){var t=this.renderer,r=this.quad,n=r.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);var i=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;(n=r.uvs)[0]=n[6]=-i,n[1]=n[3]=-o,n[2]=n[4]=1-i,n[5]=n[7]=1-o,r.invalidate();var a=e._texture,s=a.baseTexture,u=e.tileTransform.localTransform,l=e.uvMatrix,c=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;c&&(s._glTextures[t.CONTEXT_UID]?c=s.wrapMode!==Eh.s.CLAMP:s.wrapMode===Eh.s.CLAMP&&(s.wrapMode=Eh.s.REPEAT));var h=c?this.simpleShader:this.shader,d=a.width,f=a.height,p=e._width,v=e._height;vf.set(u.a*d/p,u.b*d/v,u.c*f/p,u.d*f/v,u.tx/p,u.ty/v),vf.invert(),c?vf.prepend(l.mapCoord):(h.uniforms.uMapCoord=l.mapCoord.toArray(!0),h.uniforms.uClampFrame=l.uClampFrame,h.uniforms.uClampOffset=l.uClampOffset),h.uniforms.uTransform=vf.toArray(!0),h.uniforms.uColor=Object(Rl.premultiplyTintToRgba)(e.tint,e.worldAlpha,h.uniforms.uColor,s.alphaMode),h.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),h.uniforms.uSampler=a,t.shader.bind(h),t.geometry.bind(r),this.state.blendMode=Object(Rl.correctBlendMode)(e.blendMode,s.alphaMode),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t}($l.m),mf=r(8),yf=function(e,t){return(yf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},_f=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},bf=function(){function e(){}return e.test=function(e){return"string"==typeof e&&0===e.indexOf("info face=")},e.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in t){var i=t[n].match(/^[a-z]+/gm)[0],o=t[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var u=o[s].split("="),l=u[0],c=u[1].replace(/"/gm,""),h=parseFloat(c),d=isNaN(h)?c:h;a[l]=d}r[i].push(a)}var f=new _f;return r.info.forEach((function(e){return f.info.push({face:e.face,size:parseInt(e.size,10)})})),r.common.forEach((function(e){return f.common.push({lineHeight:parseInt(e.lineHeight,10)})})),r.page.forEach((function(e){return f.page.push({id:parseInt(e.id,10),file:e.file})})),r.char.forEach((function(e){return f.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})})),r.kerning.forEach((function(e){return f.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})})),r.distanceField.forEach((function(e){return f.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})})),f},e}(),xf=function(){function e(){}return e.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},e.parse=function(e){for(var t=new _f,r=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),i=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),s=e.getElementsByTagName("distanceField"),u=0;u")>-1){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return xf.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return xf.parse(t)},e}(),Sf=[bf,xf,wf];function Tf(e){for(var t=0;t=l-T*s){if(0===y)throw new Error("[BitmapFont] textureHeight "+l+"px is too small for "+h.fontSize+"px fonts");--x,p=null,v=null,g=null,y=0,m=0,_=0}else if(_=Math.max(T+w.fontProperties.descent,_),M*s+m>=d)--x,y+=_*s,y=Math.ceil(y),m=0,_=0;else{Mf(p,v,w,m,y,s,h);var k=Ef(w.text);f.char.push({id:k,page:b.length-1,x:m/s,y:y/s,width:M,height:T,xoffset:0,yoffset:0,xadvance:Math.ceil(S-(h.dropShadow?h.dropShadowDistance:0)-(h.stroke?h.strokeThickness:0))}),m+=(M+2*a)*s,m=Math.ceil(m)}}x=0;for(var E=c.length;x0&&n.x>u&&(++g,Object(Rl.removeItems)(i,1+p-g,1+_-p),_=p,p=-1,o.push(v),a.push(i.length>0?i[i.length-1].prevSpaces:0),d=Math.max(d,v),f++,n.x=0,n.y+=t.lineHeight,c=null,y=0)}}else o.push(h),a.push(-1),d=Math.max(d,h),++f,++g,n.x=0,n.y+=t.lineHeight,c=null,y=0}var S=s[s.length-1];"\r"!==S&&"\n"!==S&&(/(?:\s)/.test(S)&&(h=v),o.push(h),d=Math.max(d,h),a.push(-1));var T=[];for(_=0;_<=f;_++){var M=0;"right"===this._align?M=d-o[_]:"center"===this._align?M=(d-o[_])/2:"justify"===this._align&&(M=a[_]<0?0:(d-o[_])/a[_]),T.push(M)}var k=i.length,E={},A=[],I=this._activePagesMeshData;for(_=0;_6*L)||q.vertices.length<2*mf.a.BATCHABLE_SIZE)q.vertices=new Float32Array(8*L),q.uvs=new Float32Array(8*L),q.indices=new Uint16Array(6*L);else for(var j=q.total,z=q.vertices,B=4*j*2;B=n&&(t=e-a-1),o+=s=s.replace("%value%",r[t].toString()),o+="\n"}return(i=i.replace("%blur%",o)).replace("%size%",e.toString())}(o);return(a=e.call(this,s,u)||this).horizontal=t,a.resolution=i,a._quality=0,a.quality=n,a.blur=r,a}return Lf(t,e),t.prototype.apply=function(e,t,r,n){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/t.width):this.uniforms.strength=1/r.height*(r.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)e.applyFilter(this,t,r,n);else{var i=e.getFilterTexture(),o=e.renderer,a=t,s=i;this.state.blend=!1,e.applyFilter(this,a,s,Qf.CLEAR);for(var u=1;u 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",r)||this).alpha=1,t}return function(e,t){function r(){this.constructor=e}ap(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype._loadMatrix=function(e,t){void 0===t&&(t=!1);var r=e;t&&(this._multiply(r,this.uniforms.m,e),r=this._colorMatrix(r)),this.uniforms.m=r},t.prototype._multiply=function(e,t,r){return e[0]=t[0]*r[0]+t[1]*r[5]+t[2]*r[10]+t[3]*r[15],e[1]=t[0]*r[1]+t[1]*r[6]+t[2]*r[11]+t[3]*r[16],e[2]=t[0]*r[2]+t[1]*r[7]+t[2]*r[12]+t[3]*r[17],e[3]=t[0]*r[3]+t[1]*r[8]+t[2]*r[13]+t[3]*r[18],e[4]=t[0]*r[4]+t[1]*r[9]+t[2]*r[14]+t[3]*r[19]+t[4],e[5]=t[5]*r[0]+t[6]*r[5]+t[7]*r[10]+t[8]*r[15],e[6]=t[5]*r[1]+t[6]*r[6]+t[7]*r[11]+t[8]*r[16],e[7]=t[5]*r[2]+t[6]*r[7]+t[7]*r[12]+t[8]*r[17],e[8]=t[5]*r[3]+t[6]*r[8]+t[7]*r[13]+t[8]*r[18],e[9]=t[5]*r[4]+t[6]*r[9]+t[7]*r[14]+t[8]*r[19]+t[9],e[10]=t[10]*r[0]+t[11]*r[5]+t[12]*r[10]+t[13]*r[15],e[11]=t[10]*r[1]+t[11]*r[6]+t[12]*r[11]+t[13]*r[16],e[12]=t[10]*r[2]+t[11]*r[7]+t[12]*r[12]+t[13]*r[17],e[13]=t[10]*r[3]+t[11]*r[8]+t[12]*r[13]+t[13]*r[18],e[14]=t[10]*r[4]+t[11]*r[9]+t[12]*r[14]+t[13]*r[19]+t[14],e[15]=t[15]*r[0]+t[16]*r[5]+t[17]*r[10]+t[18]*r[15],e[16]=t[15]*r[1]+t[16]*r[6]+t[17]*r[11]+t[18]*r[16],e[17]=t[15]*r[2]+t[16]*r[7]+t[17]*r[12]+t[18]*r[17],e[18]=t[15]*r[3]+t[16]*r[8]+t[17]*r[13]+t[18]*r[18],e[19]=t[15]*r[4]+t[16]*r[9]+t[17]*r[14]+t[18]*r[19]+t[19],e},t.prototype._colorMatrix=function(e){var t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t},t.prototype.brightness=function(e,t){var r=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.tint=function(e,t){var r=[(e>>16&255)/255,0,0,0,0,0,(e>>8&255)/255,0,0,0,0,0,(255&e)/255,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.greyscale=function(e,t){var r=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},t.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var r=Math.cos(e),n=Math.sin(e),i=1/3,o=(0,Math.sqrt)(i),a=[r+(1-r)*i,i*(1-r)-o*n,i*(1-r)+o*n,0,0,i*(1-r)+o*n,r+i*(1-r),i*(1-r)-o*n,0,0,i*(1-r)-o*n,i*(1-r)+o*n,r+i*(1-r),0,0,0,0,0,1,0];this._loadMatrix(a,t)},t.prototype.contrast=function(e,t){var r=(e||0)+1,n=-.5*(r-1),i=[r,0,0,0,n,0,r,0,0,n,0,0,r,0,n,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.saturate=function(e,t){void 0===e&&(e=0);var r=2*e/3+1,n=-.5*(r-1),i=[r,n,n,0,0,n,r,n,0,0,n,n,r,0,0,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)},t.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},t.prototype.technicolor=function(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)},t.prototype.polaroid=function(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)},t.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},t.prototype.kodachrome=function(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)},t.prototype.browni=function(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)},t.prototype.vintage=function(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)},t.prototype.colorTone=function(e,t,r,n,i){var o=((r=r||16770432)>>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((n=n||3375104)>>16&255)/255,l=(n>>8&255)/255,c=(255&n)/255,h=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,l,c,t=t||.15,0,o-u,a-l,s-c,0,0];this._loadMatrix(h,i)},t.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},t.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},t.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}($l.k);sp.prototype.grayscale=sp.prototype.greyscale; /*! * @pixi/filter-displacement - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -214,7 +214,7 @@ var $d=function(e,t){return($d=Object.setPrototypeOf||{__proto__:[]}instanceof A See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var up,lp,cp,hp,dp,fp,pp,vp,gp,mp,yp,_p,bp,xp,wp,Sp,Tp,Mp,kp,Ep=function(e,t){return(Ep=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},Ip=function(e){function t(t,r){var n=this,i=new jl.d;return t.renderable=!1,(n=e.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=t,n.maskMatrix=i,null==r&&(r=20),n.scale=new jl.g(r,r),n}return function(e,t){function r(){this.constructor=e}Ep(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.apply=function(e,t,r,n){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),a=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/a,this.uniforms.rotation[3]=i.d/a),e.applyFilter(this,t,r,n)},Object.defineProperty(t.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(e){this.uniforms.mapSampler=e},enumerable:!1,configurable:!0}),t}($l.k),Ap=function(e,t){return(Ap=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},Cp=function(e){function t(){return e.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(e,t){function r(){this.constructor=e}Ap(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}($l.k),Pp=function(e,t){return(Pp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},Np=function(e){function t(t,r){void 0===t&&(t=.5),void 0===r&&(r=Math.random());var n=e.call(this,$l.z,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return n.noise=t,n.seed=r,n}return function(e,t){function r(){this.constructor=e}Pp(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0}),t}($l.k);!function(e){e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2"}(up||(up={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(lp||(lp={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(cp||(cp={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(hp||(hp={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(dp||(dp={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(fp||(fp={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(pp||(pp={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(vp||(vp={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(gp||(gp={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(mp||(mp={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(yp||(yp={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(_p||(_p={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(bp||(bp={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(xp||(xp={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(wp||(wp={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(Sp||(Sp={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(Tp||(Tp={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(Mp||(Mp={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(kp||(kp={}));var Op=new jl.d;Dl.c.prototype._cacheAsBitmap=!1,Dl.c.prototype._cacheData=null,Dl.c.prototype._cacheAsBitmapResolution=null,Dl.c.prototype._cacheAsBitmapMultisample=Mp.NONE;var Rp=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(Dl.c.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(e){e!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(e){e!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){var t;this._cacheAsBitmap!==e&&(this._cacheAsBitmap=e,e?(this._cacheData||(this._cacheData=new Rp),(t=this._cacheData).originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((t=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea))}}}),Dl.c.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},Dl.c.prototype._initCachedDisplayObject=function(e){var t;if(!this._cacheData||!this._cacheData.sprite){var r=this.alpha;this.alpha=1,e.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var i=this.filters[0].padding;n.pad(i)}n.ceil(rd.b.RESOLUTION);var o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),s=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=$l.p.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:null!==(t=this.cacheAsBitmapMultisample)&&void 0!==t?t:e.multisample}),c="cacheAsBitmap_"+Object(Rl.uid)();this._cacheData.textureCacheId=c,$l.c.addToCache(l.baseTexture,c),$l.t.addToCache(l,c);var h=this.transform.localTransform.copyTo(Op).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:l,clear:!0,transform:h,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=u,e.renderTexture.bind(o,a,s),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var d=new Ld(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-n.x/n.width,d.anchor.y=-n.y/n.height,d.alpha=r,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},Dl.c.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},Dl.c.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cacheData||!this._cacheData.sprite){var t=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var n=e.context,i=e._projTransform;t.ceil(rd.b.RESOLUTION);var o=$l.p.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Object(Rl.uid)();this._cacheData.textureCacheId=a,$l.c.addToCache(o.baseTexture,a),$l.t.addToCache(o,a);var s=Op;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=t.x,s.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,clear:!0,transform:s,skipUpdateTransform:!1}),e.context=n,e._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var u=new Ld(o);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-t.x/t.width,u.anchor.y=-t.y/t.height,u.alpha=r,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},Dl.c.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Dl.c.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Dl.c.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,$l.c.removeFromCache(this._cacheData.textureCacheId),$l.t.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Dl.c.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},Dl.c.prototype.name=null,Dl.b.prototype.getChildByName=function(e,t){for(var r=0,n=this.children.length;r=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer)&&this.onLoop(),this.updateTexture())}},t.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},t.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},t.fromFrames=function(e){for(var r=[],n=0;n lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(e,t){function r(){this.constructor=e}Ip(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}($l.k),Pp=function(e,t){return(Pp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},Np=function(e){function t(t,r){void 0===t&&(t=.5),void 0===r&&(r=Math.random());var n=e.call(this,$l.z,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return n.noise=t,n.seed=r,n}return function(e,t){function r(){this.constructor=e}Pp(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0}),t}($l.k);!function(e){e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2"}(up||(up={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(lp||(lp={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(cp||(cp={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(hp||(hp={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(dp||(dp={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(fp||(fp={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(pp||(pp={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(vp||(vp={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(gp||(gp={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(mp||(mp={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(yp||(yp={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(_p||(_p={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(bp||(bp={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(xp||(xp={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(wp||(wp={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(Sp||(Sp={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(Tp||(Tp={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(Mp||(Mp={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(kp||(kp={}));var Op=new jl.d;Dl.c.prototype._cacheAsBitmap=!1,Dl.c.prototype._cacheData=null,Dl.c.prototype._cacheAsBitmapResolution=null,Dl.c.prototype._cacheAsBitmapMultisample=Mp.NONE;var Rp=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(Dl.c.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(e){e!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(e){e!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){var t;this._cacheAsBitmap!==e&&(this._cacheAsBitmap=e,e?(this._cacheData||(this._cacheData=new Rp),(t=this._cacheData).originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((t=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea))}}}),Dl.c.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},Dl.c.prototype._initCachedDisplayObject=function(e){var t;if(!this._cacheData||!this._cacheData.sprite){var r=this.alpha;this.alpha=1,e.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var i=this.filters[0].padding;n.pad(i)}n.ceil(rd.b.RESOLUTION);var o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),s=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=$l.p.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:null!==(t=this.cacheAsBitmapMultisample)&&void 0!==t?t:e.multisample}),c="cacheAsBitmap_"+Object(Rl.uid)();this._cacheData.textureCacheId=c,$l.c.addToCache(l.baseTexture,c),$l.t.addToCache(l,c);var h=this.transform.localTransform.copyTo(Op).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:l,clear:!0,transform:h,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=u,e.renderTexture.bind(o,a,s),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var d=new Ld(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-n.x/n.width,d.anchor.y=-n.y/n.height,d.alpha=r,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},Dl.c.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},Dl.c.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cacheData||!this._cacheData.sprite){var t=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var n=e.context,i=e._projTransform;t.ceil(rd.b.RESOLUTION);var o=$l.p.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Object(Rl.uid)();this._cacheData.textureCacheId=a,$l.c.addToCache(o.baseTexture,a),$l.t.addToCache(o,a);var s=Op;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=t.x,s.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,clear:!0,transform:s,skipUpdateTransform:!1}),e.context=n,e._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var u=new Ld(o);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-t.x/t.width,u.anchor.y=-t.y/t.height,u.alpha=r,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},Dl.c.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Dl.c.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Dl.c.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,$l.c.removeFromCache(this._cacheData.textureCacheId),$l.t.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Dl.c.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},Dl.c.prototype.name=null,Dl.b.prototype.getChildByName=function(e,t){for(var r=0,n=this.children.length;r=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer)&&this.onLoop(),this.updateTexture())}},t.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},t.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},t.fromFrames=function(e){for(var r=[],n=0;n0},e}(),Gp=function(){function e(e){this._svgMatrix=null,this._tempMatrix=new jl.d,this.renderer=e}return e.prototype._calcCanvasStyle=function(e,t){var r;return e.texture&&e.texture.baseTexture!==$l.t.WHITE.baseTexture?e.texture.valid?(r=Fp.b.getTintedPattern(e.texture,t),this.setPatternTransform(r,e.matrix||jl.d.IDENTITY)):r="#808080":r="#"+("00000"+(0|t).toString(16)).slice(-6),r},e.prototype.render=function(e){var t=this.renderer,r=t.context,n=e.worldAlpha,i=e.transform.worldTransform;t.setContextTransform(i),t.setBlendMode(e.blendMode);for(var o,a,s=e.geometry.graphicsData,u=(e.tint>>16&255)/255,l=(e.tint>>8&255)/255,c=(255&e.tint)/255,h=0;h>16&255)/255*u*255<<16)+((g>>8&255)/255*l*255<<8)+(255&g)/255*c*255;o=this._calcCanvasStyle(p,y)}if(v.visible){var _=((m>>16&255)/255*u*255<<16)+((m>>8&255)/255*l*255<<8)+(255&m)/255*c*255;a=this._calcCanvasStyle(v,_)}if(r.lineWidth=v.width,r.lineCap=v.cap,r.lineJoin=v.join,r.miterLimit=v.miterLimit,d.type===jl.l.POLY){r.beginPath();var b=(A=f).points,x=d.holes,w=void 0,S=void 0,T=void 0,M=void 0,k=void 0;r.moveTo(b[0],b[1]);for(var E=2;E0){for(k=[],w=0,T=b[0],M=b[1],E=2;E+2=0;E-=2)r.lineTo(b[E],b[E+1]);x[I].shape.closeStroke&&r.closePath(),k[I]=S*w<0}}p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fill()),v.visible&&this.paintPolygonStroke(A,v,a,x,k,n,r)}else if(d.type===jl.l.RECT){var A=f;if(p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fillRect(A.x,A.y,A.width,A.height)),v.visible){var C=v.width*(.5-(1-v.alignment)),P=A.width+2*C,N=A.height+2*C;r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.strokeRect(A.x-C,A.y-C,P,N)}}else if(d.type===jl.l.CIRC)A=f,r.beginPath(),r.arc(A.x,A.y,A.radius,0,2*Math.PI),r.closePath(),p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fill()),v.visible&&(.5!==v.alignment&&(C=v.width*(.5-(1-v.alignment)),r.beginPath(),r.arc(A.x,A.y,A.radius+C,0,2*Math.PI),r.closePath()),r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.stroke());else if(d.type===jl.l.ELIP){if(A=f,(G=1===v.alignment)||this.paintEllipse(A,p,v,o,n,r),v.visible){if(.5!==v.alignment){C=v.width*(.5-(1-v.alignment));var O=2*(A.width+C),R=2*(A.height+C),D=A.x-O/2,L=A.y-R/2,j=O/2*.5522848,z=R/2*.5522848,B=D+O,F=L+R,U=D+O/2,W=L+R/2;r.beginPath(),r.moveTo(D,W),r.bezierCurveTo(D,W-z,U-j,L,U,L),r.bezierCurveTo(U+j,L,B,W-z,B,W),r.bezierCurveTo(B,W+z,U+j,F,U,F),r.bezierCurveTo(U-j,F,D,W+z,D,W),r.closePath()}r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.stroke()}G&&this.paintEllipse(A,p,v,o,n,r)}else if(d.type===jl.l.RREC){var G;if(A=f,(G=1===v.alignment)||this.paintRoundedRectangle(A,p,v,o,n,r),v.visible){if(.5!==v.alignment){P=A.width,N=A.height,C=v.width*(.5-(1-v.alignment));var V=A.x-C,H=A.y-C,Y=A.width+2*C,$=A.height+2*C,X=C*(v.alignment>=1?Math.min(Y/P,$/N):Math.min(P/Y,N/$)),q=A.radius+X,Q=Math.min(Y,$)/2;q=q>Q?Q:q,r.beginPath(),r.moveTo(V,H+q),r.lineTo(V,H+$-q),r.quadraticCurveTo(V,H+$,V+q,H+$),r.lineTo(V+Y-q,H+$),r.quadraticCurveTo(V+Y,H+$,V+Y,H+$-q),r.lineTo(V+Y,H+q),r.quadraticCurveTo(V+Y,H,V+Y-q,H),r.lineTo(V+q,H),r.quadraticCurveTo(V,H,V,H+q),r.closePath()}r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.stroke()}G&&this.paintRoundedRectangle(A,p,v,o,n,r)}}},e.prototype.paintPolygonStroke=function(e,t,r,n,i,o,a){if(.5!==t.alignment){var s=t.width*(.5-(1-t.alignment)),u=Wp.offsetPolygon(e.points,s),l=void 0;a.beginPath(),a.moveTo(u[0],u[1]);for(var c=2;c=0;c-=2)a.lineTo(u[c],u[c+1]);n[h].shape.closeStroke&&a.closePath()}}a.globalAlpha=t.alpha*o,a.strokeStyle=r,a.stroke()},e.prototype.paintEllipse=function(e,t,r,n,i,o){var a=2*e.width,s=2*e.height,u=e.x-a/2,l=e.y-s/2,c=a/2*.5522848,h=s/2*.5522848,d=u+a,f=l+s,p=u+a/2,v=l+s/2;0===r.alignment&&o.save(),o.beginPath(),o.moveTo(u,v),o.bezierCurveTo(u,v-h,p-c,l,p,l),o.bezierCurveTo(p+c,l,d,v-h,d,v),o.bezierCurveTo(d,v+h,p+c,f,p,f),o.bezierCurveTo(p-c,f,u,v+h,u,v),o.closePath(),0===r.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=n,o.fill()),0===r.alignment&&o.restore()},e.prototype.paintRoundedRectangle=function(e,t,r,n,i,o){var a=e.x,s=e.y,u=e.width,l=e.height,c=e.radius,h=Math.min(u,l)/2;c=c>h?h:c,0===r.alignment&&o.save(),o.beginPath(),o.moveTo(a,s+c),o.lineTo(a,s+l-c),o.quadraticCurveTo(a,s+l,a+c,s+l),o.lineTo(a+u-c,s+l),o.quadraticCurveTo(a+u,s+l,a+u,s+l-c),o.lineTo(a+u,s+c),o.quadraticCurveTo(a+u,s,a+u-c,s),o.lineTo(a+c,s),o.quadraticCurveTo(a,s,a,s+c),o.closePath(),0===r.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=n,o.fill()),0===r.alignment&&o.restore()},e.prototype.setPatternTransform=function(e,t){if(!1!==this._svgMatrix){if(!this._svgMatrix){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r&&r.createSVGMatrix&&(this._svgMatrix=r.createSVGMatrix()),!this._svgMatrix||!e.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=t.a,this._svgMatrix.b=t.b,this._svgMatrix.c=t.c,this._svgMatrix.d=t.d,this._svgMatrix.e=t.tx,this._svgMatrix.f=t.ty,e.setTransform(this._svgMatrix.inverse())}},e.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},e}(),Vp=new jl.d;Nd.prototype.generateCanvasTexture=function(e,t){void 0===t&&(t=1);var r=this.getLocalBounds(),n=$l.p.create({width:r.width,height:r.height,scaleMode:e,resolution:t});zp||(zp=new Fp.a),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Vp),Vp.invert(),Vp.tx-=r.x,Vp.ty-=r.y,zp.render(this,{renderTexture:n,clear:!0,transform:Vp});var i=$l.t.from(n.baseTexture._canvasRenderTarget.canvas,{scaleMode:e});return i.baseTexture.setResolution(t),i},Nd.prototype.cachedGraphicsData=[],Nd.prototype._renderCanvas=function(e){!0!==this.isMask&&(this.finishPoly(),e.plugins.graphics.render(this))}; +$l.q.registerPlugin("accessibility",Ll),$l.q.registerPlugin("extract",ah),$l.q.registerPlugin("interaction",Yl),$l.q.registerPlugin("particle",td),$l.q.registerPlugin("prepare",sf),$l.q.registerPlugin("batch",$l.f),$l.q.registerPlugin("tilingSprite",gf),wh.registerPlugin(Nf),wh.registerPlugin(Rh),wh.registerPlugin(Gh),wh.registerPlugin(Xh),wh.registerPlugin(lf),Xl.registerPlugin(zl.b),Xl.registerPlugin(Sh);var zp,Bp={AlphaFilter:Rf,BlurFilter:op,BlurFilterPass:ip,ColorMatrixFilter:sp,DisplacementFilter:Ap,FXAAFilter:Cp,NoiseFilter:Np},Fp=r(10),Up=r(35),Wp=function(){function e(){}return e.offsetPolygon=function(t,r){var n=[],i=t.length;r=e.isPolygonClockwise(t)?r:-1*r;for(var o=0;o0},e}(),Gp=function(){function e(e){this._svgMatrix=null,this._tempMatrix=new jl.d,this.renderer=e}return e.prototype._calcCanvasStyle=function(e,t){var r;return e.texture&&e.texture.baseTexture!==$l.t.WHITE.baseTexture?e.texture.valid?(r=Fp.b.getTintedPattern(e.texture,t),this.setPatternTransform(r,e.matrix||jl.d.IDENTITY)):r="#808080":r="#"+("00000"+(0|t).toString(16)).slice(-6),r},e.prototype.render=function(e){var t=this.renderer,r=t.context,n=e.worldAlpha,i=e.transform.worldTransform;t.setContextTransform(i),t.setBlendMode(e.blendMode);for(var o,a,s=e.geometry.graphicsData,u=(e.tint>>16&255)/255,l=(e.tint>>8&255)/255,c=(255&e.tint)/255,h=0;h>16&255)/255*u*255<<16)+((g>>8&255)/255*l*255<<8)+(255&g)/255*c*255;o=this._calcCanvasStyle(p,y)}if(v.visible){var _=((m>>16&255)/255*u*255<<16)+((m>>8&255)/255*l*255<<8)+(255&m)/255*c*255;a=this._calcCanvasStyle(v,_)}if(r.lineWidth=v.width,r.lineCap=v.cap,r.lineJoin=v.join,r.miterLimit=v.miterLimit,d.type===jl.l.POLY){r.beginPath();var b=(I=f).points,x=d.holes,w=void 0,S=void 0,T=void 0,M=void 0,k=void 0;r.moveTo(b[0],b[1]);for(var E=2;E0){for(k=[],w=0,T=b[0],M=b[1],E=2;E+2=0;E-=2)r.lineTo(b[E],b[E+1]);x[A].shape.closeStroke&&r.closePath(),k[A]=S*w<0}}p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fill()),v.visible&&this.paintPolygonStroke(I,v,a,x,k,n,r)}else if(d.type===jl.l.RECT){var I=f;if(p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fillRect(I.x,I.y,I.width,I.height)),v.visible){var C=v.width*(.5-(1-v.alignment)),P=I.width+2*C,N=I.height+2*C;r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.strokeRect(I.x-C,I.y-C,P,N)}}else if(d.type===jl.l.CIRC)I=f,r.beginPath(),r.arc(I.x,I.y,I.radius,0,2*Math.PI),r.closePath(),p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fill()),v.visible&&(.5!==v.alignment&&(C=v.width*(.5-(1-v.alignment)),r.beginPath(),r.arc(I.x,I.y,I.radius+C,0,2*Math.PI),r.closePath()),r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.stroke());else if(d.type===jl.l.ELIP){if(I=f,(G=1===v.alignment)||this.paintEllipse(I,p,v,o,n,r),v.visible){if(.5!==v.alignment){C=v.width*(.5-(1-v.alignment));var O=2*(I.width+C),R=2*(I.height+C),D=I.x-O/2,L=I.y-R/2,j=O/2*.5522848,z=R/2*.5522848,B=D+O,F=L+R,U=D+O/2,W=L+R/2;r.beginPath(),r.moveTo(D,W),r.bezierCurveTo(D,W-z,U-j,L,U,L),r.bezierCurveTo(U+j,L,B,W-z,B,W),r.bezierCurveTo(B,W+z,U+j,F,U,F),r.bezierCurveTo(U-j,F,D,W+z,D,W),r.closePath()}r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.stroke()}G&&this.paintEllipse(I,p,v,o,n,r)}else if(d.type===jl.l.RREC){var G;if(I=f,(G=1===v.alignment)||this.paintRoundedRectangle(I,p,v,o,n,r),v.visible){if(.5!==v.alignment){P=I.width,N=I.height,C=v.width*(.5-(1-v.alignment));var V=I.x-C,H=I.y-C,Y=I.width+2*C,$=I.height+2*C,X=C*(v.alignment>=1?Math.min(Y/P,$/N):Math.min(P/Y,N/$)),q=I.radius+X,Q=Math.min(Y,$)/2;q=q>Q?Q:q,r.beginPath(),r.moveTo(V,H+q),r.lineTo(V,H+$-q),r.quadraticCurveTo(V,H+$,V+q,H+$),r.lineTo(V+Y-q,H+$),r.quadraticCurveTo(V+Y,H+$,V+Y,H+$-q),r.lineTo(V+Y,H+q),r.quadraticCurveTo(V+Y,H,V+Y-q,H),r.lineTo(V+q,H),r.quadraticCurveTo(V,H,V,H+q),r.closePath()}r.globalAlpha=v.alpha*n,r.strokeStyle=a,r.stroke()}G&&this.paintRoundedRectangle(I,p,v,o,n,r)}}},e.prototype.paintPolygonStroke=function(e,t,r,n,i,o,a){if(.5!==t.alignment){var s=t.width*(.5-(1-t.alignment)),u=Wp.offsetPolygon(e.points,s),l=void 0;a.beginPath(),a.moveTo(u[0],u[1]);for(var c=2;c=0;c-=2)a.lineTo(u[c],u[c+1]);n[h].shape.closeStroke&&a.closePath()}}a.globalAlpha=t.alpha*o,a.strokeStyle=r,a.stroke()},e.prototype.paintEllipse=function(e,t,r,n,i,o){var a=2*e.width,s=2*e.height,u=e.x-a/2,l=e.y-s/2,c=a/2*.5522848,h=s/2*.5522848,d=u+a,f=l+s,p=u+a/2,v=l+s/2;0===r.alignment&&o.save(),o.beginPath(),o.moveTo(u,v),o.bezierCurveTo(u,v-h,p-c,l,p,l),o.bezierCurveTo(p+c,l,d,v-h,d,v),o.bezierCurveTo(d,v+h,p+c,f,p,f),o.bezierCurveTo(p-c,f,u,v+h,u,v),o.closePath(),0===r.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=n,o.fill()),0===r.alignment&&o.restore()},e.prototype.paintRoundedRectangle=function(e,t,r,n,i,o){var a=e.x,s=e.y,u=e.width,l=e.height,c=e.radius,h=Math.min(u,l)/2;c=c>h?h:c,0===r.alignment&&o.save(),o.beginPath(),o.moveTo(a,s+c),o.lineTo(a,s+l-c),o.quadraticCurveTo(a,s+l,a+c,s+l),o.lineTo(a+u-c,s+l),o.quadraticCurveTo(a+u,s+l,a+u,s+l-c),o.lineTo(a+u,s+c),o.quadraticCurveTo(a+u,s,a+u-c,s),o.lineTo(a+c,s),o.quadraticCurveTo(a,s,a,s+c),o.closePath(),0===r.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=n,o.fill()),0===r.alignment&&o.restore()},e.prototype.setPatternTransform=function(e,t){if(!1!==this._svgMatrix){if(!this._svgMatrix){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r&&r.createSVGMatrix&&(this._svgMatrix=r.createSVGMatrix()),!this._svgMatrix||!e.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=t.a,this._svgMatrix.b=t.b,this._svgMatrix.c=t.c,this._svgMatrix.d=t.d,this._svgMatrix.e=t.tx,this._svgMatrix.f=t.ty,e.setTransform(this._svgMatrix.inverse())}},e.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},e}(),Vp=new jl.d;Nd.prototype.generateCanvasTexture=function(e,t){void 0===t&&(t=1);var r=this.getLocalBounds(),n=$l.p.create({width:r.width,height:r.height,scaleMode:e,resolution:t});zp||(zp=new Fp.a),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Vp),Vp.invert(),Vp.tx-=r.x,Vp.ty-=r.y,zp.render(this,{renderTexture:n,clear:!0,transform:Vp});var i=$l.t.from(n.baseTexture._canvasRenderTarget.canvas,{scaleMode:e});return i.baseTexture.setResolution(t),i},Nd.prototype.cachedGraphicsData=[],Nd.prototype._renderCanvas=function(e){!0!==this.isMask&&(this.finishPoly(),e.plugins.graphics.render(this))}; /*! * @pixi/canvas-sprite - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -245,14 +245,14 @@ var $p=new jl.j,Xp=function(){function e(e){this.renderer=e}return e.prototype.i * * @pixi/canvas-sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */ff.prototype._renderCanvas=function(e){var t=this._texture;if(t.baseTexture.valid){var r=e.context,n=this.worldTransform,i=t.baseTexture,o=i.getDrawableSource(),a=i.resolution;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var s=new Rl.CanvasRenderTarget(t._frame.width,t._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Fp.b.getTintedCanvas(this,this.tint),s.context.drawImage(this._tintedCanvas,0,0)):s.context.drawImage(o,-t._frame.x*a,-t._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=s.context.createPattern(s.canvas,"repeat")}r.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),this.tileTransform.updateLocalTransform();var u=this.tileTransform.localTransform,l=this._width,c=this._height;Jp.identity(),ev.copyFrom(u),this.uvRespectAnchor||ev.translate(-this.anchor.x*l,-this.anchor.y*c),ev.scale(this.tileScale.x/a,this.tileScale.y/a),Jp.prepend(ev),Jp.prepend(n),e.setContextTransform(Jp),r.fillStyle=this._canvasPattern;var h=this.anchor.x*-l,d=this.anchor.y*-c;tv[0].set(h,d),tv[1].set(h+l,d),tv[2].set(h+l,d+c),tv[3].set(h,d+c);for(var f=0;f<4;f++)ev.applyInverse(tv[f],tv[f]);for(r.beginPath(),r.moveTo(tv[0].x,tv[0].y),f=1;f<4;f++)r.lineTo(tv[f].x,tv[f].y);r.closePath(),r.fill()}},Jh.prototype.renderCanvas=function(e){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var t=e.context,r=this.worldTransform,n=!0,i=0,o=0,a=0,s=0;e.setBlendMode(this.blendMode),t.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var u=0;u20&&(e.value=Math.floor(1e3*e.times/e.valueTotal),e.valueTotal=0,e.times=0,e.destroyed||e.emit("update",e.value)),e.prevTime=t,e.destroyed||e.calcFps()}))}},{key:"destroy",value:function(){this.destroyed=!0}}]),r}(Ks.a);!function(e){e.ResourceError="RESOURCE_ERROR",e.RuntimeError="RUNTIME_ERROR",e.RuntimeWarn="RUNTIME_WARN",e.CanvasCrash="CANVAS_CRASH"}(Zp||(Zp={}));var nv=function(e){p(r,e);var t=g(r);function r(e,n){var i,o,a;return x(this,r),o=y(i=t.call(this,n)),a=(this instanceof r?this.constructor:void 0).prototype,Object.setPrototypeOf?Object.setPrototypeOf(o,a):o.__proto__&&(o.__proto__=a),i.errorType=e,i.errorMsg=n,i}return S(r,null,[{key:"transform",value:function(e){return e instanceof r?e:new r(Zp.RuntimeError,e.message)}}]),r}(n(Error));function iv(){return function(e,t,r){var n=r.value;r.value=function(){try{for(var e=arguments.length,t=new Array(e),r=0;r2048||b>2048)&&(x=(y*=2048/_)*b)>2048&&(y*=b/x),w=document.createElement("canvas"),S=Math.ceil(m.width*y),T=Math.ceil(m.height*y),w.width=S,w.height=T,w.getContext("2d").drawImage(m,0,0,S,T),M=w.toDataURL("image/png"),k=new $l.c(M,{resolution:1}),r.abrupt("return",(this.logger.info("load end. "+o,this.taskId||""),this.useCache&&this.localStorage.setItem(u,{scale:y,scaledBase64:M}).catch((function(){})),{baseTexture:k,scale:y}));case 70:case"end":return r.stop()}}),r,this,[[22,34],[39,52]])})))}},{key:"destroy",value:function(){}}]),e}(),gv=function(){function e(t){var r=this;x(this,e),this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=function(e){var t=e/(rd.b.TARGET_FPMS||.06);if(!r.isPaused){r.timestamp+=t,r.callbackList=r.callbackList.filter((function(e){return e&&!e.applied}));for(var n=r.callbackList.length,i=0;i=0&&!this.callbackList[t].running&&this.callbackList.splice(t,1)}},{key:"delay",value:function(e){var t=this;return new Promise((function(r){t.setTimeout(r,e)}))}},{key:"waitUntil",value:function(e,t){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=this.timestamp;case 1:if(e()||!(this.timestamp-n90&&a<270||a<-90&&a>-270)&&(n=-n),i=s*n}return{x:n,y:i}}function Mv(e,t,r,n,i,o){var a,s,u,l,c,h=e,d=t;if(0===Math.round(n))a=i,s=o,c=0;else if(Math.round(n)>=360)a=i,s=o,u=i+2*e*Math.abs(Math.cos(-r/180*Math.PI)),l=o+2*t*Math.sin(-r/180*Math.PI),c=1;else{var f=-(r+n),p=Tv(-r,h,d),v=i-p.x,g=o+p.y,m=Tv(f,h,d);a=m.x+v,s=g-m.y,c=n>=-360&&n<-180?1:n>=-180&&n<0||n>0&&n<180?0:1}return{radiusX:h,radiusY:d,xAxisRotation:0,largeArcFlag:c,sweepFlag:n>0?1:0,endX:a,endY:s,middleX:u,middleY:l}}var kv=function(){function e(){x(this,e),this.pool=[]}return S(e,[{key:"getObject",value:function(e){var t=this.pool.find((function(e){return!e.isUsed}));if(t)return t.isUsed=!0,t.obj;var r={obj:this.createObject(),isUsed:!0,group:e};return this.pool.push(r),r.obj}},{key:"collectObject",value:function(e){var t=this.pool.find((function(t){return t.obj===e}));t&&(t.isUsed=!1,this.resetObject(t.obj))}},{key:"collectObjectByGroup",value:function(e){var t=this;this.pool.filter((function(t){return t.group===e})).forEach((function(e){return t.collectObject(e.obj)}))}}]),e}(),Ev=new(function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("version","1.1"),e}},{key:"resetObject",value:function(e){e.removeAttribute("viewBox"),e.removeAttribute("width"),e.removeAttribute("height"),e.innerHTML=""}}]),r}(kv)),Iv=new(function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){return document.createElement("img")}},{key:"resetObject",value:function(e){e.removeAttribute("src")}}]),r}(kv)),Av=function(){function e(t){x(this,e),this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null),this.maxResolution=t}return S(e,[{key:"render",value:function(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,l,h,d,f,p,v,g=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.items,o=e.width,a=e.height,s=Iv.getObject(r),u=new $l.c(s,{width:o*n,height:a*n,resolution:1}),l=Ev.getObject(r),this.imgElements.push(s),this.svgElements.push(l),l.setAttribute("viewBox","0 0 ".concat(o," ").concat(a)),l.setAttribute("width",""+o),l.setAttribute("height",""+a),h={},i.forEach((function(e){var t=e.item,r=e.x,i=e.y,o=r+2,a=i+2;t.pathsData.forEach((function(e){var t="";e.cmds.forEach((function(r){var n=c(r,2),i=n[0],s=n[1];t+=i+" ",t+=s.map((function(t){return Sv()(t)||(t.x=t.x+e.offset.x+o,t.y=t.y+e.offset.y+a),t})).reduce((function(e,t){return Sv()(t)?e+=t+" ":e+="".concat(t.x," ").concat(t.y," "),e}),""),t+=" "})),e.pathElement.setAttribute("d",t),l.appendChild(e.pathElement)}));var s=t.width-4-2*t.padding,d=t.height-4-2*t.padding;g.textures[t.hash]={texture:new $l.t(u,new jl.j((o+2)*n,(a+2)*n,s*n,d*n)),pivot:t.pivot,scale:1/n},h[t.hash]=g.hashToIdMap[t.hash]})),f=''+l.outerHTML,d="data:image/svg+xml,"+encodeURIComponent(f).replace(/'/g,"%27").replace(/"/g,"%22"),(p=document.createElement("img")).src=d,t.next=9,new Promise((function(e,t){p.onload=function(){return e("")},p.onerror=function(){return t()}}));case 9:return(v=document.createElement("canvas")).width=p.width*n,v.height=p.height*n,v.getContext("2d").drawImage(p,0,0,v.width,v.height),s.src=v.toDataURL("image/png"),t.next=15,new Promise((function(e,t){s.onload=function(){return e("")},s.onerror=function(){return t()}}));case 15:case"end":return t.stop()}}),t,this)})))}},{key:"getGraphicsData",value:function(e){var t=this.idToHashMap[e]||"";return this.textures[t]||null}},{key:"addGraphics",value:function(e,t,r,n,i,o,a,s,u,l,h){var d,f;if(!a&&!u)return e;var p,v,g,m,y,_,b,x,w,S,T,M,k,E,I,A,C,P,N=xv()(r+(null!==(f=null===(d=null==a?void 0:a.width)||void 0===d?void 0:d.toString())&&void 0!==f?f:0)+u+l+h);if(this.hashToIdMap[N]||(this.hashToIdMap[N]=[]),this.hashToIdMap[N].push(e),this.idToHashMap[e]=N,this.graphics.findIndex((function(e){return e.hash===N}))<0){var O=(p=t,v=i,g=o,m=a,y=n,_=u,b=l,x=h,S=[],T={x:Math.abs(y.x),y:Math.abs(y.y)},M=0,k=0,E=0,I=0,A=0,C="none",P=null!==(w=null==m?void 0:m.width)&&void 0!==w?w:0,_?(M=v,k=g,A=0):(C=x||"#ff0000",A=P,E=.5*P,I=.5*P,M=v+P,k=g+P,T.x+=.5*P,T.y+=.5*P),M+=Math.abs(y.x),k+=Math.abs(y.y),E+=Math.abs(y.x),I+=Math.abs(y.y),M+=4,k+=4,E+=2,I+=2,M=Math.ceil(M),k=Math.ceil(k),p.forEach((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==e.fill&&_?t.setAttribute("fill",b||"#ff0000"):t.setAttribute("fill","none"),e.hasStroke&&!_&&(t.setAttribute("stroke-linecap",(null==m?void 0:m.cap)||"butt"),t.setAttribute("stroke-linejoin",(null==m?void 0:m.join)||"miter"),t.setAttribute("stroke-width",A.toString()),t.setAttribute("stroke",C),(null==m?void 0:m.dash)&&t.setAttribute("stroke-dasharray",m.dash));for(var r=e.scale,n=e.path.trim().split(" "),i={x:0,y:0},o={offset:{x:E,y:I},cmds:[],pathElement:t},a=0;a=360?(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.middleX/9525*r.x,y:T.middleY/9525*r.y}]]),o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]])):(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]]))}else if("L"===s){var M=c(u.split(",").map((function(e){return Number(e)})),2),k=M[0],P=M[1];i={x:k,y:P},k=k/9525*r.x,P=P/9525*r.y,o.cmds.push(["L",[{x:k,y:P}]])}else if("QB"===s){var N=c(u.split(",").map((function(e){return Number(e)})),4),O=N[0],R=N[1],D=N[2],L=N[3];i={x:D,y:L},O=O/9525*r.x,R=R/9525*r.y,D=D/9525*r.x,L=L/9525*r.y,o.cmds.push(["Q",[{x:O,y:R},{x:D,y:L}]])}else if("CB"===s){var j=c(u.split(",").map((function(e){return Number(e)})),6),z=j[0],B=j[1],F=j[2],U=j[3],W=j[4],G=j[5];i={x:W,y:G},z=z/9525*r.x,B=B/9525*r.y,F=F/9525*r.x,U=U/9525*r.y,W=W/9525*r.x,G=G/9525*r.y,o.cmds.push(["C",[{x:z,y:B},{x:F,y:U},{x:W,y:G}]])}else"C"===s&&o.cmds.push(["Z",[]])}S.push(o)})),{graphicsWidth:M,graphicsHeight:k,pivot:T,padding:2,pathsData:S}),R=O.graphicsWidth,D=O.graphicsHeight,L=O.pathsData,j=O.pivot,z=O.padding;this.graphics.push({hash:N,pathsData:L,pivot:j,width:R,height:D,padding:z})}return e}},{key:"pack",value:function(){return this.graphics.forEach((function(e){e.width+=4,e.height+=4})),function e(t){for(var r=[],n=t.filter((function(e){var t=e.width<2048&&e.height<2048;return t||r.push(e),t})).sort((function(e,t){return e.width*e.height-t.width*t.height})),i=n.length+1,o=2050,a=2050,s=[],u=null;(o>2048||a>2048)&&n.length>0;)i-=1,o=(u=av()(n.slice(0,i))).width,a=u.height;return u&&s.push(u),r.forEach((function(e){var t=av()([e]);s.push(t)})),i2&&void 0!==arguments[2]?arguments[2]:{type:"el",index:0,id:""},o=this.targets[e.id];return"shape"!==e.type?o:("shape"===e.type&&e.txEl&&(o=null!==(r=null==o?void 0:o.getTextElement(e.txEl.type,e.txEl.range))&&void 0!==r?r:null),"shape"===e.type&&e.bg&&0===i.index&&(t=!1,o=null!==(n=null==o?void 0:o.getBgElement())&&void 0!==n?n:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),t&&o?o.getIterateEntry(i.type,i.index,i.id):(o||this.eventHub.emit("IterateTimeNodeEnd",i.id),o))}},{key:"clearTargets",value:function(){this.targets=Object.create(null)}}]),e}(),Nv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.strokeColorFilter.currentColor},set:function(e){this.target.strokeColorFilter.color=e}},{key:"on",get:function(){return this.target.strokeActive?"true":"false"},set:function(e){this.target.strokeActive="true"===e}}]),e}(),Ov=function e(t){var r=this;x(this,e),this.applyCommand=function(e,t){r.target.applyCommand(e,t)},this.target=t},Rv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"toString",value:function(){return this.color}},{key:"color",get:function(){return this.target.pptColorFilter.currentColor},set:function(e){this.target.pptColorActive&&(this.target.pptColorFilter.color=e)}},{key:"on",get:function(){return this.target.pptColorActive?"true":"false"},set:function(e){this.target.pptColorActive="true"===e}},{key:"designColor",get:function(){return this.target.pptColorFilter.designColor}}]),e}(),Dv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.fillColorFilter.currentColor},set:function(e){this.target.fillActive&&(this.target.fillColorFilter.color=e)}},{key:"on",get:function(){return this.target.fillActive?"true":"false"},set:function(e){this.target.fillActive="true"===e}},{key:"designColor",get:function(){return this.target.fillColorFilter.designColor}}]),e}(),Lv=function(){function e(t,r,n){x(this,e),this.hardHidden=!1,this.designRotation=0,this.target=t,!0===r&&(this.hardHidden=!0),this.designRotation=n}return S(e,[{key:"opacity",get:function(){return this.target.alpha},set:function(e){this.target.alpha=e}},{key:"rotation",get:function(){return this.target.rotation/Math.PI*180},set:function(e){this.target.rotation=e/180*Math.PI+this.designRotation}},{key:"visibility",get:function(){return this.target.visible?"visible":"hidden"},set:function(e){this.visibility===e||this.hardHidden||(this.target.visible="visible"===e)}}]),e}(),jv=function(){function e(t,r){x(this,e),this.actions=[],this.ctx=r,this.object=t,this.object.interactive=!0}return S(e,[{key:"reset",value:function(e){this.object.interactive=!1,this.object.removeAllListeners(),this.object=e,this.object.interactive=!0}},{key:"addAction",value:function(e,t){var r=this;this.actions.push([e,t]),"click"===t?(this.object.addListener("pointertap",(function(){return r.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return r.handleAction(e)}))}},{key:"getOriginHitArea",value:function(){return this.object.hitArea?this.object.hitArea:new jl.k(0,0,this.object.width,this.object.height)}},{key:"handleAction",value:function(e){this.ctx.eventHub.emit(__.hyperlinkTrigger,e),this.execAction(e)}},{key:"execAction",value:function(e){var t,r;if(this.ctx.eventHub.emit(__.userInput),"ppaction://hlinksldjump"===e.action){var n=(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(__.requestGotoSlide,Number(n[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(__.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(__.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(__.requestGotoSlide,i)}else"ppaction://hlinkshowjump?jump=endshow"===e.action?this.ctx.eventHub.emit(__.requestGotoSlide,-1):""===e.action&&(null===(r=e.target)||void 0===r?void 0:r.startsWith("http"))&&this.ctx.eventHub.emit(__.requestOpenUrl,e.target)}}]),e}();function zv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return Math.abs(e-t)<=Math.pow(10,-r)}function Bv(e){return Math.floor(1e6*e)/1e6}var Fv=function(){function e(){x(this,e),this.point={x:0,y:0},this.slope=Math.PI/4}return S(e,[{key:"resolveY",value:function(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}},{key:"distanceToLinearEquation",value:function(e){return zv(this.slope,e.slope)?this.distanceToPoint(e.point):-1}},{key:"distanceToPoint",value:function(t){var r;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;r=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;var n=e.fromPointSlope(t,r),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}},{key:"crossPoint",value:function(e){if(zv(e.slope,this.slope))return null;var t=0,r=0,n=Math.tan(e.slope),i=Math.tan(this.slope),o=this.point,a=o.x,s=o.y,u=e.point,l=u.x,c=u.y;return zv(this.slope,Math.PI/2)?r=n*((t=this.point.x)-l)+c:zv(e.slope,Math.PI/2)?r=i*((t=e.point.x)-a)+s:zv(this.slope,Math.PI)||zv(this.slope,0)?t=((r=this.point.y)-c)/n+l:zv(e.slope,Math.PI)||zv(e.slope,0)?t=((r=e.point.y)-s)/i+a:r=i*((t=(n*l-c+s-i*a)/(n-i))-a)+s,{x:t,y:r}}}],[{key:"fromPointSlope",value:function(t,r){var n=new e;return n.point=t,n.slope=r,n}}]),e}(),Uv=function(){function e(t,r,n){var i,o,a,s,u,l,c=this;x(this,e),this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new jl.j(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new Dl.b,this.ctx=r,this.style=new Lv(this.container,!!t.hardHidden,t.rotation||0),this.designGlobalPosition={x:n.parentGlobalPos.x+(null!==(o=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0),y:n.parentGlobalPos.y+(null!==(s=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new jv(this.container,this.ctx),t.hlinkHover&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil((function(){try{return!!c.container.width}catch(e){return!1}}),3e3).then((function(){try{c.designWidth=c.designWidth||c.container.width}catch(e){}})),this.ctx.clock.waitUntil((function(){try{return!!c.container.height}catch(e){return!1}}),3e3).then((function(){try{c.designHeight=c.designHeight||c.container.height}catch(e){}}))}return S(e,[{key:"updateScale",value:function(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}},{key:"updateTransform",value:function(e){var t,r,n,i,o,a,s,u;this.designWidth=e.width,this.designHeight=e.height,this.designX=null!==(r=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,this.designY=null!==(i=null===(n=e.position)||void 0===n?void 0:n.y)&&void 0!==i?i:0;var l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;var h=null!==(a=null===(o=e.position)||void 0===o?void 0:o.x)&&void 0!==a?a:0,d=null!==(u=null===(s=e.position)||void 0===s?void 0:s.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,e.scale&&(this.designScale={x:e.scale.x,y:e.scale.y},this.container.scale.x=e.scale.x,this.container.scale.y=e.scale.y),e.rotation&&(this.container.rotation=e.rotation);var f=new Nd;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}},{key:"scale",get:function(){return this.scaleOrigin},set:function(e){this.scaleOrigin.x=e.x,this.scaleOrigin.y=e.y,this.updateScale()}},{key:"design_ppt_w",get:function(){return Bv(this.designWidth/this.ctx.stageWidth)}},{key:"design_ppt_h",get:function(){return Bv((this.designHeight||this.container.height)/this.ctx.stageHeight)}},{key:"design_ppt_x",get:function(){return Bv(this.designX/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.designY/this.ctx.stageHeight)}},{key:"ppt_w",get:function(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth},set:function(e){this.designWidth&&(this.scaleExt.x=e*this.ctx.stageWidth/this.designWidth,this.updateScale())}},{key:"ppt_h",get:function(){var e=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*e/this.ctx.stageHeight},set:function(e){this.designHeight&&(this.scaleExt.y=e*this.ctx.stageHeight/this.designHeight,this.updateScale())}},{key:"ppt_x",get:function(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth},set:function(e){this.pptX=e;var t=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=e*this.ctx.stageWidth+this.container.pivot.x*t}},{key:"ppt_y",get:function(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight},set:function(e){this.pptY=e;var t=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=e*this.ctx.stageHeight+this.container.pivot.y*t}},{key:"r",get:function(){return this.container.rotation},set:function(e){this.container.rotation=e}},{key:"xshear",set:function(e){this.container.skew.x=e},get:function(){return this.container.skew.x}},{key:"yshear",set:function(e){this.container.skew.y=e},get:function(){return this.container.skew.y}}]),e}(),Wv=r(112),Gv=r.n(Wv),Vv=function(){function e(t){if(x(this,e),this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;var r=t.match(/-?[0-9]+/g);r&&(this.h=parseInt(r[0],10),this.s=parseInt(r[1],10)/100,this.l=parseInt(r[2],10)/100)}}return S(e,[{key:"isInit",value:function(){return this._isInit}},{key:"by",value:function(e,t){t.h=Math.max(Math.min(this.h+e.h,359),0),t.s=Math.max(Math.min(this.s+e.s,1),0),t.l=Math.max(Math.min(this.l+e.l,1),0),t.a=Math.max(Math.min(this.a+e.a,1),0)}},{key:"fromHexString",value:function(e){var t,r,n=c($v(e),4),i=n[0],o=n[1],a=n[2],s=n[3],u=0,l=Math.max(i,o,a),h=Math.min(i,o,a),d=l-h;r=(l+h)/2,0===d?u=0:l===i?u=(o-a)/d%6*60:l===o?u=60*((a-i)/d+2):l===a&&(u=60*((i-o)/d+4)),t=0===d?0:d/(1-Math.abs(2*r-1)),this.h=u,this.s=t,this.l=r,this.a=s}},{key:"interpolationFrom",value:function(e,t,r){var n=e.h+(this.h-e.h)*t,i=e.s+(this.s-e.s)*t,o=e.l+(this.l-e.l)*t,a=e.a+(this.a-e.a)*t;r.h=Math.max(Math.min(n,359),0),r.s=Math.max(Math.min(i,1),0),r.l=Math.max(Math.min(o,1),0),r.a=Math.max(Math.min(a,1),0)}},{key:"toHexString",value:function(){var e=[0,0,0,0],t=this.h,r=this.s,n=this.l;if(t<360&&t>=0&&r<=1&&r>=0&&n<=1&&n>=0){var i,o=(1-Math.abs(2*n-1))*r,a=o*(1-Math.abs(t/60%2-1)),s=n-o/2;e=[(i=c(t>=0&&t<60?[o,a,0]:t>=60&&t<120?[a,o,0]:t>=120&&t<180?[0,o,a]:t>=180&&t<240?[0,a,o]:t>=240&&t<300?[a,0,o]:[o,0,a],3))[0]+s,i[1]+s,i[2]+s,this.a]}return Xv(e)}}]),e}(),Hv=function(){function e(t){x(this,e),this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}return S(e,[{key:"fromHexString",value:function(e){var t=c($v(e),4),r=t[0],n=t[1],i=t[2],o=t[3];this.r=r,this.g=n,this.b=i,this.a=o}},{key:"isInit",value:function(){return this._isInit}},{key:"interpolationFrom",value:function(e,t,r){r.r=e.r+(this.r-e.r)*t,r.g=e.g+(this.g-e.g)*t,r.b=e.b+(this.b-e.b)*t,r.a=e.a+(this.a-e.a)*t}},{key:"by",value:function(e,t){t.r=Math.min(Math.max(this.r+e.r,0),255),t.g=Math.min(Math.max(this.g+e.g,0),255),t.b=Math.min(Math.max(this.b+e.b,0),255),t.a=Math.min(Math.max(this.a+e.a,0),1)}},{key:"toHexString",value:function(){return Xv([this.r,this.g,this.b,this.a])}}]),e}();function Yv(e){var t=e.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function $v(e){return 0===(e=e.replace(/^#/,"")).substring(6,8).length&&(e+="FF"),[parseInt(e.substring(0,2).padStart(8,"0"),16)/255,parseInt(e.substring(2,4).padStart(8,"0"),16)/255,parseInt(e.substring(4,6).padStart(8,"0"),16)/255,parseInt(e.substring(6,8).padStart(8,"0"),16)/255]}function Xv(e){return"#"+Math.round(255*e[0]).toString(16).padStart(2,"0")+Math.round(255*e[1]).toString(16).padStart(2,"0")+Math.round(255*e[2]).toString(16).padStart(2,"0")+Math.round(255*e[3]).toString(16).padStart(2,"0")}function qv(e,t,r){var n=$v(e),i=$v(t),o=Math.round(255*(n[0]+(i[0]-n[0])*r)),a=Math.round(255*(n[1]+(i[1]-n[1])*r)),s=Math.round(255*(n[2]+(i[2]-n[2])*r)),u=Math.round(255*(n[3]+(i[3]-n[3])*r));return"#"+o.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}var Qv=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this,void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0})).currentColor="#FFFFFFFF",e.designColor="#FFFFFFFF",e}return S(r,[{key:"color",set:function(e){this.currentColor=e;var t=$v(e);this.uniforms.color=Float32Array.from(t)},get:function(){return this.currentColor}}]),r}($l.k),Zv=new Bp.ColorMatrixFilter;Zv.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];var Kv=new Bp.ColorMatrixFilter;Kv.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];var Jv=new Bp.ColorMatrixFilter;Jv.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];var eg=new Bp.ColorMatrixFilter;eg.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];var tg={darken:Zv,darkenLess:Kv,lightenLess:eg,lighten:Jv},rg=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,{position:{x:e.x,y:e.y},width:e.width,height:e.height},n,i)).fillColorFilter=new Qv,o.fill=new Dv(y(o)),o.json=e,o.ctx=n,o.parentGlobalPos=i.parentGlobalPos,o.global={x:i.parentGlobalPos.x+e.x,y:i.parentGlobalPos.y+e.y},o.updateTransform({position:{x:e.x,y:e.y},width:e.width,height:e.height}),o}return S(r,[{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"getTextElement",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"fillActive",get:function(){var e,t;return(null!==(t=null===(e=this.container.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){var t,r;e?(null!==(r=null===(t=this.container.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}},{key:"renderContainer",get:function(){return this.container}},{key:"interactiveContainer",get:function(){return this.container}},{key:"ppt_x",get:function(){return this.global.x/this.ctx.stageWidth},set:function(e){var t=e*this.ctx.stageWidth-this.global.x,r=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+t+this.container.pivot.x*r}},{key:"ppt_y",get:function(){return this.global.y/this.ctx.stageHeight},set:function(e){var t=e*this.ctx.stageHeight-this.global.y,r=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+t+this.container.pivot.y*r}},{key:"design_ppt_x",get:function(){return Bv(this.global.x/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.global.y/this.ctx.stageHeight)}}]),r}(Uv),ng=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.ctx=t,this.type=r,this.lineWidth=n,this.width=i,this.height=o,this.fillColor=a,this.isHorz=s,this.renderContainer=new Dl.b,this.ghcTextureId="".concat(u,"-text-p").concat(l,"-l").concat(c,"-u").concat(h,"-underLine")}return S(e,[{key:"createPaths",value:function(){if("ww"===this.type)return null;var e,t="M 0,0 L ".concat(9525*this.width,",0"),r=[this.width,this.lineWidth],n=r[0],i=r[1];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,n=(e=[this.lineWidth,this.height])[0],i=e[1]),{paths:[{id:uv(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:xv()(t)}],width:n,height:i}}},{key:"getLineStyle",value:function(){var e={width:this.lineWidth};return"dotted"===this.type&&(e.dash=""+this.lineWidth),e}},{key:"preRender",value:function(){var e=this.createPaths();if(e){var t=e.paths,r=e.width,n=e.height,i=t.reduce((function(e,t){return e+t.hash}),"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,t,i,{x:0,y:0},r,n,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}},{key:"render",value:function(){if(this.ghcTextureId){var e=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);e&&(this.sprite=new Ld,this.sprite.texture=e.texture,this.sprite.pivot.x=e.pivot.x,this.sprite.scale.x=e.scale,this.sprite.scale.y=e.scale)}}},{key:"destroy",value:function(){var e;null===(e=this.sprite)||void 0===e||e.destroy({texture:!0})}}]),e}(),ig=134217729;function og(e,t,r,n,i){var o,a,s,u,l=t[0],c=n[0],h=0,d=0;c>l==c>-l?(o=l,l=t[++h]):(o=c,c=n[++d]);var f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=t[++h]):(s=o-((a=c+o)-c),c=n[++d]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=t[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++d]),o=a,0!==s&&(i[f++]=s);for(;h0!=s>0)return u;var l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,r,n,i,o,a){var s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=e-i,k=r-i,E=t-o,I=n-o;h=(x=(p=M-(f=(d=ig*M)-(d-M)))*(g=I-(v=(d=ig*I)-(d-I)))-((b=M*I)-f*v-p*v-f*g))-(m=x-(S=(p=E-(f=(d=ig*E)-(d-E)))*(g=k-(v=(d=ig*k)-(d-k)))-((w=E*k)-f*v-p*v-f*g))),sg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),sg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,sg[2]=y-(T-h)+(m-h),sg[3]=T;var A=function(e,t){for(var r=t[0],n=1;n=C||-A>=C)return A;if(s=e-(M+(h=e-M))+(h-i),l=r-(k+(h=r-k))+(h-i),u=t-(E+(h=t-E))+(h-o),c=n-(I+(h=n-I))+(h-o),0===s&&0===u&&0===l&&0===c)return A;if(C=11093356479670487e-47*a+33306690738754706e-32*Math.abs(A),(A+=M*c+I*s-(E*l+k*u))>=C||-A>=C)return A;h=(x=(p=s-(f=(d=ig*s)-(d-s)))*(g=I-(v=(d=ig*I)-(d-I)))-((b=s*I)-f*v-p*v-f*g))-(m=x-(S=(p=u-(f=(d=ig*u)-(d-u)))*(g=k-(v=(d=ig*k)-(d-k)))-((w=u*k)-f*v-p*v-f*g))),hg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),hg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,hg[2]=y-(T-h)+(m-h),hg[3]=T;var P=og(4,sg,4,hg,ug);h=(x=(p=M-(f=(d=ig*M)-(d-M)))*(g=c-(v=(d=ig*c)-(d-c)))-((b=M*c)-f*v-p*v-f*g))-(m=x-(S=(p=E-(f=(d=ig*E)-(d-E)))*(g=l-(v=(d=ig*l)-(d-l)))-((w=E*l)-f*v-p*v-f*g))),hg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),hg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,hg[2]=y-(T-h)+(m-h),hg[3]=T;var N=og(P,ug,4,hg,lg);h=(x=(p=s-(f=(d=ig*s)-(d-s)))*(g=c-(v=(d=ig*c)-(d-c)))-((b=s*c)-f*v-p*v-f*g))-(m=x-(S=(p=u-(f=(d=ig*u)-(d-u)))*(g=l-(v=(d=ig*l)-(d-l)))-((w=u*l)-f*v-p*v-f*g))),hg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),hg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,hg[2]=y-(T-h)+(m-h),hg[3]=T;var O=og(N,lg,4,hg,cg);return cg[O-1]}(e,t,r,n,i,o,l)}var fg=Math.pow(2,-52),pg=new Uint32Array(512),vg=function(){function e(t){x(this,e);var r=t.length>>1;if(r>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;var n=Math.max(2*r-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(r)),this._hullPrev=new Uint32Array(r),this._hullNext=new Uint32Array(r),this._hullTri=new Uint32Array(r),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(r),this._dists=new Float64Array(r),this.update()}return S(e,null,[{key:"from",value:function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xg,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wg,i=t.length,o=new Float64Array(2*i),a=0;a>1,a=1/0,s=1/0,u=-1/0,l=-1/0,c=0;cu&&(u=h),d>l&&(l=d),this._ids[c]=c}for(var f,p,v,g=(a+u)/2,m=(s+l)/2,y=1/0,_=0;_0&&(p=S,y=T)}for(var M=e[2*p],k=e[2*p+1],E=1/0,I=0;IL&&(O[R++]=j,L=this._dists[j])}return this.hull=O.subarray(0,R),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(dg(x,w,M,k,C,P)<0){var z=p,B=M,F=k;p=v,M=C,k=P,v=z,C=B,P=F}var U=function(e,t,r,n,i,o){var a=r-e,s=n-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*h)*d,y:t+(a*h-u*c)*d}}(x,w,M,k,C,P);this._cx=U.x,this._cy=U.y;for(var W=0;W0&&Math.abs(X-V)<=fg&&Math.abs(q-H)<=fg)&&(V=X,H=q,$!==f&&$!==p&&$!==v)){for(var Q=0,Z=0,K=this._hashKey(X,q);Z=0;)if((ee=J)===Q){ee=-1;break}if(-1!==ee){var te=this._addTriangle(ee,$,r[ee],-1,-1,n[ee]);n[$]=this._legalize(te+2),n[ee]=te,G++;for(var re=r[ee];J=r[re],dg(X,q,e[2*re],e[2*re+1],e[2*J],e[2*J+1])<0;)te=this._addTriangle(re,$,J,n[$],-1,n[re]),n[$]=this._legalize(te+2),r[re]=re,G--,re=J;if(ee===Q)for(;dg(X,q,e[2*(J=t[ee])],e[2*J+1],e[2*ee],e[2*ee+1])<0;)te=this._addTriangle(J,$,ee,-1,n[ee],n[J]),this._legalize(te+2),n[J]=te,r[ee]=ee,G--,ee=J;this._hullStart=t[$]=ee,r[ee]=t[re]=$,r[$]=re,i[this._hashKey(X,q)]=$,i[this._hashKey(e[2*ee],e[2*ee+1])]=ee}}}this.hull=new Uint32Array(G);for(var ne=0,ie=this._hullStart;ne0?3-i:1+i)/4*this._hashSize))%this._hashSize;var r,n,i}},{key:"_legalize",value:function(e){for(var t=this._triangles,r=this._halfedges,n=this.coords,i=0,o=0;;){var a=r[e],s=e-e%3;if(o=s+(e+2)%3,-1!==a){var u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,h=t[o],d=t[e],f=t[l],p=t[c];if(mg(n[2*h],n[2*h+1],n[2*d],n[2*d+1],n[2*f],n[2*f+1],n[2*p],n[2*p+1])){t[e]=p,t[a]=h;var v=r[c];if(-1===v){var g=this._hullStart;do{if(this._hullTri[g]===c){this._hullTri[g]=e;break}g=this._hullPrev[g]}while(g!==this._hullStart)}this._link(e,v),this._link(a,r[o]),this._link(o,c);var m=u+(a+1)%3;i=r&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{var u=r+1,l=n;bg(e,r+n>>1,u),t[e[r]]>t[e[n]]&&bg(e,r,n),t[e[u]]>t[e[n]]&&bg(e,u,n),t[e[r]]>t[e[u]]&&bg(e,r,u);for(var c=e[u],h=t[c];;){do{u++}while(t[e[u]]h);if(l=l-r?(_g(e,t,u,n),_g(e,t,r,l-1)):(_g(e,t,r,l-1),_g(e,t,u,n))}}function bg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function xg(e){return e[0]}function wg(e){return e[1]}function Sg(e,t,r){var n=t/2,i=r/2,o=[{x:-n,y:i},{x:-n,y:-i},{x:n,y:i},{x:n,y:-i}],s=[Fv.fromPointSlope({x:-n,y:0},Math.PI/2),Fv.fromPointSlope({x:0,y:i},0),Fv.fromPointSlope({x:n,y:0},Math.PI/2),Fv.fromPointSlope({x:0,y:-i},0)],u=[],l=e.stopList.slice(1,e.stopList.length-1).map((function(o){for(var l,c,h,d=2*Math.PI,f=null!==(c=null===(l=e.line)||void 0===l?void 0:l.ang)&&void 0!==c?c:0;f>d;)f-=d;for(;f<0;)f+=d;var p={x:0,y:0};zv(f,Math.PI/2)?(p.x=0,p.y=r/2-o.pos*r):zv(f,0)?(p.x=o.pos*t-t/2,p.y=0):(p.x=o.pos*t-t/2,p.y=r/2-o.pos*r),f>Math.PI/2&&f<=Math.PI&&(p.x*=-1),f>Math.PI&&f<=2*Math.PI&&(p.y*=-1);var v=Fv.fromPointSlope(p,Math.PI/2-((null===(h=e.line)||void 0===h?void 0:h.ang)||0)),g=s.map((function(e){return v.crossPoint(e)})).filter((function(e){return e&&e.x<=n&&e.x>=-n&&e.y<=i&&e.y>=-i})).map((function(e){return{point:e,color:o.color}})).sort((function(e,t){return t.point.y-e.point.y}));u.push.apply(u,a(g));for(var m=Math.abs(g[1].point.x-g[0].point.x)/10,y=20;y--;){var _=y%2==0?1:-1,b=p.x+_*m,x=v.resolveY(b);b<=n&&b>=-n&&x<=i&&x>=-i&&u.push({point:{x:b,y:x},color:o.color}),m+=m}return v})),c=[],h=[];e:for(var d=0;d= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0) * texColor.a;\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0) * texColor.a;\n }\n}\n",alphaModFix:"\nvec4 transform(vec4 texColor, float arg) {\n return texColor * arg;\n}\n",alphaBiLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < arg) {\n result.a = 0.0;\n } else {\n result.a = 1.0;\n }\n return result;\n}\n",alphaCeiling:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a > 0.0) {\n result.a = 1.0;\n }\n return result;\n}\n",alphaFloor:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < 1.0) {\n result.a = 0.0;\n }\n return result;\n}\n",grayscl:"\nvec4 transform(vec4 texColor, float arg) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n return vec4(avg, avg, avg, texColor.a);\n}\n"},Eg=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=kg[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Mg.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n")),{arg:n})}return r}($l.k),Ig=[Tg],Ag={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n",changeBulletColor:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n if (texColor.a == 0.0) {\n return texColor;\n } else {\n return arg2;\n }\n}\n",duotone:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n // float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n // vec3 hsl = rgb2hsl(vec3(avg, avg, avg));\n // vec3 result = arg2.rgb * hsl.z + arg1.rgb * (1.0 - hsl.z);\n // return vec4(result * texColor.a, texColor.a);\n \n float brightness = texColor.r * 0.3 + texColor.g * 0.59 + texColor.b * 0.11;\n \n return vec4(\n (arg1.r + brightness * (arg2.r - arg1.r)) * texColor.a,\n (arg1.g + brightness * (arg2.g - arg1.g)) * texColor.a,\n (arg1.b + brightness * (arg2.b - arg1.b)) * texColor.a,\n texColor.a\n );\n}\n"},Cg=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Ag[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n".concat(Ig.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:Float32Array.from(n),arg2:Float32Array.from(i)})}return r}($l.k),Pg=[Tg],Ng={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n vec3 rgb = texColor.rgb / texColor.a;\n\n // 对比度\n highp float C = arg2 * 255.0;\n highp float F = (259.0 * (255.0 + C)) / (255.0 * (259.0 - C));\n rgb.rgb = F * (rgb.rgb - 0.5) + 0.5;\n\n // 亮度\n rgb.rgb += arg1 * rgb.rgb;\n\n rgb.rgb *= texColor.a;\n return vec4(rgb, texColor.a);\n}\n"},Og=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Ng[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n".concat(Pg.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:n,arg2:i})}return r}($l.k),Rg=[Tg],Dg={alphaInv:"\nvec4 transform(vec4 texColor, vec4 arg1) {\n float alpha = 1.0 - texColor.a;\n arg1.rgb = arg1.rgb * alpha;\n arg1.a = alpha;\n return arg1;\n}\n"},Lg=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=Dg[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform sampler2D uSampler;\n\n".concat(Rg.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1);\n}\n")),{arg1:Float32Array.from(n)})}return r}($l.k);function jg(e,t){var r=[];return e.forEach((function(e){var n=((null==t?void 0:t.filter)||[]).indexOf(e.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(e.type)>=0&&n)r.push(new Eg(e.type,e.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(e.type)>=0&&n){var i=$v(e.args[0]),o=$v(e.args[1]);r.push(new Cg(e.type,i,o))}else if("lum"===e.type&&n)r.push(new Og(e.type,e.args[0],e.args[1]));else if("alphaInv"===e.type&&n){var a=$v(e.args[0]);r.push(new Lg(e.type,a))}})),r}var zg=function(){function e(t,r,n,i,o){x(this,e),this.ctx=t,this.fillStyle=r,this.width=n,this.height=i,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=xv()("".concat(JSON.stringify(r)).concat(Math.ceil(n)).concat(Math.ceil(i)))}return S(e,[{key:"createDisplayObject",value:function(){var e;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){var t=new Ld;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType){var r=new Ld,n=function(e,t,r){var n,i=new Dl.b;if(e.stopList.sort((function(e,t){return e.pos-t.pos})),!e.stopList.find((function(e){return 0===e.pos}))){var o=e.stopList[0];e.stopList.unshift({pos:0,color:o.color})}if(!e.stopList.find((function(e){return 1===e.pos}))){var s=e.stopList[e.stopList.length-1];e.stopList.push({pos:1,color:s.color})}var u=function(e){for(var t=[],r=0,n=e.length;r0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(h.filters=jg(u,this.ctx.featureList)),this.config.fillFloat){var d=this.config.fillFloat.fillRect,f=d.l,p=d.t,v=d.r,g=d.b,m=this.width*(1-f-v),y=this.height*(1-p-g),_=null!==(e=this.config.shapeRotation)&&void 0!==e?e:0,b=new Nd;b.drawRect(0,0,m,y),b.pivot.x=m/2,b.pivot.y=y/2,b.rotation=_;var x=b.getBounds(),w=x.width,S=x.height;h.width=w,h.height=S,h.anchor.x=.5,h.anchor.y=.5,h.rotation=-1*_,h.name="math-texture",0===_?(h.position.x=w/2+f*this.width,h.position.y=S/2+p*this.height):(h.position.x=this.width/2,h.position.y=this.height/2)}else h.width=this.width,h.height=this.height,c.rotate&&(h.position.x=this.width/2,h.position.y=this.height/2,h.anchor.x=.5,h.anchor.y=.5,h.rotation=c.rotate/180*Math.PI);return h}}else if("gifFill"===this.fillStyle.fillType){var T=this.fillStyle,M=T.src,k=T.delays,E=T.filters,I=this.ctx.spriteTexture.getGifFrames(M).map((function(e,t){return{texture:e,time:k[t]||20}})),A=new jp(I,!0);A.name=uv(),A.width=this.width,A.height=this.height,E.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(A.filters=jg(E,this.ctx.featureList));var C=this.fillStyle.loop,P=1;return A.onLoop=function(){P+=1,C>0&&P>C&&A.gotoAndStop(A.totalFrames)},A}return null}},{key:"isSolidFill",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)}},{key:"getSolidFillColor",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)?this.fillStyle.color:"#000000"}},{key:"getClonedDisplayObject",value:function(){var e=this.createDisplayObject();return this.clonedObjects.push(e),e}},{key:"destroy",value:function(){var e;null===(e=this._displayObject)||void 0===e||e.destroy(),this._displayObject=null,this.clonedObjects.forEach((function(e){null==e||e.destroy()})),this.clonedObjects=[]}},{key:"displayObject",get:function(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject},set:function(e){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=e}},{key:"hasFill",get:function(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}}]),e}(),Bg=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}($l.k),Fg=r(113),Ug=r.n(Fg),Wg=r(114),Gg=r.n(Wg),Vg=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,Ug.a,Gg.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:$v(e.color),uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:e.rad/2,uSdfPosition:new Float32Array([0,0])})).priority=3,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){var t=Math.ceil(this.json.rad),r=Math.ceil(e.width+2*t),n=Math.ceil(e.height+2*t);return new jl.j(e.x-t,e.y-t,r,n)}},{key:"sdfBox",value:function(e,t){var r=Math.ceil(this.json.rad),n=Math.ceil(e+2*r),i=Math.ceil(t+2*r);return new jl.j(r,r,n,i)}}]),r}(Bg),Hg=r(19),Yg=r.n(Hg),$g=r(115),Xg=r.n($g),qg=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,Yg.a,Xg.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:e.rad,uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:1})).priority=2,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(e,t){return new jl.j(0,0,e,t)}}]),r}(Bg),Qg=function e(){x(this,e)},Zg=r(116),Kg=r.n(Zg),Jg=function(e){p(r,e);var t=g(r);function r(e){return x(this,r),t.call(this,Yg.a,Kg.a,{uColor:$v(e)})}return r}($l.k),em=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).order=1,o.outputTexture=$l.t.WHITE,o.frameTextures=[],o.json=e,o.effectContainer=n,o.outputSprite=new Ld,o.targetScale=i,o.outputSprite.scale.x=o.json.sx,o.outputSprite.scale.y=o.json.sy,o.outputSprite.skew.x=(o.targetScale.x>0?1:-1)*o.json.kx,o.outputSprite.skew.y=(o.targetScale.y>0?1:-1)*o.json.ky,o.outputSprite.filters=[new Bp.BlurFilter(o.json.blurRad/2,4),new Jg(o.json.color)],o}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];if(t){var r=this.effectContainer.getBounds(),n=(this.effectContainer.width-t.width)/2,i=(this.effectContainer.height-t.height)/2,o=new jl.g(r.x,r.y),a=new jl.g(r.x,r.y);switch(this.json.align){case"tl":a.x=r.x,a.y=r.y;break;case"t":a.x=r.x+r.width/2,a.y=r.y,o.x+=r.width/2;break;case"tr":a.x=r.x+r.width,a.y=r.y,o.x+=r.width;break;case"l":a.x=r.x,a.y=r.y+r.height/2,o.y+=r.height/2;break;case"ctr":a.x=r.x+r.width/2,a.y=r.y+r.height/2,o.x+=r.width/2,o.y+=r.height/2;break;case"r":a.x=r.x+r.width,a.y=r.y+r.height/2,o.x+=r.width,o.y+=r.height/2;break;case"bl":a.x=r.x,a.y=r.y+r.height,o.y+=r.height;break;case"b":a.x=r.x+r.width/2,a.y=r.y+r.height,o.x+=r.width/2,o.y+=r.height;break;case"br":a.x=r.x+r.width,a.y=r.y+r.height,o.x+=r.width,o.y+=r.height}var s=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=s.x,this.outputSprite.pivot.y=s.y;var u=new jl.g(this.json.dist,0),l=new jl.d;l.rotate(this.json.dir),l.translate(o.x+n,o.y+i),l.apply({x:u.x,y:u.y},u);var c=this.effectContainer.toLocal(u);this.outputSprite.position.x=c.x,this.outputSprite.position.y=c.y,this.outputSprite.texture=t}}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){}}]),r}(Qg),tm=r(117),rm=r.n(tm),nm=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),i=t.call(this,Yg.a,rm.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:n}),console.log(y(i)),i}return r}($l.k),im=function(e){p(r,e);var t=g(r);function r(e,n,i,o,a){var s;x(this,r),(s=t.call(this)).order=2,s.outputSprite=new Ld,s.outputTexture=$l.t.WHITE,s.frameTextures=[],s.json=e,s.shapeScaleX=o,s.effectContainer=n,s.rotation=i,s.ctx=a,s.outputSprite.anchor.x=.5,s.outputSprite.anchor.y=.5;var u=s.effectContainer.getBounds();return s.outputSprite.filters=[new Bp.BlurFilter(s.json.blurRad/2,4),new nm(s.json,u.height)],s.outputSprite.alpha=.5,s.outputSprite.rotation=-1===s.shapeScaleX?Math.PI+2*s.rotation:Math.PI-2*s.rotation,s.outputSprite.scale.x=-1,s}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];t&&(this.outputSprite.texture=t)}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){var r=this.effectContainer.getBounds(),n=new jl.g(r.x+r.width/2,r.y+r.height/2),i=new jl.g(n.x,n.y+r.height+this.json.dist),o=this.effectContainer.toLocal(i);this.outputSprite.position.x=o.x+e,this.outputSprite.position.y=o.y+t}}]),r}(Qg),om=r(118),am=r.n(om),sm=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,Yg.a,am.a,{})).priority=1,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),r}(Bg),um=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},lm=function(e){p(r,e);var t=g(r);function r(e,n,i,o,s,u){var l;x(this,r),(l=t.call(this)).effects=[],l.attachs=[],l.frames=new Map,l._targetContainer=new Dl.b,l.frameCount=1,l.ctx=o,l.originWidth=e.width,l.originHeight=e.height,l.cacheKey=i,l.sourceSprite=new Ld;var c,h=M(n);try{for(h.s();!(c=h.n()).done;){var d=c.value;switch(d.type){case"innerShadow":l.effects.push(new sm(d));break;case"softEdge":l.effects.push(new qg(d));break;case"glow":l.effects.push(new Vg(d));break;case"reflection":l.attachs.push(new im(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new em(d,e,u))}}}catch(e){h.e(e)}finally{h.f()}l.effects=l.effects.sort((function(e,t){return e.priority-t.priority})),l.attachs=l.attachs.sort((function(e,t){return e.order-t.order}));var f,p=M(l.attachs);try{for(p.s();!(f=p.n()).done;){var v=f.value;l._targetContainer.addChild(v.outputSprite)}}catch(e){p.e(e)}finally{p.f()}l.sourceSprite.name="source-sprite";var g=new jl.j(0,0,l.originWidth,l.originHeight),m=l.effects.map((function(e){return e.filterAreaJustify(g)})),y=m.map((function(e){return e.x})),_=m.map((function(e){return e.y})),b=m.map((function(e){return e.width})),w=m.map((function(e){return e.height}));return l.filterArea=new jl.j(Math.min.apply(Math,a(y).concat([0])),Math.min.apply(Math,a(_).concat([0])),Math.max.apply(Math,a(b).concat([l.originWidth])),Math.max.apply(Math,a(w).concat([l.originHeight]))),l.sourceSprite.filters=l.effects,l.sourceSprite.filterArea=new jl.j(0,0,l.filterArea.width,l.filterArea.height),l._targetSprite=new Ld,l._targetSprite.name="effect-sprite",l._targetContainer.sortableChildren=!0,l._targetSprite.zIndex=999,l._targetContainer.addChild(l._targetSprite),l}return S(r,[{key:"getSdfTexture",value:function(e,t){return um(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n="".concat(this.cacheKey,"_").concat(e),i=this.effects.map((function(e){return{sdfRect:e.sdfBox(t.width,t.height)}})).reduce((function(e,t){return t.sdfRect?(e.width5&&(t.dist=5),b[e]})),o.ctx.slideScopeEventHub.once("slide-render",(function(e){if(o.ctx.slideIndex===e&&o.effectObject){var t=o.getEffectTexture();if(t){var r=t.texture,n=t.offsetX,i=t.offsetY;o.effectObject.setFrameOffset(n,i),o.effectObject.createFrame(1,r)}}}))}return o}return S(r,[{key:"getEffectTexture",value:function(){var e,t=this.json,r=t.lineHeight,n=t.fillLineHeight,i=t.isHorz,o=t.lineWidth,a=this.effectContainer.getLocalBounds(),s=0,u=0,l=M(this.effectContainer.children);try{for(l.s();!(e=l.n()).done;){var c=e.value;c.pivot.x>s&&(s=c.pivot.x),c.pivot.y>u&&(u=c.pivot.y)}}catch(e){l.e(e)}finally{l.f()}var h=new jl.d;h.translate(s,u);var d=$l.p.create({width:i?a.width:o,height:i?Math.max(n,r):a.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:d,transform:h}),{texture:d,offsetX:s,offsetY:u}}},{key:"createStrokeFill",value:function(){var e=this.json,t=e.stroke,r=e.lineWidth,n=e.lineHeight;return new zg(this.ctx,null==t?void 0:t.fill,r,n,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createStrokeGraphics",value:function(){var e=this.json.stroke,t=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[]}:void 0;return new zg(this.ctx,t,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createTextFill",value:function(){var e=this.json,t=e.isHorz,r=e.fill,n=e.lineWidth,i=e.lineHeight,o=e.fillLineHeight;return t?new zg(this.ctx,null==r?void 0:r.fill,n,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new zg(this.ctx,null==r?void 0:r.fill,o,i,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextGraphics",value:function(){var e,t=this.json,r=t.fill,n=t.content,i="#000000";"solidFill"===(null===(e=null==r?void 0:r.fill)||void 0===e?void 0:e.fillType)&&(i=r.fill.color);var o=(null==r?void 0:r.key)?{fillType:"blipFill",src:r.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new zg(this.ctx,o,(null==r?void 0:r.width)||0,(null==r?void 0:r.height)||0,{useFilter:"◾"===n,useSlideBackgroundFill:!1})}},{key:"getIterateEntry",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"updateTransform",value:function(e){var t,n,i,o,a=this.json.isHorz;e.position={x:a&&null!==(n=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:a?0:null!==(o=null===(i=e.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},e.width=a?this.json.width:this.json.lineWidth,e.height=a?this.json.lineHeight:this.json.height,f(b(r.prototype),"updateTransform",this).call(this,e)}},{key:"preRender",value:function(){var e;null===(e=this.underline)||void 0===e||e.preRender()}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return cm(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.doRender();case 1:case"end":return e.stop()}}),e,this)})))}),"@TextUnitImpl[doRender]"),e.addSubMTask((function(){return cm(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.effectList&&this.effectList.length>0&&(r="".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(null===(t=this.json.fill)||void 0===t?void 0:t.key,"_").concat(this.json.effectIndexList),this.effectObject=new lm(this.effectContainer,this.effectList,r,this.ctx,0,new jl.g(1,1)),this.effectObject.on("ready",(function(){var e;n.effectContainer.visible=!1,n.effectObject.container.zIndex=10,n.container.addChild(n.effectObject.container),null===(e=n.effectObject)||void 0===e||e.updateFrame(1)})));case 1:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"doRender",value:function(){var e=!1,t=this.json,r=t.lineWidth,n=t.lineHeight,i=t.baseLine,o=t.isHorz,a=t.underline,s=t.stroke,u=t.height,l=t.width,h=t.highlightColor,d=t.x,f=t.y,p=t.content,v=t.fillLineHeight,g=t.fill,m=!1!==this.json.needFill;if(g&&g.fill&&"solidFill"!==g.fill.fillType&&(m=!0),h){var y=new Nd,_=c(Yv(h),2),b=_[0],x=_[1];y.beginFill(b,x),y.drawRect(0,0,o?l:r,o?n:u),y.endFill(),this.textureContainer.addChild(y)}if(this.textGraphics.displayObject){var w=this.textGraphics.displayObject;if(o&&(w.position.y=f>0?f:0),m){var S=this.textFill.displayObject;if(S)S.mask=w,S.addChild(w),S.position.x=-d,w.position.x+=d,e=!0,this.textureContainer.addChild(S);else if(this.textFill.isSolidFill()){var T=new Qv;T.color=this.textFill.getSolidFillColor(),w.filters=[T],e=!0,this.textureContainer.addChild(w)}}else this.textureContainer.addChild(w)}if(this.strokeGraphics.displayObject){var M=this.strokeGraphics.displayObject;if(m){var k=this.strokeFill.displayObject;if(k)k.mask=M,k.addChild(M),o?k.position.y=f>0?f:0:k.position.x=d,this.textureContainer.addChild(k);else if(this.strokeFill.isSolidFill()){o?M.position.y=Math.max(f,0):M.position.x=d;var E=new Qv;E.color=this.strokeFill.getSolidFillColor(),M.filters=[E],e=!0,this.textureContainer.addChild(M)}}else o?M.position.y=f>0?f:0:M.position.x=d,this.textureContainer.addChild(M);var I=s&&g?(s.width-(null==g?void 0:g.width))/4:0;M.position.x-=I}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=a?a-n/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);var A=this.textFill.getClonedDisplayObject();A?(A.mask=this.underline.sprite,A.addChild(this.underline.sprite),this.textureContainer.addChild(A)):this.textureContainer.addChild(this.underline.sprite)}if(e){var C=$l.p.create({width:o?l:r,height:o?Math.max(v,n):u,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:C}),this.cacheSprite.texture=C,o&&f<0&&(this.cacheSprite.position.y=f),this.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.addChild(this.textureContainer);this.container.name=p}},{key:"destroy",value:function(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}]),r}(rg),dm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},fm=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n,i)).units=[],o.isHorz=!0,o.hyperLinkMap=new Map,o.hyperLinkContainerMap=new Map,o.effectList=[],i.effectList&&(o.effectList=i.effectList),o}return S(r,[{key:"getIterateElements",value:function(){return this.units}},{key:"getIterateEntry",value:function(e,t,r){return this.units[t]?this.units[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createUnits",value:function(e,t,r,n){for(var i=this,o=function(o,a){n.addSubMTask((function(){return dm(i,void 0,void 0,regeneratorRuntime.mark((function n(){var i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.textUnits[o],a=this.json,s=a.height,u=a.width,l=a.fillHeight,c=a.baseline,h=a.y,d=a.underline,(f=new hm(Object.assign(Object.assign({},i),{lineHeight:s,lineWidth:u,baseLine:c-h,underline:d,fillLineHeight:l||s,isHorz:this.isHorz,shapeId:e,paragraphIndex:t,lineIndex:r,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).preRender(),this.units.push(f),(i.hyperlink||i.hlinkHover)&&(p=new jv(f.container,this.ctx),i.hyperlink&&p.addAction(i.hyperlink,"click"),i.hlinkHover&&p.addAction(i.hlinkHover,"hover"),this.container.sortableChildren=!0);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextLineImpl[createUnits]")},a=0,s=this.json.textUnits.length;a0)return this.iterateElements;var e=this.lines.reduce((function(e,t){return e.concat(t.getIterateElements())}),[]);return this.iterateElements=e,e}},{key:"getIterateEntry",value:function(e,t,r){var n=this.getIterateElements();return n[t]?n[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createLines",value:function(e,t,r){for(var n=this,i=function(i,o){r.addSubMTask((function(){return pm(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=this.json.lines[i],(a=new fm(o,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).isHorz=this.isHorz,a.container.name="line-"+i,a.createUnits(e,t,i,r),this.lines.push(a);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextParagraphImpl[createLines]")},o=0,a=this.json.lines.length;o90&&o<270||o<-90&&o>-270)&&(n=-n),i=-a*n}return{x:n,y:i}}((i=-i)/Math.PI*180,r,n),s=e.x-a.x,u=e.y-a.y;return{centerX:s/9525*t.x,centerY:u/9525*t.y,rx:r/9525*t.x,ry:n/9525*t.y,st:-i,end:-i+o,aClockWise:o<0}}function mm(e){for(var t=new os,r=e.scale,n={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=bm(s.paths[0].path,this.json.width,this.json.height,i,o),s.paths.unshift(Object.assign(Object.assign({},s.paths[0]),{path:d}))),f=function(e,t,r,n){if(!_m[r])return null;var i=_m[r].top(mm(t)),o=_m[r].bottom(mm(e));if(i.length!==o.length)return null;for(var a=Math.min(i.length,o.length),s=1/(a-1),u=[],l=[],c=new Array(2*a).fill("").map((function(e,t){return t})),h=0;h0&&(this.textColorFilter.color=e)},get:function(){return this.textColorFilter.color}},{key:"on",get:function(){var e;return(null!==(e=this.container.filters)&&void 0!==e?e:[]).length>0?"true":"false"},set:function(e){var t;"true"===e?(null!==(t=this.container.filters)&&void 0!==t?t:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}}]),e}(),Sm=function(){function e(t){x(this,e),this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}return S(e,[{key:"setPivot",value:function(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;default:this.pivot={x:this.width,y:this.height/2}}}},{key:"generatePaths",value:function(){this.hash="arrow-"+xv()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}},{key:"getUnitPath",value:function(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}},{key:"setScaleFromLineWidth",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}},{key:"setScaleFromSize",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}]),e}(),Tm=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.id=t,this.ctx=r,this.paths=n,this.hash=i,this.nept=o,this.width=a,this.height=s,this.lineStyle=u,this.shouldFill=l,this.bgColor=c,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}return S(e,[{key:"pointDis",value:function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}},{key:"isPoint",value:function(e){return Number.isNaN(Number(e.x))||Number.isNaN(Number(e.y))}},{key:"isSquare",value:function(e,t){var r=this;if("MLLLC"!==e.join("")&&"MLLLCC"!==e.join(""))return!1;var n=t.filter((function(e){return!r.isPoint(e)}));if(4!==n.length)return!1;var i,o=Math.min.apply(Math,a(n.map((function(e){return e.x})))),s=Math.min.apply(Math,a(n.map((function(e){return e.y})))),u=Math.max.apply(Math,a(n.map((function(e){return e.x})))),l=Math.max.apply(Math,a(n.map((function(e){return e.y})))),c=M(n);try{for(c.s();!(i=c.n()).done;){var h=i.value;if(h.x!==o&&h.x!==u||h.y!==s&&h.y!==l)return!1}}catch(e){c.e(e)}finally{c.f()}return!0}},{key:"rectangleDetect",value:function(e){if(1!==e.length)return!1;var t=e[0].path.trim().split(" ");if(10!==t.length)return!1;for(var r=[],n=[],i=0;ir&&(r=o.pivot.x),o.pivot.y>n&&(n=o.pivot.y)}}catch(e){i.e(e)}finally{i.f()}var a=new jl.d;if(a.translate(r,n),0===this.effectContainer.children.length)return null;var s=$l.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:s,transform:a}),{texture:s,offsetX:r,offsetY:n}}},{key:"createStrokeGraphics",value:function(){var e,t,r,n,i=this.json,o=i.id,a=i.geometry,s=i.lineStyle,u=(null==a?void 0:a.lineTransform)||km,l=u.width,c=u.height,h=u.pivot,d=l||this.json.width,f=c||this.json.height,p="solidFill"===(null===(e=null==s?void 0:s.fill)||void 0===e?void 0:e.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(t=s.fill)||void 0===t?void 0:t.fillType)?new Tm(o+"-path-graphics",this.ctx,null!==(r=null==a?void 0:a.paths)&&void 0!==r?r:[],null!==(n=null==a?void 0:a.hash)&&void 0!==n?n:"",h||{x:0,y:0},d,f,s,!1,null,p):null}},{key:"createStrokeFill",value:function(){var e=c(this.calculateFillObjectOffset(),2),t=e[0],r=e[1],n=this.json,i=n.geometry,o=n.lineStyle,a=n.width,s=n.height,u=(null==i?void 0:i.lineTransform)||km,l=Sv()(null==o?void 0:o.width)?o.width:1;return new zg(this.ctx,null==o?void 0:o.fill,(u.width||a)+l+t,Math.max((u.height||s)+l,r),{useFilter:!0,useSlideBackgroundFill:!1})}},{key:"createBackgroundGraphics",value:function(){var e,t=this.json,r=t.geometry,n=t.lineStyle,i=t.fillStyle,o=t.id,a=(null==r?void 0:r.lineTransform)||km,s=a.width,u=a.height,l=a.pivot,c=s||this.json.width,h=u||this.json.height,d="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new Tm(o+"-bg-graphics",this.ctx,null!==(e=null==r?void 0:r.paths)&&void 0!==e?e:[],(null==r?void 0:r.hash)||"",l||{x:0,y:0},c,h,n,!0,d,null):null}},{key:"createBackgroundFill",value:function(){var e,t,r,n,i=this.json,o=i.fillStyle,a=i.width,s=i.height,u=i.lineStyle,l=i.geometry,c=(null==l?void 0:l.fillTransform)||km,h={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},d=this.useGroupFill&&(null===(e=this.option.groupSize)||void 0===e?void 0:e.w)?this.option.groupSize.w:c.width||a,f=this.useGroupFill&&(null===(t=this.option.groupSize)||void 0===t?void 0:t.h)?this.option.groupSize.h:c.height||s;return new zg(this.ctx,o,d+(null!==(r=null==u?void 0:u.width)&&void 0!==r?r:0),f+(null!==(n=null==u?void 0:u.width)&&void 0!==n?n:0),h)}},{key:"createBackground",value:function(){var e,t,r,n,i,o,a,s,u,l,c,h,d=(null===(e=this.json.geometry)||void 0===e?void 0:e.fillTransform)||km,f=d.pivot,p=d.width,v=d.height,g=this.backgroundFill.displayObject;g?(this.json.useBgFill&&(null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)?(this.needCacheAsBitMap=!0,g.mask=this.backgroundGraphics.displayObject,g.pivot.x=(null===(n=this.json.position)||void 0===n?void 0:n.x)||0,g.pivot.y=(null===(i=this.json.position)||void 0===i?void 0:i.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(g.height=v||this.designHeight,g.width=p||this.designWidth,g instanceof jp&&g.play(),(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(g.width,g.height))&&(g.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(g.width,g.height))&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,g.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(g.x=f.x,g.y=f.y),this.useGroupFill&&(g.x-=null!==(l=null===(u=this.json.position)||void 0===u?void 0:u.x)&&void 0!==l?l:0,g.y-=null!==(h=null===(c=this.json.position)||void 0===c?void 0:c.y)&&void 0!==h?h:0),this.effectContainer.addChild(g)):this.backgroundFill.hasFill&&(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}},{key:"createPathFill",value:function(){var e,t,r,n=this.strokeFill.displayObject,i=null===(e=this.strokeGraphics)||void 0===e?void 0:e.displayObject,o=c(this.calculateFillObjectOffset(),2),a=o[0],s=o[1];n?((null===(t=this.strokeGraphics)||void 0===t?void 0:t.isNeedMask(n.width,n.height))&&i&&(this.needCacheAsBitMap=!0,n.pivot.x=i.pivot.x,n.pivot.y=i.pivot.y,i.pivot.x=0,i.pivot.y=0,n.mask=i,n.addChild(i),n.position.x=-a/2,n.position.y=-s/2,i.position.x=a/2,i.position.y=s/2),this.effectContainer.addChild(n)):this.strokeFill.hasFill&&(null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}},{key:"createFilledPathMask",value:function(){var e,t,r,n,i=(null===(t=null===(e=this.json.geometry)||void 0===e?void 0:e.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],o=M(i);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.ctx.graphicsTexture.getGraphicsData(a.id);if(s){var u=new Ld(s.texture);u.pivot.x=s.pivot.x,u.pivot.y=s.pivot.y,u.scale.x=s.scale,u.scale.y=s.scale;var l=this.backgroundFill.getClonedDisplayObject(),c=null===(r=this.backgroundGraphics)||void 0===r?void 0:r.getClonedDisplayObject(),h=l||c;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=u,h.filters=[tg[a.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(h),this.effectContainer.addChild(u))}}}catch(e){o.e(e)}finally{o.f()}}},{key:"createArrow",value:function(){var e=this;this.arrowList.length&&this.arrowList.forEach((function(t){var r,n=e.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(n){var i=n.texture,o=new Ld(i);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,o.scale.x=n.scale,o.scale.y=n.scale,null===(r=e.backgroundGraphics)||void 0===r||r.addArrows(o)}}))}},{key:"generateArrowList",value:function(){var e,t,r=this,n=this.json,i=n.lineArrowList,o=n.lineStyle,a=n.id,s="solidFill"===(null===(e=null==o?void 0:o.fill)||void 0===e?void 0:e.fillType)?o.fill.color:null;null===(t=i||[])||void 0===t||t.forEach((function(e,t){var n,i,u,l,c,h,d,f,p=new Sm(Object.assign(Object.assign({},e),{position:{x:e.position.x-(null!==(u=null===(i=null===(n=r.json.geometry)||void 0===n?void 0:n.lineTransform)||void 0===i?void 0:i.pivot.x)&&void 0!==u?u:0),y:e.position.y-(null!==(h=null===(c=null===(l=r.json.geometry)||void 0===l?void 0:l.lineTransform)||void 0===c?void 0:c.pivot.y)&&void 0!==h?h:0)},fillStyle:null==o?void 0:o.fill,lineWidth:null!==(d=null==o?void 0:o.width)&&void 0!==d?d:0}));p.graphicsId="".concat(a,"-arrow-").concat(t,"-graphics"),p.textureId="".concat(a,"-arrow-").concat(t,"-fill"),r.ctx.graphicsTexture.addGraphics(p.graphicsId,null!==(f=p.paths)&&void 0!==f?f:[],p.hash,{x:0,y:0},p.width,p.height,void 0,r.ctx.objectPoolGroup,!0,s,null),r.arrowList.push(p)}))}},{key:"calculateFillObjectOffset",value:function(){var e=0,t=0;return this.arrowList.length&&(e=this.arrowList.reduce((function(e,t){return Math.max(e,t.width)}),0),t=this.arrowList.reduce((function(e,t){return Math.max(e,t.height)}),0)),[e,t]}},{key:"preRender",value:function(e){var t,r,n,i=this,o=this.json,a=o.lineStyle,s=o.geometry,u=(null==s?void 0:s.lineTransform)||km,l=u.width,c=u.height,h=l||this.json.width,d=c||this.json.height,f=(null===(t=null==s?void 0:s.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],p="solidFill"===(null===(r=null==a?void 0:a.fill)||void 0===r?void 0:r.fillType)?a.fill.color:null;e.addSubMTask((function(){return Mm(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=M(f);try{for(t.s();!(r=t.n()).done;)n=r.value,this.ctx.graphicsTexture.addGraphics(n.id,[n],n.hash,((null==s?void 0:s.lineTransform)||km).pivot,h,d,a,this.ctx.objectPoolGroup,!0,null,p)}catch(e){t.e(e)}finally{t.f()}case 2:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[addGraphics]"),null===(n=this.text)||void 0===n||n.createParagraphs(this.json.id,e)}},{key:"subClassRender",value:function(){return Mm(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return Mm(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(r=this.backgroundGraphics)||void 0===r||r.render(),this.createBackground(),e.next=5,this.subClassRender();case 5:this.createFilledPathMask(),this.createPathFill(),this.createArrow();case 8:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[render]"),this.text&&this.text.render(e),e.addSubMTask((function(){return Mm(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M,k,E,I,A=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(r=this.json.textBody)||void 0===r?void 0:r.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(p=null!==(n=this.json.scale)&&void 0!==n?n:{x:1,y:1},v=p.x,g=p.y,this.text.container.scale.x=g<0?-Math.abs(v):Math.abs(v),this.text.container.scale.y=g,this.text.container.position.x=(null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0)+this.text.x,this.text.container.position.y=(null!==(s=null===(a=this.json.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container))):(this.text&&(this.json.textRotation&&(this.text.container.rotation=this.json.textRotation,m=this.text,y=m.width,_=m.height,b=this.text.container.position,x=b.x,w=b.y,this.text.container.pivot.x=y/2,this.text.container.pivot.y=_/2,this.text.container.x=x+y/2,this.text.container.y=w+_/2),Gv()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape&&(S=this.json.rotation||0,this.text.container.rotation=-S,T=this.text.width,this.text.container.position.x=T),this.text.container.zIndex=100,M=null===(u=this.json.effectList)||void 0===u?void 0:u.find((function(e){return"outerShadow"===e.type})),k=null===(l=this.json.effectList)||void 0===l?void 0:l.find((function(e){return"softEdge"===e.type})),E=null===(c=this.json.effectList)||void 0===c?void 0:c.find((function(e){return"glow"===e.type})),M&&1!==M.sx||k||E?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)),this.renderContainer.addChild(this.container)),"background"===this.json.id&&this.ctx.hasBackgroundFillShape&&(I=$l.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)}),this.ctx.renderer.render(this.renderContainer,{renderTexture:I}),this.ctx.bgTexture=I),this.json.effectList&&this.json.effectList.length>0&&(null===(h=this.ctx.featureList)||void 0===h?void 0:h.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new lm(this.effectContainer,this.json.effectList,"".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(this.json.id),this.ctx,this.json.rotation||0,new jl.g((null===(d=this.json.scale)||void 0===d?void 0:d.x)||1,(null===(f=this.json.scale)||void 0===f?void 0:f.y)||1)),function(e){var t,r,n;return"gifFill"===(null===(t=e.fillStyle)||void 0===t?void 0:t.fillType)||"gifFill"===(null===(n=null===(r=e.lineStyle)||void 0===r?void 0:r.fill)||void 0===n?void 0:n.fillType)||!!e.picFill&&"gifFill"===e.picFill.fillType}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",(function(){var e;A.effectContainer.visible=!1,A.effectObject.container.zIndex=10,A.container.addChild(A.effectObject.container),null===(e=A.effectObject)||void 0===e||e.updateFrame(1),A.applyEffectCacheAsBitMap(!0)})));case 3:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r;"gifFill"!==(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)&&(null===(r=this.effectObject)||void 0===r||r.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)})))}},{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"destroy",value:function(){var e,t,r,n;null===(e=this.text)||void 0===e||e.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(t=this.backgroundGraphics)||void 0===t||t.destroy(),this.strokeFill.destroy(),null===(r=this.strokeGraphics)||void 0===r||r.destroy(),this.renderContainer.destroy(),null===(n=this.arrowRenderTexture)||void 0===n||n.destroy(!0),this.arrowList=[],this.effectDisposer()}},{key:"interactiveContainer",get:function(){return this.renderContainer}},{key:"strokeActive",get:function(){var e,t,r,n,i,o,a;return this.strokeFill.displayObject?(null!==(r=null===(t=null===(e=this.strokeFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a,s=this.strokeFill.displayObject;e?s&&(null!==(r=null===(t=s.filters)||void 0===t?void 0:t.indexOf(this.strokeColorFilter))&&void 0!==r?r:-1)<0?s.filters=[this.strokeColorFilter]:(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.strokeGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):s?s.filters=[]:(null===(a=this.strokeGraphics)||void 0===a?void 0:a.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}},{key:"pptColorActive",get:function(){var e,t;return(null!==(t=null===(e=this.renderContainer.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){this.renderContainer.filters=e?[this.pptColorFilter]:[]}},{key:"fillActive",get:function(){var e,t,r,n,i,o,a;return this.backgroundFill.displayObject?(null!==(r=null===(t=null===(e=this.backgroundFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a;e?this.backgroundFill.displayObject&&(null!==(r=null===(t=this.backgroundFill.displayObject.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.backgroundGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}}]),r}(Uv),Im=r(119),Am=new(r.n(Im).a),Cm=Am.getDevice(),Pm=Am.getBrowser(),Nm=Am.getOS(),Om={isDesktop:function(){var e=!0;return"mobile"===Cm.type&&(e=!1),/Samsung/.test(Pm.name||"")&&(e=!1),window.__nativeTags&&window.__nativeTags.platform&&(e=!1),e},isIOS:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(e=!0),Nm.name&&/iOS/.test(Nm.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),Nm.name&&/android/i.test(Nm.name)&&(e=!0),e},isLowGpuMemory:function(){var e,t,r=null!==(t=null===(e=window.__nativeTags)||void 0===e?void 0:e.platform)&&void 0!==t?t:"";if(r){var n=r.split(" ");if(n[1]){if(/^iPad/.test(n[1])){var i=n[1].match(/^iPad(\d+)/);return!(i&&i[1]&&parseInt(i[1],10)>=6)}if(/^iPhone/.test(n[1])){var o=n[1].match(/^iPhone(\d+)/);return!(o&&o[1]&&parseInt(o[1],10)>=9)}return!1}return!1}return!0}},Rm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function Dm(e,t){for(var r in t)e.style[r]=t[r]}var Lm="median-container",jm=1500,zm=300,Bm=50,Fm="0",Um="1",Wm=.4,Gm=function(){function e(t){var r,n,i=this;x(this,e),this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.fadeState={in:!1,out:!1},this.changeMediaProgress=function(e){if(i.ctx.isPlayerPaused())i.ctx.logger.info("Media controller prevent seek event with paused state",i.ctx.taskId);else{e.stopPropagation();var t=e.offsetX/i.progress.clientWidth*i.duration;i.medianIsEnd=!1,"interactive"!==i.ctx.mode&&i.jumpToTime(t),"local"!==i.ctx.mode&&i.ctx.eventHub.emit(__.mediaSeek,{id:i.targetId,time:t,isPlaying:i.media.isPlaying}),i.delayHide()}},this.jumpToTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Rm(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,dv((function(){return!!n.duration}),3e3);case 2:r=Math.floor(e)+this.start,this.media.currentTime!==r&&(this.media.currentTime=r,this.changeBookmarkIndex(r,r>this.media.currentTime));case 4:case"end":return t.stop()}}),t,this)})))},this.showController=function(e){e.stopPropagation(),i.show()},this.getMediaDuration=function(){i.duration&&!Number.isNaN(i.duration)||(i.duration=i.media.duration,i.start&&(i.duration-=i.start,i.jumpToTime()),i.end&&(i.duration-=i.end)),i.totalTime.innerText=e.formatTime(i.duration)},this.playMedia=function(){return Rm(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="none",this.pauseButton.style.display="block",e.next=4,this.media.play();case 4:this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach((function(e){e()})),this.delayHide();case 7:case"end":return e.stop()}}),e,this)})))},this.pauseMedia=function(){return Rm(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="block",this.pauseButton.style.display="none",e.next=4,this.media.pause();case 4:case"end":return e.stop()}}),e,this)})))},this.onMouseOut=function(e){e.stopPropagation(),i.hide()},this.mediaTimeUpdate=function(){return Rm(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.media.currentTime-this.start,t.t0=this.duration>0&&(Math.abs(r-this.duration)<.3||r>this.duration),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(__.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle();case 9:if(this.currentTime.innerText=e.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!(this.bookmarkList&&this.bookmarkList.length>0)){t.next=14;break}(n=this.bookmarkList[this.pickBookmarkIndex])&&n.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit("shape ".concat(this.shapeId," onMediaBookmark ").concat(n.name)),this.pickBookmarkIndex+=1);case 14:this.fadeHit(r);case 15:case"end":return t.stop()}}),t,this)})))},this.onPauseMedia=function(){i.playButton.style.display="block",i.pauseButton.style.display="none"},this.onPlayMedia=function(){i.fadeState={in:!1,out:!1},i.fadeHit(0),i.playButton.style.display="none",i.pauseButton.style.display="block",i.playCallBackList.forEach((function(e){e()})),i.media.currentTime0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","polyline");return n.setAttributeNS(null,"points","35 0, 477 256, 35 512"),n.setAttributeNS(null,"fill","#000000"),r.appendChild(n),r}},{key:"generatePauseButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dm(r,{height:e+"px"}),r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttributeNS(null,"x","35"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width","148"),n.setAttributeNS(null,"height","512");var i=n.cloneNode(!0);return i.setAttributeNS(null,"x","330"),r.append(n,i),r}},{key:"generateFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dm(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),r.appendChild(n),document.body.appendChild(r),r}},{key:"generateExitFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dm(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),i.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),r.appendChild(n),r.appendChild(i),document.body.appendChild(r),r}},{key:"createButton",value:function(){var e={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};Dm(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Dm(t,{height:"20px"}),this.playButton.appendChild(t),Dm(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var r=this.generatePauseButton();if(Dm(r,{height:"20px"}),this.pauseButton.appendChild(r),this.isVideo){var n=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(n),Dm(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Dm(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Dm(e,{width:"100px"}),this.currentTime.innerText="00:00";var t=document.createElement("span");return t.innerText="/",e.append(this.currentTime,t,this.totalTime),e}},{key:"createProgress",value:function(){var e={flex:"1",position:"relative"};this.isVideo||(e.marginRight="10px"),Dm(this.progress,e);var t=document.createElement("div");Dm(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Dm(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}},{key:"fadeHit",value:function(e){if(this.info.fade){var t=this.info.fade,r=t.start,n=t.end;r&&!this.fadeState.in&&e>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,r)),n&&!this.fadeState.out&&e>=this.duration-n/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,n))}}},{key:"changeBookmarkIndex",value:function(e,t){if(this.bookmarkList&&0!==this.bookmarkList.length){if(this.pickBookmarkIndex>0)for(var r=0;re){this.pickBookmarkIndex=r;break}if(t){for(var n=this.pickBookmarkIndex-1,i=0;il?l/r:1);s.y=s.y+this.height-n,s.x=Math.max(s.x,0),s.x=Math.min(s.x,o-r*c),s.y=Math.max(s.y,0),s.y=Math.min(s.y,a-n),Dm(this.mediaController,{height:n+"px",borderRadius:n/2+"px",width:r+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:s.x+"px",top:s.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:"scale(".concat(c,")"),transformOrigin:"0 100%"}),this.fullscreenStatus&&Dm(this.mediaController,{left:"0",top:a-n+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Dm(this.mediaController,{display:"none",transition:"opacity ".concat(Wm,"s")}),this.createButton();var e=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,e,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}},{key:"addPlayCallBack",value:function(e){this.playCallBackList.push(e)}},{key:"fullscreenPlay",value:function(){this.fullscreenStatus=!0,"interactive"!==this.ctx.mode&&this.media.requestFullscreen(),"local"!==this.ctx.mode&&this.ctx.eventHub.emit(__.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}},{key:"changeFullScreenState",value:function(e,t,r){r===this.ctx.slideIndex&&(e&&this.targetId===t?this.fullscreenStatus=e:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}},{key:"bindEvent",value:function(){Om.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this._pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"unbindEvent",value:function(){var e;Om.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),null===(e=this.containerObserver)||void 0===e||e.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"show",value:function(){this.setControllerPosition(),this.mediaController.style.opacity=Um,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}},{key:"hide",value:function(){this.fullscreenStatus?this.mediaController.style.opacity=Fm:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),jm)}},{key:"destroy",value:function(){var e;this.unbindEvent(),this.playCallBackList=[],null===(e=this.container)||void 0===e||e.removeChild(this.mediaController)}},{key:"clippedDuration",get:function(){return this.duration}}],[{key:"formatTime",value:function(e){var t="00:00";if(e){var r=Math.floor(e/60),n=String(r<0?0:r).padStart(2,"0"),i=Math.floor(e%60);t="".concat(n,":").concat(String(i<0?0:i).padStart(2,"0"))}return t}}]),e}(),Vm=r(120),Hm=function(e){p(r,e);var t=g(r);function r(e,n,i){var o,a,s,u;return x(this,r),(a=t.call(this)).isGlobalPause=!1,a.lastTime=-1,a.howl=null,a.rctClient=null,a.isHowlEnd=!1,a.isHowlLoadEmit=!1,a.staticEventId=1001,a._catParams=void 0,a.url=e,a.runningAudio=n,i&&(a._catParams=i),b_.RtcAudioClazz?(a.rctClient=new b_.RtcAudioClazz(e,null===(s=a._catParams)||void 0===s?void 0:s.start,null===(u=a._catParams)||void 0===u?void 0:u.end),a.rctClient.on("load",(function(){return a.emit("load")})),a.rctClient.on("pause",(function(){return a.emit("pause")})),a.rctClient.on("play",(function(){a.startTimeChangeEmit(),a.emit("play")})),a.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){a.emit("resumeAllAudioInterruptByAudioSessionChanged")}))):(a.howl=new Vm.Howl({src:[e]}),o=c(a.howl._getSoundIds(),1),a.staticEventId=o[0],a.howl.load(),a.howl.on("load",(function(){a.isHowlLoadEmit=!0,a.emit("load")})),a.howl.on("pause",(function(){return a.emit("pause")})),a.howl.on("play",(function(){a.isHowlLoadEmit||a.emit("load"),a.isHowlEnd=!1,a.startTimeChangeEmit(),a.emit("play")})),a.howl.on("end",(function(){a.isHowlEnd=!0}))),a}return S(r,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout((function(){e.isPaused||e.startTimeChangeEmit()}),300)}},{key:"play",value:function(){var e,t,r;this.runningAudio.has(this.url)&&(null===(e=this.runningAudio.get(this.url))||void 0===e||e.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(this.staticEventId),null===(r=this.rctClient)||void 0===r||r.play(),this.runningAudio.set(this.url,this)}},{key:"fade",value:function(e,t,r){this.howl&&this.howl.fade(e,t,r)}},{key:"pause",value:function(){var e,t;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),null===(t=this.rctClient)||void 0===t||t.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"globalPause",value:function(){this.isPaused||(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"stop",value:function(){var e;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"destroy",value:function(){var e,t,r,n,i,o,a,s;null===(e=this.howl)||void 0===e||e.stop(this.staticEventId),null===(t=this.howl)||void 0===t||t.unload(),null===(r=this.rctClient)||void 0===r||r.pause(),null===(n=this.rctClient)||void 0===n||n.destroy(),null===(i=this.rctClient)||void 0===i||i.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(a=this.rctClient)||void 0===a||a.removeAllListeners("pause"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"volume",value:function(e){this.rctClient?this.rctClient.volume(e):this.howl&&this.howl.volume(e)}},{key:"currentTime",get:function(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek(this.staticEventId):-1},set:function(e){this.rctClient?this.rctClient.currentTime=e:this.howl&&this.howl.seek(e,this.staticEventId)}},{key:"duration",get:function(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration(this.staticEventId):0}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&!this.howl.playing(this.staticEventId)}}]),r}(Ks.a),Ym=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},$m=function(e){p(r,e);var t=g(r);function r(e){var n,i,o,a,s,u,l,c;x(this,r),(n=t.call(this)).type="video",n.sprite=new Ld,n.isPlaying=!1,n.isGlobalPause=!1,n.fullscreen=!1,n.url="",n.isLoaded=!1,n.onVideoResourceLoaded=function(){n.isLoaded=!0},n.onVideoStalled=function(){n.ctx.logger.warn(n.url+", Failed to fetch data, but trying.",n.ctx.taskId)},n.updateVolume=function(e){n.rtcAudio.volume(e)},n.syncFullscreenVideoState=function(e){var t=e.targetId,r=e.state;e.slideIndex===n.ctx.slideIndex&&t===n.id&&(r?(n.requestFullscreen(),n.ctx.latestChangeFullscreenTargetId=t):n.requestCancelFullscreen())},n.id=e.id,n.start=null===(i=e.video.cut)||void 0===i?void 0:i.start,n.end=null===(o=e.video.cut)||void 0===o?void 0:o.end,n.fullscreen=null!==(a=e.video.fullscreen)&&void 0!==a&&a,n.container=e.container,n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var h=e.video.src;n.videoResource=new $l.w(h,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),null===(s=n.videoElement)||void 0===s||s.addEventListener("stalled",n.onVideoStalled),null===(u=n.videoElement)||void 0===u||u.addEventListener("loadedmetadata",n.onVideoResourceLoaded),n.url=e.video.src;var d=e.video.src.replace(/4$/,"3");n.ctx.loaderDelegate&&(d=n.ctx.loaderDelegate.redirectMedia(d),n.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(d," by delegate."),e.ctx.taskId)),n.rtcAudio=new Hm(d,e.ctx.runningAudio,{start:null===(l=e.video.cut)||void 0===l?void 0:l.start,end:null===(c=e.video.cut)||void 0===c?void 0:c.end}),n.rtcAudio.on("timeupdate",(function(e){if(n.videoElement){var t=n.videoElement.currentTime;Math.abs(t-e)>.5&&(n.videoElement.currentTime=e)}})),n.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){var e;null===(e=n.videoElement)||void 0===e||e.pause(),setTimeout((function(){var e;n.rtcAudio.isPaused||null===(e=n.videoElement)||void 0===e||e.play()}),200)}));var f=e.video,p=e.width,v=e.height,g=e.target;n.controller=new Gm({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:p,height:v,target:g,media:y(n),info:f,canvasElement:e.canvasElement}),n.controller.addPlayCallBack((function(){n.sprite.width=p,n.sprite.height=v,n.ctx.clock.setTimeout((function(){n.sprite.visible=!0}),50)}));var m=new $l.c(null,{height:v,width:p});return m.resource=n.videoResource,n.videoResource.bind(m),n.sprite=new Ld,n.sprite.visible=!1,n.sprite.texture=new $l.t(m),n.sprite.interactive=!0,n.container.addChild(n.sprite),n.sprite.on("mouseover",(function(e){e.stopPropagation(),n.controller.show()})),n.sprite.on("mouseout",(function(e){e.stopPropagation(),n.controller.hide()})),["durationchange","timeupdate","pause","play"].forEach((function(e){var t;null===(t=n.videoElement)||void 0===t||t.addEventListener(e,(function(){"timeupdate"===e&&n.isPlaying,n.emit(e)}))})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n.ctx.globalEventHub.on("syncFullscreenVideoState",n.syncFullscreenVideoState),n}return S(r,[{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return Ym(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),e.next=4,this.load();case 4:return e.next=6,this.ctx.clock.waitUntil((function(){var e=r.videoElement;return!!(e&&e.videoWidth>0)}),3e3);case 6:(t=this.videoElement)&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.on("play",(function(){var e;null===(e=r.videoElement)||void 0===e||e.play(),r.fullscreen&&r.controller.fullscreenPlay()})),this.rtcAudio.play());case 8:case"end":return e.stop()}}),e,this)})))}},{key:"load",value:function(){return this.videoResource.load()}},{key:"pause",value:function(){var e,t=this;this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.once("pause",(function(){var e;null===(e=t.videoElement)||void 0===e||e.pause()})),this.rtcAudio.pause(),null===(e=this.videoElement)||void 0===e||e.pause()}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Ym(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dv((function(){return r.isLoaded}),5e3);case 2:t=new $l.t(this.sprite.texture.baseTexture),this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"requestCancelFullscreen",value:function(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}},{key:"destroy",value:function(){var e,t,r;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),null===(e=this.videoElement)||void 0===e||e.removeEventListener("stalled",this.onVideoStalled),null===(t=this.videoElement)||void 0===t||t.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(r=this.videoResource)||void 0===r||r.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}},{key:"fadeIn",value:function(e,t){this.rtcAudio.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"videoElement",get:function(){return this.videoResource.source}},{key:"currentTime",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:0},set:function(e){this.rtcAudio.currentTime=e,this.videoElement&&(this.videoElement.currentTime=e)}},{key:"paused",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.paused)||void 0===t||t}},{key:"duration",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.duration)&&void 0!==t?t:0}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}}]),r}(Ks.a),Xm=function(e){p(r,e);var t=g(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).type="audio",n.isPlaying=!1,n.isGlobalPause=!1,n.updateVolume=function(e){n.audioPlayer.volume(e)},n.id=e.id;var a=e.audio.src;n.audioPlayer=new Hm(a,e.ctx.runningAudio,{start:null===(i=e.audio.cut)||void 0===i?void 0:i.start,end:null===(o=e.audio.cut)||void 0===o?void 0:o.end}),e.audio.cut&&(n.start=e.audio.cut.start,n.end=e.audio.cut.end),n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var s=e.width,u=e.height,l=e.target;return n.controller=new Gm({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:u,width:s,target:l,media:y(n),info:e.audio,canvasElement:e.canvasElement}),n.audioPlayer.on("load",(function(){return n.emit("durationchange")})),n.audioPlayer.on("timeupdate",(function(){return n.emit("timeupdate")})),n.audioPlayer.on("pause",(function(){return n.emit("pause")})),n.audioPlayer.on("play",(function(){return n.emit("play")})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n}return S(r,[{key:"load",value:function(){return Promise.resolve()}},{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){}},{key:"requestCancelFullscreen",value:function(){}},{key:"destroy",value:function(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}},{key:"fadeIn",value:function(e,t){this.audioPlayer.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"currentTime",get:function(){return this.audioPlayer.currentTime},set:function(e){this.audioPlayer.currentTime=e}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}},{key:"paused",get:function(){return this.audioPlayer.isPaused}},{key:"isPaused",get:function(){return this.audioPlayer.isPaused}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),r}(Ks.a),qm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Qm=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,Object.assign(Object.assign({},e),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),n,i)).isInteractiveOutside=!1,o.cmd=new Ov(y(o)),o.media=null==e?void 0:e.media,o.container.name=e.id+"_container_[Picture]",o.renderContainer.name=e.id+"_render_container_[Picture]",o.picFill=new zg(o.ctx,e.picFill,e.width,e.height,{useFilter:!0,useSlideBackgroundFill:!1}),o}return S(r,[{key:"applyCommand",value:function(e,t){var r,n,i,o;if("call"===t)if(/playFrom\(([0-9.]+)\)/.test(e)){var a=e.match(/playFrom\(([0-9.]+)\)/),s=Number(a[1]||"0");null===(r=this.mediaPlayer)||void 0===r||r.controller.playMediaFromCtrl(!0),Math.abs(s)>.1&&(null===(n=this.mediaPlayer)||void 0===n||n.controller.jumpToTime(s))}else"custom-pause"===e?null===(i=this.mediaPlayer)||void 0===i||i.controller.pauseMediaFromCtrl(!0):"togglePause"===e?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):"stop"===e&&(null===(o=this.mediaPlayer)||void 0===o||o.stop())}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r,n;"gifFill"===(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)||this.media&&"video"===this.media.type||"gifFill"===(null===(r=this.json.picFill)||void 0===r?void 0:r.fillType)||null===(n=this.effectObject)||void 0===n||n.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)}))}},{key:"renderPic",value:function(){var e,t,r,n,i,o;return qm(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,l,c,h,d=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(s=this.picFill.displayObject)){a.next=15;break}if(s.name=this.json.id+"_pic_fill_[Picture]",u=null===(e=this.backgroundGraphics)||void 0===e?void 0:e.getClonedDisplayObject(),(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.isNeedMask(s.width,s.height))&&u&&(s.mask=u,this.effectContainer.addChild(u)),s.width=this.designWidth,s.height=this.designHeight,s instanceof jp&&this.ctx.slideScopeEventHub.once("slide-render",(function(e){var t;d.ctx.slideIndex===e&&(null===(t=d.effectObject)||void 0===t||t.setFrameCount(s.totalFrames),s.play(),s.onFrameChange=function(e){if(d.effectObject)if(d.effectObject.hasFrame(e))d.effectObject.updateFrame(e);else{var t=d.getEffectTexture();t&&(d.effectObject.createFrame(e,t.texture),d.effectObject.setFrameOffset(t.offsetX,t.offsetY))}})})),this.effectContainer.addChild(s),!this.media){a.next=13;break}if(l=this.media.src,"audio"===this.media.type&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),!this.ctx.urlInterrupter){a.next=12;break}return c=Date.now(),a.next=10,this.ctx.urlInterrupter(l);case 10:l=a.sent,this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-c),this.ctx.taskId);case 12:this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info("redirect media url to ".concat(l," by delegate."),this.ctx.taskId)),this.media.src=l;case 13:"video"===(null===(r=this.media)||void 0===r?void 0:r.type)&&this.media.src?(this.mediaPlayer=new $m({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.effectContainer,canvasElement:this.ctx.view}),(null===(n=this.mediaPlayer)||void 0===n?void 0:n.sprite)&&u&&(h=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.getClonedDisplayObject())&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))):"audio"===(null===(o=this.media)||void 0===o?void 0:o.type)&&this.media.src&&(this.mediaPlayer=new Xm({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view,fade:this.media.fade})),this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,Om.isDesktop()?(this.container.on("mouseover",(function(){d.mediaPlayer.showController()})),this.container.on("mouseout",(function(){d.mediaPlayer.hideController()}),!1)):this.container.on("pointerdown",(function(){d.mediaPlayer.showController()})));case 15:case"end":return a.stop()}}),a,this)})))}},{key:"preRender",value:function(e){f(b(r.prototype),"preRender",this).call(this,e)}},{key:"subClassRender",value:function(){return qm(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.renderPic();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"clearOnSlideChange",value:function(){f(b(r.prototype),"clearOnSlideChange",this).call(this),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}},{key:"initOnReuse",value:function(){f(b(r.prototype),"initOnReuse",this).call(this),this.mediaPlayer&&(this.container.interactive=!0)}},{key:"destroy",value:function(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}]),r}(Em),Zm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Km=function(e){p(r,e);var t=g(r);function r(e,n,i,o){var a;return x(this,r),(a=t.call(this,e,n,i)).children=[],a.cacheSprite=new Ld,a.cacheContainer=new Dl.b,a.json=e,a.json.fillStyle&&"groupFill"===a.json.fillStyle.fillType&&i.groupFillStyle&&(a.json.fillStyle=i.groupFillStyle),a.container.name=e.id+"_container_[Container]",a.cacheContainer.name=e.id+"_cache_container_[Container]",a.ctx.timingTargets.addTarget(e.id,y(a)),a.updateTransform(a.json),a.fillObject=new zg(a.ctx,e.fillStyle,e.width,e.height,{useFilter:!1,useSlideBackgroundFill:!1}),a.createChildren(o),a}return S(r,[{key:"createChildren",value:function(e){for(var t,n,i,o,a=this,s={x:null!==(n=null===(t=this.json.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},u=function(t,n){e.addSubMTask((function(){return Zm(a,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.children[t],o=null,this.ctx.featureList&&this.ctx.featureList.smartArt&&("Shape"===(null==i?void 0:i.type)||"Picture"===(null==i?void 0:i.type))&&this.ctx.smartArtShapeList&&(a=i.id,(u=this.ctx.smartArtShapeList.find((function(e){return e.id===a})))&&(i=u)),l={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}},"Shape"===(null==i?void 0:i.type)?o=new Em(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new Qm(i,this.ctx,l):"Container"===(null==i?void 0:i.type)&&(o=new r(i,this.ctx,l,e)),o&&this.children.push(o);case 4:case"end":return n.stop()}}),n,this)})))}),"@ContainerImpl[child.init]")},l=0,c=this.json.children.length;l1&&void 0!==arguments[1]?arguments[1]:{};if(e)if(e.delay&&e.delay>0){var r=a.ctx.clock.setTimeout((function(){e.event&&(a.cond[e.event]=!0,a.detectTrigger(t))}),e.delay);a.timeoutIds.push(r)}else a.cond[e.event]=!0,a.detectTrigger(t);else a.detectTrigger(t)},a.id=e,a.ctx=o,a.eventHubs=i,n.forEach((function(e){a.addCond(e)})),a}return S(r,[{key:"setTriggerParams",value:function(e){this.triggerParams=e}},{key:"addCond",value:function(e){var t=this,r=function(){for(var r=arguments.length,n=new Array(r),i=0;i0&&(this.cond[e.event]=!1,this.eventHubs.runtime.addListener(e.event,r)):this.cond[e.event]=!1)}},{key:"isTrigger",value:function(){var e=this;return Object.keys(this.cond).every((function(t){return!!e.cond[t]}))}},{key:"isTriggerWithoutParent",value:function(){var e=this;return Object.keys(this.cond).filter((function(e){return"self"!==e})).every((function(t){return!!e.cond[t]}))}},{key:"detectTrigger",value:function(e){var t=this;if(Object.keys(this.cond).every((function(e){return!!t.cond[e]}))){Object.keys(this.cond).forEach((function(e){t.cond[e]=!1}));var r=this.triggerParams;this.triggerParams=void 0,this.emit("active",r,e)}}},{key:"reset",value:function(){var e=this;Object.keys(this.cond).forEach((function(t){e.cond[t]=!1})),this.timeoutIds.forEach((function(t){return e.ctx.clock.clearTimeout(t)}))}}]),r}(Ks.a),ey=function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r),(n=t.call(this)).isTimeNodeEndSync=!1,n.interactiveListeners=[],n.runtimeNodeEventHub=new Ks.a,n._currentSeqIndex=0,n._currentSeqState="idle",n.isForward=!0,n.autoPlay=!1,n.handlePrev=function(){var e,t,r,i,o,a,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.hasPrev()||!n.isMainSeq?"idle"===n.currentSeqState?(n.decrSeqIndex(),null===(e=n.commonTimeNode.children[n.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToStart(),null===(t=n.commonTimeNode.children[n.currentSeqIndex])||void 0===t||t.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"running"===n.currentSeqState?(null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.seekToStart(),null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"end"===n.currentSeqState&&(n.currentSeqIndex>=n.commonTimeNode.children.length&&(n.currentSeqIndex=n.commonTimeNode.children.length-1),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.seekToStart(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.clearSubList(),n.currentSeqState="idle"):n.globalEventHub.emit("c:prev slide",s)},n.handleNext=function(e,t){var r,i,o,a;if(n.isTimeNodeEndSync&&(n.isTimeNodeEndSync=!1,n.currentSeqState="idle",n.currentSeqIndex=0),!n.hasNext()&&n.isMainSeq&&t)n.globalEventHub.emit("c:next slide",e);else{if(n.isInteractiveSeq){n.globalEventHub.emit("shape slide onNext"+(n.json.ctn.id||""));var s={result:null};n.findChildInfiniteRepeat(n.commonTimeNode,s),1===n.commonTimeNode.children.length&&s.result&&(s.result.json.subTnLst||[]).length>0&&0===n.currentSeqIndex&&"running"===n.currentSeqState&&n.commonTimeNode.allChildrenEndHandle()}"idle"===n.currentSeqState?null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.startTimeNodeForce():"running"===n.currentSeqState?(null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToEnd(!1,!0),n.currentSeqState="end",n.incrSeqIndex(),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.startTimeNodeForce()):"end"===n.currentSeqState&&(n.incrSeqIndex(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.startTimeNodeForce())}};var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,h=e.eventHub,d=e.iterateIndex,f=e.iterateId,p=e.isInInteractiveSeq;return n.isMainSeq="mainSeq"===i.ctn.nodeType,n.isInteractiveSeq="interactiveSeq"===i.ctn.nodeType,n.id=i.ctn.id,n.isIterate=a,n.json=i,n.ctx=l,n.globalEventHub=h,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:h,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:d,iterateId:f,isInInteractiveSeq:p||n.isInteractiveSeq,fromSeqId:n.isInteractiveSeq?n.json.ctn.id:""}),n.bindShapeEvent(),n.nextConds=new Jm("mainSeq",i.nextCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.prevConds=new Jm("mainSeq",i.preCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.commonTimeNode.on("timeNodeRestart",(function(){n.currentSeqIndex=0,n.currentSeqState="idle"})),n.commonTimeNode.on("childTimeNodeStart",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="running",n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepStart,t)})),n.commonTimeNode.on("childTimeNodeEnd",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="end",n.autoPlay&&n.ctx.clock.setTimeout((function(){n.handleNext(!1,!0)})),n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepEnd,t)})),n.commonTimeNode.on("timeNodeEndSync",(function(){n.isTimeNodeEndSync=!0,n.commonTimeNode.resetForRepeat()})),n.commonTimeNode.on("timeNodeDestroy",(function(){n.interactiveListeners.forEach((function(e){var t=c(e,2),r=t[0],n=t[1];r&&n&&r.interactiveContainer.removeListener("pointerdown",n)})),n.interactiveListeners=[]})),n.nextConds.on("active",(function(e,t){Array.isArray(t)?n.handleNext(t[0],t[1]):n.handleNext(t,!0)})),n.prevConds.on("active",(function(e,t){Array.isArray(t)?n.handlePrev(t[0]):n.handlePrev(t)})),n}return S(r,[{key:"startAutoPlay",value:function(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}},{key:"incrSeqIndex",value:function(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}},{key:"decrSeqIndex",value:function(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}},{key:"hasPrev",value:function(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}},{key:"hasNext",value:function(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}},{key:"findChildInfiniteRepeat",value:function(e,t){var r=this;e.isInfiniteRepeat()?t.result=e:e.children.map((function(e){return e.commonTimeNode})).forEach((function(e){return r.findChildInfiniteRepeat(e,t)}))}},{key:"bindShapeEvent",value:function(){var e=this;"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach((function(t){if(/^shape/.test(t.event)){var r=t.event.split(" ")[1];if(r){var n=e.ctx.timingTargets.getTargetById(r);if(n){n.interactiveContainer.interactive=!0,n.interactiveContainer.cursor="pointer";var i=function(){e.ctx.eventHub.emit(__.userInput);var t="shape ".concat(r," onClick"),n=e.ctx.mode;"interactive"!==n&&"sync"!==n||e.ctx.eventHub.emit(__.interactiveSeqAction,{action:t,seqId:e.json.ctn.id}),"sync"!==n&&"local"!==n||e.globalEventHub.emit(t)};n.interactiveContainer.on("pointerdown",i),e.interactiveListeners.push([n,i])}}}}))}},{key:"setCurrentStep",value:function(e,t){var r=this.commonTimeNode.children.length;if(!(e>r)){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);var n=e;if(this.commonTimeNode.seekToStart(),-1===n&&(n=r-1),0!==n||"start"!==t){if(n>=0&&n=1){var r=n.json.cBhvr.attrList[0];n.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");var i=n.json.cBhvr.to||n.json.to;i&&n.timingTarget&&ty(n.timingTarget,r,i)}})),n}return S(r,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),oy=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==("undefined"==typeof Reflect?"undefined":T(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},ay=function(){function e(t,r){x(this,e),this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:function(e){return e/Math.PI*180},exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:function(e){return e/180*Math.PI},rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=r,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}return S(e,[{key:"parseFmla",value:function(e){var t=e.replace(/#ppt_h/g,"(".concat(this.timingTarget.design_ppt_h,")"));return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/#ppt_w/g,"(".concat(this.timingTarget.design_ppt_w,")"))).replace(/#ppt_x/g,"(".concat(this.timingTarget.design_ppt_x,")"))).replace(/#ppt_y/g,"(".concat(this.timingTarget.design_ppt_y,")"))).replace(/ppt_w/g,"vars.ppt_w")).replace(/ppt_h/g,"vars.ppt_h")).replace(/ppt_x/g,"vars.ppt_x")).replace(/ppt_y/g,"vars.ppt_y")).replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach((function(e){var r=new RegExp("([^a-z])".concat(e,"([^a-z])"),"g");t=t.replace(r,(function(t,r,n){return"".concat(r,"math.").concat(e).concat(n)}))})),new Function("vars","math","$","return "+t)}}]),e}(),sy=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n)).value=e.val.value,i&&(o.fmla=o.parseFmla(i)),o}return S(r,[{key:"resolveValue",value:function(){return this.value}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue()-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],sy.prototype,"interpolationFrom",null);var uy=function(e){p(r,e);var t=g(r);function r(e,n){var i,o;return x(this,r),(i=t.call(this,e,n)).value=null===(o=e.val)||void 0===o?void 0:o.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r);return t>this.time&&["hidden","visible"].indexOf(n)<0&&(n=this.resolveValue()),n}},{key:"resolveValue",value:function(){return this.value||""}}]),r}(ay);oy([iv()],uy.prototype,"interpolationFrom",null);var ly=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).fn=i.parseFmla(i.val),i}return S(r,[{key:"resolveValue",value:function(e){return this.fn(e,this.math,1)}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue(r)-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],ly.prototype,"interpolationFrom",null);var cy=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).value=e.val.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t){return qv(e.resolveValue(),this.value,t)}},{key:"resolveValue",value:function(){return this.value}}]),r}(ay);oy([iv()],cy.prototype,"interpolationFrom",null);var hy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},n.keyFrames=[],n.isColorAnim=!1,n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]))},n.updateVars=function(){var e,t,r,i;(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_h)&&(n.vars.ppt_h=n.timingTarget.ppt_h),(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_w)&&(n.vars.ppt_w=n.timingTarget.ppt_w),(null===(r=n.timingTarget)||void 0===r?void 0:r.ppt_x)&&(n.vars.ppt_x=n.timingTarget.ppt_x),(null===(i=n.timingTarget)||void 0===i?void 0:i.ppt_y)&&(n.vars.ppt_y=n.timingTarget.ppt_y),n.isColorAnim},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=n.keyFrames.findIndex((function(e){return r<=e[0]})),o=n.json.cBhvr.attrList;if(i<0){var a=n.keyFrames[n.keyFrames.length-1];n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],a[1].resolveValue(n.vars))}else{var s=i-1,u=n.keyFrames[i],l=n.keyFrames[s]||u,c=u[0]-l[0]==0?1:(r-l[0])/(u[0]-l[0]),h=u[1].interpolationFrom(l[1],c,n.vars);n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],h)}},n.onSeekToStart=function(){null!==n.startVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.createVal)},n.initKeyFrames(),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timelineStart",n.updateVars),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.createVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]),n}return S(r,[{key:"initKeyFrames",value:function(){var e,t=this.json.valueType;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){var r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===t&&this.timingTarget){var n=new ly(r,this.timingTarget);this.keyFrames.push([r.time,n])}}var i={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===t&&this.timingTarget){var o=new ly(i,this.timingTarget);this.keyFrames.push([i.time,o])}}else if(this.json.by){var a={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===t&&this.timingTarget){var s=new ly(a,this.timingTarget);this.keyFrames.push([a.time,s])}var u={time:1,val:{type:"string",value:((null===(e=a.val)||void 0===e?void 0:e.value)||"")+"+"+this.json.by},fmla:""};if("num"===t&&this.timingTarget){var l=new ly(u,this.timingTarget);this.keyFrames.push([u.time,l])}}if(this.json.tavLst.length>0){var c,h=M(this.json.tavLst);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(d.val&&this.timingTarget){var f=null;"string"===d.val.type?"num"===t?f=new ly(d,this.timingTarget):"str"===t&&(f=new uy(d,this.timingTarget)):"number"===d.val.type?f=new sy(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new cy(d,this.timingTarget)):"boolean"===d.val.type&&console.warn("not implements"),f&&this.keyFrames.push([d.time,f])}}}catch(e){h.e(e)}finally{h.f()}}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),dy=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,e,n,i)}return S(r,[{key:"percent",set:function(e){this.uniforms.percent=e}},{key:"transition",set:function(e){this.uniforms.transition=e}}]),r}($l.k),fy=r(121),py=r.n(fy),vy=r(122),gy=r.n(vy),my=r(123),yy=r.n(my),_y=r(124),by=r.n(_y),xy=r(9),wy=r.n(xy),Sy=r(125),Ty=r.n(Sy),My=r(126),ky=r.n(My),Ey="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAr5QTFRFAAAATwAAOQAAZgAAKwAAPAAAPQAA7AAA/wAA/QAAugAA5QAAsQAAwQAAsAAAfwAAawAASQAAZAAAOAAAJwAALAAALQAAqQAAiwAAmgAA5AAA7QAAtQAAhQAALwAAfAAAXwAAYQAAigAAuQAAfgAAswAAcgAArQAAqgAAZwAAaQAAMgAAGAAAiAAAjwAA1gAA6QAA+wAA7wAA2AAAbQAA2gAA3QAAuwAA3wAA2QAAxQAA0QAAzwAA0gAAXQAAYAAADAAADwAAGQAALgAAjgAAcAAAzQAAwgAA+gAA3AAAGwAAoAAAowAAcQAAVwAA1QAAIQAAWQAA5wAAsgAAuAAASwAAbwAARwAAMAAAnAAAUQAAaAAA9wAA4gAAPwAAbAAAOwAAlwAA0wAAjQAAvAAAwwAAkwAAQQAAvgAAnwAAvQAA0AAA2wAAwAAAWwAATQAACwAABwAAQgAAtgAAgwAAvwAAgQAAlgAAEAAAxgAAtwAAmAAARgAAjAAAdwAAqwAArwAAywAAYgAACAAAmwAAHwAApQAA8QAAdAAAbgAAFgAAgAAAogAAewAAXgAA6AAA9gAA/AAAzgAA3gAAkgAAngAAdQAARAAAmQAATgAAUgAAJQAAIgAAqAAARQAAPgAAxwAACQAAAgAAMQAAiQAAhwAA4AAAUAAABQAAeQAAygAA9AAAFQAAVQAAyAAANQAA4wAAKAAAWAAAZQAApwAA4QAAyQAAXAAAkQAArAAAdgAApgAAHgAA8gAA/gAA6gAA8wAAFwAAHQAAhgAArgAAnQAANAAASAAA7gAAlQAAJgAA+AAA8AAANwAAJAAAHAAANgAAkAAAKQAAoQAAzAAABgAAFAAATAAAeAAAAQAADgAAggAA6wAAEQAAfQAAVAAA9QAAIAAADQAAEgAAVgAA5gAAQAAABAAA1wAA+QAAUHExBAAAJDlJREFUeJwlevk/lPv7/2XtOrKNsWcbzGCMJSmSpSxJZtQkjPEOg5mxRWns+xpZyr5ECGmcLIOsdVK2oyJbcVI0J8fp/Bff2+d7/+BhPO6Z1+u+ruf1XF4GAEAGZOXkFRQBTiD+dgKVTiqrqKqpq5M0ZMmaWtoAOrp6+qcMDMFIzdiEYmpmbqJBpVlYWtFJitYMG1sbFTskLvvTDmcQHM+ec3ImXp13uYCubvB/l7sHkC9eAk8jcy9Eb5/LvldQzQ+v+jsw1ZAlfwYDAK5dZ98IvIlBwXRNXVYIJ9TpLJUb9j9LvBVOj4jkRVGj/Y1i8AwiH09eEwhjMU4uXtsiAWLlqInMcLh+28okKRnuhNy945lic0+Uqu7NdErDdB/5DBo7MwuE4J+dw8jIzcsvwEIUFFGEisWQm1ACpcZlxF7vl1c8YMCJyqrqGio+fFRbVw8NjU2uec0isNWhVuq2XMPzmjcRBVHhSWCtXaPR2mZoybHzL0TUfmxPabeR6yg/+6QTY83VQNOkSwkbumsgkgzwtKe8tDdHYM7ts3sW1Q/Pn3PEWaGmYjoje+B3ewx9bM4V0LNfDB5XL3/o5v1hSBi5fzvQkQESOkQOwiiwI++5YBdkDjFIrKEx3cZK4Ti8eAlZpjcnYMSHKG0ygKKVeFSLRpOZNL9p19Ku1Q9enKlp45lZiQGr7hlWS17RKWp03mv8481cQnwBUNTAXwIUeAvsJwCCTnV4FyJC9CrKYDnOT91DpRZSG8Bsn7pAw2Ihd7Hn7R0hynXezjQcvQTyMGgUjV12kiW75XaR7Z9OK9kD0/j6ckfyk/fcPHCkvkz48NG/r3p4FeRpoQa9JA74sJAOcLubirEPqXqTpZ1hNzUN5exoNVbk5RmSOQqcJix5yWvvRZZ9nyay+tqAsb6U76oAwo3wgXvJkK6sCpOYQBTIdT6cg92rSxWh16pdV2c8NnDzfQhveqvND4k6aAB0ssWnHuL2yZQ7AHLzJTgUrreyZeWewhawpw1RMDWYHLP1OcNQgKzwlKVP5JV5crB7cZ+NRJ6AB3wx/x3RsEufEkozLu+g7+zkekfLbFQo8byEubp5ld7Ot2CQKxJ7qguZxF4SB3ozQF2pCEIbcaFxg6eAr0/MbeHb1DCK+vQCA3j4YTcwjNiWyEgcq1dRlfnXsq31K3hhhvNX/CYM0JC+asxk91d+7ahTr6AAaTAn3U2lTBfjIc1pr5VEX94yw8uIZhWQVAHQj66iLErxDLqNmN0wuO9hYf6FN+boQb1FjENYJAiWKrru2ejWzoZX6M9A91p2Sw1TTRT/rdDQsyiOT1f6br4fKm6Fpeb9qocNfvYOLPAuczuA5BTbeVT2O/ghlkYEScGHX0Df3StfyMT4iYHCTEQTLj04iWePVx6aomPYGLc08OXB+drJLqoq42/wXqB5eagtaqR+ZAPsymG8utBxt1rO8zFTPHITA50gCMQ4Gw7tQBZFo0DBsWb5ExlyKoBbvRAO7jdv6U8jMYne4Y+iWXmg53gvbNYsGg+gU3elEnaeXB/ufFUKJiyZdNZemo10NviBxr65KE1k/Rijg8KTan5647eoiJQAYPIL+9fuHPb/VSMucg/bcJHzKt557SPRYF8voq1+2SIWmSgQCZo2ZjhlymMigEZdZQ3MzX6wmmMTECwNWieLpWDlKihSZ2sVVwNX9AmecOXtMHP7C/WwPzvKbZqiJIYFZ7PuZngFJmNi9YatOLLQU77vGbS6PzGdsQVn/Ad7nQyALeZVbm01GA72t5bvR/aWTWVIIEVDwDJanzjqAc8QuFl4Yr9/2WTdPVPmHCtY7ZEZ4mJoDqURsbWcaHwtmIqJWrIXshpck5ilsHlYM34YFFXTG3dGzKrDMBxB8gsDn7G3bW/TDpe51ALDmy5KQW8lUgg4guspE7TN7wCTbFWnf7gBB16vuHtYoXsWo14j1cD9/Z+oyj5GF95jqI9KG0s6YtJ0N0jtISrVAZQcIO251QuKrBIaH7k2hLK/Mw8pyNmCnott3tGm6XjT9DsZUps7H8DCHwjc731hFRtTaF2UQ572Ca4Qp/On0RVdmFD0A219YL4DcFBN/lnfBvNr12E0W2MSZatepyNLVIbbFIg7jaYfoR/4W1VUKqL6zsF4NpNiq4orZEhCEjExd7AQ2j+B6GMOPmekeA7+DsM0IAsIqj31xrtAzvWqBsjmIWC6+uBONItM9R+HA8rGHxptX9JAF/G0L6QEiy3McdFEhp4+YNA0FHNwnW0/RFFEtwHRb/hwQsbzX/heYihsB6nNVJssfHnqQe/acYKMv8LqcRe7aEF7Y6ugtWxKLILeNmlzVF277PqxIg8dSxpo5gsaMBFxfgwvdWBhOvzOHHHzx4JUHLNpyc8LUzkLcfiIv3A2jQxpeQ1iL4IKUJ1dTmigtKLpgi6QjX2d8ISbHl1B8bH0UEbnI2DMVm5h4+6Ko+kTd3VVSVPGkpp4/p+BW7/faCjBhlD7MoDqRpcOJxz6lBe8gWYtBP80qaKf86k0FP9L1ziS+Y1m8MPaWpcD8BXkG2flILIvKvoC/hr8upkS1N2pwbQD5NtZmC6iNb2JUVJTRDoZxTXibAjQDp3w/y5Bhld8zynk7OU1S3S3LPnJLvjhzcfUaKeYeJwtkmPDDbYpWt0gTaf8e/gL32vUwV1i7lHVD65CN0n+CySLiHLZfbSx/XYollUUj09xeL/Cjqg2DUp2eM7igsEZPyXlnve63tfjYjZSbBwtUf7mlAhvX0N/CzxFIKE25lol9uEzuf4B95AK6EAVtXBSn3XGA6bVuISAxQuuFKTClSg4xz/VEivy43BYA1UY4x7aSd/i1RMdwdgzi68x0JEYIfLBbEMag6Kcur0R3WGGtXvT2744+WPE4QaWz1rrbq5fEmwQTMwOLPRNs2jAJiPTPpAjXA48lyGNDo/aEnNyEv39YQtTIKcLY2gVw/SWl2eGCgmvgRKcowIU96xWM6PvyJhk/4dRHbP4A2JaG+uq0xb1J15Gaa++VgngHKhh3L3grVzTsa95kyjw3wgZLYViuASK6smRQA8Ds39GAisCnrN+wiGik1BsIZfpFhk9aVvJNr+pUWJbSmxoOAqRzseBsHsCPJ+9EvFA6HLDuymPuB3VbLuUAeRzs5AnmhdV52drj6JdA/9JE6GEWqDZIrYYlrYCDM7hLcefRsAoFiZc4P3tYx5qFsH9ttFzAL0L/lgSwvjbS4Hlik7xGLuSVfejKzFhvtnHF3039B8VGq1UCpg4+cLt0KMDi46N3M5F9YWHiD/InKc21mDdj2pCGZNgqLihu2j14oFnH9dxycOd1FsVBZ+cMEBkuu0U7wwPJEfc9SWATH9MuG0EvfyJPxuf9enmuy3ipIOtB/Tq8fRSfpzQFs03/H+7yBgpxgsOgaPD69B90NfAH5SMhqmB4xns1ARtQlmao4VcBTRTDeuo6wPwzlIp/AQcGagk6KNOsPIQxV8P+wi/EIUDDVLWFGWvjTzIZnkLRH1UoJhWpXMTjPAjt3UAX17p6WGAJwxrWKi26AC0+gNR2jzhlwfEJrgvQCombOyaY8/bLwB9fMvueMLQvWNkBKGC0lq0Ht3KzP5jCcE4StVpESb3tdp2iHeZtLDMQ26rGa6n0GpULC4tIz4jBBxadsL3wHdFQPwahEAq1xR5rwJkcKwXQrx0f6F7awZw4fPbGa1gUiXJVpYOUgng1Il6/kdwHeGfQlS+PdZEZ/WbBBOmQjvC0LG6wpXRfApSSh5UP+GjCtGd2HwGkHtuvHkJDGvpqBlcXLXap5CKR9eJRzlgZ8W4zK891g7/yQl4SpDRz5B6E6FEUxFv8K/4i/p8Hn1DOZxLx2FQHi3X/cwgM0LCK+TZnTMszAMO3JUIXyO6zOQNiThG4OXOrwJNCE8XwV95JJ175KWLydZwJE882VhaOGyWMiSKcP771g4kaYKUFB2Dmz0JUdUk75Pplh8T7VBZwUY90zTpUDwWxIJNQ4p3+oSPgHVcJUQVskdpHklpVCunu2AMvq7HI2HuekbnizilxbZeVzVwQLUBT133fJUvswkKMu+OHgCDmIJX9+b8TDTiXIyTQUrXPXFm5NsIOF7X6snH0GkbLAqxPlJ9ecWoX5Ywy8Vl/GgAlgE21JAfp4T0F8NwItrDq/BXLuXDsET46eLTOOKK5svMyhZ3Ah1ePwHOvYdijiwWbAEJnbIP5V95SOcbXM43qIJm+5G32UABbhvaNNvRffVynh4jmDDQ3V+XtC1dHWnr5PFwd9Ds2UdVaIEHmECBo9V1OAz0w9Q7ZONc7xXtF+8+ETCmmX+G7+2+flmEDTEww2Dr5eQAbJggPltoLQ9vmismCRLQYIvSsXqDWOIS85DgRSlAhWjGdOxACJXNVdyGoSxA1lu2eETiYQrdn23iL9SxSRCa5LgEX0CruBRSxHIQWrdV/mq5qOUyNgs9QUYv+xsmlhwRichkxSqZko2RwH46USV7CUofNLnT23rewuaB+3Y+8g82zzjibgmdChhbQRFk34o/zPECaRHy7wKj5wlFDE8H30Jva81PwVlVT/UNLeH5C/T9cIDrBy3capubs5y2F7ATbAwpRvThn7BsaBvwbu0BBMDxHEtAsSE3DVOdF+kWWcXsfX3AFYeWSbrZP/TS/H80MGryotBYxj1U8rWXomZeevT+aQ0crFNLeulQLpiCr0J3rB5jTS3MR+wbSYRJirC2/5eEGCMHpzOUFWEplMsWaW0SVaCL8y8rZVI4hiy4qyEC7CW0YwNHTGLxvJ2vW6GNMctZQNF8YFxN+y/di6ENOZNtphmlCkIZsU3uvDqzlidm8vQCrkUfzYk6D4AYr6tk+mccy/i8xBKFQzibM/wWTIysZ6cDt/XhySBb1niUMBJRN+ILdWbj7Z6dnUgLZELPYXWeyXNhzV48NvUbAWzWEC0lD8PwVIGTt6rveS3h3gX3XiVRg1O5poRFvgPCL17nEx324dKJT5AC5OU7RFWXuEp0U1v+MRgY7mxikdoB4lle086YyXrr61aA8eVem+VOaY1TKn/sOxOeRhIcR4AZLNrygau7faIG/T/vTPO010Kbci6K9mAYPE3+D/Q/02VDHhOfPxxTud5MF+8KsrdY8Bw4TELjh26cdDiBfCo2ptEyDRsJrRk1KZcvgta3ckuK5CRPn7AxcptUHMpozoAU68b9ElVYL1uhaVz7RTJwRJ15W+0X8HZs7gUMi9wPAEik099Y6ilYhW7j1KNLmlFXlRwAb+NvU+PbN1AfHY1t+/sN4J1JVfn7FDYLloP1Scsg9GA3s2b6XMPgHYNbve6n3ghsmK0WGyzvNrCU7t0veADh7RGOKA7vXwYQc0uuPZMJMUQMLbBdz+2kFzkStJJNFEvH/f/cT1wnXJfsflkfnn+qJe89nGfU5c6Fpsd3vp8y31fD+eHg8uZSYXdwqcoBT9DS0aTRKoaZrdSqk0KtkFZb4+BBqXAnpKdyVLXBuP5clrK5wxSYyIWrghPCaNnLhJkp/A3x8fsMgMczROQeBhpGULvpU+ZNQqKLZQMr2c5uvEvEMHOemnBn5rN1M88Y+/TkhOxUIBP/2P2jr1+oIelfW2KEQFOnrjfGzrGWUsS6YsjIBTxTDwc64bw+fGhfW5AnvnpxLYAJDBm2lJ6rvaNZZMrsfTANYByHtYSbJahyNwhmaepqjdIPb+zS9jVAgfRHPZEjU1Gd3rhA/5cI2/I7HkyV/yE2rhd7VLRC+6h3nRnBwqHqGw2HNB46i9yPFIYrAbBjbP8Xiw3DuyzbyCf9d4TVDRcSKQussrgoejwBiAjYwZi0qcQK8KuYyotDvMBHuWgDgNhVUXyHsaOlkxmK4H0+NoRd5BhMX9v+E0DX3JzZF4fOt9EZhbDdj5dngkuAUBvofWKvSxgvWN/JXhGtuib/SxfY8KRQCXuP9M9m4RKN/YNl9WjkI76xL/vI3tkUW8UwNyBJ97wf3vZkr8zgZWjt09M51pPhhhhIa5n7iOjQUKxcVfAILZl0T4jc7FxaD1109JL9Ca0sSBbrEuNCQcFBiIv+SZSJPYe/1EYItPw54SrCk2fKxMmvjDJ19ORWT937dR9t2yrEWeJCbBTuaVFvARwhlXYkVrmPmMoeHL//5uHAvRj2Y8axOXO33AUsW/qXsBWn9CxkKIYN1C7xCb9tfTfE+3+m+utf4yM6L/i+ic02U8cQ2F98GKWj7KuD2pLDXkPCLCOzaCvJfwOemmSw+9kphfUY4yI+yj5/MmQxX+dJTNMaPNhkZY4Wbc3tEQKBn08wseAkoa6qqIQUIOD3kPmDGdgoM1ToC4KklkiDUBk4Uk/Fidp8zCJcFBMgHj+etTxbRFeHvwhf80CiSt3z3DIFYl6k1lWLVvRBn0lpMVKj6PITC0tar9jbVAPhHP8k4rhblOqCcOdqrAPy67Z1WL4TfMfVx0GLrHQJyH8iQUus8lkFKuv5kcYrNvW13YfKuZ89ORAmC15BmyKxBFilYKq8dxQRWdqGLLb8Rij6WrIs7/mxVyFptbrarK6uDO1v3yxzOWQjtaz2W/01pTvN/Omyfx8D2VGPK80olW8HfnliYW8J7UjIcIlewB+DJW6whrBEqHlPOAQ8W/xs1Hn5GmuasOM+K9M5T9RYI+PMwnvMsCTG6r+dbVXfMESA2YjneGLq0D1CQv4w2JrzNXBsshiH+QHHQa2Mr/AZ4I3FCYwSF30Bqgti3TOnZKmjAfxUANcv/0JqQQ2HHnOhMOwJodHns6/25Jg743Q1lQ+KbmEPuPq51Bt83snYTH17IxKtNv2roT2epeJDTPX4a0X9SZHNHJqSie0RtRDgKb5JGNRAJr4h2aypQVI68DWseD13hXjPfFQtgcpsWw3+bHWbYNMQ5bN4cjo9d8aBirB8/oJdnePZQoxNeCAZZbotwjOCA0wROeUdcuZjnmA4UdjXjcB5b5xb9AZYmwdFSH2DdhvscW5z5QnIMnYTFRngKajbkSdjvvVyWw6LwIJWxlYhshBPGlg4xDUFZOFLf2UlA4MUe8DA8TIea+IX2smNzuP0vmleE8ArQR+UsNqTqekrljgz0+vhX5+FaB5qs3t9J5cPuwScX+MPS/UkluQXNh5WrJFM9p4CGban0P71P43YKxglb2X+cyKQ94h/diX4v9RaCpnBsnLBEiBNo/0idpiYrznuGrJbXrCBGfcS8UOZNOTvW4hnUTwJkuVcBHodNx3R8t5LtTDmf9/EmsNByWOE4XyHplSzut+ilAlOYAW6FAoMlRP17j9CYvp40MImU7d5GfS2Drx+GW3yciuygcSeJPwW0wzd8Jx7iITtZPchNXC6aPAtKQrB2xa8z53r/+NXr2nhyLPFySAhSY0IYOQBgKT6h3kSWUhtwoeuSh11H23xn6OOue1lRwSZFtnWn9cdSaaEGqWp9dYsa7+ChyZcubQzxJjXzXLk9h89vBXfZGDIlvpsP4QIbmPMjqxhqsBfefv19nkI6ATGqFQsHNSKV1bi5RDhNzYOR3Ckunra8gfjADKT/ll0bAtT+Gyj2d7NLfv1oX/s3Dxbwcs6upK916xmn4Cn9qoUPECeybc02KdxfxGRB0zT8l0Zikliu1neuQQ0TmnzytBG1jCdcA7AUAfwLbEnAjIqNRI/tr3AS3HHzaJJ1AVHLTuHM72nkWqYVDDf+j66wmI+h8Lmvxl4OGEXnX3JOrwBz08R7ELtwHigs810rOj0viiWN/+sC7Ni5oBKQ6bZk8eHN3PYLZzQgVjEb5jNex3lMrEC0EzpQ3faNx4xd523exujDDnuf5ZP5S7v7/UuKqkqW2X94NfxXy7549ho3WWi6n1Vt7ABUIeJc5cdqWkRZrf4aNACabeODzxEINKtnW6CGh5734US98i9pjARiQfrdT+ax6iuaQ68hRSbykUQcJUr4DoFBkm4wgd2hq4tBIt5iGqkmIYjIK97X2Ac+y7Al6Eas2r5VF3EkYVixIGsqzlkm0RXA05xqwaznFZjzk8V80Y+iIDhMyNdfSpEMp3IheR2cbKGSnSfWK1HK5rU73te+Y+mp46Jt6oD3xe3/MKUzoD2UBzNmu3iQW2uCJHd2ne9t/x3h7lnn4kBxCEAK//UgVlyjyz9W5JHgDWu3g3OlGHBZO/680MjgZCrLsuOfLU+5jPl2Pxck02uqzyqmPlhPA0isbdnhRis6Qh/S179zV226tq30IMf1KqJ+bHgSCHhjM64dbIL8GGt21vGOEXP+/AJcER6NjIb286TKSzTCCidNp6Zf3rpsWZnG5dNhuEqU94Fd2sYHaDOgM3A3LO9nxQazFRTOJsT7cD4eScDOsG8UfQGqlmCqM7L0/3ZpnWylRSPqBu/B+eHEfYNZO+0QTaWrYVbLURYIK4TWR8iESRGfHHQWgthnGCFSR6XhpDR2Xtq0uhr2QQvOUVv8Giw6ImYIgOdd8OPo1dxm1hQCQV84zTzso6krY75wTfRjcwV5Geb/tJ4owfFd8kC7FDPX9B9mBYVZ0zuK21vYoVpvazdgKlwKfwFKZSgPgFfDQtTRYNOvy6JNZ7OeYCWEFJq/hygT5KPD9mIbenEBsAvHdzCG/K5iPb4S4aP/YhnMDJHIP/icNM6ztIK9gkRRdA71nyoMef+2jb3neklwx0pHH2SIdKb2jwOWG3JCmYK4Iva+7eEG0a3If9Da4KaFAGMYlTTCfFBFSoyK7YMSwyuICgV8M49c7bf4VqtKi5LOaLKCJlVZ5zBpLrIr9LvsMNctO/oiM3ab/MknNJPPbnirNLPbGflQrRr2aJJYXg/QIsh8k1PXzz+z9w5gIxiXea4P0RlO2OUDqhJdvv8EBpRLy6Z9p8GR+FFKgDHcGsMkkbMnJz0q7hAhDVdF3sCfBM6hj2P4SlE5njIsBmSky6FhkNYd2UfgLt37a35+BEvupCA+Jh5kmC5dWaGeQNmz35EEQvhwZG3qxKo/RZr66hM7IJ5Won7gh78anK172Zt3buKAMKyMDjzdR9ufcCZ0zU4DOA5RKIgkAMTbytB3LQFlT5MH/An6qfRJPjj2dg5WFP3mdlZkwFePrA+3eN2Wu0A+WAFKZrztzJRibcqCweEddxU/PSGWxOnjHtOUDzfDk9lEvDDj39cFH1E9dVeQLGVI3Qgeo0M34dZ6K/3cb9BBZcZf8uS+BivagqBuLW31L60FMADuX1jiTur3n1ZrBrIgpkFO//0OmyT9qWthHcnwzLRswTdDbgUflRNCAvfaODDSX8vQLo7QBDltK42Y/OdFbS1zUYFLv6qSiV43zDiUrcAtbEqoMVBPa37+RMTuT1gmrJVH1qqYsi12cyakNWPLrTGqg9NO1KY2vPwISkCnxobu6FodJWlXUwABhb1LwveepTps6Tt0E8j+tabfLiI+MdLLWSxLqA1cJON1hz8aZkisUWXUMhNOQpLrIR062CCV3Bg0ZwlU9OhbKefT1NjDog/g2q+TAW89zQllayE0d/y9qAdSAucb3iKOXZYzSSmdealQNS1IL3qMUpowYU6uuO7LEqyPD05MgXvXy6frzzrkpBXlAx+J30gur7J4OT/ziwA3fvIcKvLAHet4sqms0BCkZk6CKbyRPu8Xqwsv5KGfYcI4thniGI9nFwFwt1bfZm9racBom20+/R8n0upa1EAueM5b9A7lN3BE9empZqOTj5NkKNeCf630MV2jeKeEP8cImJ5W9l3gYGDg1wPxxZcmBvsZ4qZXUMim6a/M2jKAsHtYvPN1A0FsH3AAbpFvCxA200RpdN9ME2nSQL2g5pg9OIw6KkYT3gKe7QmWrItoXK1c/XBbJQ6pVOca2BzfQfoOCTygsFljpEPDG+tBLrte+jUDP2DcYKLisBjhgtTZnAmgmg8/Aus/awVIZGqScBZ1xa/82qG7rzT0BDLldEs0sP5HS8oNhU3lhDue5NS0TUt0T7YTZvSGH0HEYEs97dJ7xpNO1TKokYmLWenco4PvNEsv2hQ85pcgDjlA29jwVT9IoAcXQGCnhPG8fgYyhJ64NNzBiWf5p1XdoBx+xtXoPiVbK44FcHipEqTaar9/ruKsdneZuJmevOHPOjhmtvwVVX8Nmx+/eftj7gZmxlF3ocI/n5T0byPxzPfMi24AxSQeAGjdI3Q4hc5ffAT7v7F89ZNEgj6fheuHl2hjRQlG4EMMwpiAnsm1HT499a+zKPMejH0uAfnT4JyItDTiDQ4l5DoO/sQZ0HkzGpiM8KQNwaHk0Un9WaO+yuA1ZTV9z8Jm13bqwTlfNHncIi8M/kHQMFhMF7Imo2mUw/Sox7Bh3W6UplqvEiy+g2NvVzFPCtGkHSTLuFSL2CtGzpPY+E5O0PK3HSbUnBzNBZodkNnUAlch2Zk9/9F8JuAYBirgoVpE7QyheJ33WDOysDFYMSXBdm20XfXCWcGzsGyvXE8FJN7EadsGjIDzZ+GtIUEBWuQ6o87kaDvo4eplYs4dz6P06lSSCA0yAvpXKD1djjC8dnWdYtWsLpl4Fplhje74Y6i/M7VMSQnRvD54/CC4LPzx4vghhIOzVo6bLzl7QIHPvVyM/drqBBZ3tW1lYqvXfauRfH5WHe+RcHI+xxeqDECqJ9tdXLyy9L7RqxyUaZKwmlAux+zEzdzITSRlr36YuSm0LBhTpkivodWytR6BNULFxftqF42QqKLmoog9WlYNRb4GtNm93bHuxBvV5VcOUeY6N/9xDutwbqYhaN3rIzpg1M6XfrYctTdA5Msr2v4Aydmb+Nl2/Eqw+jSXYvctmuDHYUAei0pUc6E5N1bULPEjHAr+HI3gwDjpDg0nE2fMkXneCumq9ifZR5IKUOqn0aDIfN64olrhaHfV4msozkdG/3j5HHqsf5Els8kwvDrCaK4/BXb+YzYC00mJEOu8njPsKgB9dG+FjqqeToCsJKLTvHS+iQTnqFquCJ+yCckuDaHLnP4GzroGg7BelrYZWStEFay3j+vkEuXHy3B2zG5xBqSx+/pxoEOv+OfiCfq5QMCCNq26xXC+1DZ+eQdH2jJ9FXSh9yrISZTk56jTzMIzG9+Ye+pumQffxmh2lcvPXjmNWL3PoOgRpkx4o/TZzE2y3IMtEZNxpNUlBqFlnBVXuPS0TIBkF+ZfvW3y2bGWD14zb8Cju5+wiSW1pIIRRtD0DeaxOLIvup5BZ2R2QfQVx6ryHH4H/rls/fRJy6KIdsJ/qVsWrBZaKgKOhP0GOUjA16wS+vlpcmot72SIWJWQDwyiD04TLSU6LyObtnOC2W5QA0OCGXHtlTi9Cyh95AIL8UU6AaQOaDSDfuf3DbxO4065WUdqPZ6Zj9S26jGlhDs/3mX1c4h+to5J2UwvgO3dkFtmKMBF3OuQvskMsOO8R5FnXblT4zMUpkjhs3m1ygag6zQWKfFOQCFM8jmAFtaCpCqDX77xqhE3B99uGU3UT+41SufAp9fQENvgk5lwqneywazIE9IpGT8v23sBPibAHG34mLWiivxnjk8p2S5ofshihnLQd4CU5ABpVcMX/5Hg39Jm55k+hgxugBCGIR5KmY+qz6US5/wKYimBbjTOSBlyD9OiYpWxtoLH6PcoaUdK0dW4vKR121dfMwumvgSBf8g0fsVN0w8jbplh7Df1FVC9wZuTbZStSswGJu6IngHRvBgOFag8F3hwPVNuUYjxNngNURuMvnnOvway+3l+1sK7aILbzdSzAxUCtG9/CaaHsBFIVzMWEH7upNL6Hr6P+oI4i+VqT6NyQrYUMkRXYd2P1ZjEMDaJ1rrurxTBgTfMw9cZe8SHIAz0JA7jpgDmr+InVbg0HrkFNZVhQ2uBKn75tLEZwfMp2azBhkglsAXDPx2BccwTDGmnsjRDh2jHh9ynTQY4vLqcuv/NWRlP8sFHWyxSmm38ikF1UoTywoZL0oFE4I4ujqIcvCuo+0ABPohIMdyq8EqgTcogXcYNCGdgvytDCA/fwt2eG78+OAANOgmKkOI8WdjE3FaFdqW6rx/oOBunJoqMLOwnPtv67Cw7PY8c4jFvek2G/hk1Thivu5Pf2iV8YDA8DyziBPz6MKlF9XQlRt7ZRV09nZrygwo00ME7IpFuOiEsUrd14UcCvNC/DPkbFmqB1uQIg477mFiq2niVADUYnvdjiQPNpFfMTo4yg4X+tDW3rmH2WE9E2rY0ES40wM6QRwaQL5/fepJULkj3Zc6L1ItuWmO6zXbvou399GBCPcQwB2+rRpubsw03qWL2iRyHH9Afl/YHuFYa8v7zEXDEigXJo9RAtTM4BTzElQhSgePv55AmHTo4W9v4SmkPDlLIhOpcXBK4GO2AnyzeN0MaKP7umX9bZAfc5LA84bxj3frYCxezbP9KG7QeJzevIhiAU4p/j+y2OyMV2mxNgAAAABJRU5ErkJggg==",Iy=r(127),Ay=r.n(Iy),Cy=r(128),Py=r.n(Cy),Ny=r(129),Oy=r.n(Ny),Ry=r(130),Dy=r.n(Ry),Ly=r(131),jy=r.n(Ly),zy=r(132),By=r.n(zy),Fy=r(133),Uy=r.n(Fy),Wy=r(134),Gy=r.n(Wy),Vy=r(135),Hy=r.n(Vy),Yy={wipe:function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r);var i=1;return"up"===e?i=1:"down"===e?i=2:"left"===e?i=3:"right"===e&&(i=4),(n=t.call(this,gy.a,py.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,n}return r}(dy),fade:function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r);var i=1;return"out"===e?i=-1:"in"===e&&(i=1),(n=t.call(this,void 0,yy.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),n}return r}(dy),blinds:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,by.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n}return r}(dy),checkerboard:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Ty.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,n}return r}(dy),dissolve:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,ky.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),randombar:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Ay.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n.setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),circle:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Py.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),box:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Oy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),diamond:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Dy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),plus:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,jy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),barn:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,By.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="inHorizontal"===e?1:"outHorizontal"===e?2:"outVertical"===e?3:0,n}return r}(dy),strips:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Uy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="upLeft"===e?1:"downRight"===e?2:"upRight"===e?3:0,n}return r}(dy),wedge:function(e){p(r,e);var t=g(r);function r(e){return x(this,r),t.call(this,wy.a,Gy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return r}(dy),wheel:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Hy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,n}return r}(dy)},$y=function(e){p(r,e);var t=g(r);function r(e){var n,i;x(this,r),(n=t.call(this,e)).filterType="",n.isConflict=!1,n.activeWhenConflict="prev",n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r;if(n.filter){n.filter.percent=n.commonTimeNode.applyTimeFilter(i);var o=null===(t=n.timingTarget)||void 0===t?void 0:t.container.getBounds();o&&(n.filter.uniforms.uBoundRect=new Float32Array([o.x,o.y,o.width,o.height]))}i>=1&&n.timingTarget&&n.ctx.clock.setTimeout((function(){n.removeFilter()}),34)},n.onSeekToStart=function(){n.timingTarget&&n.removeFilter()},n.onSeekToEnd=function(){n.timingTarget&&n.removeFilter()},n.onDestroy=function(){n.removeFilter()},n.commonTimeNode.on("timelineStart",(function(){n.filter&&n.timingTarget&&(n.timingTarget.container.filters&&0!==n.timingTarget.container.filters.length?n.timingTarget.container.filters.push(n.filter):n.timingTarget.container.filters=[n.filter])})),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate);var o=1;"out"===e.json.transition&&(o=-1);var a=null===(i=e.json.filter)||void 0===i?void 0:i.match(/^([a-zA-Z]+)(\((.+)\))?/);if(a){var s=a[1],u=a[3];Yy[s]&&(n.filter=new Yy[s](u),n.filterType="".concat(s,"-").concat(u),n.filter&&(n.filter.transition=o))}return n}return S(r,[{key:"removeFilter",value:function(){var e,t=this;if((null===(e=this.timingTarget)||void 0===e?void 0:e.container.filters)&&this.filter){var r=this.timingTarget.container.filters.findIndex((function(e){return e===t.filter}));r>=0&&this.timingTarget.container.filters.splice(r,1)}}},{key:"modifyAttrKey",get:function(){return this.filterType}}]),r}(ny),Xy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startPos=null,n.onTimeNodeStart=function(){var e,t;n.startPos={x:(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_x)||0,y:(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_y)||0}},n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r,o=null===(t=n.path)||void 0===t?void 0:t.getPoint(i);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+ +n.timingTarget.design_ppt_y)},n.onSeekToStart=function(){n.timingTarget&&n.startPos&&(n.timingTarget.ppt_x=n.startPos.x,n.timingTarget.ppt_y=n.startPos.y)},n.onSeekToEnd=function(){var e,t,r,i=null!==(t=null===(e=n.commonTimeNode.json)||void 0===e?void 0:e.spd)&&void 0!==t?t:1,o=null===(r=n.path)||void 0===r?void 0:r.getPoint(i>0?1:0);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+n.timingTarget.design_ppt_y)},n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n.createPath(),n}return S(r,[{key:"createPath",value:function(){var e,t,r=new os,n=null===(e=this.json.path)||void 0===e?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(n){var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=a)||s(t)||k(t)||h(),l=u[0],f=u.slice(1);if("M"===l){var p=c(f.map((function(e){return Number(e)})),2),v=p[0],g=p[1];r.moveTo(v,g)}else if("L"===l){var m=c(f.map((function(e){return Number(e)})),2),y=m[0],_=m[1];r.lineTo(y,_)}else if("C"===l){var b=c(f.map((function(e){return Number(e)})),6),x=b[0],w=b[1],S=b[2],T=b[3],E=b[4],I=b[5];r.bezierCurveTo(x,w,S,T,E,I)}else if("Z"===l)r.closePath();else if("E"===l)console.warn("not implements");else if("c"===l){var A=c(f.map((function(e){return Number(e)})),6),C=A[0],P=A[1],N=A[2],O=A[3],R=A[4],D=A[5],L=r.currentPoint;r.bezierCurveTo(C+L.x,P+L.y,N+L.x,O+L.y,R+L.x,D+L.y)}else if("l"===l){var j=r.currentPoint,z=c(f.map((function(e){return Number(e)})),2),B=z[0],F=z[1];r.lineTo(B+j.x,F+j.y)}else if("m"===l){var U=r.currentPoint,W=c(f.map((function(e){return Number(e)})),2),G=W[0],V=W[1];r.moveTo(G+U.x,V+U.y)}}}catch(e){o.e(e)}finally{o.f()}}this.path=r}},{key:"modifyAttrKey",get:function(){return"motion"}}]),r}(ny),qy=function(e){p(r,e);var t=g(r);function r(e){var n,i;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.onTimelineStart=function(e){e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t,r,i,o,a,s=e.duration,u=e.delta/s,l={x:1,y:1};if(n.to){var c=null!==(t=n.from)&&void 0!==t?t:{x:null!==(i=null===(r=n.startVal)||void 0===r?void 0:r.x)&&void 0!==i?i:1,y:null!==(a=null===(o=n.startVal)||void 0===o?void 0:o.y)&&void 0!==a?a:1};l.x=c.x+(n.to.x-c.x)*u,l.y=c.y+(n.to.y-c.y)*u}else if(n.by){var h={x:n.by.x,y:n.by.y};l.x=1+(h.x-1)*u,l.y=1+(h.y-1)*u}n.timingTarget&&(n.timingTarget.scale=l)},n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y})},n.onSeekToStart=function(){n.timingTarget&&n.startVal&&(n.timingTarget.scale=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&(n.timingTarget.scale=n.createVal)},n.from=e.json.from,n.to=e.json.to,n.by=e.json.by,n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),(null===(i=n.timingTarget)||void 0===i?void 0:i.scale.x)&&(n.createVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y}),n}return S(r,[{key:"updateCurrentValue",value:function(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}},{key:"modifyAttrKey",get:function(){return"scale"}}]),r}(ny),Qy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isTimelineStart=!1,n.startColorString=null,n.currentColorString="#FFFFFFFF",n.onTimelineStart=function(e){if(!n.isTimelineStart){n.isTimelineStart=!0,e.isReverse||n.updateCurrentValue(),n.from.isInit()||n.from.fromHexString(n.currentColorString),n.to.isInit()||n.from.by(n.by,n.to);var t=c(n.json.cBhvr.attrList[0].split("."),1)[0];ty(n.timingTarget,t+".on","true")}},n.onTimeNodeEnd=function(){var e=n.json.cBhvr.attrList[0];if("remove"===n.json.cBhvr.ctn.fill){var t=c(e.split("."),1)[0];ty(n.timingTarget,t+".on","false")}n.isTimelineStart=!1},n.onSeekToStart=function(){var e,t=n.json.cBhvr.attrList[0];if(n.timingTarget){n.onTimeUpdate({duration:1,delta:0});var r="ppt_c.color"===t||"text.color"===t;if((null===(e=n.timingTarget.fill)||void 0===e?void 0:e.designColor.toUpperCase())===n.from.toHexString().toUpperCase()||r){var i=c(t.split("."),1)[0];ty(n.timingTarget,i+".on","false")}}},n.onTimeNodeStart=function(){if(n.timingTarget){var e=n.json.cBhvr.attrList[0],t=ry(n.timingTarget,e);t&&(n.startColorString=t)}},n.onTimeUpdate=function(e){var t=e.delta/e.duration;if(n.to.interpolationFrom(n.from,t,n.target),n.timingTarget){var r=n.json.cBhvr.attrList[0];ty(n.timingTarget,r,n.target.toHexString())}},n.onSeekToEnd=function(){n.isTimelineStart||n.onTimelineStart({isReverse:!1,activeCount:0,id:""}),n.onTimeUpdate({duration:1,delta:1})},n.replaceAttrToRelation(),"rgb"===n.json.clrSpc?(n.from=new Hv(n.json.from),n.to=new Hv(n.json.to),n.by=new Hv(n.json.by),n.target=new Hv):(n.from=new Vv(n.json.from),n.to=new Vv(n.json.to),n.by=new Vv(n.json.by),n.target=new Vv),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeEnd",n.onTimeNodeEnd),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n}return S(r,[{key:"replaceAttrToRelation",value:function(){var e=this.json.cBhvr.attrList[0];"ppt_c"!==e?"style.color"===e&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}},{key:"updateCurrentValue",value:function(){if(this.timingTarget){var e=this.json.cBhvr.attrList[0],t=ry(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),Zy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.lastVal=null,n.onTimelineStart=function(e){n.lastVal=null,e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=0;if(void 0!==n.from&&void 0!==n.to){var o=(i=n.from)+(n.to-i)*r;n.timingTarget&&(n.timingTarget.r=o)}else if(void 0!==n.by){n.lastVal||(n.lastVal=0);var a=n.by*r-n.lastVal;n.lastVal=n.by*r,n.timingTarget&&(n.timingTarget.r+=a)}},n.onTimeNodeCreate=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.createVal=n.timingTarget.r)},n.onTimeNodeStart=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.startVal=n.timingTarget.r)},n.onSeekToStart=function(){n.timingTarget&&null!==n.startVal&&(n.timingTarget.r=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){n.timingTarget&&null!==n.createVal&&(n.timingTarget.r=n.createVal),n.startVal=null},n.from=n.json.from,n.to=n.json.to,n.by=n.json.by,n.by?n.isConflict=!1:n.isConflict=!0,n.onTimeNodeCreate(),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n}return S(r,[{key:"updateCurrentValue",value:function(){var e;this.currentVal=null===(e=this.timingTarget)||void 0===e?void 0:e.r}},{key:"modifyAttrKey",get:function(){return"rotate"}}]),r}(ny),Ky=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isApplied=!1,n.onTimeUpdate=function(){var e,t,r=n.json,i=r.cmd,o=r.cmdType;!n.isApplied&&i&&o&&(n.isApplied=!0,null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand(i,o),n.commonTimeNode.seekToEnd(!1))},n.onSeekToStart=function(){var e,t;n.commonTimeNode.isInInteractiveSeq||null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand("custom-pause","call")},n.onSeekToEnd=function(){},n.commonTimeNode.on("timeNodeStart",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeNodeEnd",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("seekToStart",n.onSeekToStart),n.commonTimeNode.on("seekToEnd",n.onSeekToEnd),n}return S(r,[{key:"modifyAttrKey",get:function(){var e,t,r,n;return(null!==(t=null===(e=this.json)||void 0===e?void 0:e.cmd)&&void 0!==t?t:"")+(null!==(n=null===(r=this.json)||void 0===r?void 0:r.cmdType)&&void 0!==n?n:"")}}]),r}(ny),Jy=function e(t){var r=this;x(this,e),this.runtimeNodeEventHub=new Ks.a,this.onVolumeUpdate=function(e){r.audio.volume(e)},this.stopAudio=function(){r.audio.stop()},this.destroy=function(){r.stopAudio(),r.audio.destroy(),r.ctx.activeMedia.delete(r.audio),r.ctx.volumeAdjuster.off("update",r.onVolumeUpdate)};var n=t.json,i=t.isIterate,o=t.isSub,a=t.eventHub,s=t.ctx,u=t.parent,l=t.iterateType,c=t.iterateIndex,h=t.iterateId,d=t.isInInteractiveSeq,f=t.fromSeqId;this.json=n,this.id=n.cMediaNode.ctn.id,this.commonTimeNode=new t_({json:n.cMediaNode.ctn,isSub:o,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:s,parent:u,isIterate:i,iterateType:l,iterateIndex:c,iterateId:h,isInInteractiveSeq:d,fromSeqId:f});var p=n.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info("redirect media url from ".concat(n.cMediaNode.tgtEl," to ").concat(p," by delegate."),s.taskId)),this.audio=new Hm(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",(function(){r.audio.volume(s.volumeAdjuster.volume),r.audio.play()})),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)};function e_(e){return(null===(t=e)||void 0===t?void 0:t.cBhvr)?e.cBhvr.ctn:function(e){var t,r;return!!(null===(r=null===(t=e)||void 0===t?void 0:t.cMediaNode)||void 0===r?void 0:r.ctn)}(e)?e.cMediaNode.ctn:e.ctn;var t}var t_=function(e){p(r,e);var t=g(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).uuid=uv(),n.isSub=!1,n.isShadow=!1,n.startCount=0,n.applyCount=0,n.isReverse=!1,n.isConflictDispose=!1,n.isIterateEnd=!1,n.parentTimeNode=null,n.isActive=!1,n.isDestroy=!1,n.shouldSeekOnStart=!1,n.repeatTimeoutId="",n.iterateShadows=[],n.isEndEventsEmitted=!1,n.tmFilter=[],n.timeDelta=0,n.isIterate=!1,n.iterateType="el",n.iterateIndex=0,n.children=[],n.subList=[],n.duration=0,n.isNegativeSpeed=!1,n.handleEndCond=function(){n.isActive&&(n.isActive=!1,n.isInfiniteRepeat()?n.repeatTimeNodeEnd():n.seekToEnd(!1,!0))},n.handleActive=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(n.isActive=!0,n.isConflictDispose=!1,n.applyCount+=1,n.json.iterate||n.emit("timeNodeStart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startCount>0&&n.json.restart){if("never"===n.json.restart)return;"whenNotActive"!==n.json.restart&&"always"!==n.json.restart||(n.seekToStart(),n.emit("timeNodeRestart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startTimeLine(e))}else n.startTimeLine(e)},n.updateTimeLine=function(e){var t=e/(rd.b.TARGET_FPMS||.06);n.timeDelta+=t,n.duration-n.timeDelta<=t&&(n.timeDelta=n.duration),n.timeDelta0&&void 0!==arguments[0]&&arguments[0];(n.isTimeNodeEnd()||e)&&(n.isActive=!1,n.isSub&&n.destroy(),n.emitEndEvents())};var a=e.isSub,s=e.isIterate,u=e.ctx,l=e.eventHubs,c=e.parent,h=e.json,d=e.iterateType,f=e.iterateId,p=e.iterateIndex,v=e.isInInteractiveSeq,g=e.fromSeqId;n.isSub=a,n.fromSeqId=g,n.isInInteractiveSeq=v,n.isIterate=s,n.parentTimeNode=c,n.json=h,n.ctx=u,n.iterateIndex=p,n.eventHubs=l,n.iterateType=d,n.iterateId=f,n.tmFilter=null!==(o=null===(i=h.tmFilter)||void 0===i?void 0:i.split(";").map((function(e){return e.split(",").map((function(e){return parseFloat(e.trim())}))})))&&void 0!==o?o:[];var m=Number(n.json.dur),y=n.json.spd||1;if(n.isNegativeSpeed=y<0,Number.isNaN(m)||(n.duration=m/Math.abs(y)),n.uuid+="--"+n.json.id,n.setPreStyle(),h.childTnLst&&n.createChildren(h.childTnLst),n.startConds=new Jm(n.json.id||"",h.stCondLst,l,n.ctx),n.endConds=new Jm(n.json.id||"",h.endCondLst,l,n.ctx),h.endSync&&(n.endSync=new Jm(n.json.id||"",[h.endSync],l,n.ctx),n.endSync.on("active",(function(){var e;"interactiveSeq"===n.json.nodeType&&(n.isActive=!1,n.shouldSeekOnStart=!0,n.emit("timeNodeEndSync"),null===(e=n.endSync)||void 0===e||e.reset())}))),n.startConds.on("active",(function(e){n.isActive||(n.shouldSeekOnStart&&(n.shouldSeekOnStart=!1,n.seekToStart()),n.handleActive(e))})),n.endConds.on("active",(function(){n.handleEndCond(),n.children.forEach((function(e){return e.commonTimeNode.handleEndCond()}))})),n.parentTimeNode&&n.parentTimeNode.on("timeNodeStart",(function(){n.applyCount=0})),n.isSub&&"nextClick"===n.json.masterRel){var _="shape slide onNext"+n.fromSeqId;n.startConds.addCond({event:_})}return n.json.iterate&&!1===n.isIterate&&n.createIterateShadow(),n}return S(r,[{key:"createIterateShadow",value:function(){var e=this,t=uv(),n=!0,i=0;for(this.ctx.eventHub.on("IterateTimeNodeEnd",(function r(i){i===t&&(n=!1,e.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))}));n;){var o=JSON.parse(JSON.stringify(this.json)),a=new r({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[i]=a,i+=1}}},{key:"isInfiniteRepeat",value:function(){return this.json.repeatCount>999999998}},{key:"getReverse",value:function(){return this.isReverse}},{key:"setReverse",value:function(e){this.isReverse=e}},{key:"createTimeNode",value:function(e,t){var r=null,n={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return"seq"===e.type?r=new ey(n):"par"===e.type?r=new r_(n):"set"===e.type?r=new iy(n):"anim"===e.type?r=new hy(n):"animEffect"===e.type?r=new $y(n):"animMotion"===e.type?r=new Xy(n):"animScale"===e.type?r=new qy(n):"animClr"===e.type?r=new Qy(n):"animRot"===e.type?r=new Zy(n):"cmd"===e.type?r=new Ky(n):"audio"===e.type&&(r=new Jy(n)),r}},{key:"createSubList",value:function(e){var t=this;this.subList&&this.subList.forEach((function(e){return e.commonTimeNode.destroy()})),this.subList=[],e.forEach((function(e){var r=t.createTimeNode(e,!0);r&&t.subList.push(r)}))}},{key:"bindCommonTimeNodeEvent",value:function(e){var t=this;e.commonTimeNode.on("timeNodeStart",(function(e){t.emit("childTimeNodeStart",e)})),e.commonTimeNode.on("timeNodeEnd",(function(e){t.emit("childTimeNodeEnd",e),t.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))&&(t.json.iterate||t.allChildrenEndHandle())}))}},{key:"createChildren",value:function(e){var t=this;function r(e){return e_(e).presetOrder}function n(e){return/^slide/.test(e)?"slide":/^layout/.test(e)?"layout":/^master/.test(e)?"master":"unknow"}var i=["master","layout","slide","unknow"];e&&e[0]&&r(e[0])?a(e).sort((function(e,t){var o,a,s,u,l=e_(e).id,c=e_(t).id;if(l&&c){var h=n(l),d=n(c);return h===d?(null!==(o=r(e))&&void 0!==o?o:0)-(null!==(a=r(t))&&void 0!==a?a:0):i.indexOf(h)-i.indexOf(d)}return(null!==(s=r(e))&&void 0!==s?s:0)-(null!==(u=r(t))&&void 0!==u?u:0)})).forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))})):e.forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))}))}},{key:"playReverse",value:function(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach((function(e){return e.commonTimeNode.playReverse()}))}},{key:"allChildrenEndHandle",value:function(){var e=this;if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout((function(){e.seekToStart(!1),e.resetForRepeat(),e.startTimeNodeRepeat()})):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}},{key:"resetForRepeat",value:function(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach((function(e){return e.commonTimeNode.resetForRepeat()}))}},{key:"startSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.startTimeNode()}))}},{key:"startReverseTimeLine",value:function(){this.isEndEventsEmitted=!1,this.timeDelta=0;var e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(__.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(__.animateStart),this.ctx.ticker.add(this.updateTimeLine))}},{key:"startTimeLine",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit("time ".concat(this.json.id," begin")),this.eventHubs.global.emit("time ".concat(this.json.id," onBegin")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," begin"))),this.json.iterate)this.startIterate();else{this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});var r=1e3/this.ctx.ticker.maxFPS;this.duration<=r&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce((function(){e.onTimeLineEnd()}))):this.duration>r&&(this.ctx.eventHub.emit(__.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}}},{key:"startIterate",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.json.iterate){e.next=24;break}this.isIterateEnd=!1,t=M(this.iterateShadows),e.prev=3,t.s();case 5:if((r=t.n()).done){e.next=15;break}if(n=r.value,!this.isIterateEnd){e.next=9;break}return e.abrupt("break",15);case 9:return n.children.forEach((function(e){e.commonTimeNode.startTimeNode()})),n.applyCount+=1,e.next=13,this.ctx.clock.delay(this.json.iterate.interval);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),t.e(e.t0);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.onTimeLineEnd();case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])})))}},{key:"applyTimeFilter",value:function(e){if(!this.tmFilter.every((function(e){return Sv()(e[0])&&Sv()(e[1])})))return e;for(var t=0;t0?this.tmFilter[this.tmFilter.length-1][1]:e}},{key:"isNatureTimeEnd",value:function(){return this.duration>=0&&this.timeDelta>=this.duration}},{key:"findTargets",value:function(){var e=[];return function t(r){r.forEach((function(r){var n,i,o;r.cBhvr&&r.cBhvr.target&&e.findIndex((function(e){return e.id===r.cBhvr.target.id}))<0&&e.push(r.cBhvr.target),(null===(i=null===(n=null==r?void 0:r.cBhvr)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&t(r.cBhvr.ctn.childTnLst),(null===(o=null==r?void 0:r.ctn)||void 0===o?void 0:o.childTnLst)&&r.ctn.childTnLst.length>0&&t(r.ctn.childTnLst)}))}(this.json.childTnLst||[]),e}},{key:"setPreStyle",value:function(){var e=this;this.json.presetClass&&this.findTargets().forEach((function(t){if(e.json.iterate)for(var r=0,n=!0;n;){var i=e.ctx.timingTargets.getTarget(t,!0,{type:e.json.iterate.type,index:r,id:""});i&&(e.setPreStyleForTarget(i),r+=1),n=!!i}else{var o=e.ctx.timingTargets.getTarget(t,!1);o&&e.setPreStyleForTarget(o)}}))}},{key:"setPreStyleForTarget",value:function(e){var t,r;if(e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset)if("entr"===this.json.presetClass){var n=null===(r=null===(t=this.json)||void 0===t?void 0:t.childTnLst)||void 0===r?void 0:r.filter((function(e){return"set"===e.type&&"visible"===e.to}));(null==n?void 0:n.length)&&(e.hasPreset=!0,e.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass||"emph"===this.json.presetClass)&&(e.hasPreset=!0,e.style.visibility="visible")}},{key:"startTimeNodeRepeat",value:function(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}},{key:"startTimeNodeForce",value:function(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}},{key:"startTimeNode",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.isDestroy){this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);var t=this.json.stCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];t&&this.startConds.condHandle(t);var r=this.json.endCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];r&&this.endConds.condHandle(r),this.startConds.condHandle()}}},{key:"onTimeLineEnd",value:function(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}},{key:"clearSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.destroy()}))}},{key:"seekToStart",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(t){return t.seekToStart(e)}));if(e)for(var t=this.subList.length-1;t>=0;t--){var r=this.subList[t];null==r||r.commonTimeNode.seekToStart()}for(var n=this.children.length-1;n>=0;n--){var i=this.children[n];null==i||i.commonTimeNode.seekToStart()}if(this.children.length>1)for(var o=this.children.length-1;o>=0;o--){var a=this.children[o];null==a||a.commonTimeNode.seekToStart()}}},{key:"repeatTimeNodeEnd",value:function(){this.dispose(),this.children.forEach((function(e){e.commonTimeNode.isActive=!1,e.commonTimeNode.dispose()}))}},{key:"dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isConflictDispose=e,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(__.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(e){}this.startConds.reset(),this.endConds.reset()}},{key:"seekToEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isInfiniteRepeat()){!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();var r=this.json.autoRev||e;if(r?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(e){return e.seekToEnd(r,t)}));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach((function(e){return e.commonTimeNode.seekToEnd(r,t)})),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach((function(e){return e.commonTimeNode.seekToEnd(!1)})),this.clearSubList())}}},{key:"isTimeNodeEndWhenDetectEndSync",value:function(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"isTimeNodeEnd",value:function(){var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEnd()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"emitEndEvents",value:function(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit("time ".concat(this.json.id," end")),this.eventHubs.global.emit("time ".concat(this.json.id," onEnd")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," end")),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}},{key:"collectStartValue",value:function(){this.emit("timeNodeCreate"),this.children.forEach((function(e){return e.commonTimeNode.collectStartValue()}))}},{key:"destroy",value:function(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach((function(e){return e.commonTimeNode.destroy()})),this.clearSubList()}}]),r}(Ks.a),r_=function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r),(n=t.call(this)).isRunning=!1,n.runtimeNodeEventHub=new Ks.a;var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,c=e.eventHub,h=e.iterateIndex,d=e.iterateId,f=e.isInInteractiveSeq,p=e.fromSeqId;return n.id=i.ctn.id,n.json=i,n.ctx=l,n.isIterate=a,n.globalEventHub=c,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:c,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:h,iterateId:d,isInInteractiveSeq:f,fromSeqId:p}),n.commonTimeNode.on("timeNodeStart",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.setReverse(n.commonTimeNode.getReverse()),e.commonTimeNode.startTimeNode()})),n.isRunning||(n.isRunning=!0,n.globalEventHub.emit("runtime ".concat(n.id," begin")),n.emit("begin"))})),n.commonTimeNode.on("timeNodeRepeat",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.startTimeNode(!1)}))})),n.commonTimeNode.on("timeNodeEnd",(function(){n.commonTimeNode.isTimeNodeEnd()&&n.isRunning&&(n.isRunning=!1,n.globalEventHub.emit("runtime ".concat(n.id," end")),n.emit("end")),"exit"===n.commonTimeNode.json.presetClass&&n.commonTimeNode.children.length>=1&&n.commonTimeNode.children[n.commonTimeNode.children.length-1]instanceof iy&&n.commonTimeNode.children.forEach((function(e){e instanceof iy||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),n}return r}(Ks.a),n_=function(){function e(t,r,n){x(this,e),this.json=t,this.ctx=n,this.globalEventHub=r;var i=t.timeNodeList.find((function(e){return"par"===e.type&&"tmRoot"===e.ctn.nodeType}));i&&(this.tmRoot=new r_({json:i,isSub:!1,isIterate:!1,eventHub:r,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"mainSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))}return S(e,[{key:"findSeq",value:function(e){var t;return null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.find((function(t){var r,n,i;return"seq"===(null===(r=t.json)||void 0===r?void 0:r.type)&&(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.id)===e}))}},{key:"start",value:function(){var e,t;return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.json.autoPlayMainSeq){r.next=6;break}return r.next=3,this.ctx.clock.delay(16);case 3:null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode(),r.next=7;break;case 6:null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode();case 7:case"end":return r.stop()}}),r,this)})))}},{key:"setMainSeqApplied",value:function(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}},{key:"collectMainSeqStartValue",value:function(){var e;null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.collectStartValue()}},{key:"setMainSeqStep",value:function(e,t){var r;-1===e&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(r=this.mainSeq)||void 0===r||r.setCurrentStep(e,t)}},{key:"destroy",value:function(){var e;this.globalEventHub.removeAllListeners(),null===(e=this.tmRoot)||void 0===e||e.commonTimeNode.destroy()}},{key:"hasMainSeq",value:function(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}},{key:"currentMainSeqState",value:function(){return this.mainSeq?this.mainSeq.currentState:null}},{key:"currentMainSeqStep",value:function(){return this.mainSeq?this.mainSeq.currentStep:0}},{key:"currentMainSeqLength",value:function(){return this.mainSeq?this.mainSeq.stepLength:0}},{key:"mainSeqHasNextStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasNext()}},{key:"mainSeqHasPrevStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasPrev()}},{key:"seekInteractiveSeqToEnd",value:function(e){var t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n=this.findSeq(e);n&&n.setCurrentStep(t,r)}},{key:"resetAllInteractiveSeq",value:function(){var e;((null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.filter((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"interactiveSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))||[]).forEach((function(e){e.setCurrentStep(0,"start")}))}},{key:"applyInteractiveAction",value:function(e){this.globalEventHub.emit(e)}}]),e}(),i_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o_=function(e){p(r,e);var t=g(r);function r(e,n,i,o){var a;x(this,r),(a=t.call(this,{id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},n,{parentGlobalPos:i},o)).isRendered=!1,a.isTimingStartValueCollected=!1,a.json=e,a.json.smartArtShapeList&&(n.smartArtShapeList=a.json.smartArtShapeList),n.hasBackgroundFillShape=a.detectUseBackgroundFill(a.json),a.container.visible=!1,a.ctx=n;var s=new Nd;return s.beginFill(16777215),s.drawRect(0,0,e.width,e.height),s.endFill(),a.container.addChild(s),a}return S(r,[{key:"detectUseBackgroundFill",value:function(e){var t=this;return!!e&&("Picture"===e.type||"Shape"===e.type?e.useBgFill:!(!e.children||!Array.isArray(e.children))&&e.children.some((function(e){return t.detectUseBackgroundFill(e)})))}},{key:"initOnReuse",value:function(){var e=this;f(b(r.prototype),"initOnReuse",this).call(this),this.ctx.timingEventHub.on("c:prev slide",(function(t){e.ctx.eventHub.emit(__.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,r){e.ctx.eventHub.emit(__.requestNextSlide,t,r)}))}},{key:"applyEffectCacheAsBitMap",value:function(e){this.children.forEach((function(t){return t.applyEffectCacheAsBitMap(e)}))}},{key:"render",value:function(e){var t=this;this.isRendered||(this.collectAnimatedIds().forEach((function(e){return t.ctx.animatedIds.add(e)})),this.isRendered=!0,f(b(r.prototype),"render",this).call(this,e),e.addSubMTask((function(){return i_(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.eventHub.emit("StageRenderEnd");case 1:case"end":return e.stop()}}),e,this)})))}),"@StageImpl[emit.StageRenderEnd]"))}},{key:"isListTimeNode",value:function(e){return["excel","seq","par"].indexOf(e.type)>=0}},{key:"isAnimatedTimeNode",value:function(e){return!!e.cBhvr}},{key:"collectAnimatedIdsForTimeNode",value:function(e,t){var r,n=this;this.isListTimeNode(e)?null===(r=e.ctn.childTnLst)||void 0===r||r.forEach((function(e){n.collectAnimatedIdsForTimeNode(e,t)})):this.isAnimatedTimeNode(e)&&t.push(e.cBhvr.target.id)}},{key:"collectAnimatedIds",value:function(){var e=this,t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach((function(r){e.collectAnimatedIdsForTimeNode(r,t)})),t}},{key:"createTiming",value:function(){this.json.timing&&!this.timing&&(this.timing=new n_(this.json.timing,this.ctx.timingEventHub,this.ctx))}},{key:"startTiming",value:function(){var e;return(null===(e=this.timing)||void 0===e?void 0:e.start())||Promise.resolve()}},{key:"setMainSeqApplied",value:function(){var e;null===(e=this.timing)||void 0===e||e.setMainSeqApplied()}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.timing)||void 0===r||r.setMainSeqStep(e,t)}},{key:"collectMainSeqStartValue",value:function(){var e;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(e=this.timing)||void 0===e||e.collectMainSeqStartValue())}},{key:"hasTiming",value:function(){return!!this.timing}},{key:"clearOnSlideChange",value:function(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),f(b(r.prototype),"clearOnSlideChange",this).call(this)}},{key:"clearOnTransactionEnd",value:function(){var e,t;this.ctx.timingTargets.getTargets().forEach((function(e){e.hasPreset=!1})),null===(e=this.timing)||void 0===e||e.resetAllInteractiveSeq(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0}},{key:"destroy",value:function(){var e,t;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(e=this.ctx.bgTexture)||void 0===e||e.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0,f(b(r.prototype),"destroy",this).call(this)}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqStep())&&void 0!==t?t:0}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"mainSeqState",value:function(){return this.timing?this.timing.currentMainSeqState():null}},{key:"nextStep",value:function(e,t){var r;this.hasTiming()&&(null===(r=this.timing)||void 0===r?void 0:r.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",e,t)):this.ctx.eventHub.emit(__.requestNextSlide,e,t)}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hasTiming()&&(null===(e=this.timing)||void 0===e?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(__.requestPrevSlide,t)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.timing)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.timing)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.timing)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){return i_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=this.ctx.medias[e],n.t0=i,!n.t0){n.next=21;break}if(!t){n.next=18;break}if(!r){n.next=14;break}return n.next=7,dv((function(){return i.clippedDuration>0}),5e3);case 7:if(n.t1=r=0&&t.tasks.splice(r,1)})),e.once("task-error",(function(){var r=t.tasks.indexOf(e);r>=0&&t.tasks.splice(r,1)}))}},{key:"start",value:function(){this.couldRunning=!0}},{key:"stop",value:function(){this.couldRunning=!1}}]),e}(),s_=function(e){return new Promise((function(t){return setTimeout(t,e)}))},u_=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).slideIndex=e,o.taskId=n,o.logger=i,o.uuid=uv(),o.isCancel=!1,o.tasks=[],o}return S(r,[{key:"isEmpty",value:function(){return 0===this.tasks.length}},{key:"addMTask",value:function(e,t){this.tasks.push({fn:e,state:"wait",sub:[],name:t})}},{key:"addSubMTask",value:function(e,t){var r=this.tasks.findIndex((function(e){return"running"===e.state}));r<0&&(r=0),this.tasks[r].sub.push({fn:e,state:"wait",sub:[],name:t})}},{key:"cancel",value:function(){this.tasks=[],this.isCancel=!0}},{key:"applyNext",value:function(){var e=this;if(!this.tasks.some((function(e){return"running"===e.state}))&&!this.tasks.some((function(e){return"error"===e.state})))if(this.tasks.every((function(e){return"finish"===e.state})))this.isCancel||this.emit("task-finish");else{var t=this.tasks.find((function(e){return"wait"===e.state}));t&&(t.state="running",t.fn.apply(null).then((function(){if(t.state="finish",t.sub.length>0){var r,n=e.tasks.findIndex((function(e){return e===t}));(r=e.tasks).splice.apply(r,[n+1,0].concat(a(t.sub)))}})).catch((function(r){t.state="error",e.logger.error("".concat(r," ").concat(r.stack),e.taskId),e.emit("task-error",nv.transform(r),e.slideIndex)})))}}},{key:"applyAll",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.tasks.every((function(e){return"finish"===e.state}))){e.next=14;break}if(!this.tasks.some((function(e){return"running"===e.state}))){e.next=6;break}return e.next=4,s_(16);case 4:e.next=12;break;case 6:if(!this.tasks.some((function(e){return"error"===e.state}))){e.next=8;break}return e.abrupt("return");case 8:return e.delegateYield(regeneratorRuntime.mark((function e(){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.tasks.find((function(e){return"wait"===e.state})))){e.next=17;break}return r.state="running",e.prev=3,e.next=6,hv((function(){return r.fn.apply(null)}),6e4);case 6:if(e.t0=e.sent,e.t1=lv,e.t0!==e.t1){e.next=10;break}throw new nv(Zp.RuntimeError,"subtask ".concat(r.name," apply timeout"));case 10:r.state="finish",r.sub.length>0&&(i=t.tasks.findIndex((function(e){return e===r})),(n=t.tasks).splice.apply(n,[i+1,0].concat(a(r.sub)))),e.next=17;break;case 13:return e.prev=13,e.t2=e.catch(3),o=(null==e.t2?void 0:e.t2.errorType)?e.t2:new nv(Zp.RuntimeError,"subtask ".concat(r.name," error. ").concat(e.t2)),r.state="error",t.logger.error("".concat(e.t2," ").concat(e.t2.stack),t.taskId),t.emit("task-error",nv.transform(o),t.slideIndex),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,13]])}))(),"t0",9);case 9:if("break"!==e.t0){e.next=12;break}return e.abrupt("break",14);case 12:e.next=0;break;case 14:!this.isCancel&&this.tasks.every((function(e){return"finish"===e.state}))&&this.emit("task-finish");case 15:case"end":return e.stop()}}),e,this)})))}}]),r}(Ks.a),l_=function(){function e(t,r){var n=this;x(this,e),this.renderer=t,this.localStorage=r,this.worker=null,this.outputData=new Map,this.loadingSdfKeys=new Set;var i=new Blob(['\nself.onmessage = function(e) {\n var data = e.data.data;\n var key = e.data.key;\n var height = Math.ceil(e.data.height);\n var width = Math.ceil(e.data.width);\n if (!data || !key) {\n return;\n }\n var maxDis = 0;\n var d = [];\n var p = [];\n var maxInt = Number.MAX_SAFE_INTEGER || 255 * 255 * 255;\n var setD = function(x, y, v) { d[y * width + x] = v; };\n var getD = function(x, y) { return d[y * width + x]; };\n var setP = function(x, y, v) { p[y * width + x] = v; };\n var getP = function(x, y) { return p[y * width + x]; };\n var isContains = function(x, y) { return x >= 0 && x < width && y >= 0 && y < height; };\n var isInterior = function(x, y) { return data[(y * width + x) * 4 + 3] > 10; };\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var c = isInterior(x, y);\n var t = isContains(x, y - 1) ? isInterior(x, y - 1) : false;\n var b = isContains(x, y + 1) ? isInterior(x, y + 1) : false;\n var l = isContains(x - 1, y) ? isInterior(x - 1, y) : false;\n var r = isContains(x + 1, y) ? isInterior(x + 1, y) : false;\n if (c !== t || c !== b || c !== l || c !== r) {\n setD(x, y, 0);\n setP(x, y, [x, y]);\n } else {\n setD(x, y, maxInt);\n setP(x, y, [-1, -1]);\n }\n }\n }\n \n var f = function (x, y, dir) {\n var d1 = 1;\n var d2 = Math.sqrt(2);\n var dx;\n var dy;\n var od;\n switch (dir) {\n case "TL": dx = -1; dy = -1; od = d2; break;\n case "T": dx = 0; dy = -1; od = d1; break;\n case "TR": dx = 1; dy = -1; od = d2; break;\n case "L": dx = -1; dy = 0; od = d1; break;\n case "R": dx = 1; dy = 0; od = d1; break;\n case "BL": dx = -1; dy = 1; od = d2; break;\n case "B": dx = 0; dy = 1; od = d1; break;\n case "BR": dx = 1; dy = 1; od = d2; break;\n }\n var b = isContains(x + dx, y + dy);\n var cb = b ? getD(x + dx, y + dy) : maxInt;\n if (cb + od < getD(x, y)) {\n var p = b ? getP(x + dx, y + dy) : [-1, -1];\n var dis = Math.sqrt(Math.pow(x - p[0], 2) + Math.pow(y - p[1], 2));\n setP(x, y, p);\n setD(x, y, dis);\n if (dis > maxDis) {\n maxDis = dis;\n }\n }\n };\n \n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var dirs = ["TL", "T", "TR", "L"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n for (var y = height - 1; y >= 0; -- y) {\n for (var x = width - 1; x >= 0; -- x) {\n var dirs = ["R", "BL", "B", "BR"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n var outputData = [];\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n outputData.push(isInterior(x, y) ? 255: 0);\n outputData.push(0);\n outputData.push(0);\n outputData.push(Math.ceil(getD(x, y) / maxDis * 255));\n }\n }\n self.postMessage({\n key, outputData, maxDis\n });\n};\n'],{type:"text/javascript"});this.worker=new Worker(URL.createObjectURL(i)),this.worker.onmessage=function(e){n.outputData.set(e.data.key,{data:e.data.outputData,maxDis:e.data.maxDis})},this.outputData.set("111","222")}return S(e,[{key:"createSdfByWorker",value:function(e,t,r,n,i,o,a,s){var u=document.createElement("canvas");u.width=i,u.height=o;var l=u.getContext("2d");if(l&&this.worker){l.drawImage(a,e,t,r,n);var c=l.getImageData(0,0,i,o).data;this.worker.postMessage({data:c,key:s,width:i,height:o})}}},{key:"createSdf",value:function(e,t,r){var n=document.createElement("canvas");n.width=e,n.height=t;var i=n.getContext("2d");if(!i)return{src:"",maxDis:1};i.drawImage(r,0,0);for(var o=0,a=i.getImageData(0,0,e,t).data,s=[],u=[],l=function(t,r,n){s[r*e+t]=n},c=function(t,r){return s[r*e+t]},h=function(t,r,n){u[r*e+t]=n},d=function(r,n){return r>=0&&r=0&&n10},p=0;po&&(o=g)}},w=0;w=0;--k)for(var E=e-1;E>=0;--E)for(var I=0,A=["R","BL","B","BR"];It.maxResolution.x||s>t.maxResolution.y){var n=(r=t.maxResolution.x/a)*s;n>t.maxResolution.y&&(r*=t.maxResolution.y/n)}return o.loadSpriteSheetItem(t.url,t.taskId,e,r)}),"@StagePool[spriteTexture.loadSpriteSheetItem]")})),Promise.resolve()}),"@StagePool[loadSpriteSheets]")}},{key:"createStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){var n=t.stageJsons[e],i=t.stageCtxs[e],o=new o_(n,i,{x:0,y:0},r);return t.stageImpls[e]=o,Promise.resolve()}),"@StagePool[createStage]")}},{key:"preRenderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return t.stageImpls[e].preRender(r),Promise.resolve()}),"@StagePool[preRenderStage]")}},{key:"createGraphicsTexture",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(n=this.stageCtxs[e]).graphicsTexture.pack().forEach((function(e,t){r.addSubMTask((function(){return n.graphicsTexture.render(e,t,i.objPoolGroup,1)}),"@StagePool[graphicsTexture.render]")}));case 2:case"end":return t.stop()}}),t,this)})))}),"@StagePool[createGraphicsTexture]")}},{key:"renderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.stageImpls[e],t.next=3,n.render(r);case 3:case"end":return t.stop()}}),t,this)})))}),"@StagePool[renderStage]")}},{key:"destroyStageByIndex",value:function(e){"load"===this.stageStates[e].state&&this.stageStates[e].task.cancel(),delete this.stageStates[e],this.stageImpls[e].destroy(),delete this.stageImpls[e],delete this.stageCtxs[e]}},{key:"destroyStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);Math.abs(e.currentStageIndex-r)>e.cacheCount&&e.destroyStageByIndex(r)}))}},{key:"destroyAllStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);e.destroyStageByIndex(r)}))}},{key:"preload",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stageImpls[e]||this.stageStates[e])return Promise.resolve();var n=new u_(e,this.taskId,this.logger);return n.on("task-error",(function(e,r){delete t.stageStates[r],delete t.stageImpls[r],delete t.stageCtxs[r],t.errorChannel.emit("error",e,r)})),this.stageStates[e]={state:"load",task:n},this.createCtx(e),this.loadStageJson(e),this.loadSpriteSheets(e),this.createStage(e),this.preRenderStage(e),this.createGraphicsTexture(e),this.renderStage(e),this.microTaskManager.addTask(n),r?n.applyAll():new Promise((function(r){n.once("task-finish",(function(){t.stageStates[e].state="finish",Object.keys(t.stageStates).length>2*t.cacheCount+1&&t.destroyStage(),r()}))}))}},{key:"getStageJson",value:function(e){return this.stageJsons[e]||null}},{key:"getStage",value:function(e){return c_(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.currentStageIndex=e,"finish"!==(null==(r=this.stageStates[e])?void 0:r.state)||!this.stageImpls[e]){t.next=6;break}t.t0=this.stageImpls[e],t.next=16;break;case 6:if("load"!==(null==r?void 0:r.state)){t.next=12;break}return t.next=9,r.task.applyAll();case 9:t.t1=this.stageImpls[e],t.next=15;break;case 12:return t.next=14,this.preload(e,!0);case 14:t.t1=this.stageImpls[e];case 15:t.t0=t.t1;case 16:return t.abrupt("return",t.t0);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"destroy",value:function(){this.runningAudio.clear(),this.sdfManager.destroy()}}]),e}(),d_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},f_=function(){function e(t){var r,n=this;x(this,e),this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,null===(r=e.localCache)||void 0===r||r.ready((function(e){e||(n.isIndexDBReady=!0)})).catch((function(){t.warn("local storage not ready",n.taskId)}))}return S(e,[{key:"attachTaskId",value:function(e){this.taskId=e}},{key:"getItem",value:function(t){return d_(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null,!this.couldUseIndexDBCache||!e.localCache){r.next=10;break}return r.prev=2,r.next=5,hv((function(){return e.localCache.getItem("".concat(i.taskId,"/").concat(t))}),500);case 5:n=r.sent,r.next=10;break;case 8:r.prev=8,r.t0=r.catch(2);case 10:return r.abrupt("return",(n=n===lv?null:n)||this.memoryCache.get(t)||null);case 11:case"end":return r.stop()}}),r,this,[[2,8]])})))}},{key:"setItem",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return d_(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(this.couldUseIndexDBCache){i.next=2;break}return i.abrupt("return",(n&&this.memoryCache.set(t,r),Promise.resolve()));case 2:if(!e.localCache){i.next=13;break}return o=null,i.prev=4,i.next=7,hv((function(){return e.localCache.setItem("".concat(a.taskId,"/").concat(t),r).catch((function(){n&&a.memoryCache.set(t,r)}))}),500);case 7:o=i.sent,i.next=12;break;case 10:i.prev=10,i.t0=i.catch(4);case 12:o!==lv&&null!==o||!n||this.memoryCache.set(t,r);case 13:case"end":return i.stop()}}),i,this,[[4,10]])})))}},{key:"dispose",value:function(){var t,r=this;this.memoryCache=new Map,this.couldUseIndexDBCache&&(null===(t=e.localCache)||void 0===t||t.keys().then((function(t){t.filter((function(e){return e.indexOf(r.taskId)>=0})).forEach((function(t){var r;null===(r=e.localCache)||void 0===r||r.removeItem(t).catch((function(){}))}))})).catch((function(){})))}},{key:"couldUseIndexDBCache",get:function(){return this.isIndexDBReady&&this.taskId.length>0}}]),e}();f_.localCache=null;try{f_.localCache=_.createInstance({name:"slide_local_cache",driver:_.INDEXEDDB,version:1})}catch(u){}var p_=new jl.j,v_=function(){function e(t){x(this,e),this.localStorage=t}return S(e,[{key:"canvas",value:function(t,r,n,i){var o,a,s,u=!1,l=!1;t&&(t instanceof $l.p?s=t:(s=r.generateTexture(t),l=!0)),s?(o=s.baseTexture.resolution,a=s.frame,u=!1,r.renderTexture.bind(s)):(o=r.resolution,u=!0,(a=p_).width=r.width,a.height=r.height,r.renderTexture.bind(null));var c=Math.floor(a.width*o+1e-4),h=Math.floor(a.height*o+1e-4),d=document.createElement("canvas");d.width=c,d.height=h;var f=d.getContext("2d");if(!f)throw new Error("ctx");if(n)f.putImageData(n,0,0);else{var p=f.getImageData(0,0,c,h),v=new Uint8Array(4*c*h),g=r.gl;g.readPixels(a.x*o,a.y*o,c,h,g.RGBA,g.UNSIGNED_BYTE,v),e.arrayPostDivide(v,p.data),f.putImageData(p,0,0),i&&this.localStorage.setItem(i,p).catch((function(){}))}if(u){var m=document.createElement("canvas");m.width=c,m.height=h;var y=m.getContext("2d");y.scale(1,-1),y.drawImage(d,0,-h),d=m}return l&&(null==s||s.destroy(!0)),d}}],[{key:"arrayPostDivide",value:function(e,t){for(var r=0;r1&&(e=1),this._volume=e,this.emit("update",this._volume)}}]),r}(Ks.a),m_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Rl.skipHello();var y_={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip",gallery:"Gallery",switch:"Switch",prism:"Prism",doors:"Doors"},__={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",mediaStop:"mediaStop",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",requestOpenUrl:"requestOpenUrl",userInput:"userInput",fullscreenChange:"fullscreenChange",changeLocalFullscreenState:"changeLocalFullscreenState"},b_=function(e){p(r,e);var t=g(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(this,r),(n=t.call(this)).errorChannel=new Ks.a,n.transactionPlayer=null,n.isForward=!0,n.drawCall=0,n.scale=1,n._isPaused=!1,n.maxResolution=new jl.g(0,0),n.isNVIDIA=!1,n.fps=new rv,n.designWidth=0,n.designHeight=0,n.currentIndex=0,n.slideCount=0,n.runtime={drawCall:0,fps:0},n.globalEventHub=new Ks.a,n.globalVideoBackground=new Nd,n.globalVideoSprite=new Ld,n.onMousemoveTimeout=null,n.cacheFunctionMap=new Map,n.isPlayerPaused=function(){return n._isPaused},n.onWebGLLost=function(){n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost."))},n.fullscreenOnMousemove=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!0}),n.onMousemoveTimeout&&clearTimeout(n.onMousemoveTimeout),n.onMousemoveTimeout=setTimeout((function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})}),jm)},n.fullscreenOnMouseleave=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})},n.calculateFullscreenVideoPosition=function(e){var t=e.width,r=e.height,i=y(n),o=i.designWidth,a=i.designHeight,s=Math.min(o/t,a/r);return{x:(o-t*s)/2,y:(a-r*s)/2,width:t*s,height:r*s}},n.onRequestFullscreenVideo=function(e){var t=e.texture,r=e.index,i=e.targetId;if(r===n.currentIndex){n.onRequestCancelFullscreenVideo(),n.globalVideoBackground.width=n.designWidth,n.globalVideoBackground.height=n.designHeight,n.globalVideoBackground.beginFill(0,1),n.globalVideoBackground.drawRect(0,0,n.designWidth,n.designHeight),n.globalVideoBackground.endFill(),n.globalVideoBackground.interactive=!0,n.app.stage.addChild(n.globalVideoBackground);var o=n.calculateFullscreenVideoPosition(t),a=o.x,s=o.y,u=o.width,l=o.height;n.globalVideoSprite.texture=t,n.globalVideoSprite.width=u,n.globalVideoSprite.height=l,n.globalVideoSprite.position.x=a,n.globalVideoSprite.position.y=s,n.globalVideoBackground.addChild(n.globalVideoSprite),n.globalEventHub.emit("onFullscreenChange",{status:!0,targetId:i,slideIndex:n.currentIndex}),n.clearFullscreenEventListenersWithAppView();var c={handleEvent:function(){var e;null===(e=n.currentStage)||void 0===e||e.ctx.eventHub.emit(__.userInput)}};if(n.app.view.addEventListener("pointerdown",c,!1),n.cacheFunctionMap.set("pointerdown",c),Om.isDesktop()){var h={handleEvent:function(){n.fullscreenOnMouseleave({index:r,targetId:i})}};n.app.view.addEventListener("mouseout",h,!1);var d={handleEvent:function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:r,targetId:i,status:!0})}};n.app.view.addEventListener("mouseover",d,!1);var f={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("mousemove",f,!1),n.cacheFunctionMap.set("mouseover",d),n.cacheFunctionMap.set("mousemove",f),n.cacheFunctionMap.set("mouseout",h)}else{var p={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("touchstart",p,!1),n.cacheFunctionMap.set("touchstart",p)}}else t.destroy(!1)},n.onRequestCancelFullscreenVideo=function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.globalVideoSprite.texture.destroy(!1);try{n.globalVideoBackground.removeChild(n.globalVideoSprite)}catch(e){n.logger.error("removeChild error: PPTPlayer:1057",n.taskId)}try{n.app.stage.removeChild(n.globalVideoBackground)}catch(e){n.logger.error("removeChild error: PPTPlayer:1062",n.taskId)}n.globalEventHub.emit("onFullscreenChange",{status:!1,slideIndex:n.currentIndex,targetId:null===(e=n.currentStage)||void 0===e?void 0:e.ctx.latestChangeFullscreenTargetId}),n.clearFullscreenEventListenersWithAppView(),r&&n.emit(__.changeLocalFullscreenState,{status:!1,slideIndex:n.currentIndex,targetId:null===(t=n.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},n.logger=e.logger,n.tracker=e.tracker,n.mode=e.mode,n.volumeAdjuster=e.volumeAdjuster,n.localStorage=new f_(n.logger),n.cachedExtract=new v_(n.localStorage),n.config={minFPS:ru()(i.minFPS)?30:i.minFPS,maxFPS:ru()(i.maxFPS)?40:i.maxFPS,resolution:ru()(i.resolution)?1:i.resolution,autoFPS:!ru()(i.autoFPS)&&i.autoFPS,autoResolution:!ru()(i.autoResolution)&&i.autoResolution,transactionBgColor:ru()(i.transactionBgColor)?0:i.transactionBgColor,maxResolutionLevel:n.getMaxResolution(i.maxResolutionLevel),forceCanvas:!ru()(i.forceCanvas)&&i.forceCanvas,enableNvidiaDetect:!ru()(i.enableNvidiaDetect)&&i.enableNvidiaDetect},n.updateMaxResolutionLevel(n.config.maxResolutionLevel),n.loader=new vv(n.localStorage,e.useLocalCache,n.logger,n.tracker,e.resourceTimeout,e.loadDelegate,e.urlInterrupter);var o=Rl.isWebGLSupported();n.app=new Xl({antialias:!0,autoDensity:!1,backgroundColor:16777215,forceCanvas:n.config.forceCanvas||!o}),globalThis.__PIXI_APP__=n.app,n.tracker({name:"slidePlayerCreate",result:"",reason:"",payload:{webgl:o,resolution:n.config.resolution,minFPS:n.config.minFPS,maxFPS:n.config.maxFPS,maxResolutionLevel:n.config.maxResolutionLevel,forceCanvas:n.config.forceCanvas}}),n.updateConfig(n.config),n.app.ticker.maxFPS=60,n.app.ticker.minFPS=n.config.minFPS,n.app.ticker.maxFPS=n.config.maxFPS,n.app.view.style.zIndex="1",n.app.stage.sortableChildren=!0;var a=n.app.renderer;if(a.gl){var s=a.gl.drawElements,u=a.gl.getExtension("WEBGL_debug_renderer_info"),l=a.gl.getParameter(u.UNMASKED_RENDERER_WEBGL);/nvidia/i.test(l)&&n.config.enableNvidiaDetect&&(n.isNVIDIA=!0),a.gl.drawElements=function(){for(var e=arguments.length,t=new Array(e),r=0;r=t&&n.updateResolution(i)}}else if(e>n.config.maxFPS&&n.config.autoResolution){var o=n.scale*n.config.resolution,a=n.app.renderer.resolution,s=Math.min(o,a+.1);s<=n.config.resolution&&n.updateResolution(s)}})),n.app.ticker.add((function(){n.runtime.drawCall=n.drawCall,n.runtime.fps=Math.floor(n.app.ticker.minFPS),n.drawCall=0}),null,zl.c.LOW),n.clock=new gv(n.app.ticker),n.objPoolGroup=uv(),n.stagePool=new h_(n.loader,n.mode,n.app.renderer,n.app.ticker,n.app.view,n.clock,n.objPoolGroup,n.errorChannel,n.localStorage,n.logger,e.loadDelegate,e.urlInterrupter,n.isPlayerPaused,n.maxResolution,n.volumeAdjuster,n.config.forceCanvas,n.globalEventHub),n.app.view.addEventListener("webglcontextlost",n.onWebGLLost);try{n.config.forceCanvas||(n.transactionPlayer=new Ol)}catch(s){/Error creating WebGL context/.test(s.message)?n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost.")):n.errorChannel.emit("error",new nv(Zp.RuntimeWarn,s.message))}return n.globalEventHub.on("requestFullscreen",n.onRequestFullscreenVideo),n.globalEventHub.on("requestCancelFullscreen",n.onRequestCancelFullscreenVideo),n}return S(r,[{key:"getMaxResolution",value:function(e){return!ru()(e)&&Number.isInteger(e)?(e<1&&(e=1),e>4&&(e=4),e):r.platform.isAndroid()||r.platform.isIOS()?2:4}},{key:"updateMaxResolutionLevel",value:function(e){e<0&&(e=0),e>4&&(e=4);var t=[640,960,1280,1920,3200][e],r=[360,540,720,1080,1800][e];this.maxResolution.set(t,r)}},{key:"updateConfig",value:function(e){ru()(e.maxFPS)||ru()(e.minFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS,this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),ru()(e.resolution)||(this.config.resolution=e.resolution,this.updateResolution(this.scale*this.config.resolution)),ru()(e.autoFPS)||(this.config.autoFPS=e.autoFPS),ru()(e.autoResolution)||(this.config.autoResolution=e.autoResolution),ru()(e.transactionBgColor)||(this.config.transactionBgColor=e.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),ru()(e.maxResolutionLevel)||(this.config.maxResolutionLevel=e.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}},{key:"preload",value:function(e){return m_(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e<1||e>this.slideCount,t.t0){t.next=6;break}return this.logger.info("preload slide ".concat(e," begin"),this.taskId),t.next=5,this.stagePool.preload(e);case 5:this.logger.info("preload slide ".concat(e," end"),this.taskId);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setResourceData",value:function(e,t){this.logger.info("ppt player init config: "+JSON.stringify(this.config),e),this.logger.info("set resource to "+t,e),this.taskId=e,this.url=t,this.stagePool.setResourceData(e,t),this.localStorage.attachTaskId(e),this.loader.attachTaskId(e)}},{key:"setInteractive",value:function(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}},{key:"translateEvent",value:function(e,t){var r=this;t.forEach((function(t){e.on(t,(function(){for(var e,n,i,o,a=arguments.length,s=new Array(a),u=0;u0&&this.view&&p&&(g=s.json.transition,!this.isForward&&(null==p?void 0:p.json.transition)&&(g=p.json.transition),m=this.getTransactionTexture(p,this.view,null,null),this.initTransactionPlayer(g),null===(r=this.transactionPlayer)||void 0===r||r.setPrevTexture(m),v=!0),this.app.stage.addChild(s.container),this.updateResolution(this.config.resolution*this.scale),p){p.clearOnTransactionEnd();try{this.app.stage.removeChild(p.container)}catch(e){this.logger.error("removeChild error: PPTPlayer:622",this.taskId)}}if(!(s.json.transition&&s.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&v)){i.next=31;break}return i.next=24,this.getTransactionTexture(s,this.view,u,l);case 24:return y=i.sent,this.transactionPlayer.setNextTexture(y),i.next=28,this.transactionPlayer.play();case 28:if(_=this.transactionPlayer.renderer.domElement,this.view.parentElement&&_)try{this.view.parentElement.removeChild(_)}catch(e){this.logger.error("removeChild error: PPTPlayer:637",this.taskId)}null===(n=this.transactionPlayer)||void 0===n||n.dispose();case 31:if(!this.isForward){i.next=36;break}return i.next=34,s.startTiming();case 34:i.next=37;break;case 36:s.setMainSeqApplied();case 37:s.ctx.slideScopeEventHub.emit("slide-render",s.ctx.slideIndex),this.emit(__.renderEnd,e),this.emit(__.slideChange,e),s.ctx.isRendering=!1,this.preload(e+1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e+1)})),this.preload(e-1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-a,"ms"),this.taskId),this.tracker({name:"slidePageChange",reason:"",result:"",payload:{duration:Date.now()-a,from:o,to:e}});case 45:case"end":return i.stop()}}),i,this)})))}},{key:"getTransactionTexture",value:function(e,t,r,n){var i=$l.p.create({width:e.json.width,height:e.json.height,resolution:1});this.app.renderer.render(e.container,{renderTexture:i});var o=this.cachedExtract.canvas(i,this.app.renderer,n,r);return new W(o)}},{key:"renderToBase64",value:function(e,t,r){return m_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.stagePool.getStage(e);case 2:if(!(i=n.sent)){n.next=10;break}return o=i.json,a=o.width,s=o.height,this.designWidth=a,this.designHeight=s,u=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:u}),l=this.app.renderer.plugins.extract.base64(u,r),n.abrupt("return",(this.stagePool.destroyStageByIndex(e),l));case 10:return n.abrupt("return","__null__");case 11:case"end":return n.stop()}}),n,this)})))}},{key:"renderMainSeqToBase64",value:function(e,t,r){return m_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l,c,h,d,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=[],n.next=3,this.stagePool.getStage(e);case 3:if((o=n.sent).createTiming(),o)for(a=o.json,s=a.width,u=a.height,this.designWidth=s,this.designHeight=u,l=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),o.container.visible=!0,c=o.mainSeqLength(),o.setMainSeqStep(0,"start"),this.app.renderer.render(o.container,{renderTexture:l}),h=this.app.renderer.plugins.extract.base64(l,r),i.push(h),d=0;dr.maxResolution.x||n*r.designHeight>r.maxResolution.y;)n-=.1;r.app.renderer.resolution=n,r.app.renderer.plugins.interaction.resolution=r.app.renderer.resolution,r.app.renderer.resize(r.designWidth,r.designHeight),eu()(t)&&t()}))}},{key:"nextStep",value:function(e,t){var r;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(r=this.currentStage)||void 0===r||r.nextStep(e,t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(e=this.currentStage)||void 0===e||e.prevStep(t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqStep())&&void 0!==t?t:0}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMainSeqStep(e,t)}},{key:"mainSeqState",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqState())&&void 0!==t?t:null}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"nextTick",value:function(e){this.app.ticker.addOnce((function(){e()}),zl.c.LOW)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.currentStage)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){var n;return m_(this,void 0,void 0,regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(n=this.currentStage)||void 0===n?void 0:n.setMediaState(e,t,r);case 2:case"end":return i.stop()}}),i,this)})))}},{key:"setMediaCurrentTime",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMediaCurrentTime(e,t)}},{key:"pause",value:function(){var e;this.app.ticker.stop(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalPause()})),this._isPaused=!0}},{key:"resume",value:function(){var e;this._isPaused=!1,this.app.ticker.start(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalResume()}))}},{key:"getSnapshot",value:function(){return this.currentStage&&this.getBase64(this.currentStage)||""}},{key:"clearLocalCache",value:function(){this.localStorage.dispose()}},{key:"clearFullscreenEventListenersWithAppView",value:function(){var e=this;["mousemove","mouseout","mouseover","touchstart","pointerdown"].forEach((function(t){e.cacheFunctionMap.has(t)&&(e.app.view.removeEventListener(t,e.cacheFunctionMap.get(t),!1),e.cacheFunctionMap.delete(t))}))}},{key:"syncFullscreenVideoState",value:function(e){this.globalEventHub.emit("syncFullscreenVideoState",e)}},{key:"destroy",value:function(){var e;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost),this.app.renderer.filter.texturePool.clear(!0),Ev.collectObjectByGroup(this.objPoolGroup),Iv.collectObjectByGroup(this.objPoolGroup),null===(e=this.transactionPlayer)||void 0===e||e.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy(),this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext(),this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),this.tracker({name:"slidePlayerDestroy",result:"",reason:"",payload:{}})}catch(e){}}},{key:"view",get:function(){return this.app.renderer?this.app.view:null}},{key:"nextSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}},{key:"prevSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}}],[{key:"clearLocalCache",value:function(){var e;null===(e=f_.localCache)||void 0===e||e.clear().catch((function(){}))}}]),r}(Ks.a);b_.platform=Om,b_.RtcAudioClazz=null;var x_,w_=new Map,S_=r(136),T_=r.n(S_),M_=r(24),k_=r.n(M_),E_=r(50),I_=r.n(E_),A_=[],C_="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(x_||(x_={}));var P_,N_=function(e){return Object.freeze(e)},O_=function(e,t){this.inlineSize=e,this.blockSize=t,N_(this)},R_=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,N_(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),D_=function(e){return e instanceof SVGElement&&"getBBox"in e},L_=function(e){if(D_(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},j_=function(e){var t;if(e instanceof Element)return!0;var r=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},z_="undefined"!=typeof window?window:{},B_=new WeakMap,F_=/auto|scroll/,U_=/^tb|vertical/,W_=/msie|trident/i.test(z_.navigator&&z_.navigator.userAgent),G_=function(e){return parseFloat(e||"0")},V_=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new O_((r?t:e)||0,(r?e:t)||0)},H_=N_({devicePixelContentBoxSize:V_(),borderBoxSize:V_(),contentBoxSize:V_(),contentRect:new R_(0,0,0,0)}),Y_=function(e,t){if(void 0===t&&(t=!1),B_.has(e)&&!t)return B_.get(e);if(L_(e))return B_.set(e,H_),H_;var r=getComputedStyle(e),n=D_(e)&&e.ownerSVGElement&&e.getBBox(),i=!W_&&"border-box"===r.boxSizing,o=U_.test(r.writingMode||""),a=!n&&F_.test(r.overflowY||""),s=!n&&F_.test(r.overflowX||""),u=n?0:G_(r.paddingTop),l=n?0:G_(r.paddingRight),c=n?0:G_(r.paddingBottom),h=n?0:G_(r.paddingLeft),d=n?0:G_(r.borderTopWidth),f=n?0:G_(r.borderRightWidth),p=n?0:G_(r.borderBottomWidth),v=h+l,g=u+c,m=(n?0:G_(r.borderLeftWidth))+f,y=d+p,_=s?e.offsetHeight-y-e.clientHeight:0,b=a?e.offsetWidth-m-e.clientWidth:0,x=i?v+m:0,w=i?g+y:0,S=n?n.width:G_(r.width)-x-b,T=n?n.height:G_(r.height)-w-_,M=S+v+b+m,k=T+g+_+y,E=N_({devicePixelContentBoxSize:V_(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:V_(M,k,o),contentBoxSize:V_(S,T,o),contentRect:new R_(h,u,S,T)});return B_.set(e,E),E},$_=function(e,t,r){var n=Y_(e,r),i=n.borderBoxSize,o=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(t){case x_.DEVICE_PIXEL_CONTENT_BOX:return a;case x_.BORDER_BOX:return i;default:return o}},X_=function(e){var t=Y_(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=N_([t.borderBoxSize]),this.contentBoxSize=N_([t.contentBoxSize]),this.devicePixelContentBoxSize=N_([t.devicePixelContentBoxSize])},q_=function(e){if(L_(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},Q_=function(){var e=1/0,t=[];A_.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new X_(t.target),i=q_(t.target);n.push(r),t.lastReportedSize=$_(t.target,t.observedBox),ie?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},K_=[],J_=0,eb={attributes:!0,characterData:!0,childList:!0,subtree:!0},tb=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rb=function(e){return void 0===e&&(e=0),Date.now()+e},nb=!1,ib=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!nb){nb=!0;var r,n=rb(e);r=function(){var r=!1;try{r=function(){var e,t=0;for(Z_(t);A_.some((function(e){return e.activeTargets.length>0}));)t=Q_(),Z_(t);return A_.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:C_}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=C_),window.dispatchEvent(e)),t>0}()}finally{if(nb=!1,e=n-rb(),!J_)return;r?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!P_){var t=0,r=document.createTextNode("");new MutationObserver((function(){return K_.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),P_=function(){r.textContent="".concat(t?t--:t++)}}K_.push(e),P_()}((function(){requestAnimationFrame(r)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,eb)};document.body?t():z_.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),tb.forEach((function(t){return z_.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),tb.forEach((function(t){return z_.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ob=function(e){!J_&&e>0&&ib.start(),!(J_+=e)&&ib.stop()},ab=function(){function e(e,t){this.target=e,this.observedBox=t||x_.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=$_(this.target,this.observedBox,!0);return e=this.target,D_(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),sb=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ub=new WeakMap,lb=function(e,t){for(var r=0;r=0&&(i&&A_.splice(A_.indexOf(r),1),r.observationTargets.splice(n,1),ob(-1))},e.disconnect=function(e){var t=this,r=ub.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),hb=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cb.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.unobserve(this,e)},e.prototype.disconnect=function(){cb.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),db=function(){function e(e,t,r,n,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=r,this.index=e,this.slideIndex=t,this.eventHub=n,this.id=i}return e.prototype.apply=function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var e;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(null===(r=e.tasks[i])||void 0===r||r.apply()),n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask()),e.eventHub.emit("task-end-"+t.id)})),this.eventHub.on("task-error",(function(t){var r=t.task,n=e.tasks.findIndex((function(e){return e.index===r.index}));n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask())}))}return e.prototype.replaceIdleTask=function(){for(var e,t=this,r=new Set,n=0,i=this.tasks.length;n=0;r--)t=[e[r].apply(this,t)];return t[0]}},each:function(e,t,r){if(e)if(vb&&e.forEach&&e.forEach===vb)e.forEach(t,r);else if(e.length===e.length+0){var n,i=void 0;for(i=0,n=e.length;i1?mb.toArray(arguments):arguments[0];return mb.each(yb,(function(t){if(t.litmus(e))return mb.each(t.conversions,(function(t,r){if(_b=t.read(e),!1===bb&&!1!==_b)return bb=_b,_b.conversionName=r,_b.conversion=t,mb.BREAK})),mb.BREAK})),bb},wb=void 0,Sb={hsv_to_rgb:function(e,t,r){var n=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),o=r*(1-t),a=r*(1-i*t),s=r*(1-(1-i)*t),u=[[r,s,o],[a,r,o],[o,r,s],[o,a,r],[s,o,r],[r,o,a]][n];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,r){var n=Math.min(e,t,r),i=Math.max(e,t,r),o=i-n,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=e===i?(t-r)/o:t===i?2+(r-e)/o:4+(e-t)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/i,v:i/255})},rgb_to_hex:function(e,t,r){var n=this.hex_with_component(0,2,e);return n=this.hex_with_component(n,1,t),this.hex_with_component(n,0,r)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,r){return r<<(wb=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var Wb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=n||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,mb.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=Ub(i.__impliedStep),i}return Ib(t,e),kb(t,[{key:"setValue",value:function(e){var r=e;return void 0!==this.__min&&rthis.__max&&(r=this.__max),void 0!==this.__step&&r%this.__step!=0&&(r=Math.round(r/this.__step)*this.__step),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,r)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=Ub(e),this}}]),t}(Ob),Gb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,n));i.__truncationSuspended=!1;var o=i,a=void 0;function s(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=a-e.clientY;o.setValue(o.getValue()+t*o.__impliedStep),a=e.clientY}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),jb.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);mb.isNaN(e)||o.setValue(e)})),jb.bind(i.__input,"blur",(function(){s()})),jb.bind(i.__input,"mousedown",(function(e){jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),a=e.clientY})),jb.bind(i.__input,"keydown",(function(e){13===e.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,s())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e,r,n;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),r=this.__precision,n=Math.pow(10,r),Math.round(e*n)/n),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb);function Vb(e,t,r,n,i){return n+(e-t)/(r-t)*(i-n)}var Hb=function(e){function t(e,r,n,i,o){Mb(this,t);var a=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,{min:n,max:i,step:o})),s=a;function u(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(Vb(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function c(e){var t=e.touches[0].clientX,r=s.__background.getBoundingClientRect();s.setValue(Vb(t,r.left,r.right,s.__min,s.__max))}function h(){jb.unbind(window,"touchmove",c),jb.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),jb.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),u(e)})),jb.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(jb.bind(window,"touchmove",c),jb.bind(window,"touchend",h),c(e))})),jb.addClass(a.__background,"slider"),jb.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb),Yb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===n?"Fire":n,jb.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),jb.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Ib(t,e),kb(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Ob),$b=function(e){function t(e,r){Mb(this,t);var n=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));n.__color=new Cb(n.getValue()),n.__temp=new Cb(0);var i=n;n.domElement=document.createElement("div"),jb.makeSelectable(n.domElement,!1),n.__selector=document.createElement("div"),n.__selector.className="selector",n.__saturation_field=document.createElement("div"),n.__saturation_field.className="saturation-field",n.__field_knob=document.createElement("div"),n.__field_knob.className="field-knob",n.__field_knob_border="2px solid ",n.__hue_knob=document.createElement("div"),n.__hue_knob.className="hue-knob",n.__hue_field=document.createElement("div"),n.__hue_field.className="hue-field",n.__input=document.createElement("input"),n.__input.type="text",n.__input_textShadow="0 1px 1px ",jb.bind(n.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),jb.bind(n.__input,"blur",h),jb.bind(n.__selector,"mousedown",(function(){jb.addClass(this,"drag").bind(window,"mouseup",(function(){jb.removeClass(i.__selector,"drag")}))})),jb.bind(n.__selector,"touchstart",(function(){jb.addClass(this,"drag").bind(window,"touchend",(function(){jb.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),jb.bind(window,"mousemove",f),jb.bind(window,"touchmove",f),jb.bind(window,"mouseup",l),jb.bind(window,"touchend",l)}function u(e){p(e),jb.bind(window,"mousemove",p),jb.bind(window,"touchmove",p),jb.bind(window,"mouseup",c),jb.bind(window,"touchend",c)}function l(){jb.unbind(window,"mousemove",f),jb.unbind(window,"touchmove",f),jb.unbind(window,"mouseup",l),jb.unbind(window,"touchend",l),d()}function c(){jb.unbind(window,"mousemove",p),jb.unbind(window,"touchmove",p),jb.unbind(window,"mouseup",c),jb.unbind(window,"touchend",c),d()}function h(){var e=xb(this.value);!1!==e?(i.__color.__state=e,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__saturation_field.getBoundingClientRect(),r=e.touches&&e.touches[0]||e,n=r.clientX,o=r.clientY,a=(n-t.left)/(t.right-t.left),s=1-(o-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),i.__color.v=s,i.__color.s=a,i.setValue(i.__color.toOriginal()),!1}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__hue_field.getBoundingClientRect(),r=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return r>1?r=1:r<0&&(r=0),i.__color.h=360*r,i.setValue(i.__color.toOriginal()),!1}return mb.extend(n.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),mb.extend(n.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:n.__field_knob_border+(n.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),mb.extend(n.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),mb.extend(n.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),mb.extend(a.style,{width:"100%",height:"100%",background:"none"}),qb(a,"top","rgba(0,0,0,0)","#000"),mb.extend(n.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=n.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",mb.extend(n.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:n.__input_textShadow+"rgba(0,0,0,0.7)"}),jb.bind(n.__saturation_field,"mousedown",s),jb.bind(n.__saturation_field,"touchstart",s),jb.bind(n.__field_knob,"mousedown",s),jb.bind(n.__field_knob,"touchstart",s),jb.bind(n.__hue_field,"mousedown",u),jb.bind(n.__hue_field,"touchstart",u),n.__saturation_field.appendChild(a),n.__selector.appendChild(n.__field_knob),n.__selector.appendChild(n.__saturation_field),n.__selector.appendChild(n.__hue_field),n.__hue_field.appendChild(n.__hue_knob),n.domElement.appendChild(n.__input),n.domElement.appendChild(n.__selector),n.updateDisplay(),n}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=xb(this.getValue());if(!1!==e){var t=!1;mb.each(Cb.COMPONENTS,(function(r){if(!mb.isUndefined(e[r])&&!mb.isUndefined(this.__color.__state[r])&&e[r]!==this.__color.__state[r])return t=!0,{}}),this),t&&mb.extend(this.__color.__state,e)}mb.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,n=255-r;mb.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,qb(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),mb.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+n+","+n+","+n+",.7)"})}}]),t}(Ob),Xb=["-moz-","-o-","-webkit-","-ms-",""];function qb(e,t,r,n){e.style.background="",mb.each(Xb,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+r+" 0%, "+n+" 100%); "}))}var Qb='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',Zb=function(e,t){var r=e[t];return mb.isArray(arguments[2])||mb.isObject(arguments[2])?new Bb(e,t,arguments[2]):mb.isNumber(r)?mb.isNumber(arguments[2])&&mb.isNumber(arguments[3])?mb.isNumber(arguments[4])?new Hb(e,t,arguments[2],arguments[3],arguments[4]):new Hb(e,t,arguments[2],arguments[3]):mb.isNumber(arguments[4])?new Gb(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Gb(e,t,{min:arguments[2],max:arguments[3]}):mb.isString(r)?new Fb(e,t):mb.isFunction(r)?new Yb(e,t,""):mb.isBoolean(r)?new zb(e,t):null},Kb=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},Jb=function(){function e(){Mb(this,e),this.backgroundElement=document.createElement("div"),mb.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),jb.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),mb.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;jb.bind(this.backgroundElement,"click",(function(){t.hide()}))}return kb(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),mb.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",jb.unbind(e.domElement,"webkitTransitionEnd",t),jb.unbind(e.domElement,"transitionend",t),jb.unbind(e.domElement,"oTransitionEnd",t)};jb.bind(this.domElement,"webkitTransitionEnd",t),jb.bind(this.domElement,"transitionend",t),jb.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-jb.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-jb.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var r=t||document,n=document.createElement("style");n.type="text/css",n.innerHTML=e;var i=r.getElementsByTagName("head")[0];try{i.appendChild(n)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var ex=function(){try{return!!window.localStorage}catch(e){return!1}}(),tx=void 0,rx=!0,nx=void 0,ix=!1,ox=[],ax=function e(t){var r=this,n=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),jb.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=mb.defaults(n,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),n=mb.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),mb.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),mb.isUndefined(n.parent)&&n.hideable&&ox.push(this),n.resizable=mb.isUndefined(n.parent)&&n.resizable,n.autoPlace&&mb.isUndefined(n.scrollable)&&(n.scrollable=!0);var i,o=ex&&"true"===localStorage.getItem(dx(this,"isLocal")),a=void 0,s=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return r.parent?r.getRoot().preset:n.load.preset},set:function(e){r.parent?r.getRoot().preset=e:n.load.preset=e,function(e){for(var t=0;t1){var n=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:n,factoryArgs:[mb.toArray(arguments)]})}if(mb.isArray(t)||mb.isObject(t)){var i=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:i,factoryArgs:[t]})}},name:function(e){return r.__li.firstElementChild.firstElementChild.innerHTML=e,r},listen:function(){return r.__gui.listen(r),r},remove:function(){return r.__gui.remove(r),r}}),r instanceof Hb){var n=new Gb(r.object,r.property,{min:r.__min,max:r.__max,step:r.__step});mb.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=r[e],i=n[e];r[e]=n[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(n,e),t.apply(r,e)}})),jb.addClass(t,"has-slider"),r.domElement.insertBefore(n.domElement,r.domElement.firstElementChild)}else if(r instanceof Gb){var i=function(t){if(mb.isNumber(r.__min)&&mb.isNumber(r.__max)){var n=r.__li.firstElementChild.firstElementChild.innerHTML,i=r.__gui.__listening.indexOf(r)>-1;r.remove();var o=hx(e,r.object,r.property,{before:r.__li.nextElementSibling,factoryArgs:[r.__min,r.__max,r.__step]});return o.name(n),i&&o.listen(),o}return t};r.min=mb.compose(i,r.min),r.max=mb.compose(i,r.max)}else r instanceof zb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__checkbox,"click")})),jb.bind(r.__checkbox,"click",(function(e){e.stopPropagation()}))):r instanceof Yb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__button,"click")})),jb.bind(t,"mouseover",(function(){jb.addClass(r.__button,"hover")})),jb.bind(t,"mouseout",(function(){jb.removeClass(r.__button,"hover")}))):r instanceof $b&&(jb.addClass(t,"color"),r.updateDisplay=mb.compose((function(e){return t.style.borderLeftColor=r.__color.toString(),e}),r.updateDisplay),r.updateDisplay());r.setValue=mb.compose((function(t){return e.getRoot().__preset_select&&r.isModified()&&lx(e.getRoot(),!0),t}),r.setValue)}(e,u,i),e.__controllers.push(i),i}function dx(e,t){return document.location.href+"."+t}function fx(e,t,r){var n=document.createElement("option");n.innerHTML=t,n.value=t,e.__preset_select.appendChild(n),r&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function px(e,t){t.style.display=e.useLocalStorage?"block":"none"}function vx(e){var t=e.__save_row=document.createElement("li");jb.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),jb.addClass(t,"save-row");var r=document.createElement("span");r.innerHTML=" ",jb.addClass(r,"button gears");var n=document.createElement("span");n.innerHTML="Save",jb.addClass(n,"button"),jb.addClass(n,"save");var i=document.createElement("span");i.innerHTML="New",jb.addClass(i,"button"),jb.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",jb.addClass(o,"button"),jb.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?mb.each(e.load.remembered,(function(t,r){fx(e,r,r===e.preset)})):fx(e,"Default",!1),jb.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=mx(this)),e.folders={},mb.each(this.__folders,(function(t,r){e.folders[r]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=mx(this),lx(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=mx(this,!0)),this.load.remembered[e]=mx(this),this.preset=e,fx(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){mb.each(this.__controllers,(function(t){this.getRoot().load.remembered?cx(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),mb.each(this.__folders,(function(e){e.revert(e)})),e||lx(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&Kb.call(window,(function(){e(t)})),mb.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){mb.each(this.__controllers,(function(e){e.updateDisplay()})),mb.each(this.__folders,(function(e){e.updateDisplay()}))}});var yx=ax,_x=function(){function e(e){this.player=e}return Object.defineProperty(e.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(e){this.player.updateConfig({resolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var e,t;return(null===(e=this.player.view)||void 0===e?void 0:e.width)+"*"+(null===(t=this.player.view)||void 0===t?void 0:t.height)},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(e){this.player.updateConfig({minFPS:e,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(e){this.player.updateConfig({maxFPS:e,minFPS:this.player.config.minFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(e){this.player.updateConfig({autoResolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(e){this.player.updateConfig({autoFPS:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(e){this.player.updateConfig({transactionBgColor:e})},enumerable:!1,configurable:!0}),e}(),bx=function(){function e(e,t){var r;this.config=new _x(e),this.anchor=t,r=this.createControllerGUI(),this.gui=r[0],this.controller=r[1],this.createStats()}return e.prototype.createStats=function(){var e=this;this.stateId=setInterval((function(){e.controller.frameRate.updateDisplay(),e.controller.size.updateDisplay(),e.controller.minFPS.updateDisplay(),e.controller.drawFrames.updateDisplay(),e.controller.maxFPS.updateDisplay(),e.controller.resolution.updateDisplay(),e.controller.autoFps.updateDisplay(),e.controller.autoResolution.updateDisplay(),e.controller.drawCall.updateDisplay()}),16)},e.prototype.createControllerGUI=function(){var e=new yx({autoPlace:!0,closed:!0});e.domElement.style.opacity=".6",e.domElement.style.transformOrigin="100% 0",e.domElement.style.transform="scale(1)",this.anchor.appendChild(e.domElement),e.domElement.style.position="absolute",e.domElement.style.right="0",e.domElement.style.top="0",e.domElement.style.zIndex="2";var t={frameRate:e.add(this.config,"frameRate"),drawFrames:e.add(this.config,"drawFrames"),drawCall:e.add(this.config,"drawCall"),size:e.add(this.config,"size"),minFPS:e.add(this.config,"minFPS",0,60),maxFPS:e.add(this.config,"maxFPS",0,60),resolution:e.add(this.config,"resolution",.5,8,.5),autoResolution:e.add(this.config,"autoResolution"),autoFps:e.add(this.config,"autoFPS"),transactionBgColor:e.addColor(this.config,"backgroundColor")};return[e,t]},e.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch(e){}},e}(),xx=function(){function e(e){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&t.fn(e).then((function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))},this.fn=e}return e.prototype.destroy=function(){this.isDestroy=!0},e.prototype.addTask=function(e){this.tasks.push(e),this.isScheduling||this.schedule()},e}(),wx=function(){function e(e){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=e}return e.prototype.addLock=function(e,t){var r=this;this.available&&(this.locks[e]=t,this.autoUnlock[e]=window.setTimeout((function(){delete r.locks[e]}),3e3))},e.prototype.unlock=function(e,t){this.available&&t&&this.locks[e]&&this.locks[e]===t&&(window.clearTimeout(this.autoUnlock[e]),delete this.locks[e])},e.prototype.isLocked=function(e){return!!this.available&&!!this.locks[e]},e}(),Sx=function(){function e(){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var t=e.tasks.shift();t&&!e.isDestroy&&(t.status="running",t.fn.apply(null).then((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})).catch((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})))}}return e.prototype.getRunningTask=function(){return this.tasks[0]&&"running"===this.tasks[0].status?this.tasks[0]:null},e.prototype.addTask=function(e,t){var r={type:e,status:"wait",fn:t},n=this.getRunningTask();n&&e===n.type||(this.tasks=this.tasks.filter((function(t){return t.type!==e})),this.tasks.push(r),this.isScheduling||this.schedule())},e.prototype.destroy=function(){this.isDestroy=!0},e}(),Tx=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Mx=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.config.buffer||e))return[2];t=this.logList.splice(0),r=function(){i.logList=t.concat(i.logList),i.retryTimes>3&&i.pause(),i.retryTimes+=1},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:t})})];case 2:return o.sent().ok?this.retryTimes=0:r(),[3,4];case 3:return n=o.sent(),console.warn(n),r(),[3,4];case 4:return[2]}}))}))},e.prototype.setEnable=function(e){this.enable!==e&&(e?this.start():this.pause())},e}();function Ex(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var i,o,a,s;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(r=e.replace(/^.*__internal__/,""),t=this.resourceList.find((function(e){return e.indexOf(r)>=0}))||e),this.config.urlInterrupter?[2,this.config.urlInterrupter(t)]:[2,Promise.resolve(t)]}))}))},n.userInputHandle=function(){n.userInputTime=Date.now()},n.handleViewTouchStart=function(){window.clearTimeout(n.touchStartId),n.isTouchStart=!0,n.touchStartId=setTimeout((function(){n.isTouchStart=!1}),350)},n.handleViewTouchEnd=function(){n.isTouchStart&&(n.isTouchStart=!1,n.handleViewClick())},n.handleSlideRef=function(){console.log(n),window.__slide=n},n.receiveSyncHandler=function(e){return Px(n,void 0,void 0,(function(){var t,r,n,i,o,a=this;return Nx(this,(function(s){switch(s.label){case 0:return Sv()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(Lx.syncEventLag),this._receiveIncrId=e.incrId||0),this.logger.info("sync receive "+JSON.stringify(e),this.taskId),"nextStep"!==e.type?[3,1]:(this.mainSeqStep!==e.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(e.next,"start"),this.player.nextTick((function(){a.doNextStep(!0,e.clientId||"")}))):this.doNextStep(!0,e.clientId||""),[3,6]);case 1:return"prevStep"!==e.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===e.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(e.next+1,"start"),null===(t=this.player)||void 0===t||t.nextTick((function(){a.doPrevStep(!0)}))),[3,6]);case 2:return"interactiveAnim"!==e.type?[3,3]:(this.player?this.player.applyInteractiveAction(e.action):this.__slideState.interactiveSeqState[e.seqId]?this.__slideState.interactiveSeqState[e.seqId].step+=1:this.__slideState.interactiveSeqState[e.seqId]={step:0,state:"end"},[3,6]);case 3:return"renderSlide"!==e.type?[3,5]:[4,this.doRenderSlide(e.index,e.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===e.type?(null===(r=this.player)||void 0===r||r.setMediaState(e.id,!0),this.__slideState.mediaState[e.id]=e.state):"mediaPause"===e.type?(null===(n=this.player)||void 0===n||n.setMediaState(e.id,!1),this.__slideState.mediaState[e.id]=e.state):"mediaSeek"===e.type?(null===(i=this.player)||void 0===i||i.setMediaCurrentTime(e.id,e.time),this.__slideState.mediaState[e.id]=e.state):"mediaFullscreen"===e.type&&(e.targetId&&this.__slideState.mediaState[e.targetId]?this.__slideState.mediaState[e.targetId].fullscreen=e.state:this.__slideState.mediaState[e.targetId]={fullscreen:e.state,type:"pause",time:0},null===(o=this.player)||void 0===o||o.syncFullscreenVideoState({targetId:e.targetId,state:e.state,slideIndex:e.slideIndex})),s.label=6;case 6:return[2]}}))}))},n.flushDebounce=function(){n.resizeView.flush(),n.handleViewClick.flush()},n.handlePrevSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.prevSlideIndex)>=1&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!1):this.renderSlide(t,!1)),[2]):[2]}))}))},n.handleNextSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.nextSlideIndex)<=this.slideCount&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!0):this.renderSlide(t,!0)),[2]):[2]}))}))},n.handleGotoSlide=function(e){if(e<=n.slideCount&&e>=1){var t=n.slideState.currentSlideIndex<=e;n.renderSlide(e,t)}else-1===e&&n.renderSlide(n.slideCount,!0)},t.instances.push(n),n.config=n.initSlideConfig(r),n.tracker=function(e){r.whiteTracker&&r.whiteTracker.commit({name:e.name,reason:e.reason,result:e.result,payload:Cx(Cx({},e.payload),{slideId:n.randomId,taskId:n.taskId})},{slideVersion:n.version||""})},t.trackLogger.setEnable(!!n.config.enableTracking),n.logger={info:function(e,r){var i;t.appendLogString("INFO - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"info",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.info;o&&o("["+r+"] "+e)},warn:function(e,r){var i;t.appendLogString("WARN - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"warn",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.warn;o&&o("["+r+"] "+e)},error:function(e,r){var i;t.appendLogString("ERROR - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"error",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.error;o&&o("["+r+"] "+e)}},n.logger.info("new slide with clientId: "+n.config.clientId+", version: "+n.version,n.taskId),n.tracker({name:"initSlide",result:"",reason:"",payload:{taskId:n.taskId}}),n.anchor=n.config.anchor,n.syncQueue=new xx(n.receiveSyncHandler),n.lock=new wx("interactive"===n.mode),n.cacheImage.style.position="absolute",n.cacheImage.style.zIndex="100",n.setMedianControllerAttribute(),n.canvasContainer.style.position="relative",n.canvasContainer.style.fontSize="0",n.canvasContainer.appendChild(n.medianController),n.frame.appendChild(n.canvasContainer),n.frameResizeObserver.observe(n.frame),n.on(Lx.syncReceive,(function(e){n.lock.unlock(e.type,e.uuid),n.syncQueue.addTask(e)})),n.renderingTaskManager.eventHub.on("task-error",(function(e){var t=e.error,r=e.task,i=nv.transform(t);i.errorType===Zp.RuntimeWarn?n.logger.warn(i.message,n.taskId):n.logger.error(i.message,n.taskId),n.isLoading=!1,n.reportError(i,r.slideIndex)})),window.addEventListener("__slide_ref__",n.handleSlideRef),n.resizeView=k_()(n.resizeView.bind(n),50),n.player=n.initPlayer(n.config),n.config.controller&&n.createController(),n.player.view&&n.canvasContainer.appendChild(n.player.view),n.handleViewClick=k_()(n.handleViewClick,300),n.player.errorChannel.on("error",(function(e,t){var r=nv.transform(e);r.errorType===Zp.RuntimeWarn?n.logger.warn(r.message,n.taskId):n.logger.error(r.message,n.taskId),n.isLoading=!1,n.reportError(e,t),n.tracker({name:"slideError",reason:r.errorMsg,result:"",payload:{code:r.errorType}})})),window.addEventListener("message",n.recoverHandler),t.volumeAdjuster.on("update",n._updateVolumeByStaticAdjuster),n.volumeAdjuster.volume=t.volumeAdjuster.volume,n}var r,n;return Ax(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),Px(this,void 0,void 0,(function(){return Nx(this,(function(r){switch(r.label){case 0:if(!(t._tempLog.length>131072||e&&t._tempLog.length>0))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,null==Bx?void 0:Bx.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:case 3:return r.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,r.label=5;case 5:return[2]}}))}))},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(e){return Px(this,void 0,void 0,(function(){var r,n,i,o,a;return Nx(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!Bx)return[3,13];r=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return r=(s.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return s.sent(),[3,5];case 5:n=0,i=r,s.label=6;case 6:if(!(n500&&e.enableGlobalClick&&e.nextStep()}))},t.prototype.createController=function(){this.player&&(this.playerController=new bx(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2",this.medianController.style.fontSize="16px"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var e=this.frame.getBoundingClientRect(),t=e.width,r=e.height;this.frameWidth=t,this.frameHeight=r,this.resizeView()}},t.prototype.updateFixedFrameSize=function(e,t,r){this.config.fixedFrameSize&&(this.frameWidth=e,this.frameHeight=t,this.frame.style.width=e+"px",this.frame.style.height=t+"px",this.resizeView(r))},t.prototype._resizeView=function(e){var t,r,n=this,i=this.width,o=this.height;if(i>0&&o>0){var a=this.frameWidth/i,s=a*o;s>this.frameHeight&&(a*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(a,this.resize,e),this.cacheImage.style.transform="scale("+a+")",this.medianController.style.transform="scale("+a+")",this.medianController.setAttribute("data-scale",a.toString()),this.isInitResized||(this.isInitResized=!0,null===(r=this.player)||void 0===r||r.clock.setTimeout((function(){n.frame.style.visibility="visible"}),32))}},t.prototype.setSlideState=function(e){var t,r,n;return Px(this,void 0,void 0,(function(){var i,o=this;return Nx(this,(function(a){switch(a.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,null===(t=this.player)||void 0===t||t.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,null===(r=this.player)||void 0===r||r.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,null===(n=this.player)||void 0===n?void 0:n.clock.waitUntil((function(){var t,r;return(null===(t=o.player)||void 0===t?void 0:t.currentIndex)===e.currentSlideIndex&&(null===(r=o.player)||void 0===r?void 0:r.currentStage)}),3e3)];case 3:return a.sent(),i=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(i=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(i=!0,this.__slideState.mainSeqState=e.mainSeqState),i&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),[4,Rx(1500)];case 4:return a.sent(),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),this.isSyncingSlideState=!1,[2]}}))}))},t.prototype.initInteractiveSeq=function(e){var t;for(var r in e.interactiveSeqState){var n=e.interactiveSeqState[r];null===(t=this.player)||void 0===t||t.setInteractiveSeqState(r,n.step,"idle"===n.state?"start":"end")}},t.prototype.initMedia=function(e){var t,r,n;for(var i in e.mediaState){var o=e.mediaState[i],a=this.__slideState.mediaState[i];if(null===(t=this.player)||void 0===t||t.syncFullscreenVideoState({targetId:i,state:!!o.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!a||o.type!==a.type||o.time!==a.time)if("play"===o.type){var s=(this.timestamp()-o.time)/1e3;null===(r=this.player)||void 0===r||r.setMediaState(i,!0,s)}else null===(n=this.player)||void 0===n||n.setMediaState(i,!1,o.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,t.sent().json()];case 3:return[2,[(e=t.sent()).width,e.height]];case 4:return t.sent(),[2,[0,0]];case 5:return[2]}}))}))},t.prototype.getSlideCountAsync=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,t){var r;this.taskId=e,null===(r=this.player)||void 0===r||r.setResourceData(e,t),this.__slideState.taskId=e,this.__slideState.url=t,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:t})},t.prototype.setResourceList=function(e,t){var r;this.taskId=e,this.resourceList=t,null===(r=this.player)||void 0===r||r.setResourceData(e,"__internal__"),this.__slideState.taskId=e,this.__slideState.url="__internal__"},t.prototype._renderSlide=function(e){var t;return Px(this,void 0,void 0,(function(){var r=this;return Nx(this,(function(n){switch(n.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),this.flushDebounce(),[4,null===(t=this.player)||void 0===t?void 0:t.renderSlide(e)]);case 1:return n.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout((function(){var e,t;if("hidden"===(null===(t=null===(e=r.player)||void 0===e?void 0:e.view)||void 0===t?void 0:t.style.visibility)&&(r.player.view.style.visibility="visible"),"hidden"===r.frame.style.visibility&&(r.frame.style.visibility="visible"),r.needClearCacheImage)try{r.frame.removeChild(r.cacheImage)}catch(e){r.logger.error("removeChild error Slide.ts:1553",r.taskId)}}),100),[2]}}))}))},t.prototype.renderSlide=function(e,t){if(void 0===t&&(t=!0),this.player){var r=Number(e);(r!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(r>this.slideCount&&this.slideCount>0||this.poseRenderSlide(r,t))}},t.prototype.needCreateNewPlayer=function(){var e=b_.platform.isLowGpuMemory()?15:30;return(b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,t){"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t}):"sync"===this.mode?(this.doRenderSlide(e,t),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t})):this.doRenderSlide(e,t)},t.prototype.doRenderSlide=function(e,t){var r,n,i,o=this;if(void 0===t&&(t=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var a=this.player.getSnapshot();this.cacheImage.src=a,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(r=this.playerController)||void 0===r||r.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,(null===(n=this.config)||void 0===n?void 0:n.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(i=null==this?void 0:this.player)||void 0===i?void 0:i.view)&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var s=Math.random().toString(32).substr(2);return this.player.isForward=t,this.renderingTaskManager.addTask((function(){return o._renderSlide(e)}),e,s),new Promise((function(e){o.renderingTaskManager.eventHub.once("task-end-"+s,e)}))},t.prototype.getSnapshot=function(){var e,t;return null!==(t=null===(e=this.player)||void 0===e?void 0:e.getSnapshot())&&void 0!==t?t:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(Lx.slideStepEnd),this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doNextStep=function(e,t){if(this.player){var r=!this.config.clientId||t===this.config.clientId;this.player.nextStep(e,r);var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(Lx.slideStepStart),this.player.mainSeqHasPrevStep()?"interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(e){if(void 0===e&&(e=!1),this.player){this.player.prevStep(e);var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var e=this.slideState;!T_()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(Lx.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var t=Math.random().toString(32).substr(2);this.lock.addLock(e.type,t);var r=Cx(Cx({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(r.incrId=this.dispatchIncrId),this.emit(Lx.syncDispatch,r),this.logger.info("sync dispatch "+JSON.stringify(r),this.taskId)}},t.prototype.setMainSeqStep=function(e,t){var r;null===(r=this.player)||void 0===r||r.setMainSeqStep(e,t)},t.prototype.setInteractive=function(e){var t;this.interactive=e,null===(t=this.player)||void 0===t||t.setInteractive(e)},t.prototype.pause=function(){var e;null===(e=this.player)||void 0===e||e.pause()},t.prototype.resume=function(){var e;null===(e=this.player)||void 0===e||e.resume()},t.prototype._doFrozen=function(){var e;return Px(this,void 0,void 0,(function(){var t,r,n,i=this;return Nx(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.tracker({name:"frozenSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.view&&this.player?[4,this.player.clock.waitUntil((function(){return!i.isLoading}),6e4)]:[3,2];case 1:for(r in o.sent(),t=this.player.getSnapshot()||"",this.cacheImage.src=t,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(e=this.playerController)||void 0===e||e.destroy(),this.player=void 0,this.__slideState.mediaState)n=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Cx(Cx({},n),{frozenTime:this.timestamp()});o.label=2;case 2:return[2]}}))}))},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",(function(){return e._doFrozen()}))},t.prototype._doRelease=function(){var e,t;return Px(this,void 0,void 0,(function(){var r,n,i,o;return Nx(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",this.taskId),this.tracker({name:"releaseSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.player)return[2];for(n in this.player=this.initPlayer(this.config),(null===(e=this.config)||void 0===e?void 0:e.controller)&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=I_()(jx),r.mediaState)"play"===(i=r.mediaState[n]).type&&(o=Math.max(null!==(t=i.frozenTime)&&void 0!==t?t:0,i.time),i.time=this.timestamp()-(o-i.time),i.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return a.sent(),[4,this.player.clock.delay(333)];case 2:a.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch(e){this.logger.error("removeChild error Slide.ts:1934",this.taskId)}return[2]}}))}))},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",(function(){return e._doRelease()}))},t.prototype._doDestroy=function(){var e,r,n,i,o=this;this.logger.info("do destroy slide",this.taskId),this.tracker({name:"destroySlide",reason:"",result:"",payload:{taskId:this.taskId}});var a=t.instances.findIndex((function(e){return e.randomId===o.randomId}));if(a>=0&&t.instances.splice(a,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(e=this.player)||void 0===e||e.removeAllListeners(),null===(r=this.player)||void 0===r||r.destroy(),null===(n=this.player)||void 0===n||n.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners(),null===(i=this.player)||void 0===i?void 0:i.view)try{this.anchor.removeChild(this.player.view)}catch(e){this.logger.error("removeChild error Slide.ts:1982",this.taskId)}try{this.anchor.removeChild(this.frame)}catch(e){this.logger.error("removeChild error Slide.ts:1988",this.taskId)}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,Rx(100)]:[3,3];case 2:return t.sent(),e+=1,[3,1];case 3:return[2]}}))}))},t.prototype.preload=function(e){return this.player?this.player.preload(e):Promise.resolve()},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then((function(){e._doDestroy()})):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;null===(e=this.player)||void 0===e||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,t=0===this.mainSeqLength||this.mainSeqStep>=this.mainSeqLength-1,r="end"===this.mainSeqState||"running"===this.mainSeqState||null==this.mainSeqState;return!(e&&t&&r)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=1===this.player.currentIndex,t=0===this.mainSeqLength||0===this.mainSeqStep,r="idle"===this.mainSeqState||null===this.mainSeqState;return!(e&&t&&r)},t.prototype.snapshot=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return Px(this,void 0,void 0,(function(){return Nx(this,(function(t){return this.player?[2,this.player.snapshotWithTimingEnd(e)]:[2,null]}))}))},t.prototype.updateGlobalVolume=function(e){this.volumeAdjuster.volume=e},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){b_.clearLocalCache()},t.disposeLocalCache=function(){},r=t,t.preloadResource=Ex,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(e){var r,n;e.context({logger:{info:function(e){t.appendLogString("INFO - "+(new Date).toISOString()+" - "+e+"\n")},warn:function(e){t.appendLogString("WARN - "+(new Date).toISOString()+" - "+e+"\n")},error:function(e){t.appendLogString("ERROR - "+(new Date).toISOString()+" - "+e+"\n")}}}),r=e,(n=w_.get(r.hookPoint)||[]).push(r),w_.set(r.hookPoint,n)},t.volumeAdjuster=new g_,t.trackLogger=new kx,t.handleFrozenAllSlide=function(){t.instances.forEach((function(e){e.player&&(t._tempFrozenIds.push(e.randomId),e.frozen())}))},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach((function(e){var r=t.instances.find((function(t){return t.randomId===e}));r&&r.release()})),t._tempFrozenIds=[]},t.handleLogReport=function(e){return Px(void 0,void 0,void 0,(function(){var n,i,o,a,s,u;return Nx(r,(function(r){switch(r.label){case 0:return[4,t.flushLog(!0)];case 1:if(r.sent(),!Bx)return[3,12];n=[],r.label=2;case 2:return r.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return n=(r.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return r.sent(),[3,5];case 5:if(0===n.length)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:e},"*"),[2];i=0,o=n,r.label=6;case 6:if(!(i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);o>3&&a&&Object.defineProperty(t,r,a)}([(n="Slide.initConfig",function(e,t,r){var i=r.value;r.value=function(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?U(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(B),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=z()}while(this.disposers.has(e));return e}}]),e}();function U(e){return function(){return e.forEach(B)}}function W(e,t,r){return Math.min(Math.max(e,t),r)}var G={exports:{}},V={exports:{}},H=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Y=Array.prototype.concat,$=Array.prototype.slice,X=V.exports=function(e){for(var t=[],r=0,n=e.length;r=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},ee.to.keyword=function(e){return K[e.slice(0,3)]};var ne=G.exports,ie=function(){function e(t){var r=this;x(this,e),this.enable=t,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=function(e){var t,n;e instanceof CustomEvent?t=e.detail:"object"===T(n=e.data)&&null!==n&&(t=e.data),t&&("boolean"==typeof t.slide?r.enable=t.slide:"__instance"===t.slide?console.log(r):"__debug"===t.slide&&Object.values(r.apps).forEach((function(e){var t,r;null==(r=null==(t=e.controller)?void 0:t.slide)||r.createController()})))},this.initialize()}return S(e,[{key:"setAppContext",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).context=t,this.log("[Slide] new ".concat(e))}},{key:"setAppController",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).controller=t}},{key:"deleteApp",value:function(e){delete this.apps[e],this.log("[Slide] delete ".concat(e))}},{key:"initialize",value:function(){window.addEventListener("message",this._onMessage)}},{key:"dispose",value:function(){window.removeEventListener("message",this._onMessage)}},{key:"log",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).info.apply(e,arguments);else if(this.enable){var t;(t=console).log.apply(t,arguments)}}},{key:"verbose",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).debug.apply(e,arguments);else if(this.enable&&"verbose"===this.level){var t;(t=console).log.apply(t,arguments)}}},{key:"warn",value:function(){var e,t;this.roomLogger?(e=this.roomLogger).warn.apply(e,arguments):(t=console).warn.apply(t,arguments)}}]),e}(),oe=new ie(!1),ae=oe.log.bind(oe),se=oe.verbose.bind(oe);function ue(e){try{var t=window.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"!==t&&"transparent"!==t)return t;if(e.parentElement)return ue(e.parentElement)}catch(e){}return"#ffffff"}var le="";function ce(e){return le||(le=function(e){var t=ne.get(e);if(t&&"rgb"===t.model){var r=t.value,n=(((255&Math.round(r[0]))<<16)+((255&Math.round(r[1]))<<8)+(255&Math.round(r[2]))).toString(16);return"#"+"000000".substring(n.length)+n}return e}(ue(e)),ae("[Slide] guess bg color",le)),le}var he=function(e){return e.tracker};function de(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.width,n=e.height,i=e.slideCount,o=e.slideState,a=o.taskId,s=o.url,u=[],l=function(e){var i=t.find((function(t){return t.indexOf("preview/".concat(e,".png"))>=0}));i?u.push({width:r,height:n,thumbnail:i,src:"ppt"}):u.push({width:r,height:n,thumbnail:"".concat(s,"/").concat(a,"/preview/").concat(e,".png"),src:"ppt"})},c=1;c<=i;++c)l(c);return u}function fe(e,t,r,n){var i,o=r.slideState.currentSlideIndex;if(o>0&&t.getIsWritable()){var a=[n,o].join("/");if("page"!==e.scenePathType(a)){e.removeScenes(n);for(var s=r.slideCount,u=[],l=1;l<=s;++l)u.push({name:"".concat(l)});e.putScenes(n,u)}(t.getBox().focus?e.state.sceneState.scenePath:(null==(i=t.getView())?void 0:i.focusScenePath)||"")!==a&&t.setScenePath(a)}}var pe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=pe;var ve={taskId:"",url:"",state:null,resourceList:[],previewList:[]},ge=function(){},me=function(){function e(t){var r,n=this,i=t.context,o=t.anchor,a=t.onRenderStart,s=t.onPageChanged,u=t.onTransitionStart,c=t.onTransitionEnd,h=t.onNavigate,d=t.onError,f=t.onRenderError,p=t.showRenderError,v=t.invisibleBehavior;x(this,e),this.sideEffect=new F,this.previewList=[],this.ready=!1,this.readyPromise=new Promise((function(e){n.resolveReady=function(){n.ready?ae("[Slide] render end"):setTimeout((function(){n.ready=!0,e()}),1e3)}})),this.onSyncDispatch=function(e){if(n.context.getIsWritable()&&n.room){var t={type:L.SLIDE_EVENTS.syncDispatch,payload:e};se("[Slide] dispatch",JSON.stringify(e)),n.context.dispatchMagixEvent(L.SLIDE_EVENTS.syncDispatch,t)}},this.magixEventListener=function(e){var t=e.payload,r=t.type,i=t.payload;r===L.SLIDE_EVENTS.syncDispatch&&(n.syncStateOnce(),se("[Slide] receive",JSON.stringify(i)),n.slide.emit(L.SLIDE_EVENTS.syncReceive,i))},this.onStateChange=function(e){n.context.getIsWritable()&&(se("[Slide] state change",JSON.stringify(e,null,2)),n.context.storage.setState({state:e}))},this.pollCount=0,this.pollReadyState=function(){n.ready?1===n._toFreeze?n.freeze():-1===n._toFreeze&&n.unfreeze():n.pollCount<40?(n.pollCount++,setTimeout(n.pollReadyState,500)):(n.pollCount=0,ae("[Slide] init timeout"))},this._pageCount=0,this.destroyed=!1,this.timestamp=function(){return n.room&&n.room.calibrationTimestamp?n.room.calibrationTimestamp:n.player?n.player.beginTimestamp+n.player.progressTime:Date.now()},this.isFrozen=!1,this._toFreeze=0,this.freeze=function(){n.isFrozen=!0,n.ready?(ae("[Slide] freeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.frozen():n.slide.pause()):n._toFreeze=1},this.unfreeze=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.visible){e.next=2;break}return e.abrupt("return");case 2:n.isFrozen=!1,n.ready?(ae("[Slide] unfreeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.release():n.slide.resume()):n._toFreeze=-1;case 4:case"end":return e.stop()}}),e)}))),this.onVisibilityChange=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n.visible="visible"===document.visibilityState)?(ae("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:n.savedIsFrozen}),n.savedIsFrozen||n.unfreeze()):(n.savedIsFrozen=n.isFrozen,ae("[Slide] freeze because tab becomes invisible"),n.freeze());case 1:case"end":return e.stop()}}),e)}))),this.invisibleBehavior=null!=v?v:"frozen",this.onRenderStart=a,this.onPageChanged=s,this.onTransitionStart=u,this.onTransitionEnd=c,this.onNavigate=h||ge,this.onError=d,this.onRenderError=f,this.showRenderError=null==p||p,this.context=i,this.room=i.getRoom(),this.player=this.room?void 0:i.getDisplayer(),r=this.room||this.player,oe.roomLogger=r.logger,this.slide=this.createSlide(o,{whiteTracker:he(i.getDisplayer())}),this.syncStateOnceFlag=!this.context.isAddApp,this.visible="visible"===document.visibilityState,this.savedIsFrozen=!1,this.initialize()}return S(e,[{key:"jumpToPage",value:function(e,t){this.ready&&(e=W(e,1,this.pageCount),this.onNavigate(e,t),this.slide.renderSlide(e))}},{key:"initialize",value:function(){this.registerEventListeners(),this.kickStart()}},{key:"kickStart",value:function(){var e=this.context,t=this.slide;e.getIsWritable()&&e.storage.ensureState(ve);var r=e.storage.state,n=r.taskId,i=r.url,o=r.resourceList,a=r.previewList,s=r.state;this.previewList=a,o&&o.length>0?t.setResourceList(n,o):t.setResource(n,i||pe),s?(ae("[Slide] init with state",JSON.stringify(s)),this.syncStateOnceFlag=!1,t.setSlideState(s)):e.isAddApp&&(ae("[Slide] init by renderSlide",1),t.renderSlide(1)),this.pollReadyState()}},{key:"registerEventListeners",value:function(){var e=this,t=this.context,r=this.slide,n=this.sideEffect.addDisposer(t.storage.addStateChangedListener((function(){t.storage.state.state&&(e.syncStateOnce(),e.sideEffect.flush(n))})));this.sideEffect.add((function(){return t.addMagixEventListener(L.SLIDE_EVENTS.syncDispatch,e.magixEventListener,{fireSelfEventAfterCommit:!0})})),r.on(L.SLIDE_EVENTS.renderStart,this.onRenderStart),r.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),r.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),r.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.renderError,this.onError),r.on(L.SLIDE_EVENTS.stateChange,this.onStateChange),r.on(L.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),r.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add((function(){return document.addEventListener("visibilitychange",e.onVisibilityChange),function(){return document.removeEventListener("visibilitychange",e.onVisibilityChange)}}))}},{key:"syncStateOnce",value:function(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(ve);var e=this.context.storage.state.state;e&&(ae("[Slide] sync with state (once)",JSON.stringify(e)),this.slide.setSlideState(e),this.syncStateOnceFlag=!1)}}},{key:"createSlide",value:function(e){var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.context.getAppOptions()||{},a=new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=o.enableGlobalClick)||t,renderOptions:{minFPS:o.minFPS||25,maxFPS:o.maxFPS||30,autoFPS:null==(r=o.autoFPS)||r,autoResolution:null==(n=o.autoResolution)||n,resolution:o.resolution,transactionBgColor:o.bgColor||ce(e),maxResolutionLevel:o.maxResolutionLevel,forceCanvas:o.forceCanvas,enableNvidiaDetect:o.enableNvidiaDetect},fixedFrameSize:o.fixedFrameSize,loaderDelegate:o.loaderDelegate,navigatorDelegate:o.navigatorDelegate,urlInterrupter:o.urlInterrupter,resourceTimeout:o.resourceTimeout,rtcAudio:o.rtcAudio,useLocalCache:o.useLocalCache,logger:o.logger,whiteTracker:i.whiteTracker,timestamp:this.timestamp});return a}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.destroyed||(ae("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}},{key:"pageCount",get:function(){return this._pageCount>0||(this._pageCount=this.slide.slideCount),this._pageCount}},{key:"page",get:function(){return this.slide.slideState.currentSlideIndex}}]),e}();var ye="undefined"!=typeof window,_e=ye&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),be=ye&&"IntersectionObserver"in window,xe=ye&&"classList"in document.createElement("p"),we=ye&&window.devicePixelRatio>1,Se={elements_selector:".lazy",container:_e||ye?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Te=function(e){return Object.assign({},Se,e)},Me=function(e,t){var r,n="LazyLoad::Initialized",i=new e(t);try{r=new CustomEvent(n,{detail:{instance:i}})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(n,!1,!1,{instance:i})}window.dispatchEvent(r)},ke="src",Ee="srcset",Ie="sizes",Ae="poster",Ce="llOriginalAttrs",Pe="data",Ne="loading",Oe="loaded",Re="applied",De="error",Le="native",je="data-",ze="ll-status",Be=function(e,t){return e.getAttribute(je+t)},Fe=function(e){return Be(e,ze)},Ue=function(e,t){return function(e,t,r){var n=je+t;null!==r?e.setAttribute(n,r):e.removeAttribute(n)}(e,ze,t)},We=function(e){return Ue(e,null)},Ge=function(e){return null===Fe(e)},Ve=function(e){return Fe(e)===Le},He=[Ne,Oe,Re,De],Ye=function(e,t,r,n){e&&(void 0===n?void 0===r?e(t):e(t,r):e(t,r,n))},$e=function(e,t){xe?e.classList.add(t):e.className+=(e.className?" ":"")+t},Xe=function(e,t){xe?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},qe=function(e){return e.llTempImage},Qe=function(e,t){if(t){var r=t._observer;r&&r.unobserve(e)}},Ze=function(e,t){e&&(e.loadingCount+=t)},Ke=function(e,t){e&&(e.toLoadCount=t)},Je=function(e){for(var t,r=[],n=0;t=e.children[n];n+=1)"SOURCE"===t.tagName&&r.push(t);return r},et=function(e,t){var r=e.parentNode;r&&"PICTURE"===r.tagName&&Je(r).forEach(t)},tt=function(e,t){Je(e).forEach(t)},rt=[ke],nt=[ke,Ae],it=[ke,Ee,Ie],ot=[Pe],at=function(e){return!!e[Ce]},st=function(e){return e[Ce]},ut=function(e){return delete e[Ce]},lt=function(e,t){if(!at(e)){var r={};t.forEach((function(t){r[t]=e.getAttribute(t)})),e[Ce]=r}},ct=function(e,t){if(at(e)){var r=st(e);t.forEach((function(t){!function(e,t,r){r?e.setAttribute(t,r):e.removeAttribute(t)}(e,t,r[t])}))}},ht=function(e,t,r){$e(e,t.class_applied),Ue(e,Re),r&&(t.unobserve_completed&&Qe(e,t),Ye(t.callback_applied,e,r))},dt=function(e,t,r){$e(e,t.class_loading),Ue(e,Ne),r&&(Ze(r,1),Ye(t.callback_loading,e,r))},ft=function(e,t,r){r&&e.setAttribute(t,r)},pt=function(e,t){ft(e,Ie,Be(e,t.data_sizes)),ft(e,Ee,Be(e,t.data_srcset)),ft(e,ke,Be(e,t.data_src))},vt={IMG:function(e,t){et(e,(function(e){lt(e,it),pt(e,t)})),lt(e,it),pt(e,t)},IFRAME:function(e,t){lt(e,rt),ft(e,ke,Be(e,t.data_src))},VIDEO:function(e,t){tt(e,(function(e){lt(e,rt),ft(e,ke,Be(e,t.data_src))})),lt(e,nt),ft(e,Ae,Be(e,t.data_poster)),ft(e,ke,Be(e,t.data_src)),e.load()},OBJECT:function(e,t){lt(e,ot),ft(e,Pe,Be(e,t.data_src))}},gt=["IMG","IFRAME","VIDEO","OBJECT"],mt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||Ye(e.callback_finish,t)},yt=function(e,t,r){e.addEventListener(t,r),e.llEvLisnrs[t]=r},_t=function(e,t,r){e.removeEventListener(t,r)},bt=function(e){return!!e.llEvLisnrs},xt=function(e){if(bt(e)){var t=e.llEvLisnrs;for(var r in t){var n=t[r];_t(e,r,n)}delete e.llEvLisnrs}},wt=function(e,t,r){!function(e){delete e.llTempImage}(e),Ze(r,-1),function(e){e&&(e.toLoadCount-=1)}(r),Xe(e,t.class_loading),t.unobserve_completed&&Qe(e,r)},St=function(e,t,r){var n=qe(e)||e;if(!bt(n)){!function(e,t,r){bt(e)||(e.llEvLisnrs={});var n="VIDEO"===e.tagName?"loadeddata":"load";yt(e,n,t),yt(e,"error",r)}(n,(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_loaded),Ue(t,Oe),Ye(r.callback_loaded,t,n),i||mt(r,n)}(0,e,t,r),xt(n)}),(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_error),Ue(t,De),Ye(r.callback_error,t,n),r.restore_on_error&&ct(t,it),i||mt(r,n)}(0,e,t,r),xt(n)}))}},Tt=function(e,t,r){!function(e){e.llTempImage=document.createElement("IMG")}(e),St(e,t,r),function(e){at(e)||(e[Ce]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,r){var n=Be(e,t.data_bg),i=Be(e,t.data_bg_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage='url("'.concat(o,'")'),qe(e).setAttribute(ke,o),dt(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_multi),i=Be(e,t.data_bg_multi_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage=o,ht(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_set);if(n){var i=n.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),ht(e,t,r)}}(e,t,r)},Mt=function(e,t,r){St(e,t,r),function(e,t,r){var n=vt[e.tagName];n&&(n(e,t),dt(e,t,r))}(e,t,r)},kt=function(e,t,r){!function(e){return gt.indexOf(e.tagName)>-1}(e)?Tt(e,t,r):Mt(e,t,r)},Et=function(e,t,r){e.setAttribute("loading","lazy"),St(e,t,r),function(e,t){var r=vt[e.tagName];r&&r(e,t)}(e,t),Ue(e,Le)},It=function(e){e.removeAttribute(ke),e.removeAttribute(Ee),e.removeAttribute(Ie)},At=function(e){et(e,(function(e){ct(e,it)})),ct(e,it)},Ct={IMG:At,IFRAME:function(e){ct(e,rt)},VIDEO:function(e){tt(e,(function(e){ct(e,rt)})),ct(e,nt),e.load()},OBJECT:function(e){ct(e,ot)}},Pt=function(e){var t=Ct[e.tagName];t?t(e):function(e){if(at(e)){var t=st(e);e.style.backgroundImage=t.backgroundImage}}(e)},Nt=function(e,t){Pt(e),function(e,t){Ge(e)||Ve(e)||(Xe(e,t.class_entered),Xe(e,t.class_exited),Xe(e,t.class_applied),Xe(e,t.class_loading),Xe(e,t.class_loaded),Xe(e,t.class_error))}(e,t),We(e),ut(e)},Ot=function(e,t,r,n){r.cancel_on_exit&&function(e){return Fe(e)===Ne}(e)&&"IMG"===e.tagName&&(xt(e),function(e){et(e,(function(e){It(e)})),It(e)}(e),At(e),Xe(e,r.class_loading),Ze(n,-1),We(e),Ye(r.callback_cancel,e,t,n))},Rt=function(e,t,r,n){var i=function(e){return He.indexOf(Fe(e))>=0}(e);Ue(e,"entered"),$e(e,r.class_entered),Xe(e,r.class_exited),function(e,t,r){t.unobserve_entered&&Qe(e,r)}(e,r,n),Ye(r.callback_enter,e,t,n),i||kt(e,r,n)},Dt=["IMG","IFRAME","VIDEO"],Lt=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},jt=function(e,t,r){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Rt(e.target,e,t,r):function(e,t,r,n){Ge(e)||($e(e,r.class_exited),Ot(e,t,r,n),Ye(r.callback_exit,e,t,n))}(e.target,e,t,r)}))},zt=function(e,t){be&&!Lt(e)&&(t._observer=new IntersectionObserver((function(r){jt(r,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},Bt=function(e){return Array.prototype.slice.call(e)},Ft=function(e){return e.container.querySelectorAll(e.elements_selector)},Ut=function(e){return function(e){return Fe(e)===De}(e)},Wt=function(e,t){return function(e){return Bt(e).filter(Ge)}(e||Ft(t))},Gt=function(e,t){var r;(r=Ft(e),Bt(r).filter(Ut)).forEach((function(t){Xe(t,e.class_error),We(t)})),t.update()},Vt=function(e,t){var r=Te(e);this._settings=r,this.loadingCount=0,zt(r,this),function(e,t){ye&&(t._onlineHandler=function(){Gt(e,t)},window.addEventListener("online",t._onlineHandler))}(r,this),this.update(t)};Vt.prototype={update:function(e){var t,r,n=this._settings,i=Wt(e,n);(Ke(this,i.length),!_e&&be)?Lt(n)?function(e,t,r){e.forEach((function(e){-1!==Dt.indexOf(e.tagName)&&Et(e,t,r)})),Ke(r,0)}(i,n,this):(t=this._observer,r=i,function(e){e.disconnect()}(t),function(e,t){t.forEach((function(t){e.observe(t)}))}(t,r)):this.loadAll(i)},destroy:function(){var e;this._observer&&this._observer.disconnect(),e=this,ye&&window.removeEventListener("online",e._onlineHandler),Ft(this._settings).forEach((function(e){ut(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,r=this._settings;Wt(e,r).forEach((function(e){Qe(e,t),kt(e,r,t)}))},restoreAll:function(){var e=this._settings;Ft(e).forEach((function(t){Nt(t,e)}))}},Vt.load=function(e,t){var r=Te(t);kt(e,r)},Vt.resetStatus=function(e){We(e)},ye&&function(e,t){if(t)if(t.length)for(var r,n=0;r=t[n];n+=1)Me(e,r);else Me(e,t)}(Vt,window.lazyLoadOptions);var Ht=function(){function e(t){var r=this,n=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=t.onPagesReady,s=t.urlInterrupter;x(this,e),this._pages=[],this.pageIndex=0,this.setPaused=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new F,this.readonly=n,this.onNewPageIndex=i,this.onPlay=o,this.onPagesReady=a,this.urlInterrupter=s||function(e){return e},this.render()}var t;return S(e,[{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e}},{key:"destroy",value:function(){var e;null==(e=this.previewLazyLoad)||e.destroy(),this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}},{key:"refreshTotalPage",value:function(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t,this.refreshPreview(),this.sideEffect.addEventListener(t,"click",(function(t){var r;if(!e.readonly){var n=null==(r=t.target.dataset)?void 0:r.pageIndex;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(n),"preview"),e.togglePreview(!1))}}))}return this.$preview}},{key:"refreshPreview",value:(t=l(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=this.$preview,i=this.wrapClassName("preview-page"),o=this.wrapClassName("preview-page-name");n.firstChild;)n.firstChild.remove();for(a=[],s=0,u=this.pages.length;s0?"":"none"}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer"));var r=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-sidebar")),r.setAttribute("viewBox","0 0 64 64");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(r,"click",(function(){e.readonly||e.togglePreview()})),this.$btnSidebar=r,this.$btnSidebar.style.display="none",this.$footer.appendChild(r);var n=document.createElement("div");n.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),r.appendChild(n),r}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1,"navigation")})),n.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-play")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),r.appendChild(n),r}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-pause")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),r.appendChild(n),r}(this.namespace));this.$btnPlay=o,this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(e.setPlaying(),e.onPlay&&e.onPlay())})),n.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1,"navigation")})),n.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1,"input")}));var l=document.createElement("span");this.$totalPage=l,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(n),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,r){var n=document.createElement("button");return n.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),n.appendChild(t),r&&n.appendChild(r),n}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&(this.previewLazyLoad||(this.previewLazyLoad=new Vt({container:this.$preview,elements_selector:".".concat(this.wrapClassName("preview-page>img"))})),this.$preview.scrollTo({top:t.offsetTop-16}))}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"pages",set:function(e){this._pages=e,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage(),this.onPagesReady&&this.onPagesReady(e)},get:function(){return this._pages}}]),e}(),Yt=new Set(["clicker"]),$t=function(){},Xt=function(){function e(t){var n=this,i=t.box,o=t.view,a=t.mountSlideController,s=t.mountWhiteboard,u=t.baseScenePath,c=t.appId,h=t.urlInterrupter,d=t.onPagesReady,f=t.onNavigate;x(this,e),this.slideController=null,this.isViewMounted=!1,this.onError=function(e){var t,r,i=e.error,o=e.index;n.viewer.setPaused(),(null==(t=n.slideController)?void 0:t.showRenderError)&&(n.$overlay.textContent="Error on slide[page=".concat(n.slideController.page,"]: ").concat(i.message),n.$overlay.style.opacity="1"),(null==(r=n.slideController)?void 0:r.onRenderError)&&n.slideController.onRenderError(i,o),oe.warn("[Slide] render error",i)},this.onRenderStart=function(){n.$whiteboardView.classList.add(n.wrapClassName("wb-view-hidden")),n.viewer.setPlaying()},this.onRenderEnd=function(){},this.onPageChanged=function(){clearTimeout(n._onPageChangedTimer),n._onPageChangedTimer=setTimeout(n._onPageChanged,200)},this._onPageChangedTimer=0,this._onPageChanged=function(){n.$overlay.style.opacity="",n.$whiteboardView.classList.remove(n.wrapClassName("wb-view-hidden"))},this.refreshPages=function(){n.slideController&&(n.viewer.pages=de(n.slideController.slide,n.slideController.previewList),n.viewer.setPageIndex(n.getPageIndex(n.slideController.page)),n.scaleDocsToFit())},this.scaleDocsToFit=function(){if(n.slideController){var e=n.slideController.slide,t=e.width,r=e.height;t&&r&&(n.whiteboardView.moveCameraToContain({originX:-t/2,originY:-r/2,width:t,height:r,animationMode:"immediately"}),n.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return n.whiteboardView.camera.scale},minContentMode:function(){return n.whiteboardView.camera.scale},centerX:0,centerY:0,width:t,height:r}),n.isViewMounted||(n.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),n.mountWhiteboard(n.$whiteboardView)))}},this.onPlay=function(){n.slideController&&n.slideController.slide.nextStep()},this.onNewPageIndex=function(e,t){n.slideController&&n.slideController.jumpToPage(e+1,t)},this.sideEffect=new F,this.namespace="netless-app-slide",this.toPdf=l(regeneratorRuntime.mark((function e(){var t,i,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.slideController){e.next=3;break}return n.reportProgress(100,null),e.abrupt("return");case 3:if(t=n.slideController.slide,i=1920,o=document.createElement("canvas"),a=o.getContext("2d"),s=t.slideCount,u=t.width,l=t.height,c=Math.floor(u),h=Math.floor(l),c>i&&(c=i,h=Math.floor(l*c/u)),h>i&&(h=i,c=Math.floor(u*h/l)),o.width=c,o.height=h,(d=document.createElement("canvas")).width=c,d.height=h,(f=d.getContext("2d"))&&n.getWhiteSnapshot&&a){e.next=21;break}return n.reportProgress(100,null),e.abrupt("return",null);case 21:return p=c>h?"l":"p",e.next=24,Promise.resolve().then(r.bind(r,88877));case 24:v=e.sent,g=v.jsPDF,m=new g({format:[c,h],orientation:p,compress:!0}),y=1;case 28:if(!(y<=s)){e.next=57;break}return _=null,e.prev=30,e.next=33,n.slideController.slide.snapshotWithTimingEnd(y);case 33:_=e.sent,e.next=38;break;case 36:e.prev=36,e.t0=e.catch(30);case 38:if(!_){e.next=40;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("img")).src=_,e.next=4,new Promise((function(e){return t.onload=e}));case 4:a.drawImage(t,0,0,c,h);case 5:case"end":return e.stop()}}),e)}))(),"t1",40);case 40:return f.clearRect(0,0,c,h),n.getWhiteSnapshot(y,d,f,u,l),e.prev=42,e.delegateYield(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.toDataURL("image/png"),(r=document.createElement("img")).src=t,e.next=5,new Promise((function(e){return r.onload=e}));case 5:a.drawImage(r,0,0,c,h);case 6:case"end":return e.stop()}}),e)}))(),"t2",44);case 44:e.next=48;break;case 46:e.prev=46,e.t3=e.catch(42);case 48:b=o.toDataURL("image/jpeg",.6),y>1&&m.addPage(),m.addImage(b,"JPEG",0,0,c,h,"","FAST"),a.clearRect(0,0,c,h),Math.ceil(y/s*100)<100&&n.reportProgress(Math.ceil(y/s*100),null);case 54:y++,e.next=28;break;case 57:x=m.output("arraybuffer"),w=n.box.title,n.reportProgress(100,{pdf:x,title:w});case 60:case"end":return e.stop()}}),e,null,[[30,36],[42,46]])}))),this.box=i,this.whiteboardView=o,this.mountSlideController=a,this.mountWhiteboard=s,this.onNavigate=f||$t,this.baseScenePath=u,this.appId=c,this.viewer=new Ht({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h,onPagesReady:d}),this.sideEffect.add((function(){var e=function(e){n.setReadonly(e)};return i.events.on("readonly",e),function(){return i.events.off("readonly",e)}})),this.sideEffect.add((function(){var e=function(e){"@netless/_request_save_pdf_"===e.data.type&&e.data.appId===n.appId&&n.toPdf().catch((function(){return n.reportProgress(100,null)}))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}})),this.render()}return S(e,[{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",(function(t){if(e.box.focus&&e.slideController&&!function(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.slideController.slide.prevStep(),e.onNavigate(e.slideController.page,"keydown");break;case"ArrowRight":case"ArrowDown":e.slideController.slide.nextStep(),e.onNavigate(e.slideController.page,"keydown")}}))}},{key:"renderOverlay",value:function(){if(!this.$overlay){var e=document.createElement("div");e.className=this.wrapClassName("overlay"),this.$overlay=e}return this.$overlay}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"renderWhiteboardView",value:function(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}},{key:"mount",value:function(){var e=this;return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onNavigate:this.onNavigate,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){return e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"unmount",value:function(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.viewer.setReadonly(e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"toggleClickThrough",value:function(e){this.$whiteboardView.style.pointerEvents=!e||Yt.has(e)?"none":"auto"}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"getWhiteSnapshot",value:function(e,t,r,n,i){this.whiteboardView.screenshotToCanvas(r,"".concat(this.baseScenePath,"/").concat(e),t.width,t.height,{centerX:0,centerY:0,scale:Math.min(t.width/n,t.height/i)})}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),qt=!1,Qt=2;t.FreezerLength=Qt;var Zt=function(e){return"["+e+"]"},Kt={map:new Map,boxes:new Map,queue:[],validateQueue:function(){var e=this;for(this.queue.sort((function(t,r){var n,i,o,a;return-((null!=(i=null==(n=e.boxes.get(t))?void 0:n.zIndex)?i:0)-(null!=(a=null==(o=e.boxes.get(r))?void 0:o.zIndex)?a:0))})),ae("[Slide] freezer: validate",Zt(this.queue));this.queue.length>Qt;){var t=this.queue.pop(),r=this.map.get(t);r&&(ae("[Slide] freezer: validate-freeze",t,Zt(this.queue)),r.freeze())}},set:function(e,t,r){ae("[Slide] freezer: add",e,Zt(this.queue)),this.map.set(e,t),this.boxes.set(e,r),this.queue.includes(e)||this.queue.unshift(e),this.validateQueue()},delete:function(e){this.map.delete(e),this.boxes.delete(e),this.queue=this.queue.filter((function(t){return t!==e})),ae("[Slide] freezer: delete",e,Zt(this.queue))},focus:function(e){var t=this.map.get(e),r=this.queue.indexOf(e);r>-1&&this.queue.splice(r,1),this.queue.unshift(e),this.validateQueue(),ae("[Slide] freezer: focus",e,Zt(this.queue)),t&&t.unfreeze()}};t.apps=Kt;var Jt=new Set;var er=new Set;t.addHooks=function(e){qt=!0,e.on("focus",(function(e){var t=e.appId;Kt.focus(t)})),e.on("created",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;er.forEach((function(e){return e(t)}))}))};var tr=function(){return".netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden;transition:opacity .2s}.netless-app-slide-wb-view-hidden{opacity:0}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}\n"}();var rr=function(){function e(t){var r=this;x(this,e),this.slide=null,this.debug=!1,this.previewList=[],this.sideEffect=new F,this.ready=!1,this.readyPromise=new Promise((function(e){r.resolveReady=function(){r.ready=!0,e()}})),this.hotkeyListener=function(e){if(r.slide)switch(e.key){case"ArrowUp":case"ArrowLeft":r.slide.prevStep();break;case"ArrowRight":case"ArrowDown":r.slide.nextStep()}},this.onPageChanged=function(e){r.viewer.setPageIndex(e-1)},this.onTransitionStart=function(){r.viewer.setPlaying()},this.onTransitionEnd=function(){r.viewer.setPaused()},this.onError=function(e){var t=e.error;r.viewer.setPaused(),console.warn("[Slide] render error",t)},this.destroyed=!1,this.refreshPages=function(){r.slide&&(r.viewer.pages=de(r.slide,r.previewList),r.viewer.setPageIndex(r.getPageIndex(r.slide.slideState.currentSlideIndex)))},this.onPlay=function(){r.slide&&r.slide.nextStep()},this.onNewPageIndex=function(e){r.slide&&r.slide.slideCount>0&&r.slide.renderSlide(W(e+1,1,r.slide.slideCount))},this.namespace="netless-app-slide",this.target=t.target,this.bgColor=ce(this.target),this.viewer=new Ht({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}return S(e,[{key:"render",value:function(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}},{key:"registerHotKeys",value:function(e){this.sideEffect.addEventListener(e,"keydown",this.hotkeyListener,void 0,"hotkey")}},{key:"mount",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new L.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),r.length>0?this.slide.setResourceList(e,r):this.slide.setResource(e,t),this.slide.renderSlide(1),this.previewList=n}},{key:"renderStyle",value:function(){var e=document.createElement("style");return e.appendChild(document.createTextNode(tr)),e}},{key:"registerEventListeners",value:function(){if(this.slide){var e=this.slide;e.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),e.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.renderError,this.onError),e.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();t.SlidePreviewer=rr;var nr=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=nr;var ir="0.2.60";t.version=ir;var or={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.60"),e.getIsWritable()&&e.storage.ensureState(ve),!e.storage.state.taskId)throw new Error("[Slide] no taskId");var r=e.getView();if(!r)throw new Error("[Slide] no view, please set scenePath on addApp()");r.disableCameraTransform=!0;var n=e.getBox();n.mountStyles(tr);try{n.$content.dataset.appSlideVersion=ir}catch(e){}var i=e.getInitScenePath(),o=null,a=function(t){var r=e.getRoom();if(o&&o.slideController){var n=!1;r&&e.getIsWritable()&&(fe(r,e,o.slideController.slide,i),n=!0),ae("[Slide] page to",t,n?"(synced)":""),o.viewer.setPageIndex(t-1),o.viewer.setPaused(),o.onPageChanged();var a=o.viewer.pages.length;a>0&&e.dispatchAppEvent("pageStateChange",{index:t-1,length:a})}};o=new Xt({box:n,view:r,mountSlideController:function(t){var r,o,s=e.getAppOptions()||{},u=new me((r=D({context:e},t),o={onPageChanged:a,onNavigate:t.onNavigate,onRenderError:s.onRenderError,showRenderError:s.showRenderError,invisibleBehavior:s.invisibleBehavior},A(r,C(o))));return qt&&Kt.set(e.appId,u,n),oe.setAppController(e.appId,u),u.readyPromise.then(t.onReady).then((function(){var r=e.getRoom(),n=!1;r&&e.getIsWritable()&&(fe(r,e,u.slide,i),n=!0);var o=u.slide.slideState.currentSlideIndex;ae("[Slide] page to",o,n?"(synced)":"","(on ready)"),u.slide.on("renderEnd",t.onRenderEnd)})),u},mountWhiteboard:e.mountView.bind(e),baseScenePath:i,appId:e.appId,urlInterrupter:null==(t=e.getAppOptions())?void 0:t.urlInterrupter,onPagesReady:function(t){var r=t.length,n=(null==o?void 0:o.viewer.pageIndex)||0;e.dispatchAppEvent("pageStateChange",{index:n,length:r})},onNavigate:function(e,t){ae("[Slide] user navigate to",e,t?"(".concat(t,")"):"")}});var s=e.getRoom(),u=new F;return u.add((function(){var t;return oe.setAppContext(e.appId,e),oe.enable=(null==(t=e.getAppOptions())?void 0:t.debug)||!1,oe.level="debug",function(){return oe.deleteApp(e.appId)}})),s&&(o.toggleClickThrough(s.state.memberState.currentApplianceName),u.add((function(){var e=function(e){e.memberState&&o&&o.toggleClickThrough(e.memberState.currentApplianceName)};return s.callbacks.on("onRoomStateChanged",e),function(){return s.callbacks.off("onRoomStateChanged",e)}}))),e.emitter.on("destroy",(function(){ae("[Slide] destroy",e.appId),qt&&Kt.delete(e.appId),u.flushAll(),o&&(o.destroy(),o=null)})),o.mount(),{viewer:function(){return o},controller:function(){return null==o?void 0:o.slideController},slide:function(){var e;return null==(e=null==o?void 0:o.slideController)?void 0:e.slide},nextStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.nextStep(),!0)},prevStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.prevStep(),!0)},position:function(){var e=null==o?void 0:o.slideController;if(e)return[e.page,e.pageCount]},nextPage:function(){var e=null==o?void 0:o.slideController;if(e){var t=e.page,r=e.pageCount;if(r>0&&t0&&t>1)return e.jumpToPage(t-1),!0}return!1},jumpToPage:function(e){var t=null==o?void 0:o.slideController;if(t){var r=t.page,n=t.pageCount;if(n>0&&r>0&&r<=n)return t.jumpToPage(e),!0}return!1}}}};t.default=or;var ar=L.Slide;t.Slide=ar},60064:function(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});var n=r(71560);t.ActiveContainerType=n.ActiveContainerType,t.ApplianceMultiPlugin=n.ApplianceMultiPlugin,t.ApplianceNames=n.ApplianceNames,t.ApplianceSigleWrapper=n.ApplianceSigleWrapper,t.ApplianceSinglePlugin=n.ApplianceSinglePlugin,t.ECanvasContextType=n.ECanvasContextType,t.ECanvasShowType=n.ECanvasShowType,t.EDataType=n.EDataType,t.EPostMessageType=n.EPostMessageType,t.EScaleType=n.EScaleType,t.EStrokeType=n.EStrokeType,t.EToolsKey=n.EToolsKey,t.ElayerType=n.ElayerType,t.EmitEventType=n.EmitEventType,t.EventMessageType=n.EventMessageType,t.EvevtWorkState=n.EvevtWorkState,t.EvevtWorkType=n.EvevtWorkType,t.InternalMsgEmitterType=n.InternalMsgEmitterType,t.ShapeType=n.ShapeType,t.fullWorkerUrl=n.fullWorker,t.subWorkerUrl=n.subWorker},91873:function(e,t,r){function n(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t,r){return i=x()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&m(i,r.prototype),i},i.apply(null,arguments)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=c(e))){var t=0,r=function(){};return{s:r,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){a=!0,i=e})),f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function s(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)}))}}function l(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)for(var a=1;a1&&void 0!==arguments[1])||arguments[1],r=e.length;if(r<2)return"";var n=e[0],i=e[1];if(2===r)return"M".concat(A.precise(n),"L").concat(A.precise(i));for(var o="",a=2,s=r-1;a3?"T":"").concat(o,"L").concat(A.precise(e[r-1]))}var D=function(e){g(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),I(b(n),"canRotate",!0),I(b(n),"scaleType",A.EScaleType.all),I(b(n),"toolsType",A.EToolsKey.Pencil),I(b(n),"syncTimestamp"),I(b(n),"syncIndex",0),I(b(n),"tmpPoints",[]),I(b(n),"MAX_REPEAR",10),I(b(n),"uniThickness"),I(b(n),"workOptions"),I(b(n),"centerPos",[0,0]),n.workOptions=e.toolsOpt,n.uniThickness=n.MAX_REPEAR/n.workOptions.thickness/10,n.syncTimestamp=0,n}return M(r,[{key:"combineConsume",value:function(){var e,t,r=null==(e=this.workId)?void 0:e.toString(),n=this.transformDataAll(!0),i={name:r},o=this.drawLayer||this.fullLayer;return n.length&&(t=this.draw({attrs:i,tasks:n,replaceId:r,layer:o})),{rect:t,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local}}},{key:"setWorkOptions",value:function(e){v(w(r.prototype),"setWorkOptions",this).call(this,e),this.syncTimestamp=Date.now()}},{key:"consume",value:function(e){var t,r=this,n=e.data,i=e.isFullWork,o=e.isSubWorker,a=e.isMainThread,s=e.drawCount,u=e.replaceId;if(0===(null==(t=n.op)?void 0:t.length))return{type:A.EPostMessageType.None};var l=n.workId,c=this.transformData(n,!1),h=c.tasks,d=c.effects,f=c.consumeIndex;this.syncIndex=Math.min(this.syncIndex,f,Math.max(0,this.tmpPoints.length-2));var p,v={name:null==l?void 0:l.toString(),id:null==s?void 0:s.toString()},g=!1,m=this.syncIndex;if(0===this.syncTimestamp&&(this.syncTimestamp=Date.now()),h.length&&(h[0].taskId-this.syncTimestamp>this.syncUnitTime&&(g=!0,this.syncTimestamp=h[0].taskId,this.syncIndex=this.tmpPoints.length),o||a)){var y=i?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({attrs:v,tasks:h,effects:d,layer:y,replaceId:u})}if(o)return f>10&&this.tmpPoints.splice(0,f-10),{rect:p,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local};var _=[];return this.tmpPoints.slice(m).forEach((function(e){_.push(e.x,e.y,r.computRadius(e.z,r.workOptions.thickness))})),{rect:p,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:g?l:void 0,op:g?_:void 0,index:g?3*m:void 0}}},{key:"consumeAll",value:function(e){var t,r,n=this;if(e.data){var i=e.data,o=i.op,a=i.workState;null!=o&&o.length&&a===A.EvevtWorkState.Done&&this.workOptions.strokeType===A.EStrokeType.Stroke&&this.updateTempPointsWithPressureWhenDone(o)}var s=null==(t=this.workId)?void 0:t.toString();if(!s)return{type:A.EPostMessageType.None};var u,l=this.transformDataAll(!0),c={name:s},h=this.fullLayer;l.length&&(u=this.draw({attrs:c,tasks:l,replaceId:s,layer:h}));var d=[];this.tmpPoints.map((function(e){d.push(e.x,e.y,n.computRadius(e.z,n.workOptions.thickness))})),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var f=A.transformToSerializableData(d);return null==(r=this.vNodes)||r.setInfo(s,{rect:u,op:d,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&O.getCenterPos(u,h)}),{rect:u,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:s,ops:f,updateNodeOpt:{pos:this.centerPos,useAnimation:!0},opt:this.workOptions}}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId;this.tmpPoints.length=0;for(var a=0;a0){var u=this.tmpPoints[this.tmpPoints.length-1],l=A.Vec2d.Sub(s,u).uni();s.setv(l)}this.tmpPoints.push(s)}var c,h=this.transformDataAll(!1),d=null==(t=this.workId)?void 0:t.toString(),f={name:d};if(d&&h.length){var p=i?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({attrs:f,tasks:h,replaceId:o,layer:p}),null==(r=this.vNodes)||r.setInfo(d,{rect:c,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&O.getCenterPos(c,p)})}return c}},{key:"transformDataAll",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.getTaskPoints(this.tmpPoints,e&&this.workOptions.thickness||void 0)}},{key:"draw",value:function(e){var t,r=this,n=e.attrs,i=e.tasks,o=e.replaceId,a=e.effects,s=e.layer,u=this.workOptions,c=u.strokeColor,h=u.strokeType,d=u.thickness,p=u.zIndex,v=u.scale,g=u.rotate,m=u.translate;null!=a&&a.size&&(a.forEach((function(e){var t;null==(t=s.getElementById(e+""))||t.remove()})),a.clear());for(var y=[],_=s.worldPosition,b=s.worldScaling,x=0;x1&&(s=e[n+1].point.v);var u=A.Vec2d.Per(s).mul(a);t.push(A.Point2d.Sub(o,u)),r.push(A.Point2d.Add(o,u))}var l=e[e.length-1],c=A.Point2d.GetSemicircleStroke(l.point,t[t.length-1],-1,8),h=A.Point2d.GetSemicircleStroke(e[0].point,r[0],-1,8),d=t.concat(c,r.reverse(),h);return{ps:d,rect:A.getRectFromPoints(d)}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:A.Point2d.GetDotStroke(t,r,8),rect:n}}},{key:"transformData",value:function(e,t){var r=e.op,n=e.workState,i=this.tmpPoints.length-1,o=[];if(null!=r&&r.length&&n){var a=this.workOptions,s=a.strokeType,u=a.thickness,l=new Set;i=s===A.EStrokeType.Stroke?this.updateTempPointsWithPressure(r,u,l):this.updateTempPoints(r,u,l);var c=t?this.tmpPoints:this.tmpPoints.slice(i);return{tasks:o=this.getTaskPoints(c,u),effects:l,consumeIndex:i}}return{tasks:o,consumeIndex:i}}},{key:"computRadius",value:function(e,t){return.03*e*t+.5*t}},{key:"getMinZ",value:function(e,t){return 100*((t||Math.max(1,Math.floor(.3*e)))-.5*e)/e/3}},{key:"getTaskPoints",value:function(e,t){var r,n=[];if(0===e.length)return[];for(var i=0,o=e[0].x,a=e[0].y,s=[o,a],u=[],c=e[0].t;i0&&i270){var m=null==(r=u.pop())?void 0:r.point.clone();m&&n.push({taskId:c,pos:s,points:[].concat(l(u),[{point:m,radius:v}])}),s=[o=e[i].x,a=e[i].y];var y=h.x-o,_=h.y-a;u=[{point:new A.Point2d(y,_,p),radius:v}],c=Date.now()}}i++}return n.push({taskId:c,pos:s,points:u}),n}},{key:"updateTempPointsWithPressure",value:function(e,t,r){for(var n=Date.now(),i=this.tmpPoints.length,o=i,a=0;a1)for(var d=s-1;d>0;){var f=this.tmpPoints[d].distance(this.tmpPoints[d-1]),p=Math.max(this.tmpPoints[d].z-this.uniThickness*f,0);if(this.tmpPoints[d-1].z>=p)break;this.tmpPoints[d-1].setz(p),o=Math.min(o,d-1),d--}}else o=1/0;else{u.setv(h);var v=u.distance(c),g=Math.max(c.z-this.uniThickness*v,0);s>1&&A.Vec2d.Equals(h,c.v,.02)&&(g>0||c.z<=0)&&(r&&c.t&&r.add(c.t),this.tmpPoints.pop(),o=Math.min(l,o)),u.setz(g),this.tmpPoints.push(u)}}else this.tmpPoints.push(u)}if(o===1/0)return this.tmpPoints.length;var m=i;if(o===i){m=Math.max(m-1,0);var y=this.tmpPoints[m].t;y&&(null==r||r.add(y))}else{var _=i-1;for(m=o;_>=0;){var b=this.tmpPoints[_].t;if(b&&(null==r||r.add(b),_<=o)){m=_,_=-1;break}_--}}return this.tmpPoints[m].setT(n),m}},{key:"updateTempPoints",value:function(e,t,r){for(var n,i=Date.now(),o=this.tmpPoints.length,a=o,s=0;s=0;){var g=null==(n=this.tmpPoints[v])?void 0:n.t;if(g&&(null==r||r.add(g),v<=a)){f=v,v=-1;break}v--}}return this.tmpPoints[f].setT(i),f}},{key:"updateTempPointsWithPressureWhenDone",value:function(e){for(var t=this.workOptions.thickness,r=e.length,n=this.getMinZ(t),i=0;i1&&u.z===n)break;if(a.isNear(u,t/2)){if(r<3&&u.z1))for(var h=o-1;h>0;){var d=this.tmpPoints[h].distance(this.tmpPoints[h-1]),f=Math.max(this.tmpPoints[h].z-this.uniThickness*d,-t/4);if(this.tmpPoints[h-1].z>=f)break;this.tmpPoints[h-1].setz(f),h--}}else{a.setv(l);var p=Math.max(u.z-this.uniThickness*c,n);o>1&&A.Vec2d.Equals(l,u.v,.02)&&u.z<=0&&this.tmpPoints.pop(),a.setz(p),this.tmpPoints.push(a)}}else this.tmpPoints.push(a)}}}],[{key:"updateNodeOpt",value:function(e){var t,r=e.node,n=e.opt,i=e.vNodes,o=n.strokeColor,a=i.get(r.name);return o&&("GROUP"===r.tagName?ee(r)?r.setAttribute("bgcolor",o):r.children.forEach((function(e){e.setAttribute("strokeColor",o),e.getAttribute("fillColor")&&e.setAttribute("fillColor",o)})):(r.setAttribute("strokeColor",o),r.setAttribute("fillColor",o)),null!=(t=null==a?void 0:a.opt)&&t.strokeColor&&(a.opt.strokeColor=o)),a&&i.setInfo(r.name,a),O.updateNodeOpt(e)}}]),r}(O),L=function(e){g(n,e);var t,r=y(n);function n(e){var t;return S(this,n),t=r.call(this,e),I(b(t),"toolsType",A.EToolsKey.LaserPen),I(b(t),"canRotate",!1),I(b(t),"scaleType",A.EScaleType.none),I(b(t),"syncTimestamp"),I(b(t),"syncIndex",0),I(b(t),"tmpPoints",[]),I(b(t),"workOptions"),I(b(t),"consumeIndex",0),t.workOptions=e.toolsOpt,t.syncTimestamp=0,t}return M(n,[{key:"combineConsume",value:function(){}},{key:"setWorkOptions",value:function(e){v(w(n.prototype),"setWorkOptions",this).call(this,e),this.syncTimestamp=Date.now()}},{key:"consume",value:function(e){var t=e.data,r=e.isSubWorker,n=t.workId,i=t.op;if(0===(null==i?void 0:i.length))return{type:A.EPostMessageType.None};if(this.updateTempPoints(i||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:A.EPostMessageType.None};var o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType,l=A.getRectFromPoints(this.tmpPoints,s),c=!1,h=this.syncIndex,d=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,0===this.syncTimestamp&&(this.syncTimestamp=Date.now());var f={name:null==n?void 0:n.toString(),opacity:1,lineDash:u===A.EStrokeType.Dotted?[1,2*s]:u===A.EStrokeType.LongDotted?[s,2*s]:void 0,strokeColor:a,lineCap:"round",lineWidth:s,anchor:[.5,.5]},p=this.getTaskPoints(d);if(p.length){var v=Date.now();v-this.syncTimestamp>this.syncUnitTime&&(c=!0,this.syncTimestamp=v,this.syncIndex=this.tmpPoints.length),r&&this.draw({attrs:f,tasks:p,isDot:!1,layer:this.drawLayer||this.fullLayer})}var g=[];return this.tmpPoints.slice(h).forEach((function(e){g.push(e.x,e.y)})),{rect:{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]},type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:c?n:void 0,op:c?g:void 0,index:c?2*h:void 0}}},{key:"consumeAll",value:function(){var e,t,r=null==(e=this.workId)?void 0:e.toString();if(this.tmpPoints.length-1>this.consumeIndex){var n=this.tmpPoints.slice(this.consumeIndex),i=1===n.length,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(i){var l=this.computDotStroke({point:n[0],radius:s/2});n=l.ps,t=l.rect}else t=A.getRectFromPoints(this.tmpPoints,s);var c={name:null==r?void 0:r.toString(),fillColor:i?a:void 0,opacity:1,lineDash:u!==A.EStrokeType.Dotted||i?u!==A.EStrokeType.LongDotted||i?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:i?void 0:"round",lineWidth:i?0:s,anchor:[.5,.5]},h=this.getTaskPoints(n);h.length&&this.draw({attrs:c,tasks:h,isDot:i,layer:this.drawLayer||this.fullLayer})}var d=[];this.tmpPoints.forEach((function(e){d.push(e.x,e.y)}));var f=A.transformToSerializableData(d);return{rect:t&&{x:t.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:t.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:t.w*this.fullLayer.worldScaling[0],h:t.h*this.fullLayer.worldScaling[1]},type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:r,ops:f,index:2*this.syncIndex}}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r=e.op,n=e.replaceId,i=e.isFullWork,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(!r.length){var l=A.getRectFromPoints(this.tmpPoints,s);return{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]}}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var h,d=this.tmpPoints.slice(c),f=1===d.length;if(f){var p=this.computDotStroke({point:d[0],radius:s/2});d=p.ps,h=p.rect}else h=A.getRectFromPoints(this.tmpPoints,s);var v={name:null==(t=this.workId)?void 0:t.toString(),fillColor:f?a:void 0,opacity:1,lineDash:u!==A.EStrokeType.Dotted||f?u!==A.EStrokeType.LongDotted||f?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:f?void 0:"round",lineWidth:f?0:s,anchor:[.5,.5]},g=this.getTaskPoints(d);if(g.length){var m=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:v,tasks:g,isDot:f,replaceId:n,layer:m})}return{x:h.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:h.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:h.w*this.fullLayer.worldScaling[0],h:h.h*this.fullLayer.worldScaling[1]}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:A.Point2d.GetDotStroke(t,r,8),rect:n}}},{key:"updateTempPoints",value:function(e){for(var t=this.tmpPoints.length,r=0;r0&&n270){var f=null==(t=s.pop())?void 0:t.clone();f&&r.push({pos:a,points:[].concat(l(s),[f])}),a=[i=e[n].x,o=e[n].y];var p=u.x-i,v=u.y-o;s=[new A.Point2d(p,v)]}}n++}return r.push({pos:a,points:s}),r}},{key:"removeLocal",value:function(){}},{key:"removeService",value:function(e){var t,r=[];return this.fullLayer.getElementsByName(e).forEach((function(n){if(n.name===e){var i=n.getBoundingClientRect();t=A.computRect(t,{x:i.x,y:i.y,w:i.width,h:i.height}),r.push(n)}})),r.length&&r.forEach((function(e){return e.remove()})),t}}]),n}(O),j=function(e){g(r,e);var t=y(r);function r(e,n){var i;return S(this,r),i=t.call(this,e),I(b(i),"canRotate",!1),I(b(i),"scaleType",A.EScaleType.none),I(b(i),"toolsType",A.EToolsKey.Eraser),I(b(i),"serviceWork"),I(b(i),"tmpPoints",[]),I(b(i),"workOptions"),I(b(i),"worldPosition"),I(b(i),"worldScaling"),I(b(i),"eraserRect"),I(b(i),"eraserPolyline"),i.serviceWork=n,i.workOptions=e.toolsOpt,i.worldPosition=i.fullLayer.worldPosition,i.worldScaling=i.fullLayer.worldScaling,i}return M(r,[{key:"combineConsume",value:function(){}},{key:"consumeService",value:function(){}},{key:"setWorkOptions",value:function(e){v(w(r.prototype),"setWorkOptions",this).call(this,e)}},{key:"createEraserRect",value:function(e){var t=e[0]*this.worldScaling[0]+this.worldPosition[0],n=e[1]*this.worldScaling[1]+this.worldPosition[1],i=r.eraserSizes[this.workOptions.thickness],o=i.width,a=i.height;this.eraserRect={x:t-.5*o,y:n-.5*a,w:o,h:a},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h]}},{key:"computRectCenterPoints",value:function(){var e=this.tmpPoints.slice(-2);if(4===this.tmpPoints.length){var t=new A.Vec2d(this.tmpPoints[0],this.tmpPoints[1]),n=new A.Vec2d(this.tmpPoints[2],this.tmpPoints[3]),i=A.Vec2d.Sub(n,t).uni(),o=A.Vec2d.Dist(t,n),a=r.eraserSizes[this.workOptions.thickness],s=a.width,u=a.height,l=Math.min(s,u),c=Math.round(o/l);if(c>1){for(var h=[],d=0;d-1){var a=[],s=i.slice(0,o+1);if(A.Vec2d.Equals(i[o],t[0])||s.push(t[0].clone().setz(i[o].z)),s.length>1&&a.push(s),o+t.length-11&&a.push(l)}return{v:(r.splice.apply(r,[n,1].concat(a)),r)}}},i=0;i0&&t.isSamePoint(e,n[r-1]))})),o=[],a=0;a1){var w=P.polyline(y.map((function(e){return e.XY})),this.eraserPolyline);if(w.length&&(s.add(f.name),!g))for(var S=this.translateIntersect(w),T=this.cutPolyline(S,y),M=function(e){var t="".concat(d,"_s_").concat(e),r=[];T[e].forEach((function(e){r.push((e.x-n.worldPosition[0])/n.worldScaling[0],(e.y-n.worldPosition[1])/n.worldScaling[1],e.z)})),f.opt&&f.toolsType&&n.vNodes&&(n.vNodes.setInfo(t,{rect:x,op:r,opt:f.opt,canRotate:f.canRotate,scaleType:f.scaleType,toolsType:f.toolsType}),u.set(t,{workId:t,op:r,opt:f.opt,toolsType:f.toolsType}))},k=0;k1&&this.isNear([t[0],t[1]],[this.tmpPoints[r-2],this.tmpPoints[r-1]]))return{type:A.EPostMessageType.None};4===r&&(this.tmpPoints.shift(),this.tmpPoints.shift()),this.tmpPoints.push(t[0],t[1]);var n,i=this.computRectCenterPoints(),o=new Set,s=new Map;if(!this.vNodes)return{type:A.EPostMessageType.None};this.vNodes.setTarget();for(var u=this.getUnLockNodeMap(this.vNodes.getLastTarget()),c=0;c0&&void 0!==arguments[0])||arguments[0],t=A.getRectFromPoints(this.tmpPoints);if(0===t.w||0===t.h)return{selectIds:[],intersectRect:void 0,subNodeMap:new Map};var r=this.vNodes.getRectIntersectRange(t,e),n=r.rectRange,i=r.nodeRange;return{selectIds:l(i.keys()),intersectRect:n,subNodeMap:i}}},{key:"updateTempPoints",value:function(e){var t=this.tmpPoints.length,r=e.length;if(r>1){var n=new A.Point2d(e[r-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[r-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);2===t?this.tmpPoints.splice(1,1,n):this.tmpPoints.push(n)}}},{key:"drawSelector",value:function(e){var t=this,r=e.drawRect,i=e.subNodeMap,o=e.selectorId,a=e.layer,s=e.isService,u=new C.Group({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:o,name:o,zIndex:1e3}),l=[];if(s){var c=new C.Rect({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:n.selectorBorderId});l.push(c)}i.forEach((function(e,n){var o=[e.rect.x+e.rect.w/2-r.x,e.rect.y+e.rect.h/2-r.y],a=new C.Rect({normalize:!0,pos:o,lineWidth:1,strokeColor:i.size>1?t.selectorColor||t.workOptions.strokeColor:void 0,width:e.rect.w,height:e.rect.h,id:"selector-".concat(n),name:"selector-".concat(n)});l.push(a)})),l&&u.append.apply(u,l),(null==a?void 0:a.parent).appendChild(u)}},{key:"draw",value:function(e,t,r){var n,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=r.intersectRect,s=r.subNodeMap;null==(i=null==(n=t.parent)?void 0:n.getElementById(e))||i.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:s,selectorId:e,layer:t,isService:o})}},{key:"getSelecteorInfo",value:function(e){this.scaleType=A.EScaleType.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0;var t,r,n=new Set,i=a(e.values());try{for(i.s();!(r=i.n()).done;){var o=r.value,s=o.opt,u=o.canRotate,c=o.scaleType,h=o.toolsType;this.selectorColor=this.workOptions.strokeColor,s.strokeColor&&(this.strokeColor=s.strokeColor),s.fillColor&&(this.fillColor=s.fillColor),s.textOpt&&(this.textOpt=s.textOpt),h===A.EToolsKey.SpeechBalloon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=s.placement),h===A.EToolsKey.Polygon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices),h===A.EToolsKey.Star&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices,this.shapeOpt.innerRatio=s.innerRatio,this.shapeOpt.innerVerticeStep=s.innerVerticeStep),h===A.EToolsKey.Text&&(this.textOpt=s),1===e.size&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=u,this.scaleType=c),c===A.EScaleType.none&&(this.scaleType=c),h===A.EToolsKey.Image&&(t=o)}}catch(e){i.e(e)}finally{i.f()}n.size&&(this.toolsTypes=l(n)),t&&(1===e.size?(this.canLock=!0,t.opt.locked&&(this.isLocked=!0,this.scaleType=A.EScaleType.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1)):e.size>1&&!t.opt.locked&&(this.canLock=!1,this.canRotate=!1))}},{key:"getChildrenPoints",value:function(){var e,t;if(this.scaleType===A.EScaleType.both&&1===(null==(e=this.selectIds)?void 0:e.length)){var r=this.selectIds[0],n=null==(t=this.vNodes.get(r))?void 0:t.op;if(n){for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:n.selectorId,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];2===e.length&&function(){var n,o,s=e[0],u=e[1],c=l(t.vNodes.getRectIntersectRange({x:s,y:u,w:0,h:0},!1).nodeRange.values()).sort((function(e,t){return(t.opt.zIndex||0)-(e.opt.zIndex||0)})),h=a(c);try{for(h.s();!(o=h.n()).done;){var d=o.value;if(J(t.fullLayer.getElementsByName(d.name)).find((function(e){return e.isPointCollision(s,u)}))){n=d;break}}}catch(e){h.e(e)}finally{h.f()}if(n){var f=n.name;if(!A.isEqual(t.oldSelectRect,n.rect)){var p=new Map([[f,n]]);t.getSelecteorInfo(p),t.draw(r,t.fullLayer,{intersectRect:n.rect,subNodeMap:p,selectIds:t.selectIds||[]},i)}t.selectIds=[f],t.oldSelectRect=n.rect}}()}},{key:"unSelectedAllIds",value:function(){var e,t,r=a(this.vNodes.curNodeMap.entries());try{for(r.s();!(t=r.n()).done;){var n=o(t.value,2),i=n[0],s=n[1];s.isSelected&&(e=A.computRect(e,s.rect),this.vNodes.unSelected(i))}}catch(e){r.e(e)}finally{r.f()}return e}},{key:"unSelectedByIds",value:function(e){var t,r,n=a(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&o.isSelected&&(t=A.computRect(t,o.rect),this.vNodes.unSelected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"selectedByIds",value:function(e){var t,r,n=a(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&(t=A.computRect(t,o.rect),this.vNodes.selected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getSelectorRect",value:function(e,t){var r,n,i=null==(r=e.parent)?void 0:r.getElementById(t),o=null==i?void 0:i.getBoundingClientRect();return o&&(n=A.computRect(n,{x:Math.floor(o.x),y:Math.floor(o.y),w:Math.floor(o.width+1),h:Math.floor(o.height+1)})),n}},{key:"isCanFillColor",value:function(e){return e===A.EToolsKey.Ellipse||e===A.EToolsKey.Triangle||e===A.EToolsKey.Rectangle||e===A.EToolsKey.Polygon||e===A.EToolsKey.Star||e===A.EToolsKey.SpeechBalloon}},{key:"updateSelector",value:(t=u(regeneratorRuntime.mark((function e(t){var r,i,o,s,u,l,c,h,d,p,v,g,m,y,_,b,x,w,S,T,M,k,E,I,C,P,N,O,R,D,L,j,z,B,F,U,W,G,V,H,Y,$,X,q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.updateSelectorOpt,i=t.selectIds,o=t.vNodes,s=t.willSerializeData,u=t.worker,l=t.offset,c=t.scene,h=t.isMainThread,d=this.fullLayer){e.next=3;break}return e.abrupt("return");case 3:if(v=new Map,g=r.box,m=r.workState,y=r.angle,_=r.translate,b=[0,0],x=[1,1],w=[0,0],!(g||_||A.isNumber(y))){e.next=9;break}if(m!==A.EvevtWorkState.Start){e.next=8;break}return e.abrupt("return",(o.setTarget(),{type:A.EPostMessageType.Select,dataType:A.EDataType.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:(S=o.getLastTarget())&&g&&(null==i||i.forEach((function(e){var t=null==S?void 0:S.get(e);M=A.computRect(M,null==t?void 0:t.rect)})),M&&(x=[g.w/M.w,g.h/M.h],b=[g.x+g.w/2-(M.x+M.w/2),g.y+g.h/2-(M.y+M.h/2)],w=[M.x+M.w/2,M.y+M.h/2]),T=M);case 9:if(!i){e.next=55;break}k=a(i),e.prev=11,k.s();case 13:if((E=k.n()).done){e.next=47;break}if(I=E.value,!(C=o.get(I))){e.next=45;break}if(P=C.toolsType,!(N=(null==d?void 0:d.getElementsByName(I))[0])){e.next=45;break}if(O=f({},r),!P){e.next=45;break}if((R=null==S?void 0:S.get(I))&&g&&(O.boxScale=x,D=[R.rect.x+R.rect.w/2,R.rect.y+R.rect.h/2],L=[D[0]-w[0],D[1]-w[1]],O.boxTranslate=[L[0]*(x[0]-1)+b[0]+(l&&l[0]||0),L[1]*(x[1]-1)+b[1]+(l&&l[1]||0)]),null==(j=Z(P))||j.updateNodeOpt({node:N,opt:O,vNodes:o,willSerializeData:s,targetNode:R}),!(C&&u&&(s&&(O.angle||O.translate)||O.box&&O.workState!==A.EvevtWorkState.Start||O.pointMap&&O.pointMap.has(I)||P===A.EToolsKey.Text&&(O.fontSize||O.translate||O.textInfos&&O.textInfos.get(I))||P===A.EToolsKey.Image&&(O.angle||O.translate||O.boxScale)||P===O.toolsType&&O.willRefresh))){e.next=44;break}if(null==(z=u.createWorkShapeNode({toolsType:P,toolsOpt:C.opt}))||z.setWorkId(I),B=void 0,P!==A.EToolsKey.Image||!c){e.next=35;break}return e.next=32,z.consumeServiceAsync({isFullWork:!0,replaceId:I,scene:c,isMainThread:h});case 32:B=e.sent,e.next=42;break;case 35:if(P!==A.EToolsKey.Text){e.next=41;break}return e.next=38,z.consumeServiceAsync({isFullWork:!0,replaceId:I});case 38:B=e.sent,e.next=42;break;case 41:B=null==z?void 0:z.consumeService({op:C.op,isFullWork:!0,replaceId:I});case 42:B&&(C.rect=B),N=(null==d?void 0:d.getElementsByName(I))[0];case 44:C&&(v.set(I,C),p=A.computRect(p,C.rect));case 45:e.next=13;break;case 47:e.next=52;break;case 49:e.prev=49,e.t0=e.catch(11),k.e(e.t0);case 52:return e.prev=52,k.f(),e.finish(52);case 55:if(S&&m===A.EvevtWorkState.Done&&(o.deleteLastTarget(),S=void 0),F=p,!(T&&r.dir&&F)||l){e.next=89;break}U=[0,0],e.t1=r.dir,e.next="top"===e.t1?62:"topLeft"===e.t1?65:"topRight"===e.t1?68:"bottom"===e.t1?71:"bottomLeft"===e.t1?74:"bottomRight"===e.t1?77:"right"===e.t1?80:83;break;case 62:return W=[T.x,T.y+T.h],r.reverseY?U[1]=W[1]-F.y:U[1]=W[1]-(F.y+F.h),e.abrupt("break",83);case 65:return G=[T.x+T.w,T.y+T.h],r.reverseY?U[1]=G[1]-F.y:U[1]=G[1]-(F.y+F.h),r.reverseX?U[0]=G[0]-F.x:U[0]=G[0]-(F.x+F.w),e.abrupt("break",83);case 68:return V=[T.x,T.y+T.h],r.reverseY?U[1]=V[1]-F.y:U[1]=V[1]-(F.y+F.h),r.reverseX?U[0]=V[0]-(F.x+F.w):U[0]=V[0]-F.x,e.abrupt("break",83);case 71:return H=[T.x,T.y],r.reverseY?U[1]=H[1]-(F.y+F.h):U[1]=H[1]-F.y,e.abrupt("break",83);case 74:return Y=[T.x+T.w,T.y],r.reverseY?U[1]=Y[1]-(F.y+F.h):U[1]=Y[1]-F.y,r.reverseX?U[0]=Y[0]-F.x:U[0]=Y[0]-(F.x+F.w),e.abrupt("break",83);case 77:return $=[T.x,T.y],r.reverseY?U[1]=$[1]-(F.y+F.h):U[1]=$[1]-F.y,r.reverseX?U[0]=$[0]-(F.x+F.w):U[0]=$[0]-F.x,e.abrupt("break",83);case 80:return X=[T.x,T.y],r.reverseX?U[0]=X[0]-(F.x+F.w):U[0]=X[0]-F.x,e.abrupt("break",83);case 83:if(!U[0]&&!U[1]){e.next=89;break}return F.x=F.x+U[0],F.y=F.y+U[1],e.next=88,this.updateSelector(f(f({},t),{},{offset:U}));case 88:return e.abrupt("return",e.sent);case 89:return this.getSelecteorInfo(v),this.draw(n.selectorId,d,{selectIds:i||[],subNodeMap:v,intersectRect:F}),q=A.computRect(this.oldSelectRect,F),e.abrupt("return",(this.oldSelectRect=F,{type:A.EPostMessageType.Select,dataType:A.EDataType.Local,selectRect:F,renderRect:p,rect:A.computRect(q,F)}));case 92:case"end":return e.stop()}}),e,this,[[11,49,52,55]])}))),function(e){return t.apply(this,arguments)})},{key:"blurSelector",value:function(){var e=this.unSelectedAllIds();return{type:A.EPostMessageType.Select,dataType:A.EDataType.Local,rect:e,selectIds:[],willSyncService:!0}}},{key:"getRightServiceId",value:function(e){return e.replace(A.Storage_Splitter,"-")}},{key:"selectServiceNode",value:function(e,t,r){var n,i=this,o=t.selectIds,a=this.getRightServiceId(e),s=this.getSelectorRect(this.fullLayer,a),u=new Map;return null==o||o.forEach((function(e){var t=i.vNodes.get(e);t&&(n=A.computRect(n,t.rect),u.set(e,t))})),this.getSelecteorInfo(u),this.draw(a,this.fullLayer,{intersectRect:n,selectIds:o||[],subNodeMap:u},r),A.computRect(n,s)}},{key:"reRenderSelector",value:function(){var e,t,r=this,i=new Map;return null==(e=this.selectIds)||e.forEach((function(e){var n=r.vNodes.get(e);n&&(t=A.computRect(t,n.rect),i.set(e,n))}),this),this.getSelecteorInfo(i),this.draw(n.selectorId,this.fullLayer,{intersectRect:t,subNodeMap:i,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t}},{key:"updateSelectIds",value:function(e){var t,r,n=null==(t=this.selectIds)?void 0:t.filter((function(t){return!e.includes(t)}));if(null!=n&&n.length&&(r=this.unSelectedByIds(n)),e.length){var i=this.selectedByIds(e);r=A.computRect(r,i)}return this.selectIds=e,{bgRect:r,selectRect:this.reRenderSelector()}}},{key:"cursorHover",value:function(e){var t,r,n=this.oldSelectRect;this.selectIds=[];var i=null==(t=this.workId)?void 0:t.toString(),o=[e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];return this.selectSingleTool(o,i,!0),this.oldSelectRect&&!A.isEqual(n,this.oldSelectRect)?{type:A.EPostMessageType.CursorHover,dataType:A.EDataType.Local,rect:A.computRect(n,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1}:(null!=(r=this.selectIds)&&r.length||(this.oldSelectRect=void 0),n&&!this.oldSelectRect?(this.cursorBlur(),{type:A.EPostMessageType.CursorHover,dataType:A.EDataType.Local,rect:n,selectorColor:this.selectorColor,willSyncService:!1}):void 0)}},{key:"cursorBlur",value:function(){var e,t;this.selectIds=[];var r=null==(e=this.workId)?void 0:e.toString();(null==(t=this.fullLayer)?void 0:t.parent).children.forEach((function(e){e.name===r&&e.remove()}))}}]),n}(O);I(B,"selectorId",A.Storage_Selector_key),I(B,"selectorBorderId","selector-border");var F=B,U=function(e){g(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),I(b(n),"canRotate",!1),I(b(n),"scaleType",A.EScaleType.both),I(b(n),"toolsType",A.EToolsKey.Arrow),I(b(n),"tmpPoints",[]),I(b(n),"workOptions"),I(b(n),"oldRect"),I(b(n),"arrowTipWidth"),I(b(n),"syncTimestamp"),n.workOptions=e.toolsOpt,n.arrowTipWidth=4*n.workOptions.thickness,n.syncTimestamp=0,n.syncUnitTime=50,n}return M(r,[{key:"consume",value:function(e){var t,r=e.data,n=e.isFullWork,i=e.isSubWorker,o=e.isMainThread,a=null==(t=null==r?void 0:r.workId)?void 0:t.toString();if(!a)return{type:A.EPostMessageType.None};var s,u,c=r.op,h=r.workState,d=null==c?void 0:c.length;if(!d||d<2)return{type:A.EPostMessageType.None};if(h===A.EvevtWorkState.Start?(this.tmpPoints=[new A.Point2d(c[0],c[1])],s=!1):s=this.updateTempPoints(c),!s)return{type:A.EPostMessageType.None};if(i||o){var f=n?this.fullLayer:this.drawLayer||this.fullLayer;u=this.draw({workId:a,layer:f})}if(!i){var p=Date.now();return p-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=p,{type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0}):{type:A.EPostMessageType.None}}var v=A.computRect(u,this.oldRect);return this.oldRect=u,{rect:v,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a}}},{key:"consumeAll",value:function(e){var t,r,n=e.data,i=null==(t=null==n?void 0:n.workId)?void 0:t.toString();if(!i)return{type:A.EPostMessageType.None};if(this.tmpPoints.length<2)return{type:A.EPostMessageType.RemoveNode,removeIds:[i]};var o=this.fullLayer,a=this.draw({workId:i,layer:o});this.oldRect=a;var s=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),u=A.transformToSerializableData(s);return null==(r=this.vNodes)||r.setInfo(i,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:O.getCenterPos(a,o)}),{rect:a,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:i,ops:u,isSync:!0,opt:this.workOptions}}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=r.worldPosition,h=r.worldScaling,d=this.computDrawPoints(o),f=d.points,p=d.rect,v={pos:[p.x+p.w/2,p.y+p.h/2],name:t,id:t,close:!0,points:f,fillColor:i,strokeColor:i,lineWidth:0,normalize:!0,zIndex:a};s&&(v.scale=s),u&&(v.rotate=u),l&&(v.translate=l);var g=new C.Polyline(v);if(this.replace(r,t,g),s||u||l){var m=g.getBoundingClientRect();return{x:Math.floor(m.x-O.SafeBorderPadding),y:Math.floor(m.y-O.SafeBorderPadding),w:Math.floor(m.width+2*O.SafeBorderPadding),h:Math.floor(m.height+2*O.SafeBorderPadding)}}return{x:Math.floor(p.x*h[0]+c[0]-O.SafeBorderPadding),y:Math.floor(p.y*h[1]+c[1]-O.SafeBorderPadding),w:Math.floor(p.w*h[0]+2*O.SafeBorderPadding),h:Math.floor(p.h*h[1]+2*O.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(e):this.computTrianglePoints()}},{key:"computFullArrowPoints",value:function(e){var t=this,r=A.Vec2d.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=A.Vec2d.Per(r).mul(e/2),i=A.Point2d.Sub(this.tmpPoints[0],n),o=A.Point2d.Add(this.tmpPoints[0],n),a=A.Vec2d.Mul(r,this.arrowTipWidth),s=A.Vec2d.Sub(this.tmpPoints[1],a),u=A.Point2d.Sub(s,n),l=A.Point2d.Add(s,n),c=A.Vec2d.Per(r).mul(1.5*e),h=A.Point2d.Sub(s,c),d=A.Point2d.Add(s,c),f=[i,u,h,this.tmpPoints[1],d,l,o];return{points:f.map((function(e){return A.Point2d.Sub(e,t.tmpPoints[0]).XY})).flat(1),rect:A.getRectFromPoints(f),isTriangle:!1,pos:this.tmpPoints[0].XY}}},{key:"computTrianglePoints",value:function(){var e=this,t=A.Vec2d.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=A.Vec2d.Per(t).mul(Math.floor(3*r/8)),i=A.Point2d.Sub(this.tmpPoints[0],n),o=A.Point2d.Add(this.tmpPoints[0],n),a=[i,this.tmpPoints[1],o];return{points:a.map((function(t){return A.Point2d.Sub(t,e.tmpPoints[0]).XY})).flat(1),rect:A.getRectFromPoints(a),isTriangle:!0,pos:this.tmpPoints[0].XY}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new A.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=p,{type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0}):{type:A.EPostMessageType.None}}var v=A.computRect(u,this.oldRect);return this.oldRect=u,{rect:v,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a}}},{key:"consumeAll",value:function(e){var t,r,n=e.data,i=null==(t=null==n?void 0:n.workId)?void 0:t.toString();if(!i)return{type:A.EPostMessageType.None};if(this.tmpPoints.length<2)return{type:A.EPostMessageType.RemoveNode,removeIds:[i]};var o=this.fullLayer,a=this.draw({workId:i,layer:o,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),u=A.transformToSerializableData(s);return null==(r=this.vNodes)||r.setInfo(i,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:a&&O.getCenterPos(a,o)}),{rect:a,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:i,ops:u,isSync:!0,opt:this.workOptions}}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.scale,c=i.rotate,h=i.translate,d=r.worldScaling,p=this.computDrawPoints(s),v=p.radius,g=p.rect,m=p.pos,y={pos:m,name:t,id:t,radius:v,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0},_={name:t,id:t,zIndex:u,pos:m,anchor:[.5,.5],size:[g.w,g.h]};l&&(_.scale=l),c&&(_.rotate=c),h&&(_.translate=h);var b=new C.Group(_);if(n){var x=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/d[0],1/d[1]]});b.append(x)}var w=new C.Ellipse(f(f({},y),{},{pos:[0,0]}));b.append(w),this.replace(r,t,b);var S=b.getBoundingClientRect();return{x:Math.floor(S.x-O.SafeBorderPadding),y:Math.floor(S.y-O.SafeBorderPadding),w:Math.floor(S.width+2*O.SafeBorderPadding),h:Math.floor(S.height+2*O.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){var t=A.getRectFromPoints(this.tmpPoints);return{rect:A.getRectFromPoints(this.tmpPoints,e),pos:[Math.floor(t.x+t.w/2),Math.floor(t.y+t.h/2)],radius:[Math.floor(t.w/2),Math.floor(t.h/2)]}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new A.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=p,{type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a,op:d.flat(1),isSync:!0,index:0}):{type:A.EPostMessageType.None}}var v=A.computRect(h,this.oldRect);return this.oldRect=h,{rect:v,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a}}},{key:"consumeAll",value:function(e){var t,r,n=e.data,i=null==(t=null==n?void 0:n.workId)?void 0:t.toString();if(!i)return{type:A.EPostMessageType.None};if(this.tmpPoints.length<2)return{type:A.EPostMessageType.RemoveNode,removeIds:[i]};var o=this.transformData(),a=this.fullLayer,s=this.draw({ps:o,workId:i,layer:a,isDrawing:!1});this.oldRect=s;var u=o.flat(1),l=A.transformToSerializableData(u);return null==(r=this.vNodes)||r.setInfo(i,{rect:s,op:u,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&O.getCenterPos(s,a)}),{rect:s,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:i,ops:l,opt:this.workOptions,isSync:!0}}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=e.ps,o=e.replaceId,a=this.workOptions,s=a.strokeColor,u=a.fillColor,l=a.thickness,c=a.zIndex,h=a.scale,d=a.rotate,p=a.translate,v=(a.textOpt,r.worldPosition),g=r.worldScaling,m=this.computDrawPoints(i),y=m.points,_=m.rect,b=m.pos,x={close:!0,normalize:!0,points:y,lineWidth:l,fillColor:"transparent"!==u&&u||void 0,strokeColor:s,lineJoin:"round"},w={x:Math.floor(_.x*g[0]+v[0]-O.SafeBorderPadding),y:Math.floor(_.y*g[1]+v[1]-O.SafeBorderPadding),w:Math.floor(_.w*g[0]+2*O.SafeBorderPadding),h:Math.floor(_.h*g[0]+2*O.SafeBorderPadding)},S=new C.Group({name:t,id:t,zIndex:c,pos:b,anchor:[.5,.5],size:[_.w,_.h],scale:h,rotate:d,translate:p}),T=new C.Polyline(f(f({},x),{},{pos:[0,0]}));if(S.appendChild(T),n){var M=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/g[0],1/g[1]]});S.appendChild(M)}if(this.replace(r,o||t,S),h||d||p){var k=S.getBoundingClientRect();return{x:Math.floor(k.x-O.SafeBorderPadding),y:Math.floor(k.y-O.SafeBorderPadding),w:Math.floor(k.width+2*O.SafeBorderPadding),h:Math.floor(k.height+2*O.SafeBorderPadding)}}return w}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new A.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId,a=null==(t=this.workId)?void 0:t.toString();if(a){for(var s=[],u=0;uthis.syncUnitTime?(this.syncTimestamp=p,{type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0}):{type:A.EPostMessageType.None}}var v=A.computRect(u,this.oldRect);return this.oldRect=u,{rect:v,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a}}},{key:"consumeAll",value:function(e){var t,r,n=e.data,i=null==(t=null==n?void 0:n.workId)?void 0:t.toString();if(!i)return{type:A.EPostMessageType.None};if(this.tmpPoints.length<2)return{type:A.EPostMessageType.RemoveNode,removeIds:[i]};var o=this.fullLayer,a=this.draw({workId:i,layer:o,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),u=A.transformToSerializableData(s);return null==(r=this.vNodes)||r.setInfo(i,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&O.getCenterPos(a,o)}),{rect:a,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:i,ops:u,isSync:!0,opt:this.workOptions}}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,c=i.innerVerticeStep,h=i.innerRatio,d=i.scale,p=i.rotate,v=i.translate,g=r.worldScaling,m=this.computDrawPoints(s,l,c,h),y=m.rect,_=m.pos,b={close:!0,points:m.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round"},x={name:t,id:t,zIndex:u,pos:_,anchor:[.5,.5],size:[y.w,y.h],className:"".concat(_[0],",").concat(_[1])};d&&(x.scale=d),p&&(x.rotate=p),v&&(x.translate=v);var w=new C.Group(x);if(n){var S=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/g[0],1/g[1]]});w.append(S)}var T=new C.Polyline(f(f({},b),{},{pos:[0,0]}));w.append(T),this.replace(r,t,w);var M=w.getBoundingClientRect();return{x:Math.floor(M.x-O.SafeBorderPadding),y:Math.floor(M.y-O.SafeBorderPadding),w:Math.floor(M.width+2*O.SafeBorderPadding),h:Math.floor(M.height+2*O.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t,r,n){for(var i=A.getRectFromPoints(this.tmpPoints),o=[Math.floor(i.x+i.w/2),Math.floor(i.y+i.h/2)],a=A.getWHRatio(i.w,i.h),s=Math.floor(Math.min(i.w,i.h)/2),u=n*s,l=[],c=2*Math.PI/t,h=0;hthis.syncUnitTime?(this.syncTimestamp=p,{type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0}):{type:A.EPostMessageType.None}}var v=A.computRect(u,this.oldRect);return this.oldRect=u,{rect:v,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a}}},{key:"consumeAll",value:function(e){var t,r,n=e.data,i=null==(t=null==n?void 0:n.workId)?void 0:t.toString();if(!i)return{type:A.EPostMessageType.None};if(this.tmpPoints.length<2)return{type:A.EPostMessageType.RemoveNode,removeIds:[i]};var o=this.fullLayer,a=this.draw({workId:i,layer:o,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),u=A.transformToSerializableData(s);return null==(r=this.vNodes)||r.setInfo(i,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&O.getCenterPos(a,o)}),{rect:a,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:i,ops:u,isSync:!0,opt:this.workOptions}}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,c=i.scale,h=i.rotate,d=i.translate,p=r.worldScaling,v=this.computDrawPoints(s,l),g=v.rect,m=v.pos,y={close:!0,points:v.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round"},_={name:t,id:t,zIndex:u,pos:m,anchor:[.5,.5],size:[g.w,g.h]};c&&(_.scale=c),h&&(_.rotate=h),d&&(_.translate=d);var b=new C.Group(_);if(n){var x=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/p[0],1/p[1]]});b.append(x)}var w=new C.Polyline(f(f({},y),{},{pos:[0,0]}));b.append(w),this.replace(r,t,b);var S=b.getBoundingClientRect();return{x:Math.floor(S.x-O.SafeBorderPadding),y:Math.floor(S.y-O.SafeBorderPadding),w:Math.floor(S.width+2*O.SafeBorderPadding),h:Math.floor(S.height+2*O.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t){for(var r=A.getRectFromPoints(this.tmpPoints),n=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)],i=A.getWHRatio(r.w,r.h),o=Math.floor(Math.min(r.w,r.h)/2),a=[],s=2*Math.PI/t,u=0;u0&&void 0!==arguments[0]?arguments[0]:10,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=null,s=[];i||o?i&&!o?a=e.twoBezier:i&&o&&(a=e.threeBezier):a=e.oneBezier;for(var u=0;uthis.syncUnitTime?(this.syncTimestamp=p,{type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0}):{type:A.EPostMessageType.None}}var v=A.computRect(u,this.oldRect);return this.oldRect=u,{rect:v,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a}}},{key:"consumeAll",value:function(e){var t,r,n=e.data,i=null==(t=null==n?void 0:n.workId)?void 0:t.toString();if(!i)return{type:A.EPostMessageType.None};if(this.tmpPoints.length<2)return{type:A.EPostMessageType.RemoveNode,removeIds:[i]};var o=this.fullLayer,a=this.draw({workId:i,layer:o,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),u=A.transformToSerializableData(s);return null==(r=this.vNodes)||r.setInfo(i,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&O.getCenterPos(a,o)}),{rect:a,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:i,ops:u,isSync:!0,opt:this.workOptions}}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.fillColor,a=n.thickness,s=n.zIndex,u=n.placement,l=n.scale,c=n.rotate,h=n.translate,d=this.computDrawPoints(a,u),p=d.rect,v=d.pos,g={points:d.points.map((function(e){return e.XY})),lineWidth:a,fillColor:"transparent"!==o&&o||void 0,strokeColor:i,normalize:!0,className:"".concat(v[0],",").concat(v[1]),lineJoin:"round",close:!0},m={name:t,id:t,zIndex:s,pos:v,anchor:[.5,.5],size:[p.w,p.h]};l&&(m.scale=l),c&&(m.rotate=c),h&&(m.translate=h);var y=new C.Group(m),_=new C.Polyline(f(f({},g),{},{pos:[0,0]}));y.append(_),this.replace(r,t,y);var b=y.getBoundingClientRect();return{x:Math.floor(b.x-O.SafeBorderPadding),y:Math.floor(b.y-O.SafeBorderPadding),w:Math.floor(b.width+2*O.SafeBorderPadding),h:Math.floor(b.height+2*O.SafeBorderPadding)}}},{key:"transformControlPoints",value:function(e){var t=A.getRectFromPoints(this.tmpPoints);switch(e){case"bottom":case"bottomLeft":case"bottomRight":var r=t.y+t.h*this.ratio;return[new A.Vec2d(t.x,t.y,0),new A.Vec2d(t.x+t.w,t.y,0),new A.Vec2d(t.x+t.w,r,0),new A.Vec2d(t.x,r,0)];case"top":case"topLeft":case"topRight":var n=t.y+t.h*(1-this.ratio);return[new A.Vec2d(t.x,n,0),new A.Vec2d(t.x+t.w,n,0),new A.Vec2d(t.x+t.w,t.y+t.h,0),new A.Vec2d(t.x,t.y+t.h,0)];case"left":case"leftBottom":case"leftTop":var i=t.x+t.w*(1-this.ratio);return[new A.Vec2d(i,t.y,0),new A.Vec2d(t.x+t.w,t.y,0),new A.Vec2d(t.x+t.w,t.y+t.h,0),new A.Vec2d(i,t.y+t.h,0)];case"right":case"rightBottom":case"rightTop":var o=t.x+t.w*this.ratio;return[new A.Vec2d(t.x,t.y,0),new A.Vec2d(o,t.y,0),new A.Vec2d(o,t.y+t.h,0),new A.Vec2d(t.x,t.y+t.h,0)]}}},{key:"computDrawPoints",value:function(e,t){var r=A.getRectFromPoints(this.tmpPoints),n=this.transformControlPoints(t),i=Math.floor(.1*r.w),o=Math.floor(.1*r.h),a=[],s=A.Vec2d.Add(n[0],new A.Vec2d(0,o,0)),u=A.Vec2d.Add(n[0],new A.Vec2d(i,0,0)),c=Y.getBezierPoints(10,s,n[0],u),h=A.Vec2d.Sub(n[1],new A.Vec2d(i,0,0)),d=A.Vec2d.Add(n[1],new A.Vec2d(0,o,0)),f=Y.getBezierPoints(10,h,n[1],d),p=A.Vec2d.Sub(n[2],new A.Vec2d(0,o,0)),v=A.Vec2d.Sub(n[2],new A.Vec2d(i,0,0)),g=Y.getBezierPoints(10,p,n[2],v),m=A.Vec2d.Add(n[3],new A.Vec2d(i,0,0)),y=A.Vec2d.Sub(n[3],new A.Vec2d(0,o,0)),_=Y.getBezierPoints(10,m,n[3],y),b=i*(1-this.ratio)*10,x=o*(1-this.ratio)*10;switch(t){case"bottom":var w=A.Vec2d.Sub(n[2],new A.Vec2d(5*i-b/2,0,0)),S=A.Vec2d.Sub(n[2],new A.Vec2d(5*i,-x,0)),T=A.Vec2d.Sub(n[2],new A.Vec2d(5*i+b/2,0,0));a.push.apply(a,[S,T].concat(l(_),l(c),l(f),l(g),[w]));break;case"bottomRight":var M=A.Vec2d.Sub(n[2],new A.Vec2d(1.1*i,0,0)),k=A.Vec2d.Sub(n[2],new A.Vec2d(1.1*i+b/2,-x,0)),E=A.Vec2d.Sub(n[2],new A.Vec2d(1.1*i+b,0,0));a.push.apply(a,[k,E].concat(l(_),l(c),l(f),l(g),[M]));break;case"bottomLeft":var I=A.Vec2d.Add(n[3],new A.Vec2d(1.1*i+b,0,0)),C=A.Vec2d.Add(n[3],new A.Vec2d(1.1*i+b/2,x,0)),P=A.Vec2d.Add(n[3],new A.Vec2d(1.1*i,0,0));a.push.apply(a,[C,P].concat(l(_),l(c),l(f),l(g),[I]));break;case"top":var N=A.Vec2d.Sub(n[1],new A.Vec2d(5*i-b/2,0,0)),O=A.Vec2d.Sub(n[1],new A.Vec2d(5*i,x,0)),R=A.Vec2d.Sub(n[1],new A.Vec2d(5*i+b/2,0,0));a.push.apply(a,[O,N].concat(l(f),l(g),l(_),l(c),[R]));break;case"topRight":var D=A.Vec2d.Sub(n[1],new A.Vec2d(1.1*i,0,0)),L=A.Vec2d.Sub(n[1],new A.Vec2d(1.1*i+b/2,x,0)),j=A.Vec2d.Sub(n[1],new A.Vec2d(1.1*i+b,0,0));a.push.apply(a,[L,D].concat(l(f),l(g),l(_),l(c),[j]));break;case"topLeft":var z=A.Vec2d.Add(n[0],new A.Vec2d(1.1*i+b,0,0)),B=A.Vec2d.Add(n[0],new A.Vec2d(1.1*i+b/2,-x,0)),F=A.Vec2d.Add(n[0],new A.Vec2d(1.1*i,0,0));a.push.apply(a,[B,z].concat(l(f),l(g),l(_),l(c),[F]));break;case"left":var U=A.Vec2d.Add(n[0],new A.Vec2d(0,5*o-x/2,0)),W=A.Vec2d.Add(n[0],new A.Vec2d(-b,5*o,0)),G=A.Vec2d.Add(n[0],new A.Vec2d(0,5*o+x/2,0));a.push.apply(a,[W,U].concat(l(c),l(f),l(g),l(_),[G]));break;case"leftTop":var V=A.Vec2d.Add(n[0],new A.Vec2d(0,1.1*o,0)),H=A.Vec2d.Add(n[0],new A.Vec2d(-b,1.1*o+x/2,0)),$=A.Vec2d.Add(n[0],new A.Vec2d(0,1.1*o+x,0));a.push.apply(a,[H,V].concat(l(c),l(f),l(g),l(_),[$]));break;case"leftBottom":var X=A.Vec2d.Sub(n[3],new A.Vec2d(0,1.1*o+x,0)),q=A.Vec2d.Sub(n[3],new A.Vec2d(b,1.1*o+x/2,0)),Q=A.Vec2d.Sub(n[3],new A.Vec2d(0,1.1*o,0));a.push.apply(a,[q,X].concat(l(c),l(f),l(g),l(_),[Q]));break;case"right":var Z=A.Vec2d.Add(n[1],new A.Vec2d(0,5*o-x/2,0)),K=A.Vec2d.Add(n[1],new A.Vec2d(b,5*o,0)),J=A.Vec2d.Add(n[1],new A.Vec2d(0,5*o+x/2,0));a.push.apply(a,[K,J].concat(l(g),l(_),l(c),l(f),[Z]));break;case"rightTop":var ee=A.Vec2d.Add(n[1],new A.Vec2d(0,1.1*o,0)),te=A.Vec2d.Add(n[1],new A.Vec2d(b,1.1*o+x/2,0)),re=A.Vec2d.Add(n[1],new A.Vec2d(0,1.1*o+x,0));a.push.apply(a,[te,re].concat(l(g),l(_),l(c),l(f),[ee]));break;case"rightBottom":var ne=A.Vec2d.Sub(n[2],new A.Vec2d(0,1.1*o+x,0)),ie=A.Vec2d.Sub(n[2],new A.Vec2d(-b,1.1*o+x/2,0)),oe=A.Vec2d.Sub(n[2],new A.Vec2d(0,1.1*o,0));a.push.apply(a,[ie,oe].concat(l(g),l(_),l(c),l(f),[ne]))}var ae=A.getRectFromPoints(this.tmpPoints,e);return{rect:ae,pos:[Math.floor(ae.x+ae.w/2),Math.floor(ae.y+ae.h/2)],points:a}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new A.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i)||A.Point2d.Sub(n,r).XY.includes(0))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a0?A.EScaleType.proportional:A.EScaleType.all}},{key:"updateNodeOpt",value:function(e){var t=e.node,r=e.opt,i=e.vNodes,o=e.targetNode,a=r.translate,s=r.box,u=r.boxScale,l=r.boxTranslate,c=r.angle,h=r.isLocked,d=r.zIndex,f=o&&A.cloneDeep(o)||i.get(t.name);if(f){var p=t.parent;if(p){if(A.isNumber(d)&&(t.setAttribute("zIndex",d),f.opt.zIndex=d),A.isBoolean(h)&&(f.opt.locked=h),s&&l&&u){var v=f.opt,g=v.centerX,m=v.centerY,y=v.width,_=v.height,b=v.uniformScale,x=v.rotate,w=Math.min(u[0],u[1]),S=!1!==b?[w,w]:u,T=A.getRectRotatedPoints({x:g-y/2,y:m-_/2,w:y,h:_},x||0),M=A.getScalePoints(T,new A.Vec2d(g,m),S),k=A.getRotatePoints(M,new A.Vec2d(g,m),-(x||0)),E=A.getRectFromPoints(k);f.opt.width=Math.round(E.w),f.opt.height=Math.round(E.h);var I=[l[0]/p.worldScaling[0],l[1]/p.worldScaling[1]];f.opt.centerX=g+I[0],f.opt.centerY=m+I[1];var C=[f.centerPos[0]+I[0],f.centerPos[1]+I[1]];if(f.centerPos=C,o){var P=A.getRectScaleed(f.rect,u);P=A.getRectTranslated(P,I),f.rect=P}else{var N=O.getRectFromLayer(p,t.name);f.rect=N||f.rect}}else if(a)if(f.opt.centerX=f.opt.centerX+a[0],f.opt.centerY=f.opt.centerY+a[1],f.centerPos=[f.centerPos[0]+a[0],f.centerPos[1]+a[1]],o){var R=[a[0]*p.worldScaling[0],a[1]*p.worldScaling[1]],D=A.getRectTranslated(f.rect,R);f.rect=D}else{var L=O.getRectFromLayer(p,t.name);f.rect=L||f.rect}else if(A.isNumber(c))if(f.opt.rotate=c,f.scaleType=n.getScaleType(f.opt),o){var j=A.getRectRotated(f.rect,c);f.rect=j}else{var z=O.getRectFromLayer(p,t.name);f.rect=z||f.rect}return f&&i.setInfo(t.name,f),null==f?void 0:f.rect}}}}]),n}(O),q=function(e){g(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),I(b(n),"canRotate",!1),I(b(n),"scaleType",A.EScaleType.both),I(b(n),"toolsType",A.EToolsKey.Straight),I(b(n),"tmpPoints",[]),I(b(n),"workOptions"),I(b(n),"oldRect"),I(b(n),"straightTipWidth"),I(b(n),"syncTimestamp"),n.workOptions=e.toolsOpt,n.straightTipWidth=n.workOptions.thickness/2,n.syncTimestamp=0,n.syncUnitTime=50,n}return M(r,[{key:"consume",value:function(e){var t,r=e.data,n=e.isFullWork,i=e.isSubWorker,o=e.isMainThread,a=null==(t=null==r?void 0:r.workId)?void 0:t.toString();if(!a)return{type:A.EPostMessageType.None};var s,u,c=r.op,h=r.workState,d=null==c?void 0:c.length;if(!d||d<2)return{type:A.EPostMessageType.None};if(h===A.EvevtWorkState.Start?(this.tmpPoints=[new A.Point2d(c[0],c[1])],s=!1):s=this.updateTempPoints(c),!s)return{type:A.EPostMessageType.None};if(i||o){var f=n?this.fullLayer:this.drawLayer||this.fullLayer;u=this.draw({workId:a,layer:f})}if(!i){var p=Date.now();return p-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=p,{type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0}):{type:A.EPostMessageType.None}}var v=A.computRect(u,this.oldRect);return this.oldRect=u,{rect:v,type:A.EPostMessageType.DrawWork,dataType:A.EDataType.Local,workId:a}}},{key:"consumeAll",value:function(e){var t,r,n=e.data,i=null==(t=null==n?void 0:n.workId)?void 0:t.toString();if(!i)return{type:A.EPostMessageType.None};if(this.tmpPoints.length<2)return{type:A.EPostMessageType.RemoveNode,removeIds:[i]};var o=this.fullLayer,a=this.draw({workId:i,layer:o});this.oldRect=a;var s=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),u=A.transformToSerializableData(s);return null==(r=this.vNodes)||r.setInfo(i,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&O.getCenterPos(a,o)}),{rect:a,type:A.EPostMessageType.FullWork,dataType:A.EDataType.Local,workId:i,ops:u,isSync:!0,opt:this.workOptions}}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=r.worldPosition,h=r.worldScaling,d=this.computDrawPoints(o),f=d.d,p=d.rect,v=[p.x+p.w/2,p.y+p.h/2],g={pos:v,name:t,id:t,d:f,fillColor:i,strokeColor:i,lineWidth:0,className:"".concat(v[0],",").concat(v[1]),normalize:!0,zIndex:a};s&&(g.scale=s),u&&(g.rotate=u),l&&(g.translate=l);var m=new C.Path(g);if(this.replace(r,t,m),u||s||l){var y=m.getBoundingClientRect();return{x:Math.floor(y.x-O.SafeBorderPadding),y:Math.floor(y.y-O.SafeBorderPadding),w:Math.floor(y.width+2*O.SafeBorderPadding),h:Math.floor(y.height+2*O.SafeBorderPadding)}}return{x:Math.floor(p.x*h[0]+c[0]-O.SafeBorderPadding),y:Math.floor(p.y*h[1]+c[1]-O.SafeBorderPadding),w:Math.floor(p.w*h[0]+2*O.SafeBorderPadding),h:Math.floor(p.h*h[1]+2*O.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(e):this.computDotPoints(e)}},{key:"computFullPoints",value:function(e){var t=A.Vec2d.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=A.Vec2d.Per(t).mul(e/2),n=A.Point2d.Sub(this.tmpPoints[0],r),i=A.Point2d.Add(this.tmpPoints[0],r),o=A.Point2d.Sub(this.tmpPoints[1],r),a=A.Point2d.Add(this.tmpPoints[1],r),s=A.Point2d.GetSemicircleStroke(this.tmpPoints[1],o,-1,8),u=A.Point2d.GetSemicircleStroke(this.tmpPoints[0],i,-1,8),c=[n,o].concat(l(s),[a,i],l(u));return{d:R(c,!0),rect:A.getRectFromPoints(c),isDot:!1,pos:this.tmpPoints[0].XY}}},{key:"computDotPoints",value:function(e){var t=A.Point2d.GetDotStroke(this.tmpPoints[0],e/2,8);return{d:R(t,!0),rect:A.getRectFromPoints(t),isDot:!0,pos:this.tmpPoints[0].XY}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new A.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a1&&void 0!==arguments[1])||arguments[1],n=a(this.curNodeMap.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(A.isIntersect(e,i.rect)){if(r&&i.toolsType===A.EToolsKey.Image&&i.opt.locked||r&&i.toolsType===A.EToolsKey.Text&&(i.opt.workState===A.EvevtWorkState.Doing||i.opt.workState===A.EvevtWorkState.Start))continue;return!0}}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"getRectIntersectRange",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=new Map,s=a(this.curNodeMap.entries());try{for(s.s();!(r=s.n()).done;){var u=o(r.value,2),l=u[0],c=u[1];if(A.isIntersect(e,c.rect)){if(n&&c.toolsType===A.EToolsKey.Image&&c.opt.locked||n&&c.toolsType===A.EToolsKey.Text&&(c.opt.workState===A.EvevtWorkState.Doing||c.opt.workState===A.EvevtWorkState.Start))continue;t=A.computRect(t,c.rect),i.set(l,c)}}}catch(e){s.e(e)}finally{s.f()}return{rectRange:t,nodeRange:i}}},{key:"getNodeRectFormShape",value:function(e,t){var r,n=Z(t.toolsType);if(t.toolsType===A.EToolsKey.Text){var i=null==(r=this.fullLayer)?void 0:r.getElementsByName(e)[0];i&&n.updateLabels(t,i,this.fullLayer)}return this.fullLayer&&(null==n?void 0:n.getRectFromLayer(this.fullLayer,e))}},{key:"updateNodesRect",value:function(){var e,t=a(this.curNodeMap.entries());try{for(t.s();!(e=t.n()).done;){var r=o(e.value,2),n=r[0],i=r[1],s=this.getNodeRectFormShape(n,i);s?(i.rect=s,this.curNodeMap.set(n,i)):this.curNodeMap.delete(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"combineIntersectRect",value:function(e){var t=e;return this.curNodeMap.forEach((function(e){A.isIntersect(t,e.rect)&&(t=A.computRect(t,e.rect))})),t}},{key:"setTarget",value:function(){return this.targetNodeMap.push(A.cloneDeep(this.curNodeMap)),this.targetNodeMap.length-1}},{key:"getLastTarget",value:function(){return this.targetNodeMap[this.targetNodeMap.length-1]}},{key:"deleteLastTarget",value:function(){this.targetNodeMap.length=this.targetNodeMap.length-1}},{key:"getTarget",value:function(e){return this.targetNodeMap[e]}},{key:"deleteTarget",value:function(e){this.targetNodeMap.length=e}},{key:"clearTarget",value:function(){this.targetNodeMap.length=0}}]),e}(),ne=function(){function e(t){S(this,e),I(this,"vNodes"),I(this,"thread"),I(this,"serviceWorkShapes",new Map),I(this,"localWorkShapes",new Map),I(this,"tmpOpt"),I(this,"tmpWorkShapeNode"),I(this,"animationId"),this.vNodes=t.vNodes,this.thread=t.thread}return M(e,[{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.topLayer.children.length&&(this.thread.topLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.serviceWorkShapes.clear(),this.localWorkShapes.clear()}},{key:"consumeDraw",value:function(e){var t=e.workId;if(e.dataType===A.EDataType.Service)this.activeServiceWorkShape(e);else{var r=null==t?void 0:t.toString(),n=r&&this.localWorkShapes.get(r);if(!n)return;var i=n.node.consume({data:e,isFullWork:!1,isSubWorker:!0});i.rect&&(n.result=i,n.workState=A.EvevtWorkState.Doing,r&&this.localWorkShapes.set(r,n))}this.runAnimation()}},{key:"setToolsOpt",value:function(e){this.tmpOpt=e,this.tmpWorkShapeNode=this.createWorkShapeNode(e)}},{key:"createWorkShapeNode",value:function(e){if(e.toolsType===A.EToolsKey.LaserPen)return K(f(f({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.topLayer,drawLayer:this.thread.topLayer}))}},{key:"getTmpWorkShapeNode",value:function(){return this.tmpWorkShapeNode}},{key:"setTmpWorkId",value:function(e){if(e&&this.tmpWorkShapeNode)return this.tmpWorkShapeNode.setWorkId(e),this.localWorkShapes.set(e,{node:this.tmpWorkShapeNode,toolsType:this.tmpWorkShapeNode.toolsType,workState:A.EvevtWorkState.Start}),void(this.tmpOpt&&this.setToolsOpt(this.tmpOpt))}},{key:"setNodeKey",value:function(e,t,r){return e.toolsType=t,e.node=this.createWorkShapeNode({toolsType:t,toolsOpt:r}),e}},{key:"activeServiceWorkShape",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.toolsType,a=e.type,s=e.updateNodeOpt,u=e.ops,l=e.op;if(n){var c=n.toString(),h=null==(t=this.vNodes.get(c))?void 0:t.rect;if(null==(r=this.serviceWorkShapes)||!r.has(c)){var d={toolsType:o,animationWorkData:l||[],animationIndex:0,type:a,updateNodeOpt:s,ops:u,oldRect:h};o&&i&&(d=this.setNodeKey(d,o,i)),this.serviceWorkShapes.set(c,d)}var f=this.serviceWorkShapes.get(c);a&&(f.type=a),u&&(f.animationWorkData=A.transformToNormalData(u),f.ops=u),s&&(f.updateNodeOpt=s),l&&(f.animationWorkData=l),f.node&&f.node.getWorkId()!==c&&f.node.setWorkId(c),h&&(f.oldRect=h),o&&i&&(f.toolsType!==o&&o&&i&&this.setNodeKey(f,o,i),f.node&&f.node.setWorkOptions(i))}}},{key:"computNextAnimationIndex",value:function(e,t){var r,n=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/((null==(r=e.node)?void 0:r.syncUnitTime)||1e3))*t;return Math.min((e.animationIndex||0)+(n||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:function(){var e,t,r,n,i=this;this.animationId=void 0;var s,u=!1,l=new Map,c=[],h=a(this.serviceWorkShapes.entries());try{for(h.s();!(s=h.n()).done;){var d=o(s.value,2),f=d[0],p=d[1];switch(p.toolsType){case A.EToolsKey.LaserPen:var v=this.computNextAnimationIndex(p,8),g=Math.max(0,p.animationIndex||0),m=(p.animationWorkData||[]).slice(g,v);if((p.animationIndex||0)0&&void 0!==arguments[0]&&arguments[0],r=this.workShapes.get(A.Storage_Selector_key);if(r){if(r&&(null==(e=r.selectIds)||!e.length))return this.blurSelector();var n=r.reRenderSelector();n&&this.thread.post({sp:[{type:A.EPostMessageType.Select,selectIds:r.selectIds,selectRect:n,willSyncService:t,viewId:this.thread.viewId,points:r.getChildrenPoints(),textOpt:r.textOpt,selectorColor:r.selectorColor,strokeColor:r.strokeColor,fillColor:r.fillColor,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,opt:r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt}]})}}},{key:"blurSelector",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.workShapes.get(A.Storage_Selector_key),i=null==n?void 0:n.blurSelector(),this.clearWorkShapeNodeCache(A.Storage_Selector_key),(null==(r=this.thread.fullLayer)?void 0:r.parent).children.forEach((function(e){e.name===A.Storage_Selector_key&&e.remove()})),i&&((o=[]).push(f(f({},i),{},{isSync:null==t?void 0:t.isSync})),this.thread.post({sp:o}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"clearWorkShapeNodeCache",value:function(e){var t,r;null==(t=this.getWorkShape(e))||t.clearTmpPoints(),this.workShapes.delete(e),(null==(r=this.tmpWorkShapeNode)?void 0:r.getWorkId())===e&&this.setTmpWorkId(void 0)}},{key:"drawEraser",value:function(e){var t,r,n=this,i=[];if(null!=(t=e.newWorkDatas)&&t.size){var o,s=a(e.newWorkDatas.values());try{for(s.s();!(o=s.n()).done;){var u=o.value,l=u.workId.toString();this.batchEraserWorks.add(l),i.push({type:A.EPostMessageType.FullWork,workId:l,ops:A.transformToSerializableData(u.op),opt:u.opt,toolsType:u.toolsType,updateNodeOpt:{useAnimation:!1}})}}catch(e){s.e(e)}finally{s.f()}delete e.newWorkDatas}null==(r=e.removeIds)||r.forEach((function(e){n.batchEraserRemoveNodes.add(e)})),i.push(e),this.thread.post({sp:i}),this.batchEraserCombine()}},{key:"updateBatchEraserCombineNode",value:function(e,t){var r,n=this,i=a(t.keys());try{for(i.s();!(r=i.n()).done;){var o=r.value;this.thread.fullLayer.getElementsByName(o).forEach((function(e){e.remove()}))}}catch(e){i.e(e)}finally{i.f()}e.forEach((function(e){var t=n.vNodes.get(e);if(t&&t.toolsType===A.EToolsKey.Pencil&&!n.thread.fullLayer.getElementsByName(e)[0]){var r=n.setFullWork(f(f({},t),{},{workId:e}));r&&r.consumeService({op:t.op,isFullWork:!0})}}))}},{key:"getWorkShape",value:function(e){return this.workShapes.get(e)}},{key:"getWorkShapes",value:function(){return this.workShapes}},{key:"consumeDraw",value:function(e,t){var r=e.op,n=e.workId,i=e.scenePath;if(null!=r&&r.length&&n){var o=this.workShapes.get(n.toString());if(!o)return;var a=o.toolsType;if(a===A.EToolsKey.LaserPen)return;switch(a){case A.EToolsKey.Selector:var s=o.consume({data:e,isFullWork:!0});s.type===A.EPostMessageType.Select&&(s.selectIds&&t.runReverseSelectWork(s.selectIds),this.thread.post({sp:[s]}));break;case A.EToolsKey.Eraser:var u=o.consume({data:e,isFullWork:!0});null!=u&&u.rect&&this.drawEraser(u);break;case A.EToolsKey.Arrow:case A.EToolsKey.Straight:case A.EToolsKey.Ellipse:case A.EToolsKey.Rectangle:case A.EToolsKey.Star:case A.EToolsKey.Polygon:case A.EToolsKey.SpeechBalloon:case A.EToolsKey.Pencil:var l=o.consume({data:e,isFullWork:!1,isMainThread:!0});l&&(this.drawCount++,this.thread.post({drawCount:this.drawCount,sp:l.op&&[f(f({},l),{},{scenePath:i})]||void 0}))}}}},{key:"consumeDrawAll",value:function(e,t){var r,n,i,o=e.workId,a=e.scenePath;if(o){var s=o.toString(),u=this.workShapes.get(s);if(!u)return;var l=u.toolsType;if(l===A.EToolsKey.LaserPen)return;var c=this.workShapes.get(te),h=null==(r=null==c?void 0:c.selectIds)?void 0:r[0],d=u.consumeAll({data:e});switch(l){case A.EToolsKey.Selector:d.selectIds&&h&&null!=(n=d.selectIds)&&n.includes(h)&&c.cursorBlur(),d.type===A.EPostMessageType.Select&&(d.selectIds&&t.runReverseSelectWork(d.selectIds),this.thread.post({sp:[f(f({},d),{},{scenePath:a})]})),null!=(i=u.selectIds)&&i.length?u.clearTmpPoints():this.clearWorkShapeNodeCache(s);break;case A.EToolsKey.Eraser:null!=d&&d.rect&&this.drawEraser(f(f({},d),{},{scenePath:a})),u.clearTmpPoints();break;case A.EToolsKey.Arrow:case A.EToolsKey.Straight:case A.EToolsKey.Ellipse:case A.EToolsKey.Rectangle:case A.EToolsKey.Star:case A.EToolsKey.Polygon:case A.EToolsKey.SpeechBalloon:case A.EToolsKey.Pencil:d&&(this.drawCount=0,this.thread.post({drawCount:this.drawCount,sp:[d]})),this.clearWorkShapeNodeCache(s)}}}},{key:"getTmpWorkShapeNode",value:function(){return this.tmpWorkShapeNode}},{key:"setToolsOpt",value:function(e){var t,r=e.toolsType;null!=(t=this.tmpOpt)&&t.toolsType&&this.tmpOpt.toolsType!==r&&this.clearAllWorkShapesCache(),this.tmpOpt=e,this.tmpWorkShapeNode=this.createWorkShapeNode(e)}},{key:"setTmpWorkId",value:function(e){if(e&&this.tmpWorkShapeNode)return this.tmpWorkShapeNode.setWorkId(e),this.workShapes.set(e,this.tmpWorkShapeNode),void(this.tmpOpt&&this.setToolsOpt(this.tmpOpt))}},{key:"setWorkOptions",value:function(e,t){var r;this.workShapes.get(e)||this.setTmpWorkId(e),null==(r=this.workShapes.get(e))||r.setWorkOptions(t)}},{key:"createWorkShapeNode",value:function(e){return K(f(f({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.localLayer}),this.thread.serviceWork)}}]),e}(),oe=function(){function e(t){S(this,e),I(this,"vNodes"),I(this,"thread"),I(this,"workShapes",new Map),I(this,"selectorWorkShapes",new Map),I(this,"willRunEffectSelectorIds",new Set),I(this,"runEffectId"),I(this,"animationId"),this.vNodes=t.vNodes,this.thread=t.thread}var t;return M(e,[{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.serviceLayer.children.length&&(this.thread.serviceLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear()}},{key:"runEffect",value:function(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0))}},{key:"effectRunSelector",value:function(){var e=this;this.runEffectId=void 0,this.willRunEffectSelectorIds.forEach((function(t){var r,n,i=e.selectorWorkShapes.get(t);i&&i.selectIds&&(null==(r=i.node)||r.selectServiceNode(t,i,!0)),null!=(n=null==i?void 0:i.selectIds)&&n.length||e.selectorWorkShapes.delete(t)})),this.willRunEffectSelectorIds.clear()}},{key:"runSelectWork",value:function(e){this.activeSelectorShape(e);var t=e.workId,r=null==t?void 0:t.toString();r&&this.willRunEffectSelectorIds.add(r),this.runEffect()}},{key:"removeWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();if(r){if(this.workShapes.get(r))return this.workShapes.delete(r),void this.removeNode(r,e);this.removeNode(r,e)}}},{key:"consumeFull",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"runReverseSelectWork",value:function(e){var t=this;e.forEach((function(e){t.selectorWorkShapes.forEach((function(r,n){var i;if(null!=(i=r.selectIds)&&i.length){var o=r.selectIds.indexOf(e);o>-1&&(r.selectIds.splice(o,1),t.willRunEffectSelectorIds.add(n))}}))})),this.willRunEffectSelectorIds.size&&this.runEffect()}},{key:"consumeDraw",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"computNextAnimationIndex",value:function(e,t){var r,n=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/((null==(r=e.node)?void 0:r.syncUnitTime)||1e3))*t;return Math.min((e.animationIndex||0)+(n||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:(t=u(regeneratorRuntime.mark((function e(){var t,r,n,i,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.animationId=void 0,_=!1,b=new Map,x=a(this.workShapes.entries()),e.prev=4,S=regeneratorRuntime.mark((function e(){var a,x,S,T,k,E,I,C,P,N;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=o(w.value,2),x=a[0],S=a[1],e.t0=S.toolsType,e.next=e.t0===A.EToolsKey.Image?4:e.t0===A.EToolsKey.Text?9:e.t0===A.EToolsKey.Arrow||e.t0===A.EToolsKey.Straight||e.t0===A.EToolsKey.Rectangle||e.t0===A.EToolsKey.Ellipse||e.t0===A.EToolsKey.Star||e.t0===A.EToolsKey.Polygon||e.t0===A.EToolsKey.SpeechBalloon?17:e.t0===A.EToolsKey.Pencil?20:33;break;case 4:return e.next=6,null==(r=S.node)?void 0:r.consumeServiceAsync({isFullWork:!0,scene:null==(t=M.thread.fullLayer.parent)?void 0:t.parent,isMainThread:!0});case 6:return M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),M.workShapes.delete(x),e.abrupt("break",33);case 9:if(e.t1=S.node,!e.t1){e.next=16;break}return e.next=13,null==(n=S.node)?void 0:n.consumeServiceAsync({isFullWork:!0,replaceId:x});case 13:M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),null==(i=S.node)||i.clearTmpPoints(),M.workShapes.delete(x);case 16:return e.abrupt("break",33);case 17:return T=!!S.ops,null!=(s=S.animationWorkData)&&s.length&&(k=S.oldRect,null==(u=S.node)||u.consumeService({op:S.animationWorkData,isFullWork:T}),T&&(M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),null==(l=S.node)||l.clearTmpPoints(),M.workShapes.delete(x)),b.set(x,{workState:k?S.ops?A.EvevtWorkState.Done:A.EvevtWorkState.Doing:A.EvevtWorkState.Start,op:S.animationWorkData.filter((function(e,t){if(t%3!=2)return!0})).slice(-2)}),S.animationWorkData.length=0),e.abrupt("break",33);case 20:if(S.useAnimation||!S.ops){e.next=24;break}null==(c=S.node)||c.consumeService({op:S.animationWorkData||[],isFullWork:!0,replaceId:x}),null==(h=S.node)||h.updataOptService(S.updateNodeOpt),M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),null==(d=S.node)||d.clearTmpPoints(),M.workShapes.delete(x),e.next=32;break;case 24:if(!S.useAnimation){e.next=32;break}if(!S.isDel){e.next=28;break}return null==(f=S.node)||f.clearTmpPoints(),M.workShapes.delete(x),e.abrupt("break",33);case 28:return E=M.computNextAnimationIndex(S,3),I=S.isDiff?0:Math.max(0,(S.animationIndex||0)-3),C=(S.animationWorkData||[]).slice(I,E),P=null==(v=null==(p=S.node)?void 0:p.getWorkId())?void 0:v.toString(),(S.animationIndex||0)-1&&this.removeSelectWork(t),this.thread.fullLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.thread.serviceLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.vNodes.delete(e)}},{key:"removeSelectWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();r&&(this.activeSelectorShape(e),this.willRunEffectSelectorIds.add(r)),this.runEffect()}},{key:"activeSelectorShape",value:function(e){var t,r,n,i=e.workId,o=e.opt,a=e.toolsType,s=e.type,u=e.selectIds;if(i){var l=i.toString();if(null==(t=this.selectorWorkShapes)||!t.has(l)){var c={toolsType:a,selectIds:u,type:s,opt:o};a&&o&&(c=this.setNodeKey(c,a,o)),null==(r=this.selectorWorkShapes)||r.set(l,c)}var h=null==(n=this.selectorWorkShapes)?void 0:n.get(l);s&&(h.type=s),h.node&&h.node.getWorkId()!==l&&h.node.setWorkId(l),h.selectIds=u||[]}}},{key:"setNodeKey",value:function(e,t,r){return e.toolsType=t,e.node=K({toolsType:t,toolsOpt:r,vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.serviceLayer},this),e}}]),e}(),ae=function(){function e(){S(this,e),I(this,"localWork"),I(this,"serviceWork"),I(this,"scene")}return M(e,[{key:"registerMainThread",value:function(e,t,r){return this.localWork=e,this.serviceWork=t,this.scene=r,this}}]),e}(),se=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.CopyNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.FullWork||n!==A.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,e.t0=n,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.consumeFull(t,this.scene);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),i}(ae),ue=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.SetColorNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,s=t.isSync,u=t.textUpdateForWoker,l=r.sp||[];if(i){var c,h=a(n.entries());try{for(h.s();!(c=h.n()).done;){var d=o(c.value,2),p=d[0],v=d[1];u&&v.toolsType===A.EToolsKey.Text?l.push(f(f({},v),{},{workId:p,type:A.EPostMessageType.TextUpdate,dataType:A.EDataType.Local,willSyncService:!0})):l.push(f(f({},v),{},{workId:p,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){h.e(e)}finally{h.f()}}return{sp:l}}}]),i}(ae),le=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.ZIndexNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,s=t.isSync,u=r.sp||[];if(i&&u){var l,c=a(n.entries());try{for(c.s();!(l=c.n()).done;){var h=o(l.value,2),d=h[0],p=h[1];u.push(f(f({},p),{},{workId:d,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){c.e(e)}finally{c.f()}}return{sp:u}}}]),i}(ae),ce=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.TranslateNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.workId,o=t.updateNodeOpt,a=t.willRefreshSelector,s=t.willSyncService,u=t.willSerializeData,l=t.textUpdateForWoker,c=t.emitEventType,e.t0=i===F.selectorId&&o,!e.t0){e.next=9;break}if(!(o.workState===A.EvevtWorkState.Done&&null!=o&&o.translate&&(o.translate[0]||o.translate[1])||o.workState!==A.EvevtWorkState.Done)){e.next=8;break}return e.next=6,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:o,willRefreshSelector:a,willSyncService:s,willSerializeData:u,isSync:!0,textUpdateForWoker:l,emitEventType:c,scene:this.scene,callback:this.updateSelectorCallback});case 6:e.next=9;break;case 8:o.workState===A.EvevtWorkState.Done&&(null==(n=this.localWork)||n.vNodes.deleteLastTarget());case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=t.updateSelectorOpt,h=t.textUpdateForWoker,d=c.workState,p=r.sp||[];if(d===A.EvevtWorkState.Start)return{sp:[],render:[]};var v=null==s?void 0:s.selectRect;if(u){d===A.EvevtWorkState.Doing&&p.push({type:A.EPostMessageType.Select,selectIds:i.selectIds,selectRect:v,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});var g,m=a(n.entries());try{for(m.s();!(g=m.n()).done;){var y=o(g.value,2),_=y[0],b=y[1];h&&b.toolsType===A.EToolsKey.Text?p.push(f(f({},b),{},{workId:_,type:A.EPostMessageType.TextUpdate,dataType:A.EDataType.Local,willSyncService:!0})):p.push(f(f({},b),{},{workId:_,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){m.e(e)}finally{m.f()}}return{sp:p}}}]),i}(ae),he=function(e){g(n,e);var t,r=y(n);function n(){var e;return S(this,n),e=r.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.DeleteNode),e}return M(n,[{key:"consume",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.RemoveNode){e.next=6;break}if(n!==A.EDataType.Local||i!==this.emitEventType){e.next=4;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 4:if(n!==A.EDataType.Service||i!==this.emitEventType){e.next=6;break}return e.abrupt("return",(this.consumeForServiceWorker(t),!0));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"consumeForLocalWorker",value:function(e){if(this.localWork){var t=e.removeIds,r=e.willSyncService;if(null!=t&&t.length){var n,i=[],o=[],s=a(t);try{for(s.s();!(n=s.n()).done;){var u=n.value;if(u!==A.Storage_Selector_key){var c=this.commandDeleteText(u);c&&i.push(c),this.localWork.removeNode(u),o.push(u)}else{var h=this.localWork.workShapes.get(A.Storage_Selector_key);if(!h)return;var d,f=a(h.selectIds&&l(h.selectIds)||[]);try{for(f.s();!(d=f.n()).done;){var p=d.value;if(this.localWork.vNodes.get(p)){var v=this.commandDeleteText(p);v&&i.push(v)}this.localWork.removeNode(p),o.push(p)}}catch(e){f.e(e)}finally{f.f()}this.localWork.blurSelector()}}}catch(e){s.e(e)}finally{s.f()}r&&i.push({type:A.EPostMessageType.RemoveNode,removeIds:o}),i.length&&this.localWork.thread.post({sp:i})}}}},{key:"consumeForServiceWorker",value:function(e){this.serviceWork&&this.serviceWork.removeWork(e)}},{key:"commandDeleteText",value:function(e){var t,r=null==(t=this.localWork)?void 0:t.vNodes.get(e);if(r&&r.toolsType===A.EToolsKey.Text)return{type:A.EPostMessageType.TextUpdate,toolsType:A.EToolsKey.Text,workId:e,dataType:A.EDataType.Local}}}]),n}(ae),de=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.ScaleNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willSyncService,a=t.willSerializeData,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willSyncService:o,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,s=e.newServiceStore,u=t.updateSelectorOpt,l=t.willSyncService,c=t.willSerializeData,h=u.workState,d=r.sp||[],p=null==i?void 0:i.selectRect;if(h===A.EvevtWorkState.Start)return{sp:[],render:[]};if(l){h===A.EvevtWorkState.Doing&&d.push({type:A.EPostMessageType.Select,selectIds:n.selectIds,selectRect:p,willSyncService:!0,isSync:!0,points:n.getChildrenPoints(),textOpt:n.textOpt}),c&&h===A.EvevtWorkState.Done&&d.push({type:A.EPostMessageType.Select,selectIds:n.selectIds,selectRect:p,willSyncService:!1,isSync:!0,points:n.getChildrenPoints(),textOpt:n.textOpt});var v,g=a(s.entries());try{for(g.s();!(v=g.n()).done;){var m=o(v.value,2),y=m[0],_=m[1];_.toolsType===A.EToolsKey.Text?d.push(f(f({},_),{},{workId:y,type:A.EPostMessageType.TextUpdate,dataType:A.EDataType.Local,willSyncService:!0})):d.push(f(f({},_),{},{workId:y,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}))}}catch(e){g.e(e)}finally{g.f()}}return{sp:d}}}]),i}(ae),fe=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.RotateNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.emitEventType,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,emitEventType:u,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,s=e.newServiceStore,u=t.updateSelectorOpt,l=t.willSyncService,c=t.willSerializeData,h=t.isSync,d=u.workState,p=r.sp||[],v=null==i?void 0:i.selectRect;if(l){c&&d===A.EvevtWorkState.Done&&p.push({type:A.EPostMessageType.Select,selectIds:n.selectIds,selectRect:v,willSyncService:!0,isSync:h,points:n.getChildrenPoints()});var g,m=a(s.entries());try{for(m.s();!(g=m.n()).done;){var y=o(g.value,2),_=y[0],b=y[1];p.push(f(f({},b),{},{workId:_,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}))}}catch(e){m.e(e)}finally{m.f()}}return{sp:p}}}]),i}(ae),pe=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.SetFontStyle),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=t.updateSelectorOpt,h=t.textUpdateForWoker,d=r.sp||[],p=null==s?void 0:s.selectRect;if(u&&d){c.fontSize&&d.push({type:A.EPostMessageType.Select,selectIds:i.selectIds,selectRect:p,willSyncService:u,isSync:l,points:i.getChildrenPoints()});var v,g=a(n.entries());try{for(g.s();!(v=g.n()).done;){var m=o(v.value,2),y=m[0],_=m[1];h&&_.toolsType===A.EToolsKey.Text?d.push(f(f({},_),{},{workId:y,type:A.EPostMessageType.TextUpdate,dataType:A.EDataType.Local,willSyncService:!0})):d.push(f(f({},_),{},{workId:y,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){g.e(e)}finally{g.f()}}return{sp:d}}}]),i}(ae),ve=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.SetPoint),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:s,isSync:!0,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=r.sp||[],h=null==s?void 0:s.selectRect;if(u&&c){var d,p=a(n.entries());try{for(p.s();!(d=p.n()).done;){var v=o(d.value,2),g=v[0],m=v[1];c.push(f(f({},m),{},{workId:g,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){p.e(e)}finally{p.f()}c.push({type:A.EPostMessageType.Select,selectIds:i.selectIds,selectRect:h,willSyncService:u,isSync:l,points:i.getChildrenPoints()})}return{sp:c}}}]),i}(ae),ge=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.SetLock),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=t.updateSelectorOpt,h=r.sp||[],d=null==s?void 0:s.selectRect;if(u&&h){var p,v=a(n.entries());try{for(v.s();!(p=v.n()).done;){var g=o(p.value,2),m=g[0],y=g[1];h.push(f(f({},y),{},{workId:m,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){v.e(e)}finally{v.f()}h.push({isLocked:c.isLocked,selectorColor:i.selectorColor,scaleType:i.scaleType,canRotate:i.canRotate,type:A.EPostMessageType.Select,selectIds:i.selectIds,selectRect:d,willSyncService:u,isSync:l})}return{sp:h}}}]),i}(ae),me=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),I(b(e),"emitEventType",A.EmitEventType.SetShapeOpt),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==A.EPostMessageType.UpdateNode||n!==A.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===F.selectorId&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,s=t.isSync,u=r.sp||[];if(i&&u){var l,c=a(n.entries());try{for(c.s();!(l=c.n()).done;){var h=o(l.value,2),d=h[0],p=h[1];u.push(f(f({},p),{},{workId:d,type:A.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){c.e(e)}finally{c.f()}}return{sp:u}}}]),i}(ae),ye=function(){function e(t){var r=this;S(this,e),I(this,"builders",new Map),this.builders=new Map(t.map((function(e){return[e,r.build(e)]})))}var t;return M(e,[{key:"build",value:function(e){switch(e){case A.EmitEventType.TranslateNode:return new ce;case A.EmitEventType.ZIndexNode:return new le;case A.EmitEventType.CopyNode:return new se;case A.EmitEventType.SetColorNode:return new ue;case A.EmitEventType.DeleteNode:return new he;case A.EmitEventType.ScaleNode:return new de;case A.EmitEventType.RotateNode:return new fe;case A.EmitEventType.SetFontStyle:return new pe;case A.EmitEventType.SetPoint:return new ve;case A.EmitEventType.SetLock:return new ge;case A.EmitEventType.SetShapeOpt:return new me}}},{key:"registerForMainThread",value:function(e,t,r){return this.builders.forEach((function(n){n&&n.registerMainThread(e,t,r)})),this}},{key:"consumeForMainThread",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a(this.builders.values()),e.prev=1,r.s();case 3:if((n=r.n()).done){e.next=11;break}return i=n.value,e.next=7,null==i?void 0:i.consume(t);case 7:if(!e.sent){e.next=9;break}return e.abrupt("return",!0);case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),r.e(e.t0);case 16:return e.prev=16,r.f(),e.finish(16);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(e){return t.apply(this,arguments)})}]),e}(),_e=function(){function e(t,r){S(this,e),I(this,"viewId"),I(this,"fullLayer"),I(this,"topLayer"),I(this,"localLayer"),I(this,"serviceLayer"),I(this,"snapshotFullLayer"),I(this,"vNodes"),I(this,"master"),I(this,"opt"),I(this,"cameraOpt"),I(this,"scene"),I(this,"localWork"),I(this,"serviceWork"),I(this,"topWork"),I(this,"mainThreadPostId"),I(this,"combinePostMsg",new Set),I(this,"methodBuilder"),this.viewId=t,this.opt=r,this.scene=this.createScene(f(f({},r.canvasOpt),{},{container:r.container})),this.master=r.master,this.fullLayer=this.createLayer("fullLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:"mainView"===this.viewId?4e3:2e3})),this.topLayer=this.createLayer("topLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:"mainView"===this.viewId?1500:1e3})),this.localLayer=this.createLayer("localLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:"mainView"===this.viewId?1500:1e3})),this.serviceLayer=this.createLayer("serviceLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:"mainView"===this.viewId?1500:1e3})),this.vNodes=new re(t,this.scene);var n={thread:this,vNodes:this.vNodes};this.localWork=new ie(n),this.serviceWork=new oe(n),this.topWork=new ne(n),this.vNodes.init(this.fullLayer),this.methodBuilder=new ye([A.EmitEventType.CopyNode,A.EmitEventType.SetColorNode,A.EmitEventType.DeleteNode,A.EmitEventType.RotateNode,A.EmitEventType.ScaleNode,A.EmitEventType.TranslateNode,A.EmitEventType.ZIndexNode,A.EmitEventType.SetFontStyle,A.EmitEventType.SetPoint,A.EmitEventType.SetLock,A.EmitEventType.SetShapeOpt]).registerForMainThread(this.localWork,this.serviceWork,this.scene)}var t,r,n;return M(e,[{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(n=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.methodBuilder.consumeForMainThread(t);case 2:if(e.sent){e.next=36;break}r=t.msgType,n=t.toolsType,i=t.opt,o=t.dataType,a=t.workId,s=t.workState,u=null==a?void 0:a.toString(),e.t0=r,e.next=e.t0===A.EPostMessageType.Destroy?7:e.t0===A.EPostMessageType.Clear?9:e.t0===A.EPostMessageType.UpdateCamera?11:e.t0===A.EPostMessageType.UpdateTools?13:e.t0===A.EPostMessageType.CreateWork?15:e.t0===A.EPostMessageType.DrawWork?21:e.t0===A.EPostMessageType.UpdateNode||e.t0===A.EPostMessageType.FullWork?23:e.t0===A.EPostMessageType.RemoveNode?28:e.t0===A.EPostMessageType.Select?30:e.t0===A.EPostMessageType.CursorHover?32:e.t0===A.EPostMessageType.GetTextActive?34:36;break;case 7:return this.destroy(),e.abrupt("break",36);case 9:return this.clearAll(),e.abrupt("break",36);case 11:return this.updateCamera(t),e.abrupt("break",36);case 13:return o===A.EDataType.Local&&n&&i&&(l={toolsType:n,toolsOpt:i},this.localWork.setToolsOpt(l)),e.abrupt("break",36);case 15:if(!(a&&i&&n)){e.next=20;break}if(n!==A.EToolsKey.LaserPen){e.next=19;break}return this.topWork.getTmpWorkShapeNode()||this.topWork.setToolsOpt({toolsType:n,toolsOpt:i}),u&&this.topWork.setWorkOptions(u,i),e.abrupt("break",36);case 19:this.localWork.getTmpWorkShapeNode()||this.localWork.setToolsOpt({toolsType:n,toolsOpt:i}),u&&this.localWork.setWorkOptions(u,i);case 20:return e.abrupt("break",36);case 21:return s===A.EvevtWorkState.Done&&o===A.EDataType.Local?this.consumeDrawAll(o,t):this.consumeDraw(o,t),e.abrupt("break",36);case 23:if(n!==A.EToolsKey.LaserPen){e.next=26;break}return this.consumeDrawAll(o,t),e.abrupt("break",36);case 26:return this.consumeFull(o,t),e.abrupt("break",36);case 28:return this.removeNode(t),e.abrupt("return");case 30:return o===A.EDataType.Service&&(a===A.Storage_Selector_key?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t)),e.abrupt("break",36);case 32:return this.localWork.cursorHover(t),e.abrupt("break",36);case 34:return o===A.EDataType.Local&&this.localWork.checkTextActive(t),e.abrupt("break",36);case 36:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"removeNode",value:(r=u(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.dataType,t.workId!==A.Storage_Selector_key){e.next=4;break}return this.localWork.blurSelector(t),e.abrupt("return");case 4:if(e.t0=r===A.EDataType.Local,!e.t0){e.next=9;break}return this.localWork.removeWork(t),e.next=9,this.localWork.colloctEffectSelectWork(t);case 9:if(e.t1=r===A.EDataType.Service,!e.t1){e.next=14;break}return this.serviceWork.removeWork(t),e.next=14,this.localWork.colloctEffectSelectWork(t);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeFull",value:(t=u(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localWork.colloctEffectSelectWork(r);case 2:if(n=e.sent,e.t0=n&&t===A.EDataType.Local,!e.t0){e.next=7;break}return e.next=7,this.localWork.consumeFull(n,this.scene);case 7:n&&t===A.EDataType.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"setCameraOpt",value:function(e){this.cameraOpt=e;var t=e.scale,r=e.centerX,n=e.centerY,i=e.width,o=e.height;(i!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:i,height:o}),this.fullLayer.setAttribute("scale",[t,t]),this.fullLayer.setAttribute("translate",[-r,-n]),this.topLayer.setAttribute("scale",[t,t]),this.topLayer.setAttribute("translate",[-r,-n]),this.localLayer.setAttribute("scale",[t,t]),this.localLayer.setAttribute("translate",[-r,-n]),this.serviceLayer.setAttribute("scale",[t,t]),this.serviceLayer.setAttribute("translate",[-r,-n])}},{key:"runBatchPostData",value:function(){this.mainThreadPostId||(this.mainThreadPostId=requestAnimationFrame(this.combinePost.bind(this)))}},{key:"combinePostData",value:function(){var e;this.mainThreadPostId=void 0;var t,r,n=[],i=a(this.combinePostMsg.values());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(null!=(e=o.sp)&&e.length){var s,u=a(o.sp);try{for(u.s();!(s=u.n()).done;){var l,c=s.value,h=!1,d=a(n);try{for(d.s();!(l=d.n()).done;){var f=l.value;if(A.isEqual(c,f)){h=!0;break}}}catch(e){d.e(e)}finally{d.f()}h||n.push(c)}}catch(e){u.e(e)}finally{u.f()}}A.isNumber(o.drawCount)&&(t=o.drawCount)}}catch(e){i.e(e)}finally{i.f()}return this.combinePostMsg.clear(),{sp:n,drawCount:t}}},{key:"combinePost",value:function(){var e,t,r,n=this,i=this.combinePostData(),o=null==(e=i.sp)?void 0:e.filter((function(e){return e.type!==A.EPostMessageType.None||Object.keys(e).filter((function(e){return"type"===e})).length}));null!=o&&o.length&&(i.sp=o.map((function(e){return e.viewId?e:f(f({},e),{},{viewId:n.viewId})}))),0===(null==(t=i.sp)?void 0:t.length)&&delete i.sp,void 0===i.drawCount&&delete i.drawCount,(null!=i&&i.drawCount||null!=(r=i.sp)&&r.length)&&this.opt.post(i)}},{key:"clearAll",value:function(){this.fullLayer.children.length&&(this.fullLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.fullLayer.removeAllChildren()),this.localWork.clearAll(),this.topWork.clearAll(),this.serviceWork.clearAll(),this.vNodes.clear(),this.post({sp:[{type:A.EPostMessageType.Clear}]})}},{key:"consumeDrawAll",value:function(e,t){var r=t.ops,n=t.op,i=t.workId;if((r||null!=n&&n.length)&&i){var o=i.toString();if(this.topWork.localWorkShapes.get(o))return void this.topWork.consumeDrawAll(t);if(this.localWork.workShapes.get(o))return void this.localWork.consumeDrawAll(t,this.serviceWork)}}},{key:"consumeDraw",value:function(e,t){var r=t.op,n=t.workId;if(null!=r&&r.length&&n){var i=n.toString();if(this.topWork.localWorkShapes.get(i))return void this.topWork.consumeDraw(t);if(this.localWork.workShapes.get(i))return void this.localWork.consumeDraw(t,this.serviceWork);e===A.EDataType.Service&&this.serviceWork.consumeDraw(t)}}},{key:"updateCamera",value:function(e){var t,r=e.cameraOpt,n=e.scenePath;if(r&&!A.isEqual(this.cameraOpt,r)){var i=this.localWork.getWorkShape(te);if(i&&null!=(t=i.selectIds)&&t.length&&i.cursorBlur(),n&&l(this.localWork.getWorkShapes().keys()).filter((function(e){return e!==te})).length&&this.localWork.workShapesDone(n,this.serviceWork),this.setCameraOpt(r),this.vNodes.curNodeMap.size&&(this.vNodes.clearTarget(),this.vNodes.updateNodesRect(),this.localWork.reRenderSelector(),this.serviceWork.selectorWorkShapes.size)){var s,u=a(this.serviceWork.selectorWorkShapes.entries());try{for(u.s();!(s=u.n()).done;){var c=o(s.value,2),h=c[0],d=c[1];this.serviceWork.runSelectWork({workId:h,selectIds:d.selectIds,msgType:A.EPostMessageType.Select,dataType:A.EDataType.Service,viewId:this.viewId})}}catch(e){u.e(e)}finally{u.f()}}}}},{key:"createScene",value:function(e){return new C.Scene(f(f({displayRatio:this.opt.displayer.dpr,depth:!1,desynchronized:!0},e),{},{autoRender:!0,id:this.viewId}))}},{key:"createLayer",value:function(e,t,r){var n=r.width,i=r.height,o="canvas-".concat(e),a=t.layer(o,f(f({},r),{},{offscreen:!1})),s=new C.Group({anchor:[.5,.5],pos:[.5*n,.5*i],size:[n,i],name:"viewport",id:e});return a.append(s),s}},{key:"updateScene",value:function(e){this.scene.attr(f({},e));var t=e.width,r=e.height;this.scene.width=t,this.scene.height=r,this.updateLayer({width:t,height:r})}},{key:"updateLayer",value:function(e){var t=e.width,r=e.height;this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",r),this.fullLayer.setAttribute("size",[t,r]),this.fullLayer.setAttribute("pos",[.5*t,.5*r]),this.topLayer.parent.setAttribute("width",t),this.topLayer.parent.setAttribute("height",r),this.topLayer.setAttribute("size",[t,r]),this.topLayer.setAttribute("pos",[.5*t,.5*r]),this.localLayer.parent.setAttribute("width",t),this.localLayer.parent.setAttribute("height",r),this.localLayer.setAttribute("size",[t,r]),this.localLayer.setAttribute("pos",[.5*t,.5*r]),this.serviceLayer.parent.setAttribute("width",t),this.serviceLayer.parent.setAttribute("height",r),this.serviceLayer.setAttribute("size",[t,r]),this.serviceLayer.setAttribute("pos",[.5*t,.5*r])}},{key:"destroy",value:function(){this.vNodes.clear(),this.fullLayer.remove(),this.topLayer.remove(),this.localLayer.remove(),this.serviceLayer.remove(),this.scene.remove(),this.localWork.destroy(),this.serviceWork.destroy(),this.topWork.destroy()}}]),e}(),be=function(){function e(t,r){S(this,e),I(this,"viewId"),I(this,"fullLayer"),I(this,"master"),I(this,"opt"),I(this,"scene"),I(this,"mainThreadPostId"),I(this,"combinePostMsg",new Set),I(this,"workShapes",new Map),this.viewId=t,this.opt=r,this.scene=this.createScene(f(f({},r.canvasOpt),{},{container:r.container})),this.master=r.master,this.fullLayer=this.createLayer("fullLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:"mainView"===this.viewId?6e3:3e3}))}var t,r,n,i,s;return M(e,[{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(s=u(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.msgType,e.t0=r,e.next=e.t0===A.EPostMessageType.Snapshot?4:e.t0===A.EPostMessageType.BoundingBox?8:12;break;case 4:return e.next=6,this.getSnapshot(t);case 6:case 10:return this.destroy(),e.abrupt("return");case 8:return e.next=10,this.getBoundingRect(t);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"createWorkShapeNode",value:function(e){return K(f(f({},e),{},{fullLayer:this.fullLayer,drawLayer:void 0}))}},{key:"setFullWork",value:function(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r&&n){var i=t.toString(),o=this.workShapes.get(i)||this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:i});return o?(o.setWorkId(t.toString()),this.workShapes.set(i,o),o):void 0}}},{key:"runFullWork",value:(i=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.setFullWork(t),o=t.ops&&A.transformToNormalData(t.ops),!i){e.next=17;break}if(u=null==(r=i.getWorkId())?void 0:r.toString(),i.toolsType!==A.EToolsKey.Image){e.next=9;break}return e.next=6,i.consumeServiceAsync({isFullWork:!0,scene:null==(n=this.fullLayer.parent)?void 0:n.parent,isMainThread:!0});case 6:a=e.sent,e.next=16;break;case 9:if(i.toolsType!==A.EToolsKey.Text){e.next=15;break}return e.next=12,i.consumeServiceAsync({isFullWork:!0,replaceId:u,isDrawLabel:!0});case 12:a=e.sent,e.next=16;break;case 15:a=i.consumeService({op:o,isFullWork:!0,replaceId:u}),s=(null==t?void 0:t.updateNodeOpt)&&i.updataOptService(t.updateNodeOpt);case 16:return e.abrupt("return",A.computRect(a,s));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getSnapshot",value:(n=u(regeneratorRuntime.mark((function e(t){var r,n,i,a,s,u,l,c,h,d,p,v,g,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,s=t.h,!(r&&n&&i)){e.next=22;break}this.setCameraOpt(i),l=0,c=Object.entries(n);case 4:if(!(l0&&e.w*this.opt.displayer.dpr||1,o=e.h>0&&e.h*this.opt.displayer.dpr||1;return createImageBitmap(this.fullLayer.parent.canvas,r,n,i,o,t)}},{key:"getSnapshotRender",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.scenePath,o=t.options,(null==(r=this.fullLayer)?void 0:r.parent).render(),e.next=4,this.getRectImageBitmap(this.getSceneRect(),o);case 4:(a=e.sent)&&(this.post({sp:[{type:A.EPostMessageType.Snapshot,scenePath:i,imageBitmap:a,viewId:this.viewId}]}),null==(n=this.fullLayer)||n.removeAllChildren());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getBoundingRect",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,a,s,u,l,c,h,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,!(r&&n&&i)){e.next=19;break}this.setCameraOpt(i),s=0,u=Object.entries(n);case 4:if(!(s=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function c(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){c(o,n,i,a,s,"next",e)}function s(e){c(o,n,i,a,s,"throw",e)}a(void 0)}))}}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;x(this,e),this.x=t,this.y=r,this.z=n}return S(e,[{key:"setz",value:function(e){return this.z=e,this}},{key:"setXY",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y;return this.x=e,this.y=t,this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z;return this.x=e,this.y=t,this.z=r,this}},{key:"setTo",value:function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.z,a=void 0===o?1:o;return this.x=r,this.y=i,this.z=a,this}},{key:"rot",value:function(e){if(0===e)return this;var t=this.x,r=this.y,n=Math.sin(e),i=Math.cos(e);return this.x=t*i-r*n,this.y=t*n+r*i,this}},{key:"rotWith",value:function(e,t){if(0===t)return this;var r=this.x-e.x,n=this.y-e.y,i=Math.sin(t),o=Math.cos(t);return this.x=e.x+(r*o-n*i),this.y=e.y+(r*i+n*o),this}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subXY",value:function(e,t){return this.x-=e,this.y-=t,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addXY",value:function(e,t){return this.x+=e,this.y+=t,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"clamp",value:function(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,e),void 0!==t&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this}},{key:"div",value:function(e){return this.x/=e,this.y/=e,this}},{key:"divV",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"mul",value:function(e){return this.x*=e,this.y*=e,this}},{key:"mulV",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"abs",value:function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this}},{key:"nudge",value:function(t,r){var n=e.Tan(t,this);return this.add(n.mul(r))}},{key:"neg",value:function(){return this.x*=-1,this.y*=-1,this}},{key:"cross",value:function(e){return this.x=this.y*e.z-this.z*e.y,this.y=this.z*e.x-this.x*e.z,this}},{key:"dpr",value:function(t){return e.Dpr(this,t)}},{key:"cpr",value:function(t){return e.Cpr(this,t)}},{key:"len2",value:function(){return e.Len2(this)}},{key:"len",value:function(){return e.Len(this)}},{key:"pry",value:function(t){return e.Pry(this,t)}},{key:"per",value:function(){var e=this.x,t=this.y;return this.x=t,this.y=-e,this}},{key:"uni",value:function(){return e.Uni(this)}},{key:"tan",value:function(t){return e.Tan(this,t)}},{key:"dist",value:function(t){return e.Dist(this,t)}},{key:"distanceToLineSegment",value:function(t,r){return e.DistanceToLineSegment(t,r,this)}},{key:"slope",value:function(t){return e.Slope(this,t)}},{key:"snapToGrid",value:function(e){return this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this}},{key:"angle",value:function(t){return e.Angle(this,t)}},{key:"toAngle",value:function(){return e.ToAngle(this)}},{key:"lrp",value:function(e,t){return this.x=this.x+(e.x-this.x)*t,this.y=this.y+(e.y-this.y)*t,this}},{key:"equals",value:function(t,r){return e.Equals(this,t,r)}},{key:"equalsXY",value:function(t,r){return e.EqualsXY(this,t,r)}},{key:"norm",value:function(){var e=this.len();return this.x=0===e?0:this.x/e,this.y=0===e?0:this.y/e,this}},{key:"toFixed",value:function(){return e.ToFixed(this)}},{key:"toString",value:function(){return e.ToString(e.ToFixed(this))}},{key:"toJson",value:function(){return e.ToJson(this)}},{key:"toArray",value:function(){return e.ToArray(this)}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Add",value:function(t,r){return new e(t.x+r.x,t.y+r.y)}},{key:"AddXY",value:function(t,r,n){return new e(t.x+r,t.y+n)}},{key:"Sub",value:function(t,r){return new e(t.x-r.x,t.y-r.y)}},{key:"SubXY",value:function(t,r,n){return new e(t.x-r,t.y-n)}},{key:"AddScalar",value:function(t,r){return new e(t.x+r,t.y+r)}},{key:"SubScalar",value:function(t,r){return new e(t.x-r,t.y-r)}},{key:"Div",value:function(t,r){return new e(t.x/r,t.y/r)}},{key:"Mul",value:function(t,r){return new e(t.x*r,t.y*r)}},{key:"DivV",value:function(t,r){return new e(t.x/r.x,t.y/r.y)}},{key:"MulV",value:function(t,r){return new e(t.x*r.x,t.y*r.y)}},{key:"Neg",value:function(t){return new e(-t.x,-t.y)}},{key:"Per",value:function(t){return new e(t.y,-t.x)}},{key:"Dist2",value:function(t,r){return e.Sub(t,r).len2()}},{key:"Abs",value:function(t){return new e(Math.abs(t.x),Math.abs(t.y))}},{key:"Dist",value:function(e,t){return Math.hypot(e.y-t.y,e.x-t.x)}},{key:"Dpr",value:function(e,t){return e.x*t.x+e.y*t.y}},{key:"Cross",value:function(t,r){return new e(t.y*r.z-t.z*r.y,t.z*r.x-t.x*r.z)}},{key:"Cpr",value:function(e,t){return e.x*t.y-t.x*e.y}},{key:"Len2",value:function(e){return e.x*e.x+e.y*e.y}},{key:"Len",value:function(e){return Math.hypot(e.x,e.y)}},{key:"Pry",value:function(t,r){return e.Dpr(t,r)/e.Len(r)}},{key:"Uni",value:function(t){return e.Div(t,e.Len(t))}},{key:"Tan",value:function(t,r){return e.Uni(e.Sub(t,r))}},{key:"Min",value:function(t,r){return new e(Math.min(t.x,r.x),Math.min(t.y,r.y))}},{key:"Max",value:function(t,r){return new e(Math.max(t.x,r.x),Math.max(t.y,r.y))}},{key:"From",value:function(t){return(new e).add(t)}},{key:"FromArray",value:function(t){return new e(t[0],t[1])}},{key:"Rot",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Math.sin(r),i=Math.cos(r);return new e(t.x*i-t.y*n,t.x*n+t.y*i)}},{key:"RotWith",value:function(t,r,n){var i=t.x-r.x,o=t.y-r.y,a=Math.sin(n),s=Math.cos(n);return new e(r.x+(i*s-o*a),r.y+(i*a+o*s))}},{key:"NearestPointOnLineThroughPoint",value:function(t,r,n){return e.Mul(r,e.Sub(n,t).pry(r)).add(t)}},{key:"NearestPointOnLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=e.Tan(r,t),a=e.Add(t,e.Mul(o,e.Sub(n,t).pry(o)));if(i){if(a.xMath.max(t.x,r.x))return e.Cast(t.x>r.x?t:r);if(a.yMath.max(t.y,r.y))return e.Cast(t.y>r.y?t:r)}return a}},{key:"DistanceToLineThroughPoint",value:function(t,r,n){return e.Dist(n,e.NearestPointOnLineThroughPoint(t,r,n))}},{key:"DistanceToLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e.Dist(n,e.NearestPointOnLineSegment(t,r,n,i))}},{key:"Snap",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}},{key:"Cast",value:function(t){return t instanceof e?t:e.From(t)}},{key:"Slope",value:function(e,t){return e.x===t.y?NaN:(e.y-t.y)/(e.x-t.x)}},{key:"Angle",value:function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}},{key:"Lrp",value:function(t,r,n){return e.Sub(r,t).mul(n).add(t)}},{key:"Med",value:function(t,r){return new e((t.x+r.x)/2,(t.y+r.y)/2)}},{key:"Equals",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-4;return Math.abs(e.x-t.x)2&&void 0!==arguments[2]?arguments[2]:1e-4;return e.Equals(t,r,n)&&Math.abs((t.z||0)-(r.z||0))1&&void 0!==arguments[1]?arguments[1]:2;return new e(+t.x.toFixed(r),+t.y.toFixed(r),+t.z.toFixed(r))}},{key:"Nudge",value:function(t,r,n){return e.Add(t,e.Tan(r,t).mul(n))}},{key:"ToString",value:function(e){return"".concat(e.x,", ").concat(e.y)}},{key:"ToAngle",value:function(e){var t=Math.atan2(e.y,e.x);return t<0&&(t+=2*Math.PI),t}},{key:"FromAngle",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.cos(t)*r,Math.sin(t)*r)}},{key:"ToArray",value:function(e){return[e.x,e.y,e.z]}},{key:"ToJson",value:function(e){return{x:e.x,y:e.y,z:e.z}}},{key:"Average",value:function(t){for(var r=t.length,n=new e(0,0),i=0;i2&&void 0!==arguments[2]?arguments[2]:6,i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:8;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}}]),e}(),ee=function(e){return e<.5?2*e*e:(4-2*e)*e-1},te=function(e){v(r,e);var t=m(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return x(this,r),(e=t.call(this,n,i,o)).x=n,e.y=i,e.z=o,e.v=a,e.t=s,e.a=u,e}return S(r,[{key:"setA",value:function(e){this.a=e}},{key:"setT",value:function(e){this.t=e}},{key:"setv",value:function(e){return this.v={x:e.x,y:e.y},this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.v,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.a;return this.x=e,this.y=t,this.z=r,this.v=n,this.t=i,this.a=o,this}},{key:"clone",value:function(){var e=this.x,t=this.y,n=this.z,i=this.v,o=this.t,a=this.a;return new r(e,t,n,{x:i.x,y:i.y},o,a)}},{key:"distance",value:function(e){return r.GetDistance(this,e)}},{key:"isNear",value:function(e,t){return r.IsNear(this,e,t)}},{key:"getAngleByPoints",value:function(e,t){return r.GetAngleByPoints(e,this,t)}},{key:"timestamp",get:function(){return this.t}},{key:"pressure",get:function(){return this.z}},{key:"angleNum",get:function(){return this.a}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Sub",value:function(e,t){return new r(e.x-t.x,e.y-t.y)}},{key:"Add",value:function(e,t){return new r(e.x+t.x,e.y+t.y)}},{key:"GetDistance",value:function(e,t){return r.Len(e.clone().sub(t))}},{key:"GetAngleByPoints",value:function(e,t,r){var n=t.x-e.x,i=r.x-t.x,o=t.y-e.y,a=r.y-t.y,s=0,u=Math.sqrt(n*n+o*o),l=Math.sqrt(i*i+a*a);if(u&&l){var c=n*i+o*a,h=n*a-o*i;s=180+(h=h>0?1:-1)*(s=(s=Math.acos(c/(u*l)))/Math.PI*180)}return s}},{key:"IsNear",value:function(e,t,n){return r.Len(e.clone().sub(t))3&&void 0!==arguments[3]?arguments[3]:2,o=e.x-t.x,a=e.y-t.y,s=Math.sin(n),u=Math.cos(n),l=Math.pow(10,i),c=Math.floor((t.x+(o*u-a*s))*l)/l,h=Math.floor((t.y+(o*s+a*u))*l)/l;return new r(c,h)}},{key:"GetDotStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,i=new J(1,1),o=Math.PI+.001,a=r.Add(e,r.Sub(e,i).uni().per().mul(-t)),s=[],u=1/n,l=u;l<=1;l+=u)s.push(r.RotWith(a,e,2*o*l));return s}},{key:"GetSemicircleStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,o=n*(Math.PI+.001),a=[],s=1/i,u=s;u<=1;u+=s)a.push(r.RotWith(t,e,o*u));return a}}]),r}(J),re=("undefined"==typeof globalThis?"undefined":T(globalThis))<"u"?globalThis:("undefined"==typeof window?"undefined":T(window))<"u"?window:(void 0===r.g?"undefined":T(r.g))<"u"?r.g:("undefined"==typeof self?"undefined":T(self))<"u"?self:{};function ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ie="object"==T(re)&&re&&re.Object===Object&&re,oe=ie,ae="object"==("undefined"==typeof self?"undefined":T(self))&&self&&self.Object===Object&&self,se=oe||ae||Function("return this")(),ue=se.Symbol,le=ue,ce=Object.prototype,he=ce.hasOwnProperty,de=ce.toString,fe=le?le.toStringTag:void 0;var pe=function(e){var t=he.call(e,fe),r=e[fe];try{e[fe]=void 0;var n=!0}catch(e){}var i=de.call(e);return n&&(t?e[fe]=r:delete e[fe]),i},ve=Object.prototype.toString;var ge=function(e){return ve.call(e)},me=pe,ye=ge,_e=ue?ue.toStringTag:void 0;var be=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_e&&_e in Object(e)?me(e):ye(e)};var xe=function(e){return null!=e&&"object"==T(e)},we=be,Se=xe;var Te=function(e){return"number"==typeof e||Se(e)&&"[object Number]"==we(e)},Me=ne(Te);var ke=function(){this.__data__=[],this.size=0};var Ee=function(e,t){return e===t||e!=e&&t!=t},Ie=Ee;var Ae=function(e,t){for(var r=e.length;r--;)if(Ie(e[r][0],t))return r;return-1},Ce=Ae,Pe=Array.prototype.splice;var Ne=function(e){var t=this.__data__,r=Ce(t,e);return!(r<0)&&(r==t.length-1?t.pop():Pe.call(t,r,1),--this.size,!0)},Oe=Ae;var Re=function(e){var t=this.__data__,r=Oe(t,e);return r<0?void 0:t[r][1]},De=Ae;var Le=function(e){return De(this.__data__,e)>-1},je=Ae;var ze=function(e,t){var r=this.__data__,n=je(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Be=ke,Fe=Ne,Ue=Re,We=Le,Ge=ze;function Ve(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},qr=be,Qr=Xr,Zr=xe,Kr={};Kr["[object Float32Array]"]=Kr["[object Float64Array]"]=Kr["[object Int8Array]"]=Kr["[object Int16Array]"]=Kr["[object Int32Array]"]=Kr["[object Uint8Array]"]=Kr["[object Uint8ClampedArray]"]=Kr["[object Uint16Array]"]=Kr["[object Uint32Array]"]=!0,Kr["[object Arguments]"]=Kr["[object Array]"]=Kr["[object ArrayBuffer]"]=Kr["[object Boolean]"]=Kr["[object DataView]"]=Kr["[object Date]"]=Kr["[object Error]"]=Kr["[object Function]"]=Kr["[object Map]"]=Kr["[object Number]"]=Kr["[object Object]"]=Kr["[object RegExp]"]=Kr["[object Set]"]=Kr["[object String]"]=Kr["[object WeakMap]"]=!1;var Jr=function(e){return Zr(e)&&Qr(e.length)&&!!Kr[qr(e)]};var en=function(e){return function(t){return e(t)}},tn={exports:{}};!function(e,t){var r=ie,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(tn,tn.exports);var rn=tn.exports,nn=Jr,on=en,an=rn&&rn.isTypedArray,sn=an?on(an):nn,un=Pr,ln=Ur,cn=Wr,hn=Hr,dn=$r,fn=sn,pn=Object.prototype.hasOwnProperty;var vn=function(e,t){var r=cn(e),n=!r&&ln(e),i=!r&&!n&&hn(e),o=!r&&!n&&!i&&fn(e),a=r||n||i||o,s=a?un(e.length,String):[],u=s.length;for(var l in e)(t||pn.call(e,l))&&(!a||!("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||dn(l,u)))&&s.push(l);return s},gn=Object.prototype;var mn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||gn)};var yn=function(e,t){return function(r){return e(t(r))}},_n=yn(Object.keys,Object),bn=mn,xn=_n,wn=Object.prototype.hasOwnProperty;var Sn=function(e){if(!bn(e))return xn(e);var t=[];for(var r in Object(e))wn.call(e,r)&&"constructor"!=r&&t.push(r);return t},Tn=et,Mn=Xr;var kn=function(e){return null!=e&&Mn(e.length)&&!Tn(e)},En=vn,In=Sn,An=kn;var Cn=function(e){return An(e)?En(e):In(e)},Pn=Cr,Nn=Cn;var On=function(e,t){return e&&Pn(t,Nn(t),e)};var Rn=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Dn=Ze,Ln=mn,jn=Rn,zn=Object.prototype.hasOwnProperty;var Bn=function(e){if(!Dn(e))return jn(e);var t=Ln(e),r=[];for(var n in e)"constructor"==n&&(t||!zn.call(e,n))||r.push(n);return r},Fn=vn,Un=Bn,Wn=kn;var Gn=function(e){return Wn(e)?Fn(e,!0):Un(e)},Vn=Cr,Hn=Gn;var Yn=function(e,t){return e&&Vn(t,Hn(t),e)},$n={exports:{}};!function(e,t){var r=se,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n?r.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}}($n,$n.exports);var Xn=$n.exports;var qn=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++rs))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var h=-1,d=!0,f=2&r?new Ta:void 0;for(o.set(e,t),o.set(t,e);++h1&&void 0!==arguments[1]?arguments[1]:0,r={x:0,y:0,w:0,h:0},n=1/0,i=1/0,o=-1/0,a=-1/0;return e.forEach((function(e){var r=d(e.XY,2),s=r[0],u=r[1];n=Math.min(n,s-t),i=Math.min(i,u-t),o=Math.max(o,s+t),a=Math.max(a,u+t)})),r.x=n,r.y=i,r.w=o-n,r.h=a-i,r}function ds(e,t){var r=new J(e.x,e.y),n=new J(e.x+e.w,e.y),i=new J(e.x+e.w,e.y+e.h),o=new J(e.x,e.y+e.h),a=new J(e.x+e.w/2,e.y+e.h/2),s=Math.PI*t/180;return[J.RotWith(r,a,s),J.RotWith(n,a,s),J.RotWith(i,a,s),J.RotWith(o,a,s)]}function fs(e,t){return e[0]>=t.x&&e[0]<=t.x+t.w&&e[1]>=t.y&&e[1]<=t.y+t.h}function ps(e){return+e.toFixed(4)}var vs=function(e,t){return new Promise((function(e){window.requestIdleCallback?requestIdleCallback((function(){e(1)}),{timeout:t}):setTimeout((function(){e(2)}),t)})).then((function(){e()}),(function(){e()}))},gs=function(e){var t=(null==e?void 0:e.webkitBackingStorePixelRatio)||(null==e?void 0:e.mozBackingStorePixelRatio)||(null==e?void 0:e.msBackingStorePixelRatio)||(null==e?void 0:e.oBackingStorePixelRatio)||(null==e?void 0:e.backingStorePixelRatio)||1;return Math.max(1,(window.devicePixelRatio||1)/t)},ms=function(){function e(t){x(this,e),k(this,"plugin"),k(this,"uid"),this.plugin=t,this.uid=t.displayer.uid}return S(e,[{key:"getNamespaceData",value:function(){var e;return E.toJS(null==(e=this.plugin)?void 0:e.attributes[this.namespace])||{}}},{key:"getUidFromKey",value:function(e){return 2===e.split(pa).length&&e.split(pa)[0]||this.uid}},{key:"isLocalId",value:function(e){return 1===e.split(pa).length}},{key:"getLocalId",value:function(e){return e.split(pa)[1]}},{key:"isSelector",value:function(e){return this.getLocalId(e)===va}}]),e}(),ys=function(e){v(r,e);var t=m(r);function r(e,n){var i;return x(this,r),i=t.call(this,e),k(_(i),"namespace"),k(_(i),"serviceStorage",{}),k(_(i),"storage",{}),k(_(i),"stateDisposer"),k(_(i),"asyncClockState",!1),r.syncInterval=.5*(n||r.syncInterval),i.namespace=r.namespace,i.serviceStorage=i.getNamespaceData(),i.storage=ca(i.serviceStorage),i}return S(r,[{key:"getViewIdBySecenPath",value:function(e){for(var t=this.getNamespaceData(),r=0,n=Object.entries(t);r0&&e(i);case 4:case"end":return r.stop()}}),r)}))))}},{key:"removeStorageStateListener",value:function(){this.stateDisposer&&this.stateDisposer()}},{key:"diffFun",value:function(e,t){var r,n=fa(e),i=fa(t),o={},a=l(n);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!os(e[s],t[s])){var u=this.diffFunByscenePath(e[s]||{},t[s]||{},s);Object.assign(o,u)}}}catch(e){a.e(e)}finally{a.f()}var c,h=l(i);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!n.includes(d)){var f=this.diffFunByscenePath(e[d]||{},t[d]||{},d);Object.assign(o,f)}}}catch(e){h.e(e)}finally{h.f()}return o}},{key:"diffFunByscenePath",value:function(e,t,r){var n,i=fa(e),o=fa(t),a={},s=l(i);try{for(s.s();!(n=s.n()).done;){var u=n.value;if(!os(e[u],t[u])){var c=this.diffFunByKeys(e[u]||{},t[u]||{},u,r);Object.assign(a,c)}}}catch(e){s.e(e)}finally{s.f()}var h,d=l(o);try{for(d.s();!(h=d.n()).done;){var f=h.value;if(!i.includes(f)){var p=this.diffFunByKeys(e[f]||{},t[f]||{},f,r);Object.assign(a,p)}}}catch(e){d.e(e)}finally{d.f()}return a}},{key:"diffFunByKeys",value:function(e,t,r,n){var i,o=fa(e),a=fa(t),s={},u=l(o);try{for(u.s();!(i=u.n()).done;){var c=i.value;if(a.includes(c)){if(os(e[c],t[c]))continue;s[c]={oldValue:e[c],newValue:t[c],viewId:n,scenePath:r}}else s[c]={oldValue:e[c],newValue:void 0,viewId:n,scenePath:r}}}catch(e){u.e(e)}finally{u.f()}var h,d=l(a);try{for(d.s();!(h=d.n()).done;){var f=h.value;o.includes(f)||(s[f]={oldValue:void 0,newValue:t[f],viewId:n,scenePath:r})}}catch(e){d.e(e)}finally{d.f()}return s}},{key:"transformKey",value:function(e){return this.uid+pa+e}},{key:"isOwn",value:function(e){return e.split(pa)[0]===this.uid}},{key:"dispatch",value:function(e){var t=this,r=e.type,n=e.workId,i=e.ops,o=e.index,a=e.opt,u=e.toolsType,l=e.removeIds,c=e.updateNodeOpt,h=e.op,d=e.selectIds,f=e.isSync,p=e.scenePath,v=e.viewId;if(v)switch(r){case H.Clear:var g={};p&&this.storage[v]&&this.storage[v][p]?(delete this.storage[v][p],this.setState(g,{isSync:f,viewId:v,scenePath:p})):this.storage[v]&&(delete this.storage[v],this.setState(g,{isSync:f,viewId:v,scenePath:""}));break;case H.CreateWork:if(p&&n&&u&&a){var m=this.isLocalId(n.toString())?this.transformKey(n):n;this.updateValue(m.toString(),{type:H.CreateWork,workId:n,toolsType:u,opt:a},{isSync:f,viewId:v,scenePath:p})}break;case H.DrawWork:if(p&&n&&"number"==typeof o&&null!=h&&h.length){var y=this.isLocalId(n.toString())?this.transformKey(n):n,_=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][y]||void 0,b=o?((null==_?void 0:_.op)||[]).slice(0,o).concat(h):h||(null==_?void 0:_.op);_&&b&&this.updateValue(y.toString(),s(s({},_),{},{type:H.DrawWork,op:b,index:o}),{isSync:f,viewId:v,scenePath:p})}break;case H.FullWork:if(p&&n){var x=this.isLocalId(n.toString())?this.transformKey(n):n,w=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][x]||void 0,S=c||(null==w?void 0:w.updateNodeOpt),T=u||(null==w?void 0:w.toolsType),M=a||(null==w?void 0:w.opt),k=i||(null==w?void 0:w.ops);T&&M&&this.updateValue(x.toString(),{type:H.FullWork,updateNodeOpt:S,workId:x,toolsType:T,opt:M,ops:k},{isSync:f,viewId:v,scenePath:p})}break;case H.RemoveNode:if(p&&null!=l&&l.length){var E=l.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e}));this.storage[v]&&this.storage[v][p]&&Object.keys(this.storage[v][p]).map((function(e){null!=E&&E.includes(e)&&t.updateValue(e,void 0,{isSync:f,viewId:v,scenePath:p})}))}break;case H.UpdateNode:if(p&&n&&(c||i||a)){var I=this.isLocalId(n.toString())?this.transformKey(n):n,A=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][I]||void 0;A&&(A.updateNodeOpt=c,(i||h)&&(A.ops=i,A.op=h),a&&(A.opt=a),A.type=H.FullWork,this.updateValue(I.toString(),A,{isSync:f,viewId:v,scenePath:p}))}break;case H.Select:if(!p)return;var C;null!=d&&d.length&&(C=d.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e})));var P=this.transformKey(va),N=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][P]||void 0,O=a||(null==N?void 0:N.opt);C&&this.checkOtherSelector(P,C,{isSync:f,viewId:v,scenePath:p}),this.updateValue(P,C&&{type:H.Select,toolsType:W.Selector,opt:O,selectIds:C},{isSync:f,viewId:v,scenePath:p})}}},{key:"checkOtherSelector",value:function(e,t,r){for(var n=r.viewId,i=r.scenePath,o=0,a=Object.keys(this.storage[n][i]);o0&&(u.selectIds=l),this.updateValue(s,l.length&&u||void 0,r)}}}}},{key:"setState",value:function(e,t){for(var r=t.viewId,n=t.scenePath,i=fa(e),o=0;o0&&void 0!==arguments[0]&&arguments[0],r=fa(this.serviceStorage),n=fa(this.storage),i=new Map,o=l(r);try{for(o.s();!(e=o.n()).done;){var a=e.value;n.includes(a)?os(this.serviceStorage[a],this.storage[a])||this.syncViewData(a,t):i.set(a,void 0)}}catch(e){o.e(e)}finally{o.f()}var s,u=l(n);try{for(u.s();!(s=u.n()).done;){var c=s.value;r.includes(c)||i.set(c,this.storage[c])}}catch(e){u.e(e)}finally{u.f()}if(i.size>5)this.syncStorageView(this.storage,t);else{var h,f=l(i.entries());try{for(f.s();!(h=f.n()).done;){var p=d(h.value,2),v=p[0],g=p[1];this.syncUpdataView(v,g,t)}}catch(e){f.e(e)}finally{f.f()}}}},{key:"syncViewData",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=fa(this.serviceStorage[e]),i=fa(this.storage[e]),o=new Map,a=l(n);try{for(a.s();!(t=a.n()).done;){var s=t.value;i.includes(s)?os(this.serviceStorage[e][s],this.storage[e][s])||this.syncScenePathData(e,s,r):o.set(s,void 0)}}catch(e){a.e(e)}finally{a.f()}var u,c=l(i);try{for(c.s();!(u=c.n()).done;){var h=u.value;n.includes(h)||o.set(h,this.storage[e][h])}}catch(e){c.e(e)}finally{c.f()}if(o.size>5)this.syncStorageScenePath(e,this.storage[e],r);else{var f,p=l(o.entries());try{for(p.s();!(f=p.n()).done;){var v=d(f.value,2),g=v[0],m=v[1];this.syncUpdataScenePath(e,g,m,r)}}catch(e){p.e(e)}finally{p.f()}}}},{key:"syncScenePathData",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=fa(this.serviceStorage[e][t]),o=fa(this.storage[e][t]),a=new Map,s=l(i);try{for(s.s();!(r=s.n()).done;){var u=r.value;o.includes(u)?os(this.serviceStorage[e][t][u],this.storage[e][t][u])||a.set(u,this.storage[e][t][u]):a.set(u,void 0)}}catch(e){s.e(e)}finally{s.f()}var c,h=l(o);try{for(h.s();!(c=h.n()).done;){var f=c.value;i.includes(f)||a.set(f,this.storage[e][t][f])}}catch(e){h.e(e)}finally{h.f()}if(a.size>5)this.syncStorageKey(e,t,this.storage[e][t],n);else{var p,v=l(a.entries());try{for(v.s();!(p=v.n()).done;){var g=d(p.value,2),m=g[0],y=g[1];this.syncUpdataKey(e,t,m,y,n)}}catch(e){v.e(e)}finally{v.f()}}}},{key:"syncUpdataView",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(this.serviceStorage).length?(n||(void 0===t?delete this.serviceStorage[e]:this.serviceStorage[e]=ca(t)),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)):this.syncStorageView(this.storage,n)}},{key:"syncStorageView",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r||e&&(this.serviceStorage=ca(e)),null==(t=this.plugin)||t.updateAttributes([this.namespace],e)}},{key:"syncUpdataScenePath",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.keys(this.serviceStorage[e]).length?(i||(void 0===r?delete this.serviceStorage[e][t]:this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)):this.syncStorageScenePath(e,this.storage[e],i)}},{key:"syncStorageScenePath",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n||t&&(this.serviceStorage[e]=t),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)}},{key:"syncUpdataKey",value:function(e,t,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object.keys(this.serviceStorage[e][t]).length?(o||(void 0===n?delete this.serviceStorage[e][t][r]:this.serviceStorage[e][t][r]=n),null==(i=this.plugin)||i.updateAttributes([this.namespace,e,t,r],n)):this.syncStorageKey(e,t,this.storage[e][t],o)}},{key:"syncStorageKey",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i||(this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)}},{key:"keyTransformWorkId",value:function(e){var t=e.split(pa);return 2===t.length?t[1]:e}},{key:"destroy",value:function(){this.removeStorageStateListener(),this.serviceStorage={},this.storage={}}}]),r}(ms);k(ys,"namespace","PluginState"),k(ys,"syncInterval",500);var _s=ys,bs=function(){function e(){x(this,e),k(this,"roomMembers",[]),k(this,"onChangeHooks",new Set)}return S(e,[{key:"setRoomMembers",value:function(e){this.executChangeUidHook(this.roomMembers,e),this.roomMembers=e}},{key:"executChangeUidHook",value:function(e,t){var r={online:t.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session})),offline:e.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session}))};this.onChangeHooks.forEach((function(e){return e(r)}))}},{key:"getRoomMember",value:function(e){return this.roomMembers.find((function(t){var r;return(null==(r=t.payload)?void 0:r.uid)===e}))}},{key:"isOnLine",value:function(e){return!this.getRoomMember(e)}},{key:"onUidChangeHook",value:function(e){this.onChangeHooks.add(e)}},{key:"destroy",value:function(){this.onChangeHooks.clear()}}]),e}(),xs=function(e){return e[e.Text=1]="Text",e[e.Shape=2]="Shape",e}(xs||{}),ws=function(){function e(){x(this,e)}return S(e,[{key:"createProxy",value:function(t){var r=new Proxy(t,{get:function(t,r,n){var i=e.interceptors.hasOwnProperty(r)?e.interceptors:t;return Reflect.get(i,r,n)}});return e.proxyToRaw.set(r,t),r}}]),e}();k(ws,"proxyToRaw",new WeakMap),k(ws,"interceptors",{entries:function(){var e;return(e=ws.proxyToRaw.get(this)).entries.apply(e,arguments)},forEach:function(){var e;return(e=ws.proxyToRaw.get(this)).forEach.apply(e,arguments)},size:function(){return ws.proxyToRaw.get(this).size},get:function(e){return ws.proxyToRaw.get(this).get(e)},set:function(e,t){return ws.proxyToRaw.get(this).set(e,t)},delete:function(e,t){return ws.proxyToRaw.get(this).delete(e)},clear:function(){return ws.proxyToRaw.get(this).clear()}});var Ss=ws,Ts=function(){function e(t){x(this,e),k(this,"internalMsgEmitter"),k(this,"control"),k(this,"editors"),k(this,"activeId"),k(this,"proxyMap"),k(this,"taskqueue",new Map);var r=t.control,n=t.internalMsgEmitter;this.control=r,this.internalMsgEmitter=n;var i=new Map;this.proxyMap=new Ss;var o=this,a=Ss.interceptors.set;Ss.interceptors.set=function(e,t){return o.interceptors.set(e,t),a.call(this,e,t)};var s=Ss.interceptors.delete;Ss.interceptors.delete=function(e,t){return o.interceptors.delete(e,t),s.call(this,e)},this.editors=this.proxyMap.createProxy(i)}var t;return S(e,[{key:"filterEditor",value:function(e){var t=new Map;return this.editors.forEach((function(r,n){r.viewId===e&&t.set(n,r)})),t}},{key:"computeTextActive",value:function(e,t){var r,n,i,o,a=null==(r=this.control.viewContainerManager)?void 0:r.transformToScenePoint(e,t),s=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);t&&s&&(null==(i=this.control.worker)||i.taskBatchData.add({msgType:H.GetTextActive,dataType:G.Local,op:a,viewId:t,scenePath:s}),null==(o=this.control.worker)||o.runAnimation())}},{key:"checkEmptyTextBlur",value:function(){var e,t,r=this.activeId,n=l(this.editors.entries());try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];if(a.opt.uid&&a.opt.uid===(null==(e=this.collector)?void 0:e.uid)){r=o;break}}}catch(e){n.e(e)}finally{n.f()}if(r){var s=this.editors.get(r);(null==s?void 0:s.opt.text)&&(null==s?void 0:s.opt.text.replace(/\s*,/g,""))?this.unActive(r):this.delete(r,!0,!0)}}},{key:"onCameraChange",value:function(e,t){var r,n,i,o=l(this.editors.entries());try{for(o.s();!(i=o.n()).done;){var a=d(i.value,2),s=a[0],u=a[1];if(u.viewId===t){var c=u.opt,h=c.boxPoint,f=c.boxSize,p=h&&(null==(r=this.control.viewContainerManager)?void 0:r.transformToOriginPoint(h,u.viewId)),v=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);if(v&&t){var g={x:p&&p[0]||0,y:p&&p[1]||0,w:f&&f[0]||0,h:f&&f[1]||0,opt:u.opt,scale:e.scale,type:xs.Text,viewId:t,scenePath:v,canWorker:!1,canSync:!1};this.editors.set(s,g),this.control.viewContainerManager.setActiveTextEditor(t,this.activeId)}}}}catch(e){o.e(e)}finally{o.f()}}},{key:"onServiceDerive",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.msgType,a=e.viewId,s=e.scenePath,u=e.dataType;if(n&&a&&s){var l=n.toString();if(o!==H.RemoveNode){var c=i.boxPoint,h=i.boxSize,d=c&&(null==(t=this.control.viewContainerManager)?void 0:t.transformToOriginPoint(c,a)),f=this.control.viewContainerManager.getView(a),p={x:d&&d[0]||0,y:d&&d[1]||0,w:h&&h[0]||0,h:h&&h[1]||0,opt:i,type:xs.Text,canWorker:!0,canSync:!1,dataType:u,scale:(null==(r=null==f?void 0:f.cameraOpt)?void 0:r.scale)||1,viewId:a,scenePath:s};this.editors.set(l,p),u===G.Service&&i.workState===V.Done&&this.activeId===l&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(a,this.activeId)}else this.delete(l,!0,!0)}}},{key:"updateForViewEdited",value:function(e,t){var r;this.editors.set(e,t);var n=null==(r=this.taskqueue.get(e))?void 0:r.resolve;n&&n(t)}},{key:"active",value:function(e){var t,r=this.editors.get(e);r&&r.viewId&&(r.opt.workState=V.Start,r.opt.uid=null==(t=this.collector)?void 0:t.uid,this.activeId=e,r.canWorker=!0,r.canSync=!0,this.editors.set(e,r),this.control.viewContainerManager.setActiveTextEditor(r.viewId,this.activeId))}},{key:"unActive",value:function(e){var t=this.editors.get(e);t&&t.viewId&&(t.opt.workState=V.Done,t.opt.uid=void 0,t.canWorker=!0,t.canSync=!0,this.editors.set(e,t),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(t.viewId,this.activeId))}},{key:"createTextForMasterController",value:function(e,t){var r,n=e.workId,i=e.isActive,a=o(e,["workId","isActive"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,a.viewId),a.opt.uid=null==(r=this.collector)?void 0:r.uid,i&&(this.activeId=n),a.dataType=G.Local,a.canWorker=!0,a.canSync=!0,this.editors.set(n,a),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId)}},{key:"updateTextForMasterController",value:function(e,t){var r,n=e.workId,i=o(e,["workId"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,i.viewId);var a=this.editors.get(n)||{};i.opt&&(i.opt.uid=null==(r=this.collector)?void 0:r.uid),i.dataType=G.Local,this.editors.set(n,s(s({},a),i)),this.control.viewContainerManager.setActiveTextEditor(i.viewId,this.activeId)}},{key:"updateTextControllerWithEffectAsync",value:(t=h(regeneratorRuntime.mark((function e(t,r){var n,i,a,u,l,c,h,d=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.workId,a=o(t,["workId"]),r&&this.internalMsgEmitter.emit("addUndoTicker",r,a.viewId),u=this.editors.get(i)||{},a.opt&&(a.opt.uid=null==(n=this.collector)?void 0:n.uid),a.dataType=G.Local,this.editors.set(i,s(s({},u),a)),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId),!this.taskqueue.has(i)){e.next=5;break}return e.abrupt("return");case 5:return l=setTimeout((function(){var e,t=null==(e=d.taskqueue.get(i))?void 0:e.resolve;t&&t(void 0)}),20),e.next=8,new Promise((function(e){d.taskqueue.set(i,{resolve:e,clocker:l})}));case 8:return c=e.sent,h=this.taskqueue.get(i),e.abrupt("return",(h&&(h.clocker&&clearTimeout(h.clocker),this.taskqueue.delete(i)),this.taskqueue.delete(i),c));case 11:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"updateTextForWorker",value:function(e,t){var r=e.workId,n=e.isActive,i=o(e,["workId","isActive"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,i.viewId);var a=s(s({},this.editors.get(r)||{}),i);if(a.waitWorker&&delete a.waitWorker,n)return a.canWorker=!1,a.canSync=!1,this.editors.set(r,a),void this.active(r);this.editors.set(r,a),this.control.viewContainerManager.setActiveTextEditor(i.viewId,this.activeId)}},{key:"get",value:function(e){return this.editors.get(e)}},{key:"delete",value:function(e,t,r){var n=this.editors.get(e);if(n){var i=n.viewId;n.canSync=t,n.canWorker=r,this.editors.delete(e),this.activeId===e&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(i,this.activeId)}}},{key:"deleteBatch",value:function(e,t,r){var n,i=new Set,o=l(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.editors.get(a);if(s){var u=s.viewId;s.canSync=t,s.canWorker=r,this.editors.delete(a),this.activeId===a&&(this.activeId=void 0),i.add(u)}}}catch(e){o.e(e)}finally{o.f()}var c,h=l(i);try{for(h.s();!(c=h.n()).done;){var d=c.value;this.control.viewContainerManager.setActiveTextEditor(d,this.activeId)}}catch(e){h.e(e)}finally{h.f()}}},{key:"clear",value:function(e,t){var r=this;this.editors.forEach((function(n,i){n.viewId===e&&(t&&(n.canSync=!1),n.canWorker=!1,r.editors.delete(i))})),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(e,this.activeId)}},{key:"destory",value:function(){this.editors.clear(),this.activeId=void 0}},{key:"collector",get:function(){return this.control.collector}},{key:"interceptors",get:function(){var e=this;return{set:function(t,r){var n,i,o,a,s,u,l,c;if(!e.collector)return!0;var h=r.viewId,d=r.scenePath,f=r.canSync,p=r.canWorker,v=r.type,g=r.opt,m=r.dataType;if(!p&&!f)return!0;var y=(null==(n=e.collector)?void 0:n.isLocalId(t))?null==(i=e.collector)?void 0:i.transformKey(t):t,_=(null==(o=e.collector)?void 0:o.storage[h])&&e.collector.storage[h][d]&&e.collector.storage[h][d][y]||void 0;_?_.toolsType===W.Text&&(p&&(e.control.worker.queryTaskBatchData({workId:t,msgType:H.UpdateNode}).forEach((function(t){var r;null==(r=e.control.worker)||r.taskBatchData.delete(t)})),null==(l=e.control.worker)||l.taskBatchData.add({workId:t,msgType:H.UpdateNode,dataType:m||G.Local,toolsType:W.Text,opt:g,viewId:h,scenePath:d,willRefresh:!0}),null==(c=e.control.worker)||c.runAnimation()),f&&vs((function(){var r;null==(r=e.collector)||r.dispatch({type:H.UpdateNode,workId:t,toolsType:W.Text,opt:g,viewId:h,scenePath:d})}),e.control.worker.maxLastSyncTime)):v===xs.Text&&(f&&(null==(a=e.collector)||a.dispatch({type:g.text&&H.FullWork||H.CreateWork,workId:t,toolsType:W.Text,opt:g,isSync:!0,viewId:h,scenePath:d})),p&&(null==(s=e.control.worker)||s.taskBatchData.add({workId:t,msgType:g.text&&H.FullWork||H.CreateWork,dataType:m||G.Local,toolsType:W.Text,opt:g,viewId:h,scenePath:d,willRefresh:!0}),null==(u=e.control.worker)||u.runAnimation()))},delete:function(t){var r,n;if(!e.collector)return!0;var i=e.editors.get(t);if(!i)return!0;var o=i.viewId,a=i.scenePath,s=i.canSync,u=i.canWorker;if(!u&&!s)return!0;u&&(null==(r=e.control.worker)||r.taskBatchData.add({workId:t,toolsType:W.Text,msgType:H.RemoveNode,dataType:G.Local,viewId:o,scenePath:a,willRefresh:!0}),null==(n=e.control.worker)||n.runAnimation()),s&&vs((function(){var r;null==(r=e.collector)||r.dispatch({type:H.RemoveNode,removeIds:[t],toolsType:W.Text,viewId:o,scenePath:a})}),e.control.worker.maxLastSyncTime)},clear:function(){return!0}}}}]),e}(),Ms=function(e){v(r,e);var t=m(r);function r(e,n){var i;return x(this,r),i=t.call(this,e),k(_(i),"serviceStorage",{}),k(_(i),"storage",{}),k(_(i),"stateDisposer"),k(_(i),"asyncClockTimer"),k(_(i),"namespace"),i.namespace=r.namespace,r.syncInterval=.5*(n||r.syncInterval),i.serviceStorage=i.getNamespaceData(),i.storage=ca(i.serviceStorage),i}return S(r,[{key:"addStorageStateListener",value:function(e){var t=this;this.stateDisposer=E.autorun(h(regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t.getNamespaceData(),i=t.getDiffMap(t.serviceStorage,n),t.serviceStorage=n,i.size&&e(i);case 2:case"end":return r.stop()}}),r)}))))}},{key:"getDiffMap",value:function(e,t){for(var r=new Map,n=0,i=Object.entries(t);ns&&(r.animationIndex=s+2);var l=r.animationWorkData[s],c=r.animationWorkData[s+1],h=e.cursorInfoMap.get(a)||new Map;Me(l)&&Me(c)?h.set(u.memberId,{x:l,y:c,roomMember:u,timestamp:t}):h.has(u.memberId)&&h.delete(u.memberId),h.size?e.cursorInfoMap.set(a,h):e.cursorInfoMap.has(a)&&(e.cursorInfoMap.delete(a),e.internalMsgEmitter.emit([F.Cursor,a],[])),r.animationWorkData.length-1<=r.animationIndex&&e.animationPointWorkers.delete(n)}}})),this.animationDrawWorkers.forEach((function(r,n){var i=e.getUidAndviewId(n),o=i.uid,a=i.viewId,s=r.animationIndex,u=e.roomMember.getRoomMember(o);if(u){r.animationWorkData.length-1>s&&(r.animationIndex=s+2);var l=r.animationWorkData[s],c=r.animationWorkData[s+1],h=e.cursorInfoMap.get(a)||new Map;Me(l)&&Me(c)?h.set(u.memberId,{x:l,y:c,roomMember:u,timestamp:t}):h.has(u.memberId)&&h.delete(u.memberId),h.size?e.cursorInfoMap.set(a,h):e.cursorInfoMap.has(a)&&(e.cursorInfoMap.delete(a),e.internalMsgEmitter.emit([F.Cursor,a],[])),r.animationWorkData.length-1<=r.animationIndex&&e.animationDrawWorkers.delete(n)}}));var r,n=l(this.cursorInfoMap);try{for(n.s();!(r=n.n()).done;){var i=d(r.value,2),a=i[0],s=i[1];if(s){var u,c=[],h=[],f=l(s.entries());try{for(f.s();!(u=f.n()).done;){var p=d(u.value,2),v=p[0],g=p[1],m=g.timestamp,y=o(g,["timestamp"]);m+this.expirationTime1&&void 0!==arguments[1]?arguments[1]:1;return"rgba("+parseInt("0x"+e.slice(1,3))+","+parseInt("0x"+e.slice(3,5))+","+parseInt("0x"+e.slice(5,7))+","+t+")"}function Ns(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return"rgba(".concat(e,",").concat(t,",").concat(r,",").concat(n,")")}function Os(e){var t=e.split(","),r=parseInt(t[0].split("(")[1]),n=parseInt(t[1]),i=parseInt(t[2]),o=Number(t[3].split(")")[0]);return[Cs(r,n,i),o]}function Rs(e){var t=e.split(",");return[parseInt(t[0].split("(")[1]),parseInt(t[1]),parseInt(t[2]),Number(t[3].split(")")[0])]}function Ds(e){return"transparent"===e}var Ls=function(e){v(r,e);var t=m(r);function r(){var e;return x(this,r),e=t.apply(this,arguments),k(_(e),"lastEmtData"),k(_(e),"emitEventType",B.SetColorNode),k(_(e),"undoTickerId"),e}return S(r,[{key:"setTextColor",value:function(e,t,r,n){var i=r.fontColor,o=r.fontBgColor;t.opt&&(i&&(t.opt.fontColor=i),o&&(t.opt.fontBgColor=o),this.control.textEditorManager.updateTextForMasterController({workId:e,opt:t.opt,viewId:n,canSync:!0,canWorker:!0}))}},{key:"collect",value:function(e){var t=this;if(this.serviceColloctor&&this.mainEngine){var r=e.workIds,n=e.strokeColor,o=e.fillColor,a=e.fontColor,s=e.fontBgColor,u=e.viewId,l=e.workState,c=this.control.viewContainerManager.getView(u);if(null!=c&&c.displayer){var h=c.focusScenePath,f=i(r),p=this.serviceColloctor.storage,v=[],g={};for((l===V.Start||!this.undoTickerId&&l===V.Done)&&(this.undoTickerId=Date.now(),this.mainEngine.internalMsgEmitter.emit("addUndoTicker",this.undoTickerId,u));f.length;){var m=f.pop();if(m){var y=m.toString(),_=this.serviceColloctor.isLocalId(y),b=_?this.serviceColloctor.transformKey(m):y,x=y;!_&&this.serviceColloctor.isOwn(x)&&(x=this.serviceColloctor.getLocalId(x));var w=p[u][h][b]||void 0;if(w){var S=w.updateNodeOpt||{};if(a||s){if(a){S.fontColor=a;var T=d(Rs(a),4),M=T[0],k=T[1],E=T[2],I=T[3];g.textColor=[M,k,E],g.textOpacity=I}if(s)if(S.fontBgColor=Ds(s)?"transparent":s,Ds(s))g.textBgColor=void 0,g.textBgOpacity=void 0;else{var A=d(Rs(s),4),C=A[0],P=A[1],N=A[2],O=A[3];g.textBgColor=[C,P,N],g.textBgOpacity=O}if(w.toolsType===W.Text&&w.opt&&l!==V.Start){this.setTextColor(x,ca(w),S,u),l===V.Done&&(this.undoTickerId=void 0);continue}}if(n){S.strokeColor=n;var R=d(Rs(n),4),D=R[0],L=R[1],j=R[2],z=R[3];g.strokeColor=[D,L,j],g.strokeOpacity=z}if(o)if(S.fillColor=Ds(o)?"transparent":o,Ds(o))g.fillColor=void 0,g.fillOpacity=void 0;else{var B=d(Rs(o),4),F=B[0],U=B[1],Y=B[2],$=B[3];g.fillColor=[F,U,Y],g.fillOpacity=$}var X={workId:x,msgType:H.UpdateNode,dataType:G.Local,updateNodeOpt:S,emitEventType:this.emitEventType,willRefresh:!0,willRefreshSelector:!0,willSyncService:!0,textUpdateForWoker:!0,viewId:u};v.push([X,{workId:x,msgType:H.UpdateNode,emitEventType:this.emitEventType}])}}}v.length&&(l===V.Done&&(this.undoTickerId=void 0),this.collectForLocalWorker(v)),Object.keys(g).length&&setTimeout((function(){var e;null==(e=t.control.room)||e.setMemberState(g)}),0)}}}}]),r}(Is),js=function(e){v(r,e);var t=m(r);function r(){var e;return x(this,r),e=t.apply(this,arguments),k(_(e),"lastEmtData"),k(_(e),"emitEventType",B.ZIndexNode),k(_(e),"zIndexMap",new Map),e}return S(r,[{key:"clearZIndex",value:function(e){this.zIndexMap.delete(e)}},{key:"getMinZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.min)||0}},{key:"getMaxZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.max)||0}},{key:"setMaxZIndex",value:function(e,t){var r=this.getMinZIndex(t);this.zIndexMap.set(t,{min:r,max:e})}},{key:"setMinZIndex",value:function(e,t){var r=this.getMaxZIndex(t);this.zIndexMap.set(t,{min:e,max:r})}},{key:"addMaxLayer",value:function(e){var t=this.getMaxZIndex(e)+1;this.setMaxZIndex(t,e)}},{key:"addMinLayer",value:function(e){var t=this.getMinZIndex(e)-1;this.setMinZIndex(t,e)}},{key:"correct",value:function(e){for(var t=e.sort((function(e,t){return e[1]-t[1]})),r=1;r((null==(a=null==(o=l[f(e,t.serviceColloctor)])?void 0:o.opt)?void 0:a.zIndex)||0)?1:ei.wokerDrawCount?r.forEach((function(e){e.imageBitmap&&(e.isUnClose=!0,i.reRenders.push(e))})):i.reRenders.length&&i.clearReRenders(),i.wokerDrawCount<1/0&&i.viewContainerManager.render(r)))}};case 12:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"clearReRenders",value:function(){this.reRenders.length&&(this.reRenders.forEach((function(e){var t;e.imageBitmap&&(null==(t=e.imageBitmap)||t.close())})),this.reRenders.length=0)}},{key:"getTasksqueueState",value:function(){return this.useTasksqueue&&V.Doing||V.Done}},{key:"setMaxDrawCount",value:function(e){this.maxDrawCount=e}},{key:"setWorkerTasksqueueCount",value:function(e){this.workerTasksqueueCount=Math.max(this.workerTasksqueueCount||0,e)}},{key:"collectorSyncData",value:function(e){var t,r,n,i=this,o=!1,a=l(e);try{for(a.s();!(n=a.n()).done;){var u=n.value,c=u.type,h=u.selectIds,d=u.opt,f=u.selectRect,p=u.strokeColor,v=u.fillColor,g=u.willSyncService,m=u.isSync,y=u.imageBitmap,_=u.canvasHeight,b=u.canvasWidth,x=u.rect,w=u.op,S=u.canTextEdit,T=u.points,M=u.selectorColor,k=u.canRotate,E=u.scaleType,I=u.textOpt,A=u.toolsType,C=u.workId,P=u.viewId,N=u.dataType,O=u.canLock,R=u.isLocked,D=u.shapeOpt,L=u.toolsTypes;if(!P)return void console.error("collectorSyncData",u);var j=u.scenePath||this.viewContainerManager.getCurScenePath(P);switch(c){case H.Select:var z=null!=h&&h.length?s(s({},f),{},{selectIds:h,canvasHeight:_,canvasWidth:b,points:T}):void 0;z&&null!=d&&d.strokeColor&&(z.selectorColor=d.strokeColor),z&&M&&(z.selectorColor=M),z&&p&&(z.strokeColor=p),z&&null!=d&&d.fillColor&&(z.fillColor=d.fillColor),z&&v&&(z.fillColor=v),z&&ls(k)&&(z.canRotate=k),z&&E&&(z.scaleType=E),z&&S&&(z.canTextEdit=S),z&&I&&(z.textOpt=I),z&&ls(O)&&(z.canLock=O),z&&ls(R)&&(z.isLocked=R),z&&D&&(z.shapeOpt=D),z&&L&&(z.toolsTypes=L),P&&this.viewContainerManager.showFloatBar(P,!!z,z),g&&(null==(t=this.collector)||t.dispatch({type:c,selectIds:h,opt:d,isSync:m,viewId:P,scenePath:j}));break;case H.Snapshot:if(y&&j){var B=this.snapshotMap.get(j);B&&B(y)}break;case H.BoundingBox:if(x&&j){var F=this.boundingRectMap.get(j);F&&F(x)}break;case H.Cursor:w&&this.control.cursor.collectServiceCursor(s({},u));break;case H.Clear:P&&this.viewContainerManager.showFloatBar(P,!1),P&&this.clearAllResolve&&this.clearAllResolve(P);break;case H.TextUpdate:if(A===W.Text&&C&&P){var U=this.viewContainerManager.transformToOriginPoint((null==d?void 0:d.boxPoint)||[0,0],P),V=(null==d?void 0:d.boxSize)||[0,0],Y=null==(r=this.viewContainerManager.getView(P))?void 0:r.cameraOpt;d?this.control.textEditorManager.updateTextForWorker({x:U[0],y:U[1],w:V[0],h:V[1],scale:(null==Y?void 0:Y.scale)||1,workId:C,opt:d,dataType:N,viewId:P,canSync:g||!1,canWorker:!1}):this.control.textEditorManager.delete(C,g||!1,!1)}break;case H.GetTextActive:A===W.Text&&C&&P&&this.control.textEditorManager.updateTextForWorker({workId:C,isActive:!0,viewId:P,dataType:G.Local,canWorker:!1,canSync:!0},Date.now());break;default:o=!0}}}catch(e){a.e(e)}finally{a.f()}o&&vs((function(){i.collectorAsyncData(e)}),this.maxLastSyncTime)}},{key:"collectorAsyncData",value:function(e){var t,r,n,i,o,a=l(e);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.type,c=s.op,h=s.workId,d=s.index,f=s.removeIds,p=s.ops,v=s.opt,g=s.updateNodeOpt,m=s.toolsType,y=s.isSync,_=s.viewId;if(!_)return void console.error("collectorAsyncData",s);var b=s.scenePath||this.viewContainerManager.getCurScenePath(_);switch(u){case H.DrawWork:null==(t=this.collector)||t.dispatch({type:u,op:c,workId:h,index:d,isSync:y,viewId:_,scenePath:b});break;case H.FullWork:null==(r=this.collector)||r.dispatch({type:u,ops:p,workId:h,updateNodeOpt:g,opt:v,toolsType:m,isSync:y,viewId:_,scenePath:b});break;case H.UpdateNode:null==(n=this.collector)||n.dispatch({type:u,updateNodeOpt:g,workId:h,opt:v,ops:p,op:c,isSync:y,viewId:_,scenePath:b});break;case H.RemoveNode:f&&this.control.textEditorManager.deleteBatch(f,!1,!1),null==(i=this.collector)||i.dispatch({type:u,removeIds:f,isSync:y,viewId:_,scenePath:b})}}}catch(e){a.e(e)}finally{a.f()}}},{key:"onLocalEventEnd",value:(o=h(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s,u,c,d,f,p,v,g,m=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.viewContainerManager.getView(r)){e.next=3;break}return e.abrupt("return");case 3:a=o.focusScenePath,s=o.cameraOpt,u=this.viewContainerManager.transformToScenePoint(t,r),c=[],d=l(this.localPointsBatchData.keys()),e.prev=5,d.s();case 7:if((f=d.n()).done){e.next=19;break}if(p=f.value,(null==(n=this.currentToolsData)?void 0:n.toolsType)!==W.Text){e.next=16;break}return(v=null==(i=this.getLocalPointInfo(p))?void 0:i.points)&&v[0]===u[0]&&v[1]===u[1]&&((g=this.currentLocalWorkData.toolsOpt).workState=V.Doing,g.boxPoint=u,g.boxSize=[g.fontSize,g.fontSize],this.control.textEditorManager.checkEmptyTextBlur(),this.control.textEditorManager.createTextForMasterController({workId:Date.now().toString(),x:t[0],y:t[1],scale:(null==s?void 0:s.scale)||1,opt:g,type:xs.Text,isActive:!0,viewId:r,scenePath:a},Date.now())),this.deleteLocalPoint(p),e.abrupt("continue",17);case 16:this.pushLocalPoint(p,u,V.Done,r),c.push(p);case 17:e.next=7;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(5),d.e(e.t0);case 24:return e.prev=24,d.f(),e.finish(24);case 27:if(e.t1=c.length,!e.t1){e.next=34;break}return e.next=31,new Promise((function(e){setTimeout(h(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:c.forEach((function(e){m.setLocalPointIsFullWork(e)})),m.delayWorkStateToDoneResolve=e,c[0]&&m.control.runEffectWork((function(){var e;m.setShapeSelectorByWorkId(c[0].toString(),r),(null==(e=m.currentToolsData)?void 0:e.toolsType)===W.Selector&&m.viewContainerManager.activeFloatBar(r)})),(null==(n=m.currentToolsData)?void 0:n.toolsType)===W.Selector&&m.viewContainerManager.activeFloatBar(r),m.runAnimation();case 1:case"end":return t.stop()}}),t)}))),0)}));case 31:this.delayWorkStateToDoneResolve=void 0,c.forEach((function(e){m.deleteLocalPoint(e)})),c.length=0;case 34:case"end":return e.stop()}}),e,this,[[5,21,24,27]])}))),function(e,t){return o.apply(this,arguments)})},{key:"onLocalEventDoing",value:function(e,t){this.currentLocalWorkData.workState===V.Start&&this.setCurrentLocalWorkData(s(s({},this.currentLocalWorkData),{},{workState:V.Doing}));var r,n=!1,i=l(this.localPointsBatchData.entries());try{for(i.s();!(r=i.n()).done;){var o=d(r.value,2),a=o[0],u=o[1].state;if(this.isAbled()&&u!==V.Pending){var c=this.viewContainerManager.transformToScenePoint(e,t);this.pushLocalPoint(a,c,u===V.Start?V.Doing:u,t),n=!0}}}catch(e){i.e(e)}finally{i.f()}n?this.runAnimation():this.hoverCursor(e,t)}},{key:"onLocalEventStart",value:function(e,t){var r,n,i,o,a,s,u,l;this.viewContainerManager.focuedViewId!==t&&this.viewContainerManager.setFocuedViewId(t);var c=this.viewContainerManager.transformToScenePoint(e,t),h=(null==(r=this.currentToolsData)?void 0:r.toolsType)===W.Selector?va:Date.now();this.pushLocalPoint(h,c,V.Start,t);var d=this.setZIndex(t);if(this.setCurrentLocalWorkData({workState:V.Start,toolsOpt:d,viewId:t}),this.control.textEditorManager.checkEmptyTextBlur(),(null==(n=this.currentToolsData)?void 0:n.toolsType)!==W.Text){if(this.isCanRecordUndoRedo&&this.internalMsgEmitter.emit("addUndoTicker",h,t),this.maxDrawCount=0,this.wokerDrawCount=0,this.subWorkerDrawCount=0,this.reRenders.length=0,h&&d&&null!=(i=this.currentToolsData)&&i.toolsType&&this.prepareOnceWork({workId:h,toolsOpt:d,viewId:t},null==(o=this.currentToolsData)?void 0:o.toolsType),this.isCanDrawWork){var f=this.viewContainerManager.getCurScenePath(t);null==(s=this.collector)||s.dispatch({type:H.CreateWork,workId:h,toolsType:null==(a=this.currentToolsData)?void 0:a.toolsType,opt:d,viewId:t,scenePath:f}),f&&null!=(u=this.collector)&&u.hasSelector(t,f)&&this.blurSelector(t,f)}else(null==(l=this.currentToolsData)?void 0:l.toolsType)===W.Selector&&this.viewContainerManager.unActiveFloatBar(t);this.consume()}}},{key:"setLocalPointIsFullWork",value:function(e){var t=this.getLocalPointInfo(e);t&&(t.isFullWork=!0,this.localPointsBatchData.set(e,t))}},{key:"pushLocalPoint",value:function(e,t,r,n){var i=this.getLocalPointInfo(e);i?(i.state=r,i.points.push(t[0],t[1])):i={state:V.Start,points:t,isFullWork:!1,viewId:n},this.localPointsBatchData.set(e,i)}},{key:"deleteLocalPoint",value:function(e){this.localPointsBatchData.delete(e)}},{key:"getLocalPointInfo",value:function(e){return this.localPointsBatchData.get(e)}},{key:"getLocalPointsInfo",value:function(){return this.localPointsBatchData}},{key:"correctStorage",value:function(e,t,r){var n,i=this,o=new Map,a=[];Object.keys(e).forEach((function(t){var r,n,i=null==(n=null==(r=e[t])?void 0:r.opt)?void 0:n.zIndex;Me(i)&&a.push([t,i])}));var s=a.length&&(null==(n=this.zIndexNodeMethod)?void 0:n.correct(a))||[];this.zIndexNodeMethod&&s.length&&(this.zIndexNodeMethod.setMinZIndex(s[0][1]||0,t),this.zIndexNodeMethod.setMaxZIndex(s[s.length-1][1]||0,t));var u,c=l(s);try{for(c.s();!(u=c.n()).done;){var h=d(u.value,2),f=h[0],p=h[1];if(e[f]){var v=e[f];v.opt&&Me(v.opt.zIndex)&&v.opt.zIndex!==p&&(v.opt.zIndex=p,o.set(f,v))}}}catch(e){c.e(e)}finally{c.f()}return o.size&&o.forEach((function(n,o){var a;null==(a=i.collector)||a.updateValue(o,n,{viewId:t,scenePath:r,isSync:!0}),e[o]=n})),e}},{key:"originalEventLintener",value:(i=h(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isAbled()){e.next=13;break}e.t0=t,e.next=e.t0===V.Start?4:e.t0===V.Doing?6:e.t0===V.Done?8:13;break;case 4:return this.setLocalWorkViewId(n),n&&this.onLocalEventStart(r,n),e.abrupt("break",13);case 6:return n&&n===this.getLocalWorkViewId()&&this.onLocalEventDoing(r,n),e.abrupt("break",13);case 8:if(e.t1=n&&n===this.getLocalWorkViewId(),!e.t1){e.next=12;break}return e.next=12,this.onLocalEventEnd(r,n);case 12:return e.abrupt("break",13);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return i.apply(this,arguments)})},{key:"getLocalWorkViewId",value:function(){return this.localWorkViewId}},{key:"setLocalWorkViewId",value:function(e){this.localWorkViewId=e}},{key:"setCurrentToolsData",value:function(e){var t,r,i,o=this,a=e.toolsType,u=(null==(t=this.currentToolsData)?void 0:t.toolsType)!==e.toolsType;if(this.isActive||!u){if(n(b(f.prototype),"setCurrentToolsData",this).call(this,e),u){var c,h=l(null==(r=this.viewContainerManager)?void 0:r.getAllViews());try{for(h.s();!(c=h.n()).done;){var d=c.value;if(d){var p=d.id,v=d.focusScenePath;u&&p&&v&&(null!=(i=this.collector)&&i.hasSelector(p,v)&&this.blurSelector(p,v),this.control.textEditorManager.checkEmptyTextBlur())}}}catch(e){h.e(e)}finally{h.f()}this.taskBatchData.add({msgType:H.UpdateTools,dataType:G.Local,toolsType:a,opt:s(s({},e.toolsOpt),{},{syncUnitTime:this.maxLastSyncTime}),isRunSubWork:this.isRunSubWork,viewId:"all"}),this.runAnimation()}}else setTimeout((function(){o.setCurrentToolsData(e)}),50)}},{key:"prepareOnceWork",value:function(e,t){var r=e.workId,n=e.toolsOpt,i=e.viewId;this.taskBatchData.add({msgType:H.CreateWork,workId:r,toolsType:t,opt:s(s({},n),{},{syncUnitTime:this.maxLastSyncTime}),dataType:G.Local,isRunSubWork:this.isRunSubWork,viewId:i}),this.runAnimation()}},{key:"createViewWorker",value:function(e,t){var r=t.offscreenCanvasOpt,n=t.layerOpt,i=t.dpr,o=t.cameraOpt;this.taskBatchData.add({msgType:H.Init,dataType:G.Local,viewId:e,offscreenCanvasOpt:r,layerOpt:n,dpr:i,cameraOpt:o,isRunSubWork:!0,isSafari:-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")}),this.runAnimation()}},{key:"destroyViewWorker",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getLocalWorkViewId()===e&&this.setLocalWorkViewId(void 0),this.zIndexNodeMethod&&this.zIndexNodeMethod.clearZIndex(e),this.taskBatchData.add({msgType:H.Destroy,dataType:G.Local,viewId:e,isRunSubWork:!0}),this.runAnimation(),r||null==(t=this.collector)||t.dispatch({type:H.Clear,viewId:e})}},{key:"onServiceDerive",value:function(e,t){var r,n,i,o,a=this,s=t.newValue,u=t.oldValue,l=t.viewId,c=t.scenePath,h=ca(s)||{},d=e,f=h.type;if(s||!u||(f=H.RemoveNode,u.toolsType!==W.LaserPen)){var p=null==(r=this.viewContainerManager.getView(l))?void 0:r.focusScenePath;if(!p||p===c){if(f&&d){var v=h;if(v.workId=null!=(n=this.collector)&&n.isOwn(d)?null==(i=this.collector)?void 0:i.getLocalId(d):d,v.msgType=f,v.toolsType===W.LaserPen&&(v.isRunSubWork=!0),v.dataType=G.Service,v.viewId=l,v.scenePath=c,v.selectIds&&(v.selectIds=v.selectIds.map((function(e){var t,r;return null!=(t=a.collector)&&t.isOwn(e)?null==(r=a.collector)?void 0:r.getLocalId(e):e}))),v&&v.toolsType===W.Text||(null==u?void 0:u.toolsType)===W.Text)return void this.control.textEditorManager.onServiceDerive(v);this.taskBatchData.add(v)}this.runAnimation();var g=t.newValue&&(null==(o=t.newValue.opt)?void 0:o.zIndex);if(this.zIndexNodeMethod&&Me(g)){var m=this.zIndexNodeMethod.getMinZIndex(l);this.zIndexNodeMethod.getMaxZIndex(l)g&&this.zIndexNodeMethod.setMinZIndex(g,l)}}}}},{key:"pullServiceData",value:function(e,t){var r,n,i,o,a=this,s=null==(r=this.collector)?void 0:r.getStorageData(e,t);if(s){s=this.correctStorage(s,e,t);for(var u=Object.keys(s),l=0,c=u;l=t||r<0||h&&e-l>=o}function g(){var e=du();if(v(e))return m(e);s=setTimeout(g,function(e){var r=t-(e-u);return h?vu(r,o-(e-l)):r}(e))}function m(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=du(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(g,t),f(u)}return void 0===s&&(s=setTimeout(g,t)),a}return t=fu(t)||0,hu(r)&&(c=!!r.leading,o=(h="maxWait"in r)?pu(fu(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:m(du())},y},mu=ne(gu),yu=gu,_u=Ze;var bu=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return _u(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),yu(e,t,{leading:n,maxWait:t,trailing:i})},xu=ne(bu),wu=function(){function e(t){var r;x(this,e),k(this,"internalMsgEmitter"),k(this,"control"),k(this,"roomHotkeyCheckers"),k(this,"tmpCopyStore",new Map),k(this,"tmpCopyCoordInfo");var n=t.control,i=t.internalMsgEmitter;this.control=n,this.internalMsgEmitter=i,this.roomHotkeyCheckers=(null==(r=this.control.room)?void 0:r.viewsParams.hotKeys.nodes)||[]}return S(e,[{key:"getEventKey",value:function(e){return"keydown"===e.type?"KeyDown":"KeyUp"}},{key:"onActiveHotkey",value:function(e){var t,r,n,i=this.control.viewContainerManager.focuedViewId,o=null==(t=this.control.viewContainerManager.focuedView)?void 0:t.focusScenePath;if(i&&o)switch(e){case"delete":this.isSelector&&null!=(r=this.collector)&&r.hasSelector(i,o)&&Ys.emitMethod(F.MainEngine,B.DeleteNode,{workIds:[va],viewId:i});break;case"copy":this.isSelector&&null!=(n=this.collector)&&n.hasSelector(i,o)&&this.copySelectorToTemp(i,o);break;case"paste":this.tmpCopyStore.size&&this.pasteTempToFocusView(i,o)}("changeToPencil"===e||"redo"===e||"undo"===e)&&this.onSelfActiveHotkey(e)}},{key:"colloctHotkey",value:function(e){if(this.isUseSelf){var t=this.checkHotkey(e);t&&this.onSelfActiveHotkey(t)}}},{key:"onSelfActiveHotkey",value:function(e){switch(e){case"changeToPencil":this.setMemberState({currentApplianceName:L.pencil,useNewPencil:!0});break;case"changeToArrow":this.setMemberState({currentApplianceName:L.arrow});break;case"changeToClick":this.setMemberState({currentApplianceName:L.clicker});break;case"changeToEllipse":this.setMemberState({currentApplianceName:L.ellipse});break;case"changeToEraser":this.setMemberState({currentApplianceName:L.eraser,isLine:!0});break;case"changeToHand":this.setMemberState({currentApplianceName:L.hand});break;case"changeToLaserPointer":this.setMemberState({currentApplianceName:L.laserPointer});break;case"changeToSelector":this.setMemberState({currentApplianceName:L.selector});break;case"changeToRectangle":this.setMemberState({currentApplianceName:L.rectangle});break;case"changeToStraight":this.setMemberState({currentApplianceName:L.straight});break;case"redo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.redo();break;case"undo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.undo();break;case"changeToText":this.setMemberState({currentApplianceName:L.text})}}},{key:"checkHotkey",value:function(e){var t,r=l(this.roomHotkeyCheckers);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.kind;if((0,n.checker)({nativeEvent:e,kind:this.getEventKey(e),key:e.key,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},this.keyboardKind))return i}}catch(e){r.e(e)}finally{r.f()}}},{key:"copySelectorToTemp",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(B.CopyNode);if(i&&this.collector&&o){var a=this.collector.transformKey(va),s=this.collector.getStorageData(e,t);if(s){var u=s[a],l=u&&o.copySelector({viewId:e,store:u});l&&(this.tmpCopyCoordInfo=null==l?void 0:l.copyCoordInfo,this.tmpCopyStore=null==l?void 0:l.copyStores)}}}},{key:"pasteTempToFocusView",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(B.CopyNode);if(i&&this.tmpCopyCoordInfo&&this.tmpCopyStore.size&&this.collector&&o&&i.viewData&&this.tmpCopyCoordInfo){var a=P.cloneDeep(this.tmpCopyCoordInfo.offset),s=this.tmpCopyCoordInfo.cameraOpt,u=i.viewData.camera;a.x=a.x+u.centerX-s.centerX,a.y=a.y+u.centerY-s.centerY;var l=Date.now();this.control.worker.internalMsgEmitter.emit("addUndoTicker",l,e),o.pasteSelector({viewId:e,scenePath:t,copyStores:P.cloneDeep(this.tmpCopyStore),copyCoordInfo:{offset:a,cameraOpt:u},undoTickerId:l})}}},{key:"setMemberState",value:function(e){var t;null==(t=this.control.room)||t.setMemberState(e)}},{key:"isUseSelf",get:function(){var e;return(null==(e=this.control.room)?void 0:e.disableDeviceInputs)||!1}},{key:"isSelector",get:function(){var e;return(null==(e=this.control.worker.currentToolsData)?void 0:e.toolsType)===W.Selector}},{key:"collector",get:function(){return this.control.collector}},{key:"mainEngine",get:function(){return this.control.worker}},{key:"keyboardKind",get:function(){return/^Mac/i.test(navigator.platform)?"mac":"windows"}}]),e}(),Su=function(){function e(t){var r=this;x(this,e),k(this,"plugin"),k(this,"room"),k(this,"play"),k(this,"collector"),k(this,"hasSwitchToSelectorEffect"),k(this,"snapshootStateMap"),k(this,"effectResolve"),k(this,"hotkeyManager"),k(this,"pluginOptions"),k(this,"roomMember"),k(this,"cursor"),k(this,"textEditorManager"),k(this,"worker"),k(this,"onSceneChange",function(){var e=h(regeneratorRuntime.mark((function e(t,n){var i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(o=r.viewContainerManager.getView(n))&&o.focusScenePath&&null!=(i=r.collector)&&i.hasSelector(n,o.focusScenePath)&&r.worker.blurSelector(n,o.focusScenePath),r.textEditorManager.checkEmptyTextBlur(),a=null==o?void 0:o.displayer,e.t0=a,!e.t0){e.next=8;break}return a.setActive(!1),e.next=8,a.stopEventHandler();case 8:(s=t)&&r.viewContainerManager.setViewScenePath(n,s),null==a||a.setActive(!0);case 10:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),k(this,"onRoomMembersChange",(function(e){r.roomMember.setRoomMembers(E.toJS(e))})),k(this,"onMemberChange",xu((function(e){if(r.room&&r.worker){var t=r.getToolsKey(e),n=r.getToolsOpt(t,e);r.worker.setCurrentToolsData(n),r.effectViewContainer(t),r.effectResolve&&r.effectResolve(!0)}}),100,{leading:!1})),k(this,"internalSceneChange",(function(e,t){var n;null==(n=r.worker)||n.clearViewScenePath(e,!0).then((function(){var n;null==(n=r.worker)||n.pullServiceData(e,t)}))})),k(this,"internalCameraChange",(function(e,t){var n;null==(n=r.worker)||n.updateCamera(e,t)}));var n=t.displayer,i=t.plugin,o=t.options;this.plugin=i,this.room=E.isRoom(n)?n:void 0,this.play=E.isPlayer(n)?n:void 0,this.pluginOptions=o,this.roomMember=new bs;var a={control:this,internalMsgEmitter:e.InternalMsgEmitter};this.cursor=new Es(a),this.textEditorManager=new Ts(a),this.worker=new $s(a),this.hotkeyManager=new wu(a)}var t,r,n,i;return S(e,[{key:"hasOffscreenCanvas",value:function(){return"function"==typeof OffscreenCanvas}},{key:"bindPlugin",value:function(e){var t,r;this.plugin=e,this.collector&&this.collector.removeStorageStateListener(),this.collector=new _s(e,null==(r=null==(t=this.pluginOptions)?void 0:t.syncOpt)?void 0:r.interval),this.cursor.activeCollector(),this.activePlugin()}},{key:"destroy",value:function(){var e,t,r,n,i;this.roomMember.destroy(),null==(e=this.collector)||e.destroy(),null==(t=this.worker)||t.destroy(),null==(r=this.viewContainerManager)||r.destroy(),null==(n=this.cursor)||n.destroy(),null==(i=this.textEditorManager)||i.destory()}},{key:"cleanCurrentScene",value:function(){var t=Date.now(),r=this.worker.getLocalWorkViewId()||this.viewContainerManager.focuedViewId;r&&(e.InternalMsgEmitter.emit("addUndoTicker",t,r),this.worker.clearViewScenePath(r))}},{key:"onWritableChange",value:function(e){var t,r;e?null==(r=this.worker)||r.abled():null==(t=this.worker)||t.unWritable()}},{key:"getToolsKey",value:function(e){var t=e.currentApplianceName;switch(this.hasSwitchToSelectorEffect=!1,t){case L.text:return e.textCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),W.Text;case L.pencil:return e.useLaserPen?W.LaserPen:W.Pencil;case L.eraser:case L.pencilEraser:return W.Eraser;case L.selector:return W.Selector;case L.arrow:return e.arrowCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),W.Arrow;case L.straight:return e.straightCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),W.Straight;case L.ellipse:return e.ellipseCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),W.Ellipse;case L.rectangle:return e.rectangleCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),W.Rectangle;case L.shape:if(e.shapeCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),e.shapeType===z.Pentagram||e.shapeType===z.Star)return W.Star;if(e.shapeType===z.Polygon||e.shapeType===z.Triangle||e.shapeType===z.Rhombus)return W.Polygon;if(e.shapeType===z.SpeechBalloon)return W.SpeechBalloon}return W.Clicker}},{key:"getToolsOpt",value:function(e,t){var r=t.currentApplianceName,n={strokeColor:Ns(t.strokeColor[0],t.strokeColor[1],t.strokeColor[2],t.strokeOpacity||1),thickness:t.strokeWidth,isOpacity:(null==t?void 0:t.strokeOpacity)&&t.strokeOpacity<1||(null==t?void 0:t.fillOpacity)&&t.fillOpacity<1||(null==t?void 0:t.textOpacity)&&t.textOpacity<1||(null==t?void 0:t.textBgOpacity)&&t.textBgOpacity<1||!1};switch(e){case W.Text:n.fontFamily=window.getComputedStyle(document.documentElement).getPropertyValue("font-family"),n.fontSize=(null==t?void 0:t.textSizeOverride)||(null==t?void 0:t.textSize)||Number(window.getComputedStyle(document.body).fontSize),n.textAlign=(null==t?void 0:t.textAlign)||"left",n.verticalAlign=(null==t?void 0:t.verticalAlign)||"middle",n.fontColor=(null==t?void 0:t.textColor)&&Ns(t.textColor[0],t.textColor[1],t.textColor[2],t.textOpacity||1)||n.strokeColor||"rgba(0,0,0,1)",n.fontBgColor=Array.isArray(null==t?void 0:t.textBgColor)&&Ns(t.textBgColor[0],t.textBgColor[1],t.textBgColor[2],t.textBgOpacity||1)||"transparent",n.bold=(null==t?void 0:t.bold)?"bold":void 0,n.italic=(null==t?void 0:t.italic)?"italic":void 0,n.underline=(null==t?void 0:t.underline)||void 0,n.lineThrough=(null==t?void 0:t.lineThrough)||void 0,n.text="",n.strokeColor=void 0;break;case W.Pencil:n.strokeType=(null==t?void 0:t.strokeType)||j.Normal;break;case W.Eraser:n.thickness=Math.min(3,Math.max(1,Math.floor(t.pencilEraserSize||1)))-1,n.isLine=r===L.eraser&&!0;break;case W.LaserPen:n.duration=(null==t?void 0:t.duration)||1,n.strokeType=(null==t?void 0:t.strokeType)||j.Normal;break;case W.Ellipse:case W.Rectangle:case W.Star:case W.Polygon:case W.SpeechBalloon:e===W.Star&&(t.shapeType===z.Pentagram?(n.vertices=10,n.innerVerticeStep=2,n.innerRatio=.4):null!=t&&t.vertices&&null!=t&&t.innerVerticeStep&&null!=t&&t.innerRatio&&(n.vertices=t.vertices,n.innerVerticeStep=t.innerVerticeStep,n.innerRatio=t.innerRatio)),e===W.Polygon&&(t.shapeType===z.Triangle?n.vertices=3:t.shapeType===z.Rhombus?n.vertices=4:t.vertices&&(n.vertices=t.vertices)),n.fillColor=(null==t?void 0:t.fillColor)&&Ns(t.fillColor[0],t.fillColor[1],t.fillColor[2],null==t?void 0:t.fillOpacity)||"transparent",e===W.SpeechBalloon&&(n.placement=t.placement||"bottomLeft")}return{toolsType:e,toolsOpt:n}}},{key:"effectViewContainer",value:function(e){var t,r,n,i,o,a=this;switch(e){case W.Text:case W.Pencil:case W.LaserPen:case W.Arrow:case W.Straight:case W.Rectangle:case W.Ellipse:case W.Star:case W.Polygon:case W.SpeechBalloon:case W.Triangle:case W.Rhombus:this.room.disableDeviceInputs=!0,null==(t=this.worker)||t.abled();break;case W.Eraser:case W.Selector:this.room.disableDeviceInputs=!1,null==(r=this.cursor)||r.unabled(),null==(n=this.worker)||n.abled();break;default:this.room.disableDeviceInputs=!1,null==(i=this.worker)||i.unWritable(),null==(o=this.cursor)||o.unabled()}setTimeout((function(){a.viewContainerManager.getAllViews().forEach((function(e){null!=e&&e.displayer&&e.displayer.bindToolsClass()}))}),0)}},{key:"getBoundingRect",value:(i=h(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==(r=this.worker)?void 0:r.getBoundingRect(t);case 2:if(!(s=e.sent)){e.next=6;break}return u=(null==(i=null==(n=this.viewContainerManager.mainView)?void 0:n.viewData)?void 0:i.convertToPointInWorld({x:s.x,y:s.y}))||{x:s.x,y:s.y},l=(null==(a=null==(o=this.viewContainerManager.mainView)?void 0:o.viewData)?void 0:a.camera.scale)||1,e.abrupt("return",{width:Math.floor(s.w/l)+1,height:Math.floor(s.h/l)+1,originX:u.x,originY:u.y});case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"screenshotToCanvas",value:(n=h(regeneratorRuntime.mark((function e(t,r,n,i,o,a,s){var u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.worker.getSnapshot(r,n,i,o);case 2:(u=e.sent)&&(t.drawImage(u,a||0,s||0),u.close());case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i,o,a,s){return n.apply(this,arguments)})},{key:"scenePreview",value:(r=h(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null==(n=this.collector)?void 0:n.getViewIdBySecenPath(t)){e.next=3;break}return e.abrupt("return");case 3:if((u=this.viewContainerManager.getView(s))&&null!=(i=u.cameraOpt)&&i.width&&null!=(o=u.cameraOpt)&&o.height){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,null==(a=this.worker)?void 0:a.getSnapshot(t);case 8:(l=e.sent)&&this.worker&&(c=document.createElement("canvas"),h=c.getContext("2d"),d=u.cameraOpt,f=d.width,p=d.height,c.width=f,c.height=p,h&&(h.drawImage(l,0,0),r.src=c.toDataURL(),r.onload=function(){c.remove()},r.onerror=function(){c.remove(),r.remove()}),l.close());case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"switchToSelector",value:function(){var e;null==(e=this.room)||e.setMemberState({currentApplianceName:L.selector})}},{key:"runEffectWork",value:(t=h(regeneratorRuntime.mark((function e(t){var r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasSwitchToSelectorEffect){e.next=5;break}return e.next=3,new Promise((function(e){n.switchToSelector(),n.effectResolve=e}));case 3:r=e.sent,this.effectResolve=void 0,r&&t&&t();case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSnapshootData",value:function(){var e;this.room&&(this.snapshootStateMap=new Map,this.snapshootStateMap.set("memberState",null==(e=this.room)?void 0:e.state.memberState))}},{key:"getSnapshootData",value:function(e){var t;return null==(t=this.snapshootStateMap)?void 0:t.get(e)}},{key:"clearSnapshootData",value:function(){var e;null==(e=this.snapshootStateMap)||e.clear(),this.snapshootStateMap=void 0}}]),e}();k(Su,"InternalMsgEmitter",new C);var Tu=Su,Mu=sa;var ku=function(e){return Mu(e,4)},Eu=ne(ku),Iu=function(){function e(t){var r=this;x(this,e),k(this,"emitter",new C),k(this,"undoStack"),k(this,"redoStack"),k(this,"worker"),k(this,"control"),k(this,"room"),k(this,"isTicking"),k(this,"undoTickerId"),k(this,"viewId"),k(this,"scenePath"),k(this,"tickStartStorerCache"),k(this,"excludeIds",new Set),k(this,"onChangeScene",mu((function(){var e=r.control.viewContainerManager.getCurScenePath(r.viewId);if(e){var t=r.undoStack.filter((function(t){return t.scenePath===e})).length,n=r.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===n&&r.tickStartStorerCache&&r.scenePath===e&&(t=1),r.emitter.emit("onCanUndoStepsUpdate",t),r.emitter.emit("onCanRedoStepsUpdate",n)}}),e.waitTime));var n=t.control,i=t.internalMsgEmitter,o=t.viewId;this.control=n,this.emitter=i,this.undoStack=[],this.redoStack=[],this.room=n.room,this.worker=n.worker,this.isTicking=!1,this.viewId=o}return S(e,[{key:"addExcludeIds",value:function(e){if(this.isTicking){var t,r=l(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.excludeIds.add(n)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"undoTickerStart",value:function(e,t){if(this.collector&&(this.undoTickerId!==e||this.scenePath!==t)){!this.undoTickerId&&!this.tickStartStorerCache&&!this.scenePath&&this.emitter.emit("onCanUndoStepsUpdate",1),this.undoTickerId&&this.viewId&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath),this.isTicking=!0;var r=this.collector.transformKey(va);this.excludeIds.add(r),this.undoTickerId=e,this.scenePath=t;var n=this.collector.getStorageData(this.viewId,t)||{};this.tickStartStorerCache=new Map(Object.entries(ca(n)))}}},{key:"undoTickerEndSync",value:function(t,r,n){var i,o;if(t===this.undoTickerId&&n===this.scenePath&&r===this.viewId&&this.tickStartStorerCache){var a=(null==(i=this.collector)?void 0:i.storage[r])&&(null==(o=this.collector)?void 0:o.storage[r][n])||{},s=this.diffFun(this.tickStartStorerCache,new Map(Object.entries(a)));s.size&&(this.undoStack.push({id:t,type:2,data:ca(s),scenePath:n}),this.undoStack.length>e.MaxStackLength&&this.undoStack.shift(),this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)),this.redoStack.length&&(this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)),this.isTicking=!1,this.scenePath=void 0,this.tickStartStorerCache=void 0,this.undoTickerId=void 0,this.excludeIds.clear()}}},{key:"undo",value:function(e){this.undoTickerId&&this.tickStartStorerCache&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath);for(var t=this.undoStack.length-1;t>=0;){if(this.undoStack[t].scenePath===e){var r=this.undoStack[t];r&&(this.redoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r)),this.undoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),n}},{key:"redo",value:function(e){for(var t=this.redoStack.length-1;t>=0;){if(this.redoStack[t].scenePath===e){var r=this.redoStack[t];r&&(!this.undoTickerId&&r.tickStartStorerCache?(this.undoTickerId=r.id,this.tickStartStorerCache=r.tickStartStorerCache,this.scenePath=r.scenePath):this.undoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r,!0)),this.redoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),i}},{key:"clear",value:function(){this.clearUndo(),this.clearRedo()}},{key:"clearUndo",value:function(){this.undoStack.length=0,this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)}},{key:"clearRedo",value:function(){this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)}},{key:"canUndo",value:function(){return!!this.undoStack.length}},{key:"canRedo",value:function(){return!!this.redoStack.length}},{key:"onFocusView",value:function(){var e=this.control.viewContainerManager.getCurScenePath(this.viewId);if(e){var t=this.undoStack.filter((function(t){return t.scenePath===e})).length,r=this.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===r&&this.tickStartStorerCache&&this.scenePath===e&&(t=1),this.emitter.emit("onCanUndoStepsUpdate",t),this.emitter.emit("onCanRedoStepsUpdate",r)}}},{key:"diffFun",value:function(e,t){var r,n=new Set,i=e.keys(),o=t.keys(),a=l(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!this.excludeIds.has(s)){var u=e.get(s),c=t.get(s);if(u&&c){if(os(c,u))continue;n.add({dataType:3,key:s,data:[u,c]})}else u&&n.add({dataType:2,key:s,data:u})}}}catch(e){a.e(e)}finally{a.f()}var h,d=l(o);try{for(d.s();!(h=d.n()).done;){var f=h.value;if(!this.excludeIds.has(f)){var p=t.get(f);p&&!e.has(f)&&n.add({dataType:1,key:f,data:p})}}}catch(e){d.e(e)}finally{d.f()}return n}},{key:"isDrawEffectiveScene",value:function(e,t){var r=e.key;return!t.includes(r)}},{key:"isDeleteEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===va&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})),u=l(s);try{for(u.s();!(a=u.n()).done;){var c=a.value;if(null!=(n=null==c?void 0:c.selectIds)&&n.includes(o))return!1}}catch(e){u.e(e)}finally{u.f()}return!0}},{key:"isOldEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===va&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})),u=l(s);try{for(u.s();!(a=u.n()).done;){var c=a.value;if(null!=(n=null==c?void 0:c.selectIds)&&n.includes(o))return!1}}catch(e){u.e(e)}finally{u.f()}return!0}},{key:"isNewEffectiveScene",value:function(e,t){var r=e.key;return!!t.includes(r)}},{key:"refreshPlugin",value:function(e){var t,r,n,i,o,a,s,u,c,h,d,f,p,v,g,m,y,_,b,x,w,S=this,T=arguments.length>1&&void 0!==arguments[1]&&arguments[1],M=e.scenePath,k=e.data;if(k&&this.collector){var E,I=l(k.values());try{for(I.s();!(E=I.n()).done;){var A=E.value,C=A.dataType,P=A.data,N=A.key,O=this.collector.getStorageData(this.viewId,M),R=O&&Object.keys(O)||[];switch(C){case 1:if(T?this.isDrawEffectiveScene(A,R):this.isDeleteEffectiveScene(A,R,M))if(T&&!Array.isArray(P)){if(null!=(t=P.updateNodeOpt)&&t.useAnimation&&(P.updateNodeOpt.useAnimation=!1),(null==(r=this.collector)?void 0:r.getLocalId(N))===va&&null!=(n=this.collector)&&n.isOwn(A.key)){var D=P.selectIds;if(D){var L,j=R.filter((function(e){var t,r;return(null==(t=S.collector)?void 0:t.getLocalId(e))===va&&!(null!=(r=S.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=S.collector)?void 0:t.storage[S.viewId][M][e]})),z=!1,B=l(j);try{for(B.s();!(L=B.n()).done;)for(var F=L.value,U=0;U1&&void 0!==arguments[1]&&arguments[1],r=this.appViews.get(e);r&&(this.control.textEditorManager.clear(e,t),r.displayer.destroy(),this.appViews.delete(e))}},{key:"createMianView",value:function(e){var t=this;this.mainView=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}})}},{key:"createAppView",value:function(e){var t=this,r=e.id,n=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}});this.appViews.set(r,n)}},{key:"isAppView",value:function(e){return e!==Ru.viewId&&this.appViews.has(e)}},{key:"getView",value:function(e){var t;return e===Ru.viewId?this.mainView:null==(t=this.appViews)?void 0:t.get(e)}},{key:"getCurScenePath",value:function(e){var t=this.getView(e);if(t)return t.focusScenePath}},{key:"getAllViews",value:function(){return[this.mainView].concat(i(this.appViews.values()))}},{key:"setViewScenePath",value:function(e,t){var r;if(e===Ru.viewId&&this.mainView)this.mainView.focusScenePath=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.focusScenePath=t)}}},{key:"setViewData",value:function(e,t){var r;if(e===Ru.viewId&&this.mainView)this.mainView.viewData=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.viewData=t)}}},{key:"setFocuedViewId",value:function(e){var t;this.focuedViewId=e,e===Ru.viewId?this.focuedView=this.mainView:this.focuedView=e&&(null==(t=this.appViews)?void 0:t.get(e))||void 0,this.control.cursor.onFocusViewChange(),this.focuedView&&this.focuedView.displayer.commiter.onFocusView()}},{key:"setViewFocusScenePath",value:function(e,t){var r,n;(n=e===Ru.viewId?this.mainView:null==(r=this.appViews)?void 0:r.get(e))&&(n.focusScenePath=t)}},{key:"destroy",value:function(){var e,t=this;this.internalMsgEmitter.removeAllListeners("addUndoTicker"),this.internalMsgEmitter.removeAllListeners("excludeIds"),null==(e=this.mainView)||e.displayer.destroy(),this.appViews.forEach((function(e){t.destroyAppView(e.id,!0),t.control.worker.destroyViewWorker(e.id)}))}},{key:"setFocuedViewCameraOpt",value:function(e){if(this.focuedView){var t=this.focuedView.cameraOpt;os(t,e)||(this.focuedView.cameraOpt=e)}}},{key:"transformToOriginPoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointOnScreen(e[0],e[1]);return[n.x,n.y]}return e}},{key:"transformToScenePoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointInWorld({x:e[0],y:e[1]});return[n.x,n.y]}return e}},{key:"render",value:function(e){var t,r,n,i,o,a,s,u,c,h,d,f,p,v,g,m,y,_,b=l(e);try{for(b.s();!(_=b.n()).done;){var x=_.value,w=x.rect,S=x.imageBitmap,T=x.isClear,M=x.isUnClose,k=x.drawCanvas,E=x.clearCanvas,I=x.viewId,A=null==(t=this.getView(I))?void 0:t.displayer;if(A&&w){var C=A.dpr,P=A.canvasBgRef,N=A.canvasFloatRef,O=A.canvasServiceFloatRef,R=A.canvasTopRef,D=w.w*C,L=w.h*C,j=w.x*C,z=w.y*C;if(T){switch(E){case $.TopFloat:null==(n=null==(r=R.current)?void 0:r.getContext("2d"))||n.clearRect(j,z,D,L);break;case $.Float:null==(o=null==(i=N.current)?void 0:i.getContext("2d"))||o.clearRect(j,z,D,L);break;case $.ServiceFloat:null==(s=null==(a=O.current)?void 0:a.getContext("2d"))||s.clearRect(j,z,D,L);break;case $.Bg:null==(c=null==(u=P.current)?void 0:u.getContext("2d"))||c.clearRect(j,z,D,L)}continue}if(k&&S)switch(k){case $.TopFloat:null==(d=null==(h=R.current)?void 0:h.getContext("2d"))||d.drawImage(S,0,0,D,L,j,z,D,L);break;case $.Float:null==(p=null==(f=N.current)?void 0:f.getContext("2d"))||p.drawImage(S,0,0,D,L,j,z,D,L);break;case $.ServiceFloat:null==(g=null==(v=O.current)?void 0:v.getContext("2d"))||g.drawImage(S,0,0,D,L,j,z,D,L);break;case $.Bg:null==(y=null==(m=P.current)?void 0:m.getContext("2d"))||y.drawImage(S,0,0,D,L,j,z,D,L)}if(M)continue;null==S||S.close()}}}catch(e){b.e(e)}finally{b.f()}}},{key:"showFloatBar",value:function(e,t,r){var n=this.getView(e),i=null==n?void 0:n.displayer.vDom;i&&i.showFloatBar(t,r)}},{key:"activeFloatBar",value:function(e){var t,r=null==(t=this.getView(e))?void 0:t.displayer;null!=r&&r.vDom&&r.vDom.setFloatZIndex(2)}},{key:"unActiveFloatBar",value:function(e){var t=this.getView(e),r=null==t?void 0:t.displayer.vDom;r&&r.setFloatZIndex(-1)}},{key:"setActiveTextEditor",value:function(e,t){var r=this.getView(e),n=null==r?void 0:r.displayer.vDom;n&&n.setActiveTextEditor(t)}}]),e}();k(Nu,"defaultCameraOpt",{centerX:0,centerY:0,scale:1}),k(Nu,"defaultScreenCanvasOpt",{autoRender:!1,contextType:Y.Canvas2d}),k(Nu,"defaultLayerOpt",{offscreen:!0,handleEvent:!1,depth:!1});var Ou=function(){function e(t,r,n){var i=this;x(this,e),k(this,"viewId"),k(this,"control"),k(this,"internalMsgEmitter"),k(this,"commiter"),k(this,"cachePoint"),k(this,"cacheCursorPoint"),k(this,"active",!0),k(this,"mousedown",(function(e){if(i.active&&0===e.button&&i.viewId){i.reflashContainerOffset();var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener(V.Start,t,i.viewId)}})),k(this,"mousemove",(function(e){if(i.active&&i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener(V.Doing,t,i.viewId)}})),k(this,"mouseup",(function(e){if(i.active&&0===e.button&&i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener(V.Done,t,i.viewId),i.cachePoint=void 0}})),k(this,"touchstart",(function(e){var t;if(i.active&&Cu(e)&&i.viewId){if(!i.control.worker.isAbled()){var r=null==(t=i.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&i.control.effectViewContainer(r)}i.control.worker.removeDrawingWork(i.viewId),i.reflashContainerOffset();var n=i.getPoint(e);i.cachePoint=n,n&&i.control.worker.originalEventLintener(V.Start,n,i.viewId)}})),k(this,"touchmove",(function(e){if(i.active){if(!Cu(e))return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener(V.Doing,t,i.viewId)}}})),k(this,"touchend",(function(e){if(i.active){if(!Cu(e)||!i.control.worker.isAbled())return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener(V.Done,t,i.viewId),i.cachePoint=void 0}}})),k(this,"cursorMouseMove",xu((function(e){var t=i.getPoint(e);i.cacheCursorPoint&&os(t,i.cacheCursorPoint)||!i.viewId||(i.cacheCursorPoint=t,t&&i.control.worker.sendCursorEvent(t,i.viewId))}),30,{leading:!1})),k(this,"cursorMouseLeave",xu((function(){i.viewId&&(i.cacheCursorPoint=[void 0,void 0],i.control.worker.sendCursorEvent(i.cacheCursorPoint,i.viewId))}),30,{leading:!1})),k(this,"keydown",(function(e){i.control.hotkeyManager.colloctHotkey(e)})),this.viewId=t,this.control=r,this.internalMsgEmitter=n;var o={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new Au(o)}var t;return S(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case W.Text:case W.Pencil:case W.LaserPen:case W.Arrow:case W.Straight:case W.Rectangle:case W.Ellipse:case W.Star:case W.Polygon:case W.SpeechBalloon:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===W.Text?"cursor-text":r===W.Pencil||r===W.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"updateSize",value:function(){this.setCanvassStyle(),this.reflashContainerOffset()}},{key:"setViewId",value:function(e){this.viewId=e}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.internalMsgEmitter.removeAllListeners([F.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Pu(e);if(t&&Me(t.x)&&Me(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener(V.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),e.addEventListener("touchstart",this.touchstart,!1),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,!1),window.addEventListener("mouseup",this.mouseup,!1),window.addEventListener("touchmove",this.touchmove,!1),window.addEventListener("touchend",this.touchend,!1),e.addEventListener("mousemove",this.cursorMouseMove,!1),e.addEventListener("mouseleave",this.cursorMouseLeave,!1),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}(),Ru=function(){function e(t,r){var n=this;x(this,e),k(this,"viewId","mainView"),k(this,"control"),k(this,"internalMsgEmitter"),k(this,"commiter"),k(this,"cachePoint"),k(this,"cacheCursorPoint"),k(this,"active",!0),k(this,"mousedown",(function(e){if(n.active&&0===e.button){n.reflashContainerOffset();var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener(V.Start,t,n.viewId)}})),k(this,"mousemove",(function(e){if(n.active){var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener(V.Doing,t,n.viewId)}})),k(this,"mouseup",(function(e){if(n.active&&0===e.button){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener(V.Done,t,n.viewId),n.cachePoint=void 0}})),k(this,"touchstart",(function(e){var t;if(n.active&&Cu(e)){if(!n.control.worker.isAbled()){var r=null==(t=n.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&n.control.effectViewContainer(r)}n.control.worker.removeDrawingWork(n.viewId),n.reflashContainerOffset();var i=n.getPoint(e);n.cachePoint=i,i&&n.control.worker.originalEventLintener(V.Start,i,n.viewId)}})),k(this,"touchmove",(function(e){if(n.active){if(!Cu(e))return n.control.worker.unWritable(),void n.control.worker.removeDrawingWork(n.viewId);var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener(V.Doing,t,n.viewId)}})),k(this,"touchend",(function(e){if(n.active)if(Cu(e)&&n.control.worker.isAbled()){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener(V.Done,t,n.viewId),n.cachePoint=void 0}else n.control.worker.removeDrawingWork(n.viewId)})),k(this,"cursorMouseMove",xu((function(e){var t=n.getPoint(e);n.cacheCursorPoint&&os(t,n.cacheCursorPoint)||(n.cacheCursorPoint=t,t&&n.control.worker.sendCursorEvent(t,n.viewId))}),30,{leading:!1})),k(this,"cursorMouseLeave",xu((function(){n.cacheCursorPoint=[void 0,void 0],n.control.worker.sendCursorEvent(n.cacheCursorPoint,n.viewId)}),30,{leading:!1})),k(this,"keydown",(function(e){n.control.hotkeyManager.colloctHotkey(e)})),this.control=t,this.internalMsgEmitter=r;var i={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new Au(i)}var t;return S(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case W.Text:case W.Pencil:case W.LaserPen:case W.Arrow:case W.Straight:case W.Rectangle:case W.Ellipse:case W.Star:case W.Polygon:case W.SpeechBalloon:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===W.Text?"cursor-text":r===W.Pencil||r===W.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"updateSize",value:function(){this.setCanvassStyle()}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.internalMsgEmitter.removeAllListeners([F.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Pu(e);if(t&&Me(t.x)&&Me(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener(V.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),e.addEventListener("touchstart",this.touchstart,!1),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,!1),window.addEventListener("mouseup",this.mouseup,!1),window.addEventListener("touchmove",this.touchmove,!1),window.addEventListener("touchend",this.touchend,!1),e.addEventListener("mousemove",this.cursorMouseMove,!1),e.addEventListener("mouseleave",this.cursorMouseLeave,!1),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}();k(Ru,"viewId","mainView");var Du="index-module__Container__nLsM3",Lu="index-module__CanvasBox__j2Xe-",ju="index-module__FloatCanvas__d1YR7",zu="index-module__TopFloatCanvas__7IaCw",Bu="index-module__SnapshotBox__--eeE",Fu="index-module__FloatBar__cm-EL",Uu="index-module__RotateBtn__HSSkf",Wu="index-module__ResizeBtn__yjvda",Gu="index-module__CursorBox__2UHvI",Vu="index-module__TextEditorContainer__Qm8KC",Hu="index-module__ResizeTowBox__HOllX",Yu="index-module__FloatBarBtn__FJrOG",$u={delete:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDZ2NmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY2aDBtMS0yYTIgMiAwIDAgMSAyLTJoMmEyIDIgMCAwIDEgMiAyaDBNMyA0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",duplicate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0xMSAySDZhMSAxIDAgMCAwLTEgMXY4YTEgMSAwIDAgMCAxIDFoNmExIDEgMCAwIDAgMS0xVjRoMGwtMi0yeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PHBhdGggZD0iTTExIDJ2MWExIDEgMCAwIDAgMSAxaDFsLTItMnoiLz48cGF0aCBkPSJNOSAxNEg0YTEgMSAwIDAgMS0xLTFWNWgwIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48L2c+PC9zdmc+","layer-pressed":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzMzODFGRiIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",layer:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",rotate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEzIDZhNiA2IDAgMSAxLTMuNzA5IDEuMjgzIi8+PHBhdGggZD0ibTEzIDYgMS40MTQgMi40NUwxMyA2bDIuNDUtMS40MTQiLz48L2c+PC9zdmc+","rotation-button":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+",rotation:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjRkZGIiBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+","font-colors-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","font-colors":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","to-bottom":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDEwdjhtMCAwLTItMm0yIDIgMi0ybS00IDZoMTJtLTYtNGg2bS02LTRoNm0tNi00aDYiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+","to-top":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDIydi04bTAgMC0yIDJtMi0yIDIgMm0tNC02aDEybS02IDRoNm0tNiA0aDZtLTYgNGg2IiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","bold-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",bold:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","underline-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",underline:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","italic-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",italic:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","unlock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiMzMzgxRkYiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0xYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDN2MyIgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+","lock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiM0NDRFNjAiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0zYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDV2MyIgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+",shapes:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","shapes-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","font-style-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","font-style":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",polygon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==","polygon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","polygon-vertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTA3NyAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU0My40NzQ1MjYgNDIuMzA3MzY4YTExOS4zNzY4NDIgMTE5LjM3Njg0MiAwIDAgMSAxMTAuODA3NTc5IDE2My44NGwxOTAuNTcxNzkgMTM4LjYxNzI2NGExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEgODMuMzc1MTU4IDIxOC43MDQ4NDJsLTc0LjMyMDg0MiAyMjguODM3MDUyYTExOS4zMjI5NDcgMTE5LjMyMjk0NyAwIDAgMS02MS4yNzgzMTYgMjIxLjg4NDYzMmMtNDYuNzgwNjMyIDAtODcuMzA5NDc0LTI2Ljk0NzM2OC0xMDYuODczMjYzLTY2LjEyODg0MmgtMjg5LjQxNDczN2ExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEtMTc5LjczODk0OC0xNDcuODMzMjYzbC03Mi4yNzI4NDItMjIyLjY5MzA1My0zLjM5NTM2OCAwLjEwNzc4OUExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAwIDEgMjEuODI3MzY4IDQ2Ni43Mjg0MjFMMjEuNTU3ODk1IDQ1OC4yMTMwNTNhMTE5LjM3Njg0MiAxMTkuMzc2ODQyIDAgMCAxIDE4My44MzQ5NDctMTAwLjUxMzY4NWwyMjMuNTAxNDc0LTE2Mi4zODQ4NDJhMTE5LjQzMDczNyAxMTkuNDMwNzM3IDAgMCAxIDExNC41ODAyMS0xNTMuMDYxMDUyek0yODkuNDE0NzM3IDg0MC4wNTcyNjNhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6IG01MDMuMTYxMjYzIDBhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6TTQ2Mi42ODYzMTYgMjQ5LjU4NjUyNkwyNDguMTMxMzY4IDQwNS41NTc4OTVhMTE5LjMyMjk0NyAxMTkuMzIyOTQ3IDAgMCAxLTQyLjg0NjMxNSAxNTMuMjIyNzM3bDcwLjcwOTg5NCAyMTcuMzU3NDczYTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMSAxMzIuNDE5MzY5IDEwOC4yMjA2MzJINjczLjY4NDIxMWExMTkuNDMwNzM3IDExOS40MzA3MzcgMCAwIDEgMTE5LjE2MTI2My0xMDguOTc1MTU4bDcxLjE0MTA1Mi0yMTguOTc0MzE2YTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMS02Mi4wODY3MzctMTY0LjIxNzI2M2wtMTg2LjM2OC0xMzUuMjc1Nzg5Yy0xOS45OTQ5NDcgMTUuMDkwNTI2LTQ1LjAwMjEwNSAyNC4xNDQ4NDItNzIuMDU3MjYzIDI0LjE0NDg0MmExMTguOTQ1Njg0IDExOC45NDU2ODQgMCAwIDEtODAuNzg4MjEtMzEuNDc0NTI3eiBtLTMyMS43NTE1NzkgMTUzLjkyMzM2OWE1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQwNjMxNiA1NC43MDMxNTggNTQuNzAzMTU4IDAgMCAwIDAtMTA5LjQwNjMxNnogbTc2Ny43MzA1MjYtMTIuNTU3NDc0YTU0LjcwMzE1OCA1NC43MDMxNTggMCAxIDAgMCAxMDkuNDA2MzE2IDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE2eiBtLTM2NS4xOTA3MzctMjg0LjAyNTI2M2E1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQ2MDIxIDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE1eiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",star:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","star-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","star-innerVertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTg1LjMzMzMzMyAwYTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODEuNDA4IDU5LjczMzMzM2g0OC4yMTMzMzR2ODUuMzMzMzM0TDE3MC42NjY2NjcgMTQ0Ljk4MTMzM1Y4NTMuMzMzMzMzaDY5My4zMzMzMzNsLTI2LjQ1MzMzMy02My40ODggNzguNzYyNjY2LTMyLjc2OCAzMi44NTMzMzQgNzguNzYyNjY3LTQyLjI0IDE3LjQ5MzMzM0g5MzguNjY2NjY3YTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODQuNzM2IDc1LjM0OTMzNEwxMDI0IDkzOC42NjY2NjdhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS0xNzAuNjY2NjY3IDBIMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxLTg1LjMzMzMzNC04NS4zMzMzMzRWMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxIDAtMTcwLjY2NjY2N3ogbTc2NS4zNTQ2NjcgNTk5LjQ2NjY2N2wzMi44NTMzMzMgNzguNzYyNjY2LTc4Ljg0OCAzMi44NTMzMzQtMzIuNzY4LTc4Ljc2MjY2NyA3OC43NjI2NjctMzIuODUzMzMzeiBtLTY1LjcwNjY2Ny0xNTcuNTI1MzM0bDMyLjg1MzMzNCA3OC43NjI2NjctNzguNzYyNjY3IDMyLjg1MzMzMy0zMi43NjgtNzguNzYyNjY2IDc4Ljc2MjY2Ny0zMi44NTMzMzR6TTcxOS4zNiAyODQuNDE2bDMyLjg1MzMzMyA3OC43NjI2NjctNzguNzYyNjY2IDMyLjg1MzMzMy0zMi44NTMzMzQtNzguNzYyNjY3IDc4Ljc2MjY2Ny0zMi44NTMzMzN6IG0tNjUuNjIxMzMzLTE1Ny41MjUzMzNsMzIuODUzMzMzIDc4Ljc2MjY2Ni03OC43NjI2NjcgMzIuODUzMzM0LTMyLjg1MzMzMy03OC43NjI2NjcgNzguNzYyNjY3LTMyLjg1MzMzM3pNMzg1LjcwNjY2NyA1OS43MzMzMzN2ODUuMzMzMzM0aC04NS4zMzMzMzR2LTg1LjMzMzMzNGg4NS4zMzMzMzR6IG0xNzAuNjY2NjY2IDB2ODUuMzMzMzM0aC04NS4zMzMzMzN2LTg1LjMzMzMzNGg4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIiA+PC9wYXRoPjwvc3ZnPg==","star-innerRatio":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU2OS4zNDQgNDQ5LjUzNmwxNDYuOTQ0IDI4LjY3MiAxLjAyNC00LjYwOHY0LjYwOGgxLjAyNGM5LjcyOCAwIDE2Ljg5Ni03LjY4IDIwLjQ4LTE0Ljg0OGwxLjAyNC0yLjA0OHYtMi41NmMwLTUuNjMyIDAtMTEuMjY0LTUuMTItMTYuMzg0LTMuMDcyLTMuMDcyLTcuMTY4LTcuMTY4LTEyLjgtNy42OGwtMTI0LjkyOC0yNC4wNjRMNTQxLjY5NiAyODYuNzJjLTIuMDQ4LTQuNjA4LTYuNjU2LTguMTkyLTExLjc3Ni05LjcyOC01LjEyLTEuNTM2LTEwLjc1Mi0xLjUzNi0xNS4zNiAxLjAyNGwtMS41MzYgMC41MTItMS4wMjQgMS4wMjRjLTguMTkyIDguMTkyLTEwLjc1MiAxOS40NTYtNi42NTYgMjcuMTM2bDY0IDE0Mi44NDh6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PHBhdGggZD0iTTkzMS4zMjggNDAzLjQ1NmMtMTAuMjQtMzUuMzI4LTM4LjQtNjEuNDQtNzEuNjgtNjYuNTZsLTE4NC44MzItMzUuODQtODIuNDMyLTE4Mi43ODRjLTEyLjgtMzMuMjgtNDYuMDgtNTYuMzItODAuMzg0LTU2LjMyLTMzLjc5MiAwLTY0LjUxMiAyMC40OC03OS44NzIgNTMuNzZMMzQ5LjE4NCAyOTkuMDA4bC0xODQuMzIgMzUuMzI4Yy0zMy43OTIgNS4xMi02MS45NTIgMzEuMjMyLTcyLjE5MiA2Ni41Ni05LjcyOCAzNC4zMDQtMS4wMjQgNzIuMTkyIDIzLjA0IDk4LjgxNmwxMzEuNTg0IDEzMy42MzItMzUuODQgMTk2LjYwOGMtNS42MzIgMzQuODE2IDguNzA0IDcxLjY4IDM1Ljg0IDk0LjIwOCAxMy44MjQgMTEuMjY0IDM0LjMwNCAxOC40MzIgNTIuMjI0IDE4LjQzMiAxNi44OTYgMCAyOS42OTYtMy4wNzIgNDEuNDcyLTEwLjI0bDE2OC45Ni05MS4xMzYgMTY2LjkxMiA5MS4xMzYgMS4wMjQgMC41MTJjMTYuODk2IDYuNjU2IDI5LjY5NiA5LjcyOCA0MC40NDggOS43MjggMTQuMzM2IDAgMjcuNjQ4LTQuMDk2IDQwLjQ0OC03LjY4IDQuNjA4LTEuNTM2IDkuNzI4LTMuMDcyIDE0Ljg0OC00LjA5NmwyLjU2LTAuNTEyIDIuMDQ4LTEuNTM2YzI1LjA4OC0yMy4wNCAzNy44ODgtNTguODggMzIuNzY4LTkzLjY5NmwtMzMuMjgtMTk2LjYwOCAxMzEuNTg0LTEzNi4xOTJjMjQuMDY0LTI3LjY0OCAzMi4yNTYtNjIuOTc2IDIyLjAxNi05OC44MTZ6TTI3Ni45OTIgODM2LjA5Nmw0MS45ODQtMjMxLjkzNi0xNTcuMTg0LTE1OS4yMzJjLTUuNjMyLTUuNjMyLTguMTkyLTE3LjQwOC02LjY1Ni0yOS4xODQgMy41ODQtMTAuMjQgMTAuMjQtMTYuMzg0IDE5LjQ1Ni0xNy45MmwyMTguMTEyLTQxLjk4NCA5Ni4yNTYtMjE1LjU1MmMzLjA3Mi03LjE2OCAxMi44LTE0LjMzNiAyMC40OC0xNC4zMzZzMTcuNDA4IDcuMTY4IDIwLjQ4IDE0Ljg0OGw5OC4zMDQgMjE1LjA0IDIxOC4xMTIgNDEuOTg0YzcuMTY4IDEuNTM2IDE1LjM2IDcuMTY4IDE2Ljg5NiAxNi4zODR2My4wNzJjMi4wNDggMTEuNzc2LTAuNTEyIDIyLjUyOC02LjY1NiAzMC43Mkw2OTkuOTA0IDYwOS4yOGwzOS45MzYgMjMxLjQyNGMxLjUzNiAxMC43NTItMi4wNDggMjAuNDgtMTAuMjQgMjcuMTM2bC0xLjAyNCAwLjUxMmMtMi41NiAyLjU2LTYuNjU2IDQuMDk2LTExLjI2NCA0LjA5Ni0yLjA0OCAwLTcuMTY4LTEuNTM2LTExLjI2NC0zLjU4NGwtMTk3LjEyLTEwOC4wMzItMTk5LjE2OCAxMDIuOTEyYy00LjA5NiAyLjA0OC05LjIxNiAzLjU4NC0xMS43NzYgMy41ODQtNC42MDggMC04LjcwNC0xLjUzNi0xMS4yNjQtNC4wOTZsLTEuMDI0LTAuNTEyYy02LjY1Ni02LjE0NC0xMC43NTItMTYuMzg0LTguNzA0LTI2LjYyNHoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=",speechBallon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=","speechBallon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48L3N2Zz4=","speechBallon-placement":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU3NiAyMTMuMzMzMzMzbDIyLjYxMzMzMyAyMi42MTMzMzRhMzIgMzIgMCAwIDAgMC00NS4yMjY2NjdMNTc2IDIxMy4zMzMzMzN6IG0tNjIuNzItMTA3Ljk0NjY2NmEzMiAzMiAwIDEgMC00NS4yMjY2NjcgNDUuMjI2NjY2bDQ1LjIyNjY2Ny00NS4yMjY2NjZ6IG0tNDUuMjI2NjY3IDE3MC42NjY2NjZhMzIgMzIgMCAwIDAgNDUuMjI2NjY3IDQ1LjIyNjY2N2wtNDUuMjI2NjY3LTQ1LjIyNjY2N3pNNDQ4IDgxMC42NjY2NjdsLTIyLjYxMzMzMy0yMi42MTMzMzRhMzIgMzIgMCAwIDAgMCA0NS4yMjY2NjdsMjIuNjEzMzMzLTIyLjYxMzMzM3ogbTEwNy45NDY2NjctNjIuNzJhMzIgMzIgMCAxIDAtNDUuMjI2NjY3LTQ1LjIyNjY2N2w0NS4yMjY2NjcgNDUuMjI2NjY3eiBtLTQ1LjIyNjY2NyAxNzAuNjY2NjY2YTMyIDMyIDAgMSAwIDQ1LjIyNjY2Ny00NS4yMjY2NjZsLTQ1LjIyNjY2NyA0NS4yMjY2NjZ6TTgxMC42NjY2NjcgNTc2bC0yMi42MTMzMzQgMjIuNjEzMzMzYTMyIDMyIDAgMCAwIDQ1LjIyNjY2NyAwTDgxMC42NjY2NjcgNTc2eiBtMTA3Ljk0NjY2Ni02Mi43MmEzMiAzMiAwIDEgMC00NS4yMjY2NjYtNDUuMjI2NjY3bDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAtNDUuMjI2NjY3IDQ1LjIyNjY2N2w0NS4yMjY2NjctNDUuMjI2NjY3ek0yMTMuMzMzMzMzIDQ0OGwyMi42MTMzMzQtMjIuNjEzMzMzYTMyIDMyIDAgMCAwLTQ1LjIyNjY2NyAwbDIyLjYxMzMzMyAyMi42MTMzMzN6IG02Mi43MiAxMDcuOTQ2NjY3YTMyIDMyIDAgMCAwIDQ1LjIyNjY2Ny00NS4yMjY2NjdsLTQ1LjIyNjY2NyA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAgNDUuMjI2NjY2IDQ1LjIyNjY2N2wtNDUuMjI2NjY2LTQ1LjIyNjY2N3pNMzA5LjMzMzMzMyAyMTMuMzMzMzMzQTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMjM0LjY2NjY2NyAyODh2NjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDM3My4zMzMzMzMgMjEzLjMzMzMzM2gtNjR6TTIzNC42NjY2NjcgMjg4QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMTYwIDIxMy4zMzMzMzNoLTY0QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAyMzQuNjY2NjY3IDM1MnYtNjR6TTE2MCAyMTMuMzMzMzMzYzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2NnYtNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDk2IDIxMy4zMzMzMzNoNjR6TTIzNC42NjY2NjcgMTM4LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NiA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIzNC42NjY2NjcgNzQuNjY2NjY3djY0ek0zNDEuMzMzMzMzIDI0NS4zMzMzMzNoMjM0LjY2NjY2N3YtNjRIMzQxLjMzMzMzM3Y2NHogbTI1Ny4yOC01NC42MTMzMzNsLTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NiA4NS4zMzMzMzQgODUuMzMzMzM0IDQ1LjIyNjY2Ni00NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsLTg1LjMzMzMzNCA4NS4zMzMzMzMgNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2Njd6TTY1MC42NjY2NjcgODEwLjY2NjY2N2ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2NiAxMzguNjY2NjY2di02NEE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxIDcxNC42NjY2NjcgODEwLjY2NjY2N2gtNjR6IG0xMzguNjY2NjY2IDEzOC42NjY2NjZBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDkyOCA4MTAuNjY2NjY3aC02NGE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxLTc0LjY2NjY2NyA3NC42NjY2NjZ2NjR6TTkyOCA4MTAuNjY2NjY3YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY3LTEzOC42NjY2Njd2NjRjNDEuMjE2IDAgNzQuNjY2NjY3IDMzLjQ1MDY2NyA3NC42NjY2NjcgNzQuNjY2NjY3aDY0eiBtLTEzOC42NjY2NjctMTM4LjY2NjY2N0ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgNjUwLjY2NjY2NyA4MTAuNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY2LTc0LjY2NjY2N3YtNjR6IG0tMTA2LjY2NjY2NiAxMDYuNjY2NjY3aC0yMzQuNjY2NjY3djY0SDY4Mi42NjY2Njd2LTY0eiBtLTIxMi4wNTMzMzQgNTQuNjEzMzMzbDg1LjMzMzMzNC04NS4zMzMzMzMtNDUuMjI2NjY3LTQ1LjIyNjY2Ny04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsODUuMzMzMzMzIDg1LjMzMzMzMyA0NS4yMjY2NjctNDUuMjI2NjY2LTg1LjMzMzMzNC04NS4zMzMzMzQtNDUuMjI2NjY2IDQ1LjIyNjY2N3pNNjcyIDIzNC42NjY2NjdBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDgxMC42NjY2NjcgMzczLjMzMzMzM3YtNjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjctNzQuNjY2NjY2aC02NHpNODEwLjY2NjY2NyAzNzMuMzMzMzMzYTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAxMzguNjY2NjY2LTEzOC42NjY2NjZoLTY0QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgODEwLjY2NjY2NyAzMDkuMzMzMzMzdjY0eiBtMTM4LjY2NjY2Ni0xMzguNjY2NjY2QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCA4MTAuNjY2NjY3IDk2djY0YzQxLjIxNiAwIDc0LjY2NjY2NyAzMy40NTA2NjcgNzQuNjY2NjY2IDc0LjY2NjY2N2g2NHpNODEwLjY2NjY2NyA5NmExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAtMTM4LjY2NjY2NyAxMzguNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2N3YtNjR6TTc3OC42NjY2NjcgMzQxLjMzMzMzM3YyMzQuNjY2NjY3aDY0VjM0MS4zMzMzMzNoLTY0eiBtNTQuNjEzMzMzIDI1Ny4yOGw4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2NjctODUuMzMzMzM0IDg1LjMzMzMzNCA0NS4yMjY2NjcgNDUuMjI2NjY2eiBtMC00NS4yMjY2NjZsLTg1LjMzMzMzMy04NS4zMzMzMzQtNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2Ny00NS4yMjY2NjZ6TTEzOC42NjY2NjcgNzg5LjMzMzMzM2MwLTQxLjIxNiAzMy40NTA2NjctNzQuNjY2NjY3IDc0LjY2NjY2Ni03NC42NjY2NjZ2LTY0YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY2IDEzOC42NjY2NjZoNjR6TTIxMy4zMzMzMzMgNzE0LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NyA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIxMy4zMzMzMzMgNjUwLjY2NjY2N3Y2NHogbTc0LjY2NjY2NyA3NC42NjY2NjZBNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMSAyMTMuMzMzMzMzIDg2NHY2NGExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2Ny0xMzguNjY2NjY3aC02NHpNMjEzLjMzMzMzMyA4NjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjYtNzQuNjY2NjY3aC02NEExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMjEzLjMzMzMzMyA5Mjh2LTY0ek0yNDUuMzMzMzMzIDY4Mi42NjY2Njd2LTIzNC42NjY2NjdoLTY0VjY4Mi42NjY2NjdoNjR6IG0tNTQuNjEzMzMzLTIxMi4wNTMzMzRsODUuMzMzMzMzIDg1LjMzMzMzNCA0NS4yMjY2NjctNDUuMjI2NjY3LTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NnogbTAtNDUuMjI2NjY2bC04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2NjcgODUuMzMzMzM0LTg1LjMzMzMzNC00NS4yMjY2NjctNDUuMjI2NjY2eiIgIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4="};function Xu(e){return $u[e]}var qu=function(e){var t=e.workIds,r=e.maranger;return O.createElement("div",{className:"button normal-button",style:{touchAction:"none"},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.DeleteNode,{workIds:t||[va],viewId:r.viewId})},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.DeleteNode,{workIds:t||[va],viewId:r.viewId})}},O.createElement("img",{alt:"icon",src:Xu("delete")}))},Qu=function(e){var t=e.workIds,r=e.viewId;return O.createElement("div",{className:"button normal-button",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.CopyNode,{workIds:t||[va],viewId:r})},onTouchEnd:function(e){e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.CopyNode,{workIds:t||[va],viewId:r})}},O.createElement("img",{alt:"icon",src:Xu("duplicate")}))},Zu=function(e){var t=e.icon,r=e.onClickHandler,n=e.onTouchEndHandler;return O.createElement("div",{className:"button normal-button",onClick:r,onTouchEnd:n},O.createElement("img",{src:Xu(t)}))},Ku=function(e){var t=e.open,r=e.setOpen,n=e.style,i=O.useContext(ql),o=i.floatBarData,a=i.maranger,s=d(O.useState([]),2),u=s[0],l=s[1],c=O.useMemo((function(){if(n&&n.bottom){var e={top:"inherit",bottom:50};return e}}),[n]),h=O.useMemo((function(){return t?O.createElement("div",{className:"image-layer-menu",style:c},O.createElement(Zu,{icon:"to-top",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.ZIndexNode,{workIds:[va],layer:q.Top,viewId:null==a?void 0:a.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.ZIndexNode,{workIds:[va],layer:q.Top,viewId:null==a?void 0:a.viewId})}}),O.createElement(Zu,{icon:"to-bottom",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.ZIndexNode,{workIds:[va],layer:q.Bottom,viewId:null==a?void 0:a.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),Ys.emitMethod(F.MainEngine,B.ZIndexNode,{workIds:[va],layer:q.Bottom,viewId:null==a?void 0:a.viewId})}})):null}),[t,c]);return O.useEffect((function(){os(null==o?void 0:o.selectIds,u)||null!=o&&o.selectIds&&!os(null==o?void 0:o.selectIds,u)&&(l(null==o?void 0:o.selectIds),r(!1))}),[t,o,u,r]),O.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},h,O.createElement("img",{alt:"icon",src:Xu(t?"layer-pressed":"layer")}))},Ju=function(){return O.createElement("svg",{style:{marginLeft:"2px"},viewBox:"0 0 1025 1024",width:"14",height:"14"},O.createElement("path",{d:"M1016.5248 493.8752c-9.984-9.984-26.2144-9.984-36.1984 0l-183.6032 183.6032c-29.952 29.952-78.6944 29.952-108.5952 0l-239.2064-239.2064c-14.4384-14.4384-22.3744-33.6896-22.3744-54.3232s7.936-39.8848 22.3744-54.3232l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984s-26.2144-9.984-36.1984 0l-183.6032 183.6032c-24.1152 24.1152-37.376 56.2176-37.376 90.5216 0 14.592 2.4576 28.8256 7.0656 42.1888l-374.8864 374.8864c-4.8128 4.8128-7.4752 11.3152-7.4752 18.1248l0 76.8c0 14.1312 11.4688 25.6 25.6 25.6l486.4 0c6.8096 0 13.312-2.7136 18.1248-7.4752l170.0864-170.0864c13.3632 4.6592 27.5968 7.0656 42.1888 7.0656 34.2528 0 66.4064-13.2608 90.5216-37.376l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984zM501.4016 870.4l-450.2016 0 0-40.6016 358.5024-358.5024c1.024 1.0752 1.9968 2.1504 3.0208 3.1744l239.2064 239.2064c1.024 1.024 2.0992 2.048 3.1744 3.0208l-153.7024 153.7024z",fill:"#000000"}))},el=function(e){var t=e.activeColor,r=e.onClickHandler,n=e.onTouchEndHandler;return O.createElement("div",{className:"font-color-button ".concat("transparent"===t?"active":""),onClick:r,onTouchEnd:n},O.createElement("div",{className:"circle none"}))},tl=function(e){var t=e.color,r=e.activeColor,n=e.onClickHandler,i=e.onTouchEndHandler;return O.createElement("div",{className:"font-color-button ".concat(t===r?"active":""),onClick:n,onTouchEnd:i},O.createElement("div",{className:"circle",style:{backgroundColor:Ps(t,1)}}))},rl=function(e){var t=e.opacity,r=e.activeColor,n=e.setCurOpacity,i=d(O.useState({x:108,y:0}),2),o=i[0],a=i[1];if(O.useEffect((function(){a({x:100*t+8,y:0})}),[]),!r)return null;var s=P.throttle((function(e,i){e.cancelable&&e.preventDefault(),e.stopPropagation(),i.x!==(null==o?void 0:o.x)&&a({x:i.x,y:0});var s=Math.min(Math.max(i.x-8,0),100)/100;t!==s&&n(s,r,V.Doing)}),100,{leading:!1}),u=P.throttle((function(e,t){e.cancelable&&e.preventDefault(),e.stopPropagation(),t.x!==(null==o?void 0:o.x)&&a({x:t.x,y:0});var i=Math.min(Math.max(t.x-8,0),100)/100;n(i,r,V.Done)}),100,{leading:!1});return O.createElement("div",{className:"font-color-opacity",style:{marginLeft:"10px"},onClick:function(e){var t=e.nativeEvent.offsetX,i=Math.min(Math.max(t-12,0),100)/100;a({x:100*i+8,y:0}),n(i,r,V.Done)}},O.createElement("div",{className:"range-color",style:{background:"linear-gradient(to right, ".concat(Ps(r,0),", ").concat(Ps(r,1),")")}}),O.createElement("div",{className:"range-opacity"},O.createElement(R,{bounds:"parent",axis:"x",position:o,onDrag:s,onStart:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t,r,V.Start)},onStop:u},O.createElement("div",{className:"circle",style:{backgroundColor:Ps(r,t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}}))))},nl=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,o=O.useContext(ql),a=o.floatBarData,s=o.floatBarColors,u=o.maranger,l=o.setFloatBarData,c=d(O.useState(),2),h=c[0],f=c[1],p=d(O.useState(1),2),v=p[0],g=p[1];O.useEffect((function(){if(null!=a&&a.strokeColor){var e=d(Os(a.strokeColor),2),t=e[0],r=e[1];f(t),g(r)}}),[a]);var m=O.useMemo((function(){if(null!=n&&n.current&&P.isNumber(null==a?void 0:a.y)&&null!=u&&u.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>180){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==u?void 0:u.height)-n.current.offsetTop-a.y<120){var t={top:"inherit",bottom:50};return t}}}),[n,null==a?void 0:a.y,u]),y=O.useMemo((function(){return O.createElement(rl,{key:"strokeColors",opacity:v,activeColor:h,setCurOpacity:function(e,t,r){r===V.Start&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!0),r===V.Done&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!1),g(e);var n=Ps(t,e);null!=a&&a.strokeColor&&(a.strokeColor=n,l({strokeColor:n})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],strokeColor:n,workState:r,viewId:null==u?void 0:u.viewId})}})}),[v,h,null==u?void 0:u.control.room,null==u?void 0:u.viewId,a]),_=O.useMemo((function(){return t?O.createElement("div",{className:"font-colors-menu",style:m,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},s.concat().map((function(e,t){var r=Cs.apply(void 0,i(e));return O.createElement(tl,{key:t,color:r,activeColor:h,onTouchEndHandler:function(e){e.stopPropagation(),f(r);var t=Ps(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,l({strokeColor:t})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],workState:V.Done,strokeColor:t,viewId:null==u?void 0:u.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=Ps(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,l({strokeColor:t})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],workState:V.Done,strokeColor:t,viewId:null==u?void 0:u.viewId})}})})),y):null}),[t,s,y,h,v,a,null==u?void 0:u.viewId,m]),b=O.useMemo((function(){return h?O.createElement("div",{className:"color-bar-ring",style:{backgroundColor:Ps(h,v)}},O.createElement("div",{className:"circle"})):null}),[h,v]);return O.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},b,_)},il=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,o=O.useContext(ql),a=o.floatBarData,s=o.floatBarColors,u=o.maranger,l=o.setFloatBarData,c=d(O.useState(),2),h=c[0],f=c[1],p=d(O.useState(1),2),v=p[0],g=p[1];O.useEffect((function(){if(null!=a&&a.fillColor){var e=d("transparent"===(null==a?void 0:a.fillColor)&&["transparent",1]||Os(a.fillColor),2),t=e[0],r=e[1];f(t),g(r)}}),[a]);var m=O.useMemo((function(){if(null!=n&&n.current&&P.isNumber(null==a?void 0:a.y)&&null!=u&&u.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==u?void 0:u.height)-n.current.offsetTop-a.y<140){var t={top:"inherit",bottom:50};return t}}}),[n,null==a?void 0:a.y,u]),y=O.useMemo((function(){return h&&"transparent"!==h?O.createElement(rl,{key:"fillColors",opacity:v||0,activeColor:h,setCurOpacity:function(e,t,r){r===V.Start&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!0),r===V.Done&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!1),g(e);var n=Ps(t,e);null!=a&&a.fillColor&&(a.fillColor=n,l({fillColor:n})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],fillColor:h&&Ps(t,e),workState:r,viewId:null==u?void 0:u.viewId})}}):null}),[h,v,null==u?void 0:u.control.room,null==u?void 0:u.viewId,a]),_=O.useMemo((function(){return t?O.createElement("div",{className:"font-colors-menu",style:m,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},O.createElement(el,{activeColor:h,onTouchEndHandler:function(e){e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],workState:V.Done,fillColor:t,viewId:null==u?void 0:u.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],workState:V.Done,fillColor:t,viewId:null==u?void 0:u.viewId})}}),s.map((function(e,t){var r=Cs.apply(void 0,i(e));return O.createElement(tl,{key:t,color:r,activeColor:h,onTouchEndHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=Ps(r,v);null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],workState:V.Done,fillColor:t,viewId:null==u?void 0:u.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=Ps(r,v);null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:[va],workState:V.Done,fillColor:t,viewId:null==u?void 0:u.viewId})}})})),y):null}),[t,h,s,y,a,null==u?void 0:u.viewId,v,m]),b=O.useMemo((function(){var e=h&&"transparent"!==h&&Ps(h,v)||"transparent";return O.createElement("div",{className:"color-bar-fill"},O.createElement("div",{className:"circle",style:{backgroundColor:e}}))}),[h,v]);return O.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},b,_)},ol=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,o=e.workIds,a=e.floatBarRef,s=O.useContext(ql),u=s.floatBarColors,l=s.maranger,c=s.setFloatBarData,h=s.floatBarData,f=d(O.useState(),2),p=f[0],v=f[1],g=d(O.useState(1),2),m=g[0],y=g[1];O.useEffect((function(){if(null!=n&&n.fontColor){var e=d("transparent"===(null==n?void 0:n.fontColor)&&["transparent",0]||Os(n.fontColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontColor]);var _=O.useMemo((function(){if(null!=a&&a.current&&P.isNumber(null==h?void 0:h.y)&&null!=l&&l.height){if(a.current.offsetTop&&a.current.offsetTop+h.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==l?void 0:l.height)-a.current.offsetTop-h.y<120){var t={top:"inherit",bottom:50};return t}}}),[a,null==h?void 0:h.y,l]),b=O.useMemo((function(){return p&&"transparent"!==p?O.createElement(rl,{key:"fontColors",opacity:m,activeColor:p,setCurOpacity:function(e,t,r){r===V.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===V.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),y(e);var n=Ps(t,e);null!=h&&h.textOpt&&(h.textOpt.fontColor=n,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],fontColor:p&&n,workState:r,viewId:null==l?void 0:l.viewId})}}):null}),[p,m,null==l?void 0:l.control.room,null==l?void 0:l.viewId,null==h?void 0:h.textOpt,o]),x=O.useMemo((function(){return t?O.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},u.map((function(e,t){var r=Cs.apply(void 0,i(e));return O.createElement(tl,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=Ps(r,m);null!=h&&h.textOpt&&(h.textOpt.fontColor=t,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],workState:V.Done,fontColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=Ps(r,m);null!=h&&h.textOpt&&(h.textOpt.fontColor=t,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],workState:V.Done,fontColor:t,viewId:null==l?void 0:l.viewId})}})})),b):null}),[t,u,b,p,m,null==h?void 0:h.textOpt,o,null==l?void 0:l.viewId,_]),w=O.useMemo((function(){var e=p&&"transparent"!==p&&Ps(p,m)||"transparent";return O.createElement("div",{className:"color-bar"},O.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,m]);return O.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},O.createElement("img",{alt:"icon",src:Xu("font-colors")}),w,x)},al=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,o=e.workIds,a=e.floatBarRef,s=O.useContext(ql),u=s.floatBarColors,l=s.maranger,c=s.setFloatBarData,h=s.floatBarData,f=d(O.useState(),2),p=f[0],v=f[1],g=d(O.useState(1),2),m=g[0],y=g[1];O.useEffect((function(){if(null!=n&&n.fontBgColor){var e=d("transparent"===(null==n?void 0:n.fontBgColor)&&["transparent",1]||Os(n.fontBgColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontBgColor]);var _=O.useMemo((function(){if(null!=a&&a.current&&P.isNumber(null==h?void 0:h.y)&&null!=l&&l.height){if(a.current.offsetTop&&a.current.offsetTop+h.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==l?void 0:l.height)-a.current.offsetTop-h.y<120){var t={top:"inherit",bottom:50};return t}}}),[a,null==h?void 0:h.y,l]),b=O.useMemo((function(){return p&&"transparent"!==p?O.createElement(rl,{key:"fontBgColor",opacity:m||0,activeColor:p,setCurOpacity:function(e,t,r){r===V.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===V.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),y(e);var n=Ps(t,e);null!=h&&h.textOpt&&(h.textOpt.fontBgColor=n,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],fontBgColor:p&&Ps(t,e),workState:r,viewId:null==l?void 0:l.viewId})}}):null}),[p,m,null==l?void 0:l.control.room,null==l?void 0:l.viewId,null==h?void 0:h.textOpt,o]),x=O.useMemo((function(){return t?O.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},O.createElement(el,{activeColor:p,onTouchEndHandler:function(e){e.stopPropagation();var t="transparent";v(t),null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],workState:V.Done,fontBgColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation();var t="transparent";v(t),null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],workState:V.Done,fontBgColor:t,viewId:null==l?void 0:l.viewId})}}),u.map((function(e,t){var r=Cs.apply(void 0,i(e));return O.createElement(tl,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=Ps(r,m);null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],workState:V.Done,fontBgColor:Ps(r,m),viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=Ps(r,m);null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Ys.emitMethod(F.MainEngine,B.SetColorNode,{workIds:o||[va],workState:V.Done,fontBgColor:Ps(r,m),viewId:null==l?void 0:l.viewId})}})})),b):null}),[t,u,b,m,p,null==h?void 0:h.textOpt,o,null==l?void 0:l.viewId,_]),w=O.useMemo((function(){var e=p&&"transparent"!==p&&Ps(p,m)||"transparent";return O.createElement("div",{className:"color-bar",style:{marginTop:0}},O.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,m]);return O.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},O.createElement(Ju,null),w,x)},sl=function(e){var t=e.bold,r=e.setBold,n=e.workIds,i=e.viewId,o=function(e){var o="bold"===t?"normal":"bold";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Ys.emitMethod(F.MainEngine,B.SetFontStyle,{workIds:n,viewId:i,bold:o})};return O.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},O.createElement("img",{alt:"icon",src:Xu("bold"===t?"bold-active":"bold")}))},ul=function(e){var t=e.underline,r=e.setUnderline,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Ys.emitMethod(F.MainEngine,B.SetFontStyle,{workIds:n,viewId:i,underline:o})};return O.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},O.createElement("img",{alt:"icon",src:Xu(t?"underline-active":"underline")}))},ll=function(e){var t=e.lineThrough,r=e.setLineThrough,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Ys.emitMethod(F.MainEngine,B.SetFontStyle,{workIds:n,viewId:i,lineThrough:o})};return O.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},O.createElement("img",{alt:"icon",src:Xu(t?"line-through-active":"line-through")}))},cl=function(e){var t=e.italic,r=e.setItalic,n=e.workIds,i=e.viewId,o=function(e){var o="italic"===t?"normal":"italic";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Ys.emitMethod(F.MainEngine,B.SetFontStyle,{workIds:n,viewId:i,italic:o})};return O.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},O.createElement("img",{alt:"icon",src:Xu("italic"===t?"italic-active":"italic")}))},hl=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,o=e.style,a=O.useContext(ql).maranger,s=d(O.useState("normal"),2),u=s[0],l=s[1],c=d(O.useState("normal"),2),h=c[0],f=c[1],p=d(O.useState(!1),2),v=p[0],g=p[1],m=d(O.useState(!1),2),y=m[0],_=m[1];O.useEffect((function(){null!=n&&n.bold&&l(n.bold),ls(null==n?void 0:n.underline)&&g(n.underline||!1),ls(null==n?void 0:n.lineThrough)&&_(n.lineThrough||!1),null!=n&&n.italic&&f(n.italic)}),[n]);var b=O.useMemo((function(){if(o&&o.bottom){var e={top:"inherit",bottom:50};return e}}),[o]),x=O.useMemo((function(){return t?O.createElement("div",{className:"font-style-menu",style:b,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},O.createElement(sl,{workIds:i||[va],bold:u,setBold:l,viewId:null==a?void 0:a.viewId}),O.createElement(ul,{workIds:i||[va],underline:v,setUnderline:g,viewId:null==a?void 0:a.viewId}),O.createElement(ll,{workIds:i||[va],lineThrough:y,setLineThrough:_,viewId:null==a?void 0:a.viewId}),O.createElement(cl,{workIds:i||[va],italic:h,setItalic:f,viewId:null==a?void 0:a.viewId})):null}),[t,i,u,null==a?void 0:a.viewId,v,y,h,b]);return O.createElement("div",{className:"button normal-button ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},O.createElement("img",{alt:"icon",src:Xu(t?"font-style-active":"font-style")}),x)},dl=Object.freeze([12,14,18,24,36,48,64,80,144,288]),fl=["top","topLeft","topRight","bottom","bottomLeft","bottomRight","left","leftTop","leftBottom","right","rightTop","rightBottom"],pl=function(e){var t=e.style,r=e.onClickHandler;return O.createElement("div",{className:"font-size-menu",style:t,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},dl.map((function(e){return O.createElement("div",{className:"font-size-btn",key:e,onClick:function(){r(e)},onTouchEnd:function(){r(e)}},e)})))},vl=function(e){var t=O.useRef(null),r=e.open,n=e.setOpen,i=e.textOpt,o=e.workIds,a=e.floatBarRef,s=O.useContext(ql),u=s.maranger,l=s.floatBarData,c=d(O.useState(0),2),h=c[0],f=c[1],p=d(O.useState(),2),v=p[0],g=p[1],m=dl.length-1;O.useEffect((function(){null!=i&&i.fontSize&&(f(i.fontSize),t.current&&(t.current.value=i.fontSize.toString()))}),[null==i?void 0:i.fontSize]);var y=O.useMemo((function(){if(null!=a&&a.current&&P.isNumber(null==l?void 0:l.y)&&null!=u&&u.height){if(a.current.offsetTop&&a.current.offsetTop+l.y>250){var e={top:"inherit",bottom:35};return e}if(!a.current.offsetTop&&(null==u?void 0:u.height)-a.current.offsetTop-l.y<180){var t={top:"inherit",bottom:35};return t}}}),[a,null==l?void 0:l.y,u]);function _(e){f(e),e&&e>=dl[0]&&e<=dl[m]&&Ys.emitMethod(F.MainEngine,B.SetFontStyle,{workIds:o||[va],fontSize:e,viewId:null==u?void 0:u.viewId})}var b=function(e){var r;f(e),n(!1),null==(r=t.current)||r.blur(),e&&e>=dl[0]&&e<=dl[m]&&Ys.emitMethod(F.MainEngine,B.SetFontStyle,{workIds:o||[va],fontSize:e,viewId:null==u?void 0:u.viewId})},x=O.useMemo((function(){return r?O.createElement(pl,{onClickHandler:b,style:y}):null}),[r,b,y]),w=function(e){e>dl[m]&&(e=dl[m]),en&&(e=n),e=r&&i<=n&&h(i)}}),O.createElement("div",{className:"input-number-btns"},O.createElement("div",{className:"input-number-add",onClick:function(){h(u+i)},onTouchEnd:function(){h(u+i)}}),O.createElement("div",{className:"input-number-cut",onClick:function(){h(u-i)},onTouchEnd:function(){h(u-i)}})))},yl=function(e){var t=e.icon,r=e.min,n=e.max,i=e.step,o=e.value,a=e.onInputHandler;return O.createElement("div",{className:"button input-button"},O.createElement("img",{src:Xu(t)}),O.createElement(_l,{min:r,max:n,step:i,value:o,onInputHandler:a}))},_l=function(e){var t=e.value,r=e.min,n=e.max,i=e.onInputHandler,o=d(O.useState({x:0,y:0}),2),a=o[0],s=o[1];O.useEffect((function(){s({x:100*t,y:0})}),[]);var u=P.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var u=Math.floor(Math.max(o.x,100*r));u=Math.floor(Math.min(u,100*n)),o.x!==(null==a?void 0:a.x)&&s({x:u,y:0});var l=u/100;t!==l&&i(l)}),100,{leading:!1}),l=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()},c=P.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var u=Math.floor(Math.max(o.x,100*r));u=Math.floor(Math.min(u,100*n)),o.x!==(null==a?void 0:a.x)&&s({x:u,y:0});var l=u/100;t!==l&&i(l)}),100,{leading:!1});return O.createElement("div",{className:"range-number-container",onClick:function(e){var o=e.nativeEvent.offsetX-6,a=Math.floor(Math.max(o,100*r));a=Math.floor(Math.min(a,100*n)),s({x:a,y:0});var u=a/100;t!==u&&i(u)}},O.createElement("div",{className:"range-number-color"}),O.createElement("div",{className:"range-number"},O.createElement(R,{bounds:"parent",axis:"x",position:a,onDrag:u,onStart:l,onStop:c},O.createElement("div",{className:"circle",onClick:l}))))},bl=function(e){var t=e.icon,r=e.value,n=e.onChangeHandler,i=e.style,o=d(O.useState(0),2),a=o[0],s=o[1],u=d(O.useState(),2),l=u[0],c=u[1],h=O.useRef(null),f=O.useCallback((function(e){e>=fl.length&&(e=0),e<0&&(e=fl.length-1),s(e),n(fl[e]),c(!1),h.current&&(h.current.value=fl[e])}),[n]),p=O.useMemo((function(){if(i&&i.bottom){var e={top:"inherit",bottom:50};return e}}),[i]);O.useEffect((function(){r&&(s(fl.indexOf(r)),h.current&&(h.current.value=r))}),[r]);var v=O.useMemo((function(){return l?O.createElement(xl,{options:fl,onClickHandler:f,style:p}):null}),[l,f,p]);return O.createElement("div",{className:"button input-button"},O.createElement("img",{src:Xu(t)}),O.createElement("input",{readOnly:!0,className:"input-number",type:"text",ref:h,onTouchEnd:function(){h.current&&h.current.focus()},onClick:function(){h.current&&(h.current.focus(),c(!l))}}),O.createElement("div",{className:"input-number-btns"},O.createElement("div",{className:"input-number-add",onClick:function(){f(a+1)},onTouchEnd:function(){f(a+1)}}),O.createElement("div",{className:"input-number-cut",onClick:function(){f(a-1)},onTouchEnd:function(){f(a-1)}})),v)},xl=function(e){var t=e.options,r=e.style,n=e.onClickHandler;return O.createElement("div",{className:"select-option-menu",style:r,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},t.map((function(e,t){return O.createElement("div",{className:"select-option-btn",key:e,onClick:function(){n(t)},onTouchEnd:function(){n(t)}},e)})))},wl=function(e){var t=e.maranger,r=e.innerRatio,n=e.innerVerticeStep,i=e.vertices;return O.createElement(O.Fragment,null,O.createElement(ml,{value:i,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){Ys.emitMethod(F.MainEngine,B.SetShapeOpt,{workIds:[va],toolsType:W.Star,viewId:t.viewId,vertices:e})}}),O.createElement(ml,{value:n,icon:"star-innerVertex",min:1,max:100,step:1,onInputHandler:function(e){Ys.emitMethod(F.MainEngine,B.SetShapeOpt,{workIds:[va],toolsType:W.Star,viewId:t.viewId,innerVerticeStep:e})}}),O.createElement(yl,{value:r,icon:"star-innerRatio",min:.1,max:1,step:.1,onInputHandler:function(e){Ys.emitMethod(F.MainEngine,B.SetShapeOpt,{workIds:[va],toolsType:W.Star,viewId:t.viewId,innerRatio:e})}}))},Sl=function(e){var t=e.maranger,r=e.vertices;return O.createElement(ml,{value:r,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){Ys.emitMethod(F.MainEngine,B.SetShapeOpt,{workIds:[va],toolsType:W.Polygon,viewId:t.viewId,vertices:e})}})},Tl=function(e){var t=e.maranger,r=e.placement;return O.createElement(bl,{value:r,icon:"speechBallon-placement",onChangeHandler:function(e){Ys.emitMethod(F.MainEngine,B.SetShapeOpt,{workIds:[va],toolsType:W.SpeechBalloon,viewId:t.viewId,placement:e})}})},Ml=function(e){var t=e.icon,r=e.isActive,n=e.onClickHandler,i=e.onTouchEndHandler;return O.createElement("div",{className:"button tab-button ".concat(r?"active":""),onClick:n,onTouchEnd:i},O.createElement("img",{src:Xu(t)}))},kl=function(e){var t=e.toolsTypes,r=e.style,n=e.maranger,i=e.shapeOpt,o=d(O.useState(),2),a=o[0],s=o[1];O.useEffect((function(){t.includes(W.Polygon)?s(W.Polygon):t.includes(W.Star)?s(W.Star):s(W.SpeechBalloon)}),[t]);var u=function(e,t){t.cancelable&&t.preventDefault(),null==t||t.stopPropagation(),s(e)},l=O.useMemo((function(){return a===W.Polygon&&n&&i.vertices?O.createElement(Sl,{vertices:i.vertices,maranger:n}):null}),[n,a,i]),c=O.useMemo((function(){return a===W.Star&&n&&i.vertices&&i.innerVerticeStep&&i.innerRatio?O.createElement(wl,{maranger:n,vertices:i.vertices,innerVerticeStep:i.innerVerticeStep,innerRatio:i.innerRatio}):null}),[n,a,i]),h=O.useMemo((function(){return a===W.SpeechBalloon&&n&&i.placement?O.createElement(Tl,{maranger:n,placement:i.placement}):null}),[n,a,i]);return O.createElement("div",{className:"shapeOpt-sub-menu",style:r,onClick:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.cancelable&&e.preventDefault()}},O.createElement("div",{className:"shapeOpt-sub-menu-tabs"},t.includes(W.Polygon)&&O.createElement(Ml,{isActive:a===W.Polygon,icon:a===W.Polygon?"polygon-active":"polygon",onClickHandler:u.bind(void 0,W.Polygon),onTouchEndHandler:u.bind(void 0,W.Polygon)})||null,t.includes(W.Star)&&O.createElement(Ml,{isActive:a===W.Star,icon:a===W.Star?"star-active":"star",onClickHandler:u.bind(void 0,W.Star),onTouchEndHandler:u.bind(void 0,W.Star)})||null,t.includes(W.SpeechBalloon)&&O.createElement(Ml,{isActive:a===W.SpeechBalloon,icon:a===W.SpeechBalloon?"speechBallon-active":"speechBallon",onClickHandler:u.bind(void 0,W.SpeechBalloon),onTouchEndHandler:u.bind(void 0,W.SpeechBalloon)})||null),O.createElement("div",{className:"shapeOpt-sub-menu-content"},l,c,h))},El=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=e.toolsTypes,o=e.shapeOpt,a=O.useContext(ql),s=a.floatBarData,u=a.maranger,l=d(O.useState([]),2),c=l[0],h=l[1],f=d(O.useState(),2),p=f[0],v=f[1],g=O.useMemo((function(){if(null!=n&&n.current&&P.isNumber(null==s?void 0:s.x)&&P.isNumber(null==s?void 0:s.y)&&null!=u&&u.height){if(n.current.offsetTop&&n.current.offsetTop+s.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==u?void 0:u.height)-n.current.offsetTop-(null==s?void 0:s.y)<140){var t={top:"inherit",bottom:50};return t}}}),[n,null==s?void 0:s.x,null==s?void 0:s.y,null==u?void 0:u.height]),m=O.useMemo((function(){return t&&i&&u&&o?(u.control.room&&!u.control.room.disableDeviceInputs&&(v(u.control.room.disableDeviceInputs),u.control.room.disableDeviceInputs=!0),O.createElement(kl,{shapeOpt:o,style:g,toolsTypes:i,maranger:u})):(null!=u&&u.control.room&&ls(p)&&(u.control.room.disableDeviceInputs=p),null)}),[t,g,i,u,o]);return O.useEffect((function(){os(null==s?void 0:s.selectIds,c)||null!=s&&s.selectIds&&!os(null==s?void 0:s.selectIds,c)&&(h(null==s?void 0:s.selectIds),r(!1))}),[t,s,c,r]),O.useEffect((function(){return function(){t&&null!=u&&u.control.room&&ls(p)&&(u.control.room.disableDeviceInputs=p)}}),[t,u,p]),O.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},m,O.createElement("img",{alt:"icon",src:Xu(t?"shapes-active":"shapes")}))},Il=O.memo((function(e){var t=e.textOpt,r=e.workIds,n=e.noLayer,i=e.position,o=O.useContext(ql),a=o.floatBarData,s=o.maranger,u=d(O.useState(0),2),l=u[0],c=u[1],h=d(O.useState(),2),f=h[0],p=h[1],v=O.useRef(null);O.useEffect((function(){var e,r,n,o,u={},l=(null==a?void 0:a.w)||(null==(e=null==t?void 0:t.boxSize)?void 0:e[0])||0,c=(null==a?void 0:a.h)||(null==(r=null==t?void 0:t.boxSize)?void 0:r[1])||0;if(i&&l&&c&&null!=s&&s.width&&null!=s&&s.height){if(i.y<60?i.y+c0?u.top=62:u.top=62-i.y:u.top=0,i.x<0)u.left=3-i.x;else if(i.x+((null==(n=v.current)?void 0:n.offsetWidth)||l)>s.width){var h=s.width-((null==(o=v.current)?void 0:o.offsetWidth)||l)-i.x;u.left=h}p(u)}else p(void 0)}),[v,i,null==a?void 0:a.w,null==a?void 0:a.h,null==s?void 0:s.width,null==s?void 0:s.height,null==t?void 0:t.boxSize]);var g=O.useMemo((function(){return null!=a&&a.fillColor?O.createElement(il,{floatBarRef:v,open:3===l,setOpen:function(e){c(!0===e?3:0)}}):null}),[null==a?void 0:a.fillColor,l,v]),m=O.useMemo((function(){return null!=a&&a.strokeColor?O.createElement(nl,{floatBarRef:v,open:2===l,setOpen:function(e){c(!0===e?2:0)}}):null}),[null==a?void 0:a.strokeColor,l,v]),y=O.useMemo((function(){return null!=t&&t.fontColor&&null!=s&&s.viewId?O.createElement(ol,{floatBarRef:v,open:4===l,setOpen:function(e){c(!0===e?4:0)},textOpt:t,workIds:r}):null}),[t,l,r,s,v]),_=O.useMemo((function(){return null!=t&&t.fontBgColor&&null!=s&&s.viewId?O.createElement(al,{floatBarRef:v,open:5===l,setOpen:function(e){c(!0===e?5:0)},textOpt:t,workIds:r}):null}),[t,l,r,s,v]),b=O.useMemo((function(){return t&&null!=s&&s.viewId?O.createElement(hl,{open:6===l,setOpen:function(e){c(!0===e?6:0)},textOpt:t,workIds:r,style:f}):null}),[t,l,r,s,f]),x=O.useMemo((function(){return t&&null!=s&&s.viewId?O.createElement(vl,{open:7===l,setOpen:function(e){c(!0===e?7:0)},textOpt:t,workIds:r,floatBarRef:v}):null}),[t,l,r,s,v]),w=O.useMemo((function(){return n?null:O.createElement(Ku,{open:1===l,setOpen:function(e){c(!0===e?1:0)},floatBarRef:v})}),[n,l,v]),S=O.useMemo((function(){return null!=a&&a.canLock&&s?O.createElement(gl,{workIds:r,maranger:s,islocked:a.isLocked}):null}),[a,s,r]),T=O.useMemo((function(){return s&&null!=s&&s.viewId&&f&&null!=a&&a.shapeOpt&&null!=a&&a.toolsTypes?O.createElement(El,{open:8===l,setOpen:function(e){c(!0===e?8:0)},floatBarRef:v,workIds:r,toolsTypes:a.toolsTypes,shapeOpt:a.shapeOpt}):null}),[a,s,l,f,r,v]);return O.createElement("div",{className:"bezier-pencil-plugin-floatbtns",style:f,ref:v},s&&O.createElement(qu,{workIds:r,maranger:s}),w,S,!(null==s||!s.viewId)&&O.createElement(Qu,{workIds:r,viewId:s.viewId}),T,x,b,y,_,m,g)})),Al=function(e){var t=e.data,r=e.isActive,n=e.manager,i=e.workId,o=t.opt,a=t.scale,s=t.translate,u=t.x,l=t.y,c="scale(".concat(a||1,") ").concat(s&&"translate("+s[0]+"px,"+s[1]+"px)"||""),h=o.fontSize,d=o.fontFamily,f=o.underline,p=o.fontColor,v=o.lineThrough,g=o.textAlign,m=o.strokeColor,y=o.lineHeight,_=o.bold,b=o.italic,x=o.uid,w=o.workState,S=h,T=y||1.2*S,M={fontSize:"".concat(S,"px"),lineHeight:"".concat(T,"px"),color:p,borderColor:m,minHeight:"".concat(T,"px"),paddingRight:"".concat("italic"===b?Math.round(.3*S):5,"px")};d&&(M.fontFamily="".concat(d)),(v||f)&&(M.textDecoration="".concat(v?"line-through":"").concat(f?" underline":"")),_&&(M.fontWeight="".concat(_)),b&&(M.fontStyle="".concat(b)),g&&(M.textAlign="".concat(g));var k="
");return null!=o&&o.text&&(k=o.text.split(",").reduce((function(e,t,r){var n=""===t?"
":t;return 0===r?"
").concat(n,"
"):"".concat(e,"
").concat(n,"
")}),"")),O.createElement("div",{className:"editor-box",style:{left:"".concat(u,"px"),top:"".concat(l,"px"),transform:c,transformOrigin:"left top",pointerEvents:"none",opacity:w===V.Done?0:1}},O.createElement("div",{className:"editor ".concat(r?"":"readOnly"),style:M,dangerouslySetInnerHTML:{__html:k},onClick:function(){var e;r&&(x&&x===(null==(e=n.control.collector)?void 0:e.uid)||!x)&&n.control.textEditorManager.active(i)}}))},Cl=O.memo((function(e){var t=e.data,r=e.left,n=e.top,i=e.workId,o=e.updateOptInfo,a=t.opt,s=t.scale,u=t.translate,l=O.useRef(null);O.useEffect((function(){var e,t;if(null!=(e=l.current)&&e.offsetWidth&&null!=(t=l.current)&&t.offsetHeight){var r=a.boxSize;if((null==r?void 0:r[0])!==l.current.offsetWidth||r[1]!==l.current.offsetHeight||!r){var n=[l.current.offsetWidth,l.current.offsetHeight];o({activeTextId:i,update:{boxSize:n,workState:V.Done}})}}}),[a.fontSize,a.italic,a.bold]);var c="scale(".concat(s||1,") ").concat(u&&"translate("+u[0]+"px,"+u[1]+"px)"||""),h=a.fontSize,d=a.fontFamily,f=a.underline,p=a.fontColor,v=a.lineThrough,g=a.textAlign,m=a.strokeColor,y=a.lineHeight,_=a.bold,b=a.italic,x=h,w=y||1.2*x,S={fontSize:"".concat(x,"px"),lineHeight:"".concat(w,"px"),color:p,borderColor:m,minHeight:"".concat(w,"px"),pointerEvents:"none",paddingRight:"".concat("italic"===b?Math.round(.3*x):5,"px")};d&&(S.fontFamily="".concat(d)),(v||f)&&(S.textDecoration="".concat(v?"line-through":"").concat(f?" underline":"")),g&&(S.textAlign="".concat(g)),_&&(S.fontWeight="".concat(_)),b&&(S.fontStyle="".concat(b));var T="";return null!=a&&a.text&&(T=a.text.split(",").reduce((function(e,t,r){var n=""===t?"
":t;return 0===r?"
".concat(n,"
"):"".concat(e,"
").concat(n,"
")}),"")),O.createElement("div",{className:"editor-box",style:{left:"".concat(r),top:"".concat(n),transform:c,transformOrigin:"left top",zIndex:1,pointerEvents:"none",opacity:0}},O.createElement("div",{className:"editor readOnly",ref:l,style:S,dangerouslySetInnerHTML:{__html:T}}))}),(function(e,t){return!(e.workId!==t.workId||e.left!==t.left||e.top!==t.top||!P.isEqual(e.data,t.data))})),Pl=function(e){var t=e.data,r=e.workId,n=e.isSelect,i=e.handleKeyUp,o=e.handleFocus,a=e.updateOptInfo,s=e.showFloatBtns,u=e.manager,l=d(O.useState(),2),c=l[0],h=l[1],f=t.opt,p=t.scale,v=t.translate,g=t.x,m=t.y,y=d(O.useState(""),2),_=y[0],b=y[1],x=O.useRef(null);O.useEffect((function(){var e="";null!=f&&f.text&&(e=f.text.split(",").reduce((function(e,t,r){var n=""===t?"
":t;return 0===r?"
").concat(n,"
"):"".concat(e,"
").concat(n,"
")}),"")),b(e),Promise.resolve().then((function(){x.current&&x.current.click()}))}),[f.fontBgColor]),O.useEffect((function(){var e,t,n,i;(null!=(e=x.current)&&e.offsetWidth&&null!=(t=x.current)&&t.offsetHeight||null!=(n=x.current)&&n.offsetLeft||null!=(i=x.current)&&i.offsetTop)&&a({activeTextId:r,update:{boxSize:[x.current.offsetWidth,x.current.offsetHeight],workState:V.Doing}})}));var w="scale(".concat(p||1,") ").concat(v&&"translate("+v[0]+"px,"+v[1]+"px)"||""),S=f.fontSize,T=f.fontFamily,M=f.underline,k=f.fontColor,E=f.lineThrough,I=f.textAlign,A=f.strokeColor,C=f.lineHeight,N=f.bold,R=f.italic,D=S,L=C||1.2*D,j={left:"".concat(g,"px"),top:"".concat(m,"px"),zIndex:2,pointerEvents:"none"},z={transform:w,transformOrigin:"left top",fontSize:"".concat(D,"px"),lineHeight:"".concat(L,"px"),color:k,borderColor:A,minHeight:"".concat(L,"px"),paddingRight:"".concat("italic"===R?Math.round(.3*D):5,"px"),borderWidth:"".concat(Math.max(Math.round(1/(p||1)),1),"px")};function B(){var e;if(x.current){x.current.focus();var t=null==window?void 0:window.getSelection(),r=x.current.lastChild;if(t&&r){var n=document.createRange(),i=(null==(e=r.textContent)?void 0:e.length)||0;"#text"===(null==r?void 0:r.nodeName)?n.setStart(r,i):n.setStart(r,i?1:0),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}}return T&&(z.fontFamily="".concat(T)),(E||M)&&(z.textDecoration="".concat(E?"line-through":""," ").concat(M?" underline":"")),I&&(z.textAlign="".concat(I)),N&&(z.fontWeight="".concat(N)),R&&(z.fontStyle="".concat(R)),O.createElement("div",{className:"editor-box",style:j,onFocus:function(){u.control.room&&!u.control.room.disableDeviceInputs&&(h(u.control.room.disableDeviceInputs),u.control.room.disableDeviceInputs=!0)},onBlur:function(){null!=u&&u.control.room&&P.isBoolean(c)&&(u.control.room.disableDeviceInputs=c)},onKeyDown:function(e){return e.stopPropagation(),!0},onMouseMove:function(e){return e.stopPropagation(),e.cancelable&&e.preventDefault(),!0}},!n&&s&&O.createElement(Il,{textOpt:f,workIds:[r],noLayer:!0,position:{x:g,y:m}}),O.createElement("div",{id:r,contentEditable:!0,className:"editor",ref:x,style:z,dangerouslySetInnerHTML:{__html:_},onKeyDown:function(t){if("Backspace"===t.key){var r=window.getSelection(),n=null==r?void 0:r.getRangeAt(0);if(null!=n&&n.collapsed)return t.cancelable&&t.preventDefault(),document.execCommand("delete",!1),!1}return e.handleKeyDown(t),!1},onKeyUp:i,onClick:B,onTouchEnd:B,onFocus:o,onPaste:function(t){var r,n;if(t.cancelable&&t.preventDefault(),x.current){var i=(t.clipboardData||window.clipboardData).getData("text");i=i.toUpperCase();var o=null==window?void 0:window.getSelection();if(null==o||!o.rangeCount)return;var a=i.split(/\n/);if(o&&a.length){o.deleteFromDocument();var s=document.createRange(),u=x.current.lastChild;if(!u){var l=document.createTextNode(a[0]);if(x.current.appendChild(l),1===a.length){var c=(null==(r=l.textContent)?void 0:r.length)||0;return s.setStart(l,c),s.collapse(!0),o.removeAllRanges(),void o.addRange(s)}}if("#text"===(null==u?void 0:u.nodeName)&&(u.textContent=u.textContent+a[0],1===a.length)){var h=(null==(n=u.textContent)?void 0:n.length)||0;return s.setStart(u,h),s.collapse(!0),o.removeAllRanges(),void o.addRange(s)}"DIV"===(null==u?void 0:u.nodeName)&&(u.innerText=u.innerText+a[0]);for(var d=1;dthis.maxScreenshotWidth&&(f=this.maxScreenshotWidth/h*f,h=this.maxScreenshotWidth),d>this.maxScreenshotHeight&&(f=Math.min(this.maxScreenshotHeight/d*f,f),d=this.maxScreenshotHeight),u.scale=f,p=document.createElement("canvas"),v=p.getContext("2d"),p.width=h*(l||1),p.height=d*(l||1),v&&((t.mainView||n).screenshotToCanvas(v,o,h,d,u,l),r.drawImage(p,Math.floor((a-h)/2),Math.floor((s-d)/2),h*(l||1),d*(l||1),0,0,h,d),p.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(c=i.currentManager)?void 0:c.screenshotToCanvas(r,o,h,d,u,Math.floor((a-h)/2),Math.floor((s-d)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=h(regeneratorRuntime.mark((function e(r,o,a,s,u){var l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceMultiPlugin] scenePreview"),(t.mainView||n).scenePreview(r,o,a,s,u),(l=document.createElement("img")).style.position="absolute",l.style.top="0px",l.style.left="0px",l.style.width="100%",l.style.height="100%",l.style.pointerEvents="none",o.append(l),getComputedStyle(o).position||(o.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=14;break}return e.next=14,i.currentManager.scenePreview(r,l);case 14:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(n)&&n.isWritable?ec.InternalMsgEmitter.on(e,t):o.call(n.callbacks,e,t)},_callbacksOnce:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(n)&&n.isWritable?ec.InternalMsgEmitter.on(e,t):u.call(n.callbacks,e,t)},_callbacksOff:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(n)&&n.isWritable?ec.InternalMsgEmitter.off(e,t):a.call(n.callbacks,e,t)},undo:function(){return i.logger.info("[ApplianceMultiPlugin] undo"),i.currentManager&&E.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceMultiPlugin] redo"),i.currentManager&&E.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(){i.logger.info("[ApplianceMultiPlugin] cleanCurrentScene"),i.currentManager&&E.isRoom(n)&&n.isWritable&&(i.currentManager.cleanCurrentScene(),l.call(t))},insertImage:function(e){i.logger.info("[ApplianceMultiPlugin] insertImage"),i.currentManager&&E.isRoom(n)&&n.isWritable&&i.currentManager.worker.insertImage(e)},lockImage:function(e,t){i.logger.info("[ApplianceMultiPlugin] lockImage"),i.currentManager&&E.isRoom(n)&&n.isWritable&&i.currentManager.worker.lockImage(e,t)},completeImageUpload:function(e,t){i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&E.isRoom(n)&&n.isWritable&&i.currentManager.worker.completeImageUpload(e,t)},getImagesInformation:function(e){return i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&E.isRoom(n)&&n.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return i.logger.info("[ApplianceMultiPlugin] callbacks bind"),s(s({},n.callbacks),{},{on:f._callbacksOn.bind(f),once:f._callbacksOnce.bind(f),off:f._callbacksOff.bind(f)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceMultiPlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0)},setMemberState:function(e){i.logger.info("[ApplianceMultiPlugin] setMemberState"),Object.keys(e).includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===L.laserPen?(e.currentApplianceName=L.pencil,e.useLaserPen=!0):e.currentApplianceName&&e.currentApplianceName===L.pencil&&(e.useLaserPen=!1)),c.call(t.mainView,e)}},p=function(e,t){i.logger.info("[ApplianceMultiPlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||T(e[t])>"u"?e[t]=f[t]:"callbacks"===t&&(e.callbacks.on=f._callbacksOn.bind(f),e.callbacks.off=f._callbacksOff.bind(f),e.callbacks.once=f._callbacksOnce.bind(f))},e.abrupt("return",(p(t,"undo"),p(t,"redo"),p(t,"cleanCurrentScene"),p(t,"insertImage"),p(t,"completeImageUpload"),p(t,"lockImage"),p(n,"getImagesInformation"),p(n,"callbacks"),p(n,"screenshotToCanvasAsync"),p(n,"getBoundingRectAsync"),p(n,"scenePreviewAsync"),p(t.mainView,"setMemberState"),s(s({},f),{},{callbacks:f.callbacks()})));case 12:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createApplianceMultiPlugin",value:(t=h(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.createInvisiblePlugin(i,{});case 2:if(n=t.getInvisiblePlugin(r),e.t0=n,e.t0){e.next=8;break}return e.next=7,i.createApplianceMultiPlugin(t,r);case 7:n=e.sent;case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})}]),i}(E.InvisiblePlugin);k(rc,"kind","appliance-multi-plugin"),k(rc,"currentManager"),k(rc,"logger",{info:console.log,warn:console.warn,error:console.error}),k(rc,"options",tc),k(rc,"createCurrentManager",(function(e,t,r){if(rc.currentManager&&rc.currentManager.destroy(),t&&e){var n={plugin:r,displayer:e.displayer,options:t},i=new ec(n);rc.logger.info("[ApplianceMultiPlugin] refresh ApplianceMultiManager object"),i.setWindowManager(e),rc.currentManager=i}}));var nc=rc,ic=function(e){v(r,e);var t=m(r);function r(e,n){var i;return x(this,r),i=t.call(this,e,n),k(_(i),"width",1e3),k(_(i),"height",1e3),k(_(i),"dpr",1),k(_(i),"vDom"),k(_(i),"viewId","mainView"),k(_(i),"eventTragetElement"),k(_(i),"snapshotContainerRef"),k(_(i),"canvasContainerRef",O.createRef()),k(_(i),"canvasTopRef",O.createRef()),k(_(i),"canvasServiceFloatRef",O.createRef()),k(_(i),"canvasFloatRef",O.createRef()),k(_(i),"canvasBgRef",O.createRef()),k(_(i),"floatBarRef",O.createRef()),k(_(i),"containerOffset",{x:0,y:0}),i.control.hasOffscreenCanvas()||(i.snapshotContainerRef=O.createRef()),i}return S(r,[{key:"setCanvassStyle",value:function(){if(this.eventTragetElement){var e=this.eventTragetElement.offsetWidth,t=this.eventTragetElement.offsetHeight;e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=gs()),e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=gs(),this.width=e,this.height=t),e&&t&&this.canvasBgRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=gs(this.canvasBgRef.current.getContext("2d")),this.width=e,this.height=t,this.canvasBgRef.current.width=e*this.dpr,this.canvasBgRef.current.height=t*this.dpr,this.canvasFloatRef.current&&(this.canvasFloatRef.current.width=e*this.dpr,this.canvasFloatRef.current.height=t*this.dpr),this.canvasServiceFloatRef.current&&(this.canvasServiceFloatRef.current.width=e*this.dpr,this.canvasServiceFloatRef.current.height=t*this.dpr),this.canvasTopRef.current&&(this.canvasTopRef.current.width=e*this.dpr,this.canvasTopRef.current.height=t*this.dpr))}}},{key:"createMainViewDisplayer",value:function(e){return this.vDom||(this.containerOffset=this.getContainerOffset(e,this.containerOffset),this.eventTragetElement=e.parentElement.children[0],e.innerHTML="",N.render(O.createElement(Ql,{viewId:this.viewId,maranger:this,refs:{canvasServiceFloatRef:this.canvasServiceFloatRef,canvasFloatRef:this.canvasFloatRef,canvasBgRef:this.canvasBgRef,floatBarRef:this.floatBarRef,canvasTopRef:this.canvasTopRef,canvasContainerRef:this.canvasContainerRef,snapshotContainerRef:this.snapshotContainerRef}}),e),this.control.room&&this.bindDisplayerEvent(this.eventTragetElement)),this}}]),r}(Ru),oc=function(e){v(n,e);var t,r=m(n);function n(e){var t;return x(this,n),t=r.call(this,e),k(_(t),"focuedViewId"),k(_(t),"control"),k(_(t),"focuedView"),t.control=e.control,t}return S(n,[{key:"bindMainView",value:function(){if(this.control.divMainView){var e=new ic(this.control,Tu.InternalMsgEmitter);this.focuedViewId=Ru.viewId;var t=e.width,r=e.height,i={dpr:e.dpr,originalPoint:[t/2,r/2],offscreenCanvasOpt:s(s({},n.defaultScreenCanvasOpt),{},{width:t,height:r}),layerOpt:s(s({},n.defaultLayerOpt),{},{width:t,height:r}),cameraOpt:s(s({},n.defaultCameraOpt),{},{width:t,height:r})},a=this.control.room&&this.control.room.mainView||this.control.play&&this.control.play.mainView;if(a){var u=a.camera,l=u.scale,c=o(u,["scale"]);i.cameraOpt=s(s(s({},i.cameraOpt),c),{},{scale:l===1/0?1:l}),this.createMianView({id:Ru.viewId,displayer:e,focusScenePath:a.focusScenePath||a.scenePath,cameraOpt:i.cameraOpt,viewData:a}),this.focuedView=this.mainView,e.createMainViewDisplayer(this.control.divMainView)}}}},{key:"mountView",value:(t=h(regeneratorRuntime.mark((function e(t){var r,i,a,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this.getView(t))){e.next=10;break}if(a=i.displayer,u=a.width,l=a.height,c=a.dpr,h={dpr:c,originalPoint:[u/2,l/2],offscreenCanvasOpt:s(s({},n.defaultScreenCanvasOpt),{},{width:u,height:l}),layerOpt:s(s({},n.defaultLayerOpt),{},{width:u,height:l}),cameraOpt:s(s({},n.defaultCameraOpt),{},{width:u,height:l})},i.viewData&&(d=i.viewData.camera,f=d.scale,p=o(d,["scale"]),h.cameraOpt=s(s(s({},h.cameraOpt),p),{},{scale:f===1/0?1:f})),e.t0=this.control.worker.isActive,e.t0){e.next=8;break}return e.next=8,this.control.activeWorker();case 8:null==(r=this.control.worker)||r.createViewWorker(t,h),i.focusScenePath&&this.control.collector&&this.control.worker.pullServiceData(t,i.focusScenePath);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),n}(Nu),ac=function(e){v(n,e);var t,r=m(n);function n(e){var t;x(this,n),t=r.call(this,e),k(_(t),"viewContainerManager"),k(_(t),"divMainView"),k(_(t),"onCameraChange",xu((function(e){t.viewContainerManager.setFocuedViewCameraOpt(e)}),20,{leading:!1}));var i={control:_(t),internalMsgEmitter:n.InternalMsgEmitter};return t.viewContainerManager=new oc(i),t}return S(n,[{key:"init",value:function(){var e=this;n.InternalMsgEmitter.on(F.BindMainView,(function(t){e.divMainView=t,e.plugin&&!e.viewContainerManager.mainView&&e.viewContainerManager.bindMainView()}))}},{key:"activePlugin",value:function(){var e=this;this.plugin&&this.divMainView&&!this.viewContainerManager.mainView&&this.viewContainerManager.bindMainView(),this.collector&&(this.collector.addStorageStateListener((function(t){var r,o;if(null!=(r=e.collector)&&r.storage&&0===Object.keys(e.collector.storage).length)null==(o=e.worker)||o.clearViewScenePath("mainView",!0);else if(t){var a=new Map;Object.keys(t).forEach((function(r){var n,i=t[r];if(i){var o=i.viewId,s=a.get(o)||new Set;s.add(r),a.set(o,s),null==(n=e.worker)||n.onServiceDerive(r,i)}}));var s,u=l(a.entries());try{for(u.s();!(s=u.n()).done;){var c=d(s.value,2),h=c[0],f=c[1];n.InternalMsgEmitter.emit("excludeIds",i(f),h)}}catch(e){u.e(e)}finally{u.f()}}})),this.room&&(this.roomMember.onUidChangeHook((function(t){var r,n,o,a;if(null!=(r=e.collector)&&r.serviceStorage){var s=[];e.viewContainerManager.getAllViews().forEach((function(t){var r,n,o;if(t&&t.focusScenePath&&null!=(r=e.collector)&&r.serviceStorage[t.id]&&null!=(n=e.collector)&&n.serviceStorage[t.id][t.focusScenePath]){var a=Object.keys(null==(o=e.collector)?void 0:o.serviceStorage[t.id][t.focusScenePath]).filter((function(t){var r;return null==(r=e.collector)?void 0:r.isSelector(t)})).map((function(e){return{viewId:t.id,scenePath:t.focusScenePath,key:e}}));a.length&&s.push.apply(s,i(a))}})),s.forEach((function(r){var n,i,o=r.key,a=r.viewId,s=r.scenePath,u=null==(n=e.collector)?void 0:n.getUidFromKey(o);u&&!t.online.includes(u)&&(null==(i=e.collector)||i.updateValue(o,void 0,{isAfterUpdate:!0,viewId:a,scenePath:s}))}))}null!=(o=null==(n=e.cursor)?void 0:n.eventCollector)&&o.serviceStorage&&Object.keys(null==(a=e.cursor)?void 0:a.eventCollector.serviceStorage).forEach((function(r){var n,i;t.online.includes(r)||null==(i=null==(n=e.cursor)?void 0:n.eventCollector)||i.clearValue(r)}))})),this.worker.isActive&&this.viewContainerManager.getAllViews().forEach((function(t){t&&t.focusScenePath&&e.worker.pullServiceData(t.id,t.focusScenePath)}))))}},{key:"activeWorker",value:(t=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.worker.init();case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),n}(Tu),sc=function(e){v(i,e);var t,r,n=m(i);function i(){var e;return x(this,i),e=n.apply(this,arguments),k(_(e),"updateRoomWritable",(function(){var t;null==(t=i.currentManager)||t.onWritableChange(e.displayer.isWritable)})),k(_(e),"roomStateChangeListener",function(){var t=h(regeneratorRuntime.mark((function t(r){var n,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i.currentManager instanceof ac&&(r.cameraState&&i.currentManager.onCameraChange(r.cameraState),r.sceneState&&i.currentManager.onSceneChange(r.sceneState.scenePath,"mainView")),(!E.isRoom(e.displayer)||e.displayer.isWritable)&&(r.memberState&&(null==(n=i.currentManager)||n.onMemberChange(r.memberState)),null!=r&&r.roomMembers&&(null==(o=i.currentManager)||o.onRoomMembersChange(r.roomMembers)));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return S(i,[{key:"init",value:function(e){var t;if(E.isRoom(e)){var r=e.state;null!=r&&r.memberState&&(null==(t=i.currentManager)||t.onMemberChange(r.memberState))}this.displayer.callbacks.on(this.callbackName,this.roomStateChangeListener),this.displayer.callbacks.on("onEnableWriteNowChanged",this.updateRoomWritable)}},{key:"destroy",value:function(){var e;i.logger.info("[ApplianceSinglePlugin] passive destroy"),null==(e=i.currentManager)||e.destroy(),i.currentManager=void 0,i.cursorAdapter=void 0}},{key:"isReplay",get:function(){return E.isPlayer(this.displayer)}},{key:"callbackName",get:function(){return this.isReplay?"onPlayerStateChanged":"onRoomStateChanged"}}],[{key:"getInstance",value:(r=h(regeneratorRuntime.mark((function e(t,r){var n,o,a,u,l,c,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.callbacks.on,o=t.callbacks.off,a=t.callbacks.once,u=t.cleanCurrentScene.bind(t),l=t.setMemberState.bind(t),c={displayer:t,currentManager:i.currentManager,maxScreenshotWidth:10240,maxScreenshotHeight:10240,_injectTargetObject:void 0,getBoundingRectAsync:function(){var e=h(regeneratorRuntime.mark((function e(r){var n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.logger.info("[ApplianceSinglePlugin] getBoundingRectAsync"),o=t.getBoundingRect(r),e.next=4,null==(n=i.currentManager)?void 0:n.getBoundingRect(r);case 4:return a=e.sent,e.abrupt("return",o.width&&o.height?cs(o,a):a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),screenshotToCanvasAsync:function(){var e=h(regeneratorRuntime.mark((function e(r,n,o,a,s,u){var l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceSinglePlugin] screenshotToCanvasAsync"),c=o,h=a,d=s.scale,c>this.maxScreenshotWidth&&(d=this.maxScreenshotWidth/c*d,c=this.maxScreenshotWidth),h>this.maxScreenshotHeight&&(d=Math.min(this.maxScreenshotHeight/h*d,d),h=this.maxScreenshotHeight),s.scale=d,f=document.createElement("canvas"),p=f.getContext("2d"),f.width=c*(u||1),f.height=h*(u||1),p&&(t.screenshotToCanvas(p,n,c,h,s,u),r.drawImage(f,Math.floor((o-c)/2),Math.floor((a-h)/2),c*(u||1),h*(u||1),0,0,c,h),f.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(l=i.currentManager)?void 0:l.screenshotToCanvas(r,n,c,h,s,Math.floor((o-c)/2),Math.floor((a-h)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=h(regeneratorRuntime.mark((function e(r,n,o,a,s){var u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceSinglePlugin] scenePreview"),t.scenePreview(r,n,o,a,s),(u=document.createElement("img")).style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.width="100%",u.style.height="100%",u.style.pointerEvents="none",n.append(u),getComputedStyle(n).position||(n.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=14;break}return e.next=14,i.currentManager.scenePreview(r,u);case 14:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(t)&&t.isWritable?ac.InternalMsgEmitter.on(e,r):n.call(t.callbacks,e,r)},_callbacksOnce:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(t)&&t.isWritable?ac.InternalMsgEmitter.on(e,r):a.call(t.callbacks,e,r)},_callbacksOff:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(t)&&t.isWritable?ac.InternalMsgEmitter.off(e,r):o.call(t.callbacks,e,r)},undo:function(){return i.logger.info("[ApplianceSinglePlugin] undo"),i.currentManager&&E.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceSinglePlugin] redo"),i.currentManager&&E.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(e){i.logger.info("[ApplianceSinglePlugin] cleanCurrentScene"),i.currentManager&&E.isRoom(t)&&t.isWritable&&(i.currentManager.cleanCurrentScene(),u.call(t,e))},insertImage:function(e){i.logger.info("[ApplianceSinglePlugin] insertImage"),i.currentManager&&E.isRoom(t)&&t.isWritable&&i.currentManager.worker.insertImage(e)},lockImage:function(e,r){i.logger.info("[ApplianceSinglePlugin] lockImage"),i.currentManager&&E.isRoom(t)&&t.isWritable&&i.currentManager.worker.lockImage(e,r)},completeImageUpload:function(e,r){i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&E.isRoom(t)&&t.isWritable&&i.currentManager.worker.completeImageUpload(e,r)},getImagesInformation:function(e){return i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&E.isRoom(t)&&t.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return s(s({},t.callbacks),{},{on:c._callbacksOn.bind(c),once:c._callbacksOnce.bind(c),off:c._callbacksOff.bind(c)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceSinglePlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0,i.cursorAdapter=void 0)},setMemberState:function(e){i.logger.info("[ApplianceSinglePlugin] setMemberState"),Object.keys(e).includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===L.laserPen&&(e.currentApplianceName=L.pencil,e.useLaserPen=!0),e.currentApplianceName&&e.currentApplianceName===L.pencil&&(e.useLaserPen=!1)),l(e)}},null!=r&&r.logger&&(i.logger=r.logger),r.options&&(i.options=r.options),d=t.getInvisiblePlugin(i.kind),t&&d&&i.createCurrentManager(t,i.options,d),e.t0=!d&&E.isRoom(t),!e.t0){e.next=9;break}return e.next=8,i.createAppliancePlugin(t,i.kind);case 8:d=e.sent;case 9:return d&&i.currentManager&&(i.currentManager.bindPlugin(d),d.init(t)),null!=r&&r.cursorAdapter&&(i.cursorAdapter=r.cursorAdapter),i.effectInstance(),f=function(e,t){i.logger.info("[ApplianceSinglePlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||T(e[t])>"u"?e[t]=c[t]:"callbacks"===t&&(e.callbacks.on=c._callbacksOn.bind(c),e.callbacks.off=c._callbacksOff.bind(c),e.callbacks.once=c._callbacksOnce.bind(c))},e.abrupt("return",(f(t,"undo"),f(t,"redo"),f(t,"cleanCurrentScene"),f(t,"insertImage"),f(t,"completeImageUpload"),f(t,"lockImage"),f(t,"getImagesInformation"),f(t,"callbacks"),f(t,"screenshotToCanvasAsync"),f(t,"getBoundingRectAsync"),f(t,"scenePreviewAsync"),f(t,"setMemberState"),s(s({},c),{},{callbacks:c.callbacks()})));case 14:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createAppliancePlugin",value:(t=h(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.createInvisiblePlugin(i,{});case 2:if(n=t.getInvisiblePlugin(r),e.t0=n,e.t0){e.next=8;break}return e.next=7,i.createAppliancePlugin(t,r);case 7:n=e.sent;case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"effectInstance",value:function(){if(i.cursorAdapter){var e=i.cursorAdapter.onAddedCursor;i.cursorAdapter.onAddedCursor=function(t){t.onCursorMemberChanged=function(e){try{e.appliance===L.pencil||e.appliance===L.shape||e.appliance===L.text||e.appliance===L.arrow||e.appliance===L.straight||e.appliance===L.rectangle||e.appliance===L.ellipse?null!=t&&t.divElement&&(t.divElement.style.display="none"):null!=t&&t.divElement&&(t.divElement.style.display="block")}catch(e){}},e.call(i.cursorAdapter,t)}}}}]),i}(E.InvisiblePlugin);k(sc,"kind","teaching-aids-single-plugin"),k(sc,"cursorAdapter"),k(sc,"currentManager"),k(sc,"logger",{info:console.log,warn:console.warn,error:console.error}),k(sc,"options",tc),k(sc,"createCurrentManager",(function(e,t,r){sc.currentManager&&sc.currentManager.destroy();var n=new ac({plugin:r,displayer:e,options:t});n.init(),sc.logger.info("[ApplianceSinglePlugin] refresh ApplianceSingleManager object"),sc.currentManager=n}));var uc=sc,lc=function(e){v(r,e);var t=m(r);function r(){var e;return x(this,r),e=t.apply(this,arguments),k(_(e),"mainViewRef",null),e}return S(r,[{key:"componentDidMount",value:function(){r.emiter||(r.emiter=ac.InternalMsgEmitter),r.emiter.emit(F.BindMainView,this.mainViewRef)}},{key:"render",value:function(){var e=this;return O.createElement(O.Fragment,null,this.props.children,O.createElement("div",{className:"teaching-aids-plugin-main-view-displayer",ref:function(t){return e.mainViewRef=t}}))}}]),r}(O.Component);k(lc,"emiter");var cc=lc;t.ActiveContainerType=U,t.ApplianceMultiPlugin=nc,t.ApplianceNames=L,t.ApplianceSigleWrapper=cc,t.ApplianceSinglePlugin=uc,t.ECanvasContextType=Y,t.ECanvasShowType=$,t.EDataType=G,t.EPostMessageType=H,t.EScaleType=Q,t.EStrokeType=j,t.EToolsKey=W,t.ElayerType=q,t.EmitEventType=B,t.EventMessageType=X,t.EvevtWorkState=V,t.EvevtWorkType=Z,t.InternalMsgEmitterType=F,t.Point2d=te,t.ShapeType=z,t.Storage_Selector_key=va,t.Storage_Splitter=pa,t.Storage_ViewId_ALL="all",t.Vec2d=J,t.ViewContainerManager=Nu,t.average=function(e,t){return"".concat(ps((e.x+t.x)/2),",").concat(ps((e.y+t.y)/2)," ")},t.cloneDeep=ca,t.computRect=function(e,t){if(e&&t){var r=Math.min(e.x,t.x),n=Math.min(e.y,t.y);return{x:r,y:n,w:Math.max(e.x+e.w,t.x+t.w)-r,h:Math.max(e.y+e.h,t.y+t.h)-n}}return t||e},t.fullWorker="/fullWorker.js",t.getRectFromPoints=hs,t.getRectRotated=function(e,t){return hs(ds(e,t))},t.getRectRotatedPoints=ds,t.getRectScaleed=function(e,t){var r=new J(e.x,e.y),n=new J(e.x+e.w,e.y),i=new J(e.x+e.w,e.y+e.h),o=new J(e.x,e.y+e.h),a=new J(e.x+e.w/2,e.y+e.h/2),s=new J(t[0],t[1]);return hs([J.ScaleWOrigin(r,s,a),J.ScaleWOrigin(n,s,a),J.ScaleWOrigin(i,s,a),J.ScaleWOrigin(o,s,a)])},t.getRectTranslated=function(e,t){return{x:e.x+t[0],y:e.y+t[1],w:e.w,h:e.h}},t.getRotatePoints=function(e,t,r){for(var n=[],i=0;it.x+t.w||e.y+e.ht.y+t.h)},t.isIntersectForPoint=fs,t.isNumber=Me,t.precise=function(e){return"".concat(ps(e.x),",").concat(ps(e.y)," ")},t.rotatePoints=function(e,t,r){for(var n=new J(t[0],t[1]),i=0;i20&&(e.value=Math.floor(1e3*e.times/e.valueTotal),e.valueTotal=0,e.times=0,e.destroyed||e.emit("update",e.value)),e.prevTime=t,e.destroyed||e.calcFps()}))}},{key:"destroy",value:function(){this.destroyed=!0}}]),r}(Ks.a);!function(e){e.ResourceError="RESOURCE_ERROR",e.RuntimeError="RUNTIME_ERROR",e.RuntimeWarn="RUNTIME_WARN",e.CanvasCrash="CANVAS_CRASH"}(Zp||(Zp={}));var nv=function(e){p(r,e);var t=g(r);function r(e,n){var i,o,a;return x(this,r),o=y(i=t.call(this,n)),a=(this instanceof r?this.constructor:void 0).prototype,Object.setPrototypeOf?Object.setPrototypeOf(o,a):o.__proto__&&(o.__proto__=a),i.errorType=e,i.errorMsg=n,i}return S(r,null,[{key:"transform",value:function(e){return e instanceof r?e:new r(Zp.RuntimeError,e.message)}}]),r}(n(Error));function iv(){return function(e,t,r){var n=r.value;r.value=function(){try{for(var e=arguments.length,t=new Array(e),r=0;r2048||b>2048)&&(x=(y*=2048/_)*b)>2048&&(y*=b/x),w=document.createElement("canvas"),S=Math.ceil(m.width*y),T=Math.ceil(m.height*y),w.width=S,w.height=T,w.getContext("2d").drawImage(m,0,0,S,T),M=w.toDataURL("image/png"),k=new $l.c(M,{resolution:1}),r.abrupt("return",(this.logger.info("load end. "+o,this.taskId||""),this.useCache&&this.localStorage.setItem(u,{scale:y,scaledBase64:M}).catch((function(){})),{baseTexture:k,scale:y}));case 70:case"end":return r.stop()}}),r,this,[[22,34],[39,52]])})))}},{key:"destroy",value:function(){}}]),e}(),gv=function(){function e(t){var r=this;x(this,e),this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=function(e){var t=e/(rd.b.TARGET_FPMS||.06);if(!r.isPaused){r.timestamp+=t,r.callbackList=r.callbackList.filter((function(e){return e&&!e.applied}));for(var n=r.callbackList.length,i=0;i=0&&!this.callbackList[t].running&&this.callbackList.splice(t,1)}},{key:"delay",value:function(e){var t=this;return new Promise((function(r){t.setTimeout(r,e)}))}},{key:"waitUntil",value:function(e,t){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=this.timestamp;case 1:if(e()||!(this.timestamp-n90&&a<270||a<-90&&a>-270)&&(n=-n),i=s*n}return{x:n,y:i}}function Mv(e,t,r,n,i,o){var a,s,u,l,c,h=e,d=t;if(0===Math.round(n))a=i,s=o,c=0;else if(Math.round(n)>=360)a=i,s=o,u=i+2*e*Math.abs(Math.cos(-r/180*Math.PI)),l=o+2*t*Math.sin(-r/180*Math.PI),c=1;else{var f=-(r+n),p=Tv(-r,h,d),v=i-p.x,g=o+p.y,m=Tv(f,h,d);a=m.x+v,s=g-m.y,c=n>=-360&&n<-180?1:n>=-180&&n<0||n>0&&n<180?0:1}return{radiusX:h,radiusY:d,xAxisRotation:0,largeArcFlag:c,sweepFlag:n>0?1:0,endX:a,endY:s,middleX:u,middleY:l}}var kv=function(){function e(){x(this,e),this.pool=[]}return S(e,[{key:"getObject",value:function(e){var t=this.pool.find((function(e){return!e.isUsed}));if(t)return t.isUsed=!0,t.obj;var r={obj:this.createObject(),isUsed:!0,group:e};return this.pool.push(r),r.obj}},{key:"collectObject",value:function(e){var t=this.pool.find((function(t){return t.obj===e}));t&&(t.isUsed=!1,this.resetObject(t.obj))}},{key:"collectObjectByGroup",value:function(e){var t=this;this.pool.filter((function(t){return t.group===e})).forEach((function(e){return t.collectObject(e.obj)}))}}]),e}(),Ev=new(function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("version","1.1"),e}},{key:"resetObject",value:function(e){e.removeAttribute("viewBox"),e.removeAttribute("width"),e.removeAttribute("height"),e.innerHTML=""}}]),r}(kv)),Av=new(function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){return document.createElement("img")}},{key:"resetObject",value:function(e){e.removeAttribute("src")}}]),r}(kv)),Iv=function(){function e(t){x(this,e),this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null),this.maxResolution=t}return S(e,[{key:"render",value:function(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,l,h,d,f,p,v,g=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.items,o=e.width,a=e.height,s=Av.getObject(r),u=new $l.c(s,{width:o*n,height:a*n,resolution:1}),l=Ev.getObject(r),this.imgElements.push(s),this.svgElements.push(l),l.setAttribute("viewBox","0 0 ".concat(o," ").concat(a)),l.setAttribute("width",""+o),l.setAttribute("height",""+a),h={},i.forEach((function(e){var t=e.item,r=e.x,i=e.y,o=r+2,a=i+2;t.pathsData.forEach((function(e){var t="";e.cmds.forEach((function(r){var n=c(r,2),i=n[0],s=n[1];t+=i+" ",t+=s.map((function(t){return Sv()(t)||(t.x=t.x+e.offset.x+o,t.y=t.y+e.offset.y+a),t})).reduce((function(e,t){return Sv()(t)?e+=t+" ":e+="".concat(t.x," ").concat(t.y," "),e}),""),t+=" "})),e.pathElement.setAttribute("d",t),l.appendChild(e.pathElement)}));var s=t.width-4-2*t.padding,d=t.height-4-2*t.padding;g.textures[t.hash]={texture:new $l.t(u,new jl.j((o+2)*n,(a+2)*n,s*n,d*n)),pivot:t.pivot,scale:1/n},h[t.hash]=g.hashToIdMap[t.hash]})),f=''+l.outerHTML,d="data:image/svg+xml,"+encodeURIComponent(f).replace(/'/g,"%27").replace(/"/g,"%22"),(p=document.createElement("img")).src=d,t.next=9,new Promise((function(e,t){p.onload=function(){return e("")},p.onerror=function(){return t()}}));case 9:return(v=document.createElement("canvas")).width=p.width*n,v.height=p.height*n,v.getContext("2d").drawImage(p,0,0,v.width,v.height),s.src=v.toDataURL("image/png"),t.next=15,new Promise((function(e,t){s.onload=function(){return e("")},s.onerror=function(){return t()}}));case 15:case"end":return t.stop()}}),t,this)})))}},{key:"getGraphicsData",value:function(e){var t=this.idToHashMap[e]||"";return this.textures[t]||null}},{key:"addGraphics",value:function(e,t,r,n,i,o,a,s,u,l,h){var d,f;if(!a&&!u)return e;var p,v,g,m,y,_,b,x,w,S,T,M,k,E,A,I,C,P,N=xv()(r+(null!==(f=null===(d=null==a?void 0:a.width)||void 0===d?void 0:d.toString())&&void 0!==f?f:0)+u+l+h);if(this.hashToIdMap[N]||(this.hashToIdMap[N]=[]),this.hashToIdMap[N].push(e),this.idToHashMap[e]=N,this.graphics.findIndex((function(e){return e.hash===N}))<0){var O=(p=t,v=i,g=o,m=a,y=n,_=u,b=l,x=h,S=[],T={x:Math.abs(y.x),y:Math.abs(y.y)},M=0,k=0,E=0,A=0,I=0,C="none",P=null!==(w=null==m?void 0:m.width)&&void 0!==w?w:0,_?(M=v,k=g,I=0):(C=x||"#ff0000",I=P,E=.5*P,A=.5*P,M=v+P,k=g+P,T.x+=.5*P,T.y+=.5*P),M+=Math.abs(y.x),k+=Math.abs(y.y),E+=Math.abs(y.x),A+=Math.abs(y.y),M+=4,k+=4,E+=2,A+=2,M=Math.ceil(M),k=Math.ceil(k),p.forEach((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==e.fill&&_?t.setAttribute("fill",b||"#ff0000"):t.setAttribute("fill","none"),e.hasStroke&&!_&&(t.setAttribute("stroke-linecap",(null==m?void 0:m.cap)||"butt"),t.setAttribute("stroke-linejoin",(null==m?void 0:m.join)||"miter"),t.setAttribute("stroke-width",I.toString()),t.setAttribute("stroke",C),(null==m?void 0:m.dash)&&t.setAttribute("stroke-dasharray",m.dash));for(var r=e.scale,n=e.path.trim().split(" "),i={x:0,y:0},o={offset:{x:E,y:A},cmds:[],pathElement:t},a=0;a=360?(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.middleX/9525*r.x,y:T.middleY/9525*r.y}]]),o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]])):(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]]))}else if("L"===s){var M=c(u.split(",").map((function(e){return Number(e)})),2),k=M[0],P=M[1];i={x:k,y:P},k=k/9525*r.x,P=P/9525*r.y,o.cmds.push(["L",[{x:k,y:P}]])}else if("QB"===s){var N=c(u.split(",").map((function(e){return Number(e)})),4),O=N[0],R=N[1],D=N[2],L=N[3];i={x:D,y:L},O=O/9525*r.x,R=R/9525*r.y,D=D/9525*r.x,L=L/9525*r.y,o.cmds.push(["Q",[{x:O,y:R},{x:D,y:L}]])}else if("CB"===s){var j=c(u.split(",").map((function(e){return Number(e)})),6),z=j[0],B=j[1],F=j[2],U=j[3],W=j[4],G=j[5];i={x:W,y:G},z=z/9525*r.x,B=B/9525*r.y,F=F/9525*r.x,U=U/9525*r.y,W=W/9525*r.x,G=G/9525*r.y,o.cmds.push(["C",[{x:z,y:B},{x:F,y:U},{x:W,y:G}]])}else"C"===s&&o.cmds.push(["Z",[]])}S.push(o)})),{graphicsWidth:M,graphicsHeight:k,pivot:T,padding:2,pathsData:S}),R=O.graphicsWidth,D=O.graphicsHeight,L=O.pathsData,j=O.pivot,z=O.padding;this.graphics.push({hash:N,pathsData:L,pivot:j,width:R,height:D,padding:z})}return e}},{key:"pack",value:function(){return this.graphics.forEach((function(e){e.width+=4,e.height+=4})),function e(t){for(var r=[],n=t.filter((function(e){var t=e.width<2048&&e.height<2048;return t||r.push(e),t})).sort((function(e,t){return e.width*e.height-t.width*t.height})),i=n.length+1,o=2050,a=2050,s=[],u=null;(o>2048||a>2048)&&n.length>0;)i-=1,o=(u=av()(n.slice(0,i))).width,a=u.height;return u&&s.push(u),r.forEach((function(e){var t=av()([e]);s.push(t)})),i2&&void 0!==arguments[2]?arguments[2]:{type:"el",index:0,id:""},o=this.targets[e.id];return"shape"!==e.type?o:("shape"===e.type&&e.txEl&&(o=null!==(r=null==o?void 0:o.getTextElement(e.txEl.type,e.txEl.range))&&void 0!==r?r:null),"shape"===e.type&&e.bg&&0===i.index&&(t=!1,o=null!==(n=null==o?void 0:o.getBgElement())&&void 0!==n?n:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),t&&o?o.getIterateEntry(i.type,i.index,i.id):(o||this.eventHub.emit("IterateTimeNodeEnd",i.id),o))}},{key:"clearTargets",value:function(){this.targets=Object.create(null)}}]),e}(),Nv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.strokeColorFilter.currentColor},set:function(e){this.target.strokeColorFilter.color=e}},{key:"on",get:function(){return this.target.strokeActive?"true":"false"},set:function(e){this.target.strokeActive="true"===e}}]),e}(),Ov=function e(t){var r=this;x(this,e),this.applyCommand=function(e,t){r.target.applyCommand(e,t)},this.target=t},Rv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"toString",value:function(){return this.color}},{key:"color",get:function(){return this.target.pptColorFilter.currentColor},set:function(e){this.target.pptColorActive&&(this.target.pptColorFilter.color=e)}},{key:"on",get:function(){return this.target.pptColorActive?"true":"false"},set:function(e){this.target.pptColorActive="true"===e}},{key:"designColor",get:function(){return this.target.pptColorFilter.designColor}}]),e}(),Dv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.fillColorFilter.currentColor},set:function(e){this.target.fillActive&&(this.target.fillColorFilter.color=e)}},{key:"on",get:function(){return this.target.fillActive?"true":"false"},set:function(e){this.target.fillActive="true"===e}},{key:"designColor",get:function(){return this.target.fillColorFilter.designColor}}]),e}(),Lv=function(){function e(t,r,n){x(this,e),this.hardHidden=!1,this.designRotation=0,this.target=t,!0===r&&(this.hardHidden=!0),this.designRotation=n}return S(e,[{key:"opacity",get:function(){return this.target.alpha},set:function(e){this.target.alpha=e}},{key:"rotation",get:function(){return this.target.rotation/Math.PI*180},set:function(e){this.target.rotation=e/180*Math.PI+this.designRotation}},{key:"visibility",get:function(){return this.target.visible?"visible":"hidden"},set:function(e){this.visibility===e||this.hardHidden||(this.target.visible="visible"===e)}}]),e}(),jv=function(){function e(t,r){x(this,e),this.actions=[],this.ctx=r,this.object=t,this.object.interactive=!0}return S(e,[{key:"reset",value:function(e){this.object.interactive=!1,this.object.removeAllListeners(),this.object=e,this.object.interactive=!0}},{key:"addAction",value:function(e,t){var r=this;this.actions.push([e,t]),"click"===t?(this.object.addListener("pointertap",(function(){return r.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return r.handleAction(e)}))}},{key:"getOriginHitArea",value:function(){return this.object.hitArea?this.object.hitArea:new jl.k(0,0,this.object.width,this.object.height)}},{key:"handleAction",value:function(e){this.ctx.eventHub.emit(__.hyperlinkTrigger,e),this.execAction(e)}},{key:"execAction",value:function(e){var t,r;if(this.ctx.eventHub.emit(__.userInput),"ppaction://hlinksldjump"===e.action){var n=(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(__.requestGotoSlide,Number(n[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(__.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(__.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(__.requestGotoSlide,i)}else"ppaction://hlinkshowjump?jump=endshow"===e.action?this.ctx.eventHub.emit(__.requestGotoSlide,-1):""===e.action&&(null===(r=e.target)||void 0===r?void 0:r.startsWith("http"))&&this.ctx.eventHub.emit(__.requestOpenUrl,e.target)}}]),e}();function zv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return Math.abs(e-t)<=Math.pow(10,-r)}function Bv(e){return Math.floor(1e6*e)/1e6}var Fv=function(){function e(){x(this,e),this.point={x:0,y:0},this.slope=Math.PI/4}return S(e,[{key:"resolveY",value:function(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}},{key:"distanceToLinearEquation",value:function(e){return zv(this.slope,e.slope)?this.distanceToPoint(e.point):-1}},{key:"distanceToPoint",value:function(t){var r;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;r=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;var n=e.fromPointSlope(t,r),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}},{key:"crossPoint",value:function(e){if(zv(e.slope,this.slope))return null;var t=0,r=0,n=Math.tan(e.slope),i=Math.tan(this.slope),o=this.point,a=o.x,s=o.y,u=e.point,l=u.x,c=u.y;return zv(this.slope,Math.PI/2)?r=n*((t=this.point.x)-l)+c:zv(e.slope,Math.PI/2)?r=i*((t=e.point.x)-a)+s:zv(this.slope,Math.PI)||zv(this.slope,0)?t=((r=this.point.y)-c)/n+l:zv(e.slope,Math.PI)||zv(e.slope,0)?t=((r=e.point.y)-s)/i+a:r=i*((t=(n*l-c+s-i*a)/(n-i))-a)+s,{x:t,y:r}}}],[{key:"fromPointSlope",value:function(t,r){var n=new e;return n.point=t,n.slope=r,n}}]),e}(),Uv=function(){function e(t,r,n){var i,o,a,s,u,l,c=this;x(this,e),this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new jl.j(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new Dl.b,this.ctx=r,this.style=new Lv(this.container,!!t.hardHidden,t.rotation||0),this.designGlobalPosition={x:n.parentGlobalPos.x+(null!==(o=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0),y:n.parentGlobalPos.y+(null!==(s=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new jv(this.container,this.ctx),t.hlinkHover&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil((function(){try{return!!c.container.width}catch(e){return!1}}),3e3).then((function(){try{c.designWidth=c.designWidth||c.container.width}catch(e){}})),this.ctx.clock.waitUntil((function(){try{return!!c.container.height}catch(e){return!1}}),3e3).then((function(){try{c.designHeight=c.designHeight||c.container.height}catch(e){}}))}return S(e,[{key:"updateScale",value:function(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}},{key:"updateTransform",value:function(e){var t,r,n,i,o,a,s,u;this.designWidth=e.width,this.designHeight=e.height,this.designX=null!==(r=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,this.designY=null!==(i=null===(n=e.position)||void 0===n?void 0:n.y)&&void 0!==i?i:0;var l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;var h=null!==(a=null===(o=e.position)||void 0===o?void 0:o.x)&&void 0!==a?a:0,d=null!==(u=null===(s=e.position)||void 0===s?void 0:s.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,e.scale&&(this.designScale={x:e.scale.x,y:e.scale.y},this.container.scale.x=e.scale.x,this.container.scale.y=e.scale.y),e.rotation&&(this.container.rotation=e.rotation);var f=new Nd;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}},{key:"scale",get:function(){return this.scaleOrigin},set:function(e){this.scaleOrigin.x=e.x,this.scaleOrigin.y=e.y,this.updateScale()}},{key:"design_ppt_w",get:function(){return Bv(this.designWidth/this.ctx.stageWidth)}},{key:"design_ppt_h",get:function(){return Bv((this.designHeight||this.container.height)/this.ctx.stageHeight)}},{key:"design_ppt_x",get:function(){return Bv(this.designX/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.designY/this.ctx.stageHeight)}},{key:"ppt_w",get:function(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth},set:function(e){this.designWidth&&(this.scaleExt.x=e*this.ctx.stageWidth/this.designWidth,this.updateScale())}},{key:"ppt_h",get:function(){var e=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*e/this.ctx.stageHeight},set:function(e){this.designHeight&&(this.scaleExt.y=e*this.ctx.stageHeight/this.designHeight,this.updateScale())}},{key:"ppt_x",get:function(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth},set:function(e){this.pptX=e;var t=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=e*this.ctx.stageWidth+this.container.pivot.x*t}},{key:"ppt_y",get:function(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight},set:function(e){this.pptY=e;var t=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=e*this.ctx.stageHeight+this.container.pivot.y*t}},{key:"r",get:function(){return this.container.rotation},set:function(e){this.container.rotation=e}},{key:"xshear",set:function(e){this.container.skew.x=e},get:function(){return this.container.skew.x}},{key:"yshear",set:function(e){this.container.skew.y=e},get:function(){return this.container.skew.y}}]),e}(),Wv=r(112),Gv=r.n(Wv),Vv=function(){function e(t){if(x(this,e),this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;var r=t.match(/-?[0-9]+/g);r&&(this.h=parseInt(r[0],10),this.s=parseInt(r[1],10)/100,this.l=parseInt(r[2],10)/100)}}return S(e,[{key:"isInit",value:function(){return this._isInit}},{key:"by",value:function(e,t){t.h=Math.max(Math.min(this.h+e.h,359),0),t.s=Math.max(Math.min(this.s+e.s,1),0),t.l=Math.max(Math.min(this.l+e.l,1),0),t.a=Math.max(Math.min(this.a+e.a,1),0)}},{key:"fromHexString",value:function(e){var t,r,n=c($v(e),4),i=n[0],o=n[1],a=n[2],s=n[3],u=0,l=Math.max(i,o,a),h=Math.min(i,o,a),d=l-h;r=(l+h)/2,0===d?u=0:l===i?u=(o-a)/d%6*60:l===o?u=60*((a-i)/d+2):l===a&&(u=60*((i-o)/d+4)),t=0===d?0:d/(1-Math.abs(2*r-1)),this.h=u,this.s=t,this.l=r,this.a=s}},{key:"interpolationFrom",value:function(e,t,r){var n=e.h+(this.h-e.h)*t,i=e.s+(this.s-e.s)*t,o=e.l+(this.l-e.l)*t,a=e.a+(this.a-e.a)*t;r.h=Math.max(Math.min(n,359),0),r.s=Math.max(Math.min(i,1),0),r.l=Math.max(Math.min(o,1),0),r.a=Math.max(Math.min(a,1),0)}},{key:"toHexString",value:function(){var e=[0,0,0,0],t=this.h,r=this.s,n=this.l;if(t<360&&t>=0&&r<=1&&r>=0&&n<=1&&n>=0){var i,o=(1-Math.abs(2*n-1))*r,a=o*(1-Math.abs(t/60%2-1)),s=n-o/2;e=[(i=c(t>=0&&t<60?[o,a,0]:t>=60&&t<120?[a,o,0]:t>=120&&t<180?[0,o,a]:t>=180&&t<240?[0,a,o]:t>=240&&t<300?[a,0,o]:[o,0,a],3))[0]+s,i[1]+s,i[2]+s,this.a]}return Xv(e)}}]),e}(),Hv=function(){function e(t){x(this,e),this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}return S(e,[{key:"fromHexString",value:function(e){var t=c($v(e),4),r=t[0],n=t[1],i=t[2],o=t[3];this.r=r,this.g=n,this.b=i,this.a=o}},{key:"isInit",value:function(){return this._isInit}},{key:"interpolationFrom",value:function(e,t,r){r.r=e.r+(this.r-e.r)*t,r.g=e.g+(this.g-e.g)*t,r.b=e.b+(this.b-e.b)*t,r.a=e.a+(this.a-e.a)*t}},{key:"by",value:function(e,t){t.r=Math.min(Math.max(this.r+e.r,0),255),t.g=Math.min(Math.max(this.g+e.g,0),255),t.b=Math.min(Math.max(this.b+e.b,0),255),t.a=Math.min(Math.max(this.a+e.a,0),1)}},{key:"toHexString",value:function(){return Xv([this.r,this.g,this.b,this.a])}}]),e}();function Yv(e){var t=e.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function $v(e){return 0===(e=e.replace(/^#/,"")).substring(6,8).length&&(e+="FF"),[parseInt(e.substring(0,2).padStart(8,"0"),16)/255,parseInt(e.substring(2,4).padStart(8,"0"),16)/255,parseInt(e.substring(4,6).padStart(8,"0"),16)/255,parseInt(e.substring(6,8).padStart(8,"0"),16)/255]}function Xv(e){return"#"+Math.round(255*e[0]).toString(16).padStart(2,"0")+Math.round(255*e[1]).toString(16).padStart(2,"0")+Math.round(255*e[2]).toString(16).padStart(2,"0")+Math.round(255*e[3]).toString(16).padStart(2,"0")}function qv(e,t,r){var n=$v(e),i=$v(t),o=Math.round(255*(n[0]+(i[0]-n[0])*r)),a=Math.round(255*(n[1]+(i[1]-n[1])*r)),s=Math.round(255*(n[2]+(i[2]-n[2])*r)),u=Math.round(255*(n[3]+(i[3]-n[3])*r));return"#"+o.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}var Qv=function(e){p(r,e);var t=g(r);function r(){var e;return x(this,r),(e=t.call(this,void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0})).currentColor="#FFFFFFFF",e.designColor="#FFFFFFFF",e}return S(r,[{key:"color",set:function(e){this.currentColor=e;var t=$v(e);this.uniforms.color=Float32Array.from(t)},get:function(){return this.currentColor}}]),r}($l.k),Zv=new Bp.ColorMatrixFilter;Zv.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];var Kv=new Bp.ColorMatrixFilter;Kv.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];var Jv=new Bp.ColorMatrixFilter;Jv.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];var eg=new Bp.ColorMatrixFilter;eg.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];var tg={darken:Zv,darkenLess:Kv,lightenLess:eg,lighten:Jv},rg=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,{position:{x:e.x,y:e.y},width:e.width,height:e.height},n,i)).fillColorFilter=new Qv,o.fill=new Dv(y(o)),o.json=e,o.ctx=n,o.parentGlobalPos=i.parentGlobalPos,o.global={x:i.parentGlobalPos.x+e.x,y:i.parentGlobalPos.y+e.y},o.updateTransform({position:{x:e.x,y:e.y},width:e.width,height:e.height}),o}return S(r,[{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"getTextElement",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"fillActive",get:function(){var e,t;return(null!==(t=null===(e=this.container.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){var t,r;e?(null!==(r=null===(t=this.container.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}},{key:"renderContainer",get:function(){return this.container}},{key:"interactiveContainer",get:function(){return this.container}},{key:"ppt_x",get:function(){return this.global.x/this.ctx.stageWidth},set:function(e){var t=e*this.ctx.stageWidth-this.global.x,r=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+t+this.container.pivot.x*r}},{key:"ppt_y",get:function(){return this.global.y/this.ctx.stageHeight},set:function(e){var t=e*this.ctx.stageHeight-this.global.y,r=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+t+this.container.pivot.y*r}},{key:"design_ppt_x",get:function(){return Bv(this.global.x/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.global.y/this.ctx.stageHeight)}}]),r}(Uv),ng=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.ctx=t,this.type=r,this.lineWidth=n,this.width=i,this.height=o,this.fillColor=a,this.isHorz=s,this.renderContainer=new Dl.b,this.ghcTextureId="".concat(u,"-text-p").concat(l,"-l").concat(c,"-u").concat(h,"-underLine")}return S(e,[{key:"createPaths",value:function(){if("ww"===this.type)return null;var e,t="M 0,0 L ".concat(9525*this.width,",0"),r=[this.width,this.lineWidth],n=r[0],i=r[1];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,n=(e=[this.lineWidth,this.height])[0],i=e[1]),{paths:[{id:uv(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:xv()(t)}],width:n,height:i}}},{key:"getLineStyle",value:function(){var e={width:this.lineWidth};return"dotted"===this.type&&(e.dash=""+this.lineWidth),e}},{key:"preRender",value:function(){var e=this.createPaths();if(e){var t=e.paths,r=e.width,n=e.height,i=t.reduce((function(e,t){return e+t.hash}),"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,t,i,{x:0,y:0},r,n,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}},{key:"render",value:function(){if(this.ghcTextureId){var e=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);e&&(this.sprite=new Ld,this.sprite.texture=e.texture,this.sprite.pivot.x=e.pivot.x,this.sprite.scale.x=e.scale,this.sprite.scale.y=e.scale)}}},{key:"destroy",value:function(){var e;null===(e=this.sprite)||void 0===e||e.destroy({texture:!0})}}]),e}(),ig=134217729;function og(e,t,r,n,i){var o,a,s,u,l=t[0],c=n[0],h=0,d=0;c>l==c>-l?(o=l,l=t[++h]):(o=c,c=n[++d]);var f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=t[++h]):(s=o-((a=c+o)-c),c=n[++d]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=t[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++d]),o=a,0!==s&&(i[f++]=s);for(;h0!=s>0)return u;var l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,r,n,i,o,a){var s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=e-i,k=r-i,E=t-o,A=n-o;h=(x=(p=M-(f=(d=ig*M)-(d-M)))*(g=A-(v=(d=ig*A)-(d-A)))-((b=M*A)-f*v-p*v-f*g))-(m=x-(S=(p=E-(f=(d=ig*E)-(d-E)))*(g=k-(v=(d=ig*k)-(d-k)))-((w=E*k)-f*v-p*v-f*g))),sg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),sg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,sg[2]=y-(T-h)+(m-h),sg[3]=T;var I=function(e,t){for(var r=t[0],n=1;n=C||-I>=C)return I;if(s=e-(M+(h=e-M))+(h-i),l=r-(k+(h=r-k))+(h-i),u=t-(E+(h=t-E))+(h-o),c=n-(A+(h=n-A))+(h-o),0===s&&0===u&&0===l&&0===c)return I;if(C=11093356479670487e-47*a+33306690738754706e-32*Math.abs(I),(I+=M*c+A*s-(E*l+k*u))>=C||-I>=C)return I;h=(x=(p=s-(f=(d=ig*s)-(d-s)))*(g=A-(v=(d=ig*A)-(d-A)))-((b=s*A)-f*v-p*v-f*g))-(m=x-(S=(p=u-(f=(d=ig*u)-(d-u)))*(g=k-(v=(d=ig*k)-(d-k)))-((w=u*k)-f*v-p*v-f*g))),hg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),hg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,hg[2]=y-(T-h)+(m-h),hg[3]=T;var P=og(4,sg,4,hg,ug);h=(x=(p=M-(f=(d=ig*M)-(d-M)))*(g=c-(v=(d=ig*c)-(d-c)))-((b=M*c)-f*v-p*v-f*g))-(m=x-(S=(p=E-(f=(d=ig*E)-(d-E)))*(g=l-(v=(d=ig*l)-(d-l)))-((w=E*l)-f*v-p*v-f*g))),hg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),hg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,hg[2]=y-(T-h)+(m-h),hg[3]=T;var N=og(P,ug,4,hg,lg);h=(x=(p=s-(f=(d=ig*s)-(d-s)))*(g=c-(v=(d=ig*c)-(d-c)))-((b=s*c)-f*v-p*v-f*g))-(m=x-(S=(p=u-(f=(d=ig*u)-(d-u)))*(g=l-(v=(d=ig*l)-(d-l)))-((w=u*l)-f*v-p*v-f*g))),hg[0]=x-(m+h)+(h-S),h=(_=b-((y=b+m)-(h=y-b))+(m-h))-(m=_-w),hg[1]=_-(m+h)+(h-w),h=(T=y+m)-y,hg[2]=y-(T-h)+(m-h),hg[3]=T;var O=og(N,lg,4,hg,cg);return cg[O-1]}(e,t,r,n,i,o,l)}var fg=Math.pow(2,-52),pg=new Uint32Array(512),vg=function(){function e(t){x(this,e);var r=t.length>>1;if(r>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;var n=Math.max(2*r-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(r)),this._hullPrev=new Uint32Array(r),this._hullNext=new Uint32Array(r),this._hullTri=new Uint32Array(r),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(r),this._dists=new Float64Array(r),this.update()}return S(e,null,[{key:"from",value:function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xg,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wg,i=t.length,o=new Float64Array(2*i),a=0;a>1,a=1/0,s=1/0,u=-1/0,l=-1/0,c=0;cu&&(u=h),d>l&&(l=d),this._ids[c]=c}for(var f,p,v,g=(a+u)/2,m=(s+l)/2,y=1/0,_=0;_0&&(p=S,y=T)}for(var M=e[2*p],k=e[2*p+1],E=1/0,A=0;AL&&(O[R++]=j,L=this._dists[j])}return this.hull=O.subarray(0,R),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(dg(x,w,M,k,C,P)<0){var z=p,B=M,F=k;p=v,M=C,k=P,v=z,C=B,P=F}var U=function(e,t,r,n,i,o){var a=r-e,s=n-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*h)*d,y:t+(a*h-u*c)*d}}(x,w,M,k,C,P);this._cx=U.x,this._cy=U.y;for(var W=0;W0&&Math.abs(X-V)<=fg&&Math.abs(q-H)<=fg)&&(V=X,H=q,$!==f&&$!==p&&$!==v)){for(var Q=0,Z=0,K=this._hashKey(X,q);Z=0;)if((ee=J)===Q){ee=-1;break}if(-1!==ee){var te=this._addTriangle(ee,$,r[ee],-1,-1,n[ee]);n[$]=this._legalize(te+2),n[ee]=te,G++;for(var re=r[ee];J=r[re],dg(X,q,e[2*re],e[2*re+1],e[2*J],e[2*J+1])<0;)te=this._addTriangle(re,$,J,n[$],-1,n[re]),n[$]=this._legalize(te+2),r[re]=re,G--,re=J;if(ee===Q)for(;dg(X,q,e[2*(J=t[ee])],e[2*J+1],e[2*ee],e[2*ee+1])<0;)te=this._addTriangle(J,$,ee,-1,n[ee],n[J]),this._legalize(te+2),n[J]=te,r[ee]=ee,G--,ee=J;this._hullStart=t[$]=ee,r[ee]=t[re]=$,r[$]=re,i[this._hashKey(X,q)]=$,i[this._hashKey(e[2*ee],e[2*ee+1])]=ee}}}this.hull=new Uint32Array(G);for(var ne=0,ie=this._hullStart;ne0?3-i:1+i)/4*this._hashSize))%this._hashSize;var r,n,i}},{key:"_legalize",value:function(e){for(var t=this._triangles,r=this._halfedges,n=this.coords,i=0,o=0;;){var a=r[e],s=e-e%3;if(o=s+(e+2)%3,-1!==a){var u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,h=t[o],d=t[e],f=t[l],p=t[c];if(mg(n[2*h],n[2*h+1],n[2*d],n[2*d+1],n[2*f],n[2*f+1],n[2*p],n[2*p+1])){t[e]=p,t[a]=h;var v=r[c];if(-1===v){var g=this._hullStart;do{if(this._hullTri[g]===c){this._hullTri[g]=e;break}g=this._hullPrev[g]}while(g!==this._hullStart)}this._link(e,v),this._link(a,r[o]),this._link(o,c);var m=u+(a+1)%3;i=r&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{var u=r+1,l=n;bg(e,r+n>>1,u),t[e[r]]>t[e[n]]&&bg(e,r,n),t[e[u]]>t[e[n]]&&bg(e,u,n),t[e[r]]>t[e[u]]&&bg(e,r,u);for(var c=e[u],h=t[c];;){do{u++}while(t[e[u]]h);if(l=l-r?(_g(e,t,u,n),_g(e,t,r,l-1)):(_g(e,t,r,l-1),_g(e,t,u,n))}}function bg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function xg(e){return e[0]}function wg(e){return e[1]}function Sg(e,t,r){var n=t/2,i=r/2,o=[{x:-n,y:i},{x:-n,y:-i},{x:n,y:i},{x:n,y:-i}],s=[Fv.fromPointSlope({x:-n,y:0},Math.PI/2),Fv.fromPointSlope({x:0,y:i},0),Fv.fromPointSlope({x:n,y:0},Math.PI/2),Fv.fromPointSlope({x:0,y:-i},0)],u=[],l=e.stopList.slice(1,e.stopList.length-1).map((function(o){for(var l,c,h,d=2*Math.PI,f=null!==(c=null===(l=e.line)||void 0===l?void 0:l.ang)&&void 0!==c?c:0;f>d;)f-=d;for(;f<0;)f+=d;var p={x:0,y:0};zv(f,Math.PI/2)?(p.x=0,p.y=r/2-o.pos*r):zv(f,0)?(p.x=o.pos*t-t/2,p.y=0):(p.x=o.pos*t-t/2,p.y=r/2-o.pos*r),f>Math.PI/2&&f<=Math.PI&&(p.x*=-1),f>Math.PI&&f<=2*Math.PI&&(p.y*=-1);var v=Fv.fromPointSlope(p,Math.PI/2-((null===(h=e.line)||void 0===h?void 0:h.ang)||0)),g=s.map((function(e){return v.crossPoint(e)})).filter((function(e){return e&&e.x<=n&&e.x>=-n&&e.y<=i&&e.y>=-i})).map((function(e){return{point:e,color:o.color}})).sort((function(e,t){return t.point.y-e.point.y}));u.push.apply(u,a(g));for(var m=Math.abs(g[1].point.x-g[0].point.x)/10,y=20;y--;){var _=y%2==0?1:-1,b=p.x+_*m,x=v.resolveY(b);b<=n&&b>=-n&&x<=i&&x>=-i&&u.push({point:{x:b,y:x},color:o.color}),m+=m}return v})),c=[],h=[];e:for(var d=0;d= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0) * texColor.a;\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0) * texColor.a;\n }\n}\n",alphaModFix:"\nvec4 transform(vec4 texColor, float arg) {\n return texColor * arg;\n}\n",alphaBiLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < arg) {\n result.a = 0.0;\n } else {\n result.a = 1.0;\n }\n return result;\n}\n",alphaCeiling:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a > 0.0) {\n result.a = 1.0;\n }\n return result;\n}\n",alphaFloor:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < 1.0) {\n result.a = 0.0;\n }\n return result;\n}\n",grayscl:"\nvec4 transform(vec4 texColor, float arg) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n return vec4(avg, avg, avg, texColor.a);\n}\n"},Eg=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=kg[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Mg.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n")),{arg:n})}return r}($l.k),Ag=[Tg],Ig={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n",changeBulletColor:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n if (texColor.a == 0.0) {\n return texColor;\n } else {\n return arg2;\n }\n}\n",duotone:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n // float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n // vec3 hsl = rgb2hsl(vec3(avg, avg, avg));\n // vec3 result = arg2.rgb * hsl.z + arg1.rgb * (1.0 - hsl.z);\n // return vec4(result * texColor.a, texColor.a);\n \n float brightness = texColor.r * 0.3 + texColor.g * 0.59 + texColor.b * 0.11;\n \n return vec4(\n (arg1.r + brightness * (arg2.r - arg1.r)) * texColor.a,\n (arg1.g + brightness * (arg2.g - arg1.g)) * texColor.a,\n (arg1.b + brightness * (arg2.b - arg1.b)) * texColor.a,\n texColor.a\n );\n}\n"},Cg=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Ig[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n".concat(Ag.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:Float32Array.from(n),arg2:Float32Array.from(i)})}return r}($l.k),Pg=[Tg],Ng={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n vec3 rgb = texColor.rgb / texColor.a;\n\n // 对比度\n highp float C = arg2 * 255.0;\n highp float F = (259.0 * (255.0 + C)) / (255.0 * (259.0 - C));\n rgb.rgb = F * (rgb.rgb - 0.5) + 0.5;\n\n // 亮度\n rgb.rgb += arg1 * rgb.rgb;\n\n rgb.rgb *= texColor.a;\n return vec4(rgb, texColor.a);\n}\n"},Og=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Ng[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n".concat(Pg.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:n,arg2:i})}return r}($l.k),Rg=[Tg],Dg={alphaInv:"\nvec4 transform(vec4 texColor, vec4 arg1) {\n float alpha = 1.0 - texColor.a;\n arg1.rgb = arg1.rgb * alpha;\n arg1.a = alpha;\n return arg1;\n}\n"},Lg=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=Dg[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform sampler2D uSampler;\n\n".concat(Rg.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1);\n}\n")),{arg1:Float32Array.from(n)})}return r}($l.k);function jg(e,t){var r=[];return e.forEach((function(e){var n=((null==t?void 0:t.filter)||[]).indexOf(e.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(e.type)>=0&&n)r.push(new Eg(e.type,e.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(e.type)>=0&&n){var i=$v(e.args[0]),o=$v(e.args[1]);r.push(new Cg(e.type,i,o))}else if("lum"===e.type&&n)r.push(new Og(e.type,e.args[0],e.args[1]));else if("alphaInv"===e.type&&n){var a=$v(e.args[0]);r.push(new Lg(e.type,a))}})),r}var zg=function(){function e(t,r,n,i,o){x(this,e),this.ctx=t,this.fillStyle=r,this.width=n,this.height=i,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=xv()("".concat(JSON.stringify(r)).concat(Math.ceil(n)).concat(Math.ceil(i)))}return S(e,[{key:"createDisplayObject",value:function(){var e;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){var t=new Ld;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType){var r=new Ld,n=function(e,t,r){var n,i=new Dl.b;if(e.stopList.sort((function(e,t){return e.pos-t.pos})),!e.stopList.find((function(e){return 0===e.pos}))){var o=e.stopList[0];e.stopList.unshift({pos:0,color:o.color})}if(!e.stopList.find((function(e){return 1===e.pos}))){var s=e.stopList[e.stopList.length-1];e.stopList.push({pos:1,color:s.color})}var u=function(e){for(var t=[],r=0,n=e.length;r0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(h.filters=jg(u,this.ctx.featureList)),this.config.fillFloat){var d=this.config.fillFloat.fillRect,f=d.l,p=d.t,v=d.r,g=d.b,m=this.width*(1-f-v),y=this.height*(1-p-g),_=null!==(e=this.config.shapeRotation)&&void 0!==e?e:0,b=new Nd;b.drawRect(0,0,m,y),b.pivot.x=m/2,b.pivot.y=y/2,b.rotation=_;var x=b.getBounds(),w=x.width,S=x.height;h.width=w,h.height=S,h.anchor.x=.5,h.anchor.y=.5,h.rotation=-1*_,h.name="math-texture",0===_?(h.position.x=w/2+f*this.width,h.position.y=S/2+p*this.height):(h.position.x=this.width/2,h.position.y=this.height/2)}else h.width=this.width,h.height=this.height,c.rotate&&(h.position.x=this.width/2,h.position.y=this.height/2,h.anchor.x=.5,h.anchor.y=.5,h.rotation=c.rotate/180*Math.PI);return h}}else if("gifFill"===this.fillStyle.fillType){var T=this.fillStyle,M=T.src,k=T.delays,E=T.filters,A=this.ctx.spriteTexture.getGifFrames(M).map((function(e,t){return{texture:e,time:k[t]||20}})),I=new jp(A,!0);I.name=uv(),I.width=this.width,I.height=this.height,E.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(I.filters=jg(E,this.ctx.featureList));var C=this.fillStyle.loop,P=1;return I.onLoop=function(){P+=1,C>0&&P>C&&I.gotoAndStop(I.totalFrames)},I}return null}},{key:"isSolidFill",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)}},{key:"getSolidFillColor",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)?this.fillStyle.color:"#000000"}},{key:"getClonedDisplayObject",value:function(){var e=this.createDisplayObject();return this.clonedObjects.push(e),e}},{key:"destroy",value:function(){var e;null===(e=this._displayObject)||void 0===e||e.destroy(),this._displayObject=null,this.clonedObjects.forEach((function(e){null==e||e.destroy()})),this.clonedObjects=[]}},{key:"displayObject",get:function(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject},set:function(e){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=e}},{key:"hasFill",get:function(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}}]),e}(),Bg=function(e){p(r,e);var t=g(r);function r(){return x(this,r),t.apply(this,arguments)}return r}($l.k),Fg=r(113),Ug=r.n(Fg),Wg=r(114),Gg=r.n(Wg),Vg=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,Ug.a,Gg.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:$v(e.color),uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:e.rad/2,uSdfPosition:new Float32Array([0,0])})).priority=3,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){var t=Math.ceil(this.json.rad),r=Math.ceil(e.width+2*t),n=Math.ceil(e.height+2*t);return new jl.j(e.x-t,e.y-t,r,n)}},{key:"sdfBox",value:function(e,t){var r=Math.ceil(this.json.rad),n=Math.ceil(e+2*r),i=Math.ceil(t+2*r);return new jl.j(r,r,n,i)}}]),r}(Bg),Hg=r(19),Yg=r.n(Hg),$g=r(115),Xg=r.n($g),qg=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,Yg.a,Xg.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:e.rad,uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:1})).priority=2,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(e,t){return new jl.j(0,0,e,t)}}]),r}(Bg),Qg=function e(){x(this,e)},Zg=r(116),Kg=r.n(Zg),Jg=function(e){p(r,e);var t=g(r);function r(e){return x(this,r),t.call(this,Yg.a,Kg.a,{uColor:$v(e)})}return r}($l.k),em=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).order=1,o.outputTexture=$l.t.WHITE,o.frameTextures=[],o.json=e,o.effectContainer=n,o.outputSprite=new Ld,o.targetScale=i,o.outputSprite.scale.x=o.json.sx,o.outputSprite.scale.y=o.json.sy,o.outputSprite.skew.x=(o.targetScale.x>0?1:-1)*o.json.kx,o.outputSprite.skew.y=(o.targetScale.y>0?1:-1)*o.json.ky,o.outputSprite.filters=[new Bp.BlurFilter(o.json.blurRad/2,4),new Jg(o.json.color)],o}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];if(t){var r=this.effectContainer.getBounds(),n=(this.effectContainer.width-t.width)/2,i=(this.effectContainer.height-t.height)/2,o=new jl.g(r.x,r.y),a=new jl.g(r.x,r.y);switch(this.json.align){case"tl":a.x=r.x,a.y=r.y;break;case"t":a.x=r.x+r.width/2,a.y=r.y,o.x+=r.width/2;break;case"tr":a.x=r.x+r.width,a.y=r.y,o.x+=r.width;break;case"l":a.x=r.x,a.y=r.y+r.height/2,o.y+=r.height/2;break;case"ctr":a.x=r.x+r.width/2,a.y=r.y+r.height/2,o.x+=r.width/2,o.y+=r.height/2;break;case"r":a.x=r.x+r.width,a.y=r.y+r.height/2,o.x+=r.width,o.y+=r.height/2;break;case"bl":a.x=r.x,a.y=r.y+r.height,o.y+=r.height;break;case"b":a.x=r.x+r.width/2,a.y=r.y+r.height,o.x+=r.width/2,o.y+=r.height;break;case"br":a.x=r.x+r.width,a.y=r.y+r.height,o.x+=r.width,o.y+=r.height}var s=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=s.x,this.outputSprite.pivot.y=s.y;var u=new jl.g(this.json.dist,0),l=new jl.d;l.rotate(this.json.dir),l.translate(o.x+n,o.y+i),l.apply({x:u.x,y:u.y},u);var c=this.effectContainer.toLocal(u);this.outputSprite.position.x=c.x,this.outputSprite.position.y=c.y,this.outputSprite.texture=t}}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){}}]),r}(Qg),tm=r(117),rm=r.n(tm),nm=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),i=t.call(this,Yg.a,rm.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:n}),console.log(y(i)),i}return r}($l.k),im=function(e){p(r,e);var t=g(r);function r(e,n,i,o,a){var s;x(this,r),(s=t.call(this)).order=2,s.outputSprite=new Ld,s.outputTexture=$l.t.WHITE,s.frameTextures=[],s.json=e,s.shapeScaleX=o,s.effectContainer=n,s.rotation=i,s.ctx=a,s.outputSprite.anchor.x=.5,s.outputSprite.anchor.y=.5;var u=s.effectContainer.getBounds();return s.outputSprite.filters=[new Bp.BlurFilter(s.json.blurRad/2,4),new nm(s.json,u.height)],s.outputSprite.alpha=.5,s.outputSprite.rotation=-1===s.shapeScaleX?Math.PI+2*s.rotation:Math.PI-2*s.rotation,s.outputSprite.scale.x=-1,s}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];t&&(this.outputSprite.texture=t)}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){var r=this.effectContainer.getBounds(),n=new jl.g(r.x+r.width/2,r.y+r.height/2),i=new jl.g(n.x,n.y+r.height+this.json.dist),o=this.effectContainer.toLocal(i);this.outputSprite.position.x=o.x+e,this.outputSprite.position.y=o.y+t}}]),r}(Qg),om=r(118),am=r.n(om),sm=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,Yg.a,am.a,{})).priority=1,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),r}(Bg),um=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},lm=function(e){p(r,e);var t=g(r);function r(e,n,i,o,s,u){var l;x(this,r),(l=t.call(this)).effects=[],l.attachs=[],l.frames=new Map,l._targetContainer=new Dl.b,l.frameCount=1,l.ctx=o,l.originWidth=e.width,l.originHeight=e.height,l.cacheKey=i,l.sourceSprite=new Ld;var c,h=M(n);try{for(h.s();!(c=h.n()).done;){var d=c.value;switch(d.type){case"innerShadow":l.effects.push(new sm(d));break;case"softEdge":l.effects.push(new qg(d));break;case"glow":l.effects.push(new Vg(d));break;case"reflection":l.attachs.push(new im(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new em(d,e,u))}}}catch(e){h.e(e)}finally{h.f()}l.effects=l.effects.sort((function(e,t){return e.priority-t.priority})),l.attachs=l.attachs.sort((function(e,t){return e.order-t.order}));var f,p=M(l.attachs);try{for(p.s();!(f=p.n()).done;){var v=f.value;l._targetContainer.addChild(v.outputSprite)}}catch(e){p.e(e)}finally{p.f()}l.sourceSprite.name="source-sprite";var g=new jl.j(0,0,l.originWidth,l.originHeight),m=l.effects.map((function(e){return e.filterAreaJustify(g)})),y=m.map((function(e){return e.x})),_=m.map((function(e){return e.y})),b=m.map((function(e){return e.width})),w=m.map((function(e){return e.height}));return l.filterArea=new jl.j(Math.min.apply(Math,a(y).concat([0])),Math.min.apply(Math,a(_).concat([0])),Math.max.apply(Math,a(b).concat([l.originWidth])),Math.max.apply(Math,a(w).concat([l.originHeight]))),l.sourceSprite.filters=l.effects,l.sourceSprite.filterArea=new jl.j(0,0,l.filterArea.width,l.filterArea.height),l._targetSprite=new Ld,l._targetSprite.name="effect-sprite",l._targetContainer.sortableChildren=!0,l._targetSprite.zIndex=999,l._targetContainer.addChild(l._targetSprite),l}return S(r,[{key:"getSdfTexture",value:function(e,t){return um(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n="".concat(this.cacheKey,"_").concat(e),i=this.effects.map((function(e){return{sdfRect:e.sdfBox(t.width,t.height)}})).reduce((function(e,t){return t.sdfRect?(e.width5&&(t.dist=5),b[e]})),o.ctx.slideScopeEventHub.once("slide-render",(function(e){if(o.ctx.slideIndex===e&&o.effectObject){var t=o.getEffectTexture();if(t){var r=t.texture,n=t.offsetX,i=t.offsetY;o.effectObject.setFrameOffset(n,i),o.effectObject.createFrame(1,r)}}}))}return o}return S(r,[{key:"getEffectTexture",value:function(){var e,t=this.json,r=t.lineHeight,n=t.fillLineHeight,i=t.isHorz,o=t.lineWidth,a=this.effectContainer.getLocalBounds(),s=0,u=0,l=M(this.effectContainer.children);try{for(l.s();!(e=l.n()).done;){var c=e.value;c.pivot.x>s&&(s=c.pivot.x),c.pivot.y>u&&(u=c.pivot.y)}}catch(e){l.e(e)}finally{l.f()}var h=new jl.d;h.translate(s,u);var d=$l.p.create({width:i?a.width:o,height:i?Math.max(n,r):a.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:d,transform:h}),{texture:d,offsetX:s,offsetY:u}}},{key:"createStrokeFill",value:function(){var e=this.json,t=e.stroke,r=e.lineWidth,n=e.lineHeight;return new zg(this.ctx,null==t?void 0:t.fill,r,n,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createStrokeGraphics",value:function(){var e=this.json.stroke,t=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[]}:void 0;return new zg(this.ctx,t,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createTextFill",value:function(){var e=this.json,t=e.isHorz,r=e.fill,n=e.lineWidth,i=e.lineHeight,o=e.fillLineHeight;return t?new zg(this.ctx,null==r?void 0:r.fill,n,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new zg(this.ctx,null==r?void 0:r.fill,o,i,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextGraphics",value:function(){var e,t=this.json,r=t.fill,n=t.content,i="#000000";"solidFill"===(null===(e=null==r?void 0:r.fill)||void 0===e?void 0:e.fillType)&&(i=r.fill.color);var o=(null==r?void 0:r.key)?{fillType:"blipFill",src:r.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new zg(this.ctx,o,(null==r?void 0:r.width)||0,(null==r?void 0:r.height)||0,{useFilter:"◾"===n,useSlideBackgroundFill:!1})}},{key:"getIterateEntry",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"updateTransform",value:function(e){var t,n,i,o,a=this.json.isHorz;e.position={x:a&&null!==(n=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:a?0:null!==(o=null===(i=e.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},e.width=a?this.json.width:this.json.lineWidth,e.height=a?this.json.lineHeight:this.json.height,f(b(r.prototype),"updateTransform",this).call(this,e)}},{key:"preRender",value:function(){var e;null===(e=this.underline)||void 0===e||e.preRender()}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return cm(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.doRender();case 1:case"end":return e.stop()}}),e,this)})))}),"@TextUnitImpl[doRender]"),e.addSubMTask((function(){return cm(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.effectList&&this.effectList.length>0&&(r="".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(null===(t=this.json.fill)||void 0===t?void 0:t.key,"_").concat(this.json.effectIndexList),this.effectObject=new lm(this.effectContainer,this.effectList,r,this.ctx,0,new jl.g(1,1)),this.effectObject.on("ready",(function(){var e;n.effectContainer.visible=!1,n.effectObject.container.zIndex=10,n.container.addChild(n.effectObject.container),null===(e=n.effectObject)||void 0===e||e.updateFrame(1)})));case 1:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"doRender",value:function(){var e=!1,t=this.json,r=t.lineWidth,n=t.lineHeight,i=t.baseLine,o=t.isHorz,a=t.underline,s=t.stroke,u=t.height,l=t.width,h=t.highlightColor,d=t.x,f=t.y,p=t.content,v=t.fillLineHeight,g=t.fill,m=!1!==this.json.needFill;if(g&&g.fill&&"solidFill"!==g.fill.fillType&&(m=!0),h){var y=new Nd,_=c(Yv(h),2),b=_[0],x=_[1];y.beginFill(b,x),y.drawRect(0,0,o?l:r,o?n:u),y.endFill(),this.textureContainer.addChild(y)}if(this.textGraphics.displayObject){var w=this.textGraphics.displayObject;if(o&&(w.position.y=f>0?f:0),m){var S=this.textFill.displayObject;if(S)S.mask=w,S.addChild(w),S.position.x=-d,w.position.x+=d,e=!0,this.textureContainer.addChild(S);else if(this.textFill.isSolidFill()){var T=new Qv;T.color=this.textFill.getSolidFillColor(),w.filters=[T],e=!0,this.textureContainer.addChild(w)}}else this.textureContainer.addChild(w)}if(this.strokeGraphics.displayObject){var M=this.strokeGraphics.displayObject;if(m){var k=this.strokeFill.displayObject;if(k)k.mask=M,k.addChild(M),o?k.position.y=f>0?f:0:k.position.x=d,this.textureContainer.addChild(k);else if(this.strokeFill.isSolidFill()){o?M.position.y=Math.max(f,0):M.position.x=d;var E=new Qv;E.color=this.strokeFill.getSolidFillColor(),M.filters=[E],e=!0,this.textureContainer.addChild(M)}}else o?M.position.y=f>0?f:0:M.position.x=d,this.textureContainer.addChild(M);var A=s&&g?(s.width-(null==g?void 0:g.width))/4:0;M.position.x-=A}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=a?a-n/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);var I=this.textFill.getClonedDisplayObject();I?(I.mask=this.underline.sprite,I.addChild(this.underline.sprite),this.textureContainer.addChild(I)):this.textureContainer.addChild(this.underline.sprite)}if(e){var C=$l.p.create({width:o?l:r,height:o?Math.max(v,n):u,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:C}),this.cacheSprite.texture=C,o&&f<0&&(this.cacheSprite.position.y=f),this.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.addChild(this.textureContainer);this.container.name=p}},{key:"destroy",value:function(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}]),r}(rg),dm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},fm=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n,i)).units=[],o.isHorz=!0,o.hyperLinkMap=new Map,o.hyperLinkContainerMap=new Map,o.effectList=[],i.effectList&&(o.effectList=i.effectList),o}return S(r,[{key:"getIterateElements",value:function(){return this.units}},{key:"getIterateEntry",value:function(e,t,r){return this.units[t]?this.units[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createUnits",value:function(e,t,r,n){for(var i=this,o=function(o,a){n.addSubMTask((function(){return dm(i,void 0,void 0,regeneratorRuntime.mark((function n(){var i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.textUnits[o],a=this.json,s=a.height,u=a.width,l=a.fillHeight,c=a.baseline,h=a.y,d=a.underline,(f=new hm(Object.assign(Object.assign({},i),{lineHeight:s,lineWidth:u,baseLine:c-h,underline:d,fillLineHeight:l||s,isHorz:this.isHorz,shapeId:e,paragraphIndex:t,lineIndex:r,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).preRender(),this.units.push(f),(i.hyperlink||i.hlinkHover)&&(p=new jv(f.container,this.ctx),i.hyperlink&&p.addAction(i.hyperlink,"click"),i.hlinkHover&&p.addAction(i.hlinkHover,"hover"),this.container.sortableChildren=!0);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextLineImpl[createUnits]")},a=0,s=this.json.textUnits.length;a0)return this.iterateElements;var e=this.lines.reduce((function(e,t){return e.concat(t.getIterateElements())}),[]);return this.iterateElements=e,e}},{key:"getIterateEntry",value:function(e,t,r){var n=this.getIterateElements();return n[t]?n[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createLines",value:function(e,t,r){for(var n=this,i=function(i,o){r.addSubMTask((function(){return pm(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=this.json.lines[i],(a=new fm(o,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).isHorz=this.isHorz,a.container.name="line-"+i,a.createUnits(e,t,i,r),this.lines.push(a);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextParagraphImpl[createLines]")},o=0,a=this.json.lines.length;o90&&o<270||o<-90&&o>-270)&&(n=-n),i=-a*n}return{x:n,y:i}}((i=-i)/Math.PI*180,r,n),s=e.x-a.x,u=e.y-a.y;return{centerX:s/9525*t.x,centerY:u/9525*t.y,rx:r/9525*t.x,ry:n/9525*t.y,st:-i,end:-i+o,aClockWise:o<0}}function mm(e){for(var t=new os,r=e.scale,n={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=bm(s.paths[0].path,this.json.width,this.json.height,i,o),s.paths.unshift(Object.assign(Object.assign({},s.paths[0]),{path:d}))),f=function(e,t,r,n){if(!_m[r])return null;var i=_m[r].top(mm(t)),o=_m[r].bottom(mm(e));if(i.length!==o.length)return null;for(var a=Math.min(i.length,o.length),s=1/(a-1),u=[],l=[],c=new Array(2*a).fill("").map((function(e,t){return t})),h=0;h0&&(this.textColorFilter.color=e)},get:function(){return this.textColorFilter.color}},{key:"on",get:function(){var e;return(null!==(e=this.container.filters)&&void 0!==e?e:[]).length>0?"true":"false"},set:function(e){var t;"true"===e?(null!==(t=this.container.filters)&&void 0!==t?t:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}}]),e}(),Sm=function(){function e(t){x(this,e),this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}return S(e,[{key:"setPivot",value:function(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;default:this.pivot={x:this.width,y:this.height/2}}}},{key:"generatePaths",value:function(){this.hash="arrow-"+xv()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}},{key:"getUnitPath",value:function(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}},{key:"setScaleFromLineWidth",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}},{key:"setScaleFromSize",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}]),e}(),Tm=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.id=t,this.ctx=r,this.paths=n,this.hash=i,this.nept=o,this.width=a,this.height=s,this.lineStyle=u,this.shouldFill=l,this.bgColor=c,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}return S(e,[{key:"pointDis",value:function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}},{key:"isPoint",value:function(e){return Number.isNaN(Number(e.x))||Number.isNaN(Number(e.y))}},{key:"isSquare",value:function(e,t){var r=this;if("MLLLC"!==e.join("")&&"MLLLCC"!==e.join(""))return!1;var n=t.filter((function(e){return!r.isPoint(e)}));if(4!==n.length)return!1;var i,o=Math.min.apply(Math,a(n.map((function(e){return e.x})))),s=Math.min.apply(Math,a(n.map((function(e){return e.y})))),u=Math.max.apply(Math,a(n.map((function(e){return e.x})))),l=Math.max.apply(Math,a(n.map((function(e){return e.y})))),c=M(n);try{for(c.s();!(i=c.n()).done;){var h=i.value;if(h.x!==o&&h.x!==u||h.y!==s&&h.y!==l)return!1}}catch(e){c.e(e)}finally{c.f()}return!0}},{key:"rectangleDetect",value:function(e){if(1!==e.length)return!1;var t=e[0].path.trim().split(" ");if(10!==t.length)return!1;for(var r=[],n=[],i=0;ir&&(r=o.pivot.x),o.pivot.y>n&&(n=o.pivot.y)}}catch(e){i.e(e)}finally{i.f()}var a=new jl.d;if(a.translate(r,n),0===this.effectContainer.children.length)return null;var s=$l.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:s,transform:a}),{texture:s,offsetX:r,offsetY:n}}},{key:"createStrokeGraphics",value:function(){var e,t,r,n,i=this.json,o=i.id,a=i.geometry,s=i.lineStyle,u=(null==a?void 0:a.lineTransform)||km,l=u.width,c=u.height,h=u.pivot,d=l||this.json.width,f=c||this.json.height,p="solidFill"===(null===(e=null==s?void 0:s.fill)||void 0===e?void 0:e.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(t=s.fill)||void 0===t?void 0:t.fillType)?new Tm(o+"-path-graphics",this.ctx,null!==(r=null==a?void 0:a.paths)&&void 0!==r?r:[],null!==(n=null==a?void 0:a.hash)&&void 0!==n?n:"",h||{x:0,y:0},d,f,s,!1,null,p):null}},{key:"createStrokeFill",value:function(){var e=c(this.calculateFillObjectOffset(),2),t=e[0],r=e[1],n=this.json,i=n.geometry,o=n.lineStyle,a=n.width,s=n.height,u=(null==i?void 0:i.lineTransform)||km,l=Sv()(null==o?void 0:o.width)?o.width:1;return new zg(this.ctx,null==o?void 0:o.fill,(u.width||a)+l+t,Math.max((u.height||s)+l,r),{useFilter:!0,useSlideBackgroundFill:!1})}},{key:"createBackgroundGraphics",value:function(){var e,t=this.json,r=t.geometry,n=t.lineStyle,i=t.fillStyle,o=t.id,a=(null==r?void 0:r.lineTransform)||km,s=a.width,u=a.height,l=a.pivot,c=s||this.json.width,h=u||this.json.height,d="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new Tm(o+"-bg-graphics",this.ctx,null!==(e=null==r?void 0:r.paths)&&void 0!==e?e:[],(null==r?void 0:r.hash)||"",l||{x:0,y:0},c,h,n,!0,d,null):null}},{key:"createBackgroundFill",value:function(){var e,t,r,n,i=this.json,o=i.fillStyle,a=i.width,s=i.height,u=i.lineStyle,l=i.geometry,c=(null==l?void 0:l.fillTransform)||km,h={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},d=this.useGroupFill&&(null===(e=this.option.groupSize)||void 0===e?void 0:e.w)?this.option.groupSize.w:c.width||a,f=this.useGroupFill&&(null===(t=this.option.groupSize)||void 0===t?void 0:t.h)?this.option.groupSize.h:c.height||s;return new zg(this.ctx,o,d+(null!==(r=null==u?void 0:u.width)&&void 0!==r?r:0),f+(null!==(n=null==u?void 0:u.width)&&void 0!==n?n:0),h)}},{key:"createBackground",value:function(){var e,t,r,n,i,o,a,s,u,l,c,h,d=(null===(e=this.json.geometry)||void 0===e?void 0:e.fillTransform)||km,f=d.pivot,p=d.width,v=d.height,g=this.backgroundFill.displayObject;g?(this.json.useBgFill&&(null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)?(this.needCacheAsBitMap=!0,g.mask=this.backgroundGraphics.displayObject,g.pivot.x=(null===(n=this.json.position)||void 0===n?void 0:n.x)||0,g.pivot.y=(null===(i=this.json.position)||void 0===i?void 0:i.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(g.height=v||this.designHeight,g.width=p||this.designWidth,g instanceof jp&&g.play(),(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(g.width,g.height))&&(g.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(g.width,g.height))&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,g.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(g.x=f.x,g.y=f.y),this.useGroupFill&&(g.x-=null!==(l=null===(u=this.json.position)||void 0===u?void 0:u.x)&&void 0!==l?l:0,g.y-=null!==(h=null===(c=this.json.position)||void 0===c?void 0:c.y)&&void 0!==h?h:0),this.effectContainer.addChild(g)):this.backgroundFill.hasFill&&(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}},{key:"createPathFill",value:function(){var e,t,r,n=this.strokeFill.displayObject,i=null===(e=this.strokeGraphics)||void 0===e?void 0:e.displayObject,o=c(this.calculateFillObjectOffset(),2),a=o[0],s=o[1];n?((null===(t=this.strokeGraphics)||void 0===t?void 0:t.isNeedMask(n.width,n.height))&&i&&(this.needCacheAsBitMap=!0,n.pivot.x=i.pivot.x,n.pivot.y=i.pivot.y,i.pivot.x=0,i.pivot.y=0,n.mask=i,n.addChild(i),n.position.x=-a/2,n.position.y=-s/2,i.position.x=a/2,i.position.y=s/2),this.effectContainer.addChild(n)):this.strokeFill.hasFill&&(null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}},{key:"createFilledPathMask",value:function(){var e,t,r,n,i=(null===(t=null===(e=this.json.geometry)||void 0===e?void 0:e.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],o=M(i);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.ctx.graphicsTexture.getGraphicsData(a.id);if(s){var u=new Ld(s.texture);u.pivot.x=s.pivot.x,u.pivot.y=s.pivot.y,u.scale.x=s.scale,u.scale.y=s.scale;var l=this.backgroundFill.getClonedDisplayObject(),c=null===(r=this.backgroundGraphics)||void 0===r?void 0:r.getClonedDisplayObject(),h=l||c;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=u,h.filters=[tg[a.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(h),this.effectContainer.addChild(u))}}}catch(e){o.e(e)}finally{o.f()}}},{key:"createArrow",value:function(){var e=this;this.arrowList.length&&this.arrowList.forEach((function(t){var r,n=e.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(n){var i=n.texture,o=new Ld(i);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,o.scale.x=n.scale,o.scale.y=n.scale,null===(r=e.backgroundGraphics)||void 0===r||r.addArrows(o)}}))}},{key:"generateArrowList",value:function(){var e,t,r=this,n=this.json,i=n.lineArrowList,o=n.lineStyle,a=n.id,s="solidFill"===(null===(e=null==o?void 0:o.fill)||void 0===e?void 0:e.fillType)?o.fill.color:null;null===(t=i||[])||void 0===t||t.forEach((function(e,t){var n,i,u,l,c,h,d,f,p=new Sm(Object.assign(Object.assign({},e),{position:{x:e.position.x-(null!==(u=null===(i=null===(n=r.json.geometry)||void 0===n?void 0:n.lineTransform)||void 0===i?void 0:i.pivot.x)&&void 0!==u?u:0),y:e.position.y-(null!==(h=null===(c=null===(l=r.json.geometry)||void 0===l?void 0:l.lineTransform)||void 0===c?void 0:c.pivot.y)&&void 0!==h?h:0)},fillStyle:null==o?void 0:o.fill,lineWidth:null!==(d=null==o?void 0:o.width)&&void 0!==d?d:0}));p.graphicsId="".concat(a,"-arrow-").concat(t,"-graphics"),p.textureId="".concat(a,"-arrow-").concat(t,"-fill"),r.ctx.graphicsTexture.addGraphics(p.graphicsId,null!==(f=p.paths)&&void 0!==f?f:[],p.hash,{x:0,y:0},p.width,p.height,void 0,r.ctx.objectPoolGroup,!0,s,null),r.arrowList.push(p)}))}},{key:"calculateFillObjectOffset",value:function(){var e=0,t=0;return this.arrowList.length&&(e=this.arrowList.reduce((function(e,t){return Math.max(e,t.width)}),0),t=this.arrowList.reduce((function(e,t){return Math.max(e,t.height)}),0)),[e,t]}},{key:"preRender",value:function(e){var t,r,n,i=this,o=this.json,a=o.lineStyle,s=o.geometry,u=(null==s?void 0:s.lineTransform)||km,l=u.width,c=u.height,h=l||this.json.width,d=c||this.json.height,f=(null===(t=null==s?void 0:s.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],p="solidFill"===(null===(r=null==a?void 0:a.fill)||void 0===r?void 0:r.fillType)?a.fill.color:null;e.addSubMTask((function(){return Mm(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=M(f);try{for(t.s();!(r=t.n()).done;)n=r.value,this.ctx.graphicsTexture.addGraphics(n.id,[n],n.hash,((null==s?void 0:s.lineTransform)||km).pivot,h,d,a,this.ctx.objectPoolGroup,!0,null,p)}catch(e){t.e(e)}finally{t.f()}case 2:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[addGraphics]"),null===(n=this.text)||void 0===n||n.createParagraphs(this.json.id,e)}},{key:"subClassRender",value:function(){return Mm(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return Mm(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(r=this.backgroundGraphics)||void 0===r||r.render(),this.createBackground(),e.next=5,this.subClassRender();case 5:this.createFilledPathMask(),this.createPathFill(),this.createArrow();case 8:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[render]"),this.text&&this.text.render(e),e.addSubMTask((function(){return Mm(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M,k,E,A,I=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(r=this.json.textBody)||void 0===r?void 0:r.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(p=null!==(n=this.json.scale)&&void 0!==n?n:{x:1,y:1},v=p.x,g=p.y,this.text.container.scale.x=g<0?-Math.abs(v):Math.abs(v),this.text.container.scale.y=g,this.text.container.position.x=(null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0)+this.text.x,this.text.container.position.y=(null!==(s=null===(a=this.json.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container))):(this.text&&(this.json.textRotation&&(this.text.container.rotation=this.json.textRotation,m=this.text,y=m.width,_=m.height,b=this.text.container.position,x=b.x,w=b.y,this.text.container.pivot.x=y/2,this.text.container.pivot.y=_/2,this.text.container.x=x+y/2,this.text.container.y=w+_/2),Gv()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape&&(S=this.json.rotation||0,this.text.container.rotation=-S,T=this.text.width,this.text.container.position.x=T),this.text.container.zIndex=100,M=null===(u=this.json.effectList)||void 0===u?void 0:u.find((function(e){return"outerShadow"===e.type})),k=null===(l=this.json.effectList)||void 0===l?void 0:l.find((function(e){return"softEdge"===e.type})),E=null===(c=this.json.effectList)||void 0===c?void 0:c.find((function(e){return"glow"===e.type})),M&&1!==M.sx||k||E?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)),this.renderContainer.addChild(this.container)),"background"===this.json.id&&this.ctx.hasBackgroundFillShape&&(A=$l.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)}),this.ctx.renderer.render(this.renderContainer,{renderTexture:A}),this.ctx.bgTexture=A),this.json.effectList&&this.json.effectList.length>0&&(null===(h=this.ctx.featureList)||void 0===h?void 0:h.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new lm(this.effectContainer,this.json.effectList,"".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(this.json.id),this.ctx,this.json.rotation||0,new jl.g((null===(d=this.json.scale)||void 0===d?void 0:d.x)||1,(null===(f=this.json.scale)||void 0===f?void 0:f.y)||1)),function(e){var t,r,n;return"gifFill"===(null===(t=e.fillStyle)||void 0===t?void 0:t.fillType)||"gifFill"===(null===(n=null===(r=e.lineStyle)||void 0===r?void 0:r.fill)||void 0===n?void 0:n.fillType)||!!e.picFill&&"gifFill"===e.picFill.fillType}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",(function(){var e;I.effectContainer.visible=!1,I.effectObject.container.zIndex=10,I.container.addChild(I.effectObject.container),null===(e=I.effectObject)||void 0===e||e.updateFrame(1),I.applyEffectCacheAsBitMap(!0)})));case 3:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r;"gifFill"!==(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)&&(null===(r=this.effectObject)||void 0===r||r.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)})))}},{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"destroy",value:function(){var e,t,r,n;null===(e=this.text)||void 0===e||e.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(t=this.backgroundGraphics)||void 0===t||t.destroy(),this.strokeFill.destroy(),null===(r=this.strokeGraphics)||void 0===r||r.destroy(),this.renderContainer.destroy(),null===(n=this.arrowRenderTexture)||void 0===n||n.destroy(!0),this.arrowList=[],this.effectDisposer()}},{key:"interactiveContainer",get:function(){return this.renderContainer}},{key:"strokeActive",get:function(){var e,t,r,n,i,o,a;return this.strokeFill.displayObject?(null!==(r=null===(t=null===(e=this.strokeFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a,s=this.strokeFill.displayObject;e?s&&(null!==(r=null===(t=s.filters)||void 0===t?void 0:t.indexOf(this.strokeColorFilter))&&void 0!==r?r:-1)<0?s.filters=[this.strokeColorFilter]:(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.strokeGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):s?s.filters=[]:(null===(a=this.strokeGraphics)||void 0===a?void 0:a.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}},{key:"pptColorActive",get:function(){var e,t;return(null!==(t=null===(e=this.renderContainer.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){this.renderContainer.filters=e?[this.pptColorFilter]:[]}},{key:"fillActive",get:function(){var e,t,r,n,i,o,a;return this.backgroundFill.displayObject?(null!==(r=null===(t=null===(e=this.backgroundFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a;e?this.backgroundFill.displayObject&&(null!==(r=null===(t=this.backgroundFill.displayObject.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.backgroundGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}}]),r}(Uv),Am=r(119),Im=new(r.n(Am).a),Cm=Im.getDevice(),Pm=Im.getBrowser(),Nm=Im.getOS(),Om={isDesktop:function(){var e=!0;return"mobile"===Cm.type&&(e=!1),/Samsung/.test(Pm.name||"")&&(e=!1),window.__nativeTags&&window.__nativeTags.platform&&(e=!1),e},isIOS:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(e=!0),Nm.name&&/iOS/.test(Nm.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),Nm.name&&/android/i.test(Nm.name)&&(e=!0),e},isLowGpuMemory:function(){var e,t,r=null!==(t=null===(e=window.__nativeTags)||void 0===e?void 0:e.platform)&&void 0!==t?t:"";if(r){var n=r.split(" ");if(n[1]){if(/^iPad/.test(n[1])){var i=n[1].match(/^iPad(\d+)/);return!(i&&i[1]&&parseInt(i[1],10)>=6)}if(/^iPhone/.test(n[1])){var o=n[1].match(/^iPhone(\d+)/);return!(o&&o[1]&&parseInt(o[1],10)>=9)}return!1}return!1}return!0}},Rm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function Dm(e,t){for(var r in t)e.style[r]=t[r]}var Lm="median-container",jm=1500,zm=300,Bm=50,Fm="0",Um="1",Wm=.4,Gm=function(){function e(t){var r,n,i=this;x(this,e),this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.fadeState={in:!1,out:!1},this.changeMediaProgress=function(e){if(i.ctx.isPlayerPaused())i.ctx.logger.info("Media controller prevent seek event with paused state",i.ctx.taskId);else{e.stopPropagation();var t=e.offsetX/i.progress.clientWidth*i.duration;i.medianIsEnd=!1,"interactive"!==i.ctx.mode&&i.jumpToTime(t),"local"!==i.ctx.mode&&i.ctx.eventHub.emit(__.mediaSeek,{id:i.targetId,time:t,isPlaying:i.media.isPlaying}),i.delayHide()}},this.jumpToTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Rm(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,dv((function(){return!!n.duration}),3e3);case 2:r=Math.floor(e)+this.start,this.media.currentTime!==r&&(this.media.currentTime=r,this.changeBookmarkIndex(r,r>this.media.currentTime));case 4:case"end":return t.stop()}}),t,this)})))},this.showController=function(e){e.stopPropagation(),i.show()},this.getMediaDuration=function(){i.duration&&!Number.isNaN(i.duration)||(i.duration=i.media.duration,i.start&&(i.duration-=i.start,i.jumpToTime()),i.end&&(i.duration-=i.end)),i.totalTime.innerText=e.formatTime(i.duration)},this.playMedia=function(){return Rm(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="none",this.pauseButton.style.display="block",e.next=4,this.media.play();case 4:this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach((function(e){e()})),this.delayHide();case 7:case"end":return e.stop()}}),e,this)})))},this.pauseMedia=function(){return Rm(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="block",this.pauseButton.style.display="none",e.next=4,this.media.pause();case 4:case"end":return e.stop()}}),e,this)})))},this.onMouseOut=function(e){e.stopPropagation(),i.hide()},this.mediaTimeUpdate=function(){return Rm(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.media.currentTime-this.start,t.t0=this.duration>0&&(Math.abs(r-this.duration)<.3||r>this.duration),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(__.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle();case 9:if(this.currentTime.innerText=e.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!(this.bookmarkList&&this.bookmarkList.length>0)){t.next=14;break}(n=this.bookmarkList[this.pickBookmarkIndex])&&n.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit("shape ".concat(this.shapeId," onMediaBookmark ").concat(n.name)),this.pickBookmarkIndex+=1);case 14:this.fadeHit(r);case 15:case"end":return t.stop()}}),t,this)})))},this.onPauseMedia=function(){i.playButton.style.display="block",i.pauseButton.style.display="none"},this.onPlayMedia=function(){i.fadeState={in:!1,out:!1},i.fadeHit(0),i.playButton.style.display="none",i.pauseButton.style.display="block",i.playCallBackList.forEach((function(e){e()})),i.media.currentTime0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","polyline");return n.setAttributeNS(null,"points","35 0, 477 256, 35 512"),n.setAttributeNS(null,"fill","#000000"),r.appendChild(n),r}},{key:"generatePauseButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dm(r,{height:e+"px"}),r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttributeNS(null,"x","35"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width","148"),n.setAttributeNS(null,"height","512");var i=n.cloneNode(!0);return i.setAttributeNS(null,"x","330"),r.append(n,i),r}},{key:"generateFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dm(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),r.appendChild(n),document.body.appendChild(r),r}},{key:"generateExitFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dm(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),i.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),r.appendChild(n),r.appendChild(i),document.body.appendChild(r),r}},{key:"createButton",value:function(){var e={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};Dm(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Dm(t,{height:"20px"}),this.playButton.appendChild(t),Dm(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var r=this.generatePauseButton();if(Dm(r,{height:"20px"}),this.pauseButton.appendChild(r),this.isVideo){var n=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(n),Dm(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Dm(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Dm(e,{width:"100px"}),this.currentTime.innerText="00:00";var t=document.createElement("span");return t.innerText="/",e.append(this.currentTime,t,this.totalTime),e}},{key:"createProgress",value:function(){var e={flex:"1",position:"relative"};this.isVideo||(e.marginRight="10px"),Dm(this.progress,e);var t=document.createElement("div");Dm(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Dm(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}},{key:"fadeHit",value:function(e){if(this.info.fade){var t=this.info.fade,r=t.start,n=t.end;r&&!this.fadeState.in&&e>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,r)),n&&!this.fadeState.out&&e>=this.duration-n/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,n))}}},{key:"changeBookmarkIndex",value:function(e,t){if(this.bookmarkList&&0!==this.bookmarkList.length){if(this.pickBookmarkIndex>0)for(var r=0;re){this.pickBookmarkIndex=r;break}if(t){for(var n=this.pickBookmarkIndex-1,i=0;il?l/r:1);s.y=s.y+this.height-n,s.x=Math.max(s.x,0),s.x=Math.min(s.x,o-r*c),s.y=Math.max(s.y,0),s.y=Math.min(s.y,a-n),Dm(this.mediaController,{height:n+"px",borderRadius:n/2+"px",width:r+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:s.x+"px",top:s.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:"scale(".concat(c,")"),transformOrigin:"0 100%"}),this.fullscreenStatus&&Dm(this.mediaController,{left:"0",top:a-n+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Dm(this.mediaController,{display:"none",transition:"opacity ".concat(Wm,"s")}),this.createButton();var e=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,e,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}},{key:"addPlayCallBack",value:function(e){this.playCallBackList.push(e)}},{key:"fullscreenPlay",value:function(){this.fullscreenStatus=!0,"interactive"!==this.ctx.mode&&this.media.requestFullscreen(),"local"!==this.ctx.mode&&this.ctx.eventHub.emit(__.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}},{key:"changeFullScreenState",value:function(e,t,r){r===this.ctx.slideIndex&&(e&&this.targetId===t?this.fullscreenStatus=e:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}},{key:"bindEvent",value:function(){Om.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this._pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"unbindEvent",value:function(){var e;Om.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),null===(e=this.containerObserver)||void 0===e||e.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"show",value:function(){this.setControllerPosition(),this.mediaController.style.opacity=Um,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}},{key:"hide",value:function(){this.fullscreenStatus?this.mediaController.style.opacity=Fm:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),jm)}},{key:"destroy",value:function(){var e;this.unbindEvent(),this.playCallBackList=[],null===(e=this.container)||void 0===e||e.removeChild(this.mediaController)}},{key:"clippedDuration",get:function(){return this.duration}}],[{key:"formatTime",value:function(e){var t="00:00";if(e){var r=Math.floor(e/60),n=String(r<0?0:r).padStart(2,"0"),i=Math.floor(e%60);t="".concat(n,":").concat(String(i<0?0:i).padStart(2,"0"))}return t}}]),e}(),Vm=r(120),Hm=function(e){p(r,e);var t=g(r);function r(e,n,i){var o,a,s,u;return x(this,r),(a=t.call(this)).isGlobalPause=!1,a.lastTime=-1,a.howl=null,a.rctClient=null,a.isHowlEnd=!1,a.isHowlLoadEmit=!1,a.staticEventId=1001,a._catParams=void 0,a.url=e,a.runningAudio=n,i&&(a._catParams=i),b_.RtcAudioClazz?(a.rctClient=new b_.RtcAudioClazz(e,null===(s=a._catParams)||void 0===s?void 0:s.start,null===(u=a._catParams)||void 0===u?void 0:u.end),a.rctClient.on("load",(function(){return a.emit("load")})),a.rctClient.on("pause",(function(){return a.emit("pause")})),a.rctClient.on("play",(function(){a.startTimeChangeEmit(),a.emit("play")})),a.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){a.emit("resumeAllAudioInterruptByAudioSessionChanged")}))):(a.howl=new Vm.Howl({src:[e]}),o=c(a.howl._getSoundIds(),1),a.staticEventId=o[0],a.howl.load(),a.howl.on("load",(function(){a.isHowlLoadEmit=!0,a.emit("load")})),a.howl.on("pause",(function(){return a.emit("pause")})),a.howl.on("play",(function(){a.isHowlLoadEmit||a.emit("load"),a.isHowlEnd=!1,a.startTimeChangeEmit(),a.emit("play")})),a.howl.on("end",(function(){a.isHowlEnd=!0}))),a}return S(r,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout((function(){e.isPaused||e.startTimeChangeEmit()}),300)}},{key:"play",value:function(){var e,t,r;this.runningAudio.has(this.url)&&(null===(e=this.runningAudio.get(this.url))||void 0===e||e.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(this.staticEventId),null===(r=this.rctClient)||void 0===r||r.play(),this.runningAudio.set(this.url,this)}},{key:"fade",value:function(e,t,r){this.howl&&this.howl.fade(e,t,r)}},{key:"pause",value:function(){var e,t;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),null===(t=this.rctClient)||void 0===t||t.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"globalPause",value:function(){this.isPaused||(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"stop",value:function(){var e;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"destroy",value:function(){var e,t,r,n,i,o,a,s;null===(e=this.howl)||void 0===e||e.stop(this.staticEventId),null===(t=this.howl)||void 0===t||t.unload(),null===(r=this.rctClient)||void 0===r||r.pause(),null===(n=this.rctClient)||void 0===n||n.destroy(),null===(i=this.rctClient)||void 0===i||i.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(a=this.rctClient)||void 0===a||a.removeAllListeners("pause"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"volume",value:function(e){this.rctClient?this.rctClient.volume(e):this.howl&&this.howl.volume(e)}},{key:"currentTime",get:function(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek(this.staticEventId):-1},set:function(e){this.rctClient?this.rctClient.currentTime=e:this.howl&&this.howl.seek(e,this.staticEventId)}},{key:"duration",get:function(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration(this.staticEventId):0}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&!this.howl.playing(this.staticEventId)}}]),r}(Ks.a),Ym=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},$m=function(e){p(r,e);var t=g(r);function r(e){var n,i,o,a,s,u,l,c;x(this,r),(n=t.call(this)).type="video",n.sprite=new Ld,n.isPlaying=!1,n.isGlobalPause=!1,n.fullscreen=!1,n.url="",n.isLoaded=!1,n.onVideoResourceLoaded=function(){n.isLoaded=!0},n.onVideoStalled=function(){n.ctx.logger.warn(n.url+", Failed to fetch data, but trying.",n.ctx.taskId)},n.updateVolume=function(e){n.rtcAudio.volume(e)},n.syncFullscreenVideoState=function(e){var t=e.targetId,r=e.state;e.slideIndex===n.ctx.slideIndex&&t===n.id&&(r?(n.requestFullscreen(),n.ctx.latestChangeFullscreenTargetId=t):n.requestCancelFullscreen())},n.id=e.id,n.start=null===(i=e.video.cut)||void 0===i?void 0:i.start,n.end=null===(o=e.video.cut)||void 0===o?void 0:o.end,n.fullscreen=null!==(a=e.video.fullscreen)&&void 0!==a&&a,n.container=e.container,n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var h=e.video.src;n.videoResource=new $l.w(h,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),null===(s=n.videoElement)||void 0===s||s.addEventListener("stalled",n.onVideoStalled),null===(u=n.videoElement)||void 0===u||u.addEventListener("loadedmetadata",n.onVideoResourceLoaded),n.url=e.video.src;var d=e.video.src.replace(/4$/,"3");n.ctx.loaderDelegate&&(d=n.ctx.loaderDelegate.redirectMedia(d),n.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(d," by delegate."),e.ctx.taskId)),n.rtcAudio=new Hm(d,e.ctx.runningAudio,{start:null===(l=e.video.cut)||void 0===l?void 0:l.start,end:null===(c=e.video.cut)||void 0===c?void 0:c.end}),n.rtcAudio.on("timeupdate",(function(e){if(n.videoElement){var t=n.videoElement.currentTime;Math.abs(t-e)>.5&&(n.videoElement.currentTime=e)}})),n.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){var e;null===(e=n.videoElement)||void 0===e||e.pause(),setTimeout((function(){var e;n.rtcAudio.isPaused||null===(e=n.videoElement)||void 0===e||e.play()}),200)}));var f=e.video,p=e.width,v=e.height,g=e.target;n.controller=new Gm({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:p,height:v,target:g,media:y(n),info:f,canvasElement:e.canvasElement}),n.controller.addPlayCallBack((function(){n.sprite.width=p,n.sprite.height=v,n.ctx.clock.setTimeout((function(){n.sprite.visible=!0}),50)}));var m=new $l.c(null,{height:v,width:p});return m.resource=n.videoResource,n.videoResource.bind(m),n.sprite=new Ld,n.sprite.visible=!1,n.sprite.texture=new $l.t(m),n.sprite.interactive=!0,n.container.addChild(n.sprite),n.sprite.on("mouseover",(function(e){e.stopPropagation(),n.controller.show()})),n.sprite.on("mouseout",(function(e){e.stopPropagation(),n.controller.hide()})),["durationchange","timeupdate","pause","play"].forEach((function(e){var t;null===(t=n.videoElement)||void 0===t||t.addEventListener(e,(function(){"timeupdate"===e&&n.isPlaying,n.emit(e)}))})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n.ctx.globalEventHub.on("syncFullscreenVideoState",n.syncFullscreenVideoState),n}return S(r,[{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return Ym(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),e.next=4,this.load();case 4:return e.next=6,this.ctx.clock.waitUntil((function(){var e=r.videoElement;return!!(e&&e.videoWidth>0)}),3e3);case 6:(t=this.videoElement)&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.on("play",(function(){var e;null===(e=r.videoElement)||void 0===e||e.play(),r.fullscreen&&r.controller.fullscreenPlay()})),this.rtcAudio.play());case 8:case"end":return e.stop()}}),e,this)})))}},{key:"load",value:function(){return this.videoResource.load()}},{key:"pause",value:function(){var e,t=this;this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.once("pause",(function(){var e;null===(e=t.videoElement)||void 0===e||e.pause()})),this.rtcAudio.pause(),null===(e=this.videoElement)||void 0===e||e.pause()}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Ym(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dv((function(){return r.isLoaded}),5e3);case 2:t=new $l.t(this.sprite.texture.baseTexture),this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"requestCancelFullscreen",value:function(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}},{key:"destroy",value:function(){var e,t,r;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),null===(e=this.videoElement)||void 0===e||e.removeEventListener("stalled",this.onVideoStalled),null===(t=this.videoElement)||void 0===t||t.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(r=this.videoResource)||void 0===r||r.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}},{key:"fadeIn",value:function(e,t){this.rtcAudio.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"videoElement",get:function(){return this.videoResource.source}},{key:"currentTime",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:0},set:function(e){this.rtcAudio.currentTime=e,this.videoElement&&(this.videoElement.currentTime=e)}},{key:"paused",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.paused)||void 0===t||t}},{key:"duration",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.duration)&&void 0!==t?t:0}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}}]),r}(Ks.a),Xm=function(e){p(r,e);var t=g(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).type="audio",n.isPlaying=!1,n.isGlobalPause=!1,n.updateVolume=function(e){n.audioPlayer.volume(e)},n.id=e.id;var a=e.audio.src;n.audioPlayer=new Hm(a,e.ctx.runningAudio,{start:null===(i=e.audio.cut)||void 0===i?void 0:i.start,end:null===(o=e.audio.cut)||void 0===o?void 0:o.end}),e.audio.cut&&(n.start=e.audio.cut.start,n.end=e.audio.cut.end),n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var s=e.width,u=e.height,l=e.target;return n.controller=new Gm({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:u,width:s,target:l,media:y(n),info:e.audio,canvasElement:e.canvasElement}),n.audioPlayer.on("load",(function(){return n.emit("durationchange")})),n.audioPlayer.on("timeupdate",(function(){return n.emit("timeupdate")})),n.audioPlayer.on("pause",(function(){return n.emit("pause")})),n.audioPlayer.on("play",(function(){return n.emit("play")})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n}return S(r,[{key:"load",value:function(){return Promise.resolve()}},{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){}},{key:"requestCancelFullscreen",value:function(){}},{key:"destroy",value:function(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}},{key:"fadeIn",value:function(e,t){this.audioPlayer.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"currentTime",get:function(){return this.audioPlayer.currentTime},set:function(e){this.audioPlayer.currentTime=e}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}},{key:"paused",get:function(){return this.audioPlayer.isPaused}},{key:"isPaused",get:function(){return this.audioPlayer.isPaused}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),r}(Ks.a),qm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Qm=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,Object.assign(Object.assign({},e),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),n,i)).isInteractiveOutside=!1,o.cmd=new Ov(y(o)),o.media=null==e?void 0:e.media,o.container.name=e.id+"_container_[Picture]",o.renderContainer.name=e.id+"_render_container_[Picture]",o.picFill=new zg(o.ctx,e.picFill,e.width,e.height,{useFilter:!0,useSlideBackgroundFill:!1}),o}return S(r,[{key:"applyCommand",value:function(e,t){var r,n,i,o;if("call"===t)if(/playFrom\(([0-9.]+)\)/.test(e)){var a=e.match(/playFrom\(([0-9.]+)\)/),s=Number(a[1]||"0");null===(r=this.mediaPlayer)||void 0===r||r.controller.playMediaFromCtrl(!0),Math.abs(s)>.1&&(null===(n=this.mediaPlayer)||void 0===n||n.controller.jumpToTime(s))}else"custom-pause"===e?null===(i=this.mediaPlayer)||void 0===i||i.controller.pauseMediaFromCtrl(!0):"togglePause"===e?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):"stop"===e&&(null===(o=this.mediaPlayer)||void 0===o||o.stop())}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r,n;"gifFill"===(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)||this.media&&"video"===this.media.type||"gifFill"===(null===(r=this.json.picFill)||void 0===r?void 0:r.fillType)||null===(n=this.effectObject)||void 0===n||n.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)}))}},{key:"renderPic",value:function(){var e,t,r,n,i,o;return qm(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,l,c,h,d=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(s=this.picFill.displayObject)){a.next=15;break}if(s.name=this.json.id+"_pic_fill_[Picture]",u=null===(e=this.backgroundGraphics)||void 0===e?void 0:e.getClonedDisplayObject(),(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.isNeedMask(s.width,s.height))&&u&&(s.mask=u,this.effectContainer.addChild(u)),s.width=this.designWidth,s.height=this.designHeight,s instanceof jp&&this.ctx.slideScopeEventHub.once("slide-render",(function(e){var t;d.ctx.slideIndex===e&&(null===(t=d.effectObject)||void 0===t||t.setFrameCount(s.totalFrames),s.play(),s.onFrameChange=function(e){if(d.effectObject)if(d.effectObject.hasFrame(e))d.effectObject.updateFrame(e);else{var t=d.getEffectTexture();t&&(d.effectObject.createFrame(e,t.texture),d.effectObject.setFrameOffset(t.offsetX,t.offsetY))}})})),this.effectContainer.addChild(s),!this.media){a.next=13;break}if(l=this.media.src,"audio"===this.media.type&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),!this.ctx.urlInterrupter){a.next=12;break}return c=Date.now(),a.next=10,this.ctx.urlInterrupter(l);case 10:l=a.sent,this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-c),this.ctx.taskId);case 12:this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info("redirect media url to ".concat(l," by delegate."),this.ctx.taskId)),this.media.src=l;case 13:"video"===(null===(r=this.media)||void 0===r?void 0:r.type)&&this.media.src?(this.mediaPlayer=new $m({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.effectContainer,canvasElement:this.ctx.view}),(null===(n=this.mediaPlayer)||void 0===n?void 0:n.sprite)&&u&&(h=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.getClonedDisplayObject())&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))):"audio"===(null===(o=this.media)||void 0===o?void 0:o.type)&&this.media.src&&(this.mediaPlayer=new Xm({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view,fade:this.media.fade})),this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,Om.isDesktop()?(this.container.on("mouseover",(function(){d.mediaPlayer.showController()})),this.container.on("mouseout",(function(){d.mediaPlayer.hideController()}),!1)):this.container.on("pointerdown",(function(){d.mediaPlayer.showController()})));case 15:case"end":return a.stop()}}),a,this)})))}},{key:"preRender",value:function(e){f(b(r.prototype),"preRender",this).call(this,e)}},{key:"subClassRender",value:function(){return qm(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.renderPic();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"clearOnSlideChange",value:function(){f(b(r.prototype),"clearOnSlideChange",this).call(this),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}},{key:"initOnReuse",value:function(){f(b(r.prototype),"initOnReuse",this).call(this),this.mediaPlayer&&(this.container.interactive=!0)}},{key:"destroy",value:function(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}]),r}(Em),Zm=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Km=function(e){p(r,e);var t=g(r);function r(e,n,i,o){var a;return x(this,r),(a=t.call(this,e,n,i)).children=[],a.cacheSprite=new Ld,a.cacheContainer=new Dl.b,a.json=e,a.json.fillStyle&&"groupFill"===a.json.fillStyle.fillType&&i.groupFillStyle&&(a.json.fillStyle=i.groupFillStyle),a.container.name=e.id+"_container_[Container]",a.cacheContainer.name=e.id+"_cache_container_[Container]",a.ctx.timingTargets.addTarget(e.id,y(a)),a.updateTransform(a.json),a.fillObject=new zg(a.ctx,e.fillStyle,e.width,e.height,{useFilter:!1,useSlideBackgroundFill:!1}),a.createChildren(o),a}return S(r,[{key:"createChildren",value:function(e){for(var t,n,i,o,a=this,s={x:null!==(n=null===(t=this.json.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},u=function(t,n){e.addSubMTask((function(){return Zm(a,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.children[t],o=null,this.ctx.featureList&&this.ctx.featureList.smartArt&&("Shape"===(null==i?void 0:i.type)||"Picture"===(null==i?void 0:i.type))&&this.ctx.smartArtShapeList&&(a=i.id,(u=this.ctx.smartArtShapeList.find((function(e){return e.id===a})))&&(i=u)),l={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}},"Shape"===(null==i?void 0:i.type)?o=new Em(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new Qm(i,this.ctx,l):"Container"===(null==i?void 0:i.type)&&(o=new r(i,this.ctx,l,e)),o&&this.children.push(o);case 4:case"end":return n.stop()}}),n,this)})))}),"@ContainerImpl[child.init]")},l=0,c=this.json.children.length;l1&&void 0!==arguments[1]?arguments[1]:{};if(e)if(e.delay&&e.delay>0){var r=a.ctx.clock.setTimeout((function(){e.event&&(a.cond[e.event]=!0,a.detectTrigger(t))}),e.delay);a.timeoutIds.push(r)}else a.cond[e.event]=!0,a.detectTrigger(t);else a.detectTrigger(t)},a.id=e,a.ctx=o,a.eventHubs=i,n.forEach((function(e){a.addCond(e)})),a}return S(r,[{key:"setTriggerParams",value:function(e){this.triggerParams=e}},{key:"addCond",value:function(e){var t=this,r=function(){for(var r=arguments.length,n=new Array(r),i=0;i0&&(this.cond[e.event]=!1,this.eventHubs.runtime.addListener(e.event,r)):this.cond[e.event]=!1)}},{key:"isTrigger",value:function(){var e=this;return Object.keys(this.cond).every((function(t){return!!e.cond[t]}))}},{key:"isTriggerWithoutParent",value:function(){var e=this;return Object.keys(this.cond).filter((function(e){return"self"!==e})).every((function(t){return!!e.cond[t]}))}},{key:"detectTrigger",value:function(e){var t=this;if(Object.keys(this.cond).every((function(e){return!!t.cond[e]}))){Object.keys(this.cond).forEach((function(e){t.cond[e]=!1}));var r=this.triggerParams;this.triggerParams=void 0,this.emit("active",r,e)}}},{key:"reset",value:function(){var e=this;Object.keys(this.cond).forEach((function(t){e.cond[t]=!1})),this.timeoutIds.forEach((function(t){return e.ctx.clock.clearTimeout(t)}))}}]),r}(Ks.a),ey=function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r),(n=t.call(this)).isTimeNodeEndSync=!1,n.interactiveListeners=[],n.runtimeNodeEventHub=new Ks.a,n._currentSeqIndex=0,n._currentSeqState="idle",n.isForward=!0,n.autoPlay=!1,n.handlePrev=function(){var e,t,r,i,o,a,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.hasPrev()||!n.isMainSeq?"idle"===n.currentSeqState?(n.decrSeqIndex(),null===(e=n.commonTimeNode.children[n.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToStart(),null===(t=n.commonTimeNode.children[n.currentSeqIndex])||void 0===t||t.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"running"===n.currentSeqState?(null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.seekToStart(),null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"end"===n.currentSeqState&&(n.currentSeqIndex>=n.commonTimeNode.children.length&&(n.currentSeqIndex=n.commonTimeNode.children.length-1),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.seekToStart(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.clearSubList(),n.currentSeqState="idle"):n.globalEventHub.emit("c:prev slide",s)},n.handleNext=function(e,t){var r,i,o,a;if(n.isTimeNodeEndSync&&(n.isTimeNodeEndSync=!1,n.currentSeqState="idle",n.currentSeqIndex=0),!n.hasNext()&&n.isMainSeq&&t)n.globalEventHub.emit("c:next slide",e);else{if(n.isInteractiveSeq){n.globalEventHub.emit("shape slide onNext"+(n.json.ctn.id||""));var s={result:null};n.findChildInfiniteRepeat(n.commonTimeNode,s),1===n.commonTimeNode.children.length&&s.result&&(s.result.json.subTnLst||[]).length>0&&0===n.currentSeqIndex&&"running"===n.currentSeqState&&n.commonTimeNode.allChildrenEndHandle()}"idle"===n.currentSeqState?null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.startTimeNodeForce():"running"===n.currentSeqState?(null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToEnd(!1,!0),n.currentSeqState="end",n.incrSeqIndex(),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.startTimeNodeForce()):"end"===n.currentSeqState&&(n.incrSeqIndex(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.startTimeNodeForce())}};var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,h=e.eventHub,d=e.iterateIndex,f=e.iterateId,p=e.isInInteractiveSeq;return n.isMainSeq="mainSeq"===i.ctn.nodeType,n.isInteractiveSeq="interactiveSeq"===i.ctn.nodeType,n.id=i.ctn.id,n.isIterate=a,n.json=i,n.ctx=l,n.globalEventHub=h,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:h,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:d,iterateId:f,isInInteractiveSeq:p||n.isInteractiveSeq,fromSeqId:n.isInteractiveSeq?n.json.ctn.id:""}),n.bindShapeEvent(),n.nextConds=new Jm("mainSeq",i.nextCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.prevConds=new Jm("mainSeq",i.preCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.commonTimeNode.on("timeNodeRestart",(function(){n.currentSeqIndex=0,n.currentSeqState="idle"})),n.commonTimeNode.on("childTimeNodeStart",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="running",n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepStart,t)})),n.commonTimeNode.on("childTimeNodeEnd",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="end",n.autoPlay&&n.ctx.clock.setTimeout((function(){n.handleNext(!1,!0)})),n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepEnd,t)})),n.commonTimeNode.on("timeNodeEndSync",(function(){n.isTimeNodeEndSync=!0,n.commonTimeNode.resetForRepeat()})),n.commonTimeNode.on("timeNodeDestroy",(function(){n.interactiveListeners.forEach((function(e){var t=c(e,2),r=t[0],n=t[1];r&&n&&r.interactiveContainer.removeListener("pointerdown",n)})),n.interactiveListeners=[]})),n.nextConds.on("active",(function(e,t){Array.isArray(t)?n.handleNext(t[0],t[1]):n.handleNext(t,!0)})),n.prevConds.on("active",(function(e,t){Array.isArray(t)?n.handlePrev(t[0]):n.handlePrev(t)})),n}return S(r,[{key:"startAutoPlay",value:function(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}},{key:"incrSeqIndex",value:function(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}},{key:"decrSeqIndex",value:function(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}},{key:"hasPrev",value:function(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}},{key:"hasNext",value:function(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}},{key:"findChildInfiniteRepeat",value:function(e,t){var r=this;e.isInfiniteRepeat()?t.result=e:e.children.map((function(e){return e.commonTimeNode})).forEach((function(e){return r.findChildInfiniteRepeat(e,t)}))}},{key:"bindShapeEvent",value:function(){var e=this;"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach((function(t){if(/^shape/.test(t.event)){var r=t.event.split(" ")[1];if(r){var n=e.ctx.timingTargets.getTargetById(r);if(n){n.interactiveContainer.interactive=!0,n.interactiveContainer.cursor="pointer";var i=function(){e.ctx.eventHub.emit(__.userInput);var t="shape ".concat(r," onClick"),n=e.ctx.mode;"interactive"!==n&&"sync"!==n||e.ctx.eventHub.emit(__.interactiveSeqAction,{action:t,seqId:e.json.ctn.id}),"sync"!==n&&"local"!==n||e.globalEventHub.emit(t)};n.interactiveContainer.on("pointerdown",i),e.interactiveListeners.push([n,i])}}}}))}},{key:"setCurrentStep",value:function(e,t){var r=this.commonTimeNode.children.length;if(!(e>r)){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);var n=e;if(this.commonTimeNode.seekToStart(),-1===n&&(n=r-1),0!==n||"start"!==t){if(n>=0&&n=1){var r=n.json.cBhvr.attrList[0];n.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");var i=n.json.cBhvr.to||n.json.to;i&&n.timingTarget&&ty(n.timingTarget,r,i)}})),n}return S(r,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),oy=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==("undefined"==typeof Reflect?"undefined":T(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},ay=function(){function e(t,r){x(this,e),this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:function(e){return e/Math.PI*180},exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:function(e){return e/180*Math.PI},rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=r,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}return S(e,[{key:"parseFmla",value:function(e){var t=e.replace(/#ppt_h/g,"(".concat(this.timingTarget.design_ppt_h,")"));return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/#ppt_w/g,"(".concat(this.timingTarget.design_ppt_w,")"))).replace(/#ppt_x/g,"(".concat(this.timingTarget.design_ppt_x,")"))).replace(/#ppt_y/g,"(".concat(this.timingTarget.design_ppt_y,")"))).replace(/ppt_w/g,"vars.ppt_w")).replace(/ppt_h/g,"vars.ppt_h")).replace(/ppt_x/g,"vars.ppt_x")).replace(/ppt_y/g,"vars.ppt_y")).replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach((function(e){var r=new RegExp("([^a-z])".concat(e,"([^a-z])"),"g");t=t.replace(r,(function(t,r,n){return"".concat(r,"math.").concat(e).concat(n)}))})),new Function("vars","math","$","return "+t)}}]),e}(),sy=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n)).value=e.val.value,i&&(o.fmla=o.parseFmla(i)),o}return S(r,[{key:"resolveValue",value:function(){return this.value}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue()-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],sy.prototype,"interpolationFrom",null);var uy=function(e){p(r,e);var t=g(r);function r(e,n){var i,o;return x(this,r),(i=t.call(this,e,n)).value=null===(o=e.val)||void 0===o?void 0:o.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r);return t>this.time&&["hidden","visible"].indexOf(n)<0&&(n=this.resolveValue()),n}},{key:"resolveValue",value:function(){return this.value||""}}]),r}(ay);oy([iv()],uy.prototype,"interpolationFrom",null);var ly=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).fn=i.parseFmla(i.val),i}return S(r,[{key:"resolveValue",value:function(e){return this.fn(e,this.math,1)}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue(r)-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],ly.prototype,"interpolationFrom",null);var cy=function(e){p(r,e);var t=g(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).value=e.val.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t){return qv(e.resolveValue(),this.value,t)}},{key:"resolveValue",value:function(){return this.value}}]),r}(ay);oy([iv()],cy.prototype,"interpolationFrom",null);var hy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},n.keyFrames=[],n.isColorAnim=!1,n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]))},n.updateVars=function(){var e,t,r,i;(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_h)&&(n.vars.ppt_h=n.timingTarget.ppt_h),(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_w)&&(n.vars.ppt_w=n.timingTarget.ppt_w),(null===(r=n.timingTarget)||void 0===r?void 0:r.ppt_x)&&(n.vars.ppt_x=n.timingTarget.ppt_x),(null===(i=n.timingTarget)||void 0===i?void 0:i.ppt_y)&&(n.vars.ppt_y=n.timingTarget.ppt_y),n.isColorAnim},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=n.keyFrames.findIndex((function(e){return r<=e[0]})),o=n.json.cBhvr.attrList;if(i<0){var a=n.keyFrames[n.keyFrames.length-1];n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],a[1].resolveValue(n.vars))}else{var s=i-1,u=n.keyFrames[i],l=n.keyFrames[s]||u,c=u[0]-l[0]==0?1:(r-l[0])/(u[0]-l[0]),h=u[1].interpolationFrom(l[1],c,n.vars);n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],h)}},n.onSeekToStart=function(){null!==n.startVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.createVal)},n.initKeyFrames(),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timelineStart",n.updateVars),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.createVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]),n}return S(r,[{key:"initKeyFrames",value:function(){var e,t=this.json.valueType;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){var r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===t&&this.timingTarget){var n=new ly(r,this.timingTarget);this.keyFrames.push([r.time,n])}}var i={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===t&&this.timingTarget){var o=new ly(i,this.timingTarget);this.keyFrames.push([i.time,o])}}else if(this.json.by){var a={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===t&&this.timingTarget){var s=new ly(a,this.timingTarget);this.keyFrames.push([a.time,s])}var u={time:1,val:{type:"string",value:((null===(e=a.val)||void 0===e?void 0:e.value)||"")+"+"+this.json.by},fmla:""};if("num"===t&&this.timingTarget){var l=new ly(u,this.timingTarget);this.keyFrames.push([u.time,l])}}if(this.json.tavLst.length>0){var c,h=M(this.json.tavLst);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(d.val&&this.timingTarget){var f=null;"string"===d.val.type?"num"===t?f=new ly(d,this.timingTarget):"str"===t&&(f=new uy(d,this.timingTarget)):"number"===d.val.type?f=new sy(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new cy(d,this.timingTarget)):"boolean"===d.val.type&&console.warn("not implements"),f&&this.keyFrames.push([d.time,f])}}}catch(e){h.e(e)}finally{h.f()}}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),dy=function(e){p(r,e);var t=g(r);function r(e,n,i){return x(this,r),t.call(this,e,n,i)}return S(r,[{key:"percent",set:function(e){this.uniforms.percent=e}},{key:"transition",set:function(e){this.uniforms.transition=e}}]),r}($l.k),fy=r(121),py=r.n(fy),vy=r(122),gy=r.n(vy),my=r(123),yy=r.n(my),_y=r(124),by=r.n(_y),xy=r(9),wy=r.n(xy),Sy=r(125),Ty=r.n(Sy),My=r(126),ky=r.n(My),Ey="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAr5QTFRFAAAATwAAOQAAZgAAKwAAPAAAPQAA7AAA/wAA/QAAugAA5QAAsQAAwQAAsAAAfwAAawAASQAAZAAAOAAAJwAALAAALQAAqQAAiwAAmgAA5AAA7QAAtQAAhQAALwAAfAAAXwAAYQAAigAAuQAAfgAAswAAcgAArQAAqgAAZwAAaQAAMgAAGAAAiAAAjwAA1gAA6QAA+wAA7wAA2AAAbQAA2gAA3QAAuwAA3wAA2QAAxQAA0QAAzwAA0gAAXQAAYAAADAAADwAAGQAALgAAjgAAcAAAzQAAwgAA+gAA3AAAGwAAoAAAowAAcQAAVwAA1QAAIQAAWQAA5wAAsgAAuAAASwAAbwAARwAAMAAAnAAAUQAAaAAA9wAA4gAAPwAAbAAAOwAAlwAA0wAAjQAAvAAAwwAAkwAAQQAAvgAAnwAAvQAA0AAA2wAAwAAAWwAATQAACwAABwAAQgAAtgAAgwAAvwAAgQAAlgAAEAAAxgAAtwAAmAAARgAAjAAAdwAAqwAArwAAywAAYgAACAAAmwAAHwAApQAA8QAAdAAAbgAAFgAAgAAAogAAewAAXgAA6AAA9gAA/AAAzgAA3gAAkgAAngAAdQAARAAAmQAATgAAUgAAJQAAIgAAqAAARQAAPgAAxwAACQAAAgAAMQAAiQAAhwAA4AAAUAAABQAAeQAAygAA9AAAFQAAVQAAyAAANQAA4wAAKAAAWAAAZQAApwAA4QAAyQAAXAAAkQAArAAAdgAApgAAHgAA8gAA/gAA6gAA8wAAFwAAHQAAhgAArgAAnQAANAAASAAA7gAAlQAAJgAA+AAA8AAANwAAJAAAHAAANgAAkAAAKQAAoQAAzAAABgAAFAAATAAAeAAAAQAADgAAggAA6wAAEQAAfQAAVAAA9QAAIAAADQAAEgAAVgAA5gAAQAAABAAA1wAA+QAAUHExBAAAJDlJREFUeJwlevk/lPv7/2XtOrKNsWcbzGCMJSmSpSxJZtQkjPEOg5mxRWns+xpZyr5ECGmcLIOsdVK2oyJbcVI0J8fp/Bff2+d7/+BhPO6Z1+u+ruf1XF4GAEAGZOXkFRQBTiD+dgKVTiqrqKqpq5M0ZMmaWtoAOrp6+qcMDMFIzdiEYmpmbqJBpVlYWtFJitYMG1sbFTskLvvTDmcQHM+ec3ImXp13uYCubvB/l7sHkC9eAk8jcy9Eb5/LvldQzQ+v+jsw1ZAlfwYDAK5dZ98IvIlBwXRNXVYIJ9TpLJUb9j9LvBVOj4jkRVGj/Y1i8AwiH09eEwhjMU4uXtsiAWLlqInMcLh+28okKRnuhNy945lic0+Uqu7NdErDdB/5DBo7MwuE4J+dw8jIzcsvwEIUFFGEisWQm1ACpcZlxF7vl1c8YMCJyqrqGio+fFRbVw8NjU2uec0isNWhVuq2XMPzmjcRBVHhSWCtXaPR2mZoybHzL0TUfmxPabeR6yg/+6QTY83VQNOkSwkbumsgkgzwtKe8tDdHYM7ts3sW1Q/Pn3PEWaGmYjoje+B3ewx9bM4V0LNfDB5XL3/o5v1hSBi5fzvQkQESOkQOwiiwI++5YBdkDjFIrKEx3cZK4Ti8eAlZpjcnYMSHKG0ygKKVeFSLRpOZNL9p19Ku1Q9enKlp45lZiQGr7hlWS17RKWp03mv8481cQnwBUNTAXwIUeAvsJwCCTnV4FyJC9CrKYDnOT91DpRZSG8Bsn7pAw2Ihd7Hn7R0hynXezjQcvQTyMGgUjV12kiW75XaR7Z9OK9kD0/j6ckfyk/fcPHCkvkz48NG/r3p4FeRpoQa9JA74sJAOcLubirEPqXqTpZ1hNzUN5exoNVbk5RmSOQqcJix5yWvvRZZ9nyay+tqAsb6U76oAwo3wgXvJkK6sCpOYQBTIdT6cg92rSxWh16pdV2c8NnDzfQhveqvND4k6aAB0ssWnHuL2yZQ7AHLzJTgUrreyZeWewhawpw1RMDWYHLP1OcNQgKzwlKVP5JV5crB7cZ+NRJ6AB3wx/x3RsEufEkozLu+g7+zkekfLbFQo8byEubp5ld7Ot2CQKxJ7qguZxF4SB3ozQF2pCEIbcaFxg6eAr0/MbeHb1DCK+vQCA3j4YTcwjNiWyEgcq1dRlfnXsq31K3hhhvNX/CYM0JC+asxk91d+7ahTr6AAaTAn3U2lTBfjIc1pr5VEX94yw8uIZhWQVAHQj66iLErxDLqNmN0wuO9hYf6FN+boQb1FjENYJAiWKrru2ejWzoZX6M9A91p2Sw1TTRT/rdDQsyiOT1f6br4fKm6Fpeb9qocNfvYOLPAuczuA5BTbeVT2O/ghlkYEScGHX0Df3StfyMT4iYHCTEQTLj04iWePVx6aomPYGLc08OXB+drJLqoq42/wXqB5eagtaqR+ZAPsymG8utBxt1rO8zFTPHITA50gCMQ4Gw7tQBZFo0DBsWb5ExlyKoBbvRAO7jdv6U8jMYne4Y+iWXmg53gvbNYsGg+gU3elEnaeXB/ufFUKJiyZdNZemo10NviBxr65KE1k/Rijg8KTan5647eoiJQAYPIL+9fuHPb/VSMucg/bcJHzKt557SPRYF8voq1+2SIWmSgQCZo2ZjhlymMigEZdZQ3MzX6wmmMTECwNWieLpWDlKihSZ2sVVwNX9AmecOXtMHP7C/WwPzvKbZqiJIYFZ7PuZngFJmNi9YatOLLQU77vGbS6PzGdsQVn/Ad7nQyALeZVbm01GA72t5bvR/aWTWVIIEVDwDJanzjqAc8QuFl4Yr9/2WTdPVPmHCtY7ZEZ4mJoDqURsbWcaHwtmIqJWrIXshpck5ilsHlYM34YFFXTG3dGzKrDMBxB8gsDn7G3bW/TDpe51ALDmy5KQW8lUgg4guspE7TN7wCTbFWnf7gBB16vuHtYoXsWo14j1cD9/Z+oyj5GF95jqI9KG0s6YtJ0N0jtISrVAZQcIO251QuKrBIaH7k2hLK/Mw8pyNmCnott3tGm6XjT9DsZUps7H8DCHwjc731hFRtTaF2UQ572Ca4Qp/On0RVdmFD0A219YL4DcFBN/lnfBvNr12E0W2MSZatepyNLVIbbFIg7jaYfoR/4W1VUKqL6zsF4NpNiq4orZEhCEjExd7AQ2j+B6GMOPmekeA7+DsM0IAsIqj31xrtAzvWqBsjmIWC6+uBONItM9R+HA8rGHxptX9JAF/G0L6QEiy3McdFEhp4+YNA0FHNwnW0/RFFEtwHRb/hwQsbzX/heYihsB6nNVJssfHnqQe/acYKMv8LqcRe7aEF7Y6ugtWxKLILeNmlzVF277PqxIg8dSxpo5gsaMBFxfgwvdWBhOvzOHHHzx4JUHLNpyc8LUzkLcfiIv3A2jQxpeQ1iL4IKUJ1dTmigtKLpgi6QjX2d8ISbHl1B8bH0UEbnI2DMVm5h4+6Ko+kTd3VVSVPGkpp4/p+BW7/faCjBhlD7MoDqRpcOJxz6lBe8gWYtBP80qaKf86k0FP9L1ziS+Y1m8MPaWpcD8BXkG2flILIvKvoC/hr8upkS1N2pwbQD5NtZmC6iNb2JUVJTRDoZxTXibAjQDp3w/y5Bhld8zynk7OU1S3S3LPnJLvjhzcfUaKeYeJwtkmPDDbYpWt0gTaf8e/gL32vUwV1i7lHVD65CN0n+CySLiHLZfbSx/XYollUUj09xeL/Cjqg2DUp2eM7igsEZPyXlnve63tfjYjZSbBwtUf7mlAhvX0N/CzxFIKE25lol9uEzuf4B95AK6EAVtXBSn3XGA6bVuISAxQuuFKTClSg4xz/VEivy43BYA1UY4x7aSd/i1RMdwdgzi68x0JEYIfLBbEMag6Kcur0R3WGGtXvT2744+WPE4QaWz1rrbq5fEmwQTMwOLPRNs2jAJiPTPpAjXA48lyGNDo/aEnNyEv39YQtTIKcLY2gVw/SWl2eGCgmvgRKcowIU96xWM6PvyJhk/4dRHbP4A2JaG+uq0xb1J15Gaa++VgngHKhh3L3grVzTsa95kyjw3wgZLYViuASK6smRQA8Ds39GAisCnrN+wiGik1BsIZfpFhk9aVvJNr+pUWJbSmxoOAqRzseBsHsCPJ+9EvFA6HLDuymPuB3VbLuUAeRzs5AnmhdV52drj6JdA/9JE6GEWqDZIrYYlrYCDM7hLcefRsAoFiZc4P3tYx5qFsH9ttFzAL0L/lgSwvjbS4Hlik7xGLuSVfejKzFhvtnHF3039B8VGq1UCpg4+cLt0KMDi46N3M5F9YWHiD/InKc21mDdj2pCGZNgqLihu2j14oFnH9dxycOd1FsVBZ+cMEBkuu0U7wwPJEfc9SWATH9MuG0EvfyJPxuf9enmuy3ipIOtB/Tq8fRSfpzQFs03/H+7yBgpxgsOgaPD69B90NfAH5SMhqmB4xns1ARtQlmao4VcBTRTDeuo6wPwzlIp/AQcGagk6KNOsPIQxV8P+wi/EIUDDVLWFGWvjTzIZnkLRH1UoJhWpXMTjPAjt3UAX17p6WGAJwxrWKi26AC0+gNR2jzhlwfEJrgvQCombOyaY8/bLwB9fMvueMLQvWNkBKGC0lq0Ht3KzP5jCcE4StVpESb3tdp2iHeZtLDMQ26rGa6n0GpULC4tIz4jBBxadsL3wHdFQPwahEAq1xR5rwJkcKwXQrx0f6F7awZw4fPbGa1gUiXJVpYOUgng1Il6/kdwHeGfQlS+PdZEZ/WbBBOmQjvC0LG6wpXRfApSSh5UP+GjCtGd2HwGkHtuvHkJDGvpqBlcXLXap5CKR9eJRzlgZ8W4zK891g7/yQl4SpDRz5B6E6FEUxFv8K/4i/p8Hn1DOZxLx2FQHi3X/cwgM0LCK+TZnTMszAMO3JUIXyO6zOQNiThG4OXOrwJNCE8XwV95JJ175KWLydZwJE882VhaOGyWMiSKcP771g4kaYKUFB2Dmz0JUdUk75Pplh8T7VBZwUY90zTpUDwWxIJNQ4p3+oSPgHVcJUQVskdpHklpVCunu2AMvq7HI2HuekbnizilxbZeVzVwQLUBT133fJUvswkKMu+OHgCDmIJX9+b8TDTiXIyTQUrXPXFm5NsIOF7X6snH0GkbLAqxPlJ9ecWoX5Ywy8Vl/GgAlgE21JAfp4T0F8NwItrDq/BXLuXDsET46eLTOOKK5svMyhZ3Ah1ePwHOvYdijiwWbAEJnbIP5V95SOcbXM43qIJm+5G32UABbhvaNNvRffVynh4jmDDQ3V+XtC1dHWnr5PFwd9Ds2UdVaIEHmECBo9V1OAz0w9Q7ZONc7xXtF+8+ETCmmX+G7+2+flmEDTEww2Dr5eQAbJggPltoLQ9vmismCRLQYIvSsXqDWOIS85DgRSlAhWjGdOxACJXNVdyGoSxA1lu2eETiYQrdn23iL9SxSRCa5LgEX0CruBRSxHIQWrdV/mq5qOUyNgs9QUYv+xsmlhwRichkxSqZko2RwH46USV7CUofNLnT23rewuaB+3Y+8g82zzjibgmdChhbQRFk34o/zPECaRHy7wKj5wlFDE8H30Jva81PwVlVT/UNLeH5C/T9cIDrBy3capubs5y2F7ATbAwpRvThn7BsaBvwbu0BBMDxHEtAsSE3DVOdF+kWWcXsfX3AFYeWSbrZP/TS/H80MGryotBYxj1U8rWXomZeevT+aQ0crFNLeulQLpiCr0J3rB5jTS3MR+wbSYRJirC2/5eEGCMHpzOUFWEplMsWaW0SVaCL8y8rZVI4hiy4qyEC7CW0YwNHTGLxvJ2vW6GNMctZQNF8YFxN+y/di6ENOZNtphmlCkIZsU3uvDqzlidm8vQCrkUfzYk6D4AYr6tk+mccy/i8xBKFQzibM/wWTIysZ6cDt/XhySBb1niUMBJRN+ILdWbj7Z6dnUgLZELPYXWeyXNhzV48NvUbAWzWEC0lD8PwVIGTt6rveS3h3gX3XiVRg1O5poRFvgPCL17nEx324dKJT5AC5OU7RFWXuEp0U1v+MRgY7mxikdoB4lle086YyXrr61aA8eVem+VOaY1TKn/sOxOeRhIcR4AZLNrygau7faIG/T/vTPO010Kbci6K9mAYPE3+D/Q/02VDHhOfPxxTud5MF+8KsrdY8Bw4TELjh26cdDiBfCo2ptEyDRsJrRk1KZcvgta3ckuK5CRPn7AxcptUHMpozoAU68b9ElVYL1uhaVz7RTJwRJ15W+0X8HZs7gUMi9wPAEik099Y6ilYhW7j1KNLmlFXlRwAb+NvU+PbN1AfHY1t+/sN4J1JVfn7FDYLloP1Scsg9GA3s2b6XMPgHYNbve6n3ghsmK0WGyzvNrCU7t0veADh7RGOKA7vXwYQc0uuPZMJMUQMLbBdz+2kFzkStJJNFEvH/f/cT1wnXJfsflkfnn+qJe89nGfU5c6Fpsd3vp8y31fD+eHg8uZSYXdwqcoBT9DS0aTRKoaZrdSqk0KtkFZb4+BBqXAnpKdyVLXBuP5clrK5wxSYyIWrghPCaNnLhJkp/A3x8fsMgMczROQeBhpGULvpU+ZNQqKLZQMr2c5uvEvEMHOemnBn5rN1M88Y+/TkhOxUIBP/2P2jr1+oIelfW2KEQFOnrjfGzrGWUsS6YsjIBTxTDwc64bw+fGhfW5AnvnpxLYAJDBm2lJ6rvaNZZMrsfTANYByHtYSbJahyNwhmaepqjdIPb+zS9jVAgfRHPZEjU1Gd3rhA/5cI2/I7HkyV/yE2rhd7VLRC+6h3nRnBwqHqGw2HNB46i9yPFIYrAbBjbP8Xiw3DuyzbyCf9d4TVDRcSKQussrgoejwBiAjYwZi0qcQK8KuYyotDvMBHuWgDgNhVUXyHsaOlkxmK4H0+NoRd5BhMX9v+E0DX3JzZF4fOt9EZhbDdj5dngkuAUBvofWKvSxgvWN/JXhGtuib/SxfY8KRQCXuP9M9m4RKN/YNl9WjkI76xL/vI3tkUW8UwNyBJ97wf3vZkr8zgZWjt09M51pPhhhhIa5n7iOjQUKxcVfAILZl0T4jc7FxaD1109JL9Ca0sSBbrEuNCQcFBiIv+SZSJPYe/1EYItPw54SrCk2fKxMmvjDJ19ORWT937dR9t2yrEWeJCbBTuaVFvARwhlXYkVrmPmMoeHL//5uHAvRj2Y8axOXO33AUsW/qXsBWn9CxkKIYN1C7xCb9tfTfE+3+m+utf4yM6L/i+ic02U8cQ2F98GKWj7KuD2pLDXkPCLCOzaCvJfwOemmSw+9kphfUY4yI+yj5/MmQxX+dJTNMaPNhkZY4Wbc3tEQKBn08wseAkoa6qqIQUIOD3kPmDGdgoM1ToC4KklkiDUBk4Uk/Fidp8zCJcFBMgHj+etTxbRFeHvwhf80CiSt3z3DIFYl6k1lWLVvRBn0lpMVKj6PITC0tar9jbVAPhHP8k4rhblOqCcOdqrAPy67Z1WL4TfMfVx0GLrHQJyH8iQUus8lkFKuv5kcYrNvW13YfKuZ89ORAmC15BmyKxBFilYKq8dxQRWdqGLLb8Rij6WrIs7/mxVyFptbrarK6uDO1v3yxzOWQjtaz2W/01pTvN/Omyfx8D2VGPK80olW8HfnliYW8J7UjIcIlewB+DJW6whrBEqHlPOAQ8W/xs1Hn5GmuasOM+K9M5T9RYI+PMwnvMsCTG6r+dbVXfMESA2YjneGLq0D1CQv4w2JrzNXBsshiH+QHHQa2Mr/AZ4I3FCYwSF30Bqgti3TOnZKmjAfxUANcv/0JqQQ2HHnOhMOwJodHns6/25Jg743Q1lQ+KbmEPuPq51Bt83snYTH17IxKtNv2roT2epeJDTPX4a0X9SZHNHJqSie0RtRDgKb5JGNRAJr4h2aypQVI68DWseD13hXjPfFQtgcpsWw3+bHWbYNMQ5bN4cjo9d8aBirB8/oJdnePZQoxNeCAZZbotwjOCA0wROeUdcuZjnmA4UdjXjcB5b5xb9AZYmwdFSH2DdhvscW5z5QnIMnYTFRngKajbkSdjvvVyWw6LwIJWxlYhshBPGlg4xDUFZOFLf2UlA4MUe8DA8TIea+IX2smNzuP0vmleE8ArQR+UsNqTqekrljgz0+vhX5+FaB5qs3t9J5cPuwScX+MPS/UkluQXNh5WrJFM9p4CGban0P71P43YKxglb2X+cyKQ94h/diX4v9RaCpnBsnLBEiBNo/0idpiYrznuGrJbXrCBGfcS8UOZNOTvW4hnUTwJkuVcBHodNx3R8t5LtTDmf9/EmsNByWOE4XyHplSzut+ilAlOYAW6FAoMlRP17j9CYvp40MImU7d5GfS2Drx+GW3yciuygcSeJPwW0wzd8Jx7iITtZPchNXC6aPAtKQrB2xa8z53r/+NXr2nhyLPFySAhSY0IYOQBgKT6h3kSWUhtwoeuSh11H23xn6OOue1lRwSZFtnWn9cdSaaEGqWp9dYsa7+ChyZcubQzxJjXzXLk9h89vBXfZGDIlvpsP4QIbmPMjqxhqsBfefv19nkI6ATGqFQsHNSKV1bi5RDhNzYOR3Ckunra8gfjADKT/ll0bAtT+Gyj2d7NLfv1oX/s3Dxbwcs6upK916xmn4Cn9qoUPECeybc02KdxfxGRB0zT8l0Zikliu1neuQQ0TmnzytBG1jCdcA7AUAfwLbEnAjIqNRI/tr3AS3HHzaJJ1AVHLTuHM72nkWqYVDDf+j66wmI+h8Lmvxl4OGEXnX3JOrwBz08R7ELtwHigs810rOj0viiWN/+sC7Ni5oBKQ6bZk8eHN3PYLZzQgVjEb5jNex3lMrEC0EzpQ3faNx4xd523exujDDnuf5ZP5S7v7/UuKqkqW2X94NfxXy7549ho3WWi6n1Vt7ABUIeJc5cdqWkRZrf4aNACabeODzxEINKtnW6CGh5734US98i9pjARiQfrdT+ax6iuaQ68hRSbykUQcJUr4DoFBkm4wgd2hq4tBIt5iGqkmIYjIK97X2Ac+y7Al6Eas2r5VF3EkYVixIGsqzlkm0RXA05xqwaznFZjzk8V80Y+iIDhMyNdfSpEMp3IheR2cbKGSnSfWK1HK5rU73te+Y+mp46Jt6oD3xe3/MKUzoD2UBzNmu3iQW2uCJHd2ne9t/x3h7lnn4kBxCEAK//UgVlyjyz9W5JHgDWu3g3OlGHBZO/680MjgZCrLsuOfLU+5jPl2Pxck02uqzyqmPlhPA0isbdnhRis6Qh/S179zV226tq30IMf1KqJ+bHgSCHhjM64dbIL8GGt21vGOEXP+/AJcER6NjIb286TKSzTCCidNp6Zf3rpsWZnG5dNhuEqU94Fd2sYHaDOgM3A3LO9nxQazFRTOJsT7cD4eScDOsG8UfQGqlmCqM7L0/3ZpnWylRSPqBu/B+eHEfYNZO+0QTaWrYVbLURYIK4TWR8iESRGfHHQWgthnGCFSR6XhpDR2Xtq0uhr2QQvOUVv8Giw6ImYIgOdd8OPo1dxm1hQCQV84zTzso6krY75wTfRjcwV5Geb/tJ4owfFd8kC7FDPX9B9mBYVZ0zuK21vYoVpvazdgKlwKfwFKZSgPgFfDQtTRYNOvy6JNZ7OeYCWEFJq/hygT5KPD9mIbenEBsAvHdzCG/K5iPb4S4aP/YhnMDJHIP/icNM6ztIK9gkRRdA71nyoMef+2jb3neklwx0pHH2SIdKb2jwOWG3JCmYK4Iva+7eEG0a3If9Da4KaFAGMYlTTCfFBFSoyK7YMSwyuICgV8M49c7bf4VqtKi5LOaLKCJlVZ5zBpLrIr9LvsMNctO/oiM3ab/MknNJPPbnirNLPbGflQrRr2aJJYXg/QIsh8k1PXzz+z9w5gIxiXea4P0RlO2OUDqhJdvv8EBpRLy6Z9p8GR+FFKgDHcGsMkkbMnJz0q7hAhDVdF3sCfBM6hj2P4SlE5njIsBmSky6FhkNYd2UfgLt37a35+BEvupCA+Jh5kmC5dWaGeQNmz35EEQvhwZG3qxKo/RZr66hM7IJ5Won7gh78anK172Zt3buKAMKyMDjzdR9ufcCZ0zU4DOA5RKIgkAMTbytB3LQFlT5MH/An6qfRJPjj2dg5WFP3mdlZkwFePrA+3eN2Wu0A+WAFKZrztzJRibcqCweEddxU/PSGWxOnjHtOUDzfDk9lEvDDj39cFH1E9dVeQLGVI3Qgeo0M34dZ6K/3cb9BBZcZf8uS+BivagqBuLW31L60FMADuX1jiTur3n1ZrBrIgpkFO//0OmyT9qWthHcnwzLRswTdDbgUflRNCAvfaODDSX8vQLo7QBDltK42Y/OdFbS1zUYFLv6qSiV43zDiUrcAtbEqoMVBPa37+RMTuT1gmrJVH1qqYsi12cyakNWPLrTGqg9NO1KY2vPwISkCnxobu6FodJWlXUwABhb1LwveepTps6Tt0E8j+tabfLiI+MdLLWSxLqA1cJON1hz8aZkisUWXUMhNOQpLrIR062CCV3Bg0ZwlU9OhbKefT1NjDog/g2q+TAW89zQllayE0d/y9qAdSAucb3iKOXZYzSSmdealQNS1IL3qMUpowYU6uuO7LEqyPD05MgXvXy6frzzrkpBXlAx+J30gur7J4OT/ziwA3fvIcKvLAHet4sqms0BCkZk6CKbyRPu8Xqwsv5KGfYcI4thniGI9nFwFwt1bfZm9racBom20+/R8n0upa1EAueM5b9A7lN3BE9empZqOTj5NkKNeCf630MV2jeKeEP8cImJ5W9l3gYGDg1wPxxZcmBvsZ4qZXUMim6a/M2jKAsHtYvPN1A0FsH3AAbpFvCxA200RpdN9ME2nSQL2g5pg9OIw6KkYT3gKe7QmWrItoXK1c/XBbJQ6pVOca2BzfQfoOCTygsFljpEPDG+tBLrte+jUDP2DcYKLisBjhgtTZnAmgmg8/Aus/awVIZGqScBZ1xa/82qG7rzT0BDLldEs0sP5HS8oNhU3lhDue5NS0TUt0T7YTZvSGH0HEYEs97dJ7xpNO1TKokYmLWenco4PvNEsv2hQ85pcgDjlA29jwVT9IoAcXQGCnhPG8fgYyhJ64NNzBiWf5p1XdoBx+xtXoPiVbK44FcHipEqTaar9/ruKsdneZuJmevOHPOjhmtvwVVX8Nmx+/eftj7gZmxlF3ocI/n5T0byPxzPfMi24AxSQeAGjdI3Q4hc5ffAT7v7F89ZNEgj6fheuHl2hjRQlG4EMMwpiAnsm1HT499a+zKPMejH0uAfnT4JyItDTiDQ4l5DoO/sQZ0HkzGpiM8KQNwaHk0Un9WaO+yuA1ZTV9z8Jm13bqwTlfNHncIi8M/kHQMFhMF7Imo2mUw/Sox7Bh3W6UplqvEiy+g2NvVzFPCtGkHSTLuFSL2CtGzpPY+E5O0PK3HSbUnBzNBZodkNnUAlch2Zk9/9F8JuAYBirgoVpE7QyheJ33WDOysDFYMSXBdm20XfXCWcGzsGyvXE8FJN7EadsGjIDzZ+GtIUEBWuQ6o87kaDvo4eplYs4dz6P06lSSCA0yAvpXKD1djjC8dnWdYtWsLpl4Fplhje74Y6i/M7VMSQnRvD54/CC4LPzx4vghhIOzVo6bLzl7QIHPvVyM/drqBBZ3tW1lYqvXfauRfH5WHe+RcHI+xxeqDECqJ9tdXLyy9L7RqxyUaZKwmlAux+zEzdzITSRlr36YuSm0LBhTpkivodWytR6BNULFxftqF42QqKLmoog9WlYNRb4GtNm93bHuxBvV5VcOUeY6N/9xDutwbqYhaN3rIzpg1M6XfrYctTdA5Msr2v4Aydmb+Nl2/Eqw+jSXYvctmuDHYUAei0pUc6E5N1bULPEjHAr+HI3gwDjpDg0nE2fMkXneCumq9ifZR5IKUOqn0aDIfN64olrhaHfV4msozkdG/3j5HHqsf5Els8kwvDrCaK4/BXb+YzYC00mJEOu8njPsKgB9dG+FjqqeToCsJKLTvHS+iQTnqFquCJ+yCckuDaHLnP4GzroGg7BelrYZWStEFay3j+vkEuXHy3B2zG5xBqSx+/pxoEOv+OfiCfq5QMCCNq26xXC+1DZ+eQdH2jJ9FXSh9yrISZTk56jTzMIzG9+Ye+pumQffxmh2lcvPXjmNWL3PoOgRpkx4o/TZzE2y3IMtEZNxpNUlBqFlnBVXuPS0TIBkF+ZfvW3y2bGWD14zb8Cju5+wiSW1pIIRRtD0DeaxOLIvup5BZ2R2QfQVx6ryHH4H/rls/fRJy6KIdsJ/qVsWrBZaKgKOhP0GOUjA16wS+vlpcmot72SIWJWQDwyiD04TLSU6LyObtnOC2W5QA0OCGXHtlTi9Cyh95AIL8UU6AaQOaDSDfuf3DbxO4065WUdqPZ6Zj9S26jGlhDs/3mX1c4h+to5J2UwvgO3dkFtmKMBF3OuQvskMsOO8R5FnXblT4zMUpkjhs3m1ygag6zQWKfFOQCFM8jmAFtaCpCqDX77xqhE3B99uGU3UT+41SufAp9fQENvgk5lwqneywazIE9IpGT8v23sBPibAHG34mLWiivxnjk8p2S5ofshihnLQd4CU5ABpVcMX/5Hg39Jm55k+hgxugBCGIR5KmY+qz6US5/wKYimBbjTOSBlyD9OiYpWxtoLH6PcoaUdK0dW4vKR121dfMwumvgSBf8g0fsVN0w8jbplh7Df1FVC9wZuTbZStSswGJu6IngHRvBgOFag8F3hwPVNuUYjxNngNURuMvnnOvway+3l+1sK7aILbzdSzAxUCtG9/CaaHsBFIVzMWEH7upNL6Hr6P+oI4i+VqT6NyQrYUMkRXYd2P1ZjEMDaJ1rrurxTBgTfMw9cZe8SHIAz0JA7jpgDmr+InVbg0HrkFNZVhQ2uBKn75tLEZwfMp2azBhkglsAXDPx2BccwTDGmnsjRDh2jHh9ynTQY4vLqcuv/NWRlP8sFHWyxSmm38ikF1UoTywoZL0oFE4I4ujqIcvCuo+0ABPohIMdyq8EqgTcogXcYNCGdgvytDCA/fwt2eG78+OAANOgmKkOI8WdjE3FaFdqW6rx/oOBunJoqMLOwnPtv67Cw7PY8c4jFvek2G/hk1Thivu5Pf2iV8YDA8DyziBPz6MKlF9XQlRt7ZRV09nZrygwo00ME7IpFuOiEsUrd14UcCvNC/DPkbFmqB1uQIg477mFiq2niVADUYnvdjiQPNpFfMTo4yg4X+tDW3rmH2WE9E2rY0ES40wM6QRwaQL5/fepJULkj3Zc6L1ItuWmO6zXbvou399GBCPcQwB2+rRpubsw03qWL2iRyHH9Afl/YHuFYa8v7zEXDEigXJo9RAtTM4BTzElQhSgePv55AmHTo4W9v4SmkPDlLIhOpcXBK4GO2AnyzeN0MaKP7umX9bZAfc5LA84bxj3frYCxezbP9KG7QeJzevIhiAU4p/j+y2OyMV2mxNgAAAABJRU5ErkJggg==",Ay=r(127),Iy=r.n(Ay),Cy=r(128),Py=r.n(Cy),Ny=r(129),Oy=r.n(Ny),Ry=r(130),Dy=r.n(Ry),Ly=r(131),jy=r.n(Ly),zy=r(132),By=r.n(zy),Fy=r(133),Uy=r.n(Fy),Wy=r(134),Gy=r.n(Wy),Vy=r(135),Hy=r.n(Vy),Yy={wipe:function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r);var i=1;return"up"===e?i=1:"down"===e?i=2:"left"===e?i=3:"right"===e&&(i=4),(n=t.call(this,gy.a,py.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,n}return r}(dy),fade:function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r);var i=1;return"out"===e?i=-1:"in"===e&&(i=1),(n=t.call(this,void 0,yy.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),n}return r}(dy),blinds:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,by.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n}return r}(dy),checkerboard:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Ty.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,n}return r}(dy),dissolve:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,ky.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),randombar:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Iy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n.setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),circle:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Py.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),box:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Oy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),diamond:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Dy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),plus:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,jy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),barn:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,By.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="inHorizontal"===e?1:"outHorizontal"===e?2:"outVertical"===e?3:0,n}return r}(dy),strips:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Uy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="upLeft"===e?1:"downRight"===e?2:"upRight"===e?3:0,n}return r}(dy),wedge:function(e){p(r,e);var t=g(r);function r(e){return x(this,r),t.call(this,wy.a,Gy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return r}(dy),wheel:function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Hy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,n}return r}(dy)},$y=function(e){p(r,e);var t=g(r);function r(e){var n,i;x(this,r),(n=t.call(this,e)).filterType="",n.isConflict=!1,n.activeWhenConflict="prev",n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r;if(n.filter){n.filter.percent=n.commonTimeNode.applyTimeFilter(i);var o=null===(t=n.timingTarget)||void 0===t?void 0:t.container.getBounds();o&&(n.filter.uniforms.uBoundRect=new Float32Array([o.x,o.y,o.width,o.height]))}i>=1&&n.timingTarget&&n.ctx.clock.setTimeout((function(){n.removeFilter()}),34)},n.onSeekToStart=function(){n.timingTarget&&n.removeFilter()},n.onSeekToEnd=function(){n.timingTarget&&n.removeFilter()},n.onDestroy=function(){n.removeFilter()},n.commonTimeNode.on("timelineStart",(function(){n.filter&&n.timingTarget&&(n.timingTarget.container.filters&&0!==n.timingTarget.container.filters.length?n.timingTarget.container.filters.push(n.filter):n.timingTarget.container.filters=[n.filter])})),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate);var o=1;"out"===e.json.transition&&(o=-1);var a=null===(i=e.json.filter)||void 0===i?void 0:i.match(/^([a-zA-Z]+)(\((.+)\))?/);if(a){var s=a[1],u=a[3];Yy[s]&&(n.filter=new Yy[s](u),n.filterType="".concat(s,"-").concat(u),n.filter&&(n.filter.transition=o))}return n}return S(r,[{key:"removeFilter",value:function(){var e,t=this;if((null===(e=this.timingTarget)||void 0===e?void 0:e.container.filters)&&this.filter){var r=this.timingTarget.container.filters.findIndex((function(e){return e===t.filter}));r>=0&&this.timingTarget.container.filters.splice(r,1)}}},{key:"modifyAttrKey",get:function(){return this.filterType}}]),r}(ny),Xy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startPos=null,n.onTimeNodeStart=function(){var e,t;n.startPos={x:(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_x)||0,y:(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_y)||0}},n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r,o=null===(t=n.path)||void 0===t?void 0:t.getPoint(i);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+ +n.timingTarget.design_ppt_y)},n.onSeekToStart=function(){n.timingTarget&&n.startPos&&(n.timingTarget.ppt_x=n.startPos.x,n.timingTarget.ppt_y=n.startPos.y)},n.onSeekToEnd=function(){var e,t,r,i=null!==(t=null===(e=n.commonTimeNode.json)||void 0===e?void 0:e.spd)&&void 0!==t?t:1,o=null===(r=n.path)||void 0===r?void 0:r.getPoint(i>0?1:0);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+n.timingTarget.design_ppt_y)},n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n.createPath(),n}return S(r,[{key:"createPath",value:function(){var e,t,r=new os,n=null===(e=this.json.path)||void 0===e?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(n){var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=a)||s(t)||k(t)||h(),l=u[0],f=u.slice(1);if("M"===l){var p=c(f.map((function(e){return Number(e)})),2),v=p[0],g=p[1];r.moveTo(v,g)}else if("L"===l){var m=c(f.map((function(e){return Number(e)})),2),y=m[0],_=m[1];r.lineTo(y,_)}else if("C"===l){var b=c(f.map((function(e){return Number(e)})),6),x=b[0],w=b[1],S=b[2],T=b[3],E=b[4],A=b[5];r.bezierCurveTo(x,w,S,T,E,A)}else if("Z"===l)r.closePath();else if("E"===l)console.warn("not implements");else if("c"===l){var I=c(f.map((function(e){return Number(e)})),6),C=I[0],P=I[1],N=I[2],O=I[3],R=I[4],D=I[5],L=r.currentPoint;r.bezierCurveTo(C+L.x,P+L.y,N+L.x,O+L.y,R+L.x,D+L.y)}else if("l"===l){var j=r.currentPoint,z=c(f.map((function(e){return Number(e)})),2),B=z[0],F=z[1];r.lineTo(B+j.x,F+j.y)}else if("m"===l){var U=r.currentPoint,W=c(f.map((function(e){return Number(e)})),2),G=W[0],V=W[1];r.moveTo(G+U.x,V+U.y)}}}catch(e){o.e(e)}finally{o.f()}}this.path=r}},{key:"modifyAttrKey",get:function(){return"motion"}}]),r}(ny),qy=function(e){p(r,e);var t=g(r);function r(e){var n,i;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.onTimelineStart=function(e){e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t,r,i,o,a,s=e.duration,u=e.delta/s,l={x:1,y:1};if(n.to){var c=null!==(t=n.from)&&void 0!==t?t:{x:null!==(i=null===(r=n.startVal)||void 0===r?void 0:r.x)&&void 0!==i?i:1,y:null!==(a=null===(o=n.startVal)||void 0===o?void 0:o.y)&&void 0!==a?a:1};l.x=c.x+(n.to.x-c.x)*u,l.y=c.y+(n.to.y-c.y)*u}else if(n.by){var h={x:n.by.x,y:n.by.y};l.x=1+(h.x-1)*u,l.y=1+(h.y-1)*u}n.timingTarget&&(n.timingTarget.scale=l)},n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y})},n.onSeekToStart=function(){n.timingTarget&&n.startVal&&(n.timingTarget.scale=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&(n.timingTarget.scale=n.createVal)},n.from=e.json.from,n.to=e.json.to,n.by=e.json.by,n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),(null===(i=n.timingTarget)||void 0===i?void 0:i.scale.x)&&(n.createVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y}),n}return S(r,[{key:"updateCurrentValue",value:function(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}},{key:"modifyAttrKey",get:function(){return"scale"}}]),r}(ny),Qy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isTimelineStart=!1,n.startColorString=null,n.currentColorString="#FFFFFFFF",n.onTimelineStart=function(e){if(!n.isTimelineStart){n.isTimelineStart=!0,e.isReverse||n.updateCurrentValue(),n.from.isInit()||n.from.fromHexString(n.currentColorString),n.to.isInit()||n.from.by(n.by,n.to);var t=c(n.json.cBhvr.attrList[0].split("."),1)[0];ty(n.timingTarget,t+".on","true")}},n.onTimeNodeEnd=function(){var e=n.json.cBhvr.attrList[0];if("remove"===n.json.cBhvr.ctn.fill){var t=c(e.split("."),1)[0];ty(n.timingTarget,t+".on","false")}n.isTimelineStart=!1},n.onSeekToStart=function(){var e,t=n.json.cBhvr.attrList[0];if(n.timingTarget){n.onTimeUpdate({duration:1,delta:0});var r="ppt_c.color"===t||"text.color"===t;if((null===(e=n.timingTarget.fill)||void 0===e?void 0:e.designColor.toUpperCase())===n.from.toHexString().toUpperCase()||r){var i=c(t.split("."),1)[0];ty(n.timingTarget,i+".on","false")}}},n.onTimeNodeStart=function(){if(n.timingTarget){var e=n.json.cBhvr.attrList[0],t=ry(n.timingTarget,e);t&&(n.startColorString=t)}},n.onTimeUpdate=function(e){var t=e.delta/e.duration;if(n.to.interpolationFrom(n.from,t,n.target),n.timingTarget){var r=n.json.cBhvr.attrList[0];ty(n.timingTarget,r,n.target.toHexString())}},n.onSeekToEnd=function(){n.isTimelineStart||n.onTimelineStart({isReverse:!1,activeCount:0,id:""}),n.onTimeUpdate({duration:1,delta:1})},n.replaceAttrToRelation(),"rgb"===n.json.clrSpc?(n.from=new Hv(n.json.from),n.to=new Hv(n.json.to),n.by=new Hv(n.json.by),n.target=new Hv):(n.from=new Vv(n.json.from),n.to=new Vv(n.json.to),n.by=new Vv(n.json.by),n.target=new Vv),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeEnd",n.onTimeNodeEnd),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n}return S(r,[{key:"replaceAttrToRelation",value:function(){var e=this.json.cBhvr.attrList[0];"ppt_c"!==e?"style.color"===e&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}},{key:"updateCurrentValue",value:function(){if(this.timingTarget){var e=this.json.cBhvr.attrList[0],t=ry(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),Zy=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.lastVal=null,n.onTimelineStart=function(e){n.lastVal=null,e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=0;if(void 0!==n.from&&void 0!==n.to){var o=(i=n.from)+(n.to-i)*r;n.timingTarget&&(n.timingTarget.r=o)}else if(void 0!==n.by){n.lastVal||(n.lastVal=0);var a=n.by*r-n.lastVal;n.lastVal=n.by*r,n.timingTarget&&(n.timingTarget.r+=a)}},n.onTimeNodeCreate=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.createVal=n.timingTarget.r)},n.onTimeNodeStart=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.startVal=n.timingTarget.r)},n.onSeekToStart=function(){n.timingTarget&&null!==n.startVal&&(n.timingTarget.r=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){n.timingTarget&&null!==n.createVal&&(n.timingTarget.r=n.createVal),n.startVal=null},n.from=n.json.from,n.to=n.json.to,n.by=n.json.by,n.by?n.isConflict=!1:n.isConflict=!0,n.onTimeNodeCreate(),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n}return S(r,[{key:"updateCurrentValue",value:function(){var e;this.currentVal=null===(e=this.timingTarget)||void 0===e?void 0:e.r}},{key:"modifyAttrKey",get:function(){return"rotate"}}]),r}(ny),Ky=function(e){p(r,e);var t=g(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isApplied=!1,n.onTimeUpdate=function(){var e,t,r=n.json,i=r.cmd,o=r.cmdType;!n.isApplied&&i&&o&&(n.isApplied=!0,null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand(i,o),n.commonTimeNode.seekToEnd(!1))},n.onSeekToStart=function(){var e,t;n.commonTimeNode.isInInteractiveSeq||null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand("custom-pause","call")},n.onSeekToEnd=function(){},n.commonTimeNode.on("timeNodeStart",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeNodeEnd",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("seekToStart",n.onSeekToStart),n.commonTimeNode.on("seekToEnd",n.onSeekToEnd),n}return S(r,[{key:"modifyAttrKey",get:function(){var e,t,r,n;return(null!==(t=null===(e=this.json)||void 0===e?void 0:e.cmd)&&void 0!==t?t:"")+(null!==(n=null===(r=this.json)||void 0===r?void 0:r.cmdType)&&void 0!==n?n:"")}}]),r}(ny),Jy=function e(t){var r=this;x(this,e),this.runtimeNodeEventHub=new Ks.a,this.onVolumeUpdate=function(e){r.audio.volume(e)},this.stopAudio=function(){r.audio.stop()},this.destroy=function(){r.stopAudio(),r.audio.destroy(),r.ctx.activeMedia.delete(r.audio),r.ctx.volumeAdjuster.off("update",r.onVolumeUpdate)};var n=t.json,i=t.isIterate,o=t.isSub,a=t.eventHub,s=t.ctx,u=t.parent,l=t.iterateType,c=t.iterateIndex,h=t.iterateId,d=t.isInInteractiveSeq,f=t.fromSeqId;this.json=n,this.id=n.cMediaNode.ctn.id,this.commonTimeNode=new t_({json:n.cMediaNode.ctn,isSub:o,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:s,parent:u,isIterate:i,iterateType:l,iterateIndex:c,iterateId:h,isInInteractiveSeq:d,fromSeqId:f});var p=n.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info("redirect media url from ".concat(n.cMediaNode.tgtEl," to ").concat(p," by delegate."),s.taskId)),this.audio=new Hm(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",(function(){r.audio.volume(s.volumeAdjuster.volume),r.audio.play()})),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)};function e_(e){return(null===(t=e)||void 0===t?void 0:t.cBhvr)?e.cBhvr.ctn:function(e){var t,r;return!!(null===(r=null===(t=e)||void 0===t?void 0:t.cMediaNode)||void 0===r?void 0:r.ctn)}(e)?e.cMediaNode.ctn:e.ctn;var t}var t_=function(e){p(r,e);var t=g(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).uuid=uv(),n.isSub=!1,n.isShadow=!1,n.startCount=0,n.applyCount=0,n.isReverse=!1,n.isConflictDispose=!1,n.isIterateEnd=!1,n.parentTimeNode=null,n.isActive=!1,n.isDestroy=!1,n.shouldSeekOnStart=!1,n.repeatTimeoutId="",n.iterateShadows=[],n.isEndEventsEmitted=!1,n.tmFilter=[],n.timeDelta=0,n.isIterate=!1,n.iterateType="el",n.iterateIndex=0,n.children=[],n.subList=[],n.duration=0,n.isNegativeSpeed=!1,n.handleEndCond=function(){n.isActive&&(n.isActive=!1,n.isInfiniteRepeat()?n.repeatTimeNodeEnd():n.seekToEnd(!1,!0))},n.handleActive=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(n.isActive=!0,n.isConflictDispose=!1,n.applyCount+=1,n.json.iterate||n.emit("timeNodeStart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startCount>0&&n.json.restart){if("never"===n.json.restart)return;"whenNotActive"!==n.json.restart&&"always"!==n.json.restart||(n.seekToStart(),n.emit("timeNodeRestart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startTimeLine(e))}else n.startTimeLine(e)},n.updateTimeLine=function(e){var t=e/(rd.b.TARGET_FPMS||.06);n.timeDelta+=t,n.duration-n.timeDelta<=t&&(n.timeDelta=n.duration),n.timeDelta0&&void 0!==arguments[0]&&arguments[0];(n.isTimeNodeEnd()||e)&&(n.isActive=!1,n.isSub&&n.destroy(),n.emitEndEvents())};var a=e.isSub,s=e.isIterate,u=e.ctx,l=e.eventHubs,c=e.parent,h=e.json,d=e.iterateType,f=e.iterateId,p=e.iterateIndex,v=e.isInInteractiveSeq,g=e.fromSeqId;n.isSub=a,n.fromSeqId=g,n.isInInteractiveSeq=v,n.isIterate=s,n.parentTimeNode=c,n.json=h,n.ctx=u,n.iterateIndex=p,n.eventHubs=l,n.iterateType=d,n.iterateId=f,n.tmFilter=null!==(o=null===(i=h.tmFilter)||void 0===i?void 0:i.split(";").map((function(e){return e.split(",").map((function(e){return parseFloat(e.trim())}))})))&&void 0!==o?o:[];var m=Number(n.json.dur),y=n.json.spd||1;if(n.isNegativeSpeed=y<0,Number.isNaN(m)||(n.duration=m/Math.abs(y)),n.uuid+="--"+n.json.id,n.setPreStyle(),h.childTnLst&&n.createChildren(h.childTnLst),n.startConds=new Jm(n.json.id||"",h.stCondLst,l,n.ctx),n.endConds=new Jm(n.json.id||"",h.endCondLst,l,n.ctx),h.endSync&&(n.endSync=new Jm(n.json.id||"",[h.endSync],l,n.ctx),n.endSync.on("active",(function(){var e;"interactiveSeq"===n.json.nodeType&&(n.isActive=!1,n.shouldSeekOnStart=!0,n.emit("timeNodeEndSync"),null===(e=n.endSync)||void 0===e||e.reset())}))),n.startConds.on("active",(function(e){n.isActive||(n.shouldSeekOnStart&&(n.shouldSeekOnStart=!1,n.seekToStart()),n.handleActive(e))})),n.endConds.on("active",(function(){n.handleEndCond(),n.children.forEach((function(e){return e.commonTimeNode.handleEndCond()}))})),n.parentTimeNode&&n.parentTimeNode.on("timeNodeStart",(function(){n.applyCount=0})),n.isSub&&"nextClick"===n.json.masterRel){var _="shape slide onNext"+n.fromSeqId;n.startConds.addCond({event:_})}return n.json.iterate&&!1===n.isIterate&&n.createIterateShadow(),n}return S(r,[{key:"createIterateShadow",value:function(){var e=this,t=uv(),n=!0,i=0;for(this.ctx.eventHub.on("IterateTimeNodeEnd",(function r(i){i===t&&(n=!1,e.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))}));n;){var o=JSON.parse(JSON.stringify(this.json)),a=new r({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[i]=a,i+=1}}},{key:"isInfiniteRepeat",value:function(){return this.json.repeatCount>999999998}},{key:"getReverse",value:function(){return this.isReverse}},{key:"setReverse",value:function(e){this.isReverse=e}},{key:"createTimeNode",value:function(e,t){var r=null,n={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return"seq"===e.type?r=new ey(n):"par"===e.type?r=new r_(n):"set"===e.type?r=new iy(n):"anim"===e.type?r=new hy(n):"animEffect"===e.type?r=new $y(n):"animMotion"===e.type?r=new Xy(n):"animScale"===e.type?r=new qy(n):"animClr"===e.type?r=new Qy(n):"animRot"===e.type?r=new Zy(n):"cmd"===e.type?r=new Ky(n):"audio"===e.type&&(r=new Jy(n)),r}},{key:"createSubList",value:function(e){var t=this;this.subList&&this.subList.forEach((function(e){return e.commonTimeNode.destroy()})),this.subList=[],e.forEach((function(e){var r=t.createTimeNode(e,!0);r&&t.subList.push(r)}))}},{key:"bindCommonTimeNodeEvent",value:function(e){var t=this;e.commonTimeNode.on("timeNodeStart",(function(e){t.emit("childTimeNodeStart",e)})),e.commonTimeNode.on("timeNodeEnd",(function(e){t.emit("childTimeNodeEnd",e),t.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))&&(t.json.iterate||t.allChildrenEndHandle())}))}},{key:"createChildren",value:function(e){var t=this;function r(e){return e_(e).presetOrder}function n(e){return/^slide/.test(e)?"slide":/^layout/.test(e)?"layout":/^master/.test(e)?"master":"unknow"}var i=["master","layout","slide","unknow"];e&&e[0]&&r(e[0])?a(e).sort((function(e,t){var o,a,s,u,l=e_(e).id,c=e_(t).id;if(l&&c){var h=n(l),d=n(c);return h===d?(null!==(o=r(e))&&void 0!==o?o:0)-(null!==(a=r(t))&&void 0!==a?a:0):i.indexOf(h)-i.indexOf(d)}return(null!==(s=r(e))&&void 0!==s?s:0)-(null!==(u=r(t))&&void 0!==u?u:0)})).forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))})):e.forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))}))}},{key:"playReverse",value:function(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach((function(e){return e.commonTimeNode.playReverse()}))}},{key:"allChildrenEndHandle",value:function(){var e=this;if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout((function(){e.seekToStart(!1),e.resetForRepeat(),e.startTimeNodeRepeat()})):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}},{key:"resetForRepeat",value:function(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach((function(e){return e.commonTimeNode.resetForRepeat()}))}},{key:"startSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.startTimeNode()}))}},{key:"startReverseTimeLine",value:function(){this.isEndEventsEmitted=!1,this.timeDelta=0;var e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(__.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(__.animateStart),this.ctx.ticker.add(this.updateTimeLine))}},{key:"startTimeLine",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit("time ".concat(this.json.id," begin")),this.eventHubs.global.emit("time ".concat(this.json.id," onBegin")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," begin"))),this.json.iterate)this.startIterate();else{this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});var r=1e3/this.ctx.ticker.maxFPS;this.duration<=r&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce((function(){e.onTimeLineEnd()}))):this.duration>r&&(this.ctx.eventHub.emit(__.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}}},{key:"startIterate",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.json.iterate){e.next=24;break}this.isIterateEnd=!1,t=M(this.iterateShadows),e.prev=3,t.s();case 5:if((r=t.n()).done){e.next=15;break}if(n=r.value,!this.isIterateEnd){e.next=9;break}return e.abrupt("break",15);case 9:return n.children.forEach((function(e){e.commonTimeNode.startTimeNode()})),n.applyCount+=1,e.next=13,this.ctx.clock.delay(this.json.iterate.interval);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),t.e(e.t0);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.onTimeLineEnd();case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])})))}},{key:"applyTimeFilter",value:function(e){if(!this.tmFilter.every((function(e){return Sv()(e[0])&&Sv()(e[1])})))return e;for(var t=0;t0?this.tmFilter[this.tmFilter.length-1][1]:e}},{key:"isNatureTimeEnd",value:function(){return this.duration>=0&&this.timeDelta>=this.duration}},{key:"findTargets",value:function(){var e=[];return function t(r){r.forEach((function(r){var n,i,o;r.cBhvr&&r.cBhvr.target&&e.findIndex((function(e){return e.id===r.cBhvr.target.id}))<0&&e.push(r.cBhvr.target),(null===(i=null===(n=null==r?void 0:r.cBhvr)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&t(r.cBhvr.ctn.childTnLst),(null===(o=null==r?void 0:r.ctn)||void 0===o?void 0:o.childTnLst)&&r.ctn.childTnLst.length>0&&t(r.ctn.childTnLst)}))}(this.json.childTnLst||[]),e}},{key:"setPreStyle",value:function(){var e=this;this.json.presetClass&&this.findTargets().forEach((function(t){if(e.json.iterate)for(var r=0,n=!0;n;){var i=e.ctx.timingTargets.getTarget(t,!0,{type:e.json.iterate.type,index:r,id:""});i&&(e.setPreStyleForTarget(i),r+=1),n=!!i}else{var o=e.ctx.timingTargets.getTarget(t,!1);o&&e.setPreStyleForTarget(o)}}))}},{key:"setPreStyleForTarget",value:function(e){var t,r;if(e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset)if("entr"===this.json.presetClass){var n=null===(r=null===(t=this.json)||void 0===t?void 0:t.childTnLst)||void 0===r?void 0:r.filter((function(e){return"set"===e.type&&"visible"===e.to}));(null==n?void 0:n.length)&&(e.hasPreset=!0,e.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass||"emph"===this.json.presetClass)&&(e.hasPreset=!0,e.style.visibility="visible")}},{key:"startTimeNodeRepeat",value:function(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}},{key:"startTimeNodeForce",value:function(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}},{key:"startTimeNode",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.isDestroy){this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);var t=this.json.stCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];t&&this.startConds.condHandle(t);var r=this.json.endCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];r&&this.endConds.condHandle(r),this.startConds.condHandle()}}},{key:"onTimeLineEnd",value:function(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}},{key:"clearSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.destroy()}))}},{key:"seekToStart",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(t){return t.seekToStart(e)}));if(e)for(var t=this.subList.length-1;t>=0;t--){var r=this.subList[t];null==r||r.commonTimeNode.seekToStart()}for(var n=this.children.length-1;n>=0;n--){var i=this.children[n];null==i||i.commonTimeNode.seekToStart()}if(this.children.length>1)for(var o=this.children.length-1;o>=0;o--){var a=this.children[o];null==a||a.commonTimeNode.seekToStart()}}},{key:"repeatTimeNodeEnd",value:function(){this.dispose(),this.children.forEach((function(e){e.commonTimeNode.isActive=!1,e.commonTimeNode.dispose()}))}},{key:"dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isConflictDispose=e,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(__.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(e){}this.startConds.reset(),this.endConds.reset()}},{key:"seekToEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isInfiniteRepeat()){!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();var r=this.json.autoRev||e;if(r?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(e){return e.seekToEnd(r,t)}));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach((function(e){return e.commonTimeNode.seekToEnd(r,t)})),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach((function(e){return e.commonTimeNode.seekToEnd(!1)})),this.clearSubList())}}},{key:"isTimeNodeEndWhenDetectEndSync",value:function(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"isTimeNodeEnd",value:function(){var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEnd()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"emitEndEvents",value:function(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit("time ".concat(this.json.id," end")),this.eventHubs.global.emit("time ".concat(this.json.id," onEnd")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," end")),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}},{key:"collectStartValue",value:function(){this.emit("timeNodeCreate"),this.children.forEach((function(e){return e.commonTimeNode.collectStartValue()}))}},{key:"destroy",value:function(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach((function(e){return e.commonTimeNode.destroy()})),this.clearSubList()}}]),r}(Ks.a),r_=function(e){p(r,e);var t=g(r);function r(e){var n;x(this,r),(n=t.call(this)).isRunning=!1,n.runtimeNodeEventHub=new Ks.a;var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,c=e.eventHub,h=e.iterateIndex,d=e.iterateId,f=e.isInInteractiveSeq,p=e.fromSeqId;return n.id=i.ctn.id,n.json=i,n.ctx=l,n.isIterate=a,n.globalEventHub=c,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:c,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:h,iterateId:d,isInInteractiveSeq:f,fromSeqId:p}),n.commonTimeNode.on("timeNodeStart",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.setReverse(n.commonTimeNode.getReverse()),e.commonTimeNode.startTimeNode()})),n.isRunning||(n.isRunning=!0,n.globalEventHub.emit("runtime ".concat(n.id," begin")),n.emit("begin"))})),n.commonTimeNode.on("timeNodeRepeat",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.startTimeNode(!1)}))})),n.commonTimeNode.on("timeNodeEnd",(function(){n.commonTimeNode.isTimeNodeEnd()&&n.isRunning&&(n.isRunning=!1,n.globalEventHub.emit("runtime ".concat(n.id," end")),n.emit("end")),"exit"===n.commonTimeNode.json.presetClass&&n.commonTimeNode.children.length>=1&&n.commonTimeNode.children[n.commonTimeNode.children.length-1]instanceof iy&&n.commonTimeNode.children.forEach((function(e){e instanceof iy||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),n}return r}(Ks.a),n_=function(){function e(t,r,n){x(this,e),this.json=t,this.ctx=n,this.globalEventHub=r;var i=t.timeNodeList.find((function(e){return"par"===e.type&&"tmRoot"===e.ctn.nodeType}));i&&(this.tmRoot=new r_({json:i,isSub:!1,isIterate:!1,eventHub:r,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"mainSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))}return S(e,[{key:"findSeq",value:function(e){var t;return null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.find((function(t){var r,n,i;return"seq"===(null===(r=t.json)||void 0===r?void 0:r.type)&&(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.id)===e}))}},{key:"start",value:function(){var e,t;return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.json.autoPlayMainSeq){r.next=6;break}return r.next=3,this.ctx.clock.delay(16);case 3:null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode(),r.next=7;break;case 6:null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode();case 7:case"end":return r.stop()}}),r,this)})))}},{key:"setMainSeqApplied",value:function(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}},{key:"collectMainSeqStartValue",value:function(){var e;null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.collectStartValue()}},{key:"setMainSeqStep",value:function(e,t){var r;-1===e&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(r=this.mainSeq)||void 0===r||r.setCurrentStep(e,t)}},{key:"destroy",value:function(){var e;this.globalEventHub.removeAllListeners(),null===(e=this.tmRoot)||void 0===e||e.commonTimeNode.destroy()}},{key:"hasMainSeq",value:function(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}},{key:"currentMainSeqState",value:function(){return this.mainSeq?this.mainSeq.currentState:null}},{key:"currentMainSeqStep",value:function(){return this.mainSeq?this.mainSeq.currentStep:0}},{key:"currentMainSeqLength",value:function(){return this.mainSeq?this.mainSeq.stepLength:0}},{key:"mainSeqHasNextStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasNext()}},{key:"mainSeqHasPrevStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasPrev()}},{key:"seekInteractiveSeqToEnd",value:function(e){var t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n=this.findSeq(e);n&&n.setCurrentStep(t,r)}},{key:"resetAllInteractiveSeq",value:function(){var e;((null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.filter((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"interactiveSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))||[]).forEach((function(e){e.setCurrentStep(0,"start")}))}},{key:"applyInteractiveAction",value:function(e){this.globalEventHub.emit(e)}}]),e}(),i_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o_=function(e){p(r,e);var t=g(r);function r(e,n,i,o){var a;x(this,r),(a=t.call(this,{id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},n,{parentGlobalPos:i},o)).isRendered=!1,a.isTimingStartValueCollected=!1,a.json=e,a.json.smartArtShapeList&&(n.smartArtShapeList=a.json.smartArtShapeList),n.hasBackgroundFillShape=a.detectUseBackgroundFill(a.json),a.container.visible=!1,a.ctx=n;var s=new Nd;return s.beginFill(16777215),s.drawRect(0,0,e.width,e.height),s.endFill(),a.container.addChild(s),a}return S(r,[{key:"detectUseBackgroundFill",value:function(e){var t=this;return!!e&&("Picture"===e.type||"Shape"===e.type?e.useBgFill:!(!e.children||!Array.isArray(e.children))&&e.children.some((function(e){return t.detectUseBackgroundFill(e)})))}},{key:"initOnReuse",value:function(){var e=this;f(b(r.prototype),"initOnReuse",this).call(this),this.ctx.timingEventHub.on("c:prev slide",(function(t){e.ctx.eventHub.emit(__.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,r){e.ctx.eventHub.emit(__.requestNextSlide,t,r)}))}},{key:"applyEffectCacheAsBitMap",value:function(e){this.children.forEach((function(t){return t.applyEffectCacheAsBitMap(e)}))}},{key:"render",value:function(e){var t=this;this.isRendered||(this.collectAnimatedIds().forEach((function(e){return t.ctx.animatedIds.add(e)})),this.isRendered=!0,f(b(r.prototype),"render",this).call(this,e),e.addSubMTask((function(){return i_(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.eventHub.emit("StageRenderEnd");case 1:case"end":return e.stop()}}),e,this)})))}),"@StageImpl[emit.StageRenderEnd]"))}},{key:"isListTimeNode",value:function(e){return["excel","seq","par"].indexOf(e.type)>=0}},{key:"isAnimatedTimeNode",value:function(e){return!!e.cBhvr}},{key:"collectAnimatedIdsForTimeNode",value:function(e,t){var r,n=this;this.isListTimeNode(e)?null===(r=e.ctn.childTnLst)||void 0===r||r.forEach((function(e){n.collectAnimatedIdsForTimeNode(e,t)})):this.isAnimatedTimeNode(e)&&t.push(e.cBhvr.target.id)}},{key:"collectAnimatedIds",value:function(){var e=this,t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach((function(r){e.collectAnimatedIdsForTimeNode(r,t)})),t}},{key:"createTiming",value:function(){this.json.timing&&!this.timing&&(this.timing=new n_(this.json.timing,this.ctx.timingEventHub,this.ctx))}},{key:"startTiming",value:function(){var e;return(null===(e=this.timing)||void 0===e?void 0:e.start())||Promise.resolve()}},{key:"setMainSeqApplied",value:function(){var e;null===(e=this.timing)||void 0===e||e.setMainSeqApplied()}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.timing)||void 0===r||r.setMainSeqStep(e,t)}},{key:"collectMainSeqStartValue",value:function(){var e;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(e=this.timing)||void 0===e||e.collectMainSeqStartValue())}},{key:"hasTiming",value:function(){return!!this.timing}},{key:"clearOnSlideChange",value:function(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),f(b(r.prototype),"clearOnSlideChange",this).call(this)}},{key:"clearOnTransactionEnd",value:function(){var e,t;this.ctx.timingTargets.getTargets().forEach((function(e){e.hasPreset=!1})),null===(e=this.timing)||void 0===e||e.resetAllInteractiveSeq(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0}},{key:"destroy",value:function(){var e,t;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(e=this.ctx.bgTexture)||void 0===e||e.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0,f(b(r.prototype),"destroy",this).call(this)}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqStep())&&void 0!==t?t:0}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"mainSeqState",value:function(){return this.timing?this.timing.currentMainSeqState():null}},{key:"nextStep",value:function(e,t){var r;this.hasTiming()&&(null===(r=this.timing)||void 0===r?void 0:r.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",e,t)):this.ctx.eventHub.emit(__.requestNextSlide,e,t)}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hasTiming()&&(null===(e=this.timing)||void 0===e?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(__.requestPrevSlide,t)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.timing)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.timing)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.timing)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){return i_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=this.ctx.medias[e],n.t0=i,!n.t0){n.next=21;break}if(!t){n.next=18;break}if(!r){n.next=14;break}return n.next=7,dv((function(){return i.clippedDuration>0}),5e3);case 7:if(n.t1=r=0&&t.tasks.splice(r,1)})),e.once("task-error",(function(){var r=t.tasks.indexOf(e);r>=0&&t.tasks.splice(r,1)}))}},{key:"start",value:function(){this.couldRunning=!0}},{key:"stop",value:function(){this.couldRunning=!1}}]),e}(),s_=function(e){return new Promise((function(t){return setTimeout(t,e)}))},u_=function(e){p(r,e);var t=g(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).slideIndex=e,o.taskId=n,o.logger=i,o.uuid=uv(),o.isCancel=!1,o.tasks=[],o}return S(r,[{key:"isEmpty",value:function(){return 0===this.tasks.length}},{key:"addMTask",value:function(e,t){this.tasks.push({fn:e,state:"wait",sub:[],name:t})}},{key:"addSubMTask",value:function(e,t){var r=this.tasks.findIndex((function(e){return"running"===e.state}));r<0&&(r=0),this.tasks[r].sub.push({fn:e,state:"wait",sub:[],name:t})}},{key:"cancel",value:function(){this.tasks=[],this.isCancel=!0}},{key:"applyNext",value:function(){var e=this;if(!this.tasks.some((function(e){return"running"===e.state}))&&!this.tasks.some((function(e){return"error"===e.state})))if(this.tasks.every((function(e){return"finish"===e.state})))this.isCancel||this.emit("task-finish");else{var t=this.tasks.find((function(e){return"wait"===e.state}));t&&(t.state="running",t.fn.apply(null).then((function(){if(t.state="finish",t.sub.length>0){var r,n=e.tasks.findIndex((function(e){return e===t}));(r=e.tasks).splice.apply(r,[n+1,0].concat(a(t.sub)))}})).catch((function(r){t.state="error",e.logger.error("".concat(r," ").concat(r.stack),e.taskId),e.emit("task-error",nv.transform(r),e.slideIndex)})))}}},{key:"applyAll",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.tasks.every((function(e){return"finish"===e.state}))){e.next=14;break}if(!this.tasks.some((function(e){return"running"===e.state}))){e.next=6;break}return e.next=4,s_(16);case 4:e.next=12;break;case 6:if(!this.tasks.some((function(e){return"error"===e.state}))){e.next=8;break}return e.abrupt("return");case 8:return e.delegateYield(regeneratorRuntime.mark((function e(){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.tasks.find((function(e){return"wait"===e.state})))){e.next=17;break}return r.state="running",e.prev=3,e.next=6,hv((function(){return r.fn.apply(null)}),6e4);case 6:if(e.t0=e.sent,e.t1=lv,e.t0!==e.t1){e.next=10;break}throw new nv(Zp.RuntimeError,"subtask ".concat(r.name," apply timeout"));case 10:r.state="finish",r.sub.length>0&&(i=t.tasks.findIndex((function(e){return e===r})),(n=t.tasks).splice.apply(n,[i+1,0].concat(a(r.sub)))),e.next=17;break;case 13:return e.prev=13,e.t2=e.catch(3),o=(null==e.t2?void 0:e.t2.errorType)?e.t2:new nv(Zp.RuntimeError,"subtask ".concat(r.name," error. ").concat(e.t2)),r.state="error",t.logger.error("".concat(e.t2," ").concat(e.t2.stack),t.taskId),t.emit("task-error",nv.transform(o),t.slideIndex),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,13]])}))(),"t0",9);case 9:if("break"!==e.t0){e.next=12;break}return e.abrupt("break",14);case 12:e.next=0;break;case 14:!this.isCancel&&this.tasks.every((function(e){return"finish"===e.state}))&&this.emit("task-finish");case 15:case"end":return e.stop()}}),e,this)})))}}]),r}(Ks.a),l_=function(){function e(t,r){var n=this;x(this,e),this.renderer=t,this.localStorage=r,this.worker=null,this.outputData=new Map,this.loadingSdfKeys=new Set;var i=new Blob(['\nself.onmessage = function(e) {\n var data = e.data.data;\n var key = e.data.key;\n var height = Math.ceil(e.data.height);\n var width = Math.ceil(e.data.width);\n if (!data || !key) {\n return;\n }\n var maxDis = 0;\n var d = [];\n var p = [];\n var maxInt = Number.MAX_SAFE_INTEGER || 255 * 255 * 255;\n var setD = function(x, y, v) { d[y * width + x] = v; };\n var getD = function(x, y) { return d[y * width + x]; };\n var setP = function(x, y, v) { p[y * width + x] = v; };\n var getP = function(x, y) { return p[y * width + x]; };\n var isContains = function(x, y) { return x >= 0 && x < width && y >= 0 && y < height; };\n var isInterior = function(x, y) { return data[(y * width + x) * 4 + 3] > 10; };\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var c = isInterior(x, y);\n var t = isContains(x, y - 1) ? isInterior(x, y - 1) : false;\n var b = isContains(x, y + 1) ? isInterior(x, y + 1) : false;\n var l = isContains(x - 1, y) ? isInterior(x - 1, y) : false;\n var r = isContains(x + 1, y) ? isInterior(x + 1, y) : false;\n if (c !== t || c !== b || c !== l || c !== r) {\n setD(x, y, 0);\n setP(x, y, [x, y]);\n } else {\n setD(x, y, maxInt);\n setP(x, y, [-1, -1]);\n }\n }\n }\n \n var f = function (x, y, dir) {\n var d1 = 1;\n var d2 = Math.sqrt(2);\n var dx;\n var dy;\n var od;\n switch (dir) {\n case "TL": dx = -1; dy = -1; od = d2; break;\n case "T": dx = 0; dy = -1; od = d1; break;\n case "TR": dx = 1; dy = -1; od = d2; break;\n case "L": dx = -1; dy = 0; od = d1; break;\n case "R": dx = 1; dy = 0; od = d1; break;\n case "BL": dx = -1; dy = 1; od = d2; break;\n case "B": dx = 0; dy = 1; od = d1; break;\n case "BR": dx = 1; dy = 1; od = d2; break;\n }\n var b = isContains(x + dx, y + dy);\n var cb = b ? getD(x + dx, y + dy) : maxInt;\n if (cb + od < getD(x, y)) {\n var p = b ? getP(x + dx, y + dy) : [-1, -1];\n var dis = Math.sqrt(Math.pow(x - p[0], 2) + Math.pow(y - p[1], 2));\n setP(x, y, p);\n setD(x, y, dis);\n if (dis > maxDis) {\n maxDis = dis;\n }\n }\n };\n \n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var dirs = ["TL", "T", "TR", "L"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n for (var y = height - 1; y >= 0; -- y) {\n for (var x = width - 1; x >= 0; -- x) {\n var dirs = ["R", "BL", "B", "BR"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n var outputData = [];\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n outputData.push(isInterior(x, y) ? 255: 0);\n outputData.push(0);\n outputData.push(0);\n outputData.push(Math.ceil(getD(x, y) / maxDis * 255));\n }\n }\n self.postMessage({\n key, outputData, maxDis\n });\n};\n'],{type:"text/javascript"});this.worker=new Worker(URL.createObjectURL(i)),this.worker.onmessage=function(e){n.outputData.set(e.data.key,{data:e.data.outputData,maxDis:e.data.maxDis})},this.outputData.set("111","222")}return S(e,[{key:"createSdfByWorker",value:function(e,t,r,n,i,o,a,s){var u=document.createElement("canvas");u.width=i,u.height=o;var l=u.getContext("2d");if(l&&this.worker){l.drawImage(a,e,t,r,n);var c=l.getImageData(0,0,i,o).data;this.worker.postMessage({data:c,key:s,width:i,height:o})}}},{key:"createSdf",value:function(e,t,r){var n=document.createElement("canvas");n.width=e,n.height=t;var i=n.getContext("2d");if(!i)return{src:"",maxDis:1};i.drawImage(r,0,0);for(var o=0,a=i.getImageData(0,0,e,t).data,s=[],u=[],l=function(t,r,n){s[r*e+t]=n},c=function(t,r){return s[r*e+t]},h=function(t,r,n){u[r*e+t]=n},d=function(r,n){return r>=0&&r=0&&n10},p=0;po&&(o=g)}},w=0;w=0;--k)for(var E=e-1;E>=0;--E)for(var A=0,I=["R","BL","B","BR"];At.maxResolution.x||s>t.maxResolution.y){var n=(r=t.maxResolution.x/a)*s;n>t.maxResolution.y&&(r*=t.maxResolution.y/n)}return o.loadSpriteSheetItem(t.url,t.taskId,e,r)}),"@StagePool[spriteTexture.loadSpriteSheetItem]")})),Promise.resolve()}),"@StagePool[loadSpriteSheets]")}},{key:"createStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){var n=t.stageJsons[e],i=t.stageCtxs[e],o=new o_(n,i,{x:0,y:0},r);return t.stageImpls[e]=o,Promise.resolve()}),"@StagePool[createStage]")}},{key:"preRenderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return t.stageImpls[e].preRender(r),Promise.resolve()}),"@StagePool[preRenderStage]")}},{key:"createGraphicsTexture",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(n=this.stageCtxs[e]).graphicsTexture.pack().forEach((function(e,t){r.addSubMTask((function(){return n.graphicsTexture.render(e,t,i.objPoolGroup,1)}),"@StagePool[graphicsTexture.render]")}));case 2:case"end":return t.stop()}}),t,this)})))}),"@StagePool[createGraphicsTexture]")}},{key:"renderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.stageImpls[e],t.next=3,n.render(r);case 3:case"end":return t.stop()}}),t,this)})))}),"@StagePool[renderStage]")}},{key:"destroyStageByIndex",value:function(e){"load"===this.stageStates[e].state&&this.stageStates[e].task.cancel(),delete this.stageStates[e],this.stageImpls[e].destroy(),delete this.stageImpls[e],delete this.stageCtxs[e]}},{key:"destroyStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);Math.abs(e.currentStageIndex-r)>e.cacheCount&&e.destroyStageByIndex(r)}))}},{key:"destroyAllStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);e.destroyStageByIndex(r)}))}},{key:"preload",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stageImpls[e]||this.stageStates[e])return Promise.resolve();var n=new u_(e,this.taskId,this.logger);return n.on("task-error",(function(e,r){delete t.stageStates[r],delete t.stageImpls[r],delete t.stageCtxs[r],t.errorChannel.emit("error",e,r)})),this.stageStates[e]={state:"load",task:n},this.createCtx(e),this.loadStageJson(e),this.loadSpriteSheets(e),this.createStage(e),this.preRenderStage(e),this.createGraphicsTexture(e),this.renderStage(e),this.microTaskManager.addTask(n),r?n.applyAll():new Promise((function(r){n.once("task-finish",(function(){t.stageStates[e].state="finish",Object.keys(t.stageStates).length>2*t.cacheCount+1&&t.destroyStage(),r()}))}))}},{key:"getStageJson",value:function(e){return this.stageJsons[e]||null}},{key:"getStage",value:function(e){return c_(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.currentStageIndex=e,"finish"!==(null==(r=this.stageStates[e])?void 0:r.state)||!this.stageImpls[e]){t.next=6;break}t.t0=this.stageImpls[e],t.next=16;break;case 6:if("load"!==(null==r?void 0:r.state)){t.next=12;break}return t.next=9,r.task.applyAll();case 9:t.t1=this.stageImpls[e],t.next=15;break;case 12:return t.next=14,this.preload(e,!0);case 14:t.t1=this.stageImpls[e];case 15:t.t0=t.t1;case 16:return t.abrupt("return",t.t0);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"destroy",value:function(){this.runningAudio.clear(),this.sdfManager.destroy()}}]),e}(),d_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},f_=function(){function e(t){var r,n=this;x(this,e),this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,null===(r=e.localCache)||void 0===r||r.ready((function(e){e||(n.isIndexDBReady=!0)})).catch((function(){t.warn("local storage not ready",n.taskId)}))}return S(e,[{key:"attachTaskId",value:function(e){this.taskId=e}},{key:"getItem",value:function(t){return d_(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null,!this.couldUseIndexDBCache||!e.localCache){r.next=10;break}return r.prev=2,r.next=5,hv((function(){return e.localCache.getItem("".concat(i.taskId,"/").concat(t))}),500);case 5:n=r.sent,r.next=10;break;case 8:r.prev=8,r.t0=r.catch(2);case 10:return r.abrupt("return",(n=n===lv?null:n)||this.memoryCache.get(t)||null);case 11:case"end":return r.stop()}}),r,this,[[2,8]])})))}},{key:"setItem",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return d_(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(this.couldUseIndexDBCache){i.next=2;break}return i.abrupt("return",(n&&this.memoryCache.set(t,r),Promise.resolve()));case 2:if(!e.localCache){i.next=13;break}return o=null,i.prev=4,i.next=7,hv((function(){return e.localCache.setItem("".concat(a.taskId,"/").concat(t),r).catch((function(){n&&a.memoryCache.set(t,r)}))}),500);case 7:o=i.sent,i.next=12;break;case 10:i.prev=10,i.t0=i.catch(4);case 12:o!==lv&&null!==o||!n||this.memoryCache.set(t,r);case 13:case"end":return i.stop()}}),i,this,[[4,10]])})))}},{key:"dispose",value:function(){var t,r=this;this.memoryCache=new Map,this.couldUseIndexDBCache&&(null===(t=e.localCache)||void 0===t||t.keys().then((function(t){t.filter((function(e){return e.indexOf(r.taskId)>=0})).forEach((function(t){var r;null===(r=e.localCache)||void 0===r||r.removeItem(t).catch((function(){}))}))})).catch((function(){})))}},{key:"couldUseIndexDBCache",get:function(){return this.isIndexDBReady&&this.taskId.length>0}}]),e}();f_.localCache=null;try{f_.localCache=_.createInstance({name:"slide_local_cache",driver:_.INDEXEDDB,version:1})}catch(u){}var p_=new jl.j,v_=function(){function e(t){x(this,e),this.localStorage=t}return S(e,[{key:"canvas",value:function(t,r,n,i){var o,a,s,u=!1,l=!1;t&&(t instanceof $l.p?s=t:(s=r.generateTexture(t),l=!0)),s?(o=s.baseTexture.resolution,a=s.frame,u=!1,r.renderTexture.bind(s)):(o=r.resolution,u=!0,(a=p_).width=r.width,a.height=r.height,r.renderTexture.bind(null));var c=Math.floor(a.width*o+1e-4),h=Math.floor(a.height*o+1e-4),d=document.createElement("canvas");d.width=c,d.height=h;var f=d.getContext("2d");if(!f)throw new Error("ctx");if(n)f.putImageData(n,0,0);else{var p=f.getImageData(0,0,c,h),v=new Uint8Array(4*c*h),g=r.gl;g.readPixels(a.x*o,a.y*o,c,h,g.RGBA,g.UNSIGNED_BYTE,v),e.arrayPostDivide(v,p.data),f.putImageData(p,0,0),i&&this.localStorage.setItem(i,p).catch((function(){}))}if(u){var m=document.createElement("canvas");m.width=c,m.height=h;var y=m.getContext("2d");y.scale(1,-1),y.drawImage(d,0,-h),d=m}return l&&(null==s||s.destroy(!0)),d}}],[{key:"arrayPostDivide",value:function(e,t){for(var r=0;r1&&(e=1),this._volume=e,this.emit("update",this._volume)}}]),r}(Ks.a),m_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Rl.skipHello();var y_={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip",gallery:"Gallery",switch:"Switch",prism:"Prism",doors:"Doors"},__={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",mediaStop:"mediaStop",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",requestOpenUrl:"requestOpenUrl",userInput:"userInput",fullscreenChange:"fullscreenChange",changeLocalFullscreenState:"changeLocalFullscreenState"},b_=function(e){p(r,e);var t=g(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(this,r),(n=t.call(this)).errorChannel=new Ks.a,n.transactionPlayer=null,n.isForward=!0,n.drawCall=0,n.scale=1,n._isPaused=!1,n.maxResolution=new jl.g(0,0),n.isNVIDIA=!1,n.fps=new rv,n.designWidth=0,n.designHeight=0,n.currentIndex=0,n.slideCount=0,n.runtime={drawCall:0,fps:0},n.globalEventHub=new Ks.a,n.globalVideoBackground=new Nd,n.globalVideoSprite=new Ld,n.onMousemoveTimeout=null,n.cacheFunctionMap=new Map,n.isPlayerPaused=function(){return n._isPaused},n.onWebGLLost=function(){n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost."))},n.fullscreenOnMousemove=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!0}),n.onMousemoveTimeout&&clearTimeout(n.onMousemoveTimeout),n.onMousemoveTimeout=setTimeout((function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})}),jm)},n.fullscreenOnMouseleave=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})},n.calculateFullscreenVideoPosition=function(e){var t=e.width,r=e.height,i=y(n),o=i.designWidth,a=i.designHeight,s=Math.min(o/t,a/r);return{x:(o-t*s)/2,y:(a-r*s)/2,width:t*s,height:r*s}},n.onRequestFullscreenVideo=function(e){var t=e.texture,r=e.index,i=e.targetId;if(r===n.currentIndex){n.onRequestCancelFullscreenVideo(),n.globalVideoBackground.width=n.designWidth,n.globalVideoBackground.height=n.designHeight,n.globalVideoBackground.beginFill(0,1),n.globalVideoBackground.drawRect(0,0,n.designWidth,n.designHeight),n.globalVideoBackground.endFill(),n.globalVideoBackground.interactive=!0,n.app.stage.addChild(n.globalVideoBackground);var o=n.calculateFullscreenVideoPosition(t),a=o.x,s=o.y,u=o.width,l=o.height;n.globalVideoSprite.texture=t,n.globalVideoSprite.width=u,n.globalVideoSprite.height=l,n.globalVideoSprite.position.x=a,n.globalVideoSprite.position.y=s,n.globalVideoBackground.addChild(n.globalVideoSprite),n.globalEventHub.emit("onFullscreenChange",{status:!0,targetId:i,slideIndex:n.currentIndex}),n.clearFullscreenEventListenersWithAppView();var c={handleEvent:function(){var e;null===(e=n.currentStage)||void 0===e||e.ctx.eventHub.emit(__.userInput)}};if(n.app.view.addEventListener("pointerdown",c,!1),n.cacheFunctionMap.set("pointerdown",c),Om.isDesktop()){var h={handleEvent:function(){n.fullscreenOnMouseleave({index:r,targetId:i})}};n.app.view.addEventListener("mouseout",h,!1);var d={handleEvent:function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:r,targetId:i,status:!0})}};n.app.view.addEventListener("mouseover",d,!1);var f={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("mousemove",f,!1),n.cacheFunctionMap.set("mouseover",d),n.cacheFunctionMap.set("mousemove",f),n.cacheFunctionMap.set("mouseout",h)}else{var p={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("touchstart",p,!1),n.cacheFunctionMap.set("touchstart",p)}}else t.destroy(!1)},n.onRequestCancelFullscreenVideo=function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.globalVideoSprite.texture.destroy(!1);try{n.globalVideoBackground.removeChild(n.globalVideoSprite)}catch(e){n.logger.error("removeChild error: PPTPlayer:1057",n.taskId)}try{n.app.stage.removeChild(n.globalVideoBackground)}catch(e){n.logger.error("removeChild error: PPTPlayer:1062",n.taskId)}n.globalEventHub.emit("onFullscreenChange",{status:!1,slideIndex:n.currentIndex,targetId:null===(e=n.currentStage)||void 0===e?void 0:e.ctx.latestChangeFullscreenTargetId}),n.clearFullscreenEventListenersWithAppView(),r&&n.emit(__.changeLocalFullscreenState,{status:!1,slideIndex:n.currentIndex,targetId:null===(t=n.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},n.logger=e.logger,n.tracker=e.tracker,n.mode=e.mode,n.volumeAdjuster=e.volumeAdjuster,n.localStorage=new f_(n.logger),n.cachedExtract=new v_(n.localStorage),n.config={minFPS:ru()(i.minFPS)?30:i.minFPS,maxFPS:ru()(i.maxFPS)?40:i.maxFPS,resolution:ru()(i.resolution)?1:i.resolution,autoFPS:!ru()(i.autoFPS)&&i.autoFPS,autoResolution:!ru()(i.autoResolution)&&i.autoResolution,transactionBgColor:ru()(i.transactionBgColor)?0:i.transactionBgColor,maxResolutionLevel:n.getMaxResolution(i.maxResolutionLevel),forceCanvas:!ru()(i.forceCanvas)&&i.forceCanvas,enableNvidiaDetect:!ru()(i.enableNvidiaDetect)&&i.enableNvidiaDetect},n.updateMaxResolutionLevel(n.config.maxResolutionLevel),n.loader=new vv(n.localStorage,e.useLocalCache,n.logger,n.tracker,e.resourceTimeout,e.loadDelegate,e.urlInterrupter);var o=Rl.isWebGLSupported();n.app=new Xl({antialias:!0,autoDensity:!1,backgroundColor:16777215,forceCanvas:n.config.forceCanvas||!o}),globalThis.__PIXI_APP__=n.app,n.tracker({name:"slidePlayerCreate",result:"",reason:"",payload:{webgl:o,resolution:n.config.resolution,minFPS:n.config.minFPS,maxFPS:n.config.maxFPS,maxResolutionLevel:n.config.maxResolutionLevel,forceCanvas:n.config.forceCanvas}}),n.updateConfig(n.config),n.app.ticker.maxFPS=60,n.app.ticker.minFPS=n.config.minFPS,n.app.ticker.maxFPS=n.config.maxFPS,n.app.view.style.zIndex="1",n.app.stage.sortableChildren=!0;var a=n.app.renderer;if(a.gl){var s=a.gl.drawElements,u=a.gl.getExtension("WEBGL_debug_renderer_info"),l=a.gl.getParameter(u.UNMASKED_RENDERER_WEBGL);/nvidia/i.test(l)&&n.config.enableNvidiaDetect&&(n.isNVIDIA=!0),a.gl.drawElements=function(){for(var e=arguments.length,t=new Array(e),r=0;r=t&&n.updateResolution(i)}}else if(e>n.config.maxFPS&&n.config.autoResolution){var o=n.scale*n.config.resolution,a=n.app.renderer.resolution,s=Math.min(o,a+.1);s<=n.config.resolution&&n.updateResolution(s)}})),n.app.ticker.add((function(){n.runtime.drawCall=n.drawCall,n.runtime.fps=Math.floor(n.app.ticker.minFPS),n.drawCall=0}),null,zl.c.LOW),n.clock=new gv(n.app.ticker),n.objPoolGroup=uv(),n.stagePool=new h_(n.loader,n.mode,n.app.renderer,n.app.ticker,n.app.view,n.clock,n.objPoolGroup,n.errorChannel,n.localStorage,n.logger,e.loadDelegate,e.urlInterrupter,n.isPlayerPaused,n.maxResolution,n.volumeAdjuster,n.config.forceCanvas,n.globalEventHub),n.app.view.addEventListener("webglcontextlost",n.onWebGLLost);try{n.config.forceCanvas||(n.transactionPlayer=new Ol)}catch(s){/Error creating WebGL context/.test(s.message)?n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost.")):n.errorChannel.emit("error",new nv(Zp.RuntimeWarn,s.message))}return n.globalEventHub.on("requestFullscreen",n.onRequestFullscreenVideo),n.globalEventHub.on("requestCancelFullscreen",n.onRequestCancelFullscreenVideo),n}return S(r,[{key:"getMaxResolution",value:function(e){return!ru()(e)&&Number.isInteger(e)?(e<1&&(e=1),e>4&&(e=4),e):r.platform.isAndroid()||r.platform.isIOS()?2:4}},{key:"updateMaxResolutionLevel",value:function(e){e<0&&(e=0),e>4&&(e=4);var t=[640,960,1280,1920,3200][e],r=[360,540,720,1080,1800][e];this.maxResolution.set(t,r)}},{key:"updateConfig",value:function(e){ru()(e.maxFPS)||ru()(e.minFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS,this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),ru()(e.resolution)||(this.config.resolution=e.resolution,this.updateResolution(this.scale*this.config.resolution)),ru()(e.autoFPS)||(this.config.autoFPS=e.autoFPS),ru()(e.autoResolution)||(this.config.autoResolution=e.autoResolution),ru()(e.transactionBgColor)||(this.config.transactionBgColor=e.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),ru()(e.maxResolutionLevel)||(this.config.maxResolutionLevel=e.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}},{key:"preload",value:function(e){return m_(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e<1||e>this.slideCount,t.t0){t.next=6;break}return this.logger.info("preload slide ".concat(e," begin"),this.taskId),t.next=5,this.stagePool.preload(e);case 5:this.logger.info("preload slide ".concat(e," end"),this.taskId);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setResourceData",value:function(e,t){this.logger.info("ppt player init config: "+JSON.stringify(this.config),e),this.logger.info("set resource to "+t,e),this.taskId=e,this.url=t,this.stagePool.setResourceData(e,t),this.localStorage.attachTaskId(e),this.loader.attachTaskId(e)}},{key:"setInteractive",value:function(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}},{key:"translateEvent",value:function(e,t){var r=this;t.forEach((function(t){e.on(t,(function(){for(var e,n,i,o,a=arguments.length,s=new Array(a),u=0;u0&&this.view&&p&&(g=s.json.transition,!this.isForward&&(null==p?void 0:p.json.transition)&&(g=p.json.transition),m=this.getTransactionTexture(p,this.view,null,null),this.initTransactionPlayer(g),null===(r=this.transactionPlayer)||void 0===r||r.setPrevTexture(m),v=!0),this.app.stage.addChild(s.container),this.updateResolution(this.config.resolution*this.scale),p){p.clearOnTransactionEnd();try{this.app.stage.removeChild(p.container)}catch(e){this.logger.error("removeChild error: PPTPlayer:622",this.taskId)}}if(!(s.json.transition&&s.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&v)){i.next=31;break}return i.next=24,this.getTransactionTexture(s,this.view,u,l);case 24:return y=i.sent,this.transactionPlayer.setNextTexture(y),i.next=28,this.transactionPlayer.play();case 28:if(_=this.transactionPlayer.renderer.domElement,this.view.parentElement&&_)try{this.view.parentElement.removeChild(_)}catch(e){this.logger.error("removeChild error: PPTPlayer:637",this.taskId)}null===(n=this.transactionPlayer)||void 0===n||n.dispose();case 31:if(!this.isForward){i.next=36;break}return i.next=34,s.startTiming();case 34:i.next=37;break;case 36:s.setMainSeqApplied();case 37:s.ctx.slideScopeEventHub.emit("slide-render",s.ctx.slideIndex),this.emit(__.renderEnd,e),this.emit(__.slideChange,e),s.ctx.isRendering=!1,this.preload(e+1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e+1)})),this.preload(e-1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-a,"ms"),this.taskId),this.tracker({name:"slidePageChange",reason:"",result:"",payload:{duration:Date.now()-a,from:o,to:e}});case 45:case"end":return i.stop()}}),i,this)})))}},{key:"getTransactionTexture",value:function(e,t,r,n){var i=$l.p.create({width:e.json.width,height:e.json.height,resolution:1});this.app.renderer.render(e.container,{renderTexture:i});var o=this.cachedExtract.canvas(i,this.app.renderer,n,r);return new W(o)}},{key:"renderToBase64",value:function(e,t,r){return m_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.stagePool.getStage(e);case 2:if(!(i=n.sent)){n.next=10;break}return o=i.json,a=o.width,s=o.height,this.designWidth=a,this.designHeight=s,u=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:u}),l=this.app.renderer.plugins.extract.base64(u,r),n.abrupt("return",(this.stagePool.destroyStageByIndex(e),l));case 10:return n.abrupt("return","__null__");case 11:case"end":return n.stop()}}),n,this)})))}},{key:"renderMainSeqToBase64",value:function(e,t,r){return m_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l,c,h,d,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=[],n.next=3,this.stagePool.getStage(e);case 3:if((o=n.sent).createTiming(),o)for(a=o.json,s=a.width,u=a.height,this.designWidth=s,this.designHeight=u,l=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),o.container.visible=!0,c=o.mainSeqLength(),o.setMainSeqStep(0,"start"),this.app.renderer.render(o.container,{renderTexture:l}),h=this.app.renderer.plugins.extract.base64(l,r),i.push(h),d=0;dr.maxResolution.x||n*r.designHeight>r.maxResolution.y;)n-=.1;r.app.renderer.resolution=n,r.app.renderer.plugins.interaction.resolution=r.app.renderer.resolution,r.app.renderer.resize(r.designWidth,r.designHeight),eu()(t)&&t()}))}},{key:"nextStep",value:function(e,t){var r;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(r=this.currentStage)||void 0===r||r.nextStep(e,t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(e=this.currentStage)||void 0===e||e.prevStep(t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqStep())&&void 0!==t?t:0}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMainSeqStep(e,t)}},{key:"mainSeqState",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqState())&&void 0!==t?t:null}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"nextTick",value:function(e){this.app.ticker.addOnce((function(){e()}),zl.c.LOW)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.currentStage)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){var n;return m_(this,void 0,void 0,regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(n=this.currentStage)||void 0===n?void 0:n.setMediaState(e,t,r);case 2:case"end":return i.stop()}}),i,this)})))}},{key:"setMediaCurrentTime",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMediaCurrentTime(e,t)}},{key:"pause",value:function(){var e;this.app.ticker.stop(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalPause()})),this._isPaused=!0}},{key:"resume",value:function(){var e;this._isPaused=!1,this.app.ticker.start(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalResume()}))}},{key:"getSnapshot",value:function(){return this.currentStage&&this.getBase64(this.currentStage)||""}},{key:"clearLocalCache",value:function(){this.localStorage.dispose()}},{key:"clearFullscreenEventListenersWithAppView",value:function(){var e=this;["mousemove","mouseout","mouseover","touchstart","pointerdown"].forEach((function(t){e.cacheFunctionMap.has(t)&&(e.app.view.removeEventListener(t,e.cacheFunctionMap.get(t),!1),e.cacheFunctionMap.delete(t))}))}},{key:"syncFullscreenVideoState",value:function(e){this.globalEventHub.emit("syncFullscreenVideoState",e)}},{key:"destroy",value:function(){var e;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost),this.app.renderer.filter.texturePool.clear(!0),Ev.collectObjectByGroup(this.objPoolGroup),Av.collectObjectByGroup(this.objPoolGroup),null===(e=this.transactionPlayer)||void 0===e||e.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy(),this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext(),this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),this.tracker({name:"slidePlayerDestroy",result:"",reason:"",payload:{}})}catch(e){}}},{key:"view",get:function(){return this.app.renderer?this.app.view:null}},{key:"nextSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}},{key:"prevSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}}],[{key:"clearLocalCache",value:function(){var e;null===(e=f_.localCache)||void 0===e||e.clear().catch((function(){}))}}]),r}(Ks.a);b_.platform=Om,b_.RtcAudioClazz=null;var x_,w_=new Map,S_=r(136),T_=r.n(S_),M_=r(24),k_=r.n(M_),E_=r(50),A_=r.n(E_),I_=[],C_="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(x_||(x_={}));var P_,N_=function(e){return Object.freeze(e)},O_=function(e,t){this.inlineSize=e,this.blockSize=t,N_(this)},R_=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,N_(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),D_=function(e){return e instanceof SVGElement&&"getBBox"in e},L_=function(e){if(D_(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},j_=function(e){var t;if(e instanceof Element)return!0;var r=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},z_="undefined"!=typeof window?window:{},B_=new WeakMap,F_=/auto|scroll/,U_=/^tb|vertical/,W_=/msie|trident/i.test(z_.navigator&&z_.navigator.userAgent),G_=function(e){return parseFloat(e||"0")},V_=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new O_((r?t:e)||0,(r?e:t)||0)},H_=N_({devicePixelContentBoxSize:V_(),borderBoxSize:V_(),contentBoxSize:V_(),contentRect:new R_(0,0,0,0)}),Y_=function(e,t){if(void 0===t&&(t=!1),B_.has(e)&&!t)return B_.get(e);if(L_(e))return B_.set(e,H_),H_;var r=getComputedStyle(e),n=D_(e)&&e.ownerSVGElement&&e.getBBox(),i=!W_&&"border-box"===r.boxSizing,o=U_.test(r.writingMode||""),a=!n&&F_.test(r.overflowY||""),s=!n&&F_.test(r.overflowX||""),u=n?0:G_(r.paddingTop),l=n?0:G_(r.paddingRight),c=n?0:G_(r.paddingBottom),h=n?0:G_(r.paddingLeft),d=n?0:G_(r.borderTopWidth),f=n?0:G_(r.borderRightWidth),p=n?0:G_(r.borderBottomWidth),v=h+l,g=u+c,m=(n?0:G_(r.borderLeftWidth))+f,y=d+p,_=s?e.offsetHeight-y-e.clientHeight:0,b=a?e.offsetWidth-m-e.clientWidth:0,x=i?v+m:0,w=i?g+y:0,S=n?n.width:G_(r.width)-x-b,T=n?n.height:G_(r.height)-w-_,M=S+v+b+m,k=T+g+_+y,E=N_({devicePixelContentBoxSize:V_(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:V_(M,k,o),contentBoxSize:V_(S,T,o),contentRect:new R_(h,u,S,T)});return B_.set(e,E),E},$_=function(e,t,r){var n=Y_(e,r),i=n.borderBoxSize,o=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(t){case x_.DEVICE_PIXEL_CONTENT_BOX:return a;case x_.BORDER_BOX:return i;default:return o}},X_=function(e){var t=Y_(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=N_([t.borderBoxSize]),this.contentBoxSize=N_([t.contentBoxSize]),this.devicePixelContentBoxSize=N_([t.devicePixelContentBoxSize])},q_=function(e){if(L_(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},Q_=function(){var e=1/0,t=[];I_.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new X_(t.target),i=q_(t.target);n.push(r),t.lastReportedSize=$_(t.target,t.observedBox),ie?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},K_=[],J_=0,eb={attributes:!0,characterData:!0,childList:!0,subtree:!0},tb=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rb=function(e){return void 0===e&&(e=0),Date.now()+e},nb=!1,ib=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!nb){nb=!0;var r,n=rb(e);r=function(){var r=!1;try{r=function(){var e,t=0;for(Z_(t);I_.some((function(e){return e.activeTargets.length>0}));)t=Q_(),Z_(t);return I_.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:C_}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=C_),window.dispatchEvent(e)),t>0}()}finally{if(nb=!1,e=n-rb(),!J_)return;r?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!P_){var t=0,r=document.createTextNode("");new MutationObserver((function(){return K_.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),P_=function(){r.textContent="".concat(t?t--:t++)}}K_.push(e),P_()}((function(){requestAnimationFrame(r)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,eb)};document.body?t():z_.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),tb.forEach((function(t){return z_.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),tb.forEach((function(t){return z_.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ob=function(e){!J_&&e>0&&ib.start(),!(J_+=e)&&ib.stop()},ab=function(){function e(e,t){this.target=e,this.observedBox=t||x_.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=$_(this.target,this.observedBox,!0);return e=this.target,D_(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),sb=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ub=new WeakMap,lb=function(e,t){for(var r=0;r=0&&(i&&I_.splice(I_.indexOf(r),1),r.observationTargets.splice(n,1),ob(-1))},e.disconnect=function(e){var t=this,r=ub.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),hb=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cb.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.unobserve(this,e)},e.prototype.disconnect=function(){cb.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),db=function(){function e(e,t,r,n,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=r,this.index=e,this.slideIndex=t,this.eventHub=n,this.id=i}return e.prototype.apply=function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var e;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(null===(r=e.tasks[i])||void 0===r||r.apply()),n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask()),e.eventHub.emit("task-end-"+t.id)})),this.eventHub.on("task-error",(function(t){var r=t.task,n=e.tasks.findIndex((function(e){return e.index===r.index}));n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask())}))}return e.prototype.replaceIdleTask=function(){for(var e,t=this,r=new Set,n=0,i=this.tasks.length;n=0;r--)t=[e[r].apply(this,t)];return t[0]}},each:function(e,t,r){if(e)if(vb&&e.forEach&&e.forEach===vb)e.forEach(t,r);else if(e.length===e.length+0){var n,i=void 0;for(i=0,n=e.length;i1?mb.toArray(arguments):arguments[0];return mb.each(yb,(function(t){if(t.litmus(e))return mb.each(t.conversions,(function(t,r){if(_b=t.read(e),!1===bb&&!1!==_b)return bb=_b,_b.conversionName=r,_b.conversion=t,mb.BREAK})),mb.BREAK})),bb},wb=void 0,Sb={hsv_to_rgb:function(e,t,r){var n=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),o=r*(1-t),a=r*(1-i*t),s=r*(1-(1-i)*t),u=[[r,s,o],[a,r,o],[o,r,s],[o,a,r],[s,o,r],[r,o,a]][n];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,r){var n=Math.min(e,t,r),i=Math.max(e,t,r),o=i-n,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=e===i?(t-r)/o:t===i?2+(r-e)/o:4+(e-t)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/i,v:i/255})},rgb_to_hex:function(e,t,r){var n=this.hex_with_component(0,2,e);return n=this.hex_with_component(n,1,t),this.hex_with_component(n,0,r)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,r){return r<<(wb=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var Wb=function(e){function t(e,r,n){Mb(this,t);var i=Ib(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=n||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,mb.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=Ub(i.__impliedStep),i}return Ab(t,e),kb(t,[{key:"setValue",value:function(e){var r=e;return void 0!==this.__min&&rthis.__max&&(r=this.__max),void 0!==this.__step&&r%this.__step!=0&&(r=Math.round(r/this.__step)*this.__step),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,r)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=Ub(e),this}}]),t}(Ob),Gb=function(e){function t(e,r,n){Mb(this,t);var i=Ib(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,n));i.__truncationSuspended=!1;var o=i,a=void 0;function s(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=a-e.clientY;o.setValue(o.getValue()+t*o.__impliedStep),a=e.clientY}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),jb.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);mb.isNaN(e)||o.setValue(e)})),jb.bind(i.__input,"blur",(function(){s()})),jb.bind(i.__input,"mousedown",(function(e){jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),a=e.clientY})),jb.bind(i.__input,"keydown",(function(e){13===e.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,s())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return Ab(t,e),kb(t,[{key:"updateDisplay",value:function(){var e,r,n;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),r=this.__precision,n=Math.pow(10,r),Math.round(e*n)/n),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb);function Vb(e,t,r,n,i){return n+(e-t)/(r-t)*(i-n)}var Hb=function(e){function t(e,r,n,i,o){Mb(this,t);var a=Ib(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,{min:n,max:i,step:o})),s=a;function u(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(Vb(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function c(e){var t=e.touches[0].clientX,r=s.__background.getBoundingClientRect();s.setValue(Vb(t,r.left,r.right,s.__min,s.__max))}function h(){jb.unbind(window,"touchmove",c),jb.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),jb.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),u(e)})),jb.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(jb.bind(window,"touchmove",c),jb.bind(window,"touchend",h),c(e))})),jb.addClass(a.__background,"slider"),jb.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Ab(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb),Yb=function(e){function t(e,r,n){Mb(this,t);var i=Ib(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===n?"Fire":n,jb.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),jb.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Ab(t,e),kb(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Ob),$b=function(e){function t(e,r){Mb(this,t);var n=Ib(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));n.__color=new Cb(n.getValue()),n.__temp=new Cb(0);var i=n;n.domElement=document.createElement("div"),jb.makeSelectable(n.domElement,!1),n.__selector=document.createElement("div"),n.__selector.className="selector",n.__saturation_field=document.createElement("div"),n.__saturation_field.className="saturation-field",n.__field_knob=document.createElement("div"),n.__field_knob.className="field-knob",n.__field_knob_border="2px solid ",n.__hue_knob=document.createElement("div"),n.__hue_knob.className="hue-knob",n.__hue_field=document.createElement("div"),n.__hue_field.className="hue-field",n.__input=document.createElement("input"),n.__input.type="text",n.__input_textShadow="0 1px 1px ",jb.bind(n.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),jb.bind(n.__input,"blur",h),jb.bind(n.__selector,"mousedown",(function(){jb.addClass(this,"drag").bind(window,"mouseup",(function(){jb.removeClass(i.__selector,"drag")}))})),jb.bind(n.__selector,"touchstart",(function(){jb.addClass(this,"drag").bind(window,"touchend",(function(){jb.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),jb.bind(window,"mousemove",f),jb.bind(window,"touchmove",f),jb.bind(window,"mouseup",l),jb.bind(window,"touchend",l)}function u(e){p(e),jb.bind(window,"mousemove",p),jb.bind(window,"touchmove",p),jb.bind(window,"mouseup",c),jb.bind(window,"touchend",c)}function l(){jb.unbind(window,"mousemove",f),jb.unbind(window,"touchmove",f),jb.unbind(window,"mouseup",l),jb.unbind(window,"touchend",l),d()}function c(){jb.unbind(window,"mousemove",p),jb.unbind(window,"touchmove",p),jb.unbind(window,"mouseup",c),jb.unbind(window,"touchend",c),d()}function h(){var e=xb(this.value);!1!==e?(i.__color.__state=e,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__saturation_field.getBoundingClientRect(),r=e.touches&&e.touches[0]||e,n=r.clientX,o=r.clientY,a=(n-t.left)/(t.right-t.left),s=1-(o-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),i.__color.v=s,i.__color.s=a,i.setValue(i.__color.toOriginal()),!1}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__hue_field.getBoundingClientRect(),r=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return r>1?r=1:r<0&&(r=0),i.__color.h=360*r,i.setValue(i.__color.toOriginal()),!1}return mb.extend(n.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),mb.extend(n.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:n.__field_knob_border+(n.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),mb.extend(n.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),mb.extend(n.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),mb.extend(a.style,{width:"100%",height:"100%",background:"none"}),qb(a,"top","rgba(0,0,0,0)","#000"),mb.extend(n.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=n.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",mb.extend(n.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:n.__input_textShadow+"rgba(0,0,0,0.7)"}),jb.bind(n.__saturation_field,"mousedown",s),jb.bind(n.__saturation_field,"touchstart",s),jb.bind(n.__field_knob,"mousedown",s),jb.bind(n.__field_knob,"touchstart",s),jb.bind(n.__hue_field,"mousedown",u),jb.bind(n.__hue_field,"touchstart",u),n.__saturation_field.appendChild(a),n.__selector.appendChild(n.__field_knob),n.__selector.appendChild(n.__saturation_field),n.__selector.appendChild(n.__hue_field),n.__hue_field.appendChild(n.__hue_knob),n.domElement.appendChild(n.__input),n.domElement.appendChild(n.__selector),n.updateDisplay(),n}return Ab(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=xb(this.getValue());if(!1!==e){var t=!1;mb.each(Cb.COMPONENTS,(function(r){if(!mb.isUndefined(e[r])&&!mb.isUndefined(this.__color.__state[r])&&e[r]!==this.__color.__state[r])return t=!0,{}}),this),t&&mb.extend(this.__color.__state,e)}mb.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,n=255-r;mb.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,qb(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),mb.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+n+","+n+","+n+",.7)"})}}]),t}(Ob),Xb=["-moz-","-o-","-webkit-","-ms-",""];function qb(e,t,r,n){e.style.background="",mb.each(Xb,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+r+" 0%, "+n+" 100%); "}))}var Qb='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',Zb=function(e,t){var r=e[t];return mb.isArray(arguments[2])||mb.isObject(arguments[2])?new Bb(e,t,arguments[2]):mb.isNumber(r)?mb.isNumber(arguments[2])&&mb.isNumber(arguments[3])?mb.isNumber(arguments[4])?new Hb(e,t,arguments[2],arguments[3],arguments[4]):new Hb(e,t,arguments[2],arguments[3]):mb.isNumber(arguments[4])?new Gb(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Gb(e,t,{min:arguments[2],max:arguments[3]}):mb.isString(r)?new Fb(e,t):mb.isFunction(r)?new Yb(e,t,""):mb.isBoolean(r)?new zb(e,t):null},Kb=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},Jb=function(){function e(){Mb(this,e),this.backgroundElement=document.createElement("div"),mb.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),jb.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),mb.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;jb.bind(this.backgroundElement,"click",(function(){t.hide()}))}return kb(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),mb.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",jb.unbind(e.domElement,"webkitTransitionEnd",t),jb.unbind(e.domElement,"transitionend",t),jb.unbind(e.domElement,"oTransitionEnd",t)};jb.bind(this.domElement,"webkitTransitionEnd",t),jb.bind(this.domElement,"transitionend",t),jb.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-jb.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-jb.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var r=t||document,n=document.createElement("style");n.type="text/css",n.innerHTML=e;var i=r.getElementsByTagName("head")[0];try{i.appendChild(n)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var ex=function(){try{return!!window.localStorage}catch(e){return!1}}(),tx=void 0,rx=!0,nx=void 0,ix=!1,ox=[],ax=function e(t){var r=this,n=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),jb.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=mb.defaults(n,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),n=mb.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),mb.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),mb.isUndefined(n.parent)&&n.hideable&&ox.push(this),n.resizable=mb.isUndefined(n.parent)&&n.resizable,n.autoPlace&&mb.isUndefined(n.scrollable)&&(n.scrollable=!0);var i,o=ex&&"true"===localStorage.getItem(dx(this,"isLocal")),a=void 0,s=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return r.parent?r.getRoot().preset:n.load.preset},set:function(e){r.parent?r.getRoot().preset=e:n.load.preset=e,function(e){for(var t=0;t1){var n=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:n,factoryArgs:[mb.toArray(arguments)]})}if(mb.isArray(t)||mb.isObject(t)){var i=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:i,factoryArgs:[t]})}},name:function(e){return r.__li.firstElementChild.firstElementChild.innerHTML=e,r},listen:function(){return r.__gui.listen(r),r},remove:function(){return r.__gui.remove(r),r}}),r instanceof Hb){var n=new Gb(r.object,r.property,{min:r.__min,max:r.__max,step:r.__step});mb.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=r[e],i=n[e];r[e]=n[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(n,e),t.apply(r,e)}})),jb.addClass(t,"has-slider"),r.domElement.insertBefore(n.domElement,r.domElement.firstElementChild)}else if(r instanceof Gb){var i=function(t){if(mb.isNumber(r.__min)&&mb.isNumber(r.__max)){var n=r.__li.firstElementChild.firstElementChild.innerHTML,i=r.__gui.__listening.indexOf(r)>-1;r.remove();var o=hx(e,r.object,r.property,{before:r.__li.nextElementSibling,factoryArgs:[r.__min,r.__max,r.__step]});return o.name(n),i&&o.listen(),o}return t};r.min=mb.compose(i,r.min),r.max=mb.compose(i,r.max)}else r instanceof zb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__checkbox,"click")})),jb.bind(r.__checkbox,"click",(function(e){e.stopPropagation()}))):r instanceof Yb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__button,"click")})),jb.bind(t,"mouseover",(function(){jb.addClass(r.__button,"hover")})),jb.bind(t,"mouseout",(function(){jb.removeClass(r.__button,"hover")}))):r instanceof $b&&(jb.addClass(t,"color"),r.updateDisplay=mb.compose((function(e){return t.style.borderLeftColor=r.__color.toString(),e}),r.updateDisplay),r.updateDisplay());r.setValue=mb.compose((function(t){return e.getRoot().__preset_select&&r.isModified()&&lx(e.getRoot(),!0),t}),r.setValue)}(e,u,i),e.__controllers.push(i),i}function dx(e,t){return document.location.href+"."+t}function fx(e,t,r){var n=document.createElement("option");n.innerHTML=t,n.value=t,e.__preset_select.appendChild(n),r&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function px(e,t){t.style.display=e.useLocalStorage?"block":"none"}function vx(e){var t=e.__save_row=document.createElement("li");jb.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),jb.addClass(t,"save-row");var r=document.createElement("span");r.innerHTML=" ",jb.addClass(r,"button gears");var n=document.createElement("span");n.innerHTML="Save",jb.addClass(n,"button"),jb.addClass(n,"save");var i=document.createElement("span");i.innerHTML="New",jb.addClass(i,"button"),jb.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",jb.addClass(o,"button"),jb.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?mb.each(e.load.remembered,(function(t,r){fx(e,r,r===e.preset)})):fx(e,"Default",!1),jb.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=mx(this)),e.folders={},mb.each(this.__folders,(function(t,r){e.folders[r]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=mx(this),lx(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=mx(this,!0)),this.load.remembered[e]=mx(this),this.preset=e,fx(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){mb.each(this.__controllers,(function(t){this.getRoot().load.remembered?cx(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),mb.each(this.__folders,(function(e){e.revert(e)})),e||lx(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&Kb.call(window,(function(){e(t)})),mb.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){mb.each(this.__controllers,(function(e){e.updateDisplay()})),mb.each(this.__folders,(function(e){e.updateDisplay()}))}});var yx=ax,_x=function(){function e(e){this.player=e}return Object.defineProperty(e.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(e){this.player.updateConfig({resolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var e,t;return(null===(e=this.player.view)||void 0===e?void 0:e.width)+"*"+(null===(t=this.player.view)||void 0===t?void 0:t.height)},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(e){this.player.updateConfig({minFPS:e,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(e){this.player.updateConfig({maxFPS:e,minFPS:this.player.config.minFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(e){this.player.updateConfig({autoResolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(e){this.player.updateConfig({autoFPS:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(e){this.player.updateConfig({transactionBgColor:e})},enumerable:!1,configurable:!0}),e}(),bx=function(){function e(e,t){var r;this.config=new _x(e),this.anchor=t,r=this.createControllerGUI(),this.gui=r[0],this.controller=r[1],this.createStats()}return e.prototype.createStats=function(){var e=this;this.stateId=setInterval((function(){e.controller.frameRate.updateDisplay(),e.controller.size.updateDisplay(),e.controller.minFPS.updateDisplay(),e.controller.drawFrames.updateDisplay(),e.controller.maxFPS.updateDisplay(),e.controller.resolution.updateDisplay(),e.controller.autoFps.updateDisplay(),e.controller.autoResolution.updateDisplay(),e.controller.drawCall.updateDisplay()}),16)},e.prototype.createControllerGUI=function(){var e=new yx({autoPlace:!0,closed:!0});e.domElement.style.opacity=".6",e.domElement.style.transformOrigin="100% 0",e.domElement.style.transform="scale(1)",this.anchor.appendChild(e.domElement),e.domElement.style.position="absolute",e.domElement.style.right="0",e.domElement.style.top="0",e.domElement.style.zIndex="2";var t={frameRate:e.add(this.config,"frameRate"),drawFrames:e.add(this.config,"drawFrames"),drawCall:e.add(this.config,"drawCall"),size:e.add(this.config,"size"),minFPS:e.add(this.config,"minFPS",0,60),maxFPS:e.add(this.config,"maxFPS",0,60),resolution:e.add(this.config,"resolution",.5,8,.5),autoResolution:e.add(this.config,"autoResolution"),autoFps:e.add(this.config,"autoFPS"),transactionBgColor:e.addColor(this.config,"backgroundColor")};return[e,t]},e.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch(e){}},e}(),xx=function(){function e(e){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&t.fn(e).then((function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))},this.fn=e}return e.prototype.destroy=function(){this.isDestroy=!0},e.prototype.addTask=function(e){this.tasks.push(e),this.isScheduling||this.schedule()},e}(),wx=function(){function e(e){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=e}return e.prototype.addLock=function(e,t){var r=this;this.available&&(this.locks[e]=t,this.autoUnlock[e]=window.setTimeout((function(){delete r.locks[e]}),3e3))},e.prototype.unlock=function(e,t){this.available&&t&&this.locks[e]&&this.locks[e]===t&&(window.clearTimeout(this.autoUnlock[e]),delete this.locks[e])},e.prototype.isLocked=function(e){return!!this.available&&!!this.locks[e]},e}(),Sx=function(){function e(){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var t=e.tasks.shift();t&&!e.isDestroy&&(t.status="running",t.fn.apply(null).then((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})).catch((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})))}}return e.prototype.getRunningTask=function(){return this.tasks[0]&&"running"===this.tasks[0].status?this.tasks[0]:null},e.prototype.addTask=function(e,t){var r={type:e,status:"wait",fn:t},n=this.getRunningTask();n&&e===n.type||(this.tasks=this.tasks.filter((function(t){return t.type!==e})),this.tasks.push(r),this.isScheduling||this.schedule())},e.prototype.destroy=function(){this.isDestroy=!0},e}(),Tx=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Mx=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.config.buffer||e))return[2];t=this.logList.splice(0),r=function(){i.logList=t.concat(i.logList),i.retryTimes>3&&i.pause(),i.retryTimes+=1},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:t})})];case 2:return o.sent().ok?this.retryTimes=0:r(),[3,4];case 3:return n=o.sent(),console.warn(n),r(),[3,4];case 4:return[2]}}))}))},e.prototype.setEnable=function(e){this.enable!==e&&(e?this.start():this.pause())},e}();function Ex(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var i,o,a,s;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(r=e.replace(/^.*__internal__/,""),t=this.resourceList.find((function(e){return e.indexOf(r)>=0}))||e),this.config.urlInterrupter?[2,this.config.urlInterrupter(t)]:[2,Promise.resolve(t)]}))}))},n.userInputHandle=function(){n.userInputTime=Date.now()},n.handleViewTouchStart=function(){window.clearTimeout(n.touchStartId),n.isTouchStart=!0,n.touchStartId=setTimeout((function(){n.isTouchStart=!1}),350)},n.handleViewTouchEnd=function(){n.isTouchStart&&(n.isTouchStart=!1,n.handleViewClick())},n.handleSlideRef=function(){console.log(n),window.__slide=n},n.receiveSyncHandler=function(e){return Px(n,void 0,void 0,(function(){var t,r,n,i,o,a=this;return Nx(this,(function(s){switch(s.label){case 0:return Sv()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(Lx.syncEventLag),this._receiveIncrId=e.incrId||0),this.logger.info("sync receive "+JSON.stringify(e),this.taskId),"nextStep"!==e.type?[3,1]:(this.mainSeqStep!==e.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(e.next,"start"),this.player.nextTick((function(){a.doNextStep(!0,e.clientId||"")}))):this.doNextStep(!0,e.clientId||""),[3,6]);case 1:return"prevStep"!==e.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===e.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(e.next+1,"start"),null===(t=this.player)||void 0===t||t.nextTick((function(){a.doPrevStep(!0)}))),[3,6]);case 2:return"interactiveAnim"!==e.type?[3,3]:(this.player?this.player.applyInteractiveAction(e.action):this.__slideState.interactiveSeqState[e.seqId]?this.__slideState.interactiveSeqState[e.seqId].step+=1:this.__slideState.interactiveSeqState[e.seqId]={step:0,state:"end"},[3,6]);case 3:return"renderSlide"!==e.type?[3,5]:[4,this.doRenderSlide(e.index,e.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===e.type?(null===(r=this.player)||void 0===r||r.setMediaState(e.id,!0),this.__slideState.mediaState[e.id]=e.state):"mediaPause"===e.type?(null===(n=this.player)||void 0===n||n.setMediaState(e.id,!1),this.__slideState.mediaState[e.id]=e.state):"mediaSeek"===e.type?(null===(i=this.player)||void 0===i||i.setMediaCurrentTime(e.id,e.time),this.__slideState.mediaState[e.id]=e.state):"mediaFullscreen"===e.type&&(e.targetId&&this.__slideState.mediaState[e.targetId]?this.__slideState.mediaState[e.targetId].fullscreen=e.state:this.__slideState.mediaState[e.targetId]={fullscreen:e.state,type:"pause",time:0},null===(o=this.player)||void 0===o||o.syncFullscreenVideoState({targetId:e.targetId,state:e.state,slideIndex:e.slideIndex})),s.label=6;case 6:return[2]}}))}))},n.flushDebounce=function(){n.resizeView.flush(),n.handleViewClick.flush()},n.handlePrevSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.prevSlideIndex)>=1&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!1):this.renderSlide(t,!1)),[2]):[2]}))}))},n.handleNextSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.nextSlideIndex)<=this.slideCount&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!0):this.renderSlide(t,!0)),[2]):[2]}))}))},n.handleGotoSlide=function(e){if(e<=n.slideCount&&e>=1){var t=n.slideState.currentSlideIndex<=e;n.renderSlide(e,t)}else-1===e&&n.renderSlide(n.slideCount,!0)},t.instances.push(n),n.config=n.initSlideConfig(r),n.tracker=function(e){r.whiteTracker&&r.whiteTracker.commit({name:e.name,reason:e.reason,result:e.result,payload:Cx(Cx({},e.payload),{slideId:n.randomId,taskId:n.taskId})},{slideVersion:n.version||""})},t.trackLogger.setEnable(!!n.config.enableTracking),n.logger={info:function(e,r){var i;t.appendLogString("INFO - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"info",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.info;o&&o("["+r+"] "+e)},warn:function(e,r){var i;t.appendLogString("WARN - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"warn",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.warn;o&&o("["+r+"] "+e)},error:function(e,r){var i;t.appendLogString("ERROR - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"error",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.error;o&&o("["+r+"] "+e)}},n.logger.info("new slide with clientId: "+n.config.clientId+", version: "+n.version,n.taskId),n.tracker({name:"initSlide",result:"",reason:"",payload:{taskId:n.taskId}}),n.anchor=n.config.anchor,n.syncQueue=new xx(n.receiveSyncHandler),n.lock=new wx("interactive"===n.mode),n.cacheImage.style.position="absolute",n.cacheImage.style.zIndex="100",n.setMedianControllerAttribute(),n.canvasContainer.style.position="relative",n.canvasContainer.style.fontSize="0",n.canvasContainer.appendChild(n.medianController),n.frame.appendChild(n.canvasContainer),n.frameResizeObserver.observe(n.frame),n.on(Lx.syncReceive,(function(e){n.lock.unlock(e.type,e.uuid),n.syncQueue.addTask(e)})),n.renderingTaskManager.eventHub.on("task-error",(function(e){var t=e.error,r=e.task,i=nv.transform(t);i.errorType===Zp.RuntimeWarn?n.logger.warn(i.message,n.taskId):n.logger.error(i.message,n.taskId),n.isLoading=!1,n.reportError(i,r.slideIndex)})),window.addEventListener("__slide_ref__",n.handleSlideRef),n.resizeView=k_()(n.resizeView.bind(n),50),n.player=n.initPlayer(n.config),n.config.controller&&n.createController(),n.player.view&&n.canvasContainer.appendChild(n.player.view),n.handleViewClick=k_()(n.handleViewClick,300),n.player.errorChannel.on("error",(function(e,t){var r=nv.transform(e);r.errorType===Zp.RuntimeWarn?n.logger.warn(r.message,n.taskId):n.logger.error(r.message,n.taskId),n.isLoading=!1,n.reportError(e,t),n.tracker({name:"slideError",reason:r.errorMsg,result:"",payload:{code:r.errorType}})})),window.addEventListener("message",n.recoverHandler),t.volumeAdjuster.on("update",n._updateVolumeByStaticAdjuster),n.volumeAdjuster.volume=t.volumeAdjuster.volume,n}var r,n;return Ix(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),Px(this,void 0,void 0,(function(){return Nx(this,(function(r){switch(r.label){case 0:if(!(t._tempLog.length>131072||e&&t._tempLog.length>0))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,null==Bx?void 0:Bx.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:case 3:return r.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,r.label=5;case 5:return[2]}}))}))},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(e){return Px(this,void 0,void 0,(function(){var r,n,i,o,a;return Nx(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!Bx)return[3,13];r=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return r=(s.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return s.sent(),[3,5];case 5:n=0,i=r,s.label=6;case 6:if(!(n500&&e.enableGlobalClick&&e.nextStep()}))},t.prototype.createController=function(){this.player&&(this.playerController=new bx(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2",this.medianController.style.fontSize="16px"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var e=this.frame.getBoundingClientRect(),t=e.width,r=e.height;this.frameWidth=t,this.frameHeight=r,this.resizeView()}},t.prototype.updateFixedFrameSize=function(e,t,r){this.config.fixedFrameSize&&(this.frameWidth=e,this.frameHeight=t,this.frame.style.width=e+"px",this.frame.style.height=t+"px",this.resizeView(r))},t.prototype._resizeView=function(e){var t,r,n=this,i=this.width,o=this.height;if(i>0&&o>0){var a=this.frameWidth/i,s=a*o;s>this.frameHeight&&(a*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(a,this.resize,e),this.cacheImage.style.transform="scale("+a+")",this.medianController.style.transform="scale("+a+")",this.medianController.setAttribute("data-scale",a.toString()),this.isInitResized||(this.isInitResized=!0,null===(r=this.player)||void 0===r||r.clock.setTimeout((function(){n.frame.style.visibility="visible"}),32))}},t.prototype.setSlideState=function(e){var t,r,n;return Px(this,void 0,void 0,(function(){var i,o=this;return Nx(this,(function(a){switch(a.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,null===(t=this.player)||void 0===t||t.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,null===(r=this.player)||void 0===r||r.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,null===(n=this.player)||void 0===n?void 0:n.clock.waitUntil((function(){var t,r;return(null===(t=o.player)||void 0===t?void 0:t.currentIndex)===e.currentSlideIndex&&(null===(r=o.player)||void 0===r?void 0:r.currentStage)}),3e3)];case 3:return a.sent(),i=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(i=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(i=!0,this.__slideState.mainSeqState=e.mainSeqState),i&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),[4,Rx(1500)];case 4:return a.sent(),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),this.isSyncingSlideState=!1,[2]}}))}))},t.prototype.initInteractiveSeq=function(e){var t;for(var r in e.interactiveSeqState){var n=e.interactiveSeqState[r];null===(t=this.player)||void 0===t||t.setInteractiveSeqState(r,n.step,"idle"===n.state?"start":"end")}},t.prototype.initMedia=function(e){var t,r,n;for(var i in e.mediaState){var o=e.mediaState[i],a=this.__slideState.mediaState[i];if(null===(t=this.player)||void 0===t||t.syncFullscreenVideoState({targetId:i,state:!!o.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!a||o.type!==a.type||o.time!==a.time)if("play"===o.type){var s=(this.timestamp()-o.time)/1e3;null===(r=this.player)||void 0===r||r.setMediaState(i,!0,s)}else null===(n=this.player)||void 0===n||n.setMediaState(i,!1,o.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,t.sent().json()];case 3:return[2,[(e=t.sent()).width,e.height]];case 4:return t.sent(),[2,[0,0]];case 5:return[2]}}))}))},t.prototype.getSlideCountAsync=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,t){var r;this.taskId=e,null===(r=this.player)||void 0===r||r.setResourceData(e,t),this.__slideState.taskId=e,this.__slideState.url=t,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:t})},t.prototype.setResourceList=function(e,t){var r;this.taskId=e,this.resourceList=t,null===(r=this.player)||void 0===r||r.setResourceData(e,"__internal__"),this.__slideState.taskId=e,this.__slideState.url="__internal__"},t.prototype._renderSlide=function(e){var t;return Px(this,void 0,void 0,(function(){var r=this;return Nx(this,(function(n){switch(n.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),this.flushDebounce(),[4,null===(t=this.player)||void 0===t?void 0:t.renderSlide(e)]);case 1:return n.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout((function(){var e,t;if("hidden"===(null===(t=null===(e=r.player)||void 0===e?void 0:e.view)||void 0===t?void 0:t.style.visibility)&&(r.player.view.style.visibility="visible"),"hidden"===r.frame.style.visibility&&(r.frame.style.visibility="visible"),r.needClearCacheImage)try{r.frame.removeChild(r.cacheImage)}catch(e){r.logger.error("removeChild error Slide.ts:1553",r.taskId)}}),100),[2]}}))}))},t.prototype.renderSlide=function(e,t){if(void 0===t&&(t=!0),this.player){var r=Number(e);(r!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(r>this.slideCount&&this.slideCount>0||this.poseRenderSlide(r,t))}},t.prototype.needCreateNewPlayer=function(){var e=b_.platform.isLowGpuMemory()?15:30;return(b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,t){"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t}):"sync"===this.mode?(this.doRenderSlide(e,t),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t})):this.doRenderSlide(e,t)},t.prototype.doRenderSlide=function(e,t){var r,n,i,o=this;if(void 0===t&&(t=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var a=this.player.getSnapshot();this.cacheImage.src=a,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(r=this.playerController)||void 0===r||r.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,(null===(n=this.config)||void 0===n?void 0:n.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(i=null==this?void 0:this.player)||void 0===i?void 0:i.view)&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var s=Math.random().toString(32).substr(2);return this.player.isForward=t,this.renderingTaskManager.addTask((function(){return o._renderSlide(e)}),e,s),new Promise((function(e){o.renderingTaskManager.eventHub.once("task-end-"+s,e)}))},t.prototype.getSnapshot=function(){var e,t;return null!==(t=null===(e=this.player)||void 0===e?void 0:e.getSnapshot())&&void 0!==t?t:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(Lx.slideStepEnd),this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doNextStep=function(e,t){if(this.player){var r=!this.config.clientId||t===this.config.clientId;this.player.nextStep(e,r);var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(Lx.slideStepStart),this.player.mainSeqHasPrevStep()?"interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(e){if(void 0===e&&(e=!1),this.player){this.player.prevStep(e);var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var e=this.slideState;!T_()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(Lx.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var t=Math.random().toString(32).substr(2);this.lock.addLock(e.type,t);var r=Cx(Cx({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(r.incrId=this.dispatchIncrId),this.emit(Lx.syncDispatch,r),this.logger.info("sync dispatch "+JSON.stringify(r),this.taskId)}},t.prototype.setMainSeqStep=function(e,t){var r;null===(r=this.player)||void 0===r||r.setMainSeqStep(e,t)},t.prototype.setInteractive=function(e){var t;this.interactive=e,null===(t=this.player)||void 0===t||t.setInteractive(e)},t.prototype.pause=function(){var e;null===(e=this.player)||void 0===e||e.pause()},t.prototype.resume=function(){var e;null===(e=this.player)||void 0===e||e.resume()},t.prototype._doFrozen=function(){var e;return Px(this,void 0,void 0,(function(){var t,r,n,i=this;return Nx(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.tracker({name:"frozenSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.view&&this.player?[4,this.player.clock.waitUntil((function(){return!i.isLoading}),6e4)]:[3,2];case 1:for(r in o.sent(),t=this.player.getSnapshot()||"",this.cacheImage.src=t,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(e=this.playerController)||void 0===e||e.destroy(),this.player=void 0,this.__slideState.mediaState)n=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Cx(Cx({},n),{frozenTime:this.timestamp()});o.label=2;case 2:return[2]}}))}))},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",(function(){return e._doFrozen()}))},t.prototype._doRelease=function(){var e,t;return Px(this,void 0,void 0,(function(){var r,n,i,o;return Nx(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",this.taskId),this.tracker({name:"releaseSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.player)return[2];for(n in this.player=this.initPlayer(this.config),(null===(e=this.config)||void 0===e?void 0:e.controller)&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=A_()(jx),r.mediaState)"play"===(i=r.mediaState[n]).type&&(o=Math.max(null!==(t=i.frozenTime)&&void 0!==t?t:0,i.time),i.time=this.timestamp()-(o-i.time),i.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return a.sent(),[4,this.player.clock.delay(333)];case 2:a.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch(e){this.logger.error("removeChild error Slide.ts:1934",this.taskId)}return[2]}}))}))},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",(function(){return e._doRelease()}))},t.prototype._doDestroy=function(){var e,r,n,i,o=this;this.logger.info("do destroy slide",this.taskId),this.tracker({name:"destroySlide",reason:"",result:"",payload:{taskId:this.taskId}});var a=t.instances.findIndex((function(e){return e.randomId===o.randomId}));if(a>=0&&t.instances.splice(a,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(e=this.player)||void 0===e||e.removeAllListeners(),null===(r=this.player)||void 0===r||r.destroy(),null===(n=this.player)||void 0===n||n.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners(),null===(i=this.player)||void 0===i?void 0:i.view)try{this.anchor.removeChild(this.player.view)}catch(e){this.logger.error("removeChild error Slide.ts:1982",this.taskId)}try{this.anchor.removeChild(this.frame)}catch(e){this.logger.error("removeChild error Slide.ts:1988",this.taskId)}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,Rx(100)]:[3,3];case 2:return t.sent(),e+=1,[3,1];case 3:return[2]}}))}))},t.prototype.preload=function(e){return this.player?this.player.preload(e):Promise.resolve()},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then((function(){e._doDestroy()})):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;null===(e=this.player)||void 0===e||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,t=0===this.mainSeqLength||this.mainSeqStep>=this.mainSeqLength-1,r="end"===this.mainSeqState||"running"===this.mainSeqState||null==this.mainSeqState;return!(e&&t&&r)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=1===this.player.currentIndex,t=0===this.mainSeqLength||0===this.mainSeqStep,r="idle"===this.mainSeqState||null===this.mainSeqState;return!(e&&t&&r)},t.prototype.snapshot=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return Px(this,void 0,void 0,(function(){return Nx(this,(function(t){return this.player?[2,this.player.snapshotWithTimingEnd(e)]:[2,null]}))}))},t.prototype.updateGlobalVolume=function(e){this.volumeAdjuster.volume=e},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){b_.clearLocalCache()},t.disposeLocalCache=function(){},r=t,t.preloadResource=Ex,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(e){var r,n;e.context({logger:{info:function(e){t.appendLogString("INFO - "+(new Date).toISOString()+" - "+e+"\n")},warn:function(e){t.appendLogString("WARN - "+(new Date).toISOString()+" - "+e+"\n")},error:function(e){t.appendLogString("ERROR - "+(new Date).toISOString()+" - "+e+"\n")}}}),r=e,(n=w_.get(r.hookPoint)||[]).push(r),w_.set(r.hookPoint,n)},t.volumeAdjuster=new g_,t.trackLogger=new kx,t.handleFrozenAllSlide=function(){t.instances.forEach((function(e){e.player&&(t._tempFrozenIds.push(e.randomId),e.frozen())}))},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach((function(e){var r=t.instances.find((function(t){return t.randomId===e}));r&&r.release()})),t._tempFrozenIds=[]},t.handleLogReport=function(e){return Px(void 0,void 0,void 0,(function(){var n,i,o,a,s,u;return Nx(r,(function(r){switch(r.label){case 0:return[4,t.flushLog(!0)];case 1:if(r.sent(),!Bx)return[3,12];n=[],r.label=2;case 2:return r.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return n=(r.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return r.sent(),[3,5];case 5:if(0===n.length)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:e},"*"),[2];i=0,o=n,r.label=6;case 6:if(!(i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);o>3&&a&&Object.defineProperty(t,r,a)}([(n="Slide.initConfig",function(e,t,r){var i=r.value;r.value=function(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?U(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(B),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=z()}while(this.disposers.has(e));return e}}]),e}();function U(e){return function(){return e.forEach(B)}}function W(e,t,r){return Math.min(Math.max(e,t),r)}var G={exports:{}},V={exports:{}},H=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Y=Array.prototype.concat,$=Array.prototype.slice,X=V.exports=function(e){for(var t=[],r=0,n=e.length;r=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},ee.to.keyword=function(e){return K[e.slice(0,3)]};var ne=G.exports,ie=function(){function e(t){var r=this;x(this,e),this.enable=t,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=function(e){var t,n;e instanceof CustomEvent?t=e.detail:"object"===T(n=e.data)&&null!==n&&(t=e.data),t&&("boolean"==typeof t.slide?r.enable=t.slide:"__instance"===t.slide?console.log(r):"__debug"===t.slide&&Object.values(r.apps).forEach((function(e){var t,r;null==(r=null==(t=e.controller)?void 0:t.slide)||r.createController()})))},this.initialize()}return S(e,[{key:"setAppContext",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).context=t,this.log("[Slide] new ".concat(e))}},{key:"setAppController",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).controller=t}},{key:"deleteApp",value:function(e){delete this.apps[e],this.log("[Slide] delete ".concat(e))}},{key:"initialize",value:function(){window.addEventListener("message",this._onMessage)}},{key:"dispose",value:function(){window.removeEventListener("message",this._onMessage)}},{key:"log",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).info.apply(e,arguments);else if(this.enable){var t;(t=console).log.apply(t,arguments)}}},{key:"verbose",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).debug.apply(e,arguments);else if(this.enable&&"verbose"===this.level){var t;(t=console).log.apply(t,arguments)}}},{key:"warn",value:function(){var e,t;this.roomLogger?(e=this.roomLogger).warn.apply(e,arguments):(t=console).warn.apply(t,arguments)}}]),e}(),oe=new ie(!1),ae=oe.log.bind(oe),se=oe.verbose.bind(oe);function ue(e){try{var t=window.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"!==t&&"transparent"!==t)return t;if(e.parentElement)return ue(e.parentElement)}catch(e){}return"#ffffff"}var le="";function ce(e){return le||(le=function(e){var t=ne.get(e);if(t&&"rgb"===t.model){var r=t.value,n=(((255&Math.round(r[0]))<<16)+((255&Math.round(r[1]))<<8)+(255&Math.round(r[2]))).toString(16);return"#"+"000000".substring(n.length)+n}return e}(ue(e)),ae("[Slide] guess bg color",le)),le}var he=function(e){return e.tracker};function de(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.width,n=e.height,i=e.slideCount,o=e.slideState,a=o.taskId,s=o.url,u=[],l=function(e){var i=t.find((function(t){return t.indexOf("preview/".concat(e,".png"))>=0}));i?u.push({width:r,height:n,thumbnail:i,src:"ppt"}):u.push({width:r,height:n,thumbnail:"".concat(s,"/").concat(a,"/preview/").concat(e,".png"),src:"ppt"})},c=1;c<=i;++c)l(c);return u}function fe(e,t,r,n){var i,o=r.slideState.currentSlideIndex;if(o>0&&t.getIsWritable()){var a=[n,o].join("/");if("page"!==e.scenePathType(a)){e.removeScenes(n);for(var s=r.slideCount,u=[],l=1;l<=s;++l)u.push({name:"".concat(l)});e.putScenes(n,u)}(t.getBox().focus?e.state.sceneState.scenePath:(null==(i=t.getView())?void 0:i.focusScenePath)||"")!==a&&t.setScenePath(a)}}var pe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=pe;var ve={taskId:"",url:"",state:null,resourceList:[],previewList:[]},ge=function(){},me=function(){function e(t){var r,n=this,i=t.context,o=t.anchor,a=t.onRenderStart,s=t.onPageChanged,u=t.onTransitionStart,c=t.onTransitionEnd,h=t.onNavigate,d=t.onError,f=t.onRenderError,p=t.showRenderError,v=t.invisibleBehavior;x(this,e),this.sideEffect=new F,this.previewList=[],this.ready=!1,this.readyPromise=new Promise((function(e){n.resolveReady=function(){n.ready?ae("[Slide] render end"):setTimeout((function(){n.ready=!0,e()}),1e3)}})),this.onSyncDispatch=function(e){if(n.context.getIsWritable()&&n.room){var t={type:L.SLIDE_EVENTS.syncDispatch,payload:e};se("[Slide] dispatch",JSON.stringify(e)),n.context.dispatchMagixEvent(L.SLIDE_EVENTS.syncDispatch,t)}},this.magixEventListener=function(e){var t=e.payload,r=t.type,i=t.payload;r===L.SLIDE_EVENTS.syncDispatch&&(n.syncStateOnce(),se("[Slide] receive",JSON.stringify(i)),n.slide.emit(L.SLIDE_EVENTS.syncReceive,i))},this.onStateChange=function(e){n.context.getIsWritable()&&(se("[Slide] state change",JSON.stringify(e,null,2)),n.context.storage.setState({state:e}))},this.pollCount=0,this.pollReadyState=function(){n.ready?1===n._toFreeze?n.freeze():-1===n._toFreeze&&n.unfreeze():n.pollCount<40?(n.pollCount++,setTimeout(n.pollReadyState,500)):(n.pollCount=0,ae("[Slide] init timeout"))},this._pageCount=0,this.destroyed=!1,this.timestamp=function(){return n.room&&n.room.calibrationTimestamp?n.room.calibrationTimestamp:n.player?n.player.beginTimestamp+n.player.progressTime:Date.now()},this.isFrozen=!1,this._toFreeze=0,this.freeze=function(){n.isFrozen=!0,n.ready?(ae("[Slide] freeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.frozen():n.slide.pause()):n._toFreeze=1},this.unfreeze=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.visible){e.next=2;break}return e.abrupt("return");case 2:n.isFrozen=!1,n.ready?(ae("[Slide] unfreeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.release():n.slide.resume()):n._toFreeze=-1;case 4:case"end":return e.stop()}}),e)}))),this.onVisibilityChange=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n.visible="visible"===document.visibilityState)?(ae("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:n.savedIsFrozen}),n.savedIsFrozen||n.unfreeze()):(n.savedIsFrozen=n.isFrozen,ae("[Slide] freeze because tab becomes invisible"),n.freeze());case 1:case"end":return e.stop()}}),e)}))),this.invisibleBehavior=null!=v?v:"frozen",this.onRenderStart=a,this.onPageChanged=s,this.onTransitionStart=u,this.onTransitionEnd=c,this.onNavigate=h||ge,this.onError=d,this.onRenderError=f,this.showRenderError=null==p||p,this.context=i,this.room=i.getRoom(),this.player=this.room?void 0:i.getDisplayer(),r=this.room||this.player,oe.roomLogger=r.logger,this.slide=this.createSlide(o,{whiteTracker:he(i.getDisplayer())}),this.syncStateOnceFlag=!this.context.isAddApp,this.visible="visible"===document.visibilityState,this.savedIsFrozen=!1,this.initialize()}return S(e,[{key:"jumpToPage",value:function(e,t){this.ready&&(e=W(e,1,this.pageCount),this.onNavigate(e,t),this.slide.renderSlide(e))}},{key:"initialize",value:function(){this.registerEventListeners(),this.kickStart()}},{key:"kickStart",value:function(){var e=this.context,t=this.slide;e.getIsWritable()&&e.storage.ensureState(ve);var r=e.storage.state,n=r.taskId,i=r.url,o=r.resourceList,a=r.previewList,s=r.state;this.previewList=a,o&&o.length>0?t.setResourceList(n,o):t.setResource(n,i||pe),s?(ae("[Slide] init with state",JSON.stringify(s)),this.syncStateOnceFlag=!1,t.setSlideState(s)):e.isAddApp&&(ae("[Slide] init by renderSlide",1),t.renderSlide(1)),this.pollReadyState()}},{key:"registerEventListeners",value:function(){var e=this,t=this.context,r=this.slide,n=this.sideEffect.addDisposer(t.storage.addStateChangedListener((function(){t.storage.state.state&&(e.syncStateOnce(),e.sideEffect.flush(n))})));this.sideEffect.add((function(){return t.addMagixEventListener(L.SLIDE_EVENTS.syncDispatch,e.magixEventListener,{fireSelfEventAfterCommit:!0})})),r.on(L.SLIDE_EVENTS.renderStart,this.onRenderStart),r.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),r.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),r.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.renderError,this.onError),r.on(L.SLIDE_EVENTS.stateChange,this.onStateChange),r.on(L.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),r.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add((function(){return document.addEventListener("visibilitychange",e.onVisibilityChange),function(){return document.removeEventListener("visibilitychange",e.onVisibilityChange)}}))}},{key:"syncStateOnce",value:function(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(ve);var e=this.context.storage.state.state;e&&(ae("[Slide] sync with state (once)",JSON.stringify(e)),this.slide.setSlideState(e),this.syncStateOnceFlag=!1)}}},{key:"createSlide",value:function(e){var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.context.getAppOptions()||{},a=new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=o.enableGlobalClick)||t,renderOptions:{minFPS:o.minFPS||25,maxFPS:o.maxFPS||30,autoFPS:null==(r=o.autoFPS)||r,autoResolution:null==(n=o.autoResolution)||n,resolution:o.resolution,transactionBgColor:o.bgColor||ce(e),maxResolutionLevel:o.maxResolutionLevel,forceCanvas:o.forceCanvas,enableNvidiaDetect:o.enableNvidiaDetect},fixedFrameSize:o.fixedFrameSize,loaderDelegate:o.loaderDelegate,navigatorDelegate:o.navigatorDelegate,urlInterrupter:o.urlInterrupter,resourceTimeout:o.resourceTimeout,rtcAudio:o.rtcAudio,useLocalCache:o.useLocalCache,logger:o.logger,whiteTracker:i.whiteTracker,timestamp:this.timestamp});return a}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.destroyed||(ae("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}},{key:"pageCount",get:function(){return this._pageCount>0||(this._pageCount=this.slide.slideCount),this._pageCount}},{key:"page",get:function(){return this.slide.slideState.currentSlideIndex}}]),e}();var ye="undefined"!=typeof window,_e=ye&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),be=ye&&"IntersectionObserver"in window,xe=ye&&"classList"in document.createElement("p"),we=ye&&window.devicePixelRatio>1,Se={elements_selector:".lazy",container:_e||ye?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Te=function(e){return Object.assign({},Se,e)},Me=function(e,t){var r,n="LazyLoad::Initialized",i=new e(t);try{r=new CustomEvent(n,{detail:{instance:i}})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(n,!1,!1,{instance:i})}window.dispatchEvent(r)},ke="src",Ee="srcset",Ae="sizes",Ie="poster",Ce="llOriginalAttrs",Pe="data",Ne="loading",Oe="loaded",Re="applied",De="error",Le="native",je="data-",ze="ll-status",Be=function(e,t){return e.getAttribute(je+t)},Fe=function(e){return Be(e,ze)},Ue=function(e,t){return function(e,t,r){var n=je+t;null!==r?e.setAttribute(n,r):e.removeAttribute(n)}(e,ze,t)},We=function(e){return Ue(e,null)},Ge=function(e){return null===Fe(e)},Ve=function(e){return Fe(e)===Le},He=[Ne,Oe,Re,De],Ye=function(e,t,r,n){e&&(void 0===n?void 0===r?e(t):e(t,r):e(t,r,n))},$e=function(e,t){xe?e.classList.add(t):e.className+=(e.className?" ":"")+t},Xe=function(e,t){xe?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},qe=function(e){return e.llTempImage},Qe=function(e,t){if(t){var r=t._observer;r&&r.unobserve(e)}},Ze=function(e,t){e&&(e.loadingCount+=t)},Ke=function(e,t){e&&(e.toLoadCount=t)},Je=function(e){for(var t,r=[],n=0;t=e.children[n];n+=1)"SOURCE"===t.tagName&&r.push(t);return r},et=function(e,t){var r=e.parentNode;r&&"PICTURE"===r.tagName&&Je(r).forEach(t)},tt=function(e,t){Je(e).forEach(t)},rt=[ke],nt=[ke,Ie],it=[ke,Ee,Ae],ot=[Pe],at=function(e){return!!e[Ce]},st=function(e){return e[Ce]},ut=function(e){return delete e[Ce]},lt=function(e,t){if(!at(e)){var r={};t.forEach((function(t){r[t]=e.getAttribute(t)})),e[Ce]=r}},ct=function(e,t){if(at(e)){var r=st(e);t.forEach((function(t){!function(e,t,r){r?e.setAttribute(t,r):e.removeAttribute(t)}(e,t,r[t])}))}},ht=function(e,t,r){$e(e,t.class_applied),Ue(e,Re),r&&(t.unobserve_completed&&Qe(e,t),Ye(t.callback_applied,e,r))},dt=function(e,t,r){$e(e,t.class_loading),Ue(e,Ne),r&&(Ze(r,1),Ye(t.callback_loading,e,r))},ft=function(e,t,r){r&&e.setAttribute(t,r)},pt=function(e,t){ft(e,Ae,Be(e,t.data_sizes)),ft(e,Ee,Be(e,t.data_srcset)),ft(e,ke,Be(e,t.data_src))},vt={IMG:function(e,t){et(e,(function(e){lt(e,it),pt(e,t)})),lt(e,it),pt(e,t)},IFRAME:function(e,t){lt(e,rt),ft(e,ke,Be(e,t.data_src))},VIDEO:function(e,t){tt(e,(function(e){lt(e,rt),ft(e,ke,Be(e,t.data_src))})),lt(e,nt),ft(e,Ie,Be(e,t.data_poster)),ft(e,ke,Be(e,t.data_src)),e.load()},OBJECT:function(e,t){lt(e,ot),ft(e,Pe,Be(e,t.data_src))}},gt=["IMG","IFRAME","VIDEO","OBJECT"],mt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||Ye(e.callback_finish,t)},yt=function(e,t,r){e.addEventListener(t,r),e.llEvLisnrs[t]=r},_t=function(e,t,r){e.removeEventListener(t,r)},bt=function(e){return!!e.llEvLisnrs},xt=function(e){if(bt(e)){var t=e.llEvLisnrs;for(var r in t){var n=t[r];_t(e,r,n)}delete e.llEvLisnrs}},wt=function(e,t,r){!function(e){delete e.llTempImage}(e),Ze(r,-1),function(e){e&&(e.toLoadCount-=1)}(r),Xe(e,t.class_loading),t.unobserve_completed&&Qe(e,r)},St=function(e,t,r){var n=qe(e)||e;if(!bt(n)){!function(e,t,r){bt(e)||(e.llEvLisnrs={});var n="VIDEO"===e.tagName?"loadeddata":"load";yt(e,n,t),yt(e,"error",r)}(n,(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_loaded),Ue(t,Oe),Ye(r.callback_loaded,t,n),i||mt(r,n)}(0,e,t,r),xt(n)}),(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_error),Ue(t,De),Ye(r.callback_error,t,n),r.restore_on_error&&ct(t,it),i||mt(r,n)}(0,e,t,r),xt(n)}))}},Tt=function(e,t,r){!function(e){e.llTempImage=document.createElement("IMG")}(e),St(e,t,r),function(e){at(e)||(e[Ce]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,r){var n=Be(e,t.data_bg),i=Be(e,t.data_bg_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage='url("'.concat(o,'")'),qe(e).setAttribute(ke,o),dt(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_multi),i=Be(e,t.data_bg_multi_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage=o,ht(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_set);if(n){var i=n.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),ht(e,t,r)}}(e,t,r)},Mt=function(e,t,r){St(e,t,r),function(e,t,r){var n=vt[e.tagName];n&&(n(e,t),dt(e,t,r))}(e,t,r)},kt=function(e,t,r){!function(e){return gt.indexOf(e.tagName)>-1}(e)?Tt(e,t,r):Mt(e,t,r)},Et=function(e,t,r){e.setAttribute("loading","lazy"),St(e,t,r),function(e,t){var r=vt[e.tagName];r&&r(e,t)}(e,t),Ue(e,Le)},At=function(e){e.removeAttribute(ke),e.removeAttribute(Ee),e.removeAttribute(Ae)},It=function(e){et(e,(function(e){ct(e,it)})),ct(e,it)},Ct={IMG:It,IFRAME:function(e){ct(e,rt)},VIDEO:function(e){tt(e,(function(e){ct(e,rt)})),ct(e,nt),e.load()},OBJECT:function(e){ct(e,ot)}},Pt=function(e){var t=Ct[e.tagName];t?t(e):function(e){if(at(e)){var t=st(e);e.style.backgroundImage=t.backgroundImage}}(e)},Nt=function(e,t){Pt(e),function(e,t){Ge(e)||Ve(e)||(Xe(e,t.class_entered),Xe(e,t.class_exited),Xe(e,t.class_applied),Xe(e,t.class_loading),Xe(e,t.class_loaded),Xe(e,t.class_error))}(e,t),We(e),ut(e)},Ot=function(e,t,r,n){r.cancel_on_exit&&function(e){return Fe(e)===Ne}(e)&&"IMG"===e.tagName&&(xt(e),function(e){et(e,(function(e){At(e)})),At(e)}(e),It(e),Xe(e,r.class_loading),Ze(n,-1),We(e),Ye(r.callback_cancel,e,t,n))},Rt=function(e,t,r,n){var i=function(e){return He.indexOf(Fe(e))>=0}(e);Ue(e,"entered"),$e(e,r.class_entered),Xe(e,r.class_exited),function(e,t,r){t.unobserve_entered&&Qe(e,r)}(e,r,n),Ye(r.callback_enter,e,t,n),i||kt(e,r,n)},Dt=["IMG","IFRAME","VIDEO"],Lt=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},jt=function(e,t,r){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Rt(e.target,e,t,r):function(e,t,r,n){Ge(e)||($e(e,r.class_exited),Ot(e,t,r,n),Ye(r.callback_exit,e,t,n))}(e.target,e,t,r)}))},zt=function(e,t){be&&!Lt(e)&&(t._observer=new IntersectionObserver((function(r){jt(r,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},Bt=function(e){return Array.prototype.slice.call(e)},Ft=function(e){return e.container.querySelectorAll(e.elements_selector)},Ut=function(e){return function(e){return Fe(e)===De}(e)},Wt=function(e,t){return function(e){return Bt(e).filter(Ge)}(e||Ft(t))},Gt=function(e,t){var r;(r=Ft(e),Bt(r).filter(Ut)).forEach((function(t){Xe(t,e.class_error),We(t)})),t.update()},Vt=function(e,t){var r=Te(e);this._settings=r,this.loadingCount=0,zt(r,this),function(e,t){ye&&(t._onlineHandler=function(){Gt(e,t)},window.addEventListener("online",t._onlineHandler))}(r,this),this.update(t)};Vt.prototype={update:function(e){var t,r,n=this._settings,i=Wt(e,n);(Ke(this,i.length),!_e&&be)?Lt(n)?function(e,t,r){e.forEach((function(e){-1!==Dt.indexOf(e.tagName)&&Et(e,t,r)})),Ke(r,0)}(i,n,this):(t=this._observer,r=i,function(e){e.disconnect()}(t),function(e,t){t.forEach((function(t){e.observe(t)}))}(t,r)):this.loadAll(i)},destroy:function(){var e;this._observer&&this._observer.disconnect(),e=this,ye&&window.removeEventListener("online",e._onlineHandler),Ft(this._settings).forEach((function(e){ut(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,r=this._settings;Wt(e,r).forEach((function(e){Qe(e,t),kt(e,r,t)}))},restoreAll:function(){var e=this._settings;Ft(e).forEach((function(t){Nt(t,e)}))}},Vt.load=function(e,t){var r=Te(t);kt(e,r)},Vt.resetStatus=function(e){We(e)},ye&&function(e,t){if(t)if(t.length)for(var r,n=0;r=t[n];n+=1)Me(e,r);else Me(e,t)}(Vt,window.lazyLoadOptions);var Ht=function(){function e(t){var r=this,n=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=t.onPagesReady,s=t.urlInterrupter;x(this,e),this._pages=[],this.pageIndex=0,this.setPaused=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new F,this.readonly=n,this.onNewPageIndex=i,this.onPlay=o,this.onPagesReady=a,this.urlInterrupter=s||function(e){return e},this.render()}var t;return S(e,[{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e}},{key:"destroy",value:function(){var e;null==(e=this.previewLazyLoad)||e.destroy(),this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}},{key:"refreshTotalPage",value:function(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t,this.refreshPreview(),this.sideEffect.addEventListener(t,"click",(function(t){var r;if(!e.readonly){var n=null==(r=t.target.dataset)?void 0:r.pageIndex;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(n),"preview"),e.togglePreview(!1))}}))}return this.$preview}},{key:"refreshPreview",value:(t=l(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=this.$preview,i=this.wrapClassName("preview-page"),o=this.wrapClassName("preview-page-name");n.firstChild;)n.firstChild.remove();for(a=[],s=0,u=this.pages.length;s0?"":"none"}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer"));var r=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-sidebar")),r.setAttribute("viewBox","0 0 64 64");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(r,"click",(function(){e.readonly||e.togglePreview()})),this.$btnSidebar=r,this.$btnSidebar.style.display="none",this.$footer.appendChild(r);var n=document.createElement("div");n.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),r.appendChild(n),r}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1,"navigation")})),n.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-play")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),r.appendChild(n),r}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-pause")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),r.appendChild(n),r}(this.namespace));this.$btnPlay=o,this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(e.setPlaying(),e.onPlay&&e.onPlay())})),n.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1,"navigation")})),n.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1,"input")}));var l=document.createElement("span");this.$totalPage=l,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(n),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,r){var n=document.createElement("button");return n.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),n.appendChild(t),r&&n.appendChild(r),n}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&(this.previewLazyLoad||(this.previewLazyLoad=new Vt({container:this.$preview,elements_selector:".".concat(this.wrapClassName("preview-page>img"))})),this.$preview.scrollTo({top:t.offsetTop-16}))}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"pages",set:function(e){this._pages=e,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage(),this.onPagesReady&&this.onPagesReady(e)},get:function(){return this._pages}}]),e}(),Yt=new Set(["clicker"]),$t=function(){},Xt=function(){function e(t){var n=this,i=t.box,o=t.view,a=t.mountSlideController,s=t.mountWhiteboard,u=t.baseScenePath,c=t.appId,h=t.urlInterrupter,d=t.onPagesReady,f=t.onNavigate;x(this,e),this.slideController=null,this.isViewMounted=!1,this.onError=function(e){var t,r,i=e.error,o=e.index;n.viewer.setPaused(),(null==(t=n.slideController)?void 0:t.showRenderError)&&(n.$overlay.textContent="Error on slide[page=".concat(n.slideController.page,"]: ").concat(i.message),n.$overlay.style.opacity="1"),(null==(r=n.slideController)?void 0:r.onRenderError)&&n.slideController.onRenderError(i,o),oe.warn("[Slide] render error",i)},this.onRenderStart=function(){n.$whiteboardView.classList.add(n.wrapClassName("wb-view-hidden")),n.viewer.setPlaying()},this.onRenderEnd=function(){},this.onPageChanged=function(){clearTimeout(n._onPageChangedTimer),n._onPageChangedTimer=setTimeout(n._onPageChanged,200)},this._onPageChangedTimer=0,this._onPageChanged=function(){n.$overlay.style.opacity="",n.$whiteboardView.classList.remove(n.wrapClassName("wb-view-hidden"))},this.refreshPages=function(){n.slideController&&(n.viewer.pages=de(n.slideController.slide,n.slideController.previewList),n.viewer.setPageIndex(n.getPageIndex(n.slideController.page)),n.scaleDocsToFit())},this.scaleDocsToFit=function(){if(n.slideController){var e=n.slideController.slide,t=e.width,r=e.height;t&&r&&(n.whiteboardView.moveCameraToContain({originX:-t/2,originY:-r/2,width:t,height:r,animationMode:"immediately"}),n.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return n.whiteboardView.camera.scale},minContentMode:function(){return n.whiteboardView.camera.scale},centerX:0,centerY:0,width:t,height:r}),n.isViewMounted||(n.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),n.mountWhiteboard(n.$whiteboardView)))}},this.onPlay=function(){n.slideController&&n.slideController.slide.nextStep()},this.onNewPageIndex=function(e,t){n.slideController&&n.slideController.jumpToPage(e+1,t)},this.sideEffect=new F,this.namespace="netless-app-slide",this.toPdf=l(regeneratorRuntime.mark((function e(){var t,i,o,a,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.slideController){e.next=3;break}return n.reportProgress(100,null),e.abrupt("return");case 3:if(t=n.slideController.slide,i=1920,o=document.createElement("canvas"),a=o.getContext("2d"),s=t.slideCount,u=t.width,l=t.height,c=Math.floor(u),h=Math.floor(l),c>i&&(c=i,h=Math.floor(l*c/u)),h>i&&(h=i,c=Math.floor(u*h/l)),o.width=c,o.height=h,(d=document.createElement("canvas")).width=c,d.height=h,(f=d.getContext("2d"))&&n.getWhiteSnapshot&&a){e.next=21;break}return n.reportProgress(100,null),e.abrupt("return",null);case 21:return p=c>h?"l":"p",e.next=24,Promise.resolve().then(r.bind(r,88877));case 24:v=e.sent,g=v.jsPDF,m=new g({format:[c,h],orientation:p,compress:!0}),y=1;case 28:if(!(y<=s)){e.next=57;break}return _=null,e.prev=30,e.next=33,n.slideController.slide.snapshotWithTimingEnd(y);case 33:_=e.sent,e.next=38;break;case 36:e.prev=36,e.t0=e.catch(30);case 38:if(!_){e.next=40;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("img")).src=_,e.next=4,new Promise((function(e){return t.onload=e}));case 4:a.drawImage(t,0,0,c,h);case 5:case"end":return e.stop()}}),e)}))(),"t1",40);case 40:return f.clearRect(0,0,c,h),n.getWhiteSnapshot(y,d,f,u,l),e.prev=42,e.delegateYield(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.toDataURL("image/png"),(r=document.createElement("img")).src=t,e.next=5,new Promise((function(e){return r.onload=e}));case 5:a.drawImage(r,0,0,c,h);case 6:case"end":return e.stop()}}),e)}))(),"t2",44);case 44:e.next=48;break;case 46:e.prev=46,e.t3=e.catch(42);case 48:b=o.toDataURL("image/jpeg",.6),y>1&&m.addPage(),m.addImage(b,"JPEG",0,0,c,h,"","FAST"),a.clearRect(0,0,c,h),Math.ceil(y/s*100)<100&&n.reportProgress(Math.ceil(y/s*100),null);case 54:y++,e.next=28;break;case 57:x=m.output("arraybuffer"),w=n.box.title,n.reportProgress(100,{pdf:x,title:w});case 60:case"end":return e.stop()}}),e,null,[[30,36],[42,46]])}))),this.box=i,this.whiteboardView=o,this.mountSlideController=a,this.mountWhiteboard=s,this.onNavigate=f||$t,this.baseScenePath=u,this.appId=c,this.viewer=new Ht({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h,onPagesReady:d}),this.sideEffect.add((function(){var e=function(e){n.setReadonly(e)};return i.events.on("readonly",e),function(){return i.events.off("readonly",e)}})),this.sideEffect.add((function(){var e=function(e){"@netless/_request_save_pdf_"===e.data.type&&e.data.appId===n.appId&&n.toPdf().catch((function(){return n.reportProgress(100,null)}))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}})),this.render()}return S(e,[{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",(function(t){if(e.box.focus&&e.slideController&&!function(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.slideController.slide.prevStep(),e.onNavigate(e.slideController.page,"keydown");break;case"ArrowRight":case"ArrowDown":e.slideController.slide.nextStep(),e.onNavigate(e.slideController.page,"keydown")}}))}},{key:"renderOverlay",value:function(){if(!this.$overlay){var e=document.createElement("div");e.className=this.wrapClassName("overlay"),this.$overlay=e}return this.$overlay}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"renderWhiteboardView",value:function(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}},{key:"mount",value:function(){var e=this;return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onNavigate:this.onNavigate,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){return e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"unmount",value:function(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.viewer.setReadonly(e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"toggleClickThrough",value:function(e){this.$whiteboardView.style.pointerEvents=!e||Yt.has(e)?"none":"auto"}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"getWhiteSnapshot",value:function(e,t,r,n,i){this.whiteboardView.screenshotToCanvas(r,"".concat(this.baseScenePath,"/").concat(e),t.width,t.height,{centerX:0,centerY:0,scale:Math.min(t.width/n,t.height/i)})}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),qt=!1,Qt=2;t.FreezerLength=Qt;var Zt=function(e){return"["+e+"]"},Kt={map:new Map,boxes:new Map,queue:[],validateQueue:function(){var e=this;for(this.queue.sort((function(t,r){var n,i,o,a;return-((null!=(i=null==(n=e.boxes.get(t))?void 0:n.zIndex)?i:0)-(null!=(a=null==(o=e.boxes.get(r))?void 0:o.zIndex)?a:0))})),ae("[Slide] freezer: validate",Zt(this.queue));this.queue.length>Qt;){var t=this.queue.pop(),r=this.map.get(t);r&&(ae("[Slide] freezer: validate-freeze",t,Zt(this.queue)),r.freeze())}},set:function(e,t,r){ae("[Slide] freezer: add",e,Zt(this.queue)),this.map.set(e,t),this.boxes.set(e,r),this.queue.includes(e)||this.queue.unshift(e),this.validateQueue()},delete:function(e){this.map.delete(e),this.boxes.delete(e),this.queue=this.queue.filter((function(t){return t!==e})),ae("[Slide] freezer: delete",e,Zt(this.queue))},focus:function(e){var t=this.map.get(e),r=this.queue.indexOf(e);r>-1&&this.queue.splice(r,1),this.queue.unshift(e),this.validateQueue(),ae("[Slide] freezer: focus",e,Zt(this.queue)),t&&t.unfreeze()}};t.apps=Kt;var Jt=new Set;var er=new Set;t.addHooks=function(e){qt=!0,e.on("focus",(function(e){var t=e.appId;Kt.focus(t)})),e.on("created",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;er.forEach((function(e){return e(t)}))}))};var tr=function(){return".netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden;transition:opacity .2s}.netless-app-slide-wb-view-hidden{opacity:0}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}\n"}();var rr=function(){function e(t){var r=this;x(this,e),this.slide=null,this.debug=!1,this.previewList=[],this.sideEffect=new F,this.ready=!1,this.readyPromise=new Promise((function(e){r.resolveReady=function(){r.ready=!0,e()}})),this.hotkeyListener=function(e){if(r.slide)switch(e.key){case"ArrowUp":case"ArrowLeft":r.slide.prevStep();break;case"ArrowRight":case"ArrowDown":r.slide.nextStep()}},this.onPageChanged=function(e){r.viewer.setPageIndex(e-1)},this.onTransitionStart=function(){r.viewer.setPlaying()},this.onTransitionEnd=function(){r.viewer.setPaused()},this.onError=function(e){var t=e.error;r.viewer.setPaused(),console.warn("[Slide] render error",t)},this.destroyed=!1,this.refreshPages=function(){r.slide&&(r.viewer.pages=de(r.slide,r.previewList),r.viewer.setPageIndex(r.getPageIndex(r.slide.slideState.currentSlideIndex)))},this.onPlay=function(){r.slide&&r.slide.nextStep()},this.onNewPageIndex=function(e){r.slide&&r.slide.slideCount>0&&r.slide.renderSlide(W(e+1,1,r.slide.slideCount))},this.namespace="netless-app-slide",this.target=t.target,this.bgColor=ce(this.target),this.viewer=new Ht({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}return S(e,[{key:"render",value:function(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}},{key:"registerHotKeys",value:function(e){this.sideEffect.addEventListener(e,"keydown",this.hotkeyListener,void 0,"hotkey")}},{key:"mount",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new L.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),r.length>0?this.slide.setResourceList(e,r):this.slide.setResource(e,t),this.slide.renderSlide(1),this.previewList=n}},{key:"renderStyle",value:function(){var e=document.createElement("style");return e.appendChild(document.createTextNode(tr)),e}},{key:"registerEventListeners",value:function(){if(this.slide){var e=this.slide;e.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),e.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.renderError,this.onError),e.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();t.SlidePreviewer=rr;var nr=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=nr;var ir="0.2.60";t.version=ir;var or={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.60"),e.getIsWritable()&&e.storage.ensureState(ve),!e.storage.state.taskId)throw new Error("[Slide] no taskId");var r=e.getView();if(!r)throw new Error("[Slide] no view, please set scenePath on addApp()");r.disableCameraTransform=!0;var n=e.getBox();n.mountStyles(tr);try{n.$content.dataset.appSlideVersion=ir}catch(e){}var i=e.getInitScenePath(),o=null,a=function(t){var r=e.getRoom();if(o&&o.slideController){var n=!1;r&&e.getIsWritable()&&(fe(r,e,o.slideController.slide,i),n=!0),ae("[Slide] page to",t,n?"(synced)":""),o.viewer.setPageIndex(t-1),o.viewer.setPaused(),o.onPageChanged();var a=o.viewer.pages.length;a>0&&e.dispatchAppEvent("pageStateChange",{index:t-1,length:a})}};o=new Xt({box:n,view:r,mountSlideController:function(t){var r,o,s=e.getAppOptions()||{},u=new me((r=D({context:e},t),o={onPageChanged:a,onNavigate:t.onNavigate,onRenderError:s.onRenderError,showRenderError:s.showRenderError,invisibleBehavior:s.invisibleBehavior},I(r,C(o))));return qt&&Kt.set(e.appId,u,n),oe.setAppController(e.appId,u),u.readyPromise.then(t.onReady).then((function(){var r=e.getRoom(),n=!1;r&&e.getIsWritable()&&(fe(r,e,u.slide,i),n=!0);var o=u.slide.slideState.currentSlideIndex;ae("[Slide] page to",o,n?"(synced)":"","(on ready)"),u.slide.on("renderEnd",t.onRenderEnd)})),u},mountWhiteboard:e.mountView.bind(e),baseScenePath:i,appId:e.appId,urlInterrupter:null==(t=e.getAppOptions())?void 0:t.urlInterrupter,onPagesReady:function(t){var r=t.length,n=(null==o?void 0:o.viewer.pageIndex)||0;e.dispatchAppEvent("pageStateChange",{index:n,length:r})},onNavigate:function(e,t){ae("[Slide] user navigate to",e,t?"(".concat(t,")"):"")}});var s=e.getRoom(),u=new F;return u.add((function(){var t;return oe.setAppContext(e.appId,e),oe.enable=(null==(t=e.getAppOptions())?void 0:t.debug)||!1,oe.level="debug",function(){return oe.deleteApp(e.appId)}})),s&&(o.toggleClickThrough(s.state.memberState.currentApplianceName),u.add((function(){var e=function(e){e.memberState&&o&&o.toggleClickThrough(e.memberState.currentApplianceName)};return s.callbacks.on("onRoomStateChanged",e),function(){return s.callbacks.off("onRoomStateChanged",e)}}))),e.emitter.on("destroy",(function(){ae("[Slide] destroy",e.appId),qt&&Kt.delete(e.appId),u.flushAll(),o&&(o.destroy(),o=null)})),o.mount(),{viewer:function(){return o},controller:function(){return null==o?void 0:o.slideController},slide:function(){var e;return null==(e=null==o?void 0:o.slideController)?void 0:e.slide},nextStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.nextStep(),!0)},prevStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.prevStep(),!0)},position:function(){var e=null==o?void 0:o.slideController;if(e)return[e.page,e.pageCount]},nextPage:function(){var e=null==o?void 0:o.slideController;if(e){var t=e.page,r=e.pageCount;if(r>0&&t0&&t>1)return e.jumpToPage(t-1),!0}return!1},jumpToPage:function(e){var t=null==o?void 0:o.slideController;if(t){var r=t.page,n=t.pageCount;if(n>0&&r>0&&r<=n)return t.jumpToPage(e),!0}return!1}}}};t.default=or;var ar=L.Slide;t.Slide=ar},60064:function(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});var n=r(91215);t.ActiveContainerType=n.ActiveContainerType,t.ApplianceMultiPlugin=n.ApplianceMultiPlugin,t.ApplianceNames=n.ApplianceNames,t.ApplianceSigleWrapper=n.ApplianceSigleWrapper,t.ApplianceSinglePlugin=n.ApplianceSinglePlugin,t.ECanvasContextType=n.ECanvasContextType,t.ECanvasShowType=n.ECanvasShowType,t.EDataType=n.EDataType,t.EMatrixrRelationType=n.EMatrixrRelationType,t.EPostMessageType=n.EPostMessageType,t.EScaleType=n.EScaleType,t.EStrokeType=n.EStrokeType,t.EToolsKey=n.EToolsKey,t.ElayerType=n.ElayerType,t.EmitEventType=n.EmitEventType,t.EventMessageType=n.EventMessageType,t.EvevtWorkState=n.EvevtWorkState,t.EvevtWorkType=n.EvevtWorkType,t.InternalMsgEmitterType=n.InternalMsgEmitterType,t.ShapeType=n.ShapeType,t.fullWorkerUrl=n.fullWorker,t.subWorkerUrl=n.subWorker},62959:function(e,t,r){function n(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t,r){return i=x()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&m(i,r.prototype),i},i.apply(null,arguments)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=c(e))){var t=0,r=function(){};return{s:r,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function s(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)}))}}function l(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:.01;return e.reduce((function(e,r){var n=e[e.length-1];return(r&&!n||r&&n&&!r.isNear(n,t))&&e.push(r),e}),[])}},{key:"setWorkId",value:function(e){this.workId=e}},{key:"getWorkId",value:function(){return this.workId}},{key:"getWorkOptions",value:function(){return this.workOptions}},{key:"setWorkOptions",value:function(e){var t,r,n;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var i=null==(t=this.workId)?void 0:t.toString(),o=i&&(null==(r=this.vNodes)?void 0:r.get(i))||void 0;i&&o&&(o.opt=e,null==(n=this.vNodes)||n.setInfo(i,o))}},{key:"updataOptService",value:function(t){var r,n,i,o=null==(r=this.workId)?void 0:r.toString();if(o&&t){var a=this.fullLayer.getElementsByName(o)||this.drawLayer&&this.drawLayer.getElementsByName(o)||[];if(1!==a.length)return;var s=a[0],u=t.pos,l=t.zIndex,c=t.scale,h=t.angle,d=t.translate,f={};L(l)&&(f.zIndex=l),u&&(f.pos=[u[0],u[1]]),c&&(f.scale=c),h&&(f.rotate=h),d&&(f.translate=d),s.attr(f);var p=null==s?void 0:s.getBoundingClientRect();return p&&(i=I.computRect(i,{x:Math.floor(p.x-e.SafeBorderPadding),y:Math.floor(p.y-e.SafeBorderPadding),w:Math.floor(p.width+2*e.SafeBorderPadding),h:Math.floor(p.height+2*e.SafeBorderPadding)})),null==(n=this.vNodes)||n.setInfo(o,{rect:i,centerPos:u}),i}}},{key:"replace",value:function(e,t,r){var n,i=this,o=e.getElementsByName(t),a=o.length;if(a){if(a>1)for(var s=1;s1&&void 0!==arguments[1])||arguments[1],r=e.length;if(r<2)return"";var n=e[0],i=e[1];if(2===r)return"M".concat(I.precise(n),"L").concat(I.precise(i));for(var o="",a=2,s=r-1;a3?"T":"").concat(o,"L").concat(I.precise(e[r-1]))}var F=function(e){g(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),A(b(n),"canRotate",!0),A(b(n),"scaleType",I.EScaleType.all),A(b(n),"toolsType",I.EToolsKey.Pencil),A(b(n),"syncTimestamp"),A(b(n),"syncIndex",0),A(b(n),"tmpPoints",[]),A(b(n),"MAX_REPEAR",10),A(b(n),"uniThickness"),A(b(n),"workOptions"),A(b(n),"centerPos",[0,0]),n.workOptions=e.toolsOpt,n.uniThickness=n.MAX_REPEAR/n.workOptions.thickness/10,n.syncTimestamp=0,n}return M(r,[{key:"combineConsume",value:function(){var e,t=null==(e=this.workId)?void 0:e.toString();if(this.tmpPoints.length<2)return{type:I.EPostMessageType.None};var r,n=this.transformDataAll(!0),i={name:t},o=this.drawLayer||this.fullLayer;return n.length&&(r=this.draw({attrs:i,tasks:n,replaceId:t,layer:o})),{rect:r,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local}}},{key:"setWorkOptions",value:function(e){v(w(r.prototype),"setWorkOptions",this).call(this,e),this.syncTimestamp=Date.now()}},{key:"consume",value:function(e){var t=this,r=e.data,n=e.isFullWork,i=e.isSubWorker,o=e.isMainThread,a=e.drawCount,s=e.replaceId,u=r.workId,l=this.transformData(r,!1),c=l.tasks,h=l.effects,d=l.consumeIndex;this.syncIndex=Math.min(this.syncIndex,d,Math.max(0,this.tmpPoints.length-2));var p,v={name:u,id:null==a?void 0:a.toString()},g=!1,m=this.syncIndex;if(0===this.syncTimestamp&&(this.syncTimestamp=Date.now()),c.length&&(c[0].taskId-this.syncTimestamp>this.syncUnitTime&&(g=!0,this.syncTimestamp=c[0].taskId,this.syncIndex=this.tmpPoints.length),i||o)){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({attrs:v,tasks:c,effects:h,layer:y,replaceId:s})}if(i)return d>10&&this.tmpPoints.splice(0,d-10),{rect:p,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local};var _=[];return this.tmpPoints.slice(m).forEach((function(e){_.push(e.x,e.y,t.computRadius(e.z,t.workOptions.thickness))})),f(f({},this.baseConsumeResult),{},{type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,rect:p,op:g?_:void 0,index:g?3*m:void 0,updateNodeOpt:{useAnimation:!0}})}},{key:"consumeAll",value:function(e){var t,r=this,n=this.workId;if(e.data){var i=e.data,o=i.op,a=i.workState;null!=o&&o.length&&a===I.EvevtWorkState.Done&&this.workOptions.strokeType===I.EStrokeType.Stroke&&this.updateTempPointsWithPressureWhenDone(o)}var s,u=this.transformDataAll(!0),l={name:n},c=this.fullLayer;if(u.length&&(s=this.draw({attrs:l,tasks:u,replaceId:n,layer:c})),this.tmpPoints.length<2)return this.replace(c,n),{type:I.EPostMessageType.RemoveNode,removeIds:[n],rect:s};var h=[];this.tmpPoints.map((function(e){h.push(e.x,e.y,r.computRadius(e.z,r.workOptions.thickness))})),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var d=I.transformToSerializableData(h);return null==(t=this.vNodes)||t.setInfo(n,{rect:s,op:h,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&z.getCenterPos(s,c)}),f(f({},this.baseConsumeResult),{},{rect:s,type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:d,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}})}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId;this.tmpPoints.length=0;for(var a=0;a0){var u=this.tmpPoints[this.tmpPoints.length-1],l=I.Vec2d.Sub(s,u).uni();s.setv(l)}this.tmpPoints.push(s)}if(!(this.tmpPoints.length<2)){var c,h=this.transformDataAll(!1),d=null==(t=this.workId)?void 0:t.toString(),f={name:d};if(d&&h.length){var p=i?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({attrs:f,tasks:h,replaceId:o,layer:p}),null==(r=this.vNodes)||r.setInfo(d,{rect:c,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&z.getCenterPos(c,p)})}return c}}},{key:"transformDataAll",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(t,e&&this.workOptions.thickness||void 0)}},{key:"draw",value:function(e){var t,r=this,n=e.attrs,i=e.tasks,o=e.replaceId,a=e.effects,s=e.layer,u=this.workOptions,c=u.strokeColor,h=u.strokeType,d=u.thickness,p=u.zIndex,v=u.scale,g=u.rotate,m=u.translate;null!=a&&a.size&&(a.forEach((function(e){var t;null==(t=s.getElementById(e+""))||t.remove()})),a.clear());for(var y=[],_=s.worldPosition,b=s.worldScaling,x=0;x1&&(s=e[n+1].point.v);var u=I.Vec2d.Per(s).mul(a);t.push(I.Point2d.Sub(o,u)),r.push(I.Point2d.Add(o,u))}var l=e[e.length-1],c=I.Point2d.GetSemicircleStroke(l.point,t[t.length-1],-1,8),h=I.Point2d.GetSemicircleStroke(e[0].point,r[0],-1,8),d=t.concat(c,r.reverse(),h);return{ps:d,rect:I.getRectFromPoints(d)}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:I.Point2d.GetDotStroke(t,r,8),rect:n}}},{key:"transformData",value:function(e,t){var r=e.op,n=e.workState,i=this.tmpPoints.length-1,o=[];if(null!=r&&r.length&&n){var a=this.workOptions,s=a.strokeType,u=a.thickness,l=new Set;i=s===I.EStrokeType.Stroke?this.updateTempPointsWithPressure(r,u,l):this.updateTempPoints(r,u,l);var c=t?this.tmpPoints:this.tmpPoints.slice(i);return{tasks:o=this.getTaskPoints(c,u),effects:l,consumeIndex:i}}return{tasks:o,consumeIndex:i}}},{key:"computRadius",value:function(e,t){return.03*e*t+.5*t}},{key:"getMinZ",value:function(e,t){return 100*((t||Math.max(1,Math.floor(.3*e)))-.5*e)/e/3}},{key:"getTaskPoints",value:function(e,t){var r,n=[];if(0===e.length)return[];for(var i=0,o=e[0].x,a=e[0].y,s=[o,a],u=[],c=e[0].t;i0&&i270){var m=null==(r=u.pop())?void 0:r.point.clone();m&&n.push({taskId:c,pos:s,points:[].concat(l(u),[{point:m,radius:v}])}),s=[o=e[i].x,a=e[i].y];var y=h.x-o,_=h.y-a;u=[{point:new I.Point2d(y,_,p),radius:v}],c=Date.now()}}i++}return n.push({taskId:c,pos:s,points:u}),n}},{key:"updateTempPointsWithPressure",value:function(e,t,r){for(var n=Date.now(),i=this.tmpPoints.length,o=i,a=0;a1)for(var d=s-1;d>0;){var f=this.tmpPoints[d].distance(this.tmpPoints[d-1]),p=Math.max(this.tmpPoints[d].z-this.uniThickness*f,0);if(this.tmpPoints[d-1].z>=p)break;this.tmpPoints[d-1].setz(p),o=Math.min(o,d-1),d--}}else o=1/0;else{u.setv(h);var v=u.distance(c),g=Math.max(c.z-this.uniThickness*v,0);s>1&&I.Vec2d.Equals(h,c.v,.02)&&(g>0||c.z<=0)&&(r&&c.t&&r.add(c.t),this.tmpPoints.pop(),o=Math.min(l,o)),u.setz(g),this.tmpPoints.push(u)}}else this.tmpPoints.push(u)}if(o===1/0)return this.tmpPoints.length;var m=i;if(o===i){m=Math.max(m-1,0);var y=this.tmpPoints[m].t;y&&(null==r||r.add(y))}else{var _=i-1;for(m=o;_>=0;){var b=this.tmpPoints[_].t;if(b&&(null==r||r.add(b),_<=o)){m=_,_=-1;break}_--}}return this.tmpPoints[m].setT(n),m}},{key:"updateTempPoints",value:function(e,t,r){for(var n,i=Date.now(),o=this.tmpPoints.length,a=o,s=0;s=0;){var g=null==(n=this.tmpPoints[v])?void 0:n.t;if(g&&(null==r||r.add(g),v<=a)){f=v,v=-1;break}v--}}return this.tmpPoints[f].setT(i),f}},{key:"updateTempPointsWithPressureWhenDone",value:function(e){for(var t=this.workOptions.thickness,r=e.length,n=this.getMinZ(t),i=0;i1&&u.z===n)break;if(a.isNear(u,t/2)){if(r<3&&u.z1))for(var h=o-1;h>0;){var d=this.tmpPoints[h].distance(this.tmpPoints[h-1]),f=Math.max(this.tmpPoints[h].z-this.uniThickness*d,-t/4);if(this.tmpPoints[h-1].z>=f)break;this.tmpPoints[h-1].setz(f),h--}}else{a.setv(l);var p=Math.max(u.z-this.uniThickness*c,n);o>1&&I.Vec2d.Equals(l,u.v,.02)&&u.z<=0&&this.tmpPoints.pop(),a.setz(p),this.tmpPoints.push(a)}}else this.tmpPoints.push(a)}}}],[{key:"updateNodeOpt",value:function(e){var t,r=e.node,n=e.opt,i=e.vNodes,o=n.strokeColor,a=i.get(r.name);return o&&("GROUP"===r.tagName?ae(r)?r.setAttribute("bgcolor",o):r.children.forEach((function(e){e.setAttribute("strokeColor",o),e.getAttribute("fillColor")&&e.setAttribute("fillColor",o)})):(r.setAttribute("strokeColor",o),r.setAttribute("fillColor",o)),null!=(t=null==a?void 0:a.opt)&&t.strokeColor&&(a.opt.strokeColor=o)),a&&i.setInfo(r.name,a),z.updateNodeOpt(e)}}]),r}(z),U=function(e){g(n,e);var t,r=y(n);function n(e){var t;return S(this,n),t=r.call(this,e),A(b(t),"toolsType",I.EToolsKey.LaserPen),A(b(t),"canRotate",!1),A(b(t),"scaleType",I.EScaleType.none),A(b(t),"syncTimestamp"),A(b(t),"syncIndex",0),A(b(t),"tmpPoints",[]),A(b(t),"workOptions"),A(b(t),"consumeIndex",0),t.workOptions=e.toolsOpt,t.syncTimestamp=0,t}return M(n,[{key:"combineConsume",value:function(){}},{key:"setWorkOptions",value:function(e){v(w(n.prototype),"setWorkOptions",this).call(this,e),this.syncTimestamp=Date.now()}},{key:"consume",value:function(e){var t=e.data,r=e.isSubWorker,n=t.workId,i=t.op;if(0===(null==i?void 0:i.length))return{type:I.EPostMessageType.None};if(this.updateTempPoints(i||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:I.EPostMessageType.None};var o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType,l=I.getRectFromPoints(this.tmpPoints,s),c=!1,h=this.syncIndex,d=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,0===this.syncTimestamp&&(this.syncTimestamp=Date.now());var p={name:null==n?void 0:n.toString(),opacity:1,lineDash:u===I.EStrokeType.Dotted?[1,2*s]:u===I.EStrokeType.LongDotted?[s,2*s]:void 0,strokeColor:a,lineCap:"round",lineWidth:s,anchor:[.5,.5]},v=this.getTaskPoints(d);if(v.length){var g=Date.now();g-this.syncTimestamp>this.syncUnitTime&&(c=!0,this.syncTimestamp=g,this.syncIndex=this.tmpPoints.length),r&&this.draw({attrs:p,tasks:v,isDot:!1,layer:this.drawLayer||this.fullLayer})}var m=[];return this.tmpPoints.slice(h).forEach((function(e){m.push(e.x,e.y)})),f({rect:{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]},type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,op:c?m:void 0,index:c?2*h:void 0},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t,r=null==(e=this.workId)?void 0:e.toString();if(this.tmpPoints.length-1>this.consumeIndex){var n=this.tmpPoints.slice(this.consumeIndex),i=1===n.length,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(i){var l=this.computDotStroke({point:n[0],radius:s/2});n=l.ps,t=l.rect}else t=I.getRectFromPoints(this.tmpPoints,s);var c={name:null==r?void 0:r.toString(),fillColor:i?a:void 0,opacity:1,lineDash:u!==I.EStrokeType.Dotted||i?u!==I.EStrokeType.LongDotted||i?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:i?void 0:"round",lineWidth:i?0:s,anchor:[.5,.5]},h=this.getTaskPoints(n);h.length&&this.draw({attrs:c,tasks:h,isDot:i,layer:this.drawLayer||this.fullLayer})}var d=[];this.tmpPoints.forEach((function(e){d.push(e.x,e.y)}));var p=I.transformToSerializableData(d);return f({rect:t&&{x:t.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:t.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:t.w*this.fullLayer.worldScaling[0],h:t.h*this.fullLayer.worldScaling[1]},type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:p,index:2*this.syncIndex},this.baseConsumeResult)}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r=e.op,n=e.replaceId,i=e.isFullWork,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(!r.length){var l=I.getRectFromPoints(this.tmpPoints,s);return{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]}}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var h,d=this.tmpPoints.slice(c),f=1===d.length;if(f){var p=this.computDotStroke({point:d[0],radius:s/2});d=p.ps,h=p.rect}else h=I.getRectFromPoints(this.tmpPoints,s);var v={name:null==(t=this.workId)?void 0:t.toString(),fillColor:f?a:void 0,opacity:1,lineDash:u!==I.EStrokeType.Dotted||f?u!==I.EStrokeType.LongDotted||f?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:f?void 0:"round",lineWidth:f?0:s,anchor:[.5,.5]},g=this.getTaskPoints(d);if(g.length){var m=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:v,tasks:g,isDot:f,replaceId:n,layer:m})}return{x:h.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:h.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:h.w*this.fullLayer.worldScaling[0],h:h.h*this.fullLayer.worldScaling[1]}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:I.Point2d.GetDotStroke(t,r,8),rect:n}}},{key:"updateTempPoints",value:function(e){for(var t=this.tmpPoints.length,r=0;r0&&n270){var f=null==(t=s.pop())?void 0:t.clone();f&&r.push({pos:a,points:[].concat(l(s),[f])}),a=[i=e[n].x,o=e[n].y];var p=u.x-i,v=u.y-o;s=[new I.Point2d(p,v)]}}n++}return r.push({pos:a,points:s}),r}},{key:"removeLocal",value:function(){}},{key:"removeService",value:function(e){var t,r=[];return this.fullLayer.getElementsByName(e).forEach((function(n){if(n.name===e){var i=n.getBoundingClientRect();t=I.computRect(t,{x:i.x,y:i.y,w:i.width,h:i.height}),r.push(n)}})),r.length&&r.forEach((function(e){return e.remove()})),t}}]),n}(z),W=function(e){g(r,e);var t=y(r);function r(e,n){var i;return S(this,r),i=t.call(this,e),A(b(i),"canRotate",!1),A(b(i),"scaleType",I.EScaleType.none),A(b(i),"toolsType",I.EToolsKey.Eraser),A(b(i),"serviceWork"),A(b(i),"tmpPoints",[]),A(b(i),"workOptions"),A(b(i),"worldPosition"),A(b(i),"worldScaling"),A(b(i),"eraserRect"),A(b(i),"eraserPolyline"),i.serviceWork=n,i.workOptions=e.toolsOpt,i.worldPosition=i.fullLayer.worldPosition,i.worldScaling=i.fullLayer.worldScaling,i}return M(r,[{key:"combineConsume",value:function(){}},{key:"consumeService",value:function(){}},{key:"setWorkOptions",value:function(e){v(w(r.prototype),"setWorkOptions",this).call(this,e)}},{key:"createEraserRect",value:function(e){var t=e[0]*this.worldScaling[0]+this.worldPosition[0],n=e[1]*this.worldScaling[1]+this.worldPosition[1],i=r.eraserSizes[this.workOptions.thickness],o=i.width,a=i.height;this.eraserRect={x:t-.5*o,y:n-.5*a,w:o,h:a},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h]}},{key:"computRectCenterPoints",value:function(){var e=this.tmpPoints.slice(-2);if(4===this.tmpPoints.length){var t=new I.Vec2d(this.tmpPoints[0],this.tmpPoints[1]),n=new I.Vec2d(this.tmpPoints[2],this.tmpPoints[3]),i=I.Vec2d.Sub(n,t).uni(),o=I.Vec2d.Dist(t,n),a=r.eraserSizes[this.workOptions.thickness],s=a.width,u=a.height,l=Math.min(s,u),c=Math.round(o/l);if(c>1){for(var h=[],d=0;d-1){var a=[],s=i.slice(0,o+1);if(I.Vec2d.Equals(i[o],t[0])||s.push(t[0].clone().setz(i[o].z)),s.length>1&&a.push(s),o+t.length-11&&a.push(l)}return{v:(r.splice.apply(r,[n,1].concat(a)),r)}}},i=0;i0&&t.isSamePoint(e,n[r-1]))})),o=[],a=0;a1){var w=P.polyline(y.map((function(e){return e.XY})),this.eraserPolyline);if(w.length&&(s.add(f.name),!g))for(var S=this.translateIntersect(w),T=this.cutPolyline(S,y),M=function(e){var t="".concat(d,"_s_").concat(e),r=[];T[e].forEach((function(e){r.push((e.x-n.worldPosition[0])/n.worldScaling[0],(e.y-n.worldPosition[1])/n.worldScaling[1],e.z)})),f.opt&&f.toolsType&&n.vNodes&&(n.vNodes.setInfo(t,{rect:x,op:r,opt:f.opt,canRotate:f.canRotate,scaleType:f.scaleType,toolsType:f.toolsType}),u.set(t,{workId:t,op:r,opt:f.opt,toolsType:f.toolsType}))},k=0;k1&&this.isNear([t[0],t[1]],[this.tmpPoints[r-2],this.tmpPoints[r-1]]))return f({type:I.EPostMessageType.None},this.baseConsumeResult);4===r&&(this.tmpPoints.shift(),this.tmpPoints.shift()),this.tmpPoints.push(t[0],t[1]);var n,i=this.computRectCenterPoints(),o=new Set,s=new Map;if(!this.vNodes)return f({type:I.EPostMessageType.None},this.baseConsumeResult);this.vNodes.setTarget();for(var u=this.getUnLockNodeMap(this.vNodes.getLastTarget()),c=0;c0&&void 0!==arguments[0])||arguments[0],t=I.getRectFromPoints(this.tmpPoints);if(0===t.w||0===t.h)return{selectIds:[],intersectRect:void 0,subNodeMap:new Map};var r=this.vNodes.getRectIntersectRange(t,e),n=r.rectRange,i=r.nodeRange;return{selectIds:l(i.keys()),intersectRect:n,subNodeMap:i}}},{key:"updateTempPoints",value:function(e){var t=this.tmpPoints.length,r=e.length;if(r>1){var n=new I.Point2d(e[r-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[r-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);2===t?this.tmpPoints.splice(1,1,n):this.tmpPoints.push(n)}}},{key:"drawSelector",value:function(e){var t=this,r=e.drawRect,i=e.subNodeMap,o=e.selectorId,a=e.layer,s=e.isService,u=new C.Group({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:o,name:o,zIndex:9999}),l=[];if(s){var c=new C.Rect({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:n.selectorBorderId});l.push(c)}i.forEach((function(e,n){var o=[e.rect.x+e.rect.w/2-r.x,e.rect.y+e.rect.h/2-r.y],a=new C.Rect({normalize:!0,pos:o,lineWidth:1,strokeColor:i.size>1?t.selectorColor||t.workOptions.strokeColor:void 0,width:e.rect.w,height:e.rect.h,id:"selector-".concat(n),name:"selector-".concat(n)});l.push(a)})),l&&u.append.apply(u,l),(null==a?void 0:a.parent).appendChild(u)}},{key:"draw",value:function(e,t,r){var n,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=r.intersectRect,s=r.subNodeMap;null==(i=null==(n=t.parent)?void 0:n.getElementById(e))||i.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:s,selectorId:e,layer:t,isService:o})}},{key:"getSelecteorInfo",value:function(e){this.scaleType=I.EScaleType.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0;var t,r,n=new Set,i=a(e.values());try{for(i.s();!(r=i.n()).done;){var o=r.value,s=o.opt,u=o.canRotate,c=o.scaleType,h=o.toolsType;this.selectorColor=this.workOptions.strokeColor,s.strokeColor&&(this.strokeColor=s.strokeColor),s.fillColor&&(this.fillColor=s.fillColor),s.textOpt&&(this.textOpt=s.textOpt),h===I.EToolsKey.SpeechBalloon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=s.placement),h===I.EToolsKey.Polygon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices),h===I.EToolsKey.Star&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices,this.shapeOpt.innerRatio=s.innerRatio,this.shapeOpt.innerVerticeStep=s.innerVerticeStep),h===I.EToolsKey.Text&&(this.textOpt=s),1===e.size&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=u,this.scaleType=c),c===I.EScaleType.none&&(this.scaleType=c),h===I.EToolsKey.Image&&(t=o)}}catch(e){i.e(e)}finally{i.f()}n.size&&(this.toolsTypes=l(n)),t&&(1===e.size?(this.canLock=!0,t.opt.locked&&(this.isLocked=!0,this.scaleType=I.EScaleType.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1)):e.size>1&&!t.opt.locked&&(this.canLock=!1,this.canRotate=!1))}},{key:"getChildrenPoints",value:function(){var e,t;if(this.scaleType===I.EScaleType.both&&1===(null==(e=this.selectIds)?void 0:e.length)){var r=this.selectIds[0],n=null==(t=this.vNodes.get(r))?void 0:t.op;if(n){for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:I.Storage_Selector_key,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];2===e.length&&function(){var i,o,s=e[0],u=e[1],c=l(t.vNodes.getRectIntersectRange({x:s,y:u,w:0,h:0},!1).nodeRange.values()).sort((function(e,t){return(t.opt.zIndex||0)-(e.opt.zIndex||0)})),h=a(c);try{for(h.s();!(o=h.n()).done;){var d=o.value;if(oe(t.fullLayer.getElementsByName(d.name)).find((function(e){return e.isPointCollision(s,u)}))){i=d;break}}}catch(e){h.e(e)}finally{h.f()}if(i){var f=i.name;if(!I.isEqual(t.oldSelectRect,i.rect)){var p=new Map([[f,i]]);t.getSelecteorInfo(p),t.draw(r,t.fullLayer,{intersectRect:i.rect,subNodeMap:p,selectIds:t.selectIds||[]},n)}t.selectIds=[f],t.oldSelectRect=i.rect}}()}},{key:"unSelectedAllIds",value:function(){var e,t,r=a(this.vNodes.curNodeMap.entries());try{for(r.s();!(t=r.n()).done;){var n=o(t.value,2),i=n[0],s=n[1];s.isSelected&&(e=I.computRect(e,s.rect),this.vNodes.unSelected(i))}}catch(e){r.e(e)}finally{r.f()}return e}},{key:"unSelectedByIds",value:function(e){var t,r,n=a(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&o.isSelected&&(t=I.computRect(t,o.rect),this.vNodes.unSelected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"selectedByIds",value:function(e){var t,r,n=a(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&(t=I.computRect(t,o.rect),this.vNodes.selected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getSelectorRect",value:function(e,t){var r,n,i=null==(r=e.parent)?void 0:r.getElementById(t),o=null==i?void 0:i.getBoundingClientRect();return o&&(n=I.computRect(n,{x:Math.floor(o.x),y:Math.floor(o.y),w:Math.floor(o.width+1),h:Math.floor(o.height+1)})),n}},{key:"isCanFillColor",value:function(e){return e===I.EToolsKey.Ellipse||e===I.EToolsKey.Triangle||e===I.EToolsKey.Rectangle||e===I.EToolsKey.Polygon||e===I.EToolsKey.Star||e===I.EToolsKey.SpeechBalloon}},{key:"updateSelector",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,s,u,l,c,h,d,p,v,g,m,y,_,b,x,w,S,T,M,k,E,A,C,P,N,O,R,D,j,z,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,o=t.willSerializeData,s=t.worker,u=t.scene,l=t.isMainThread,c=t.offset,h=this.fullLayer){e.next=3;break}return e.abrupt("return");case 3:if(p=new Map,v=r.originPoint,g=r.workState,m=r.angle,y=r.translate,_=r.dir,b=r.scale,c&&(r.translate=y?[y[0]+c[0],y[1]+c[1]]:c),!(v||y||L(m))){e.next=9;break}if(g!==I.EvevtWorkState.Start||!n){e.next=8;break}return e.abrupt("return",(i.setTargetAssignKeys(n),{type:I.EPostMessageType.Select,dataType:I.EDataType.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:x=i.getLastTarget();case 9:if(!n){e.next=59;break}w=a(n),e.prev=11,w.s();case 13:if((S=w.n()).done){e.next=51;break}if(T=S.value,!(M=i.get(T))){e.next=49;break}if(k=M.toolsType,!(E=(null==h?void 0:h.getElementsByName(T))[0])){e.next=49;break}if(A=f({},r),!k){e.next=49;break}if(C=null==x?void 0:x.get(T),null==(P=ne(k))||P.updateNodeOpt({node:E,opt:A,vNodes:i,willSerializeData:o,targetNode:C}),!(M&&s&&(o&&(A.angle||A.translate)||A.originPoint&&A.scenePoint&&A.scale||A.pointMap&&A.pointMap.has(T)||k===I.EToolsKey.Text&&(A.fontSize||A.translate||A.textInfos&&A.textInfos.get(T))||k===I.EToolsKey.Image&&(A.angle||A.translate||A.scale)||k===A.toolsType&&A.willRefresh))){e.next=48;break}if(null==(N=s.createWorkShapeNode({workId:T,toolsType:k,toolsOpt:M.opt}))||N.setWorkId(T),O=void 0,k!==I.EToolsKey.Image||!u){e.next=34;break}return e.next=31,N.consumeServiceAsync({isFullWork:!0,replaceId:T,scene:u,isMainThread:l});case 31:O=e.sent,e.next=47;break;case 34:if(k!==I.EToolsKey.Text){e.next=40;break}return e.next=37,N.consumeServiceAsync({isFullWork:!0,replaceId:T});case 37:O=e.sent,e.next=47;break;case 40:e.prev=40,O=null==N?void 0:N.consumeService({op:M.op,isFullWork:!0,replaceId:T}),e.next=47;break;case 44:return e.prev=44,e.t0=e.catch(40),e.abrupt("continue",49);case 47:O&&(M.rect=O);case 48:M&&(p.set(T,M),d=I.computRect(d,M.rect));case 49:e.next=13;break;case 51:e.next=56;break;case 53:e.prev=53,e.t1=e.catch(11),w.e(e.t1);case 56:return e.prev=56,w.f(),e.finish(56);case 59:if(x&&g===I.EvevtWorkState.Done&&(i.deleteLastTarget(),x=void 0),R=d,!(v&&y&&b&&_&&R)||c){e.next=79;break}D=[[R.x,R.y],[R.x+R.w,R.y],[R.x+R.w,R.y+R.h],[R.x,R.y+R.h]],e.t2=_,e.next="top"===e.t2||"topLeft"===e.t2||"left"===e.t2?66:"topRight"===e.t2?68:"right"===e.t2||"bottomRight"===e.t2||"bottom"===e.t2?70:"bottomLeft"===e.t2?72:74;break;case 66:return j=y[0]>0&&y[1]>0?D[0]:y[0]>0?D[3]:y[1]>0?D[1]:D[2],e.abrupt("break",74);case 68:return j=y[0]<0&&y[1]>0?D[1]:y[0]<0?D[2]:y[1]>0?D[0]:D[3],e.abrupt("break",74);case 70:return j=y[0]<0&&y[1]<0?D[2]:y[0]<0?D[1]:y[1]<0?D[3]:D[0],e.abrupt("break",74);case 72:return j=y[0]>0&&y[1]<0?D[3]:y[0]>0?D[0]:y[1]<0?D[2]:D[1],e.abrupt("break",74);case 74:if(z=j&&[v[0]-j[0],v[1]-j[1]]||[0,0],I.isEqual(z,[0,0])){e.next=79;break}return e.next=78,this.updateSelector(f(f({},t),{},{updateSelectorOpt:{},offset:z}));case 78:return e.abrupt("return",e.sent);case 79:return this.getSelecteorInfo(p),this.draw(I.Storage_Selector_key,h,{selectIds:n||[],subNodeMap:p,intersectRect:R}),B=I.computRect(this.oldSelectRect,R),e.abrupt("return",(this.oldSelectRect=R,{type:I.EPostMessageType.Select,dataType:I.EDataType.Local,selectRect:R,renderRect:d,rect:I.computRect(B,R),selectIds:n}));case 82:case"end":return e.stop()}}),e,this,[[11,53,56,59],[40,44]])}))),function(e){return t.apply(this,arguments)})},{key:"blurSelector",value:function(){var e=this.unSelectedAllIds();return{type:I.EPostMessageType.Select,dataType:I.EDataType.Local,rect:e,selectIds:[],willSyncService:!0}}},{key:"getRightServiceId",value:function(e){return e.replace(I.Storage_Splitter,"-")}},{key:"selectServiceNode",value:function(e,t,r){var n,i=this,o=t.selectIds,a=this.getRightServiceId(e),s=this.getSelectorRect(this.fullLayer,a),u=new Map;return null==o||o.forEach((function(e){var t=i.vNodes.get(e);t&&(n=I.computRect(n,t.rect),u.set(e,t))})),this.getSelecteorInfo(u),this.draw(a,this.fullLayer,{intersectRect:n,selectIds:o||[],subNodeMap:u},r),I.computRect(n,s)}},{key:"reRenderSelector",value:function(){var e,t,r=this,n=new Map;return null==(e=this.selectIds)||e.forEach((function(e){var i=r.vNodes.get(e);i&&(t=I.computRect(t,i.rect),n.set(e,i))}),this),this.getSelecteorInfo(n),this.draw(I.Storage_Selector_key,this.fullLayer,{intersectRect:t,subNodeMap:n,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t}},{key:"updateSelectIds",value:function(e){var t,r,n=null==(t=this.selectIds)?void 0:t.filter((function(t){return!e.includes(t)}));if(null!=n&&n.length&&(r=this.unSelectedByIds(n)),e.length){var i=this.selectedByIds(e);r=I.computRect(r,i)}return this.selectIds=e,{bgRect:r,selectRect:this.reRenderSelector()}}},{key:"cursorHover",value:function(e){var t,r,n=this.oldSelectRect;this.selectIds=[];var i=null==(t=this.workId)?void 0:t.toString(),o=[e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];return this.selectSingleTool(o,i,!0),this.oldSelectRect&&!I.isEqual(n,this.oldSelectRect)?{type:I.EPostMessageType.CursorHover,dataType:I.EDataType.Local,rect:I.computRect(n,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1}:(null!=(r=this.selectIds)&&r.length||(this.oldSelectRect=void 0),n&&!this.oldSelectRect?(this.cursorBlur(),{type:I.EPostMessageType.CursorHover,dataType:I.EDataType.Local,rect:n,selectorColor:this.selectorColor,willSyncService:!1}):void 0)}},{key:"cursorBlur",value:function(){var e,t;this.selectIds=[];var r=null==(e=this.workId)?void 0:e.toString();(null==(t=this.fullLayer)?void 0:t.parent).children.forEach((function(e){e.name===r&&e.remove()}))}}]),n}(z);A(V,"selectorBorderId","selector-border");var H=V,Y=function(e){g(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),A(b(n),"canRotate",!1),A(b(n),"scaleType",I.EScaleType.both),A(b(n),"toolsType",I.EToolsKey.Arrow),A(b(n),"tmpPoints",[]),A(b(n),"workOptions"),A(b(n),"oldRect"),A(b(n),"arrowTipWidth"),A(b(n),"syncTimestamp"),n.workOptions=e.toolsOpt,n.arrowTipWidth=4*n.workOptions.thickness,n.syncTimestamp=0,n.syncUnitTime=50,n}return M(r,[{key:"consume",value:function(e){var t,r,n=e.data,i=e.isFullWork,o=e.isSubWorker,a=e.isMainThread,s=this.workId,u=n.op,c=null==u?void 0:u.length;if(!c||c<2)return{type:I.EPostMessageType.None};if(0===this.tmpPoints.length?(this.tmpPoints=[new I.Point2d(u[0],u[1])],t=!1):t=this.updateTempPoints(u),!t)return{type:I.EPostMessageType.None};if(o||a){var h=i?this.fullLayer:this.drawLayer||this.fullLayer;r=this.draw({workId:s,layer:h})}if(!o){var d=Date.now();return d-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=d,f(f({},this.baseConsumeResult),{},{type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0})):{type:I.EPostMessageType.None}}var p=I.computRect(r,this.oldRect);return this.oldRect=r,f(f({rect:p},this.baseConsumeResult),{},{type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local})}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:I.EPostMessageType.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),o=I.transformToSerializableData(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:z.getCenterPos(n,r)}),f(f({rect:n},this.baseConsumeResult),{},{type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:o,isSync:!0})}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=r.worldPosition,h=r.worldScaling,d=this.computDrawPoints(o),f=d.points,p=d.rect,v={pos:[p.x+p.w/2,p.y+p.h/2],name:t,id:t,close:!0,points:f,fillColor:i,strokeColor:i,lineWidth:0,normalize:!0,zIndex:a};s&&(v.scale=s),u&&(v.rotate=u),l&&(v.translate=l);var g=new C.Polyline(v);if(this.replace(r,t,g),s||u||l){var m=g.getBoundingClientRect();return{x:Math.floor(m.x-z.SafeBorderPadding),y:Math.floor(m.y-z.SafeBorderPadding),w:Math.floor(m.width+2*z.SafeBorderPadding),h:Math.floor(m.height+2*z.SafeBorderPadding)}}return{x:Math.floor(p.x*h[0]+c[0]-z.SafeBorderPadding),y:Math.floor(p.y*h[1]+c[1]-z.SafeBorderPadding),w:Math.floor(p.w*h[0]+2*z.SafeBorderPadding),h:Math.floor(p.h*h[1]+2*z.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(e):this.computTrianglePoints()}},{key:"computFullArrowPoints",value:function(e){var t=this,r=I.Vec2d.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=I.Vec2d.Per(r).mul(e/2),i=I.Point2d.Sub(this.tmpPoints[0],n),o=I.Point2d.Add(this.tmpPoints[0],n),a=I.Vec2d.Mul(r,this.arrowTipWidth),s=I.Vec2d.Sub(this.tmpPoints[1],a),u=I.Point2d.Sub(s,n),l=I.Point2d.Add(s,n),c=I.Vec2d.Per(r).mul(1.5*e),h=I.Point2d.Sub(s,c),d=I.Point2d.Add(s,c),f=[i,u,h,this.tmpPoints[1],d,l,o];return{points:f.map((function(e){return I.Point2d.Sub(e,t.tmpPoints[0]).XY})).flat(1),rect:I.getRectFromPoints(f),isTriangle:!1,pos:this.tmpPoints[0].XY}}},{key:"computTrianglePoints",value:function(){var e=this,t=I.Vec2d.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=I.Vec2d.Per(t).mul(Math.floor(3*r/8)),i=I.Point2d.Sub(this.tmpPoints[0],n),o=I.Point2d.Add(this.tmpPoints[0],n),a=[i,this.tmpPoints[1],o];return{points:a.map((function(t){return I.Point2d.Sub(t,e.tmpPoints[0]).XY})).flat(1),rect:I.getRectFromPoints(a),isTriangle:!0,pos:this.tmpPoints[0].XY}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new I.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=d,f(f({type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0})):{type:I.EPostMessageType.None}}var p=I.computRect(r,this.oldRect);return this.oldRect=r,f({rect:p,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:I.EPostMessageType.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),o=I.transformToSerializableData(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&z.getCenterPos(n,r)}),f(f({rect:n,type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local},this.baseConsumeResult),{},{ops:o,isSync:!0})}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.scale,c=i.rotate,h=i.translate,d=r.worldScaling,p=this.computDrawPoints(s),v=p.radius,g=p.rect,m=p.pos,y={pos:m,name:t,id:t,radius:v,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0},_={name:t,id:t,zIndex:u,pos:m,anchor:[.5,.5],size:[g.w,g.h]};l&&(_.scale=l),c&&(_.rotate=c),h&&(_.translate=h);var b=new C.Group(_);if(n){var x=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/d[0],1/d[1]]});b.append(x)}var w=new C.Ellipse(f(f({},y),{},{pos:[0,0]}));b.append(w),this.replace(r,t,b);var S=b.getBoundingClientRect();return{x:Math.floor(S.x-z.SafeBorderPadding),y:Math.floor(S.y-z.SafeBorderPadding),w:Math.floor(S.width+2*z.SafeBorderPadding),h:Math.floor(S.height+2*z.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){var t=I.getRectFromPoints(this.tmpPoints);return{rect:I.getRectFromPoints(this.tmpPoints,e),pos:[Math.floor(t.x+t.w/2),Math.floor(t.y+t.h/2)],radius:[Math.floor(t.w/2),Math.floor(t.h/2)]}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new I.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=d,f({type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,op:c.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:I.EPostMessageType.None}}var p=I.computRect(l,this.oldRect);return this.oldRect=l,f({rect:p,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:I.EPostMessageType.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,i=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var o=r.flat(1),a=I.transformToSerializableData(o);return null==(e=this.vNodes)||e.setInfo(t,{rect:i,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&z.getCenterPos(i,n)}),f({rect:i,type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:a,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=e.ps,o=e.replaceId,a=this.workOptions,s=a.strokeColor,u=a.fillColor,l=a.thickness,c=a.zIndex,h=a.scale,d=a.rotate,p=a.translate,v=(a.textOpt,r.worldPosition),g=r.worldScaling,m=this.computDrawPoints(i),y=m.points,_=m.rect,b=m.pos,x={close:!0,normalize:!0,points:y,lineWidth:l,fillColor:"transparent"!==u&&u||void 0,strokeColor:s,lineJoin:"round"},w={x:Math.floor(_.x*g[0]+v[0]-z.SafeBorderPadding),y:Math.floor(_.y*g[1]+v[1]-z.SafeBorderPadding),w:Math.floor(_.w*g[0]+2*z.SafeBorderPadding),h:Math.floor(_.h*g[0]+2*z.SafeBorderPadding)},S=new C.Group({name:t,id:t,zIndex:c,pos:b,anchor:[.5,.5],size:[_.w,_.h],scale:h,rotate:d,translate:p}),T=new C.Polyline(f(f({},x),{},{pos:[0,0]}));if(S.appendChild(T),n){var M=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/g[0],1/g[1]]});S.appendChild(M)}if(this.replace(r,o||t,S),h||d||p){var k=S.getBoundingClientRect();return{x:Math.floor(k.x-z.SafeBorderPadding),y:Math.floor(k.y-z.SafeBorderPadding),w:Math.floor(k.width+2*z.SafeBorderPadding),h:Math.floor(k.height+2*z.SafeBorderPadding)}}return w}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new I.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId,a=null==(t=this.workId)?void 0:t.toString();if(a){for(var s=[],u=0;uthis.syncUnitTime?(this.syncTimestamp=d,f({type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:I.EPostMessageType.None}}var p=I.computRect(r,this.oldRect);return this.oldRect=r,f({rect:p,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:I.EPostMessageType.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),o=I.transformToSerializableData(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&z.getCenterPos(n,r)}),f({rect:n,type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,c=i.innerVerticeStep,h=i.innerRatio,d=i.scale,p=i.rotate,v=i.translate,g=r.worldScaling,m=this.computDrawPoints(s,l,c,h),y=m.rect,_=m.pos,b={close:!0,points:m.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round"},x={name:t,id:t,zIndex:u,pos:_,anchor:[.5,.5],size:[y.w,y.h],className:"".concat(_[0],",").concat(_[1])};d&&(x.scale=d),p&&(x.rotate=p),v&&(x.translate=v);var w=new C.Group(x);if(n){var S=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/g[0],1/g[1]]});w.append(S)}var T=new C.Polyline(f(f({},b),{},{pos:[0,0]}));w.append(T),this.replace(r,t,w);var M=w.getBoundingClientRect();return{x:Math.floor(M.x-z.SafeBorderPadding),y:Math.floor(M.y-z.SafeBorderPadding),w:Math.floor(M.width+2*z.SafeBorderPadding),h:Math.floor(M.height+2*z.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t,r,n){for(var i=I.getRectFromPoints(this.tmpPoints),o=[Math.floor(i.x+i.w/2),Math.floor(i.y+i.h/2)],a=I.getWHRatio(i.w,i.h),s=Math.floor(Math.min(i.w,i.h)/2),u=n*s,l=[],c=2*Math.PI/t,h=0;hthis.syncUnitTime?(this.syncTimestamp=d,f({type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:I.EPostMessageType.None}}var p=I.computRect(r,this.oldRect);return this.oldRect=r,f({rect:p,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:I.EPostMessageType.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),o=I.transformToSerializableData(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&z.getCenterPos(n,r)}),f({rect:n,type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,c=i.scale,h=i.rotate,d=i.translate,p=r.worldScaling,v=this.computDrawPoints(s,l),g=v.rect,m=v.pos,y={close:!0,points:v.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round"},_={name:t,id:t,zIndex:u,pos:m,anchor:[.5,.5],size:[g.w,g.h]};c&&(_.scale=c),h&&(_.rotate=h),d&&(_.translate=d);var b=new C.Group(_);if(n){var x=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/p[0],1/p[1]]});b.append(x)}var w=new C.Polyline(f(f({},y),{},{pos:[0,0]}));b.append(w),this.replace(r,t,b);var S=b.getBoundingClientRect();return{x:Math.floor(S.x-z.SafeBorderPadding),y:Math.floor(S.y-z.SafeBorderPadding),w:Math.floor(S.width+2*z.SafeBorderPadding),h:Math.floor(S.height+2*z.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t){for(var r=I.getRectFromPoints(this.tmpPoints),n=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)],i=I.getWHRatio(r.w,r.h),o=Math.floor(Math.min(r.w,r.h)/2),a=[],s=2*Math.PI/t,u=0;u0&&void 0!==arguments[0]?arguments[0]:10,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=null,s=[];i||o?i&&!o?a=e.twoBezier:i&&o&&(a=e.threeBezier):a=e.oneBezier;for(var u=0;uthis.syncUnitTime?(this.syncTimestamp=p,f({type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:I.EPostMessageType.None}}var v=I.computRect(u,this.oldRect);return this.oldRect=u,f({rect:v,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:I.EPostMessageType.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),o=I.transformToSerializableData(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&z.getCenterPos(n,r)}),f({rect:n,type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.fillColor,a=n.thickness,s=n.zIndex,u=n.placement,l=n.scale,c=n.rotate,h=n.translate,d=this.computDrawPoints(a,u),p=d.rect,v=d.pos,g={points:d.points.map((function(e){return e.XY})),lineWidth:a,fillColor:"transparent"!==o&&o||void 0,strokeColor:i,normalize:!0,className:"".concat(v[0],",").concat(v[1]),lineJoin:"round",close:!0},m={name:t,id:t,zIndex:s,pos:v,anchor:[.5,.5],size:[p.w,p.h]};l&&(m.scale=l),c&&(m.rotate=c),h&&(m.translate=h);var y=new C.Group(m),_=new C.Polyline(f(f({},g),{},{pos:[0,0]}));y.append(_),this.replace(r,t,y);var b=y.getBoundingClientRect();return{x:Math.floor(b.x-z.SafeBorderPadding),y:Math.floor(b.y-z.SafeBorderPadding),w:Math.floor(b.width+2*z.SafeBorderPadding),h:Math.floor(b.height+2*z.SafeBorderPadding)}}},{key:"transformControlPoints",value:function(e){var t=I.getRectFromPoints(this.tmpPoints);switch(e){case"bottom":case"bottomLeft":case"bottomRight":var r=t.y+t.h*this.ratio;return[new I.Vec2d(t.x,t.y,0),new I.Vec2d(t.x+t.w,t.y,0),new I.Vec2d(t.x+t.w,r,0),new I.Vec2d(t.x,r,0)];case"top":case"topLeft":case"topRight":var n=t.y+t.h*(1-this.ratio);return[new I.Vec2d(t.x,n,0),new I.Vec2d(t.x+t.w,n,0),new I.Vec2d(t.x+t.w,t.y+t.h,0),new I.Vec2d(t.x,t.y+t.h,0)];case"left":case"leftBottom":case"leftTop":var i=t.x+t.w*(1-this.ratio);return[new I.Vec2d(i,t.y,0),new I.Vec2d(t.x+t.w,t.y,0),new I.Vec2d(t.x+t.w,t.y+t.h,0),new I.Vec2d(i,t.y+t.h,0)];case"right":case"rightBottom":case"rightTop":var o=t.x+t.w*this.ratio;return[new I.Vec2d(t.x,t.y,0),new I.Vec2d(o,t.y,0),new I.Vec2d(o,t.y+t.h,0),new I.Vec2d(t.x,t.y+t.h,0)]}}},{key:"computDrawPoints",value:function(e,t){var r=I.getRectFromPoints(this.tmpPoints),n=this.transformControlPoints(t),i=Math.floor(.1*r.w),o=Math.floor(.1*r.h),a=[],s=I.Vec2d.Add(n[0],new I.Vec2d(0,o,0)),u=I.Vec2d.Add(n[0],new I.Vec2d(i,0,0)),c=Z.getBezierPoints(10,s,n[0],u),h=I.Vec2d.Sub(n[1],new I.Vec2d(i,0,0)),d=I.Vec2d.Add(n[1],new I.Vec2d(0,o,0)),f=Z.getBezierPoints(10,h,n[1],d),p=I.Vec2d.Sub(n[2],new I.Vec2d(0,o,0)),v=I.Vec2d.Sub(n[2],new I.Vec2d(i,0,0)),g=Z.getBezierPoints(10,p,n[2],v),m=I.Vec2d.Add(n[3],new I.Vec2d(i,0,0)),y=I.Vec2d.Sub(n[3],new I.Vec2d(0,o,0)),_=Z.getBezierPoints(10,m,n[3],y),b=i*(1-this.ratio)*10,x=o*(1-this.ratio)*10;switch(t){case"bottom":var w=I.Vec2d.Sub(n[2],new I.Vec2d(5*i-b/2,0,0)),S=I.Vec2d.Sub(n[2],new I.Vec2d(5*i,-x,0)),T=I.Vec2d.Sub(n[2],new I.Vec2d(5*i+b/2,0,0));a.push.apply(a,[S,T].concat(l(_),l(c),l(f),l(g),[w]));break;case"bottomRight":var M=I.Vec2d.Sub(n[2],new I.Vec2d(1.1*i,0,0)),k=I.Vec2d.Sub(n[2],new I.Vec2d(1.1*i+b/2,-x,0)),E=I.Vec2d.Sub(n[2],new I.Vec2d(1.1*i+b,0,0));a.push.apply(a,[k,E].concat(l(_),l(c),l(f),l(g),[M]));break;case"bottomLeft":var A=I.Vec2d.Add(n[3],new I.Vec2d(1.1*i+b,0,0)),C=I.Vec2d.Add(n[3],new I.Vec2d(1.1*i+b/2,x,0)),P=I.Vec2d.Add(n[3],new I.Vec2d(1.1*i,0,0));a.push.apply(a,[C,P].concat(l(_),l(c),l(f),l(g),[A]));break;case"top":var N=I.Vec2d.Sub(n[1],new I.Vec2d(5*i-b/2,0,0)),O=I.Vec2d.Sub(n[1],new I.Vec2d(5*i,x,0)),R=I.Vec2d.Sub(n[1],new I.Vec2d(5*i+b/2,0,0));a.push.apply(a,[O,N].concat(l(f),l(g),l(_),l(c),[R]));break;case"topRight":var D=I.Vec2d.Sub(n[1],new I.Vec2d(1.1*i,0,0)),L=I.Vec2d.Sub(n[1],new I.Vec2d(1.1*i+b/2,x,0)),j=I.Vec2d.Sub(n[1],new I.Vec2d(1.1*i+b,0,0));a.push.apply(a,[L,D].concat(l(f),l(g),l(_),l(c),[j]));break;case"topLeft":var z=I.Vec2d.Add(n[0],new I.Vec2d(1.1*i+b,0,0)),B=I.Vec2d.Add(n[0],new I.Vec2d(1.1*i+b/2,-x,0)),F=I.Vec2d.Add(n[0],new I.Vec2d(1.1*i,0,0));a.push.apply(a,[B,z].concat(l(f),l(g),l(_),l(c),[F]));break;case"left":var U=I.Vec2d.Add(n[0],new I.Vec2d(0,5*o-x/2,0)),W=I.Vec2d.Add(n[0],new I.Vec2d(-b,5*o,0)),G=I.Vec2d.Add(n[0],new I.Vec2d(0,5*o+x/2,0));a.push.apply(a,[W,U].concat(l(c),l(f),l(g),l(_),[G]));break;case"leftTop":var V=I.Vec2d.Add(n[0],new I.Vec2d(0,1.1*o,0)),H=I.Vec2d.Add(n[0],new I.Vec2d(-b,1.1*o+x/2,0)),Y=I.Vec2d.Add(n[0],new I.Vec2d(0,1.1*o+x,0));a.push.apply(a,[H,V].concat(l(c),l(f),l(g),l(_),[Y]));break;case"leftBottom":var $=I.Vec2d.Sub(n[3],new I.Vec2d(0,1.1*o+x,0)),X=I.Vec2d.Sub(n[3],new I.Vec2d(b,1.1*o+x/2,0)),q=I.Vec2d.Sub(n[3],new I.Vec2d(0,1.1*o,0));a.push.apply(a,[X,$].concat(l(c),l(f),l(g),l(_),[q]));break;case"right":var Q=I.Vec2d.Add(n[1],new I.Vec2d(0,5*o-x/2,0)),K=I.Vec2d.Add(n[1],new I.Vec2d(b,5*o,0)),J=I.Vec2d.Add(n[1],new I.Vec2d(0,5*o+x/2,0));a.push.apply(a,[K,J].concat(l(g),l(_),l(c),l(f),[Q]));break;case"rightTop":var ee=I.Vec2d.Add(n[1],new I.Vec2d(0,1.1*o,0)),te=I.Vec2d.Add(n[1],new I.Vec2d(b,1.1*o+x/2,0)),re=I.Vec2d.Add(n[1],new I.Vec2d(0,1.1*o+x,0));a.push.apply(a,[te,re].concat(l(g),l(_),l(c),l(f),[ee]));break;case"rightBottom":var ne=I.Vec2d.Sub(n[2],new I.Vec2d(0,1.1*o+x,0)),ie=I.Vec2d.Sub(n[2],new I.Vec2d(-b,1.1*o+x/2,0)),oe=I.Vec2d.Sub(n[2],new I.Vec2d(0,1.1*o,0));a.push.apply(a,[ie,oe].concat(l(g),l(_),l(c),l(f),[ne]))}var ae=I.getRectFromPoints(this.tmpPoints,e);return{rect:ae,pos:[Math.floor(ae.x+ae.w/2),Math.floor(ae.y+ae.h/2)],points:a}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new I.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i)||I.Point2d.Sub(n,r).XY.includes(0))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a0?I.EScaleType.proportional:I.EScaleType.all}},{key:"updateNodeOpt",value:function(e){var t=e.node,r=e.opt,i=e.vNodes,o=e.targetNode,a=r.translate,s=r.originPoint,u=r.scenePoint,l=r.scale,c=r.angle,h=r.isLocked,d=r.zIndex,f=o&&I.cloneDeep(o)||i.get(t.name);if(f){var p=t.parent;if(p){if(L(d)&&(t.setAttribute("zIndex",d),f.opt.zIndex=d),I.isBoolean(h)&&(f.opt.locked=h),s&&u&&l){var v=f.opt,g=v.centerX,m=v.centerY,y=v.width,_=v.height,b=!1!==v.uniformScale?[l[0],l[0]]:l,x=[g,m],w=[g,m];I.scalePoints(w,u,b,a);var S=[w[0]-x[0],w[1]-x[1]];f.centerPos=[f.centerPos[0]+S[0],f.centerPos[1]+S[1]],f.opt.width=Math.round(y*b[0]),f.opt.height=Math.round(_*b[1]),f.opt.centerX=w[0],f.opt.centerY=w[1]}else if(a)f.opt.centerX=f.opt.centerX+a[0],f.opt.centerY=f.opt.centerY+a[1],f.centerPos=[f.centerPos[0]+a[0],f.centerPos[1]+a[1]];else if(L(c))if(f.opt.rotate=c,f.scaleType=n.getScaleType(f.opt),o){var T=I.getRectRotated(f.rect,c);f.rect=T}else{var M=z.getRectFromLayer(p,t.name);f.rect=M||f.rect}return f&&i.setInfo(t.name,f),null==f?void 0:f.rect}}}}]),n}(z),ee=function(e){g(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),A(b(n),"canRotate",!1),A(b(n),"scaleType",I.EScaleType.both),A(b(n),"toolsType",I.EToolsKey.Straight),A(b(n),"tmpPoints",[]),A(b(n),"workOptions"),A(b(n),"oldRect"),A(b(n),"straightTipWidth"),A(b(n),"syncTimestamp"),n.workOptions=e.toolsOpt,n.straightTipWidth=n.workOptions.thickness/2,n.syncTimestamp=0,n.syncUnitTime=50,n}return M(r,[{key:"consume",value:function(e){var t,r,n=e.data,i=e.isFullWork,o=e.isSubWorker,a=e.isMainThread,s=this.workId,u=n.op,c=null==u?void 0:u.length;if(!c||c<2)return{type:I.EPostMessageType.None};if(0===this.tmpPoints.length?(this.tmpPoints=[new I.Point2d(u[0],u[1])],t=!1):t=this.updateTempPoints(u),!t)return{type:I.EPostMessageType.None};if(o||a){var h=i?this.fullLayer:this.drawLayer||this.fullLayer;r=this.draw({workId:s,layer:h})}if(!o){var d=Date.now();return d-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=d,f({type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local,op:this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:I.EPostMessageType.None}}var p=I.computRect(r,this.oldRect);return this.oldRect=r,f({rect:p,type:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:I.EPostMessageType.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(l(e.XY),[0])})).flat(1),o=I.transformToSerializableData(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&z.getCenterPos(n,r)}),f({rect:n,type:I.EPostMessageType.FullWork,dataType:I.EDataType.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=r.worldPosition,h=r.worldScaling,d=this.computDrawPoints(o),f=d.d,p=d.rect,v=[p.x+p.w/2,p.y+p.h/2],g={pos:v,name:t,id:t,d:f,fillColor:i,strokeColor:i,lineWidth:0,className:"".concat(v[0],",").concat(v[1]),normalize:!0,zIndex:a};s&&(g.scale=s),u&&(g.rotate=u),l&&(g.translate=l);var m=new C.Path(g);if(this.replace(r,t,m),u||s||l){var y=m.getBoundingClientRect();return{x:Math.floor(y.x-z.SafeBorderPadding),y:Math.floor(y.y-z.SafeBorderPadding),w:Math.floor(y.width+2*z.SafeBorderPadding),h:Math.floor(y.height+2*z.SafeBorderPadding)}}return{x:Math.floor(p.x*h[0]+c[0]-z.SafeBorderPadding),y:Math.floor(p.y*h[1]+c[1]-z.SafeBorderPadding),w:Math.floor(p.w*h[0]+2*z.SafeBorderPadding),h:Math.floor(p.h*h[1]+2*z.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(e):this.computDotPoints(e)}},{key:"computFullPoints",value:function(e){var t=I.Vec2d.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=I.Vec2d.Per(t).mul(e/2),n=I.Point2d.Sub(this.tmpPoints[0],r),i=I.Point2d.Add(this.tmpPoints[0],r),o=I.Point2d.Sub(this.tmpPoints[1],r),a=I.Point2d.Add(this.tmpPoints[1],r),s=I.Point2d.GetSemicircleStroke(this.tmpPoints[1],o,-1,8),u=I.Point2d.GetSemicircleStroke(this.tmpPoints[0],i,-1,8),c=[n,o].concat(l(s),[a,i],l(u));return{d:B(c,!0),rect:I.getRectFromPoints(c),isDot:!1,pos:this.tmpPoints[0].XY}}},{key:"computDotPoints",value:function(e){var t=I.Point2d.GetDotStroke(this.tmpPoints[0],e/2,8);return{d:B(t,!0),rect:I.getRectFromPoints(t),isDot:!0,pos:this.tmpPoints[0].XY}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new I.Point2d(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a"u"&&this.workOptions.workState===I.EvevtWorkState.Done||l});case 8:return h=e.sent,e.abrupt("return",(null==(o=this.vNodes)||o.setInfo(a,{rect:h,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:h&&z.getCenterPos(h,c)}),h));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updataOptService",value:function(){}},{key:"updataOptServiceAsync",value:(r=u(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.workId){e.next=2;break}return e.abrupt("return");case 2:if(o=this.workId.toString(),a=t.fontColor,s=t.fontBgColor,u=t.bold,l=t.italic,c=t.lineThrough,h=t.underline,d=t.zIndex,f=null==(n=this.vNodes)?void 0:n.get(o)){e.next=5;break}return e.abrupt("return");case 5:return a&&(f.opt.fontColor=a),s&&(f.opt.fontBgColor=s),u&&(f.opt.bold=u),l&&(f.opt.italic=l),I.isBoolean(c)&&(f.opt.lineThrough=c),I.isBoolean(h)&&(f.opt.underline=h),L(d)&&(f.opt.zIndex=d),this.oldRect=f.rect,e.next=8,this.draw({workId:o,layer:this.fullLayer,isDrawLabel:k(r)>"u"&&this.workOptions.workState===I.EvevtWorkState.Done||r});case 8:return p=e.sent,e.abrupt("return",(null==(i=this.vNodes)||i.setInfo(o,{rect:p,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:p&&z.getCenterPos(p,this.fullLayer)}),p));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0}}],[{key:"getSafetySnippetRatio",value:function(e){var t=(null==e?void 0:e.parent).displayRatio||1,r=Math.ceil(10*e.worldScaling[0])/10,n=r;return r>=.2&&r<1?n=r*t:r<=2&&r>=1?n=r*t*1.6:r>2&&r<=3?n=r*t*1.4:r>3&&r<=4?n=r*t*.8:r>4&&(n=r*t*.6),Math.floor(1e3*n)/1e3}},{key:"getSafetySnippetFontLength",value:function(e){return Math.floor(3*a.textImageSnippetSize/4/e)||1}},{key:"createLabels",value:(t=u(regeneratorRuntime.mark((function e(t,r,n){var i,o,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M,k,E,A,P,N,O,R,D,L,j,z,B,F,U,W,G,V,H,Y,$,X,q,Q,Z,K,J,ee,te,re,ne,ie;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],s=n.x,u=n.y,l=null==(i=r.parent)?void 0:i.parent,c=l.width,h=l.height,d=I.transformToNormalData(t.text),f=d.length,p=t.fontSize,v=t.lineHeight,g=t.bold,m=t.textAlign,y=t.italic,_=t.fontFamily,b=t.verticalAlign,x=t.fontColor,w=t.fontBgColor,S=t.underline,T=t.lineThrough,M=a.getSafetySnippetRatio(r)||1,k=Math.floor(p*M),E=a.getSafetySnippetFontLength(k),A=0,P=0;case 3:if(!(P=c||(j[1]+D[1]+Q)*r.worldScaling[1]+u<=0||(j[1]+D[1])*r.worldScaling[1]+u>=h)&&(V.disconnect(),Y=!1),Y&&F.push(V))),U+=E;case 25:e.next=14;break;case 27:L[0]=B,"italic"===y&&(L[0]=L[0]+z*p),A=Math.max(A,L[0]),Z=!0,((D[0]+L[0])*r.worldScaling[0]+s<=0||D[0]*r.worldScaling[0]+s>=c||(D[1]+L[1])*r.worldScaling[0]+u<=0||D[1]*r.worldScaling[1]+u>=h)&&(Z=!1),Z&&(S&&(K=Math.floor(p/10),J={normalize:!1,pos:[0,1.1*p+K/2],lineWidth:K,points:[0,0,Math.ceil(L[0]),0],strokeColor:x,className:"underline"},ee=new C.Polyline(J),F.push(ee)),T&&(te={normalize:!1,pos:[0,1.2*p/2],lineWidth:Math.floor(p/10),points:[0,0,Math.ceil(L[0]),0],strokeColor:x,className:"lineThrough"},re=new C.Polyline(te),F.push(re)),ne={pos:D,anchor:[0,0],size:L,bgcolor:w},(ie=new C.Group(ne)).append.apply(ie,F),o.push(ie));case 30:P++,e.next=3;break;case 33:return e.abrupt("return",{labels:o,maxWidth:A});case 34:case"end":return e.stop()}}),e)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"updateNodeOpt",value:function(e){var t=e.node,r=e.opt,n=e.vNodes,i=e.targetNode,o=r.fontBgColor,a=r.fontColor,s=r.translate,u=r.originPoint,l=r.scenePoint,c=r.scale,h=r.bold,d=r.italic,f=r.lineThrough,p=r.underline,v=r.fontSize,g=r.textInfos,m=r.zIndex,y=i&&I.cloneDeep(i)||n.get(t.name);if(y&&t.parent){var _=y.opt;if(L(m)&&(t.setAttribute("zIndex",m),y.opt.zIndex=m),a&&_.fontColor&&(_.fontColor=a,t.children.forEach((function(e){"GROUP"===e.tagName&&e.children.forEach((function(e){"LABEL"===e.tagName?(e.setAttribute("fillColor",a),e.setAttribute("strokeColor",a)):"POLYLINE"===e.tagName&&e.setAttribute("strokeColor",a)}))}))),o&&_.fontBgColor&&(_.fontBgColor=o,t.children.forEach((function(e){"GROUP"===e.tagName&&e.setAttribute("bgcolor",o)}))),h&&(_.bold=h),d&&(_.italic=d),I.isBoolean(f)&&(_.lineThrough=f),I.isBoolean(p)&&(_.underline=p),v&&(_.fontSize=v),u&&l&&c&&i&&_.boxPoint){var b=null==g?void 0:g.get(t.name);if(b){var x=b.fontSize,w=b.boxSize;_.boxSize=w||_.boxSize,_.fontSize=x||_.fontSize}var S=[_.boxPoint[0],_.boxPoint[1]];I.scalePoints(_.boxPoint,l,c,s);var T=[y.op[0],y.op[1]],M=[T[0]-S[0],T[1]-S[1]];y.centerPos=[y.centerPos[0]+M[0],y.centerPos[1]+M[1]]}else s&&_.boxPoint&&(_.boxPoint=[_.boxPoint[0]+s[0],_.boxPoint[1]+s[1]],y.centerPos=[y.centerPos[0]+s[0],y.centerPos[1]+s[1]]);return y&&n.setInfo(t.name,y),null==y?void 0:y.rect}}},{key:"getRectFromLayer",value:function(e,t){var r=e.getElementsByName(t)[0];if(r){var n=r.getBoundingClientRect(),i={x:Math.floor(n.x-a.SafeBorderPadding*e.worldScaling[0]),y:Math.floor(n.y-a.SafeBorderPadding*e.worldScaling[1]),w:Math.floor(n.width+a.SafeBorderPadding*e.worldScaling[0]*2),h:Math.floor(n.height+a.SafeBorderPadding*e.worldScaling[1]*2)};return r.children.forEach((function(t){if("GROUP"===t.tagName){var n=r.getBoundingClientRect();i=I.computRect(i,{x:Math.floor(n.x-a.SafeBorderPadding*e.worldScaling[0]),y:Math.floor(n.y-a.SafeBorderPadding*e.worldScaling[1]),w:Math.floor(n.width+a.SafeBorderPadding*e.worldScaling[0]*2),h:Math.floor(n.height+a.SafeBorderPadding*e.worldScaling[1]*2)})}})),i}}}]),a}(z);A(te,"textImageSnippetSize",4096),A(te,"SafeBorderPadding",30);var re=te;function ne(e){switch(e){case I.EToolsKey.Arrow:return Y;case I.EToolsKey.Pencil:return F;case I.EToolsKey.Straight:return ee;case I.EToolsKey.Ellipse:return $;case I.EToolsKey.Polygon:case I.EToolsKey.Triangle:return Q;case I.EToolsKey.Star:case I.EToolsKey.Rhombus:return q;case I.EToolsKey.Rectangle:return X;case I.EToolsKey.SpeechBalloon:return K;case I.EToolsKey.Text:return re;case I.EToolsKey.LaserPen:return U;case I.EToolsKey.Eraser:return G;case I.EToolsKey.Selector:return H;case I.EToolsKey.Image:return J}}function ie(e,t){var r=e.toolsType,i=n(e,["toolsType"]);switch(r){case I.EToolsKey.Arrow:return new Y(i);case I.EToolsKey.Pencil:return new F(i);case I.EToolsKey.Straight:return new ee(i);case I.EToolsKey.Ellipse:return new $(i);case I.EToolsKey.Polygon:case I.EToolsKey.Triangle:return new Q(i);case I.EToolsKey.Star:case I.EToolsKey.Rhombus:return new q(i);case I.EToolsKey.Rectangle:return new X(i);case I.EToolsKey.SpeechBalloon:return new K(i);case I.EToolsKey.Text:return new re(i);case I.EToolsKey.LaserPen:return new U(i);case I.EToolsKey.Eraser:return new G(i,t);case I.EToolsKey.Selector:return i.vNodes?new H(f(f({},i),{},{vNodes:i.vNodes,drawLayer:i.fullLayer})):void 0;case I.EToolsKey.Image:return new J(i);default:return}}function oe(e){var t,r=[],n=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"],i=a(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;if("GROUP"===o.tagName&&o.children.length)return oe(o.children);o.tagName&&n.includes(o.tagName)&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r}var ae=function(e){if("GROUP"===e.tagName){var t=Object.getOwnPropertySymbols(e).find((function(e){return"Symbol(sealed)"===e.toString()}));if(t&&e[t])return!0}return!1},se=function(){function e(t,r){S(this,e),A(this,"viewId"),A(this,"scene"),A(this,"fullLayer"),A(this,"curNodeMap",new Map),A(this,"targetNodeMap",[]),A(this,"highLevelIds"),this.viewId=t,this.scene=r}return M(e,[{key:"init",value:function(e){this.fullLayer=e}},{key:"get",value:function(e){return this.curNodeMap.get(e)}},{key:"getNodesByType",value:function(e){var t=new Map;return this.curNodeMap.forEach((function(r,n){r.toolsType===e&&t.set(n,r)})),t}},{key:"hasRenderNodes",value:function(){var e,t=!1,r=a(this.curNodeMap.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;!n.isHid&&(t=!0)}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"has",value:function(e){return this.curNodeMap.has(e)}},{key:"setInfo",value:function(e,t){var r=this.curNodeMap.get(e)||{name:e,rect:t.rect};t.rect&&(r.rect=I.cloneDeep(t.rect)),t.op&&I.checkOp(t.op)&&(r.op=I.cloneDeep(t.op)),t.canRotate&&(r.canRotate=t.canRotate),t.scaleType&&(r.scaleType=t.scaleType),t.opt&&(r.opt=I.cloneDeep(t.opt)),t.toolsType&&(r.toolsType=t.toolsType),t.centerPos&&(r.centerPos=I.cloneDeep(t.centerPos)),I.isBoolean(t.isSelected)&&(r.isSelected=t.isSelected),r.rect?this.curNodeMap.set(e,r):this.curNodeMap.delete(e)}},{key:"selected",value:function(e){this.setInfo(e,{isSelected:!0})}},{key:"unSelected",value:function(e){this.setInfo(e,{isSelected:!1})}},{key:"delete",value:function(e){this.curNodeMap.delete(e)}},{key:"clear",value:function(){this.curNodeMap.clear(),this.targetNodeMap.length=0}},{key:"hasRectIntersectRange",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a(this.curNodeMap.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(I.isIntersect(e,i.rect)){if(r&&i.toolsType===I.EToolsKey.Image&&i.opt.locked||r&&i.toolsType===I.EToolsKey.Text&&(i.opt.workState===I.EvevtWorkState.Doing||i.opt.workState===I.EvevtWorkState.Start))continue;return!0}}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"getRectIntersectRange",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=new Map,u=a(this.curNodeMap.entries());try{for(u.s();!(r=u.n()).done;){var l=o(r.value,2),c=l[0],h=l[1];if(I.isIntersect(e,h.rect)){if(n&&h.toolsType===I.EToolsKey.Image&&h.opt.locked||i&&h.toolsType===I.EToolsKey.Text&&(h.opt.workState===I.EvevtWorkState.Doing||h.opt.workState===I.EvevtWorkState.Start))continue;t=I.computRect(t,h.rect),s.set(c,h)}}}catch(e){u.e(e)}finally{u.f()}return{rectRange:t,nodeRange:s}}},{key:"getNodeRectFormShape",value:function(e,t){var r=ne(t.toolsType);return this.fullLayer&&(null==r?void 0:r.getRectFromLayer(this.fullLayer,e))}},{key:"updateNodeRect",value:function(e){var t=this.curNodeMap.get(e);if(t){var r=this.getNodeRectFormShape(e,t);if(!r)return void this.curNodeMap.delete(e);t.rect=r,this.curNodeMap.set(e,t)}}},{key:"updateHighLevelNodesRect",value:function(e){this.highLevelIds=e;var t,r=a(this.highLevelIds.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;this.updateNodeRect(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"updateLowLevelNodesRect",value:function(){var e,t,r=a(this.curNodeMap.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;null!=(e=this.highLevelIds)&&e.has(n)||this.updateNodeRect(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"clearHighLevelIds",value:function(){this.highLevelIds=void 0}},{key:"combineIntersectRect",value:function(e){var t=e;return this.curNodeMap.forEach((function(e){I.isIntersect(t,e.rect)&&(t=I.computRect(t,e.rect))})),t}},{key:"setTargetAssignKeys",value:function(e){var t,r=new Map,n=a(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.curNodeMap.get(i);o&&r.set(i,I.cloneDeep(o))}}catch(e){n.e(e)}finally{n.f()}return this.targetNodeMap.push(I.cloneDeep(r)),this.targetNodeMap.length-1}},{key:"setTarget",value:function(){return this.targetNodeMap.push(I.cloneDeep(this.curNodeMap)),this.targetNodeMap.length-1}},{key:"getLastTarget",value:function(){return this.targetNodeMap[this.targetNodeMap.length-1]}},{key:"deleteLastTarget",value:function(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1)}},{key:"getTarget",value:function(e){return this.targetNodeMap[e]}},{key:"deleteTarget",value:function(e){this.targetNodeMap.length=e}},{key:"clearTarget",value:function(){this.targetNodeMap.length=0}}]),e}(),ue=function(){function e(t){S(this,e),A(this,"vNodes"),A(this,"thread"),A(this,"serviceWorkShapes",new Map),A(this,"localWorkShapes",new Map),A(this,"tmpOpt"),A(this,"animationId"),A(this,"syncUnitTime",I.DefaultAppliancePluginOptions.syncOpt.interval),this.vNodes=t.vNodes,this.thread=t.thread}return M(e,[{key:"createLocalWork",value:function(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r){var i=t.toString();!this.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:r}),this.setWorkOptions(i,r)}}},{key:"getLocalWorkShape",value:function(e){return this.localWorkShapes.get(e)}},{key:"createLocalWorkShape",value:function(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(f(f({},r),{},{workId:e}));return n&&this.localWorkShapes.set(e,{node:n,toolsType:n.toolsType,workState:I.EvevtWorkState.Start}),n}}},{key:"canUseTopLayer",value:function(e){return e===I.EToolsKey.LaserPen}},{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.topLayer.children.length&&(this.thread.topLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.serviceWorkShapes.clear(),this.localWorkShapes.clear()}},{key:"consumeDraw",value:function(e){var t=e.workId;if(e.dataType===I.EDataType.Service)this.activeServiceWorkShape(e);else{var r=null==t?void 0:t.toString(),n=r&&this.localWorkShapes.get(r);if(!n)return;var i=n.node.consume({data:e,isFullWork:!1,isSubWorker:!0});i.rect&&(n.result=i,n.workState=I.EvevtWorkState.Doing,r&&this.localWorkShapes.set(r,n))}this.runAnimation()}},{key:"setToolsOpt",value:function(e){var t;this.tmpOpt=e,null!=(t=e.toolsOpt)&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime)}},{key:"getToolsOpt",value:function(){return this.tmpOpt}},{key:"createWorkShapeNode",value:function(e){if(e.toolsType===I.EToolsKey.LaserPen)return ie(f(f({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.topLayer,drawLayer:this.thread.topLayer}))}},{key:"setNodeKey",value:function(e,t,r,n){return t.toolsType=r,t.node=this.createWorkShapeNode({workId:e,toolsType:r,toolsOpt:n}),t}},{key:"activeServiceWorkShape",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.toolsType,a=e.type,s=e.updateNodeOpt,u=e.ops,l=e.op;if(n){var c=n.toString(),h=null==(t=this.vNodes.get(c))?void 0:t.rect;if(null==(r=this.serviceWorkShapes)||!r.has(c)){var d={toolsType:o,animationWorkData:l||[],animationIndex:0,type:a,updateNodeOpt:s,ops:u,oldRect:h};o&&i&&(d=this.setNodeKey(c,d,o,i)),this.serviceWorkShapes.set(c,d)}var f=this.serviceWorkShapes.get(c);a&&(f.type=a),u&&(f.animationWorkData=I.transformToNormalData(u),f.ops=u),s&&(f.updateNodeOpt=s),l&&(f.animationWorkData=l),f.node&&f.node.getWorkId()!==c&&f.node.setWorkId(c),h&&(f.oldRect=h),o&&i&&(f.toolsType!==o&&o&&i&&this.setNodeKey(c,f,o,i),f.node&&f.node.setWorkOptions(i))}}},{key:"computNextAnimationIndex",value:function(e,t){var r,n=(null==(r=e.node)?void 0:r.syncUnitTime)||this.syncUnitTime,i=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/n)*t;return Math.min((e.animationIndex||0)+(i||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:function(){var e,t,r,n,i=this;this.animationId=void 0;var s,u=!1,l=new Map,c=[],h=a(this.serviceWorkShapes.entries());try{for(h.s();!(s=h.n()).done;){var d=o(s.value,2),f=d[0],p=d[1];switch(p.toolsType){case I.EToolsKey.LaserPen:var v=this.computNextAnimationIndex(p,8),g=Math.max(0,p.animationIndex||0),m=(p.animationWorkData||[]).slice(g,v);if((p.animationIndex||0)0&&void 0!==arguments[0]&&arguments[0],r=this.workShapes.get(I.Storage_Selector_key);if(r){if(r&&(null==(e=r.selectIds)||!e.length))return this.blurSelector();var n=r.reRenderSelector();n&&this.thread.post({sp:[{type:I.EPostMessageType.Select,selectIds:r.selectIds,selectRect:n,willSyncService:t,viewId:this.thread.viewId,points:r.getChildrenPoints(),textOpt:r.textOpt,selectorColor:r.selectorColor,strokeColor:r.strokeColor,fillColor:r.fillColor,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,opt:r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt}]})}}},{key:"blurSelector",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.workShapes.get(I.Storage_Selector_key),i=null==n?void 0:n.blurSelector(),this.clearWorkShapeNodeCache(I.Storage_Selector_key),(null==(r=this.thread.fullLayer)?void 0:r.parent).children.forEach((function(e){e.name===I.Storage_Selector_key&&e.remove()})),i&&((o=[]).push(f(f({},i),{},{isSync:null==t?void 0:t.isSync})),this.thread.post({sp:o}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"clearWorkShapeNodeCache",value:function(e){var t;null==(t=this.getWorkShape(e))||t.clearTmpPoints(),this.workShapes.delete(e)}},{key:"drawEraser",value:function(e){var t,r,n=this,i=[];if(null!=(t=e.newWorkDatas)&&t.size){var o,s=a(e.newWorkDatas.values());try{for(s.s();!(o=s.n()).done;){var u=o.value,l=u.workId.toString();this.batchEraserWorks.add(l),i.push({type:I.EPostMessageType.FullWork,workId:l,ops:I.transformToSerializableData(u.op),opt:u.opt,toolsType:u.toolsType,updateNodeOpt:{useAnimation:!1}})}}catch(e){s.e(e)}finally{s.f()}delete e.newWorkDatas}null==(r=e.removeIds)||r.forEach((function(e){n.batchEraserRemoveNodes.add(e)})),i.push(e),this.thread.post({sp:i}),this.batchEraserCombine()}},{key:"updateBatchEraserCombineNode",value:function(e,t){var r,n=this,i=a(t.keys());try{for(i.s();!(r=i.n()).done;){var o=r.value;this.thread.fullLayer.getElementsByName(o).forEach((function(e){e.remove()}))}}catch(e){i.e(e)}finally{i.f()}e.forEach((function(e){var t=n.vNodes.get(e);if(t&&t.toolsType===I.EToolsKey.Pencil&&!n.thread.fullLayer.getElementsByName(e)[0]){var r=n.setFullWork(f(f({},t),{},{workId:e}));r&&r.consumeService({op:t.op,isFullWork:!0})}}))}},{key:"getWorkShape",value:function(e){return this.workShapes.get(e)}},{key:"getWorkShapes",value:function(){return this.workShapes}},{key:"consumeDraw",value:function(e,t){var r=e.op,n=e.workId,i=e.scenePath;if(null!=r&&r.length&&n){var o=n.toString(),a=this.workShapes.get(o);if(!a)return;var s=a.toolsType;if(s===I.EToolsKey.LaserPen)return;switch(this.drawWorkActiveId&&this.drawWorkActiveId!==o&&(this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:i,viewId:this.thread.viewId,msgType:I.EPostMessageType.DrawWork,dataType:I.EDataType.Local},t),this.drawWorkActiveId=void 0),!this.drawWorkActiveId&&o!==I.Storage_Selector_key&&(this.drawWorkActiveId=o),s){case I.EToolsKey.Selector:var u=a.consume({data:e,isFullWork:!0});u.type===I.EPostMessageType.Select&&(u.selectIds&&t.runReverseSelectWork(u.selectIds),this.thread.post({sp:[u]}));break;case I.EToolsKey.Eraser:var l=a.consume({data:e,isFullWork:!0});null!=l&&l.rect&&this.drawEraser(l);break;case I.EToolsKey.Arrow:case I.EToolsKey.Straight:case I.EToolsKey.Ellipse:case I.EToolsKey.Rectangle:case I.EToolsKey.Star:case I.EToolsKey.Polygon:case I.EToolsKey.SpeechBalloon:case I.EToolsKey.Pencil:var c=a.consume({data:e,isFullWork:!1,isMainThread:!0});c&&(this.drawCount++,this.thread.post({drawCount:this.drawCount,sp:c.op&&[f(f({},c),{},{scenePath:i})]||void 0}))}}}},{key:"consumeDrawAll",value:function(e,t){var r,n,i,o=e.workId,a=e.scenePath;if(o){var s=o.toString();this.drawWorkActiveId===s&&(this.drawWorkActiveId=void 0);var u=this.workShapes.get(s);if(!u)return;var l=u.toolsType;if(l===I.EToolsKey.LaserPen)return;var c=this.workShapes.get(I.Cursor_Hover_Id),h=null==(r=null==c?void 0:c.selectIds)?void 0:r[0],d=u.consumeAll({data:e});switch(l){case I.EToolsKey.Selector:d.selectIds&&h&&null!=(n=d.selectIds)&&n.includes(h)&&c.cursorBlur(),d.type===I.EPostMessageType.Select&&(d.selectIds&&t.runReverseSelectWork(d.selectIds),this.thread.post({sp:[f(f({},d),{},{scenePath:a})]})),null!=(i=u.selectIds)&&i.length?u.clearTmpPoints():this.clearWorkShapeNodeCache(s);break;case I.EToolsKey.Eraser:null!=d&&d.rect&&this.drawEraser(f(f({},d),{},{scenePath:a})),u.clearTmpPoints();break;case I.EToolsKey.Arrow:case I.EToolsKey.Straight:case I.EToolsKey.Ellipse:case I.EToolsKey.Rectangle:case I.EToolsKey.Star:case I.EToolsKey.Polygon:case I.EToolsKey.SpeechBalloon:case I.EToolsKey.Pencil:d&&(this.drawCount=0,this.thread.post({drawCount:this.drawCount,sp:[d]})),this.clearWorkShapeNodeCache(s)}}}},{key:"getToolsOpt",value:function(){return this.tmpOpt}},{key:"setToolsOpt",value:function(e){var t;this.tmpOpt=e,null!=(t=e.toolsOpt)&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime)}},{key:"setWorkOptions",value:function(e,t){var r=this.workShapes.get(e);if(!r&&this.tmpOpt){var n=this.tmpOpt.toolsType;this.tmpOpt.toolsOpt=t,(r=this.createWorkShapeNode({workId:e,toolsType:n,toolsOpt:t}))&&this.workShapes.set(e,r),this.setToolsOpt(this.tmpOpt)}t.syncUnitTime||(t.syncUnitTime=this.syncUnitTime),null==r||r.setWorkOptions(t)}},{key:"createWorkShapeNode",value:function(e){return ie(f(f({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.localLayer}),this.thread.serviceWork)}}]),e}(),ce=function(){function e(t){S(this,e),A(this,"vNodes"),A(this,"thread"),A(this,"workShapes",new Map),A(this,"selectorWorkShapes",new Map),A(this,"willRunEffectSelectorIds",new Set),A(this,"runEffectId"),A(this,"animationId"),A(this,"syncUnitTime",I.DefaultAppliancePluginOptions.syncOpt.interval),this.vNodes=t.vNodes,this.thread=t.thread}var t;return M(e,[{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.serviceLayer.children.length&&(this.thread.serviceLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear()}},{key:"runEffect",value:function(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0))}},{key:"effectRunSelector",value:function(){var e=this;this.runEffectId=void 0,this.willRunEffectSelectorIds.forEach((function(t){var r,n,i=e.selectorWorkShapes.get(t);i&&i.selectIds&&(null==(r=i.node)||r.selectServiceNode(t,i,!0)),null!=(n=null==i?void 0:i.selectIds)&&n.length||e.selectorWorkShapes.delete(t)})),this.willRunEffectSelectorIds.clear()}},{key:"runSelectWork",value:function(e){this.activeSelectorShape(e);var t=e.workId,r=null==t?void 0:t.toString();r&&this.willRunEffectSelectorIds.add(r),this.runEffect()}},{key:"removeWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();if(r){if(this.workShapes.get(r))return this.workShapes.delete(r),void this.removeNode(r,e);this.removeNode(r,e)}}},{key:"consumeFull",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"runReverseSelectWork",value:function(e){var t=this;e.forEach((function(e){t.selectorWorkShapes.forEach((function(r,n){var i;if(null!=(i=r.selectIds)&&i.length){var o=r.selectIds.indexOf(e);o>-1&&(r.selectIds.splice(o,1),t.willRunEffectSelectorIds.add(n))}}))})),this.willRunEffectSelectorIds.size&&this.runEffect()}},{key:"consumeDraw",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"computNextAnimationIndex",value:function(e,t){var r=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:(t=u(regeneratorRuntime.mark((function e(){var t,r,n,i,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.animationId=void 0,_=!1,b=new Map,x=a(this.workShapes.entries()),e.prev=4,S=regeneratorRuntime.mark((function e(){var a,x,S,T,k,E,A,C,P,N;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=o(w.value,2),x=a[0],S=a[1],e.t0=S.toolsType,e.next=e.t0===I.EToolsKey.Image?4:e.t0===I.EToolsKey.Text?9:e.t0===I.EToolsKey.Arrow||e.t0===I.EToolsKey.Straight||e.t0===I.EToolsKey.Rectangle||e.t0===I.EToolsKey.Ellipse||e.t0===I.EToolsKey.Star||e.t0===I.EToolsKey.Polygon||e.t0===I.EToolsKey.SpeechBalloon?17:e.t0===I.EToolsKey.Pencil?20:33;break;case 4:return e.next=6,null==(r=S.node)?void 0:r.consumeServiceAsync({isFullWork:!0,scene:null==(t=M.thread.fullLayer.parent)?void 0:t.parent,isMainThread:!0});case 6:return M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),M.workShapes.delete(x),e.abrupt("break",33);case 9:if(e.t1=S.node,!e.t1){e.next=16;break}return e.next=13,null==(n=S.node)?void 0:n.consumeServiceAsync({isFullWork:!0,replaceId:x});case 13:M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),null==(i=S.node)||i.clearTmpPoints(),M.workShapes.delete(x);case 16:return e.abrupt("break",33);case 17:return T=!!S.ops,null!=(s=S.animationWorkData)&&s.length&&(k=S.oldRect,null==(u=S.node)||u.consumeService({op:S.animationWorkData,isFullWork:T}),T&&(M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),null==(l=S.node)||l.clearTmpPoints(),M.workShapes.delete(x)),b.set(x,{workState:k?S.ops?I.EvevtWorkState.Done:I.EvevtWorkState.Doing:I.EvevtWorkState.Start,op:S.animationWorkData.filter((function(e,t){if(t%3!=2)return!0})).slice(-2)}),S.animationWorkData.length=0),e.abrupt("break",33);case 20:if(S.useAnimation||!S.ops){e.next=24;break}null==(c=S.node)||c.consumeService({op:S.animationWorkData||[],isFullWork:!0,replaceId:x}),null==(h=S.node)||h.updataOptService(S.updateNodeOpt),M.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(x)&&(M.willRunEffectSelectorIds.add(t),M.runEffect())})),null==(d=S.node)||d.clearTmpPoints(),M.workShapes.delete(x),e.next=32;break;case 24:if(!S.useAnimation){e.next=32;break}if(!S.isDel){e.next=28;break}return null==(f=S.node)||f.clearTmpPoints(),M.workShapes.delete(x),e.abrupt("break",33);case 28:return E=M.computNextAnimationIndex(S,3),A=S.isDiff?0:Math.max(0,(S.animationIndex||0)-3),C=(S.animationWorkData||[]).slice(A,E),P=null==(v=null==(p=S.node)?void 0:p.getWorkId())?void 0:v.toString(),(S.animationIndex||0)-1&&this.removeSelectWork(t),this.thread.fullLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.thread.serviceLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.vNodes.delete(e)}},{key:"removeSelectWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();r&&(this.activeSelectorShape(e),this.willRunEffectSelectorIds.add(r)),this.runEffect()}},{key:"activeSelectorShape",value:function(e){var t,r,n,i=e.workId,o=e.opt,a=e.toolsType,s=e.type,u=e.selectIds;if(i){var l=i.toString();if(null==(t=this.selectorWorkShapes)||!t.has(l)){var c={toolsType:a,selectIds:u,type:s,opt:o};a&&o&&(c=this.setNodeKey(l,c,a,o)),null==(r=this.selectorWorkShapes)||r.set(l,c)}var h=null==(n=this.selectorWorkShapes)?void 0:n.get(l);s&&(h.type=s),h.node&&h.node.getWorkId()!==l&&h.node.setWorkId(l),h.selectIds=u||[]}}},{key:"setNodeKey",value:function(e,t,r,n){return t.toolsType=r,t.node=ie({toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.serviceLayer,workId:e},this),t}}]),e}(),he=function(){function e(){S(this,e),A(this,"localWork"),A(this,"serviceWork"),A(this,"scene")}return M(e,[{key:"registerMainThread",value:function(e,t,r){return this.localWork=e,this.serviceWork=t,this.scene=r,this}}]),e}(),de=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.CopyNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.FullWork||n!==I.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,e.t0=n,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.consumeFull(t,this.scene);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),i}(he),fe=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.SetColorNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,s=t.isSync,u=t.textUpdateForWoker,l=r.sp||[];if(i){var c,h=a(n.entries());try{for(h.s();!(c=h.n()).done;){var d=o(c.value,2),p=d[0],v=d[1];u&&v.toolsType===I.EToolsKey.Text?l.push(f(f({},v),{},{workId:p,type:I.EPostMessageType.TextUpdate,dataType:I.EDataType.Local,willSyncService:!0})):l.push(f(f({},v),{},{workId:p,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){h.e(e)}finally{h.f()}}return{sp:l}}}]),i}(he),pe=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.ZIndexNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,s=t.isSync,u=r.sp||[];if(i&&u){var l,c=a(n.entries());try{for(c.s();!(l=c.n()).done;){var h=o(l.value,2),d=h[0],p=h[1];u.push(f(f({},p),{},{workId:d,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){c.e(e)}finally{c.f()}}return{sp:u}}}]),i}(he),ve=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.TranslateNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.workId,o=t.updateNodeOpt,a=t.willRefreshSelector,s=t.willSyncService,u=t.willSerializeData,l=t.textUpdateForWoker,c=t.emitEventType,e.t0=i===I.Storage_Selector_key&&o,!e.t0){e.next=9;break}if(!(o.workState===I.EvevtWorkState.Done&&null!=o&&o.translate&&(o.translate[0]||o.translate[1])||o.workState!==I.EvevtWorkState.Done)){e.next=8;break}return e.next=6,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:o,willRefreshSelector:a,willSyncService:s,willSerializeData:u,isSync:!0,textUpdateForWoker:l,emitEventType:c,scene:this.scene,callback:this.updateSelectorCallback});case 6:e.next=9;break;case 8:o.workState===I.EvevtWorkState.Done&&(null==(n=this.localWork)||n.vNodes.deleteLastTarget());case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=t.updateSelectorOpt,h=t.textUpdateForWoker,d=c.workState,p=r.sp||[];if(d===I.EvevtWorkState.Start)return{sp:[],render:[]};var v=null==s?void 0:s.selectRect;if(u){d===I.EvevtWorkState.Doing&&p.push({type:I.EPostMessageType.Select,selectIds:i.selectIds,selectRect:v,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});var g,m=a(n.entries());try{for(m.s();!(g=m.n()).done;){var y=o(g.value,2),_=y[0],b=y[1];h&&b.toolsType===I.EToolsKey.Text?p.push(f(f({},b),{},{workId:_,type:I.EPostMessageType.TextUpdate,dataType:I.EDataType.Local,willSyncService:!0})):p.push(f(f({},b),{},{workId:_,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){m.e(e)}finally{m.f()}}return{sp:p}}}]),i}(he),ge=function(e){g(n,e);var t,r=y(n);function n(){var e;return S(this,n),e=r.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.DeleteNode),e}return M(n,[{key:"consume",value:(t=u(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!1);case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),n}(he),me=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.ScaleNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willSyncService,a=t.willSerializeData,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willSyncService:o,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,s=e.newServiceStore,u=t.updateSelectorOpt,l=t.willSyncService,c=u.workState,h=r.sp||[],d=null==i?void 0:i.selectRect;if(c===I.EvevtWorkState.Start)return{sp:[],render:[]};if(l){h.push({type:I.EPostMessageType.Select,selectIds:n.selectIds,selectRect:d,willSyncService:!0,isSync:!0,points:c===I.EvevtWorkState.Done&&n.getChildrenPoints()||void 0,textOpt:n.textOpt});var p,v=a(s.entries());try{for(v.s();!(p=v.n()).done;){var g=o(p.value,2),m=g[0],y=g[1];y.toolsType===I.EToolsKey.Text?h.push(f(f({},y),{},{workId:m,type:I.EPostMessageType.TextUpdate,dataType:I.EDataType.Local,willSyncService:!0})):h.push(f(f({},y),{},{workId:m,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}))}}catch(e){v.e(e)}finally{v.f()}}return{sp:h}}}]),i}(he),ye=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.RotateNode),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.emitEventType,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,emitEventType:u,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,s=e.newServiceStore,u=t.updateSelectorOpt,l=t.willSyncService,c=t.willSerializeData,h=t.isSync,d=u.workState,p=r.sp||[],v=null==i?void 0:i.selectRect;if(l){c&&d===I.EvevtWorkState.Done&&p.push({type:I.EPostMessageType.Select,selectIds:n.selectIds,selectRect:v,willSyncService:!0,isSync:h,points:n.getChildrenPoints()});var g,m=a(s.entries());try{for(m.s();!(g=m.n()).done;){var y=o(g.value,2),_=y[0],b=y[1];p.push(f(f({},b),{},{workId:_,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}))}}catch(e){m.e(e)}finally{m.f()}}return{sp:p}}}]),i}(he),_e=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.SetFontStyle),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=t.updateSelectorOpt,h=t.textUpdateForWoker,d=r.sp||[],p=null==s?void 0:s.selectRect;if(u&&d){c.fontSize&&d.push({type:I.EPostMessageType.Select,selectIds:i.selectIds,selectRect:p,willSyncService:u,isSync:l,points:i.getChildrenPoints()});var v,g=a(n.entries());try{for(g.s();!(v=g.n()).done;){var m=o(v.value,2),y=m[0],_=m[1];h&&_.toolsType===I.EToolsKey.Text?d.push(f(f({},_),{},{workId:y,type:I.EPostMessageType.TextUpdate,dataType:I.EDataType.Local,willSyncService:!0})):d.push(f(f({},_),{},{workId:y,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){g.e(e)}finally{g.f()}}return{sp:d}}}]),i}(he),be=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.SetPoint),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:s,isSync:!0,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=r.sp||[],h=null==s?void 0:s.selectRect;if(u&&c){var d,p=a(n.entries());try{for(p.s();!(d=p.n()).done;){var v=o(d.value,2),g=v[0],m=v[1];c.push(f(f({},m),{},{workId:g,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){p.e(e)}finally{p.f()}c.push({type:I.EPostMessageType.Select,selectIds:i.selectIds,selectRect:h,willSyncService:u,isSync:l,points:i.getChildrenPoints()})}return{sp:c}}}]),i}(he),xe=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.SetLock),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,s=e.res,u=t.willSyncService,l=t.isSync,c=t.updateSelectorOpt,h=r.sp||[],d=null==s?void 0:s.selectRect;if(u&&h){var p,v=a(n.entries());try{for(v.s();!(p=v.n()).done;){var g=o(p.value,2),m=g[0],y=g[1];h.push(f(f({},y),{},{workId:m,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){v.e(e)}finally{v.f()}h.push({isLocked:c.isLocked,selectorColor:i.selectorColor,scaleType:i.scaleType,canRotate:i.canRotate,type:I.EPostMessageType.Select,selectIds:i.selectIds,selectRect:d,willSyncService:u,isSync:l})}return{sp:h}}}]),i}(he),we=function(e){g(i,e);var t,r,n=y(i);function i(){var e;return S(this,i),e=n.apply(this,arguments),A(b(e),"emitEventType",I.EmitEventType.SetShapeOpt),e}return M(i,[{key:"consume",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==I.EPostMessageType.UpdateNode||n!==I.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===I.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,s=t.isSync,u=r.sp||[];if(i&&u){var l,c=a(n.entries());try{for(c.s();!(l=c.n()).done;){var h=o(l.value,2),d=h[0],p=h[1];u.push(f(f({},p),{},{workId:d,type:I.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){c.e(e)}finally{c.f()}}return{sp:u}}}]),i}(he),Se=function(){function e(t){var r=this;S(this,e),A(this,"builders",new Map),this.builders=new Map(t.map((function(e){return[e,r.build(e)]})))}var t;return M(e,[{key:"build",value:function(e){switch(e){case I.EmitEventType.TranslateNode:return new ve;case I.EmitEventType.ZIndexNode:return new pe;case I.EmitEventType.CopyNode:return new de;case I.EmitEventType.SetColorNode:return new fe;case I.EmitEventType.DeleteNode:return new ge;case I.EmitEventType.ScaleNode:return new me;case I.EmitEventType.RotateNode:return new ye;case I.EmitEventType.SetFontStyle:return new _e;case I.EmitEventType.SetPoint:return new be;case I.EmitEventType.SetLock:return new xe;case I.EmitEventType.SetShapeOpt:return new we}}},{key:"registerForMainThread",value:function(e,t,r){return this.builders.forEach((function(n){n&&n.registerMainThread(e,t,r)})),this}},{key:"consumeForMainThread",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a(this.builders.values()),e.prev=1,r.s();case 3:if((n=r.n()).done){e.next=11;break}return i=n.value,e.next=7,null==i?void 0:i.consume(t);case 7:if(!e.sent){e.next=9;break}return e.abrupt("return",!0);case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),r.e(e.t0);case 16:return e.prev=16,r.f(),e.finish(16);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(e){return t.apply(this,arguments)})}]),e}(),Te=function(){function e(t,r){S(this,e),A(this,"viewId"),A(this,"fullLayer"),A(this,"topLayer"),A(this,"localLayer"),A(this,"serviceLayer"),A(this,"snapshotFullLayer"),A(this,"vNodes"),A(this,"master"),A(this,"opt"),A(this,"cameraOpt"),A(this,"scene"),A(this,"localWork"),A(this,"serviceWork"),A(this,"topWork"),A(this,"taskUpdateCameraId"),A(this,"debounceUpdateCameraId"),A(this,"debounceUpdateCache",new Set),A(this,"mainThreadPostId"),A(this,"combinePostMsg",new Set),A(this,"methodBuilder"),this.viewId=t,this.opt=r,this.scene=this.createScene(f(f({},r.canvasOpt),{},{container:r.container})),this.master=r.master;var n=I.DefaultAppliancePluginOptions.bufferSize.full,i=I.DefaultAppliancePluginOptions.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:this.viewId===I.Main_View_Id?n:i})),this.topLayer=this.createLayer("topLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:(this.viewId,I.Main_View_Id,i)})),this.localLayer=this.createLayer("localLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:(this.viewId,I.Main_View_Id,i)})),this.serviceLayer=this.createLayer("serviceLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:(this.viewId,I.Main_View_Id,i)})),this.vNodes=new se(t,this.scene);var o={thread:this,vNodes:this.vNodes};this.localWork=new le(o),this.serviceWork=new ce(o),this.topWork=new ue(o),this.vNodes.init(this.fullLayer),this.methodBuilder=new Se([I.EmitEventType.CopyNode,I.EmitEventType.SetColorNode,I.EmitEventType.DeleteNode,I.EmitEventType.RotateNode,I.EmitEventType.ScaleNode,I.EmitEventType.TranslateNode,I.EmitEventType.ZIndexNode,I.EmitEventType.SetFontStyle,I.EmitEventType.SetPoint,I.EmitEventType.SetLock,I.EmitEventType.SetShapeOpt]).registerForMainThread(this.localWork,this.serviceWork,this.scene)}var t,r,n,i;return M(e,[{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(i=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.methodBuilder.consumeForMainThread(t);case 2:if(e.sent){e.next=38;break}r=t.msgType,n=t.toolsType,i=t.opt,o=t.dataType,a=t.workId,s=t.workState,u=null==a?void 0:a.toString(),e.t0=r,e.next=e.t0===I.EPostMessageType.Destroy?7:e.t0===I.EPostMessageType.Clear?9:e.t0===I.EPostMessageType.UpdateCamera?11:e.t0===I.EPostMessageType.UpdateTools?14:e.t0===I.EPostMessageType.CreateWork?16:e.t0===I.EPostMessageType.DrawWork?22:e.t0===I.EPostMessageType.UpdateNode||e.t0===I.EPostMessageType.FullWork?24:e.t0===I.EPostMessageType.RemoveNode?29:e.t0===I.EPostMessageType.Select?32:e.t0===I.EPostMessageType.CursorHover?34:e.t0===I.EPostMessageType.GetTextActive?36:38;break;case 7:return this.destroy(),e.abrupt("break",38);case 9:return this.clearAll(),e.abrupt("break",38);case 11:return e.next=13,this.updateCamera(t);case 13:return e.abrupt("break",38);case 14:return n&&i&&(l={toolsType:n,toolsOpt:i},this.topWork.canUseTopLayer(n)?this.topWork.setToolsOpt(l):this.localWork.setToolsOpt(l)),e.abrupt("break",38);case 16:if(!(u&&i&&n)){e.next=21;break}if(!this.topWork.canUseTopLayer(n)){e.next=20;break}return this.topWork.getToolsOpt()||this.topWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topWork.setWorkOptions(u,i),e.abrupt("break",38);case 20:this.localWork.getToolsOpt()||this.localWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.localWork.setWorkOptions(u,i);case 21:return e.abrupt("break",38);case 22:return s===I.EvevtWorkState.Done&&o===I.EDataType.Local?this.consumeDrawAll(o,t):this.consumeDraw(o,t),e.abrupt("break",38);case 24:if(!n||!this.topWork.canUseTopLayer(n)){e.next=27;break}return this.consumeDrawAll(o,t),e.abrupt("break",38);case 27:return this.consumeFull(o,t),e.abrupt("break",38);case 29:return e.next=31,this.removeNode(t);case 31:return e.abrupt("return");case 32:return o===I.EDataType.Service&&(a===I.Storage_Selector_key?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t)),e.abrupt("break",38);case 34:return this.localWork.cursorHover(t),e.abrupt("break",38);case 36:return o===I.EDataType.Local&&this.localWork.checkTextActive(t),e.abrupt("break",38);case 38:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"removeNode",value:(n=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.dataType,n=t.workId,i=t.removeIds,o=i||[],n&&o.push(n.toString()),!o.length){e.next=24;break}s=a(o),e.prev=3,s.s();case 5:if((u=s.n()).done){e.next=16;break}if(u.value!==I.Storage_Selector_key){e.next=11;break}return e.next=10,this.localWork.removeSelector(t);case 10:return e.abrupt("continue",14);case 11:return r===I.EDataType.Local?this.localWork.removeWork(t):r===I.EDataType.Service&&this.serviceWork.removeWork(t),e.next=14,this.localWork.colloctEffectSelectWork(t);case 14:e.next=5;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),s.e(e.t0);case 21:return e.prev=21,s.f(),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[3,18,21,24]])}))),function(e){return n.apply(this,arguments)})},{key:"consumeFull",value:(r=u(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localWork.colloctEffectSelectWork(r);case 2:if(n=e.sent,e.t0=n&&t===I.EDataType.Local,!e.t0){e.next=7;break}return e.next=7,this.localWork.consumeFull(n,this.scene);case 7:n&&t===I.EDataType.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"setCameraOpt",value:function(e){this.cameraOpt=e;var t=e.scale,r=e.centerX,n=e.centerY,i=e.width,o=e.height;(i!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:i,height:o}),this.fullLayer.setAttribute("scale",[t,t]),this.fullLayer.setAttribute("translate",[-r,-n]),this.topLayer.setAttribute("scale",[t,t]),this.topLayer.setAttribute("translate",[-r,-n]),this.localLayer.setAttribute("scale",[t,t]),this.localLayer.setAttribute("translate",[-r,-n]),this.serviceLayer.setAttribute("scale",[t,t]),this.serviceLayer.setAttribute("translate",[-r,-n])}},{key:"runBatchPostData",value:function(){this.mainThreadPostId||(this.mainThreadPostId=requestAnimationFrame(this.combinePost.bind(this)))}},{key:"combinePostData",value:function(){var e;this.mainThreadPostId=void 0;var t,r,n=[],i=a(this.combinePostMsg.values());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(null!=(e=o.sp)&&e.length){var s,u=a(o.sp);try{for(u.s();!(s=u.n()).done;){var l,c=s.value,h=!1,d=a(n);try{for(d.s();!(l=d.n()).done;){var f=l.value;if(N.isEqual(c,f)){h=!0;break}}}catch(e){d.e(e)}finally{d.f()}h||n.push(c)}}catch(e){u.e(e)}finally{u.f()}}N.isNumber(o.drawCount)&&(t=o.drawCount)}}catch(e){i.e(e)}finally{i.f()}return this.combinePostMsg.clear(),{sp:n,drawCount:t}}},{key:"combinePost",value:function(){var e,t,r=this,n=this.combinePostData(),i=null==(e=n.sp)?void 0:e.filter((function(e){return e.type!==I.EPostMessageType.None}));null!=i&&i.length?n.sp=i.map((function(e){return e.viewId?e:f(f({},e),{},{viewId:r.viewId})})):delete n.sp,void 0===n.drawCount&&delete n.drawCount,(null!=n&&n.drawCount||null!=(t=n.sp)&&t.length)&&this.opt.post(n)}},{key:"clearAll",value:function(){this.fullLayer.children.length&&(this.fullLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.fullLayer.removeAllChildren()),this.localWork.clearAll(),this.topWork.clearAll(),this.serviceWork.clearAll(),this.vNodes.clear(),this.post({sp:[{type:I.EPostMessageType.Clear}]})}},{key:"consumeDrawAll",value:function(e,t){var r=t.toolsType,n=t.workId;if(n){var i=n.toString();if(r&&this.topWork.canUseTopLayer(r))return e===I.EDataType.Local&&(this.topWork.getLocalWorkShape(n.toString())||this.topWork.createLocalWork(t)),void this.topWork.consumeDrawAll(t);e===I.EDataType.Local&&(this.localWork.getWorkShape(i)||this.localWork.createLocalWork(t),this.localWork.consumeDrawAll(t,this.serviceWork))}}},{key:"consumeDraw",value:function(e,t){var r=t.opt,n=t.workId,i=t.toolsType;if(n&&i&&r){var o=n.toString();return this.topWork.canUseTopLayer(i)?(e===I.EDataType.Local&&(this.topWork.getLocalWorkShape(o)||this.topWork.createLocalWork(t)),void this.topWork.consumeDraw(t)):void(e===I.EDataType.Local?(this.localWork.getWorkShape(o)||this.localWork.createLocalWork(t),this.localWork.consumeDraw(t,this.serviceWork)):e===I.EDataType.Service&&this.serviceWork.consumeDraw(t))}}},{key:"updateCamera",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,s,u,l,c,h,d,f,p,v,g,m,y,_,b,x,w,S,T,M,k,E,A,C,P,O,R,D,L,j,z,B,F,U,W,G,V,H,Y,$,X,q,Q,Z,K,J,ee,te=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.cameraOpt,i=t.scenePath,!n||N.isEqual(this.cameraOpt,n)){e.next=34;break}if(this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0),!i){e.next=25;break}s=!1,u=a(this.localWork.getWorkShapes().entries()),e.prev=5,u.s();case 7:if((l=u.n()).done){e.next=14;break}if(c=o(l.value,2),h=c[0],(d=c[1]).toolsType===I.EToolsKey.Text||d.toolsType===I.EToolsKey.Eraser||d.toolsType===I.EToolsKey.Selector||d.toolsType===I.EToolsKey.LaserPen||h===I.Cursor_Hover_Id||h===I.Storage_Selector_key){e.next=12;break}return s=!0,e.abrupt("break",14);case 12:e.next=7;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),u.e(e.t0);case 19:return e.prev=19,u.f(),e.finish(19);case 22:if(!s){e.next=25;break}return this.taskUpdateCameraId=setTimeout((function(){te.taskUpdateCameraId=void 0,te.updateCamera(t)}),I.Task_Time_Interval),e.abrupt("return");case 25:f=new Map,p=a(this.vNodes.getNodesByType(I.EToolsKey.Text).entries());try{for(p.s();!(v=p.n()).done;)g=o(v.value,2),m=g[0],y=g[1],_=y.rect,f.set(m,N.cloneDeep(_))}catch(e){p.e(e)}finally{p.f()}if(b=new Set(f.keys()),x=!1,this.localWork.hasSelector()&&(w=null==(r=this.localWork.getSelector())?void 0:r.selectIds)){x=!0,S=a(w);try{for(S.s();!(T=S.n()).done;)M=T.value,b.add(M)}catch(e){S.e(e)}finally{S.f()}}if(k=!1,this.serviceWork.selectorWorkShapes.size){E=a(this.serviceWork.selectorWorkShapes.values());try{for(E.s();!(A=E.n()).done;)if(C=A.value,P=C.selectIds){k=!0,O=a(P);try{for(O.s();!(R=O.n()).done;)D=R.value,b.add(D)}catch(e){O.e(e)}finally{O.f()}}}catch(e){E.e(e)}finally{E.f()}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(b),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId),L=a(f.entries());try{for(L.s();!(j=L.n()).done;)z=o(j.value,2),B=z[0],F=z[1],(U=this.vNodes.get(B))&&(W=F,G=U.rect,V=this.getSceneRect(),H=I.getRectMatrixrRelation(W,V),Y=I.getRectMatrixrRelation(G,V),$=!1,(H!==Y||W.w!==G.w||W.h!==G.h||Y===I.EMatrixrRelationType.intersect)&&($=!0),$&&(X=U.toolsType,q=U.opt,X===I.EToolsKey.Text&&q.workState===I.EvevtWorkState.Done&&this.debounceUpdateCache.add(B)))}catch(e){L.e(e)}finally{L.f()}if(x&&this.localWork.reRenderSelector(),k){Q=a(this.serviceWork.selectorWorkShapes.entries());try{for(Q.s();!(Z=Q.n()).done;)K=o(Z.value,2),J=K[0],ee=K[1],this.serviceWork.runSelectWork({workId:J,selectIds:ee.selectIds,msgType:I.EPostMessageType.Select,dataType:I.EDataType.Service,viewId:this.viewId})}catch(e){Q.e(e)}finally{Q.f()}}this.debounceUpdateCameraId=setTimeout((function(){var e;te.debounceUpdateCameraId=void 0;var t,r=[],n=a(te.debounceUpdateCache.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null==(e=te.fullLayer)?void 0:e.getElementsByName(i)[0]){var o=te.vNodes.get(i);if(o){var s=o.toolsType,u=o.opt,l=o.rect,c=te.localWork.setFullWork({toolsType:s,opt:u,workId:i});if(c){var h=te.getSceneRect(),d=I.getRectMatrixrRelation(l,h);r.push(c.consumeServiceAsync({isFullWork:!0,replaceId:i,isDrawLabel:d!==I.EMatrixrRelationType.outside}))}}}te.debounceUpdateCache.delete(i)}}catch(e){n.e(e)}finally{n.f()}te.vNodes.updateLowLevelNodesRect(),te.vNodes.clearHighLevelIds()}),I.Task_Time_Interval)}case 34:case"end":return e.stop()}}),e,this,[[5,16,19,22]])}))),function(e){return t.apply(this,arguments)})},{key:"getSceneRect",value:function(){var e=this.scene,t=e.width,r=e.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(r)}}},{key:"createScene",value:function(e){return new C.Scene(f(f({displayRatio:this.opt.displayer.dpr,depth:!1,desynchronized:!0},e),{},{autoRender:!0,id:this.viewId}))}},{key:"createLayer",value:function(e,t,r){var n=r.width,i=r.height,o="canvas-".concat(e),a=t.layer(o,f(f({},r),{},{offscreen:!1})),s=new C.Group({anchor:[.5,.5],pos:[.5*n,.5*i],size:[n,i],name:"viewport",id:e});return a.append(s),s}},{key:"updateScene",value:function(e){this.scene.attr(f({},e));var t=e.width,r=e.height;this.scene.width=t,this.scene.height=r,this.updateLayer({width:t,height:r})}},{key:"updateLayer",value:function(e){var t=e.width,r=e.height;this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",r),this.fullLayer.setAttribute("size",[t,r]),this.fullLayer.setAttribute("pos",[.5*t,.5*r]),this.topLayer.parent.setAttribute("width",t),this.topLayer.parent.setAttribute("height",r),this.topLayer.setAttribute("size",[t,r]),this.topLayer.setAttribute("pos",[.5*t,.5*r]),this.localLayer.parent.setAttribute("width",t),this.localLayer.parent.setAttribute("height",r),this.localLayer.setAttribute("size",[t,r]),this.localLayer.setAttribute("pos",[.5*t,.5*r]),this.serviceLayer.parent.setAttribute("width",t),this.serviceLayer.parent.setAttribute("height",r),this.serviceLayer.setAttribute("size",[t,r]),this.serviceLayer.setAttribute("pos",[.5*t,.5*r])}},{key:"destroy",value:function(){this.vNodes.clear(),this.fullLayer.remove(),this.topLayer.remove(),this.localLayer.remove(),this.serviceLayer.remove(),this.scene.remove(),this.localWork.destroy(),this.serviceWork.destroy(),this.topWork.destroy()}}]),e}(),Me=function(){function e(t,r){S(this,e),A(this,"viewId"),A(this,"fullLayer"),A(this,"master"),A(this,"opt"),A(this,"scene"),A(this,"mainThreadPostId"),A(this,"combinePostMsg",new Set),A(this,"workShapes",new Map),this.viewId=t,this.opt=r,this.scene=this.createScene(f(f({},r.canvasOpt),{},{container:r.container})),this.master=r.master,this.fullLayer=this.createLayer("fullLayer",this.scene,f(f({},r.layerOpt),{},{bufferSize:this.viewId===I.Main_View_Id?6e3:3e3}))}var t,r,n,i,s;return M(e,[{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(s=u(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.msgType,e.t0=r,e.next=e.t0===I.EPostMessageType.Snapshot?4:e.t0===I.EPostMessageType.BoundingBox?8:12;break;case 4:return e.next=6,this.getSnapshot(t);case 6:case 10:return this.destroy(),e.abrupt("return");case 8:return e.next=10,this.getBoundingRect(t);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"createWorkShapeNode",value:function(e){return ie(f(f({},e),{},{fullLayer:this.fullLayer,drawLayer:void 0}))}},{key:"setFullWork",value:function(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r&&n){var i,o=t.toString();return t&&this.workShapes.has(o)?null==(i=this.workShapes.get(o))||i.setWorkOptions(r):i=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:o}),i?(this.workShapes.set(o,i),i):void 0}}},{key:"runFullWork",value:(i=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.setFullWork(t),o=t.ops&&I.transformToNormalData(t.ops),!i){e.next=17;break}if(u=null==(r=i.getWorkId())?void 0:r.toString(),i.toolsType!==I.EToolsKey.Image){e.next=9;break}return e.next=6,i.consumeServiceAsync({isFullWork:!0,scene:null==(n=this.fullLayer.parent)?void 0:n.parent,isMainThread:!0});case 6:a=e.sent,e.next=16;break;case 9:if(i.toolsType!==I.EToolsKey.Text){e.next=15;break}return e.next=12,i.consumeServiceAsync({isFullWork:!0,replaceId:u,isDrawLabel:!0});case 12:a=e.sent,e.next=16;break;case 15:a=i.consumeService({op:o,isFullWork:!0,replaceId:u}),s=(null==t?void 0:t.updateNodeOpt)&&i.updataOptService(t.updateNodeOpt);case 16:return e.abrupt("return",I.computRect(a,s));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getSnapshot",value:(n=u(regeneratorRuntime.mark((function e(t){var r,n,i,a,s,u,l,c,h,d,p,v,g,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,s=t.h,!(r&&n&&i)){e.next=22;break}this.setCameraOpt(i),l=0,c=Object.entries(n);case 4:if(!(l0&&Math.floor(e.w*this.opt.displayer.dpr||1)||1,o=e.h>0&&Math.floor(e.h*this.opt.displayer.dpr||1)||1;return createImageBitmap(this.fullLayer.parent.canvas,r,n,i,o,t)}},{key:"getSnapshotRender",value:(r=u(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.scenePath,o=t.options,(null==(r=this.fullLayer)?void 0:r.parent).render(),e.next=4,this.getRectImageBitmap(this.getSceneRect(),o);case 4:(a=e.sent)&&(this.post({sp:[{type:I.EPostMessageType.Snapshot,scenePath:i,imageBitmap:a,viewId:this.viewId}]}),null==(n=this.fullLayer)||n.removeAllChildren());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getBoundingRect",value:(t=u(regeneratorRuntime.mark((function e(t){var r,n,i,a,s,u,l,c,h,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,!(r&&n&&i)){e.next=19;break}this.setCameraOpt(i),s=0,u=Object.entries(n);case 4:if(!(s=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;x(this,e),this.x=t,this.y=r,this.z=n}return S(e,[{key:"setz",value:function(e){return this.z=e,this}},{key:"setXY",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y;return this.x=e,this.y=t,this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z;return this.x=e,this.y=t,this.z=r,this}},{key:"setTo",value:function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.z,a=void 0===o?1:o;return this.x=r,this.y=i,this.z=a,this}},{key:"rot",value:function(e){if(0===e)return this;var t=this.x,r=this.y,n=Math.sin(e),i=Math.cos(e);return this.x=t*i-r*n,this.y=t*n+r*i,this}},{key:"rotWith",value:function(e,t){if(0===t)return this;var r=this.x-e.x,n=this.y-e.y,i=Math.sin(t),o=Math.cos(t);return this.x=e.x+(r*o-n*i),this.y=e.y+(r*i+n*o),this}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subXY",value:function(e,t){return this.x-=e,this.y-=t,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addXY",value:function(e,t){return this.x+=e,this.y+=t,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"clamp",value:function(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,e),void 0!==t&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this}},{key:"div",value:function(e){return this.x/=e,this.y/=e,this}},{key:"divV",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"mul",value:function(e){return this.x*=e,this.y*=e,this}},{key:"mulV",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"abs",value:function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this}},{key:"nudge",value:function(t,r){var n=e.Tan(t,this);return this.add(n.mul(r))}},{key:"neg",value:function(){return this.x*=-1,this.y*=-1,this}},{key:"cross",value:function(e){return this.x=this.y*e.z-this.z*e.y,this.y=this.z*e.x-this.x*e.z,this}},{key:"dpr",value:function(t){return e.Dpr(this,t)}},{key:"cpr",value:function(t){return e.Cpr(this,t)}},{key:"len2",value:function(){return e.Len2(this)}},{key:"len",value:function(){return e.Len(this)}},{key:"pry",value:function(t){return e.Pry(this,t)}},{key:"per",value:function(){var e=this.x,t=this.y;return this.x=t,this.y=-e,this}},{key:"uni",value:function(){return e.Uni(this)}},{key:"tan",value:function(t){return e.Tan(this,t)}},{key:"dist",value:function(t){return e.Dist(this,t)}},{key:"distanceToLineSegment",value:function(t,r){return e.DistanceToLineSegment(t,r,this)}},{key:"slope",value:function(t){return e.Slope(this,t)}},{key:"snapToGrid",value:function(e){return this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this}},{key:"angle",value:function(t){return e.Angle(this,t)}},{key:"toAngle",value:function(){return e.ToAngle(this)}},{key:"lrp",value:function(e,t){return this.x=this.x+(e.x-this.x)*t,this.y=this.y+(e.y-this.y)*t,this}},{key:"equals",value:function(t,r){return e.Equals(this,t,r)}},{key:"equalsXY",value:function(t,r){return e.EqualsXY(this,t,r)}},{key:"norm",value:function(){var e=this.len();return this.x=0===e?0:this.x/e,this.y=0===e?0:this.y/e,this}},{key:"toFixed",value:function(){return e.ToFixed(this)}},{key:"toString",value:function(){return e.ToString(e.ToFixed(this))}},{key:"toJson",value:function(){return e.ToJson(this)}},{key:"toArray",value:function(){return e.ToArray(this)}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Add",value:function(t,r){return new e(t.x+r.x,t.y+r.y)}},{key:"AddXY",value:function(t,r,n){return new e(t.x+r,t.y+n)}},{key:"Sub",value:function(t,r){return new e(t.x-r.x,t.y-r.y)}},{key:"SubXY",value:function(t,r,n){return new e(t.x-r,t.y-n)}},{key:"AddScalar",value:function(t,r){return new e(t.x+r,t.y+r)}},{key:"SubScalar",value:function(t,r){return new e(t.x-r,t.y-r)}},{key:"Div",value:function(t,r){return new e(t.x/r,t.y/r)}},{key:"Mul",value:function(t,r){return new e(t.x*r,t.y*r)}},{key:"DivV",value:function(t,r){return new e(t.x/r.x,t.y/r.y)}},{key:"MulV",value:function(t,r){return new e(t.x*r.x,t.y*r.y)}},{key:"Neg",value:function(t){return new e(-t.x,-t.y)}},{key:"Per",value:function(t){return new e(t.y,-t.x)}},{key:"Dist2",value:function(t,r){return e.Sub(t,r).len2()}},{key:"Abs",value:function(t){return new e(Math.abs(t.x),Math.abs(t.y))}},{key:"Dist",value:function(e,t){return Math.hypot(e.y-t.y,e.x-t.x)}},{key:"Dpr",value:function(e,t){return e.x*t.x+e.y*t.y}},{key:"Cross",value:function(t,r){return new e(t.y*r.z-t.z*r.y,t.z*r.x-t.x*r.z)}},{key:"Cpr",value:function(e,t){return e.x*t.y-t.x*e.y}},{key:"Len2",value:function(e){return e.x*e.x+e.y*e.y}},{key:"Len",value:function(e){return Math.hypot(e.x,e.y)}},{key:"Pry",value:function(t,r){return e.Dpr(t,r)/e.Len(r)}},{key:"Uni",value:function(t){return e.Div(t,e.Len(t))}},{key:"Tan",value:function(t,r){return e.Uni(e.Sub(t,r))}},{key:"Min",value:function(t,r){return new e(Math.min(t.x,r.x),Math.min(t.y,r.y))}},{key:"Max",value:function(t,r){return new e(Math.max(t.x,r.x),Math.max(t.y,r.y))}},{key:"From",value:function(t){return(new e).add(t)}},{key:"FromArray",value:function(t){return new e(t[0],t[1])}},{key:"Rot",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Math.sin(r),i=Math.cos(r);return new e(t.x*i-t.y*n,t.x*n+t.y*i)}},{key:"RotWith",value:function(t,r,n){var i=t.x-r.x,o=t.y-r.y,a=Math.sin(n),s=Math.cos(n);return new e(r.x+(i*s-o*a),r.y+(i*a+o*s))}},{key:"NearestPointOnLineThroughPoint",value:function(t,r,n){return e.Mul(r,e.Sub(n,t).pry(r)).add(t)}},{key:"NearestPointOnLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=e.Tan(r,t),a=e.Add(t,e.Mul(o,e.Sub(n,t).pry(o)));if(i){if(a.xMath.max(t.x,r.x))return e.Cast(t.x>r.x?t:r);if(a.yMath.max(t.y,r.y))return e.Cast(t.y>r.y?t:r)}return a}},{key:"DistanceToLineThroughPoint",value:function(t,r,n){return e.Dist(n,e.NearestPointOnLineThroughPoint(t,r,n))}},{key:"DistanceToLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e.Dist(n,e.NearestPointOnLineSegment(t,r,n,i))}},{key:"Snap",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}},{key:"Cast",value:function(t){return t instanceof e?t:e.From(t)}},{key:"Slope",value:function(e,t){return e.x===t.y?NaN:(e.y-t.y)/(e.x-t.x)}},{key:"Angle",value:function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}},{key:"Lrp",value:function(t,r,n){return e.Sub(r,t).mul(n).add(t)}},{key:"Med",value:function(t,r){return new e((t.x+r.x)/2,(t.y+r.y)/2)}},{key:"Equals",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-4;return Math.abs(e.x-t.x)2&&void 0!==arguments[2]?arguments[2]:1e-4;return e.Equals(t,r,n)&&Math.abs((t.z||0)-(r.z||0))1&&void 0!==arguments[1]?arguments[1]:2;return new e(+t.x.toFixed(r),+t.y.toFixed(r),+t.z.toFixed(r))}},{key:"Nudge",value:function(t,r,n){return e.Add(t,e.Tan(r,t).mul(n))}},{key:"ToString",value:function(e){return"".concat(e.x,", ").concat(e.y)}},{key:"ToAngle",value:function(e){var t=Math.atan2(e.y,e.x);return t<0&&(t+=2*Math.PI),t}},{key:"FromAngle",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.cos(t)*r,Math.sin(t)*r)}},{key:"ToArray",value:function(e){return[e.x,e.y,e.z]}},{key:"ToJson",value:function(e){return{x:e.x,y:e.y,z:e.z}}},{key:"Average",value:function(t){for(var r=t.length,n=new e(0,0),i=0;i2&&void 0!==arguments[2]?arguments[2]:6,i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:8;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}}]),e}(),ee=function(e){return e<.5?2*e*e:(4-2*e)*e-1},te=("undefined"==typeof globalThis?"undefined":T(globalThis))<"u"?globalThis:("undefined"==typeof window?"undefined":T(window))<"u"?window:(void 0===r.g?"undefined":T(r.g))<"u"?r.g:("undefined"==typeof self?"undefined":T(self))<"u"?self:{};function re(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ne="object"==T(te)&&te&&te.Object===Object&&te,ie=ne,oe="object"==("undefined"==typeof self?"undefined":T(self))&&self&&self.Object===Object&&self,ae=ie||oe||Function("return this")(),se=ae.Symbol,ue=se,le=Object.prototype,ce=le.hasOwnProperty,he=le.toString,de=ue?ue.toStringTag:void 0;var fe=function(e){var t=ce.call(e,de),r=e[de];try{e[de]=void 0;var n=!0}catch(e){}var i=he.call(e);return n&&(t?e[de]=r:delete e[de]),i},pe=Object.prototype.toString;var ve=function(e){return pe.call(e)},ge=fe,me=ve,ye=se?se.toStringTag:void 0;var _e=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ye&&ye in Object(e)?ge(e):me(e)};var be=function(e){return null!=e&&"object"==T(e)};var xe=function(){this.__data__=[],this.size=0};var we=function(e,t){return e===t||e!=e&&t!=t},Se=we;var Te=function(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1},Me=Te,ke=Array.prototype.splice;var Ee=function(e){var t=this.__data__,r=Me(t,e);return!(r<0)&&(r==t.length-1?t.pop():ke.call(t,r,1),--this.size,!0)},Ae=Te;var Ie=function(e){var t=this.__data__,r=Ae(t,e);return r<0?void 0:t[r][1]},Ce=Te;var Pe=function(e){return Ce(this.__data__,e)>-1},Ne=Te;var Oe=function(e,t){var r=this.__data__,n=Ne(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Re=xe,De=Ee,Le=Ie,je=Pe,ze=Oe;function Be(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Vr=_e,Hr=Gr,Yr=be,$r={};$r["[object Float32Array]"]=$r["[object Float64Array]"]=$r["[object Int8Array]"]=$r["[object Int16Array]"]=$r["[object Int32Array]"]=$r["[object Uint8Array]"]=$r["[object Uint8ClampedArray]"]=$r["[object Uint16Array]"]=$r["[object Uint32Array]"]=!0,$r["[object Arguments]"]=$r["[object Array]"]=$r["[object ArrayBuffer]"]=$r["[object Boolean]"]=$r["[object DataView]"]=$r["[object Date]"]=$r["[object Error]"]=$r["[object Function]"]=$r["[object Map]"]=$r["[object Number]"]=$r["[object Object]"]=$r["[object RegExp]"]=$r["[object Set]"]=$r["[object String]"]=$r["[object WeakMap]"]=!1;var Xr=function(e){return Yr(e)&&Hr(e.length)&&!!$r[Vr(e)]};var qr=function(e){return function(t){return e(t)}},Qr={exports:{}};!function(e,t){var r=ne,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(Qr,Qr.exports);var Zr=Qr.exports,Kr=Xr,Jr=qr,en=Zr&&Zr.isTypedArray,tn=en?Jr(en):Kr,rn=kr,nn=Lr,on=jr,an=Fr,sn=Wr,un=tn,ln=Object.prototype.hasOwnProperty;var cn=function(e,t){var r=on(e),n=!r&&nn(e),i=!r&&!n&&an(e),o=!r&&!n&&!i&&un(e),a=r||n||i||o,s=a?rn(e.length,String):[],u=s.length;for(var l in e)(t||ln.call(e,l))&&(!a||!("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||sn(l,u)))&&s.push(l);return s},hn=Object.prototype;var dn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||hn)};var fn=function(e,t){return function(r){return e(t(r))}},pn=fn(Object.keys,Object),vn=dn,gn=pn,mn=Object.prototype.hasOwnProperty;var yn=function(e){if(!vn(e))return gn(e);var t=[];for(var r in Object(e))mn.call(e,r)&&"constructor"!=r&&t.push(r);return t},_n=qe,bn=Gr;var xn=function(e){return null!=e&&bn(e.length)&&!_n(e)},wn=cn,Sn=yn,Tn=xn;var Mn=function(e){return Tn(e)?wn(e):Sn(e)},kn=Mr,En=Mn;var An=function(e,t){return e&&kn(t,En(t),e)};var In=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Cn=Ye,Pn=dn,Nn=In,On=Object.prototype.hasOwnProperty;var Rn=function(e){if(!Cn(e))return Nn(e);var t=Pn(e),r=[];for(var n in e)"constructor"==n&&(t||!On.call(e,n))||r.push(n);return r},Dn=cn,Ln=Rn,jn=xn;var zn=function(e){return jn(e)?Dn(e,!0):Ln(e)},Bn=Mr,Fn=zn;var Un=function(e,t){return e&&Bn(t,Fn(t),e)},Wn={exports:{}};!function(e,t){var r=ae,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n?r.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}}(Wn,Wn.exports);var Gn=Wn.exports;var Vn=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return x(this,r),(e=t.call(this,n,i,o)).x=n,e.y=i,e.z=o,e.v=a,e.t=s,e.a=u,e}return S(r,[{key:"setA",value:function(e){this.a=e}},{key:"setT",value:function(e){this.t=e}},{key:"setv",value:function(e){return this.v={x:e.x,y:e.y},this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.v,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.a;return this.x=e,this.y=t,this.z=r,this.v=n,this.t=i,this.a=o,this}},{key:"clone",value:function(){var e=this.x,t=this.y,n=this.z,i=this.v,o=this.t,a=this.a;return new r(e,t,n,{x:i.x,y:i.y},o,a)}},{key:"distance",value:function(e){return r.GetDistance(this,e)}},{key:"isNear",value:function(e,t){return r.IsNear(this,e,t)}},{key:"getAngleByPoints",value:function(e,t){return r.GetAngleByPoints(e,this,t)}},{key:"timestamp",get:function(){return this.t}},{key:"pressure",get:function(){return this.z}},{key:"angleNum",get:function(){return this.a}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Sub",value:function(e,t){return new r(e.x-t.x,e.y-t.y)}},{key:"Add",value:function(e,t){return new r(e.x+t.x,e.y+t.y)}},{key:"GetDistance",value:function(e,t){return r.Len(e.clone().sub(t))}},{key:"GetAngleByPoints",value:function(e,t,r){var n=t.x-e.x,i=r.x-t.x,o=t.y-e.y,a=r.y-t.y,s=0,u=Math.sqrt(n*n+o*o),l=Math.sqrt(i*i+a*a);if(u&&l){var c=n*i+o*a,h=n*a-o*i;s=180+(h=h>0?1:-1)*(s=(s=Math.acos(c/(u*l)))/Math.PI*180)}return s}},{key:"IsNear",value:function(e,t,n){return r.Len(e.clone().sub(t))3&&void 0!==arguments[3]?arguments[3]:2,o=e.x-t.x,a=e.y-t.y,s=Math.sin(n),u=Math.cos(n),l=Math.pow(10,i),c=Math.floor((t.x+(o*u-a*s))*l)/l,h=Math.floor((t.y+(o*s+a*u))*l)/l;return new r(c,h)}},{key:"GetDotStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,i=new J(1,1),o=Math.PI+.001,a=r.Add(e,r.Sub(e,i).uni().per().mul(-t)),s=[],u=1/n,l=u;l<=1;l+=u)s.push(r.RotWith(a,e,2*o*l));return s}},{key:"GetSemicircleStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,o=n*(Math.PI+.001),a=[],s=1/i,u=s;u<=1;u+=s)a.push(r.RotWith(t,e,o*u));return a}}]),r}(J);function ha(e){return JSON.parse(A.decompress(e))}function da(e){return A.compress(JSON.stringify(e))}var fa=Object.keys,pa="++",va="selector";var ga=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var ma=function(e){return this.__data__.has(e)},ya=tr,_a=ga,ba=ma;function xa(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new ya;++ts))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var h=-1,d=!0,f=2&r?new Ta:void 0;for(o.set(e,t),o.set(t,e);++h1&&void 0!==arguments[1]?arguments[1]:0,r={x:0,y:0,w:0,h:0},n=1/0,i=1/0,o=-1/0,a=-1/0;return e.forEach((function(e){var r=d(e.XY,2),s=r[0],u=r[1];n=Math.min(n,s-t),i=Math.min(i,u-t),o=Math.max(o,s+t),a=Math.max(a,u+t)})),r.x=n,r.y=i,r.w=o-n,r.h=a-i,r}function ds(e,t){return e[0]>=t.x&&e[0]<=t.x+t.w&&e[1]>=t.y&&e[1]<=t.y+t.h}function fs(e){return+e.toFixed(4)}var ps=function(e,t){return new Promise((function(e){window.requestIdleCallback?requestIdleCallback((function(){e(1)}),{timeout:t}):setTimeout((function(){e(2)}),t)})).then((function(){e()}),(function(){e()}))},vs=function(e){var t=(null==e?void 0:e.webkitBackingStorePixelRatio)||(null==e?void 0:e.mozBackingStorePixelRatio)||(null==e?void 0:e.msBackingStorePixelRatio)||(null==e?void 0:e.oBackingStorePixelRatio)||(null==e?void 0:e.backingStorePixelRatio)||1;return Math.max(1,(window.devicePixelRatio||1)/t)};var gs=function(e){v(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),o=t.call(this,e,n),k(_(o),"namespace"),k(_(o),"serviceStorage",{}),k(_(o),"storage",{}),k(_(o),"stateDisposer"),k(_(o),"asyncClockState",!1),r.syncInterval=.5*(i||r.syncInterval),o.namespace=r.namespace,o.serviceStorage=o.getNamespaceData(),o.storage=C.cloneDeep(o.serviceStorage),o}return S(r,[{key:"getViewIdBySecenPath",value:function(e){for(var t=this.getNamespaceData(),r=0,n=Object.entries(t);r0)){r.next=17;break}l.diffView=a,c=0,h=Object.entries(a);case 6:if(!(c0)){r.next=34;break}l.diffScenePath=s,g=0,m=Object.entries(s);case 20:if(!(g0)){r.next=53;break}l.diffData=u,T=0,M=Object.entries(u);case 37:if(!(T0&&e(l);case 54:case"end":return r.stop()}}),r)}))))}},{key:"removeStorageStateListener",value:function(){this.stateDisposer&&this.stateDisposer()}},{key:"diffFunByView",value:function(e,t){var r,n=fa(e),i=fa(t),o={},a={},s={},u=h(i);try{for(u.s();!(r=u.n()).done;){var l=r.value;n.includes(l)&&void 0!==e[l]||(o[l]={newValue:t[l],oldValue:void 0})}}catch(e){u.e(e)}finally{u.f()}var c,d=h(n);try{for(d.s();!(c=d.n()).done;){var f=c.value;if(!C.isEqual(e[f],t[f]))if(i.includes(f)&&void 0!==t[f]){var p=this.diffFunByScenePath(e[f],t[f],f);Object.assign(a,p.diffScenePath),Object.assign(s,p.diffData)}else o[f]={newValue:void 0,oldValue:e[f]}}}catch(e){d.e(e)}finally{d.f()}return{diffData:s,diffScenePath:a,diffView:o}}},{key:"diffFunByScenePath",value:function(e,t,r){var n,i=fa(e),o=fa(t),a={},s={},u=h(o);try{for(u.s();!(n=u.n()).done;){var l=n.value;i.includes(l)&&void 0!==e[l]||(a[l]={newValue:t[l],oldValue:void 0,viewId:r})}}catch(e){u.e(e)}finally{u.f()}var c,d=h(i);try{for(d.s();!(c=d.n()).done;){var f=c.value;if(!C.isEqual(e[f],t[f]))if(o.includes(f)&&void 0!==t[f]){var p=this.diffFunByKeys(e[f],t[f],f,r);Object.assign(s,p)}else a[f]={newValue:void 0,oldValue:e[f],viewId:r}}}catch(e){d.e(e)}finally{d.f()}return{diffScenePath:a,diffData:s}}},{key:"diffFunByKeys",value:function(e,t,r,n){var i,o=fa(e),a=fa(t),s={},u=h(a);try{for(u.s();!(i=u.n()).done;){var l=i.value;(!o.includes(l)||void 0===e[l])&&(s[l]={oldValue:void 0,newValue:t[l],viewId:n,scenePath:r})}}catch(e){u.e(e)}finally{u.f()}var c,d=h(o);try{for(d.s();!(c=d.n()).done;){var f=c.value;if(!C.isEqual(e[f],t[f])){if(!a.includes(f)||void 0===t[f]){s[f]={newValue:void 0,oldValue:e[f],viewId:n,scenePath:r};continue}a.includes(f)&&(s[f]={oldValue:e[f],newValue:t[f],viewId:n,scenePath:r})}}}catch(e){d.e(e)}finally{d.f()}return s}},{key:"transformKey",value:function(e){return this.uid+pa+e}},{key:"isOwn",value:function(e){return e.split(pa)[0]===this.uid}},{key:"dispatch",value:function(e){var t=this,r=e.type,n=e.workId,i=e.ops,o=e.index,a=e.opt,u=e.toolsType,l=e.removeIds,c=e.updateNodeOpt,h=e.op,d=e.selectIds,f=e.isSync,p=e.scenePath,v=e.viewId;if(v)switch(r){case V.Clear:var g={};p&&this.storage[v]&&this.storage[v][p]?(delete this.storage[v][p],this.setState(g,{isSync:f,viewId:v,scenePath:p})):this.storage[v]&&(delete this.storage[v],this.setState(g,{isSync:f,viewId:v,scenePath:""}));break;case V.CreateWork:if(p&&n&&u&&a){var m=this.isLocalId(n.toString())?this.transformKey(n):n;this.updateValue(m.toString(),{type:V.CreateWork,workId:n,toolsType:u,opt:a},{isSync:f,viewId:v,scenePath:p})}break;case V.DrawWork:if(p&&n&&"number"==typeof o&&null!=h&&h.length){var y=this.isLocalId(n.toString())?this.transformKey(n):n,_=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][y]||void 0;if(null!=_&&_.ops||(null==_?void 0:_.type)===V.FullWork)return;var b=o?((null==_?void 0:_.op)||[]).slice(0,o).concat(h):h||(null==_?void 0:_.op),x=u||(null==_?void 0:_.toolsType),w=a||(null==_?void 0:_.opt),S=c||(null==_?void 0:_.updateNodeOpt);n&&x&&w&&b&&this.updateValue(y.toString(),s(s({},_),{},{type:V.DrawWork,workId:n,updateNodeOpt:S,toolsType:x,opt:w,op:b,index:o}),{isSync:f,viewId:v,scenePath:p})}break;case V.FullWork:if(p&&n){var T=this.isLocalId(n.toString())?this.transformKey(n):n,M=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][T]||void 0,k=c||(null==M?void 0:M.updateNodeOpt),E=u||(null==M?void 0:M.toolsType),A=a||(null==M?void 0:M.opt),I=i||(null==M?void 0:M.ops);E&&A&&this.updateValue(T.toString(),{type:V.FullWork,updateNodeOpt:k,workId:T,toolsType:E,opt:A,ops:I},{isSync:f,viewId:v,scenePath:p})}break;case V.RemoveNode:if(p&&null!=l&&l.length){var C=l.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e}));this.storage[v]&&this.storage[v][p]&&Object.keys(this.storage[v][p]).map((function(e){null!=C&&C.includes(e)&&t.updateValue(e,void 0,{isSync:f,viewId:v,scenePath:p})}))}break;case V.UpdateNode:if(p&&n&&(c||i||a)){var P=this.isLocalId(n.toString())?this.transformKey(n):n,N=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][P]||void 0;N&&(N.updateNodeOpt=c,(i||h)&&(N.ops=i,N.op=h),a&&(N.opt=a),N.type=V.FullWork,this.updateValue(P.toString(),N,{isSync:f,viewId:v,scenePath:p}))}break;case V.Select:if(!p)return;var O;null!=d&&d.length&&(O=d.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e})));var R=this.transformKey(va),D=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][R]||void 0,L=a||(null==D?void 0:D.opt);O&&this.checkOtherSelector(R,O,{isSync:f,viewId:v,scenePath:p}),this.updateValue(R,O&&{type:V.Select,toolsType:U.Selector,opt:L,selectIds:O},{isSync:f,viewId:v,scenePath:p})}}},{key:"checkOtherSelector",value:function(e,t,r){for(var n=r.viewId,i=r.scenePath,o=0,a=Object.keys(this.storage[n][i]);o0&&(u.selectIds=l),this.updateValue(s,l.length&&u||void 0,r)}}}}},{key:"setState",value:function(e,t){for(var r=t.viewId,n=t.scenePath,i=fa(e),o=0;o0&&void 0!==arguments[0]&&arguments[0],r=fa(this.serviceStorage),n=fa(this.storage),i=new Map,o=h(r);try{for(o.s();!(e=o.n()).done;){var a=e.value;n.includes(a)?C.isEqual(this.serviceStorage[a],this.storage[a])||this.syncViewData(a,t):i.set(a,void 0)}}catch(e){o.e(e)}finally{o.f()}var s,u=h(n);try{for(u.s();!(s=u.n()).done;){var l=s.value;r.includes(l)||i.set(l,this.storage[l])}}catch(e){u.e(e)}finally{u.f()}if(i.size>5)this.syncStorageView(this.storage,t);else{var c,f=h(i.entries());try{for(f.s();!(c=f.n()).done;){var p=d(c.value,2),v=p[0],g=p[1];this.syncUpdataView(v,g,t)}}catch(e){f.e(e)}finally{f.f()}}}},{key:"syncViewData",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=fa(this.serviceStorage[e]),i=fa(this.storage[e]),o=new Map,a=h(n);try{for(a.s();!(t=a.n()).done;){var s=t.value;i.includes(s)?C.isEqual(this.serviceStorage[e][s],this.storage[e][s])||this.syncScenePathData(e,s,r):o.set(s,void 0)}}catch(e){a.e(e)}finally{a.f()}var u,l=h(i);try{for(l.s();!(u=l.n()).done;){var c=u.value;n.includes(c)||o.set(c,this.storage[e][c])}}catch(e){l.e(e)}finally{l.f()}if(o.size>5)this.syncStorageScenePath(e,this.storage[e],r);else{var f,p=h(o.entries());try{for(p.s();!(f=p.n()).done;){var v=d(f.value,2),g=v[0],m=v[1];this.syncUpdataScenePath(e,g,m,r)}}catch(e){p.e(e)}finally{p.f()}}}},{key:"syncScenePathData",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=fa(this.serviceStorage[e][t]),o=fa(this.storage[e][t]),a=new Map,s=h(i);try{for(s.s();!(r=s.n()).done;){var u=r.value;o.includes(u)?C.isEqual(this.serviceStorage[e][t][u],this.storage[e][t][u])||a.set(u,this.storage[e][t][u]):a.set(u,void 0)}}catch(e){s.e(e)}finally{s.f()}var l,c=h(o);try{for(c.s();!(l=c.n()).done;){var f=l.value;i.includes(f)||a.set(f,this.storage[e][t][f])}}catch(e){c.e(e)}finally{c.f()}if(a.size>5)this.syncStorageKey(e,t,this.storage[e][t],n);else{var p,v=h(a.entries());try{for(v.s();!(p=v.n()).done;){var g=d(p.value,2),m=g[0],y=g[1];this.syncUpdataKey(e,t,m,y,n)}}catch(e){v.e(e)}finally{v.f()}}}},{key:"syncUpdataView",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(this.serviceStorage).length?(n||(void 0===t?delete this.serviceStorage[e]:this.serviceStorage[e]=C.cloneDeep(t)),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)):this.syncStorageView(this.storage,n)}},{key:"syncStorageView",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r||e&&(this.serviceStorage=C.cloneDeep(e)),null==(t=this.plugin)||t.updateAttributes([this.namespace],e)}},{key:"syncUpdataScenePath",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.keys(this.serviceStorage[e]).length?(i||(void 0===r?delete this.serviceStorage[e][t]:this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)):this.syncStorageScenePath(e,this.storage[e],i)}},{key:"syncStorageScenePath",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n||t&&(this.serviceStorage[e]=t),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)}},{key:"syncUpdataKey",value:function(e,t,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object.keys(this.serviceStorage[e][t]).length?(o||(void 0===n?delete this.serviceStorage[e][t][r]:this.serviceStorage[e][t][r]=n),null==(i=this.plugin)||i.updateAttributes([this.namespace,e,t,r],n)):this.syncStorageKey(e,t,this.storage[e][t],o)}},{key:"syncStorageKey",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i||(this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)}},{key:"keyTransformWorkId",value:function(e){var t=e.split(pa);return 2===t.length?t[1]:e}},{key:"destroy",value:function(){this.removeStorageStateListener(),this.serviceStorage={},this.storage={}}}]),r}(function(){function e(t,r){x(this,e),k(this,"plugin"),k(this,"uid"),k(this,"control"),this.control=t,this.plugin=r,this.uid=r.displayer.uid}return S(e,[{key:"getNamespaceData",value:function(){var e;return E.toJS(null==(e=this.plugin)?void 0:e.attributes[this.namespace])||{}}},{key:"getUidFromKey",value:function(e){return 2===e.split(pa).length&&e.split(pa)[0]||this.uid}},{key:"isLocalId",value:function(e){return 1===e.split(pa).length}},{key:"getLocalId",value:function(e){return e.split(pa)[1]}},{key:"isSelector",value:function(e){return this.getLocalId(e)===va}}]),e}());k(gs,"namespace","PluginState"),k(gs,"syncInterval",500);var ms=gs,ys=function(){function e(){x(this,e),k(this,"roomMembers",[]),k(this,"onChangeHooks",new Set)}return S(e,[{key:"setRoomMembers",value:function(e){this.executChangeUidHook(this.roomMembers,e),this.roomMembers=e}},{key:"executChangeUidHook",value:function(e,t){var r={online:t.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session})),offline:e.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session}))};this.onChangeHooks.forEach((function(e){return e(r)}))}},{key:"getRoomMember",value:function(e){return this.roomMembers.find((function(t){var r;return(null==(r=t.payload)?void 0:r.uid)===e}))}},{key:"isOnLine",value:function(e){return!this.getRoomMember(e)}},{key:"onUidChangeHook",value:function(e){this.onChangeHooks.add(e)}},{key:"destroy",value:function(){this.onChangeHooks.clear()}}]),e}(),_s=function(e){return e[e.Text=1]="Text",e[e.Shape=2]="Shape",e}(_s||{}),bs="mainView",xs=function(){function e(){x(this,e)}return S(e,[{key:"createProxy",value:function(t){var r=new Proxy(t,{get:function(t,r,n){var i=e.interceptors.hasOwnProperty(r)?e.interceptors:t;return Reflect.get(i,r,n)}});return e.proxyToRaw.set(r,t),r}}]),e}();k(xs,"proxyToRaw",new WeakMap),k(xs,"interceptors",{entries:function(){var e;return(e=xs.proxyToRaw.get(this)).entries.apply(e,arguments)},forEach:function(){var e;return(e=xs.proxyToRaw.get(this)).forEach.apply(e,arguments)},size:function(){return xs.proxyToRaw.get(this).size},get:function(e){return xs.proxyToRaw.get(this).get(e)},set:function(e,t){return xs.proxyToRaw.get(this).set(e,t)},delete:function(e,t){return xs.proxyToRaw.get(this).delete(e)},clear:function(){return xs.proxyToRaw.get(this).clear()}});var ws=xs,Ss=function(){function e(t){x(this,e),k(this,"internalMsgEmitter"),k(this,"control"),k(this,"editors"),k(this,"activeId"),k(this,"proxyMap"),k(this,"taskqueue",new Map);var r=t.control,n=t.internalMsgEmitter;this.control=r,this.internalMsgEmitter=n;var i=new Map;this.proxyMap=new ws;var o=this,a=ws.interceptors.set;ws.interceptors.set=function(e,t){return o.interceptors.set(e,t),a.call(this,e,t)};var s=ws.interceptors.delete;ws.interceptors.delete=function(e,t){return o.interceptors.delete(e,t),s.call(this,e)},this.editors=this.proxyMap.createProxy(i)}var t;return S(e,[{key:"filterEditor",value:function(e){var t=new Map;return this.editors.forEach((function(r,n){r.viewId===e&&t.set(n,r)})),t}},{key:"computeTextActive",value:function(e,t){var r,n,i,o,a=null==(r=this.control.viewContainerManager)?void 0:r.transformToScenePoint(e,t),s=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);t&&s&&(null==(i=this.control.worker)||i.taskBatchData.add({msgType:V.GetTextActive,dataType:W.Local,op:a,viewId:t,scenePath:s}),null==(o=this.control.worker)||o.runAnimation())}},{key:"checkEmptyTextBlur",value:function(){var e,t,r=this.activeId,n=h(this.editors.entries());try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];if(a.opt.uid&&a.opt.uid===(null==(e=this.collector)?void 0:e.uid)){r=o;break}}}catch(e){n.e(e)}finally{n.f()}if(r){var s=this.editors.get(r);(null==s?void 0:s.opt.text)&&(null==s?void 0:s.opt.text.replace(/\s*,/g,""))?this.unActive(r):this.delete(r,!0,!0)}}},{key:"onCameraChange",value:function(e,t){var r,n,i,o=h(this.editors.entries());try{for(o.s();!(i=o.n()).done;){var a=d(i.value,2),s=a[0],u=a[1];if(u.viewId===t){var l=u.opt,c=l.boxPoint,f=l.boxSize,p=c&&(null==(r=this.control.viewContainerManager)?void 0:r.transformToOriginPoint(c,u.viewId)),v=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);if(v&&t){var g={x:p&&p[0]||0,y:p&&p[1]||0,w:f&&f[0]||0,h:f&&f[1]||0,opt:u.opt,scale:e.scale,type:_s.Text,viewId:t,scenePath:v,canWorker:!1,canSync:!1};this.editors.set(s,g),this.control.viewContainerManager.setActiveTextEditor(t,this.activeId)}}}}catch(e){o.e(e)}finally{o.f()}}},{key:"onServiceDerive",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.msgType,a=e.viewId,s=e.scenePath,u=e.dataType;if(n&&a&&s){var l=n.toString();if(o!==V.RemoveNode){var c=i.boxPoint,h=i.boxSize,d=c&&(null==(t=this.control.viewContainerManager)?void 0:t.transformToOriginPoint(c,a)),f=this.control.viewContainerManager.getView(a),p={x:d&&d[0]||0,y:d&&d[1]||0,w:h&&h[0]||0,h:h&&h[1]||0,opt:i,type:_s.Text,canWorker:!0,canSync:!1,dataType:u,scale:(null==(r=null==f?void 0:f.cameraOpt)?void 0:r.scale)||1,viewId:a,scenePath:s};this.editors.set(l,p),u===W.Service&&i.workState===G.Done&&this.activeId===l&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(a,this.activeId)}else this.delete(l,!0,!0)}}},{key:"updateForViewEdited",value:function(e,t){var r;this.editors.set(e,t);var n=null==(r=this.taskqueue.get(e))?void 0:r.resolve;n&&n(t)}},{key:"active",value:function(e){var t,r=this.editors.get(e);r&&r.viewId&&(r.opt.workState=G.Start,r.opt.uid=null==(t=this.collector)?void 0:t.uid,this.activeId=e,r.canWorker=!0,r.canSync=!0,this.editors.set(e,r),this.control.viewContainerManager.setActiveTextEditor(r.viewId,this.activeId))}},{key:"unActive",value:function(e){var t=this.editors.get(e);t&&t.viewId&&(t.opt.workState=G.Done,t.opt.uid=void 0,t.canWorker=!0,t.canSync=!0,this.editors.set(e,t),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(t.viewId,this.activeId))}},{key:"createTextForMasterController",value:function(e,t){var r,n=e.workId,i=e.isActive,a=o(e,["workId","isActive"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,a.viewId),a.opt.uid=null==(r=this.collector)?void 0:r.uid,i&&(this.activeId=n),a.dataType=W.Local,a.canWorker=!0,a.canSync=!0,this.editors.set(n,a),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId)}},{key:"updateTextForMasterController",value:function(e,t){var r,n=e.workId,i=o(e,["workId"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,i.viewId);var a=this.editors.get(n)||{};i.opt&&(i.opt.uid=null==(r=this.collector)?void 0:r.uid),i.dataType=W.Local,this.editors.set(n,s(s({},a),i)),this.control.viewContainerManager.setActiveTextEditor(i.viewId,this.activeId)}},{key:"updateTextControllerWithEffectAsync",value:(t=c(regeneratorRuntime.mark((function e(t,r){var n,i,a,u,l,c,h,d,f,p=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.workId,a=o(t,["workId"]),r&&this.internalMsgEmitter.emit("addUndoTicker",r,a.viewId),u=this.editors.get(i)||{},a.opt&&(a.opt.uid=null==(n=this.collector)?void 0:n.uid),a.dataType=W.Local,l=s(s({},u),a),this.editors.set(i,l),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId),!this.taskqueue.has(i)){e.next=11;break}return(c=this.taskqueue.get(i))&&(c.clocker&&clearTimeout(c.clocker),this.taskqueue.delete(i)),e.next=10,this.updateTextControllerWithEffectAsync(t);case 10:return e.abrupt("return",e.sent);case 11:return h=setTimeout((function(){var e,t=null==(e=p.taskqueue.get(i))?void 0:e.resolve;t&&t(l)}),50),e.next=14,new Promise((function(e){p.taskqueue.set(i,{resolve:e,clocker:h})}));case 14:return d=e.sent,f=this.taskqueue.get(i),e.abrupt("return",(f&&(f.clocker&&clearTimeout(f.clocker),this.taskqueue.delete(i)),d));case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"updateTextForWorker",value:function(e,t){var r=e.workId,n=e.isActive,i=o(e,["workId","isActive"]),a=s(s({},this.editors.get(r)||{}),i);if(n)return a.canWorker=!1,a.canSync=!1,this.editors.set(r,a),void this.active(r);this.editors.set(r,a),this.control.viewContainerManager.setActiveTextEditor(i.viewId,this.activeId),t&&this.internalMsgEmitter.emit("addUndoTicker",t,i.viewId)}},{key:"get",value:function(e){return this.editors.get(e)}},{key:"delete",value:function(e,t,r){var n=this.editors.get(e);if(n){var i=n.viewId;n.canSync=t,n.canWorker=r,this.editors.delete(e),this.activeId===e&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(i,this.activeId)}}},{key:"deleteBatch",value:function(e,t,r){var n,i=new Set,o=h(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.editors.get(a);if(s){var u=s.viewId;s.canSync=t,s.canWorker=r,this.editors.delete(a),this.activeId===a&&(this.activeId=void 0),i.add(u)}}}catch(e){o.e(e)}finally{o.f()}var l,c=h(i);try{for(c.s();!(l=c.n()).done;){var d=l.value;this.control.viewContainerManager.setActiveTextEditor(d,this.activeId)}}catch(e){c.e(e)}finally{c.f()}}},{key:"clear",value:function(e,t){var r=this;this.editors.forEach((function(n,i){n.viewId===e&&(t&&(n.canSync=!1),n.canWorker=!1,r.editors.delete(i))})),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(e,this.activeId)}},{key:"destory",value:function(){this.editors.clear(),this.activeId=void 0}},{key:"collector",get:function(){return this.control.collector}},{key:"interceptors",get:function(){var e=this;return{set:function(t,r){var n,i,o,a,s,u,l,c;if(!e.collector)return!0;var h=r.viewId,d=r.scenePath,f=r.canSync,p=r.canWorker,v=r.type,g=r.opt,m=r.dataType;if(!p&&!f)return!0;var y=(null==(n=e.collector)?void 0:n.isLocalId(t))?null==(i=e.collector)?void 0:i.transformKey(t):t,_=(null==(o=e.collector)?void 0:o.storage[h])&&e.collector.storage[h][d]&&e.collector.storage[h][d][y]||void 0;_?_.toolsType===U.Text&&(p&&(e.control.worker.queryTaskBatchData({workId:t,msgType:V.UpdateNode}).forEach((function(t){var r;null==(r=e.control.worker)||r.taskBatchData.delete(t)})),null==(l=e.control.worker)||l.taskBatchData.add({workId:t,msgType:V.UpdateNode,dataType:m||W.Local,toolsType:U.Text,opt:g,viewId:h,scenePath:d,willRefresh:!0}),null==(c=e.control.worker)||c.runAnimation()),f&&ps((function(){var r;null==(r=e.collector)||r.dispatch({type:V.UpdateNode,workId:t,toolsType:U.Text,opt:g,viewId:h,scenePath:d})}),e.control.worker.maxLastSyncTime)):v===_s.Text&&(f&&(null==(a=e.collector)||a.dispatch({type:g.text&&V.FullWork||V.CreateWork,workId:t,toolsType:U.Text,opt:g,isSync:!0,viewId:h,scenePath:d})),p&&(null==(s=e.control.worker)||s.taskBatchData.add({workId:t,msgType:g.text&&V.FullWork||V.CreateWork,dataType:m||W.Local,toolsType:U.Text,opt:g,viewId:h,scenePath:d,willRefresh:!0}),null==(u=e.control.worker)||u.runAnimation()))},delete:function(t){var r,n;if(!e.collector)return!0;var i=e.editors.get(t);if(!i)return!0;var o=i.viewId,a=i.scenePath,s=i.canSync,u=i.canWorker;if(!u&&!s)return!0;u&&(null==(r=e.control.worker)||r.taskBatchData.add({workId:t,toolsType:U.Text,msgType:V.RemoveNode,dataType:W.Local,viewId:o,scenePath:a,willRefresh:!0}),null==(n=e.control.worker)||n.runAnimation()),s&&ps((function(){var r;null==(r=e.collector)||r.dispatch({type:V.RemoveNode,removeIds:[t],toolsType:U.Text,viewId:o,scenePath:a})}),e.control.worker.maxLastSyncTime)},clear:function(){return!0}}}}]),e}(),Ts=function(){function e(t){var r,n;x(this,e),k(this,"expirationTime",la.cursor.expirationTime),k(this,"internalMsgEmitter"),k(this,"control"),k(this,"eventName","applianc-cursor"),k(this,"displayer"),k(this,"roomMember"),k(this,"animationId"),k(this,"maxLastSyncTime",la.syncOpt.interval),k(this,"willSendEventWorkers",[]),k(this,"willConsumeEventWorkers",new Map),k(this,"sendEventTimerId"),k(this,"animationDrawWorkers",new Map),k(this,"animationEventWorkers",new Map),k(this,"cursorInfoMap",new Map),k(this,"doneRenderCursorInfoMap",new Map),k(this,"eventCollector");var i=t.control,o=t.internalMsgEmitter;this.internalMsgEmitter=o,this.control=i,this.roomMember=i.roomMember,this.maxLastSyncTime=(null==(n=null==(r=this.control.pluginOptions)?void 0:r.syncOpt)?void 0:n.interval)||this.maxLastSyncTime}return S(e,[{key:"activeCollector",value:function(){this.control.plugin&&(this.displayer=this.control.room||this.control.play,this.displayer.addMagixEventListener(this.eventName,this.mainMagixEventListener.bind(this)))}},{key:"mainMagixEventListener",value:function(e){var t,r=e.event,n=e.payload;if(r===this.eventName){var i=n.uid,o=n.op,a=n.type;if((null==(t=this.control.collector)?void 0:t.uid)!==i&&a===$.Cursor&&null!=o&&o.length){var u,l=this.willConsumeEventWorkers.get(i)||[],c=h(o);try{for(c.s();!(u=c.n()).done;){var d=u.value,f=d.viewId;C.isNumber(d.consumPoint[0])&&C.isNumber(d.consumPoint[1])&&(d.consumPoint=this.control.viewContainerManager.transformToOriginPoint(d.consumPoint,f)),l.unshift(s(s({},d),{},{timestamp:Date.now()}))}}catch(e){c.e(e)}finally{c.f()}this.willConsumeEventWorkers.set(i,l),this.runAnimation()}}}},{key:"onFocusViewChange",value:function(){this.checkDrawWorks(),this.runAnimation()}},{key:"updateRoomMembers",value:function(e){var t,r=e.offline,n=h(this.cursorInfoMap.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;i&&r.includes(i)&&this.cursorInfoMap.delete(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"getKey",value:function(e,t){return"".concat(e).concat(pa).concat(t)}},{key:"getUidAndviewId",value:function(e){var t=d(e.split(pa),2);return{uid:t[0],viewId:t[1]}}},{key:"runAnimation",value:function(){this.animationId||(this.animationId=requestAnimationFrame(this.animationCursor.bind(this)))}},{key:"checkDrawWorks",value:function(){var e,t,r=this.control.viewContainerManager.focuedViewId,n=h(this.animationDrawWorkers.entries());try{for(n.s();!(t=n.n()).done;){var i=d(t.value,2),o=i[0],a=i[1],s=this.getUidAndviewId(o),u=s.viewId;s.uid!==(null==(e=this.control.collector)?void 0:e.uid)&&u!==r&&a.workState===G.Done&&(a.consumPoint=[void 0,void 0])}}catch(e){n.e(e)}finally{n.f()}}},{key:"animationCursor",value:function(){this.animationId=void 0;var e,t=Date.now(),r=h(this.animationDrawWorkers.entries());try{for(r.s();!(e=r.n()).done;){var n=d(e.value,2),i=n[0],a=n[1],s=this.getUidAndviewId(i),u=s.uid,l=s.viewId,c=this.roomMember.getRoomMember(u);if(c){var f=a.consumPoint,p=a.timestamp,v=a.workState,g=this.cursorInfoMap.get(l)||new Map;f&&C.isNumber(f[0])&&C.isNumber(f[1])&&p+this.expirationTime>t?g.set(c.memberId,{x:f[0],y:f[1],roomMember:c,timestamp:p,type:1,workState:v}):g.delete(c.memberId),g.size?this.cursorInfoMap.set(l,g):this.cursorInfoMap.delete(l),this.animationDrawWorkers.delete(i)}else this.animationDrawWorkers.delete(i)}}catch(e){r.e(e)}finally{r.f()}var m,y=new Set,_=h(this.cursorInfoMap.entries());try{for(_.s();!(m=_.n()).done;){var b=d(m.value,2),x=b[0],w=b[1];if(w){var S,T=h(w.entries());try{for(T.s();!(S=T.n()).done;){var M=d(S.value,2),k=M[0],E=M[1];1===E.type&&E.workState!==G.Done&&y.add(k)}}catch(e){T.e(e)}finally{T.f()}}else this.cursorInfoMap.delete(x)}}catch(e){_.e(e)}finally{_.f()}var A,I=h(this.willConsumeEventWorkers.entries());try{for(I.s();!(A=I.n()).done;){var P=d(A.value,2),N=P[0],O=P[1],R=this.roomMember.getRoomMember(N);if(null!=R&&R.memberId&&!y.has(R.memberId)){var D=O.pop();D?this.animationEventWorkers.set(N,D):this.willConsumeEventWorkers.delete(N)}}}catch(e){I.e(e)}finally{I.f()}var L,j=h(this.animationEventWorkers.entries());try{for(j.s();!(L=j.n()).done;){var z=d(L.value,2),F=z[0],U=z[1],W=this.roomMember.getRoomMember(F);if(W){var V=U.viewId,H=U.consumPoint,Y=U.timestamp,$=this.cursorInfoMap.get(V)||new Map;H&&C.isNumber(H[0])&&C.isNumber(H[1])&&Y+this.expirationTime>t?$.set(W.memberId,{x:H[0],y:H[1],roomMember:W,timestamp:Y,type:0}):$.delete(W.memberId),$.size?this.cursorInfoMap.set(V,$):this.cursorInfoMap.delete(V),this.animationEventWorkers.delete(F)}else this.animationEventWorkers.delete(F)}}catch(e){j.e(e)}finally{j.f()}var X,q=h(this.doneRenderCursorInfoMap.keys());try{for(q.s();!(X=q.n()).done;){var Q=X.value;this.cursorInfoMap.has(Q)||(this.doneRenderCursorInfoMap.delete(Q),this.internalMsgEmitter.emit([B.Cursor,Q],[]))}}catch(e){q.e(e)}finally{q.f()}var Z,K=h(this.cursorInfoMap.entries());try{for(K.s();!(Z=K.n()).done;){var J=d(Z.value,2),ee=J[0],te=J[1];if(null!=te&&te.size){var re,ne=[],ie=h(te.entries());try{for(ie.s();!(re=ie.n()).done;){var oe=d(re.value,2),ae=oe[0],se=oe[1],ue=se.timestamp,le=o(se,["timestamp"]);ue+this.expirationTime>t?ne.push(le):(te.delete(ae),0===te.size&&(this.cursorInfoMap.delete(ee),this.doneRenderCursorInfoMap.delete(ee),this.internalMsgEmitter.emit([B.Cursor,ee],[])))}}catch(e){ie.e(e)}finally{ie.f()}var ce=this.doneRenderCursorInfoMap.get(ee);C.isEqual(ce,ne)||(this.doneRenderCursorInfoMap.set(ee,ne),this.internalMsgEmitter.emit([B.Cursor,ee],ne))}else this.cursorInfoMap.delete(ee),this.doneRenderCursorInfoMap.delete(ee),this.internalMsgEmitter.emit([B.Cursor,ee],[])}}catch(e){K.e(e)}finally{K.f()}(this.willConsumeEventWorkers.size||this.cursorInfoMap.size)&&this.runAnimation()}},{key:"sendEvent",value:function(e,t){var r=this;if(this.displayer&&E.isRoom(this.displayer)){var n=C.isNumber(e[0])&&C.isNumber(e[1])&&this.control.viewContainerManager.transformToScenePoint(e,t)||[void 0,void 0];this.willSendEventWorkers.push({consumPoint:n,viewId:t}),this.sendEventTimerId||(this.sendEventTimerId=setTimeout((function(){r.dispatchMagixEvent()}),this.maxLastSyncTime))}}},{key:"dispatchMagixEvent",value:function(){var e;this.displayer.dispatchMagixEvent(this.eventName,{type:$.Cursor,op:C.cloneDeep(this.willSendEventWorkers),uid:null==(e=this.control.collector)?void 0:e.uid}),this.willSendEventWorkers.length=0,this.sendEventTimerId&&(clearTimeout(this.sendEventTimerId),this.sendEventTimerId=void 0)}},{key:"collectServiceCursor",value:function(e){var t,r=e.op,n=e.uid,i=e.workState,o=e.viewId;if(n&&r&&i&&o){if(!this.roomMember.getRoomMember(n)||n===(null==(t=this.control.collector)?void 0:t.uid))return;var a=this.getKey(n,o),s=this.control.viewContainerManager.focuedViewId,u=[void 0,void 0];if(C.isNumber(r[0])&&C.isNumber(r[1])){var l=d(this.control.viewContainerManager.transformToOriginPoint(r,o),2);u=[l[0],l[1]]}i===G.Done&&s!==o&&(u=[void 0,void 0]);var c={consumPoint:u,workState:i,viewId:o,timestamp:Date.now()};if(i===G.Start||i===G.Done){var h=this.willConsumeEventWorkers.get(n);i===G.Start&&h&&this.willConsumeEventWorkers.delete(n),h&&i===G.Done&&(c.timestamp=c.timestamp-this.expirationTime)}this.animationDrawWorkers.set(a,c),this.runAnimation()}}},{key:"unabled",value:function(){var e;this.displayer&&E.isRoom(this.displayer)&&(this.willSendEventWorkers.length=0,this.displayer.dispatchMagixEvent(this.eventName,{type:$.Cursor,op:[{viewId:this.control.viewContainerManager.focuedViewId,consumPoint:[void 0,void 0]}],uid:null==(e=this.control.collector)?void 0:e.uid}),this.sendEventTimerId&&(clearTimeout(this.sendEventTimerId),this.sendEventTimerId=void 0))}},{key:"clearViewCursor",value:function(e){var t,r,n,i,o=h(this.animationDrawWorkers.entries());try{for(o.s();!(i=o.n()).done;){var a=d(i.value,1)[0];this.getUidAndviewId(a).uid===(null==(t=this.control.collector)?void 0:t.uid)&&e==e&&this.animationDrawWorkers.delete(a)}}catch(e){o.e(e)}finally{o.f()}var s,u=h(this.willConsumeEventWorkers.entries());try{for(u.s();!(s=u.n()).done;){var l=d(s.value,1)[0];l===(null==(r=this.control.collector)?void 0:r.uid)&&this.willConsumeEventWorkers.delete(l)}}catch(e){u.e(e)}finally{u.f()}var c,f=h(this.animationEventWorkers.entries());try{for(f.s();!(c=f.n()).done;){var p=d(c.value,1)[0];p===(null==(n=this.control.collector)?void 0:n.uid)&&this.animationEventWorkers.delete(p)}}catch(e){f.e(e)}finally{f.f()}var v,g=h(this.cursorInfoMap.entries());try{for(g.s();!(v=g.n()).done;){var m=d(v.value,1)[0];m==m&&(this.cursorInfoMap.delete(m),this.doneRenderCursorInfoMap.delete(m),this.internalMsgEmitter.emit([B.Cursor,m],[]))}}catch(e){g.e(e)}finally{g.f()}}},{key:"stopAnimation",value:function(){this.animationDrawWorkers.clear(),this.willConsumeEventWorkers.clear(),this.cursorInfoMap.clear()}},{key:"destroy",value:function(){var e;null==(e=this.displayer)||e.removeMagixEventListener(this.eventName),this.stopAnimation()}}]),e}(),Ms=function(){function e(){x(this,e),k(this,"useEmtMsg"),k(this,"emtType"),k(this,"control"),k(this,"mainEngine")}return S(e,[{key:"registerForMainEngine",value:function(e,t){return this.emtType=e,this.control=t,this.mainEngine=t.worker,this.mainEngine.internalMsgEmitter.on([this.emtType,this.emitEventType],this.collect.bind(this)),this}},{key:"destroy",value:function(){this.emtType&&this.mainEngine&&this.mainEngine.internalMsgEmitter.off([this.emtType,this.emitEventType],this.collect.bind(this))}},{key:"collectForLocalWorker",value:function(e,t){var r,n,i,o,a=this,s=h(e);try{for(s.s();!(o=s.n()).done;){var u=d(o.value,2),l=u[0],c=u[1];null==(r=this.mainEngine)||r.queryTaskBatchData(c).forEach((function(e){var t;null==(t=a.mainEngine)||t.taskBatchData.delete(e)})),null==(n=this.mainEngine)||n.taskBatchData.add(l)}}catch(e){s.e(e)}finally{s.f()}t?this.mainEngine.consume():null==(i=this.mainEngine)||i.runAnimation()}},{key:"collectForServiceWorker",value:function(e){var t=this;ps((function(){e.forEach((function(e){var r;null==(r=t.serviceColloctor)||r.dispatch(e)}))}),this.mainEngine.maxLastSyncTime)}},{key:"pause",value:function(){var e;if(this.lastEmtData){this.useEmtMsg=!0;var t=s(s({},this.lastEmtData),{},{workState:G.Done});this.collect(t,!0),null==(e=xu.InternalMsgEmitter)||e.emit(z.ActiveMethod,!1)}}},{key:"recover",value:function(){var e;this.useEmtMsg&&xu.InternalMsgEmitter.hasListeners(z.ActiveMethod)&&(null==(e=xu.InternalMsgEmitter)||e.emit(z.ActiveMethod,!0))}},{key:"serviceColloctor",get:function(){return this.control.collector}}],[{key:"dispatch",value:function(e,t,r){var n;null==(n=xu.InternalMsgEmitter)||n.emit([e,t],r)}}]),e}(),ks=function(e){v(r,e);var t=m(r);function r(){var e;return x(this,r),e=t.apply(this,arguments),k(_(e),"lastEmtData"),k(_(e),"emitEventType",z.CopyNode),e}return S(r,[{key:"collect",value:function(e){var t;if(this.serviceColloctor&&this.mainEngine){var r=e.workIds,n=e.viewId,i=this.control.viewContainerManager.getView(n);if(null!=i&&i.displayer){var o=i.focusScenePath,a=Date.now();this.mainEngine.internalMsgEmitter.emit("addUndoTicker",a,n);var u,l=h(r);try{for(l.s();!(u=l.n()).done;){var c=u.value,d=c.toString(),f=this.serviceColloctor.isLocalId(d)?this.serviceColloctor.transformKey(c):d,p=null==(t=this.serviceColloctor.getStorageData(n,o))?void 0:t[f];if(p){if(c===va){var v=p&&this.copySelector({viewId:n,store:p});v&&this.pasteSelector(s(s({},v),{},{viewId:n,scenePath:o,undoTickerId:a}));break}if(p.toolsType===U.Text&&p.opt&&p.opt.workState&&p.opt.workState!==G.Done){var g=p&&this.copyText({viewId:n,store:p});g&&this.pasteText(s(s({},g),{},{viewId:n,scenePath:o,key:f,store:p,undoTickerId:a}));break}}}}catch(e){l.e(e)}finally{l.f()}}}}},{key:"copyText",value:function(e){var t=e.viewId,r=e.store,n=this.control.viewContainerManager.getView(t);if(this.serviceColloctor&&n){var i=null==n?void 0:n.cameraOpt,o=i&&[i.centerX,i.centerY],a=r.opt;return{bgCenter:o,textCenter:a.boxPoint&&a.boxSize&&[a.boxPoint[0]+a.boxSize[0]/2,a.boxPoint[1]+a.boxSize[1]/2]}}}},{key:"pasteText",value:function(e){var t,r,n=e.bgCenter,i=e.textCenter,o=e.store,a=e.key,u=e.viewId,l=e.scenePath,c=e.undoTickerId,h=this.control.viewContainerManager.getView(u);if(this.serviceColloctor&&h){var d=Math.floor(30*Math.random()+1),f=(null==(t=h.cameraOpt)?void 0:t.scale)||1,p=n&&i&&[n[0]-i[0]+d,n[1]-i[1]+d]||[d/f,d/f],v=(this.serviceColloctor.isLocalId(a)?a:this.serviceColloctor.getLocalId(a.toString()))+"-"+c;if(o.toolsType===U.Text&&o.opt){var g=o.opt;if(g&&g.boxPoint&&g.text){g.workState=G.Done;var m=g.boxPoint;g.boxPoint=[m[0]+p[0],m[1]+p[1]],g.workState=G.Done;var y=this.control.viewContainerManager.transformToOriginPoint(g.boxPoint,u);this.control.textEditorManager.createTextForMasterController({workId:v,x:y[0],y:y[1],opt:g,scale:(null==(r=h.cameraOpt)?void 0:r.scale)||1,type:_s.Text,isActive:!1,viewId:u,scenePath:l}),this.collectForServiceWorker([s(s({},o),{},{opt:g,type:V.FullWork,workId:v,viewId:u,scenePath:l})])}}}}},{key:"copySelector",value:function(e){var t,r,n,i,o,a,s,u,l,c=e.viewId,d=e.store,f=this.control.viewContainerManager.getView(c),p=d.selectIds;if(this.serviceColloctor&&null!=p&&p.length&&f){var v=new Map,g={offset:{x:0,y:0},cameraOpt:{centerX:(null==(t=f.cameraOpt)?void 0:t.centerX)||0,centerY:(null==(r=f.cameraOpt)?void 0:r.centerY)||0,scale:(null==(n=f.cameraOpt)?void 0:n.scale)||1}},m=this.control.hasOffscreenCanvas()&&(null==(i=f.displayer.canvasBgRef.current)?void 0:i.getBoundingClientRect())||(null==(o=f.displayer.canvasContainerRef.current)?void 0:o.getBoundingClientRect()),y=null==(s=null==(a=f.displayer)?void 0:a.floatBarRef.current)?void 0:s.getBoundingClientRect(),_=m&&[m.x+m.width/2,m.y+m.height/2],b=y&&[y.x+y.width/2,y.y+y.height/2],x=_&&f.viewData&&f.viewData.convertToPointInWorld({x:_[0],y:_[1]}),w=b&&f.viewData&&f.viewData.convertToPointInWorld({x:b[0],y:b[1]});x&&w&&(g.offset={x:x.x-w.x,y:x.y-w.y});var S,T=h(p);try{for(T.s();!(S=T.n()).done;){var M=S.value,k=null==(l=null==(u=this.serviceColloctor)?void 0:u.getStorageData(f.id,f.focusScenePath))?void 0:l[M];k&&v.set(M,k)}}catch(e){T.e(e)}finally{T.f()}return{copyStores:v,copyCoordInfo:g}}}},{key:"pasteSelector",value:function(e){var t,r=e.copyStores,n=e.copyCoordInfo,i=e.viewId,o=e.scenePath,a=e.undoTickerId,u=this.control.viewContainerManager.getView(i);if(r.size&&this.serviceColloctor&&u){var l,c=n.offset,f=(n.cameraOpt,Math.floor(30*Math.random()+1)),p=[c.x+f,c.y+f],v=[],g=[],m=h(r.entries());try{for(m.s();!(l=m.n()).done;){var y=d(l.value,2),_=y[0],b=y[1],x=(this.serviceColloctor.isLocalId(_)?_:this.serviceColloctor.getLocalId(_.toString()))+"-"+a,w={useAnimation:!1};if(b.toolsType===U.Text&&b.opt){var S=b.opt;if(S&&S.boxPoint&&S.text){S.workState=G.Done;var T=S.boxPoint;S.boxPoint=[T[0]+p[0],T[1]+p[1]],S.workState=G.Done;var M=this.control.viewContainerManager.transformToOriginPoint(S.boxPoint,i);this.control.textEditorManager.createTextForMasterController({workId:x,x:M[0],y:M[1],opt:S,scale:(null==(t=u.cameraOpt)?void 0:t.scale)||1,type:_s.Text,isActive:!1,viewId:i,scenePath:o})}g.push(s(s({},b),{},{opt:S,type:V.FullWork,workId:x,viewId:i,scenePath:o}))}else{if(b.toolsType===U.Image&&(b.opt.uuid=x,b.opt.centerX=b.opt.centerX+p[0],b.opt.centerY=b.opt.centerY+p[1]),b.ops){var k=ha(b.ops).map((function(e,t){var r=t%3;return 0===r?e+p[0]:1===r?e+p[1]:e})),E=da(k);b.ops=E}g.push(s(s({},b),{},{updateNodeOpt:w,type:V.FullWork,workId:x,viewId:i,scenePath:o})),v.push([s(s({},b),{},{updateNodeOpt:w,workId:x,msgType:V.FullWork,dataType:W.Local,emitEventType:z.CopyNode,willSyncService:!1,willRefresh:!0,viewId:i}),{workId:x,msgType:V.FullWork,emitEventType:z.CopyNode}])}}}catch(e){m.e(e)}finally{m.f()}v.length&&this.collectForLocalWorker(v),g.length&&this.collectForServiceWorker(g)}}}]),r}(Ms);function Es(e,t,r){return"#"+((e<<16)+(t<<8)+r).toString(16).padStart(6,"0")}function As(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return"rgba("+parseInt("0x"+e.slice(1,3))+","+parseInt("0x"+e.slice(3,5))+","+parseInt("0x"+e.slice(5,7))+","+t+")"}function Is(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return"rgba(".concat(e,",").concat(t,",").concat(r,",").concat(n,")")}function Cs(e){var t=e.split(","),r=parseInt(t[0].split("(")[1]),n=parseInt(t[1]),i=parseInt(t[2]),o=Number(t[3].split(")")[0]);return[Es(r,n,i),o]}function Ps(e){var t=e.split(",");return[parseInt(t[0].split("(")[1]),parseInt(t[1]),parseInt(t[2]),Number(t[3].split(")")[0])]}function Ns(e){return"transparent"===e}var Os=function(e){v(r,e);var t=m(r);function r(){var e;return x(this,r),e=t.apply(this,arguments),k(_(e),"lastEmtData"),k(_(e),"emitEventType",z.SetColorNode),k(_(e),"undoTickerId"),e}return S(r,[{key:"setTextColor",value:function(e,t,r,n){var i=r.fontColor,o=r.fontBgColor;t.opt&&(i&&(t.opt.fontColor=i),o&&(t.opt.fontBgColor=o),this.control.textEditorManager.updateTextForMasterController({workId:e,opt:t.opt,viewId:n,canSync:!0,canWorker:!0}))}},{key:"collect",value:function(e){var t=this;if(this.serviceColloctor&&this.mainEngine){var r=e.workIds,n=e.strokeColor,o=e.fillColor,a=e.fontColor,s=e.fontBgColor,u=e.viewId,l=e.workState,c=this.control.viewContainerManager.getView(u);if(null!=c&&c.displayer){var h=c.focusScenePath,f=i(r),p=this.serviceColloctor.storage,v=[],g={};for((l===G.Start||!this.undoTickerId&&l===G.Done)&&(this.undoTickerId=Date.now(),this.mainEngine.internalMsgEmitter.emit("addUndoTicker",this.undoTickerId,u));f.length;){var m=f.pop();if(m){var y=m.toString(),_=this.serviceColloctor.isLocalId(y),b=_?this.serviceColloctor.transformKey(m):y,x=y;!_&&this.serviceColloctor.isOwn(x)&&(x=this.serviceColloctor.getLocalId(x));var w=p[u][h][b]||void 0;if(w){var S=w.updateNodeOpt||{};if(a||s){if(a){S.fontColor=a;var T=d(Ps(a),4),M=T[0],k=T[1],E=T[2],A=T[3];g.textColor=[M,k,E],g.textOpacity=A}if(s)if(S.fontBgColor=Ns(s)?"transparent":s,Ns(s))g.textBgColor=void 0,g.textBgOpacity=void 0;else{var I=d(Ps(s),4),C=I[0],P=I[1],N=I[2],O=I[3];g.textBgColor=[C,P,N],g.textBgOpacity=O}if(w.toolsType===U.Text&&w.opt&&l!==G.Start){this.setTextColor(x,oa(w),S,u),l===G.Done&&(this.undoTickerId=void 0);continue}}if(n){S.strokeColor=n;var R=d(Ps(n),4),D=R[0],L=R[1],j=R[2],z=R[3];g.strokeColor=[D,L,j],g.strokeOpacity=z}if(o)if(S.fillColor=Ns(o)?"transparent":o,Ns(o))g.fillColor=void 0,g.fillOpacity=void 0;else{var B=d(Ps(o),4),F=B[0],H=B[1],Y=B[2],$=B[3];g.fillColor=[F,H,Y],g.fillOpacity=$}var X={workId:x,msgType:V.UpdateNode,dataType:W.Local,updateNodeOpt:S,emitEventType:this.emitEventType,willRefresh:!0,willRefreshSelector:!0,willSyncService:!0,textUpdateForWoker:!0,viewId:u};v.push([X,{workId:x,msgType:V.UpdateNode,emitEventType:this.emitEventType}])}}}v.length&&(l===G.Done&&(this.undoTickerId=void 0),this.collectForLocalWorker(v)),Object.keys(g).length&&setTimeout((function(){var e;null==(e=t.control.room)||e.setMemberState(g)}),0)}}}}]),r}(Ms),Rs=function(e){v(r,e);var t=m(r);function r(){var e;return x(this,r),e=t.apply(this,arguments),k(_(e),"lastEmtData"),k(_(e),"emitEventType",z.ZIndexNode),k(_(e),"zIndexMap",new Map),e}return S(r,[{key:"clearZIndex",value:function(e){this.zIndexMap.delete(e)}},{key:"getMinZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.min)||0}},{key:"getMaxZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.max)||0}},{key:"setMaxZIndex",value:function(e,t){var r=this.getMinZIndex(t);this.zIndexMap.set(t,{min:r,max:e})}},{key:"setMinZIndex",value:function(e,t){var r=this.getMaxZIndex(t);this.zIndexMap.set(t,{min:e,max:r})}},{key:"addMaxLayer",value:function(e){var t=this.getMaxZIndex(e)+1;this.setMaxZIndex(t,e)}},{key:"addMinLayer",value:function(e){var t=this.getMinZIndex(e)-1;this.setMinZIndex(t,e)}},{key:"correct",value:function(e){for(var t=e.sort((function(e,t){return e[1]-t[1]})),r=1;r((null==(a=null==(o=l[f(e,t.serviceColloctor)])?void 0:o.opt)?void 0:a.zIndex)||0)?1:ei.wokerDrawCount?r.forEach((function(e){e.imageBitmap&&(e.isUnClose=!0,i.reRenders.push(e))})):i.reRenders.length&&i.clearReRenders(),i.wokerDrawCount<1/0&&i.viewContainerManager.render(r)))}};case 12:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"clearReRenders",value:function(){this.reRenders.length&&(this.reRenders.forEach((function(e){var t;e.imageBitmap&&(null==(t=e.imageBitmap)||t.close())})),this.reRenders.length=0)}},{key:"getLockSentEventCursor",value:function(){return this.isLockSentEventCursor}},{key:"setLockSentEventCursor",value:function(e){this.isLockSentEventCursor=e}},{key:"getTasksqueueState",value:function(){return this.useTasksqueue&&G.Doing||G.Done}},{key:"setMaxDrawCount",value:function(e){this.maxDrawCount=e}},{key:"setWorkerTasksqueueCount",value:function(e){var t=Math.max(this.workerTasksqueueCount||0,e);this.workerTasksqueueCount=t}},{key:"collectorSyncData",value:function(e){var t,r,n,i,o=this,a=!1,u=h(e);try{for(u.s();!(i=u.n()).done;){var l=i.value,c=l.type,d=l.selectIds,f=l.opt,p=l.selectRect,v=l.strokeColor,g=l.fillColor,m=l.willSyncService,y=l.isSync,_=l.imageBitmap,b=l.canvasHeight,x=l.canvasWidth,w=l.rect,S=l.op,T=l.canTextEdit,M=l.points,k=l.selectorColor,E=l.canRotate,A=l.scaleType,I=l.textOpt,P=l.toolsType,N=l.workId,O=l.viewId,R=l.dataType,D=l.canLock,L=l.isLocked,j=l.shapeOpt,z=l.toolsTypes;if(!O)return;var B=l.scenePath||this.viewContainerManager.getCurScenePath(O);switch(c){case V.Select:var F=null!=d&&d.length?s(s({},p),{},{selectIds:d,canvasHeight:b,canvasWidth:x,points:M}):void 0;F&&null!=f&&f.strokeColor&&(F.selectorColor=f.strokeColor),F&&k&&(F.selectorColor=k),F&&v&&(F.strokeColor=v),F&&null!=f&&f.fillColor&&(F.fillColor=f.fillColor),F&&g&&(F.fillColor=g),F&&C.isBoolean(E)&&(F.canRotate=E),F&&A&&(F.scaleType=A),F&&T&&(F.canTextEdit=T),F&&I&&(F.textOpt=I),F&&C.isBoolean(D)&&(F.canLock=D),F&&C.isBoolean(L)&&(F.isLocked=L),F&&j&&(F.shapeOpt=j),F&&z&&(F.toolsTypes=z),O&&this.viewContainerManager.showFloatBar(O,!!F,F),m&&(null==(t=this.collector)||t.dispatch({type:c,selectIds:d,opt:f,isSync:y,viewId:O,scenePath:B}));break;case V.Snapshot:if(_&&B){var G=this.snapshotMap.get(B);G&&G(_)}break;case V.BoundingBox:if(w&&B){var H=this.boundingRectMap.get(B);H&&H(w)}break;case V.Cursor:S&&this.control.cursor.collectServiceCursor(s({},l));break;case V.Clear:if(O){this.viewContainerManager.showFloatBar(O,!1);var Y=null==(r=this.clearAllResolveMap.get(O))?void 0:r.resolve;Y&&Y(O)}break;case V.TextUpdate:if(P===U.Text&&N&&O){var $=this.viewContainerManager.transformToOriginPoint((null==f?void 0:f.boxPoint)||[0,0],O),X=(null==f?void 0:f.boxSize)||[0,0],q=null==(n=this.viewContainerManager.getView(O))?void 0:n.cameraOpt;f?this.control.textEditorManager.updateTextForWorker({x:$[0],y:$[1],w:X[0],h:X[1],scale:(null==q?void 0:q.scale)||1,workId:N,opt:f,dataType:R,viewId:O,canSync:m||!1,canWorker:!1}):this.control.textEditorManager.delete(N,m||!1,!1)}break;case V.GetTextActive:P===U.Text&&N&&O&&this.control.textEditorManager.updateTextForWorker({workId:N,isActive:!0,viewId:O,dataType:W.Local,canWorker:!1,canSync:!0},Date.now());break;default:a=!0}}}catch(e){u.e(e)}finally{u.f()}a&&ps((function(){o.collectorAsyncData(e)}),this.maxLastSyncTime)}},{key:"collectorAsyncData",value:function(e){var t,r,n,i,o,a=this,s=h(e);try{var u=function(){var e=o.value,s=e.type,u=e.op,l=e.workId,c=e.index,h=e.removeIds,d=e.ops,f=e.opt,p=e.updateNodeOpt,v=e.toolsType,g=e.isSync,m=e.viewId,y=e.isLockSentEventCursor;if(!m)return console.error("collectorAsyncData",e),{v:void 0};var _=e.scenePath||a.viewContainerManager.getCurScenePath(m);switch(s){case V.DrawWork:null==(t=a.collector)||t.dispatch({type:s,op:u,opt:f,toolsType:v,workId:l,index:c,isSync:g,viewId:m,scenePath:_,updateNodeOpt:p});break;case V.FullWork:null==(r=a.collector)||r.dispatch({type:s,ops:d,workId:l,updateNodeOpt:p,opt:f,toolsType:v,isSync:g,viewId:m,scenePath:_}),a.willSelectorWorkId&&l&&l.toString()===a.willSelectorWorkId&&a.control.runEffectWork((function(){a.setShapeSelectorByWorkId(a.willSelectorWorkId,m),a.willSelectorWorkId=void 0})),y&&ps((function(){a.setLockSentEventCursor(!1)}),a.maxLastSyncTime);break;case V.UpdateNode:null==(n=a.collector)||n.dispatch({type:s,updateNodeOpt:p,workId:l,opt:f,ops:d,op:u,isSync:g,viewId:m,scenePath:_});break;case V.RemoveNode:h&&a.control.textEditorManager.deleteBatch(h,!1,!1),null==(i=a.collector)||i.dispatch({type:s,removeIds:h,isSync:g,viewId:m,scenePath:_}),a.willSelectorWorkId&&null!=h&&h.includes(a.willSelectorWorkId)&&(a.willSelectorWorkId=void 0)}};for(s.s();!(o=s.n()).done;){var l=u();if("object"===T(l))return l.v}}catch(e){s.e(e)}finally{s.f()}}},{key:"onLocalEventEnd",value:(a=c(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s,u,l,d,f,p,v,g,m,y=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.viewContainerManager.getView(r)){e.next=3;break}return e.abrupt("return");case 3:o=i.focusScenePath,a=i.cameraOpt,s=this.viewContainerManager.transformToScenePoint(t,r),u=[],l=h(this.localPointsBatchData.keys()),e.prev=5,l.s();case 7:if((d=l.n()).done){e.next=19;break}if(f=d.value,(null==(n=this.currentToolsData)?void 0:n.toolsType)!==U.Text){e.next=16;break}return p=this.getLocalPointInfo(f),(v=null==p?void 0:p.state)&&v===G.Start&&((g=this.currentLocalWorkData.toolsOpt).workState=G.Doing,g.boxPoint=s,g.boxSize=[g.fontSize,g.fontSize],this.control.textEditorManager.checkEmptyTextBlur(),this.control.textEditorManager.createTextForMasterController({workId:Date.now().toString(),x:t[0],y:t[1],scale:(null==a?void 0:a.scale)||1,opt:g,type:_s.Text,isActive:!0,viewId:r,scenePath:o},Date.now())),this.deleteLocalPoint(f),e.abrupt("continue",17);case 16:this.pushLocalPoint(f,s,G.Done,r),u.push(f);case 17:e.next=7;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(5),l.e(e.t0);case 24:return e.prev=24,l.f(),e.finish(24);case 27:if(!u.length){e.next=43;break}return e.prev=28,e.next=31,new Promise((function(e){setTimeout(c(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:u.forEach((function(e){y.setLocalPointIsFullWork(e)})),y.delayWorkStateToDoneResolve=e,y.consume();case 1:case"end":return t.stop()}}),t)}))),0)}));case 31:if(e.t1=e.sent,!e.t1){e.next=34;break}e.t1=u[0];case 34:if(!e.t1){e.next=37;break}m=u[0],u.forEach((function(e){y.deleteLocalPoint(e)})),this.willSelectorWorkId=m.toString();case 37:e.next=42;break;case 39:e.prev=39,e.t2=e.catch(28),console.log("error",e.t2);case 42:this.delayWorkStateToDoneResolve=void 0,u.length=0;case 43:case"end":return e.stop()}}),e,this,[[5,21,24,27],[28,39]])}))),function(e,t){return a.apply(this,arguments)})},{key:"onLocalEventDoing",value:function(e,t){var r;if((null==(r=this.currentToolsData)?void 0:r.toolsType)!==U.Text){this.currentLocalWorkData.workState===G.Start&&this.setCurrentLocalWorkData(s(s({},this.currentLocalWorkData),{},{workState:G.Doing}));var n,i=!1,o=h(this.localPointsBatchData.entries());try{for(o.s();!(n=o.n()).done;){var a=d(n.value,2),u=a[0],l=a[1].state;if(this.isAbled()&&l!==G.Pending){var c=this.viewContainerManager.transformToScenePoint(e,t);this.pushLocalPoint(u,c,l===G.Start?G.Doing:l,t),i=!0}}}catch(e){o.e(e)}finally{o.f()}i?this.runAnimation():this.useTasksqueue||this.hoverCursor(e,t)}}},{key:"onLocalEventStart",value:function(e,t){var r,n,i,o,a;this.viewContainerManager.focuedViewId!==t&&this.viewContainerManager.setFocuedViewId(t),this.isCanDrawWork&&this.control.room&&!this.control.room.disableDeviceInputs&&(this.control.room.disableDeviceInputs=!0);var s=(null==(r=this.currentToolsData)?void 0:r.toolsType)===U.Selector?va:Date.now(),u=this.setZIndex(t);this.setCurrentLocalWorkData({workState:G.Start,toolsOpt:u,viewId:t});var l=this.viewContainerManager.transformToScenePoint(e,t);if(this.pushLocalPoint(s,l,G.Start,t,u),(null==(n=this.currentToolsData)?void 0:n.toolsType)!==U.Text){if(this.control.textEditorManager.checkEmptyTextBlur(),this.isCanRecordUndoRedo&&this.internalMsgEmitter.emit("addUndoTicker",s,t),s&&u&&null!=(i=this.currentToolsData)&&i.toolsType&&this.isCanStartEventConsum&&this.prepareOnceWork({workId:s,toolsOpt:u,viewId:t},null==(o=this.currentToolsData)?void 0:o.toolsType),this.maxDrawCount=0,this.wokerDrawCount=0,this.subWorkerDrawCount=0,this.reRenders.length=0,this.isCanDrawWork){var c=this.viewContainerManager.getCurScenePath(t);c&&null!=(a=this.collector)&&a.hasSelector(t,c)&&this.blurSelector(t,c)}this.consume()}}},{key:"setLocalPointIsFullWork",value:function(e){var t=this.getLocalPointInfo(e);t&&(t.isFullWork=!0,this.localPointsBatchData.set(e,t))}},{key:"pushLocalPoint",value:function(e,t,r,n,i){var o=this.getLocalPointInfo(e);r===G.Start?o={state:G.Start,points:t,opt:i||this.currentLocalWorkData.toolsOpt,isFullWork:!1,viewId:n}:o&&(o.state=r,o.points.push(t[0],t[1])),o&&this.localPointsBatchData.set(e,o)}},{key:"deleteLocalPoint",value:function(e){this.localPointsBatchData.delete(e)}},{key:"getLocalPointInfo",value:function(e){return this.localPointsBatchData.get(e)}},{key:"getLocalPointsInfo",value:function(){return this.localPointsBatchData}},{key:"correctStorage",value:function(e,t,r){var n,i=this,o=new Map,a=[];Object.keys(e).forEach((function(t){var r,n,i=null==(n=null==(r=e[t])?void 0:r.opt)?void 0:n.zIndex;C.isNumber(i)&&a.push([t,i])}));var s=a.length&&(null==(n=this.zIndexNodeMethod)?void 0:n.correct(a))||[];this.zIndexNodeMethod&&s.length&&(this.zIndexNodeMethod.setMinZIndex(s[0][1]||0,t),this.zIndexNodeMethod.setMaxZIndex(s[s.length-1][1]||0,t));var u,l=h(s);try{for(l.s();!(u=l.n()).done;){var c=d(u.value,2),f=c[0],p=c[1];if(e[f]){var v=e[f];v.opt&&C.isNumber(v.opt.zIndex)&&v.opt.zIndex!==p&&(v.opt.zIndex=p,o.set(f,v))}}}catch(e){l.e(e)}finally{l.f()}return o.size&&o.forEach((function(n,o){var a;null==(a=i.collector)||a.updateValue(o,n,{viewId:t,scenePath:r,isSync:!0}),e[o]=n})),e}},{key:"originalEventLintener",value:(o=c(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isAbled()){e.next=13;break}e.t0=t,e.next=e.t0===G.Start?4:e.t0===G.Doing?6:e.t0===G.Done?8:13;break;case 4:return this.setLocalWorkViewId(n),n&&this.onLocalEventStart(r,n),e.abrupt("break",13);case 6:return n&&n===this.getLocalWorkViewId()&&this.onLocalEventDoing(r,n),e.abrupt("break",13);case 8:if(e.t1=n&&n===this.getLocalWorkViewId(),!e.t1){e.next=12;break}return e.next=12,this.onLocalEventEnd(r,n);case 12:return e.abrupt("break",13);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})},{key:"getLocalWorkViewId",value:function(){return this.localWorkViewId}},{key:"setLocalWorkViewId",value:function(e){this.localWorkViewId=e}},{key:"setCurrentToolsData",value:function(e){var t,r,i,o=e.toolsType,a=(null==(t=this.currentToolsData)?void 0:t.toolsType)!==e.toolsType;if(n(b(p.prototype),"setCurrentToolsData",this).call(this,e),a){var u,l=h(null==(r=this.viewContainerManager)?void 0:r.getAllViews());try{for(l.s();!(u=l.n()).done;){var c=u.value;if(c){var d=c.id,f=c.focusScenePath;a&&d&&f&&(null!=(i=this.collector)&&i.hasSelector(d,f)&&this.blurSelector(d,f),this.control.textEditorManager.checkEmptyTextBlur())}}}catch(e){l.e(e)}finally{l.f()}this.taskBatchData.add({msgType:V.UpdateTools,dataType:W.Local,toolsType:o,opt:s(s({},e.toolsOpt),{},{syncUnitTime:this.maxLastSyncTime}),isRunSubWork:this.isRunSubWork,viewId:"all"}),this.runAnimation()}}},{key:"prepareOnceWork",value:function(e,t){var r=this,n=e.workId,i=e.toolsOpt,o=e.viewId;this.queryTaskBatchData({msgType:V.CreateWork,dataType:W.Local,viewId:o,toolsType:t}).forEach((function(e){r.taskBatchData.delete(e)})),this.taskBatchData.add({msgType:V.CreateWork,workId:n,toolsType:t,opt:s(s({},i),{},{syncUnitTime:this.maxLastSyncTime}),dataType:W.Local,isRunSubWork:this.isRunSubWork,viewId:o}),this.runAnimation()}},{key:"createViewWorker",value:function(e,t){var r=t.offscreenCanvasOpt,n=t.layerOpt,i=t.dpr,o=t.cameraOpt;this.taskBatchData.add({msgType:V.Init,dataType:W.Local,viewId:e,offscreenCanvasOpt:r,layerOpt:n,dpr:i,cameraOpt:o,isRunSubWork:!0,isSafari:-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")}),this.isBusy&&this.destroyTaskQueue(),this.consume()}},{key:"destroyViewWorker",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getLocalWorkViewId()===e&&this.setLocalWorkViewId(void 0),this.zIndexNodeMethod&&this.zIndexNodeMethod.clearZIndex(e),this.taskBatchData.add({msgType:V.Destroy,dataType:W.Local,viewId:e,isRunSubWork:!0}),this.consume(),r||null==(t=this.collector)||t.dispatch({type:V.Clear,viewId:e})}},{key:"onServiceDerive",value:function(e,t){var r,n,i,o,a=this,s=t.newValue,u=t.oldValue,l=t.viewId,c=t.scenePath,h=C.cloneDeep(s)||{},d=e,f=h.type;if(s||!u||(f=V.RemoveNode,u.toolsType!==U.LaserPen)){var p=null==(r=this.viewContainerManager.getView(l))?void 0:r.focusScenePath;if(!p||p===c){if(f&&d){var v=h;if(v.workId=null!=(n=this.collector)&&n.isOwn(d)?null==(i=this.collector)?void 0:i.getLocalId(d):d,v.msgType=f,v.toolsType===U.LaserPen&&(v.isRunSubWork=!0),v.dataType=W.Service,v.viewId=l,v.scenePath=c,v.selectIds&&(v.selectIds=v.selectIds.map((function(e){var t,r;return null!=(t=a.collector)&&t.isOwn(e)?null==(r=a.collector)?void 0:r.getLocalId(e):e}))),v&&v.toolsType===U.Text||(null==u?void 0:u.toolsType)===U.Text)return void this.control.textEditorManager.onServiceDerive(v);this.taskBatchData.add(v)}this.runAnimation();var g=t.newValue&&(null==(o=t.newValue.opt)?void 0:o.zIndex);if(this.zIndexNodeMethod&&C.isNumber(g)){var m=this.zIndexNodeMethod.getMinZIndex(l);this.zIndexNodeMethod.getMaxZIndex(l)g&&this.zIndexNodeMethod.setMinZIndex(g,l)}}}}},{key:"pullServiceData",value:function(e,t){var r,n,i,o,a=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isAsync:!1,useAnimation:!1},u=null==(r=this.collector)?void 0:r.getStorageData(e,t),l=s.isAsync,c=s.useAnimation;if(u){u=this.correctStorage(u,e,t);for(var h=Object.keys(u),d=0,f=h;dDate.now()&&(a.push(l.toString()),this.taskBatchData.add({msgType:V.RemoveNode,workId:l,viewId:p,dataType:W.Local,isRunSubWork:!0}));var m=v.map((function(e){return e}));this.taskBatchData.add({op:m,workState:G.Done,workId:l,dataType:W.Local,msgType:V.DrawWork,isRunSubWork:this.isRunSubWork,toolsType:null==(t=this.currentToolsData)?void 0:t.toolsType,viewId:p,opt:g,scenePath:p&&this.viewContainerManager.getCurScenePath(p)}),o=!0}this.deleteLocalPoint(l)}}}catch(e){s.e(e)}finally{s.f()}if((o||a.length)&&(this.consume(),a.length)){var y=null==(r=this.viewContainerManager.getView(e))?void 0:r.focusScenePath;null==(n=this.collector)||n.dispatch({type:V.RemoveNode,removeIds:a,viewId:e,scenePath:y})}}},{key:"removeDrawingWork",value:function(e){var t,r,n,i=[],o=h(this.localPointsBatchData.entries());try{for(o.s();!(n=o.n()).done;){var a=d(n.value,2),s=a[0],u=a[1],l=u.state,c=u.viewId;(e===c&&l===G.Start||l===G.Doing)&&(this.deleteLocalPoint(s),l===G.Doing&&this.isCanDrawWork&&(i.push(s.toString()),this.taskBatchData.add({msgType:V.RemoveNode,workId:s,viewId:c,dataType:W.Local,isRunSubWork:!0})))}}catch(e){o.e(e)}finally{o.f()}if(i.length){this.consume();var f=null==(t=this.viewContainerManager.getView(e))?void 0:t.focusScenePath;null==(r=this.collector)||r.dispatch({type:V.RemoveNode,removeIds:i,viewId:e,scenePath:f})}}},{key:"hoverCursor",value:function(e,t){var r,n=this;if((null==(r=this.currentToolsData)?void 0:r.toolsType)===U.Selector){var i=this.viewContainerManager.getView(t);if(i&&i.displayer&&i.displayer.vDom){var o=i.displayer.vDom.state.floatBarData;if(o)if(ds(e,{x:o.x,y:o.y,w:o.w,h:o.h}))return}var a=this.viewContainerManager.transformToScenePoint(e,t),s={msgType:V.CursorHover,dataType:W.Local,point:a,toolsType:this.currentToolsData.toolsType,opt:this.currentToolsData.toolsOpt,isRunSubWork:!1,viewId:t};this.queryTaskBatchData({msgType:V.CursorHover,dataType:W.Local,toolsType:this.currentToolsData.toolsType,viewId:t}).forEach((function(e){n.taskBatchData.delete(e)})),this.taskBatchData.add(s),this.runAnimation()}}},{key:"blurCursor",value:function(e){var t,r=this;if((null==(t=this.currentToolsData)?void 0:t.toolsType)===U.Selector){var n={msgType:V.CursorBlur,dataType:W.Local,isRunSubWork:!1,viewId:e};this.queryTaskBatchData({msgType:V.CursorHover,dataType:W.Local,viewId:e}).forEach((function(e){r.taskBatchData.delete(e)})),this.taskBatchData.add(n),this.consume()}}},{key:"sendCursorEvent",value:function(e,t){if(this.currentLocalWorkData&&this.currentLocalWorkData.workState!==G.Unwritable&&this.currentToolsData&&this.isCanSentCursor){var r=[void 0,void 0];this.currentToolsData&&(this.isCanDrawWork||this.currentToolsData.toolsType===U.Text)&&!this.localPointsBatchData.size&&!this.getLockSentEventCursor()&&(r=e,this.control.cursor.sendEvent(r,t))}}},{key:"getBoundingRect",value:function(e){var t,r,n=this;if(!(null==(t=this.boundingRectMap)?void 0:t.get(e))){var i=null==(r=this.collector)?void 0:r.getScenePathData(e);if(!i)return;if(Object.keys(i).forEach((function(e){var t;(null==(t=n.collector)?void 0:t.getLocalId(e))===va&&delete i[e]})),Object.keys(i).length&&this.viewContainerManager.mainView&&this.viewContainerManager.mainView.cameraOpt){var o={msgType:V.BoundingBox,dataType:W.Local,scenePath:e,scenes:i,cameraOpt:s({},this.viewContainerManager.mainView.cameraOpt),isRunSubWork:!0,viewId:this.viewContainerManager.mainView.id};return this.taskBatchData.add(o),this.runAnimation(),new Promise((function(t){n.boundingRectMap.set(e,t)})).then((function(t){return n.boundingRectMap.delete(e),t}))}}}},{key:"getSnapshot",value:function(e,t,r,n){var i,o,a,u,l,c=this;if(!(null==(i=this.snapshotMap)?void 0:i.get(e))){var h=null==(o=this.collector)?void 0:o.getViewIdBySecenPath(e);if(!h)return;var d=null==(a=this.collector)?void 0:a.getStorageData(h,e);if(!d)return;if(Object.keys(d).forEach((function(e){var t;(null==(t=c.collector)?void 0:t.getLocalId(e))===va&&delete d[e]})),Object.keys(d).length){var f=this.viewContainerManager.mainView;if(!f)return;var p=t||(null==(u=f.cameraOpt)?void 0:u.width),v=r||(null==(l=f.cameraOpt)?void 0:l.height),g={msgType:V.Snapshot,dataType:W.Local,scenePath:e,scenes:d,w:p,h:v,cameraOpt:n&&s(s({},n),{},{width:p,height:v})||f.cameraOpt,isRunSubWork:!0,viewId:f.id};return this.taskBatchData.add(g),this.runAnimation(),new Promise((function(t){c.snapshotMap.set(e,t)})).then((function(t){return c.snapshotMap.delete(e),t}))}}}},{key:"queryTaskBatchData",value:function(e){var t=[];if(e){var r,n=h(this.taskBatchData.values());try{for(n.s();!(r=n.n()).done;){for(var i=r.value,o=!0,a=0,s=Object.entries(e);a=t||r<0||h&&e-l>=o}function g(){var e=cu();if(v(e))return m(e);s=setTimeout(g,function(e){var r=t-(e-u);return h?fu(r,o-(e-l)):r}(e))}function m(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=cu(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(g,t),f(u)}return void 0===s&&(s=setTimeout(g,t)),a}return t=hu(t)||0,lu(r)&&(c=!!r.leading,o=(h="maxWait"in r)?du(hu(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:m(cu())},y},vu=pu,gu=Ye;var mu=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return gu(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),vu(e,t,{leading:n,maxWait:t,trailing:i})},yu=re(mu),_u=function(){function e(t){var r;x(this,e),k(this,"internalMsgEmitter"),k(this,"control"),k(this,"roomHotkeyCheckers"),k(this,"tmpCopyStore",new Map),k(this,"tmpCopyCoordInfo");var n=t.control,i=t.internalMsgEmitter;this.control=n,this.internalMsgEmitter=i,this.roomHotkeyCheckers=(null==(r=this.control.room)?void 0:r.viewsParams.hotKeys.nodes)||[]}return S(e,[{key:"getEventKey",value:function(e){return"keydown"===e.type?"KeyDown":"KeyUp"}},{key:"onActiveHotkey",value:function(e){var t,r,n,i=this.control.viewContainerManager.focuedViewId,o=null==(t=this.control.viewContainerManager.focuedView)?void 0:t.focusScenePath;if(i&&o)switch(e){case"delete":this.isSelector&&null!=(r=this.collector)&&r.hasSelector(i,o)&&Vs.emitMethod(B.MainEngine,z.DeleteNode,{workIds:[va],viewId:i});break;case"copy":this.isSelector&&null!=(n=this.collector)&&n.hasSelector(i,o)&&this.copySelectorToTemp(i,o);break;case"paste":this.tmpCopyStore.size&&this.pasteTempToFocusView(i,o)}("changeToPencil"===e||"redo"===e||"undo"===e)&&this.onSelfActiveHotkey(e)}},{key:"colloctHotkey",value:function(e){if(this.isUseSelf){var t=this.checkHotkey(e);t&&this.onSelfActiveHotkey(t)}}},{key:"onSelfActiveHotkey",value:function(e){switch(e){case"changeToPencil":this.setMemberState({currentApplianceName:D.pencil,useNewPencil:!0});break;case"changeToArrow":this.setMemberState({currentApplianceName:D.arrow});break;case"changeToClick":this.setMemberState({currentApplianceName:D.clicker});break;case"changeToEllipse":this.setMemberState({currentApplianceName:D.ellipse});break;case"changeToEraser":this.setMemberState({currentApplianceName:D.eraser,isLine:!0});break;case"changeToHand":this.setMemberState({currentApplianceName:D.hand});break;case"changeToLaserPointer":this.setMemberState({currentApplianceName:D.laserPointer});break;case"changeToSelector":this.setMemberState({currentApplianceName:D.selector});break;case"changeToRectangle":this.setMemberState({currentApplianceName:D.rectangle});break;case"changeToStraight":this.setMemberState({currentApplianceName:D.straight});break;case"redo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.redo();break;case"undo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.undo();break;case"changeToText":this.setMemberState({currentApplianceName:D.text})}}},{key:"checkHotkey",value:function(e){var t,r=h(this.roomHotkeyCheckers);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.kind;if((0,n.checker)({nativeEvent:e,kind:this.getEventKey(e),key:e.key,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},this.keyboardKind))return i}}catch(e){r.e(e)}finally{r.f()}}},{key:"copySelectorToTemp",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(z.CopyNode);if(i&&this.collector&&o){var a=this.collector.transformKey(va),s=this.collector.getStorageData(e,t);if(s){var u=s[a],l=u&&o.copySelector({viewId:e,store:u});l&&(this.tmpCopyCoordInfo=null==l?void 0:l.copyCoordInfo,this.tmpCopyStore=null==l?void 0:l.copyStores)}}}},{key:"pasteTempToFocusView",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(z.CopyNode);if(i&&this.tmpCopyCoordInfo&&this.tmpCopyStore.size&&this.collector&&o&&i.viewData&&this.tmpCopyCoordInfo){var a=C.cloneDeep(this.tmpCopyCoordInfo.offset),s=this.tmpCopyCoordInfo.cameraOpt,u=i.viewData.camera;a.x=a.x+u.centerX-s.centerX,a.y=a.y+u.centerY-s.centerY;var l=Date.now();this.control.worker.internalMsgEmitter.emit("addUndoTicker",l,e),o.pasteSelector({viewId:e,scenePath:t,copyStores:C.cloneDeep(this.tmpCopyStore),copyCoordInfo:{offset:a,cameraOpt:u},undoTickerId:l})}}},{key:"setMemberState",value:function(e){var t;null==(t=this.control.room)||t.setMemberState(e)}},{key:"isUseSelf",get:function(){var e;return(null==(e=this.control.room)?void 0:e.disableDeviceInputs)||!1}},{key:"isSelector",get:function(){var e;return(null==(e=this.control.worker.currentToolsData)?void 0:e.toolsType)===U.Selector}},{key:"collector",get:function(){return this.control.collector}},{key:"mainEngine",get:function(){return this.control.worker}},{key:"keyboardKind",get:function(){return/^Mac/i.test(navigator.platform)?"mac":"windows"}}]),e}(),bu=function(){function e(t){var r=this;x(this,e),k(this,"version",aa),k(this,"plugin"),k(this,"room"),k(this,"play"),k(this,"collector"),k(this,"hasSwitchToSelectorEffect"),k(this,"snapshootStateMap"),k(this,"effectResolve"),k(this,"hotkeyManager"),k(this,"pluginOptions"),k(this,"roomMember"),k(this,"cursor"),k(this,"textEditorManager"),k(this,"worker"),k(this,"onSceneChange",function(){var e=c(regeneratorRuntime.mark((function e(t,n){var i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(o=r.viewContainerManager.getView(n))&&o.focusScenePath&&null!=(i=r.collector)&&i.hasSelector(n,o.focusScenePath)&&r.worker.blurSelector(n,o.focusScenePath),r.textEditorManager.checkEmptyTextBlur(),a=null==o?void 0:o.displayer,e.t0=a,!e.t0){e.next=8;break}return a.setActive(!1),e.next=8,a.stopEventHandler();case 8:(s=t)&&r.viewContainerManager.setViewScenePath(n,s),null==a||a.setActive(!0);case 10:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),k(this,"onRoomMembersChange",(function(e){r.roomMember.setRoomMembers(E.toJS(e))})),k(this,"onMemberChange",yu((function(e){if(r.room&&r.worker&&e){var t=r.getToolsKey(e),n=r.getToolsOpt(t,e);r.worker.setCurrentToolsData(n),r.effectViewContainer(t),r.effectResolve&&r.effectResolve(!0)}}),100,{leading:!1})),k(this,"internalSceneChange",(function(e,t){var n;null==(n=r.worker)||n.clearViewScenePath(e,!0).then((function(){var n;null==(n=r.worker)||n.pullServiceData(e,t,{isAsync:!0,useAnimation:!1})}))})),k(this,"internalCameraChange",(function(e,t){var n;null==(n=r.worker)||n.updateCamera(e,t)}));var n=t.displayer,i=t.plugin,o=t.options;this.plugin=i,this.room=E.isRoom(n)?n:void 0,this.play=E.isPlayer(n)?n:void 0,this.pluginOptions=o,this.roomMember=new ys;var a={control:this,internalMsgEmitter:e.InternalMsgEmitter};this.cursor=new Ts(a),this.textEditorManager=new Ss(a),this.worker=new Hs(a),this.hotkeyManager=new _u(a)}var t,r,n,i;return S(e,[{key:"hasOffscreenCanvas",value:function(){return"worker"===sa}},{key:"bindPlugin",value:function(e){var t,r;this.plugin=e,this.collector&&this.collector.removeStorageStateListener(),this.collector=new ms(this,e,null==(r=null==(t=this.pluginOptions)?void 0:t.syncOpt)?void 0:r.interval),this.activePlugin()}},{key:"destroy",value:function(){var e,t,r,n,i;this.roomMember.destroy(),null==(e=this.collector)||e.destroy(),null==(t=this.worker)||t.destroy(),null==(r=this.viewContainerManager)||r.destroy(),null==(n=this.cursor)||n.destroy(),null==(i=this.textEditorManager)||i.destory()}},{key:"cleanCurrentScene",value:function(){var t=Date.now(),r=this.worker.getLocalWorkViewId()||this.viewContainerManager.focuedViewId;r&&(e.InternalMsgEmitter.emit("addUndoTicker",t,r),this.worker.clearViewScenePath(r))}},{key:"onWritableChange",value:function(e){var t,r;e?null==(r=this.worker)||r.abled():null==(t=this.worker)||t.unWritable()}},{key:"getToolsKey",value:function(e){var t=e.currentApplianceName;switch(this.hasSwitchToSelectorEffect=!1,t){case D.text:return e.textCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),U.Text;case D.pencil:return e.useLaserPen?U.LaserPen:U.Pencil;case D.eraser:case D.pencilEraser:return U.Eraser;case D.selector:return U.Selector;case D.arrow:return e.arrowCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),U.Arrow;case D.straight:return e.straightCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),U.Straight;case D.ellipse:return e.ellipseCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),U.Ellipse;case D.rectangle:return e.rectangleCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),U.Rectangle;case D.shape:if(e.shapeCompleteToSelector&&(this.hasSwitchToSelectorEffect=!0),e.shapeType===j.Pentagram||e.shapeType===j.Star)return U.Star;if(e.shapeType===j.Polygon||e.shapeType===j.Triangle||e.shapeType===j.Rhombus)return U.Polygon;if(e.shapeType===j.SpeechBalloon)return U.SpeechBalloon}return U.Clicker}},{key:"getToolsOpt",value:function(e,t){if(e===U.Clicker)return{toolsType:e,toolsOpt:{}};var r=t.currentApplianceName,n={strokeColor:Is(t.strokeColor[0],t.strokeColor[1],t.strokeColor[2],t.strokeOpacity||1),thickness:t.strokeWidth,isOpacity:(null==t?void 0:t.strokeOpacity)&&t.strokeOpacity<1||(null==t?void 0:t.fillOpacity)&&t.fillOpacity<1||(null==t?void 0:t.textOpacity)&&t.textOpacity<1||(null==t?void 0:t.textBgOpacity)&&t.textBgOpacity<1||!1};switch(e){case U.Text:n.fontFamily=window.getComputedStyle(document.documentElement).getPropertyValue("font-family"),n.fontSize=(null==t?void 0:t.textSizeOverride)||(null==t?void 0:t.textSize)||Number(window.getComputedStyle(document.body).fontSize),n.textAlign=(null==t?void 0:t.textAlign)||"left",n.verticalAlign=(null==t?void 0:t.verticalAlign)||"middle",n.fontColor=(null==t?void 0:t.textColor)&&Is(t.textColor[0],t.textColor[1],t.textColor[2],t.textOpacity||1)||n.strokeColor||"rgba(0,0,0,1)",n.fontBgColor=Array.isArray(null==t?void 0:t.textBgColor)&&Is(t.textBgColor[0],t.textBgColor[1],t.textBgColor[2],t.textBgOpacity||1)||"transparent",n.bold=(null==t?void 0:t.bold)?"bold":void 0,n.italic=(null==t?void 0:t.italic)?"italic":void 0,n.underline=(null==t?void 0:t.underline)||void 0,n.lineThrough=(null==t?void 0:t.lineThrough)||void 0,n.text="",n.strokeColor=void 0;break;case U.Pencil:n.strokeType=(null==t?void 0:t.strokeType)||L.Normal;break;case U.Eraser:n.thickness=Math.min(3,Math.max(1,Math.floor(t.pencilEraserSize||1)))-1,n.isLine=r===D.eraser&&!0;break;case U.LaserPen:n.duration=(null==t?void 0:t.duration)||1,n.strokeType=(null==t?void 0:t.strokeType)||L.Normal;break;case U.Ellipse:case U.Rectangle:case U.Star:case U.Polygon:case U.SpeechBalloon:e===U.Star&&(t.shapeType===j.Pentagram?(n.vertices=10,n.innerVerticeStep=2,n.innerRatio=.4):null!=t&&t.vertices&&null!=t&&t.innerVerticeStep&&null!=t&&t.innerRatio&&(n.vertices=t.vertices,n.innerVerticeStep=t.innerVerticeStep,n.innerRatio=t.innerRatio)),e===U.Polygon&&(t.shapeType===j.Triangle?n.vertices=3:t.shapeType===j.Rhombus?n.vertices=4:t.vertices&&(n.vertices=t.vertices)),n.fillColor=(null==t?void 0:t.fillColor)&&Is(t.fillColor[0],t.fillColor[1],t.fillColor[2],null==t?void 0:t.fillOpacity)||"transparent",e===U.SpeechBalloon&&(n.placement=t.placement||"bottomLeft")}return{toolsType:e,toolsOpt:n}}},{key:"effectViewContainer",value:function(e){var t,r,n,i,o,a=this;switch(e){case U.Text:case U.Pencil:case U.LaserPen:case U.Arrow:case U.Straight:case U.Rectangle:case U.Ellipse:case U.Star:case U.Polygon:case U.SpeechBalloon:case U.Triangle:case U.Rhombus:this.room.disableDeviceInputs=!0,null==(t=this.worker)||t.abled();break;case U.Eraser:case U.Selector:this.room.disableDeviceInputs=!1,null==(r=this.cursor)||r.unabled(),null==(n=this.worker)||n.abled();break;default:this.room.disableDeviceInputs=!1,null==(i=this.worker)||i.unWritable(),null==(o=this.cursor)||o.unabled()}setTimeout((function(){a.viewContainerManager.getAllViews().forEach((function(e){null!=e&&e.displayer&&e.displayer.bindToolsClass()}))}),0)}},{key:"getBoundingRect",value:(i=c(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==(r=this.worker)?void 0:r.getBoundingRect(t);case 2:if(!(s=e.sent)){e.next=6;break}return u=(null==(i=null==(n=this.viewContainerManager.mainView)?void 0:n.viewData)?void 0:i.convertToPointInWorld({x:s.x,y:s.y}))||{x:s.x,y:s.y},l=(null==(a=null==(o=this.viewContainerManager.mainView)?void 0:o.viewData)?void 0:a.camera.scale)||1,e.abrupt("return",{width:Math.floor(s.w/l)+1,height:Math.floor(s.h/l)+1,originX:u.x,originY:u.y});case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"screenshotToCanvas",value:(n=c(regeneratorRuntime.mark((function e(t,r,n,i,o,a,s){var u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.worker.getSnapshot(r,n,i,o);case 2:(u=e.sent)&&(t.drawImage(u,a||0,s||0),u.close());case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i,o,a,s){return n.apply(this,arguments)})},{key:"scenePreview",value:(r=c(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null==(n=this.collector)?void 0:n.getViewIdBySecenPath(t)){e.next=3;break}return e.abrupt("return");case 3:if((u=this.viewContainerManager.getView(s))&&null!=(i=u.cameraOpt)&&i.width&&null!=(o=u.cameraOpt)&&o.height){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,null==(a=this.worker)?void 0:a.getSnapshot(t);case 8:(l=e.sent)&&this.worker&&(c=document.createElement("canvas"),h=c.getContext("2d"),d=u.cameraOpt,f=d.width,p=d.height,c.width=f,c.height=p,h&&(h.drawImage(l,0,0),r.src=c.toDataURL(),r.onload=function(){c.remove()},r.onerror=function(){c.remove(),r.remove()}),l.close());case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"switchToText",value:function(){var e;null==(e=this.room)||e.setMemberState({currentApplianceName:D.text})}},{key:"switchToSelector",value:function(){var e;null==(e=this.room)||e.setMemberState({currentApplianceName:D.selector})}},{key:"runEffectWork",value:(t=c(regeneratorRuntime.mark((function e(t){var r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasSwitchToSelectorEffect){e.next=5;break}return e.next=3,new Promise((function(e){n.switchToSelector(),n.effectResolve=e}));case 3:r=e.sent,this.effectResolve=void 0,r&&t&&t();case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSnapshootData",value:function(){var e;this.room&&(this.snapshootStateMap=new Map,this.snapshootStateMap.set("memberState",null==(e=this.room)?void 0:e.state.memberState))}},{key:"getSnapshootData",value:function(e){var t;return null==(t=this.snapshootStateMap)?void 0:t.get(e)}},{key:"clearSnapshootData",value:function(){var e;null==(e=this.snapshootStateMap)||e.clear(),this.snapshootStateMap=void 0}},{key:"consoleWorkerInfo",value:function(){var e;null==(e=this.worker)||e.consoleWorkerInfo()}}]),e}();k(bu,"InternalMsgEmitter",new I);var xu=bu,wu=function(){function e(t){var r=this;x(this,e),k(this,"emitter",new I),k(this,"undoStack"),k(this,"redoStack"),k(this,"worker"),k(this,"control"),k(this,"room"),k(this,"isTicking"),k(this,"undoTickerId"),k(this,"viewId"),k(this,"scenePath"),k(this,"tickStartStorerCache"),k(this,"excludeIds",new Set),k(this,"onChangeScene",C.debounce((function(){var e=r.control.viewContainerManager.getCurScenePath(r.viewId);if(e){var t=r.undoStack.filter((function(t){return t.scenePath===e})).length,n=r.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===n&&r.tickStartStorerCache&&r.scenePath===e&&(t=1),r.emitter.emit("onCanUndoStepsUpdate",t),r.emitter.emit("onCanRedoStepsUpdate",n)}}),e.waitTime));var n=t.control,i=t.internalMsgEmitter,o=t.viewId;this.control=n,this.emitter=i,this.undoStack=[],this.redoStack=[],this.room=n.room,this.worker=n.worker,this.isTicking=!1,this.viewId=o}return S(e,[{key:"addExcludeIds",value:function(e){if(this.isTicking){var t,r=h(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.excludeIds.add(n)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"undoTickerStart",value:function(e,t){if(this.collector&&(this.undoTickerId!==e||this.scenePath!==t)){!this.undoTickerId&&!this.tickStartStorerCache&&!this.scenePath&&this.emitter.emit("onCanUndoStepsUpdate",1),this.undoTickerId&&this.viewId&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath),this.isTicking=!0;var r=this.collector.transformKey(va);this.excludeIds.add(r),this.undoTickerId=e,this.scenePath=t;var n=this.collector.getStorageData(this.viewId,t)||{};this.tickStartStorerCache=new Map(Object.entries(C.cloneDeep(n)))}}},{key:"undoTickerEndSync",value:function(t,r,n){var i,o;if(t===this.undoTickerId&&n===this.scenePath&&r===this.viewId&&this.tickStartStorerCache){var a=(null==(i=this.collector)?void 0:i.storage[r])&&(null==(o=this.collector)?void 0:o.storage[r][n])||{},s=this.diffFun(this.tickStartStorerCache,new Map(Object.entries(a)));s.size&&(this.undoStack.push({id:t,type:2,data:C.cloneDeep(s),scenePath:n}),this.undoStack.length>e.MaxStackLength&&this.undoStack.shift(),this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)),this.redoStack.length&&(this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)),this.isTicking=!1,this.scenePath=void 0,this.tickStartStorerCache=void 0,this.undoTickerId=void 0,this.excludeIds.clear()}}},{key:"undo",value:function(e){this.undoTickerId&&this.tickStartStorerCache&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath);for(var t=this.undoStack.length-1;t>=0;){if(this.undoStack[t].scenePath===e){var r=this.undoStack[t];r&&(this.redoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r)),this.undoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),n}},{key:"redo",value:function(e){for(var t=this.redoStack.length-1;t>=0;){if(this.redoStack[t].scenePath===e){var r=this.redoStack[t];r&&(!this.undoTickerId&&r.tickStartStorerCache?(this.undoTickerId=r.id,this.tickStartStorerCache=r.tickStartStorerCache,this.scenePath=r.scenePath):this.undoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r,!0)),this.redoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),i}},{key:"clear",value:function(){this.clearUndo(),this.clearRedo()}},{key:"clearUndo",value:function(){this.undoStack.length=0,this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)}},{key:"clearRedo",value:function(){this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)}},{key:"canUndo",value:function(){return!!this.undoStack.length}},{key:"canRedo",value:function(){return!!this.redoStack.length}},{key:"onFocusView",value:function(){var e=this.control.viewContainerManager.getCurScenePath(this.viewId);if(e){var t=this.undoStack.filter((function(t){return t.scenePath===e})).length,r=this.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===r&&this.tickStartStorerCache&&this.scenePath===e&&(t=1),this.emitter.emit("onCanUndoStepsUpdate",t),this.emitter.emit("onCanRedoStepsUpdate",r)}}},{key:"diffFun",value:function(e,t){var r,n=new Set,i=e.keys(),o=t.keys(),a=h(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!this.excludeIds.has(s)){var u=e.get(s),l=t.get(s);if(u&&l){if(C.isEqual(l,u))continue;n.add({dataType:3,key:s,data:[u,l]})}else u&&n.add({dataType:2,key:s,data:u})}}}catch(e){a.e(e)}finally{a.f()}var c,d=h(o);try{for(d.s();!(c=d.n()).done;){var f=c.value;if(!this.excludeIds.has(f)){var p=t.get(f);p&&!e.has(f)&&n.add({dataType:1,key:f,data:p})}}}catch(e){d.e(e)}finally{d.f()}return n}},{key:"isDrawEffectiveScene",value:function(e,t){var r=e.key;return!t.includes(r)}},{key:"isDeleteEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===va&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})),u=h(s);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(null!=(n=null==l?void 0:l.selectIds)&&n.includes(o))return!1}}catch(e){u.e(e)}finally{u.f()}return!0}},{key:"isOldEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===va&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})),u=h(s);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(null!=(n=null==l?void 0:l.selectIds)&&n.includes(o))return!1}}catch(e){u.e(e)}finally{u.f()}return!0}},{key:"isNewEffectiveScene",value:function(e,t){var r=e.key;return!!t.includes(r)}},{key:"refreshPlugin",value:function(e){var t,r,n,i,o,a,s,u,l,c,d,f,p,v,g,m,y,_,b,x,w,S=this,T=arguments.length>1&&void 0!==arguments[1]&&arguments[1],M=e.scenePath,k=e.data;if(k&&this.collector){var E,A=h(k.values());try{for(A.s();!(E=A.n()).done;){var I=E.value,C=I.dataType,P=I.data,N=I.key,O=this.collector.getStorageData(this.viewId,M),R=O&&Object.keys(O)||[];switch(C){case 1:if(T?this.isDrawEffectiveScene(I,R):this.isDeleteEffectiveScene(I,R,M))if(T&&!Array.isArray(P)){if(null!=(t=P.updateNodeOpt)&&t.useAnimation&&(P.updateNodeOpt.useAnimation=!1),(null==(r=this.collector)?void 0:r.getLocalId(N))===va&&null!=(n=this.collector)&&n.isOwn(I.key)){var D=P.selectIds;if(D){var L,j=R.filter((function(e){var t,r;return(null==(t=S.collector)?void 0:t.getLocalId(e))===va&&!(null!=(r=S.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=S.collector)?void 0:t.storage[S.viewId][M][e]})),z=!1,B=h(j);try{for(B.s();!(L=B.n()).done;)for(var F=L.value,U=0;U1&&void 0!==arguments[1]&&arguments[1],r=this.appViews.get(e);r&&(this.control.textEditorManager.clear(e,t),r.displayer.destroy(),this.appViews.delete(e))}},{key:"createMianView",value:function(e){var t=this;this.mainView=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}})}},{key:"createAppView",value:function(e){var t=this,r=e.id,n=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}});this.appViews.set(r,n)}},{key:"isAppView",value:function(e){return e!==bs&&this.appViews.has(e)}},{key:"getView",value:function(e){var t;return e===bs?this.mainView:null==(t=this.appViews)?void 0:t.get(e)}},{key:"getCurScenePath",value:function(e){var t=this.getView(e);if(t)return t.focusScenePath}},{key:"getAllViews",value:function(){return[this.mainView].concat(i(this.appViews.values()))}},{key:"setViewScenePath",value:function(e,t){var r;if(e===bs&&this.mainView)this.mainView.focusScenePath=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.focusScenePath=t)}}},{key:"setViewData",value:function(e,t){var r;if(e===bs&&this.mainView)this.mainView.viewData=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.viewData=t)}}},{key:"setFocuedViewId",value:function(e){var t;this.focuedViewId=e,this.focuedView=e===bs?this.mainView:e&&(null==(t=this.appViews)?void 0:t.get(e))||void 0,this.control.cursor.onFocusViewChange(),this.focuedView&&this.focuedView.displayer.commiter.onFocusView()}},{key:"setViewFocusScenePath",value:function(e,t){var r,n;(n=e===bs?this.mainView:null==(r=this.appViews)?void 0:r.get(e))&&(n.focusScenePath=t)}},{key:"destroy",value:function(){var e,t=this;this.internalMsgEmitter.removeAllListeners("addUndoTicker"),this.internalMsgEmitter.removeAllListeners("excludeIds"),null==(e=this.mainView)||e.displayer.destroy(),this.appViews.forEach((function(e){t.destroyAppView(e.id,!0),t.control.worker.destroyViewWorker(e.id)}))}},{key:"setFocuedViewCameraOpt",value:function(e){if(this.focuedView){var t=this.focuedView.cameraOpt;C.isEqual(t,e)||(this.focuedView.cameraOpt=e)}}},{key:"transformToOriginPoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointOnScreen(e[0],e[1]);return[n.x,n.y]}return e}},{key:"transformToScenePoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointInWorld({x:e[0],y:e[1]});return[n.x,n.y]}return e}},{key:"render",value:function(e){var t,r,n,i,o,a,s,u,l,c,d,f,p,v,g,m,y,_,b=h(e);try{for(b.s();!(_=b.n()).done;){var x=_.value,w=x.rect,S=x.imageBitmap,T=x.isClear,M=x.isUnClose,k=x.drawCanvas,E=x.clearCanvas,A=x.viewId,I=null==(t=this.getView(A))?void 0:t.displayer;if(I&&w){var C=I.dpr,P=I.canvasBgRef,N=I.canvasFloatRef,O=I.canvasServiceFloatRef,R=I.canvasTopRef,D=Math.floor(w.w*C),L=Math.floor(w.h*C),j=Math.ceil(w.x*C),z=Math.ceil(w.y*C);if(T){switch(E){case Y.TopFloat:null==(n=null==(r=R.current)?void 0:r.getContext("2d"))||n.clearRect(j,z,D,L);break;case Y.Float:null==(o=null==(i=N.current)?void 0:i.getContext("2d"))||o.clearRect(j,z,D,L);break;case Y.ServiceFloat:null==(s=null==(a=O.current)?void 0:a.getContext("2d"))||s.clearRect(j,z,D,L);break;case Y.Bg:null==(l=null==(u=P.current)?void 0:u.getContext("2d"))||l.clearRect(j,z,D,L)}continue}if(k&&S)switch(k){case Y.TopFloat:null==(d=null==(c=R.current)?void 0:c.getContext("2d"))||d.drawImage(S,0,0,D,L,j,z,D,L);break;case Y.Float:null==(p=null==(f=N.current)?void 0:f.getContext("2d"))||p.drawImage(S,0,0,D,L,j,z,D,L);break;case Y.ServiceFloat:null==(g=null==(v=O.current)?void 0:v.getContext("2d"))||g.drawImage(S,0,0,D,L,j,z,D,L);break;case Y.Bg:null==(y=null==(m=P.current)?void 0:m.getContext("2d"))||y.drawImage(S,0,0,D,L,j,z,D,L)}if(M)continue;null==S||S.close()}}}catch(e){b.e(e)}finally{b.f()}}},{key:"showFloatBar",value:function(e,t,r){var n=this.getView(e),i=null==n?void 0:n.displayer.vDom;i&&i.showFloatBar(t,r)}},{key:"setActiveTextEditor",value:function(e,t){var r=this.getView(e),n=null==r?void 0:r.displayer.vDom;n&&n.setActiveTextEditor(t)}}]),e}();k(ku,"defaultCameraOpt",{centerX:0,centerY:0,scale:1}),k(ku,"defaultScreenCanvasOpt",{autoRender:!1,contextType:H.Canvas2d}),k(ku,"defaultLayerOpt",{offscreen:!0,handleEvent:!1,depth:!1});var Eu=function(){function e(t,r,n){var i=this;x(this,e),k(this,"viewId"),k(this,"control"),k(this,"internalMsgEmitter"),k(this,"commiter"),k(this,"cachePoint"),k(this,"cacheCursorPoint"),k(this,"active",!0),k(this,"mousedown",(function(e){if(i.active&&0===e.button&&i.viewId){i.control.worker.checkDrawingWork(i.viewId),i.reflashContainerOffset();var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener(G.Start,t,i.viewId)}})),k(this,"mousemove",(function(e){if(i.active&&i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener(G.Doing,t,i.viewId)}})),k(this,"mouseup",(function(e){if(i.active&&0===e.button&&i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener(G.Done,t,i.viewId),i.cachePoint=void 0}})),k(this,"touchstart",(function(e){var t;if(i.active){if(!Tu(e))return i.control.worker.unWritable(),void(i.viewId&&i.control.worker.removeDrawingWork(i.viewId));if(i.viewId){if(!i.control.worker.isAbled()){var r=null==(t=i.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&i.control.effectViewContainer(r)}i.control.worker.checkDrawingWork(i.viewId),i.reflashContainerOffset();var n=i.getPoint(e);i.cachePoint=n,n&&i.control.worker.originalEventLintener(G.Start,n,i.viewId)}}})),k(this,"touchmove",(function(e){if(i.active){if(!Tu(e))return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener(G.Doing,t,i.viewId)}}})),k(this,"touchend",(function(e){if(i.active){if(!Tu(e)||!i.control.worker.isAbled())return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener(G.Done,t,i.viewId),i.cachePoint=void 0}}})),k(this,"cursorMouseMove",C.throttle((function(e){var t=i.getPoint(e);i.cacheCursorPoint&&C.isEqual(t,i.cacheCursorPoint)||!i.viewId||(i.cacheCursorPoint=t,t&&i.control.worker.sendCursorEvent(t,i.viewId))}),30,{leading:!1})),k(this,"cursorMouseLeave",C.throttle((function(){i.viewId&&(i.cacheCursorPoint=[void 0,void 0],i.control.worker.sendCursorEvent(i.cacheCursorPoint,i.viewId))}),30,{leading:!1})),k(this,"keydown",(function(e){i.control.hotkeyManager.colloctHotkey(e)})),this.viewId=t,this.control=r,this.internalMsgEmitter=n;var o={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new Su(o)}var t;return S(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case U.Text:case U.Pencil:case U.LaserPen:case U.Arrow:case U.Straight:case U.Rectangle:case U.Ellipse:case U.Star:case U.Polygon:case U.SpeechBalloon:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===U.Text?"cursor-text":r===U.Pencil||r===U.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"updateSize",value:function(){this.setCanvassStyle(),this.reflashContainerOffset()}},{key:"setViewId",value:function(e){this.viewId=e}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.control.cursor.clearViewCursor(this.viewId),this.internalMsgEmitter.removeAllListeners([B.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Mu(e);if(t&&C.isNumber(t.x)&&C.isNumber(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=c(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener(G.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),e.addEventListener("touchstart",this.touchstart,{capture:!0,passive:!1}),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,{capture:!0,passive:!1}),window.addEventListener("mouseup",this.mouseup,!1),window.addEventListener("touchmove",this.touchmove,{capture:!0,passive:!1}),window.addEventListener("touchend",this.touchend,{capture:!0,passive:!1}),e.addEventListener("mousemove",this.cursorMouseMove,!1),e.addEventListener("mouseleave",this.cursorMouseLeave,!1),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}(),Au=function(){function e(t,r){var n=this;x(this,e),k(this,"viewId",bs),k(this,"control"),k(this,"internalMsgEmitter"),k(this,"commiter"),k(this,"cachePoint"),k(this,"cacheCursorPoint"),k(this,"active",!0),k(this,"mousedown",(function(e){if(n.active&&0===e.button){n.control.worker.checkDrawingWork(n.viewId),n.reflashContainerOffset();var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener(G.Start,t,n.viewId)}})),k(this,"mousemove",(function(e){if(n.active){var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener(G.Doing,t,n.viewId)}})),k(this,"mouseup",(function(e){if(n.active&&0===e.button){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener(G.Done,t,n.viewId),n.cachePoint=void 0}})),k(this,"touchstart",(function(e){var t;if(n.active){if(!Tu(e))return n.control.worker.unWritable(),void(n.viewId&&n.control.worker.removeDrawingWork(n.viewId));if(!n.control.worker.isAbled()){var r=null==(t=n.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&n.control.effectViewContainer(r)}n.control.worker.checkDrawingWork(n.viewId),n.reflashContainerOffset();var i=n.getPoint(e);n.cachePoint=i,i&&n.control.worker.originalEventLintener(G.Start,i,n.viewId)}})),k(this,"touchmove",(function(e){if(n.active){if(!Tu(e))return n.control.worker.unWritable(),void(n.viewId&&n.control.worker.removeDrawingWork(n.viewId));var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener(G.Doing,t,n.viewId)}})),k(this,"touchend",(function(e){if(n.active)if(Tu(e)&&n.control.worker.isAbled()){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener(G.Done,t,n.viewId),n.cachePoint=void 0}else n.control.worker.removeDrawingWork(n.viewId)})),k(this,"cursorMouseMove",C.throttle((function(e){var t=n.getPoint(e);n.cacheCursorPoint&&C.isEqual(t,n.cacheCursorPoint)||(n.cacheCursorPoint=t,t&&n.control.worker.sendCursorEvent(t,n.viewId))}),30,{leading:!1})),k(this,"cursorMouseLeave",C.throttle((function(){n.cacheCursorPoint=[void 0,void 0],n.control.worker.sendCursorEvent(n.cacheCursorPoint,n.viewId)}),30,{leading:!1})),k(this,"keydown",(function(e){n.control.hotkeyManager.colloctHotkey(e)})),this.control=t,this.internalMsgEmitter=r;var i={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new Su(i)}var t;return S(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case U.Text:case U.Pencil:case U.LaserPen:case U.Arrow:case U.Straight:case U.Rectangle:case U.Ellipse:case U.Star:case U.Polygon:case U.SpeechBalloon:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===U.Text?"cursor-text":r===U.Pencil||r===U.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"updateSize",value:function(){this.setCanvassStyle()}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.control.cursor.destroy(),this.internalMsgEmitter.removeAllListeners([B.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Mu(e);if(t&&C.isNumber(t.x)&&C.isNumber(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=c(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener(G.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,{capture:!1,passive:!1}),window.addEventListener("mouseup",this.mouseup,!1),e.addEventListener("touchstart",this.touchstart,{capture:!0,passive:!1}),window.addEventListener("touchmove",this.touchmove,{capture:!0,passive:!1}),window.addEventListener("touchend",this.touchend,{capture:!0,passive:!1}),e.addEventListener("mousemove",this.cursorMouseMove,!0),e.addEventListener("mouseleave",this.cursorMouseLeave,!0),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}(),Iu="index-module__Container__nLsM3",Cu="index-module__CanvasBox__j2Xe-",Pu="index-module__FloatCanvas__d1YR7",Nu="index-module__TopFloatCanvas__7IaCw",Ou="index-module__SnapshotBox__--eeE",Ru="index-module__FloatBar__cm-EL",Du="index-module__RotateBtn__HSSkf",Lu="index-module__ResizeBtn__yjvda",ju="index-module__CursorBox__2UHvI",zu="index-module__TextEditorContainer__Qm8KC",Bu="index-module__ResizeTowBox__HOllX",Fu="index-module__FloatBarBtn__FJrOG",Uu={delete:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDZ2NmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY2aDBtMS0yYTIgMiAwIDAgMSAyLTJoMmEyIDIgMCAwIDEgMiAyaDBNMyA0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",duplicate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0xMSAySDZhMSAxIDAgMCAwLTEgMXY4YTEgMSAwIDAgMCAxIDFoNmExIDEgMCAwIDAgMS0xVjRoMGwtMi0yeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PHBhdGggZD0iTTExIDJ2MWExIDEgMCAwIDAgMSAxaDFsLTItMnoiLz48cGF0aCBkPSJNOSAxNEg0YTEgMSAwIDAgMS0xLTFWNWgwIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48L2c+PC9zdmc+","layer-pressed":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzMzODFGRiIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",layer:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",rotate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEzIDZhNiA2IDAgMSAxLTMuNzA5IDEuMjgzIi8+PHBhdGggZD0ibTEzIDYgMS40MTQgMi40NUwxMyA2bDIuNDUtMS40MTQiLz48L2c+PC9zdmc+","rotation-button":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+",rotation:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjRkZGIiBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+","font-colors-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","font-colors":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","to-bottom":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDEwdjhtMCAwLTItMm0yIDIgMi0ybS00IDZoMTJtLTYtNGg2bS02LTRoNm0tNi00aDYiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+","to-top":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDIydi04bTAgMC0yIDJtMi0yIDIgMm0tNC02aDEybS02IDRoNm0tNiA0aDZtLTYgNGg2IiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","bold-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",bold:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","underline-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",underline:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","italic-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",italic:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","unlock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiMzMzgxRkYiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0xYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDN2MyIgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+","lock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiM0NDRFNjAiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0zYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDV2MyIgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+",shapes:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","shapes-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","font-style-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","font-style":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",polygon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==","polygon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","polygon-vertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTA3NyAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU0My40NzQ1MjYgNDIuMzA3MzY4YTExOS4zNzY4NDIgMTE5LjM3Njg0MiAwIDAgMSAxMTAuODA3NTc5IDE2My44NGwxOTAuNTcxNzkgMTM4LjYxNzI2NGExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEgODMuMzc1MTU4IDIxOC43MDQ4NDJsLTc0LjMyMDg0MiAyMjguODM3MDUyYTExOS4zMjI5NDcgMTE5LjMyMjk0NyAwIDAgMS02MS4yNzgzMTYgMjIxLjg4NDYzMmMtNDYuNzgwNjMyIDAtODcuMzA5NDc0LTI2Ljk0NzM2OC0xMDYuODczMjYzLTY2LjEyODg0MmgtMjg5LjQxNDczN2ExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEtMTc5LjczODk0OC0xNDcuODMzMjYzbC03Mi4yNzI4NDItMjIyLjY5MzA1My0zLjM5NTM2OCAwLjEwNzc4OUExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAwIDEgMjEuODI3MzY4IDQ2Ni43Mjg0MjFMMjEuNTU3ODk1IDQ1OC4yMTMwNTNhMTE5LjM3Njg0MiAxMTkuMzc2ODQyIDAgMCAxIDE4My44MzQ5NDctMTAwLjUxMzY4NWwyMjMuNTAxNDc0LTE2Mi4zODQ4NDJhMTE5LjQzMDczNyAxMTkuNDMwNzM3IDAgMCAxIDExNC41ODAyMS0xNTMuMDYxMDUyek0yODkuNDE0NzM3IDg0MC4wNTcyNjNhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6IG01MDMuMTYxMjYzIDBhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6TTQ2Mi42ODYzMTYgMjQ5LjU4NjUyNkwyNDguMTMxMzY4IDQwNS41NTc4OTVhMTE5LjMyMjk0NyAxMTkuMzIyOTQ3IDAgMCAxLTQyLjg0NjMxNSAxNTMuMjIyNzM3bDcwLjcwOTg5NCAyMTcuMzU3NDczYTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMSAxMzIuNDE5MzY5IDEwOC4yMjA2MzJINjczLjY4NDIxMWExMTkuNDMwNzM3IDExOS40MzA3MzcgMCAwIDEgMTE5LjE2MTI2My0xMDguOTc1MTU4bDcxLjE0MTA1Mi0yMTguOTc0MzE2YTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMS02Mi4wODY3MzctMTY0LjIxNzI2M2wtMTg2LjM2OC0xMzUuMjc1Nzg5Yy0xOS45OTQ5NDcgMTUuMDkwNTI2LTQ1LjAwMjEwNSAyNC4xNDQ4NDItNzIuMDU3MjYzIDI0LjE0NDg0MmExMTguOTQ1Njg0IDExOC45NDU2ODQgMCAwIDEtODAuNzg4MjEtMzEuNDc0NTI3eiBtLTMyMS43NTE1NzkgMTUzLjkyMzM2OWE1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQwNjMxNiA1NC43MDMxNTggNTQuNzAzMTU4IDAgMCAwIDAtMTA5LjQwNjMxNnogbTc2Ny43MzA1MjYtMTIuNTU3NDc0YTU0LjcwMzE1OCA1NC43MDMxNTggMCAxIDAgMCAxMDkuNDA2MzE2IDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE2eiBtLTM2NS4xOTA3MzctMjg0LjAyNTI2M2E1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQ2MDIxIDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE1eiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",star:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","star-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","star-innerVertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTg1LjMzMzMzMyAwYTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODEuNDA4IDU5LjczMzMzM2g0OC4yMTMzMzR2ODUuMzMzMzM0TDE3MC42NjY2NjcgMTQ0Ljk4MTMzM1Y4NTMuMzMzMzMzaDY5My4zMzMzMzNsLTI2LjQ1MzMzMy02My40ODggNzguNzYyNjY2LTMyLjc2OCAzMi44NTMzMzQgNzguNzYyNjY3LTQyLjI0IDE3LjQ5MzMzM0g5MzguNjY2NjY3YTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODQuNzM2IDc1LjM0OTMzNEwxMDI0IDkzOC42NjY2NjdhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS0xNzAuNjY2NjY3IDBIMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxLTg1LjMzMzMzNC04NS4zMzMzMzRWMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxIDAtMTcwLjY2NjY2N3ogbTc2NS4zNTQ2NjcgNTk5LjQ2NjY2N2wzMi44NTMzMzMgNzguNzYyNjY2LTc4Ljg0OCAzMi44NTMzMzQtMzIuNzY4LTc4Ljc2MjY2NyA3OC43NjI2NjctMzIuODUzMzMzeiBtLTY1LjcwNjY2Ny0xNTcuNTI1MzM0bDMyLjg1MzMzNCA3OC43NjI2NjctNzguNzYyNjY3IDMyLjg1MzMzMy0zMi43NjgtNzguNzYyNjY2IDc4Ljc2MjY2Ny0zMi44NTMzMzR6TTcxOS4zNiAyODQuNDE2bDMyLjg1MzMzMyA3OC43NjI2NjctNzguNzYyNjY2IDMyLjg1MzMzMy0zMi44NTMzMzQtNzguNzYyNjY3IDc4Ljc2MjY2Ny0zMi44NTMzMzN6IG0tNjUuNjIxMzMzLTE1Ny41MjUzMzNsMzIuODUzMzMzIDc4Ljc2MjY2Ni03OC43NjI2NjcgMzIuODUzMzM0LTMyLjg1MzMzMy03OC43NjI2NjcgNzguNzYyNjY3LTMyLjg1MzMzM3pNMzg1LjcwNjY2NyA1OS43MzMzMzN2ODUuMzMzMzM0aC04NS4zMzMzMzR2LTg1LjMzMzMzNGg4NS4zMzMzMzR6IG0xNzAuNjY2NjY2IDB2ODUuMzMzMzM0aC04NS4zMzMzMzN2LTg1LjMzMzMzNGg4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIiA+PC9wYXRoPjwvc3ZnPg==","star-innerRatio":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU2OS4zNDQgNDQ5LjUzNmwxNDYuOTQ0IDI4LjY3MiAxLjAyNC00LjYwOHY0LjYwOGgxLjAyNGM5LjcyOCAwIDE2Ljg5Ni03LjY4IDIwLjQ4LTE0Ljg0OGwxLjAyNC0yLjA0OHYtMi41NmMwLTUuNjMyIDAtMTEuMjY0LTUuMTItMTYuMzg0LTMuMDcyLTMuMDcyLTcuMTY4LTcuMTY4LTEyLjgtNy42OGwtMTI0LjkyOC0yNC4wNjRMNTQxLjY5NiAyODYuNzJjLTIuMDQ4LTQuNjA4LTYuNjU2LTguMTkyLTExLjc3Ni05LjcyOC01LjEyLTEuNTM2LTEwLjc1Mi0xLjUzNi0xNS4zNiAxLjAyNGwtMS41MzYgMC41MTItMS4wMjQgMS4wMjRjLTguMTkyIDguMTkyLTEwLjc1MiAxOS40NTYtNi42NTYgMjcuMTM2bDY0IDE0Mi44NDh6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PHBhdGggZD0iTTkzMS4zMjggNDAzLjQ1NmMtMTAuMjQtMzUuMzI4LTM4LjQtNjEuNDQtNzEuNjgtNjYuNTZsLTE4NC44MzItMzUuODQtODIuNDMyLTE4Mi43ODRjLTEyLjgtMzMuMjgtNDYuMDgtNTYuMzItODAuMzg0LTU2LjMyLTMzLjc5MiAwLTY0LjUxMiAyMC40OC03OS44NzIgNTMuNzZMMzQ5LjE4NCAyOTkuMDA4bC0xODQuMzIgMzUuMzI4Yy0zMy43OTIgNS4xMi02MS45NTIgMzEuMjMyLTcyLjE5MiA2Ni41Ni05LjcyOCAzNC4zMDQtMS4wMjQgNzIuMTkyIDIzLjA0IDk4LjgxNmwxMzEuNTg0IDEzMy42MzItMzUuODQgMTk2LjYwOGMtNS42MzIgMzQuODE2IDguNzA0IDcxLjY4IDM1Ljg0IDk0LjIwOCAxMy44MjQgMTEuMjY0IDM0LjMwNCAxOC40MzIgNTIuMjI0IDE4LjQzMiAxNi44OTYgMCAyOS42OTYtMy4wNzIgNDEuNDcyLTEwLjI0bDE2OC45Ni05MS4xMzYgMTY2LjkxMiA5MS4xMzYgMS4wMjQgMC41MTJjMTYuODk2IDYuNjU2IDI5LjY5NiA5LjcyOCA0MC40NDggOS43MjggMTQuMzM2IDAgMjcuNjQ4LTQuMDk2IDQwLjQ0OC03LjY4IDQuNjA4LTEuNTM2IDkuNzI4LTMuMDcyIDE0Ljg0OC00LjA5NmwyLjU2LTAuNTEyIDIuMDQ4LTEuNTM2YzI1LjA4OC0yMy4wNCAzNy44ODgtNTguODggMzIuNzY4LTkzLjY5NmwtMzMuMjgtMTk2LjYwOCAxMzEuNTg0LTEzNi4xOTJjMjQuMDY0LTI3LjY0OCAzMi4yNTYtNjIuOTc2IDIyLjAxNi05OC44MTZ6TTI3Ni45OTIgODM2LjA5Nmw0MS45ODQtMjMxLjkzNi0xNTcuMTg0LTE1OS4yMzJjLTUuNjMyLTUuNjMyLTguMTkyLTE3LjQwOC02LjY1Ni0yOS4xODQgMy41ODQtMTAuMjQgMTAuMjQtMTYuMzg0IDE5LjQ1Ni0xNy45MmwyMTguMTEyLTQxLjk4NCA5Ni4yNTYtMjE1LjU1MmMzLjA3Mi03LjE2OCAxMi44LTE0LjMzNiAyMC40OC0xNC4zMzZzMTcuNDA4IDcuMTY4IDIwLjQ4IDE0Ljg0OGw5OC4zMDQgMjE1LjA0IDIxOC4xMTIgNDEuOTg0YzcuMTY4IDEuNTM2IDE1LjM2IDcuMTY4IDE2Ljg5NiAxNi4zODR2My4wNzJjMi4wNDggMTEuNzc2LTAuNTEyIDIyLjUyOC02LjY1NiAzMC43Mkw2OTkuOTA0IDYwOS4yOGwzOS45MzYgMjMxLjQyNGMxLjUzNiAxMC43NTItMi4wNDggMjAuNDgtMTAuMjQgMjcuMTM2bC0xLjAyNCAwLjUxMmMtMi41NiAyLjU2LTYuNjU2IDQuMDk2LTExLjI2NCA0LjA5Ni0yLjA0OCAwLTcuMTY4LTEuNTM2LTExLjI2NC0zLjU4NGwtMTk3LjEyLTEwOC4wMzItMTk5LjE2OCAxMDIuOTEyYy00LjA5NiAyLjA0OC05LjIxNiAzLjU4NC0xMS43NzYgMy41ODQtNC42MDggMC04LjcwNC0xLjUzNi0xMS4yNjQtNC4wOTZsLTEuMDI0LTAuNTEyYy02LjY1Ni02LjE0NC0xMC43NTItMTYuMzg0LTguNzA0LTI2LjYyNHoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=",speechBallon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=","speechBallon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48L3N2Zz4=","speechBallon-placement":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU3NiAyMTMuMzMzMzMzbDIyLjYxMzMzMyAyMi42MTMzMzRhMzIgMzIgMCAwIDAgMC00NS4yMjY2NjdMNTc2IDIxMy4zMzMzMzN6IG0tNjIuNzItMTA3Ljk0NjY2NmEzMiAzMiAwIDEgMC00NS4yMjY2NjcgNDUuMjI2NjY2bDQ1LjIyNjY2Ny00NS4yMjY2NjZ6IG0tNDUuMjI2NjY3IDE3MC42NjY2NjZhMzIgMzIgMCAwIDAgNDUuMjI2NjY3IDQ1LjIyNjY2N2wtNDUuMjI2NjY3LTQ1LjIyNjY2N3pNNDQ4IDgxMC42NjY2NjdsLTIyLjYxMzMzMy0yMi42MTMzMzRhMzIgMzIgMCAwIDAgMCA0NS4yMjY2NjdsMjIuNjEzMzMzLTIyLjYxMzMzM3ogbTEwNy45NDY2NjctNjIuNzJhMzIgMzIgMCAxIDAtNDUuMjI2NjY3LTQ1LjIyNjY2N2w0NS4yMjY2NjcgNDUuMjI2NjY3eiBtLTQ1LjIyNjY2NyAxNzAuNjY2NjY2YTMyIDMyIDAgMSAwIDQ1LjIyNjY2Ny00NS4yMjY2NjZsLTQ1LjIyNjY2NyA0NS4yMjY2NjZ6TTgxMC42NjY2NjcgNTc2bC0yMi42MTMzMzQgMjIuNjEzMzMzYTMyIDMyIDAgMCAwIDQ1LjIyNjY2NyAwTDgxMC42NjY2NjcgNTc2eiBtMTA3Ljk0NjY2Ni02Mi43MmEzMiAzMiAwIDEgMC00NS4yMjY2NjYtNDUuMjI2NjY3bDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAtNDUuMjI2NjY3IDQ1LjIyNjY2N2w0NS4yMjY2NjctNDUuMjI2NjY3ek0yMTMuMzMzMzMzIDQ0OGwyMi42MTMzMzQtMjIuNjEzMzMzYTMyIDMyIDAgMCAwLTQ1LjIyNjY2NyAwbDIyLjYxMzMzMyAyMi42MTMzMzN6IG02Mi43MiAxMDcuOTQ2NjY3YTMyIDMyIDAgMCAwIDQ1LjIyNjY2Ny00NS4yMjY2NjdsLTQ1LjIyNjY2NyA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAgNDUuMjI2NjY2IDQ1LjIyNjY2N2wtNDUuMjI2NjY2LTQ1LjIyNjY2N3pNMzA5LjMzMzMzMyAyMTMuMzMzMzMzQTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMjM0LjY2NjY2NyAyODh2NjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDM3My4zMzMzMzMgMjEzLjMzMzMzM2gtNjR6TTIzNC42NjY2NjcgMjg4QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMTYwIDIxMy4zMzMzMzNoLTY0QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAyMzQuNjY2NjY3IDM1MnYtNjR6TTE2MCAyMTMuMzMzMzMzYzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2NnYtNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDk2IDIxMy4zMzMzMzNoNjR6TTIzNC42NjY2NjcgMTM4LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NiA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIzNC42NjY2NjcgNzQuNjY2NjY3djY0ek0zNDEuMzMzMzMzIDI0NS4zMzMzMzNoMjM0LjY2NjY2N3YtNjRIMzQxLjMzMzMzM3Y2NHogbTI1Ny4yOC01NC42MTMzMzNsLTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NiA4NS4zMzMzMzQgODUuMzMzMzM0IDQ1LjIyNjY2Ni00NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsLTg1LjMzMzMzNCA4NS4zMzMzMzMgNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2Njd6TTY1MC42NjY2NjcgODEwLjY2NjY2N2ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2NiAxMzguNjY2NjY2di02NEE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxIDcxNC42NjY2NjcgODEwLjY2NjY2N2gtNjR6IG0xMzguNjY2NjY2IDEzOC42NjY2NjZBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDkyOCA4MTAuNjY2NjY3aC02NGE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxLTc0LjY2NjY2NyA3NC42NjY2NjZ2NjR6TTkyOCA4MTAuNjY2NjY3YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY3LTEzOC42NjY2Njd2NjRjNDEuMjE2IDAgNzQuNjY2NjY3IDMzLjQ1MDY2NyA3NC42NjY2NjcgNzQuNjY2NjY3aDY0eiBtLTEzOC42NjY2NjctMTM4LjY2NjY2N0ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgNjUwLjY2NjY2NyA4MTAuNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY2LTc0LjY2NjY2N3YtNjR6IG0tMTA2LjY2NjY2NiAxMDYuNjY2NjY3aC0yMzQuNjY2NjY3djY0SDY4Mi42NjY2Njd2LTY0eiBtLTIxMi4wNTMzMzQgNTQuNjEzMzMzbDg1LjMzMzMzNC04NS4zMzMzMzMtNDUuMjI2NjY3LTQ1LjIyNjY2Ny04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsODUuMzMzMzMzIDg1LjMzMzMzMyA0NS4yMjY2NjctNDUuMjI2NjY2LTg1LjMzMzMzNC04NS4zMzMzMzQtNDUuMjI2NjY2IDQ1LjIyNjY2N3pNNjcyIDIzNC42NjY2NjdBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDgxMC42NjY2NjcgMzczLjMzMzMzM3YtNjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjctNzQuNjY2NjY2aC02NHpNODEwLjY2NjY2NyAzNzMuMzMzMzMzYTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAxMzguNjY2NjY2LTEzOC42NjY2NjZoLTY0QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgODEwLjY2NjY2NyAzMDkuMzMzMzMzdjY0eiBtMTM4LjY2NjY2Ni0xMzguNjY2NjY2QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCA4MTAuNjY2NjY3IDk2djY0YzQxLjIxNiAwIDc0LjY2NjY2NyAzMy40NTA2NjcgNzQuNjY2NjY2IDc0LjY2NjY2N2g2NHpNODEwLjY2NjY2NyA5NmExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAtMTM4LjY2NjY2NyAxMzguNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2N3YtNjR6TTc3OC42NjY2NjcgMzQxLjMzMzMzM3YyMzQuNjY2NjY3aDY0VjM0MS4zMzMzMzNoLTY0eiBtNTQuNjEzMzMzIDI1Ny4yOGw4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2NjctODUuMzMzMzM0IDg1LjMzMzMzNCA0NS4yMjY2NjcgNDUuMjI2NjY2eiBtMC00NS4yMjY2NjZsLTg1LjMzMzMzMy04NS4zMzMzMzQtNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2Ny00NS4yMjY2NjZ6TTEzOC42NjY2NjcgNzg5LjMzMzMzM2MwLTQxLjIxNiAzMy40NTA2NjctNzQuNjY2NjY3IDc0LjY2NjY2Ni03NC42NjY2NjZ2LTY0YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY2IDEzOC42NjY2NjZoNjR6TTIxMy4zMzMzMzMgNzE0LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NyA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIxMy4zMzMzMzMgNjUwLjY2NjY2N3Y2NHogbTc0LjY2NjY2NyA3NC42NjY2NjZBNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMSAyMTMuMzMzMzMzIDg2NHY2NGExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2Ny0xMzguNjY2NjY3aC02NHpNMjEzLjMzMzMzMyA4NjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjYtNzQuNjY2NjY3aC02NEExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMjEzLjMzMzMzMyA5Mjh2LTY0ek0yNDUuMzMzMzMzIDY4Mi42NjY2Njd2LTIzNC42NjY2NjdoLTY0VjY4Mi42NjY2NjdoNjR6IG0tNTQuNjEzMzMzLTIxMi4wNTMzMzRsODUuMzMzMzMzIDg1LjMzMzMzNCA0NS4yMjY2NjctNDUuMjI2NjY3LTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NnogbTAtNDUuMjI2NjY2bC04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2NjcgODUuMzMzMzM0LTg1LjMzMzMzNC00NS4yMjY2NjctNDUuMjI2NjY2eiIgIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4="};function Wu(e){return Uu[e]}var Gu=function(e){var t=e.workIds,r=e.mananger;return N.createElement("div",{className:"button normal-button",style:{touchAction:"none"},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.DeleteNode,{workIds:t||[va],viewId:r.viewId})},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.DeleteNode,{workIds:t||[va],viewId:r.viewId})}},N.createElement("img",{alt:"icon",src:Wu("delete")}))},Vu=function(e){var t=e.workIds,r=e.viewId;return N.createElement("div",{className:"button normal-button",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.CopyNode,{workIds:t||[va],viewId:r})},onTouchEnd:function(e){e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.CopyNode,{workIds:t||[va],viewId:r})}},N.createElement("img",{alt:"icon",src:Wu("duplicate")}))},Hu=function(e){var t=e.icon,r=e.onClickHandler,n=e.onTouchEndHandler;return N.createElement("div",{className:"button normal-button",onClick:r,onTouchEnd:n},N.createElement("img",{src:Wu(t)}))},Yu=function(e){var t=e.open,r=e.setOpen,n=e.style,i=N.useContext(Gl),o=i.floatBarData,a=i.mananger,s=d(N.useState([]),2),u=s[0],l=s[1],c=N.useMemo((function(){if(n&&n.bottom){var e={top:"inherit",bottom:50};return e}}),[n]),h=N.useMemo((function(){return t?N.createElement("div",{className:"image-layer-menu",style:c},N.createElement(Hu,{icon:"to-top",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.ZIndexNode,{workIds:[va],layer:X.Top,viewId:null==a?void 0:a.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.ZIndexNode,{workIds:[va],layer:X.Top,viewId:null==a?void 0:a.viewId})}}),N.createElement(Hu,{icon:"to-bottom",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.ZIndexNode,{workIds:[va],layer:X.Bottom,viewId:null==a?void 0:a.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.ZIndexNode,{workIds:[va],layer:X.Bottom,viewId:null==a?void 0:a.viewId})}})):null}),[t,c]);return N.useEffect((function(){os(null==o?void 0:o.selectIds,u)||null!=o&&o.selectIds&&!os(null==o?void 0:o.selectIds,u)&&(l(null==o?void 0:o.selectIds),r(!1))}),[t,o,u,r]),N.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},h,N.createElement("img",{alt:"icon",src:Wu(t?"layer-pressed":"layer")}))},$u=function(){return N.createElement("svg",{style:{marginLeft:"2px"},viewBox:"0 0 1025 1024",width:"14",height:"14"},N.createElement("path",{d:"M1016.5248 493.8752c-9.984-9.984-26.2144-9.984-36.1984 0l-183.6032 183.6032c-29.952 29.952-78.6944 29.952-108.5952 0l-239.2064-239.2064c-14.4384-14.4384-22.3744-33.6896-22.3744-54.3232s7.936-39.8848 22.3744-54.3232l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984s-26.2144-9.984-36.1984 0l-183.6032 183.6032c-24.1152 24.1152-37.376 56.2176-37.376 90.5216 0 14.592 2.4576 28.8256 7.0656 42.1888l-374.8864 374.8864c-4.8128 4.8128-7.4752 11.3152-7.4752 18.1248l0 76.8c0 14.1312 11.4688 25.6 25.6 25.6l486.4 0c6.8096 0 13.312-2.7136 18.1248-7.4752l170.0864-170.0864c13.3632 4.6592 27.5968 7.0656 42.1888 7.0656 34.2528 0 66.4064-13.2608 90.5216-37.376l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984zM501.4016 870.4l-450.2016 0 0-40.6016 358.5024-358.5024c1.024 1.0752 1.9968 2.1504 3.0208 3.1744l239.2064 239.2064c1.024 1.024 2.0992 2.048 3.1744 3.0208l-153.7024 153.7024z",fill:"#000000"}))},Xu=function(e){var t=e.activeColor,r=e.onClickHandler,n=e.onTouchEndHandler;return N.createElement("div",{className:"font-color-button ".concat("transparent"===t?"active":""),onClick:r,onTouchEnd:n},N.createElement("div",{className:"circle none"}))},qu=function(e){var t=e.color,r=e.activeColor,n=e.onClickHandler,i=e.onTouchEndHandler;return N.createElement("div",{className:"font-color-button ".concat(t===r?"active":""),onClick:n,onTouchEnd:i},N.createElement("div",{className:"circle",style:{backgroundColor:As(t,1)}}))},Qu=function(e){var t=e.opacity,r=e.activeColor,n=e.setCurOpacity,i=d(N.useState({x:108,y:0}),2),o=i[0],a=i[1];if(N.useEffect((function(){a({x:100*t+8,y:0})}),[]),!r)return null;var s=C.throttle((function(e,i){e.cancelable&&e.preventDefault(),e.stopPropagation(),i.x!==(null==o?void 0:o.x)&&a({x:i.x,y:0});var s=Math.min(Math.max(i.x-8,0),100)/100;t!==s&&n(s,r,G.Doing)}),100,{leading:!1}),u=C.throttle((function(e,t){e.cancelable&&e.preventDefault(),e.stopPropagation(),t.x!==(null==o?void 0:o.x)&&a({x:t.x,y:0});var i=Math.min(Math.max(t.x-8,0),100)/100;n(i,r,G.Done)}),100,{leading:!1});return N.createElement("div",{className:"font-color-opacity",style:{marginLeft:"10px"},onClick:function(e){var t=e.nativeEvent.offsetX,i=Math.min(Math.max(t-12,0),100)/100;a({x:100*i+8,y:0}),n(i,r,G.Done)}},N.createElement("div",{className:"range-color",style:{background:"linear-gradient(to right, ".concat(As(r,0),", ").concat(As(r,1),")")}}),N.createElement("div",{className:"range-opacity"},N.createElement(O,{bounds:"parent",axis:"x",position:o,onDrag:s,onStart:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t,r,G.Start)},onStop:u},N.createElement("div",{className:"circle",style:{backgroundColor:As(r,t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}}))))},Zu=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,o=N.useContext(Gl),a=o.floatBarData,s=o.floatBarColors,u=o.mananger,l=o.setFloatBarData,c=d(N.useState(),2),h=c[0],f=c[1],p=d(N.useState(1),2),v=p[0],g=p[1];N.useEffect((function(){if(null!=a&&a.strokeColor){var e=d(Cs(a.strokeColor),2),t=e[0],r=e[1];f(t),g(r)}}),[a]);var m=N.useMemo((function(){if(null!=n&&n.current&&C.isNumber(null==a?void 0:a.y)&&null!=u&&u.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>180){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==u?void 0:u.height)-n.current.offsetTop-a.y<120){var t={top:"inherit",bottom:50};return t}}}),[n,null==a?void 0:a.y,u]),y=N.useMemo((function(){return N.createElement(Qu,{key:"strokeColors",opacity:v,activeColor:h,setCurOpacity:function(e,t,r){r===G.Start&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!0),r===G.Done&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!1),g(e);var n=As(t,e);null!=a&&a.strokeColor&&(a.strokeColor=n,l({strokeColor:n})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],strokeColor:n,workState:r,viewId:null==u?void 0:u.viewId})}})}),[v,h,null==u?void 0:u.control.room,null==u?void 0:u.viewId,a]),_=N.useMemo((function(){return t?N.createElement("div",{className:"font-colors-menu",style:m,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},s.concat().map((function(e,t){var r=Es.apply(void 0,i(e));return N.createElement(qu,{key:t,color:r,activeColor:h,onTouchEndHandler:function(e){e.stopPropagation(),f(r);var t=As(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,l({strokeColor:t})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],workState:G.Done,strokeColor:t,viewId:null==u?void 0:u.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=As(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,l({strokeColor:t})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],workState:G.Done,strokeColor:t,viewId:null==u?void 0:u.viewId})}})})),y):null}),[t,s,y,h,v,a,null==u?void 0:u.viewId,m]),b=N.useMemo((function(){return h?N.createElement("div",{className:"color-bar-ring",style:{backgroundColor:As(h,v)}},N.createElement("div",{className:"circle"})):null}),[h,v]);return N.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},b,_)},Ku=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,o=N.useContext(Gl),a=o.floatBarData,s=o.floatBarColors,u=o.mananger,l=o.setFloatBarData,c=d(N.useState(),2),h=c[0],f=c[1],p=d(N.useState(1),2),v=p[0],g=p[1];N.useEffect((function(){if(null!=a&&a.fillColor){var e=d("transparent"===(null==a?void 0:a.fillColor)&&["transparent",1]||Cs(a.fillColor),2),t=e[0],r=e[1];f(t),g(r)}}),[a]);var m=N.useMemo((function(){if(null!=n&&n.current&&C.isNumber(null==a?void 0:a.y)&&null!=u&&u.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==u?void 0:u.height)-n.current.offsetTop-a.y<140){var t={top:"inherit",bottom:50};return t}}}),[n,null==a?void 0:a.y,u]),y=N.useMemo((function(){return h&&"transparent"!==h?N.createElement(Qu,{key:"fillColors",opacity:v||0,activeColor:h,setCurOpacity:function(e,t,r){r===G.Start&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!0),r===G.Done&&null!=u&&u.control.room&&(u.control.room.disableDeviceInputs=!1),g(e);var n=As(t,e);null!=a&&a.fillColor&&(a.fillColor=n,l({fillColor:n})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],fillColor:h&&As(t,e),workState:r,viewId:null==u?void 0:u.viewId})}}):null}),[h,v,null==u?void 0:u.control.room,null==u?void 0:u.viewId,a]),_=N.useMemo((function(){return t?N.createElement("div",{className:"font-colors-menu",style:m,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},N.createElement(Xu,{activeColor:h,onTouchEndHandler:function(e){e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],workState:G.Done,fillColor:t,viewId:null==u?void 0:u.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],workState:G.Done,fillColor:t,viewId:null==u?void 0:u.viewId})}}),s.map((function(e,t){var r=Es.apply(void 0,i(e));return N.createElement(qu,{key:t,color:r,activeColor:h,onTouchEndHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=As(r,v);null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],workState:G.Done,fillColor:t,viewId:null==u?void 0:u.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=As(r,v);null!=a&&a.fillColor&&(a.fillColor=t,l({fillColor:t})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:[va],workState:G.Done,fillColor:t,viewId:null==u?void 0:u.viewId})}})})),y):null}),[t,h,s,y,a,null==u?void 0:u.viewId,v,m]),b=N.useMemo((function(){var e=h&&"transparent"!==h&&As(h,v)||"transparent";return N.createElement("div",{className:"color-bar-fill"},N.createElement("div",{className:"circle",style:{backgroundColor:e}}))}),[h,v]);return N.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},b,_)},Ju=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,o=e.workIds,a=e.floatBarRef,s=N.useContext(Gl),u=s.floatBarColors,l=s.mananger,c=s.setFloatBarData,h=s.floatBarData,f=d(N.useState(),2),p=f[0],v=f[1],g=d(N.useState(1),2),m=g[0],y=g[1];N.useEffect((function(){if(null!=n&&n.fontColor){var e=d("transparent"===(null==n?void 0:n.fontColor)&&["transparent",0]||Cs(n.fontColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontColor]);var _=N.useMemo((function(){if(null!=a&&a.current&&C.isNumber(null==h?void 0:h.y)&&null!=l&&l.height){if(a.current.offsetTop&&a.current.offsetTop+h.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==l?void 0:l.height)-a.current.offsetTop-h.y<120){var t={top:"inherit",bottom:50};return t}}}),[a,null==h?void 0:h.y,l]),b=N.useMemo((function(){return p&&"transparent"!==p?N.createElement(Qu,{key:"fontColors",opacity:m,activeColor:p,setCurOpacity:function(e,t,r){r===G.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===G.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),y(e);var n=As(t,e);null!=h&&h.textOpt&&(h.textOpt.fontColor=n,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],fontColor:p&&n,workState:r,viewId:null==l?void 0:l.viewId})}}):null}),[p,m,null==l?void 0:l.control.room,null==l?void 0:l.viewId,null==h?void 0:h.textOpt,o]),x=N.useMemo((function(){return t?N.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},u.map((function(e,t){var r=Es.apply(void 0,i(e));return N.createElement(qu,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=As(r,m);null!=h&&h.textOpt&&(h.textOpt.fontColor=t,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],workState:G.Done,fontColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=As(r,m);null!=h&&h.textOpt&&(h.textOpt.fontColor=t,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],workState:G.Done,fontColor:t,viewId:null==l?void 0:l.viewId})}})})),b):null}),[t,u,b,p,m,null==h?void 0:h.textOpt,o,null==l?void 0:l.viewId,_]),w=N.useMemo((function(){var e=p&&"transparent"!==p&&As(p,m)||"transparent";return N.createElement("div",{className:"color-bar"},N.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,m]);return N.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},N.createElement("img",{alt:"icon",src:Wu("font-colors")}),w,x)},el=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,o=e.workIds,a=e.floatBarRef,s=N.useContext(Gl),u=s.floatBarColors,l=s.mananger,c=s.setFloatBarData,h=s.floatBarData,f=d(N.useState(),2),p=f[0],v=f[1],g=d(N.useState(1),2),m=g[0],y=g[1];N.useEffect((function(){if(null!=n&&n.fontBgColor){var e=d("transparent"===(null==n?void 0:n.fontBgColor)&&["transparent",1]||Cs(n.fontBgColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontBgColor]);var _=N.useMemo((function(){if(null!=a&&a.current&&C.isNumber(null==h?void 0:h.y)&&null!=l&&l.height){if(a.current.offsetTop&&a.current.offsetTop+h.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==l?void 0:l.height)-a.current.offsetTop-h.y<120){var t={top:"inherit",bottom:50};return t}}}),[a,null==h?void 0:h.y,l]),b=N.useMemo((function(){return p&&"transparent"!==p?N.createElement(Qu,{key:"fontBgColor",opacity:m||0,activeColor:p,setCurOpacity:function(e,t,r){r===G.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===G.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),y(e);var n=As(t,e);null!=h&&h.textOpt&&(h.textOpt.fontBgColor=n,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],fontBgColor:p&&As(t,e),workState:r,viewId:null==l?void 0:l.viewId})}}):null}),[p,m,null==l?void 0:l.control.room,null==l?void 0:l.viewId,null==h?void 0:h.textOpt,o]),x=N.useMemo((function(){return t?N.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},N.createElement(Xu,{activeColor:p,onTouchEndHandler:function(e){e.stopPropagation();var t="transparent";v(t),null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],workState:G.Done,fontBgColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation();var t="transparent";v(t),null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],workState:G.Done,fontBgColor:t,viewId:null==l?void 0:l.viewId})}}),u.map((function(e,t){var r=Es.apply(void 0,i(e));return N.createElement(qu,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=As(r,m);null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],workState:G.Done,fontBgColor:As(r,m),viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=As(r,m);null!=h&&h.textOpt&&(h.textOpt.fontBgColor=t,c({textOpt:h.textOpt})),Vs.emitMethod(B.MainEngine,z.SetColorNode,{workIds:o||[va],workState:G.Done,fontBgColor:As(r,m),viewId:null==l?void 0:l.viewId})}})})),b):null}),[t,u,b,m,p,null==h?void 0:h.textOpt,o,null==l?void 0:l.viewId,_]),w=N.useMemo((function(){var e=p&&"transparent"!==p&&As(p,m)||"transparent";return N.createElement("div",{className:"color-bar",style:{marginTop:0}},N.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,m]);return N.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},N.createElement($u,null),w,x)},tl=function(e){var t=e.bold,r=e.setBold,n=e.workIds,i=e.viewId,o=function(e){var o="bold"===t?"normal":"bold";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Vs.emitMethod(B.MainEngine,z.SetFontStyle,{workIds:n,viewId:i,bold:o})};return N.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},N.createElement("img",{alt:"icon",src:Wu("bold"===t?"bold-active":"bold")}))},rl=function(e){var t=e.underline,r=e.setUnderline,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Vs.emitMethod(B.MainEngine,z.SetFontStyle,{workIds:n,viewId:i,underline:o})};return N.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},N.createElement("img",{alt:"icon",src:Wu(t?"underline-active":"underline")}))},nl=function(e){var t=e.lineThrough,r=e.setLineThrough,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Vs.emitMethod(B.MainEngine,z.SetFontStyle,{workIds:n,viewId:i,lineThrough:o})};return N.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},N.createElement("img",{alt:"icon",src:Wu(t?"line-through-active":"line-through")}))},il=function(e){var t=e.italic,r=e.setItalic,n=e.workIds,i=e.viewId,o=function(e){var o="italic"===t?"normal":"italic";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),Vs.emitMethod(B.MainEngine,z.SetFontStyle,{workIds:n,viewId:i,italic:o})};return N.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},N.createElement("img",{alt:"icon",src:Wu("italic"===t?"italic-active":"italic")}))},ol=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,o=e.style,a=N.useContext(Gl).mananger,s=d(N.useState("normal"),2),u=s[0],l=s[1],c=d(N.useState("normal"),2),h=c[0],f=c[1],p=d(N.useState(!1),2),v=p[0],g=p[1],m=d(N.useState(!1),2),y=m[0],_=m[1];N.useEffect((function(){null!=n&&n.bold&&l(n.bold),ls(null==n?void 0:n.underline)&&g(n.underline||!1),ls(null==n?void 0:n.lineThrough)&&_(n.lineThrough||!1),null!=n&&n.italic&&f(n.italic)}),[n]);var b=N.useMemo((function(){if(o&&o.bottom){var e={top:"inherit",bottom:50};return e}}),[o]),x=N.useMemo((function(){return t?N.createElement("div",{className:"font-style-menu",style:b,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},N.createElement(tl,{workIds:i||[va],bold:u,setBold:l,viewId:null==a?void 0:a.viewId}),N.createElement(rl,{workIds:i||[va],underline:v,setUnderline:g,viewId:null==a?void 0:a.viewId}),N.createElement(nl,{workIds:i||[va],lineThrough:y,setLineThrough:_,viewId:null==a?void 0:a.viewId}),N.createElement(il,{workIds:i||[va],italic:h,setItalic:f,viewId:null==a?void 0:a.viewId})):null}),[t,i,u,null==a?void 0:a.viewId,v,y,h,b]);return N.createElement("div",{className:"button normal-button ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},N.createElement("img",{alt:"icon",src:Wu(t?"font-style-active":"font-style")}),x)},al=Object.freeze([12,14,18,24,36,48,64,80,144,288]),sl=["top","topLeft","topRight","bottom","bottomLeft","bottomRight","left","leftTop","leftBottom","right","rightTop","rightBottom"],ul=function(e){var t=e.style,r=e.onClickHandler;return N.createElement("div",{className:"font-size-menu",style:t,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},al.map((function(e){return N.createElement("div",{className:"font-size-btn",key:e,onClick:function(){r(e)},onTouchEnd:function(){r(e)}},e)})))},ll=function(e){var t=N.useRef(null),r=e.open,n=e.setOpen,i=e.textOpt,o=e.workIds,a=e.floatBarRef,s=N.useContext(Gl),u=s.mananger,l=s.floatBarData,c=d(N.useState(0),2),h=c[0],f=c[1],p=d(N.useState(),2),v=p[0],g=p[1],m=al.length-1;N.useEffect((function(){null!=i&&i.fontSize&&(f(i.fontSize),t.current&&(t.current.value=i.fontSize.toString()))}),[null==i?void 0:i.fontSize]);var y=N.useMemo((function(){if(null!=a&&a.current&&C.isNumber(null==l?void 0:l.y)&&null!=u&&u.height){if(a.current.offsetTop&&a.current.offsetTop+l.y>250){var e={top:"inherit",bottom:35};return e}if(!a.current.offsetTop&&(null==u?void 0:u.height)-a.current.offsetTop-l.y<180){var t={top:"inherit",bottom:35};return t}}}),[a,null==l?void 0:l.y,u]);var _=function(e){var r;null==(r=t.current)||r.blur(),n(!1),x(e)},b=N.useMemo((function(){return r?N.createElement(ul,{onClickHandler:_,style:y}):null}),[r,_,y]),x=function(e){e>al[m]&&(e=al[m]),e=al[0]&&e<=al[m]&&Vs.emitMethod(B.MainEngine,z.SetFontStyle,{workIds:o||[va],fontSize:e,viewId:null==u?void 0:u.viewId})}(e)};return N.useEffect((function(){return function(){null!=u&&u.control.room&&C.isBoolean(v)&&(u.control.room.disableDeviceInputs=v)}}),[u,v]),N.createElement("div",{className:"button normal-button font-size-barBtn",style:{width:50},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},N.createElement("input",{className:"font-size-input",ref:t,onTouchEnd:function(){t.current&&t.current.focus()},onClick:function(){n(!r),t.current&&t.current.focus()},onKeyDown:function(e){if("Backspace"===e.key){var t=window.getSelection(),r=null==t?void 0:t.getRangeAt(0);if(null!=r&&r.collapsed)return e.cancelable&&e.preventDefault(),document.execCommand("delete",!1),!1}return!1},onKeyUp:function(e){var r;if(t.current){var i=t.current.value,o=parseInt(i);isNaN(o)?t.current.value="0":t.current.value=o.toString(),o&&"Enter"===e.key&&(x(o),null==(r=t.current)||r.blur(),n(!1))}},onFocus:function(){null!=u&&u.control.room&&!u.control.room.disableDeviceInputs&&(g(u.control.room.disableDeviceInputs),u.control.room.disableDeviceInputs=!0)},onBlur:function(){null!=u&&u.control.room&&C.isBoolean(v)&&(u.control.room.disableDeviceInputs=v)}}),N.createElement("div",{className:"font-size-btns"},N.createElement("div",{className:"font-size-add",onClick:function(){x(h+al[0])},onTouchEnd:function(){x(h+al[0])}}),N.createElement("div",{className:"font-size-cut",onClick:function(){x(h-al[0])},onTouchEnd:function(){x(h-al[0])}})),b)},cl=function(e){var t=e.workIds,r=e.mananger,n=e.islocked;return N.createElement("div",{className:"button normal-button",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.SetLock,{workIds:t||[va],isLocked:!n,viewId:null==r?void 0:r.viewId})},onTouchEnd:function(e){e.stopPropagation(),Vs.emitMethod(B.MainEngine,z.SetLock,{workIds:t||[va],isLocked:!n,viewId:null==r?void 0:r.viewId})}},N.createElement("img",{alt:"icon",src:Wu(n?"unlock-new":"lock-new")}))},hl=function(e){var t=e.icon,r=e.min,n=e.max,i=e.step,o=e.value,a=e.onInputHandler,s=d(N.useState(0),2),u=s[0],l=s[1],c=N.useRef(null),h=function(e){e>n&&(e=n),e=r&&i<=n&&h(i)}}),N.createElement("div",{className:"input-number-btns"},N.createElement("div",{className:"input-number-add",onClick:function(){h(u+i)},onTouchEnd:function(){h(u+i)}}),N.createElement("div",{className:"input-number-cut",onClick:function(){h(u-i)},onTouchEnd:function(){h(u-i)}})))},dl=function(e){var t=e.icon,r=e.min,n=e.max,i=e.step,o=e.value,a=e.onInputHandler;return N.createElement("div",{className:"button input-button"},N.createElement("img",{src:Wu(t)}),N.createElement(fl,{min:r,max:n,step:i,value:o,onInputHandler:a}))},fl=function(e){var t=e.value,r=e.min,n=e.max,i=e.onInputHandler,o=d(N.useState({x:0,y:0}),2),a=o[0],s=o[1];N.useEffect((function(){s({x:100*t,y:0})}),[]);var u=C.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var u=Math.floor(Math.max(o.x,100*r));u=Math.floor(Math.min(u,100*n)),o.x!==(null==a?void 0:a.x)&&s({x:u,y:0});var l=u/100;t!==l&&i(l)}),100,{leading:!1}),l=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()},c=C.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var u=Math.floor(Math.max(o.x,100*r));u=Math.floor(Math.min(u,100*n)),o.x!==(null==a?void 0:a.x)&&s({x:u,y:0});var l=u/100;t!==l&&i(l)}),100,{leading:!1});return N.createElement("div",{className:"range-number-container",onClick:function(e){var o=e.nativeEvent.offsetX-6,a=Math.floor(Math.max(o,100*r));a=Math.floor(Math.min(a,100*n)),s({x:a,y:0});var u=a/100;t!==u&&i(u)}},N.createElement("div",{className:"range-number-color"}),N.createElement("div",{className:"range-number"},N.createElement(O,{bounds:"parent",axis:"x",position:a,onDrag:u,onStart:l,onStop:c},N.createElement("div",{className:"circle",onClick:l}))))},pl=function(e){var t=e.icon,r=e.value,n=e.onChangeHandler,i=e.style,o=d(N.useState(0),2),a=o[0],s=o[1],u=d(N.useState(),2),l=u[0],c=u[1],h=N.useRef(null),f=N.useCallback((function(e){e>=sl.length&&(e=0),e<0&&(e=sl.length-1),s(e),n(sl[e]),c(!1),h.current&&(h.current.value=sl[e])}),[n]),p=N.useMemo((function(){if(i&&i.bottom){var e={top:"inherit",bottom:50};return e}}),[i]);N.useEffect((function(){r&&(s(sl.indexOf(r)),h.current&&(h.current.value=r))}),[r]);var v=N.useMemo((function(){return l?N.createElement(vl,{options:sl,onClickHandler:f,style:p}):null}),[l,f,p]);return N.createElement("div",{className:"button input-button"},N.createElement("img",{src:Wu(t)}),N.createElement("input",{readOnly:!0,className:"input-number",type:"text",ref:h,onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),h.current&&h.current.focus()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),h.current&&(h.current.focus(),c(!l))}}),N.createElement("div",{className:"input-number-btns"},N.createElement("div",{className:"input-number-add",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(a+1)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(a+1)}}),N.createElement("div",{className:"input-number-cut",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(a-1)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(a-1)}})),v)},vl=function(e){var t=e.options,r=e.style,n=e.onClickHandler;return N.createElement("div",{className:"select-option-menu",style:r,onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},t.map((function(e,t){return N.createElement("div",{className:"select-option-btn",key:e,onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t)}},e)})))},gl=function(e){var t=e.mananger,r=e.innerRatio,n=e.innerVerticeStep,i=e.vertices;return N.createElement(N.Fragment,null,N.createElement(hl,{value:i,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){Vs.emitMethod(B.MainEngine,z.SetShapeOpt,{workIds:[va],toolsType:U.Star,viewId:t.viewId,vertices:e})}}),N.createElement(hl,{value:n,icon:"star-innerVertex",min:1,max:100,step:1,onInputHandler:function(e){Vs.emitMethod(B.MainEngine,z.SetShapeOpt,{workIds:[va],toolsType:U.Star,viewId:t.viewId,innerVerticeStep:e})}}),N.createElement(dl,{value:r,icon:"star-innerRatio",min:.1,max:1,step:.1,onInputHandler:function(e){Vs.emitMethod(B.MainEngine,z.SetShapeOpt,{workIds:[va],toolsType:U.Star,viewId:t.viewId,innerRatio:e})}}))},ml=function(e){var t=e.mananger,r=e.vertices;return N.createElement(hl,{value:r,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){Vs.emitMethod(B.MainEngine,z.SetShapeOpt,{workIds:[va],toolsType:U.Polygon,viewId:t.viewId,vertices:e})}})},yl=function(e){var t=e.mananger,r=e.placement;return N.createElement(pl,{value:r,icon:"speechBallon-placement",onChangeHandler:function(e){Vs.emitMethod(B.MainEngine,z.SetShapeOpt,{workIds:[va],toolsType:U.SpeechBalloon,viewId:t.viewId,placement:e})}})},_l=function(e){var t=e.icon,r=e.isActive,n=e.onClickHandler,i=e.onTouchEndHandler;return N.createElement("div",{className:"button tab-button ".concat(r?"active":""),onClick:n,onTouchEnd:i},N.createElement("img",{src:Wu(t)}))},bl=function(e){var t=e.toolsTypes,r=e.style,n=e.mananger,i=e.shapeOpt,o=d(N.useState(),2),a=o[0],s=o[1];N.useEffect((function(){t.includes(U.Polygon)?s(U.Polygon):t.includes(U.Star)?s(U.Star):s(U.SpeechBalloon)}),[t]);var u=function(e,t){t.cancelable&&t.preventDefault(),null==t||t.stopPropagation(),s(e)},l=N.useMemo((function(){return a===U.Polygon&&n&&i.vertices?N.createElement(ml,{vertices:i.vertices,mananger:n}):null}),[n,a,i]),c=N.useMemo((function(){return a===U.Star&&n&&i.vertices&&i.innerVerticeStep&&i.innerRatio?N.createElement(gl,{mananger:n,vertices:i.vertices,innerVerticeStep:i.innerVerticeStep,innerRatio:i.innerRatio}):null}),[n,a,i]),h=N.useMemo((function(){return a===U.SpeechBalloon&&n&&i.placement?N.createElement(yl,{mananger:n,placement:i.placement}):null}),[n,a,i]);return N.createElement("div",{className:"shapeOpt-sub-menu",style:r,onClick:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.cancelable&&e.preventDefault()}},N.createElement("div",{className:"shapeOpt-sub-menu-tabs"},t.includes(U.Polygon)&&N.createElement(_l,{isActive:a===U.Polygon,icon:a===U.Polygon?"polygon-active":"polygon",onClickHandler:u.bind(void 0,U.Polygon),onTouchEndHandler:u.bind(void 0,U.Polygon)})||null,t.includes(U.Star)&&N.createElement(_l,{isActive:a===U.Star,icon:a===U.Star?"star-active":"star",onClickHandler:u.bind(void 0,U.Star),onTouchEndHandler:u.bind(void 0,U.Star)})||null,t.includes(U.SpeechBalloon)&&N.createElement(_l,{isActive:a===U.SpeechBalloon,icon:a===U.SpeechBalloon?"speechBallon-active":"speechBallon",onClickHandler:u.bind(void 0,U.SpeechBalloon),onTouchEndHandler:u.bind(void 0,U.SpeechBalloon)})||null),N.createElement("div",{className:"shapeOpt-sub-menu-content"},l,c,h))},xl=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=e.toolsTypes,o=e.shapeOpt,a=N.useContext(Gl),s=a.floatBarData,u=a.mananger,l=d(N.useState([]),2),c=l[0],h=l[1],f=d(N.useState(),2),p=f[0],v=f[1],g=N.useMemo((function(){if(null!=n&&n.current&&C.isNumber(null==s?void 0:s.x)&&C.isNumber(null==s?void 0:s.y)&&null!=u&&u.height){if(n.current.offsetTop&&n.current.offsetTop+s.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==u?void 0:u.height)-n.current.offsetTop-(null==s?void 0:s.y)<140){var t={top:"inherit",bottom:50};return t}}}),[n,null==s?void 0:s.x,null==s?void 0:s.y,null==u?void 0:u.height]),m=N.useMemo((function(){return t&&i&&u&&o?(u.control.room&&!u.control.room.disableDeviceInputs&&(v(u.control.room.disableDeviceInputs),u.control.room.disableDeviceInputs=!0),N.createElement(bl,{shapeOpt:o,style:g,toolsTypes:i,mananger:u})):(null!=u&&u.control.room&&C.isBoolean(p)&&(u.control.room.disableDeviceInputs=p),null)}),[t,g,i,u,o]);return N.useEffect((function(){C.isEqual(null==s?void 0:s.selectIds,c)||null!=s&&s.selectIds&&!C.isEqual(null==s?void 0:s.selectIds,c)&&(h(null==s?void 0:s.selectIds),r(!1))}),[t,s,c,r]),N.useEffect((function(){return function(){t&&null!=u&&u.control.room&&C.isBoolean(p)&&(u.control.room.disableDeviceInputs=p)}}),[t,u,p]),N.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},m,N.createElement("img",{alt:"icon",src:Wu(t?"shapes-active":"shapes")}))},wl=N.memo((function(e){var t=e.textOpt,r=e.workIds,n=e.noLayer,i=e.position,o=N.useContext(Gl),a=o.floatBarData,s=o.mananger,u=d(N.useState(0),2),l=u[0],c=u[1],h=d(N.useState(),2),f=h[0],p=h[1],v=N.useRef(null);N.useEffect((function(){var e,r,n,o,u={},l=(null==a?void 0:a.w)||(null==(e=null==t?void 0:t.boxSize)?void 0:e[0])||0,c=(null==a?void 0:a.h)||(null==(r=null==t?void 0:t.boxSize)?void 0:r[1])||0;if(i&&l&&c&&null!=s&&s.width&&null!=s&&s.height){if(i.y<60?i.y+c0?u.top=62:u.top=62-i.y:u.top=0,i.x<0)u.left=3-i.x;else if(i.x+((null==(n=v.current)?void 0:n.offsetWidth)||l)>s.width){var h=s.width-((null==(o=v.current)?void 0:o.offsetWidth)||l)-i.x;u.left=h}p(u)}else p(void 0)}),[v,i,null==a?void 0:a.w,null==a?void 0:a.h,null==s?void 0:s.width,null==s?void 0:s.height,null==t?void 0:t.boxSize]);var g=N.useMemo((function(){return null!=a&&a.fillColor?N.createElement(Ku,{floatBarRef:v,open:3===l,setOpen:function(e){c(!0===e?3:0)}}):null}),[null==a?void 0:a.fillColor,l,v]),m=N.useMemo((function(){return null!=a&&a.strokeColor?N.createElement(Zu,{floatBarRef:v,open:2===l,setOpen:function(e){c(!0===e?2:0)}}):null}),[null==a?void 0:a.strokeColor,l,v]),y=N.useMemo((function(){return null!=t&&t.fontColor&&null!=s&&s.viewId?N.createElement(Ju,{floatBarRef:v,open:4===l,setOpen:function(e){c(!0===e?4:0)},textOpt:t,workIds:r}):null}),[t,l,r,s,v]),_=N.useMemo((function(){return null!=t&&t.fontBgColor&&null!=s&&s.viewId?N.createElement(el,{floatBarRef:v,open:5===l,setOpen:function(e){c(!0===e?5:0)},textOpt:t,workIds:r}):null}),[t,l,r,s,v]),b=N.useMemo((function(){return t&&null!=s&&s.viewId?N.createElement(ol,{open:6===l,setOpen:function(e){c(!0===e?6:0)},textOpt:t,workIds:r,style:f}):null}),[t,l,r,s,f]),x=N.useMemo((function(){return t&&null!=s&&s.viewId?N.createElement(ll,{open:7===l,setOpen:function(e){c(!0===e?7:0)},textOpt:t,workIds:r,floatBarRef:v}):null}),[t,l,r,s,v]),w=N.useMemo((function(){return n?null:N.createElement(Yu,{open:1===l,setOpen:function(e){c(!0===e?1:0)},floatBarRef:v})}),[n,l,v]),S=N.useMemo((function(){return null!=a&&a.canLock&&s?N.createElement(cl,{workIds:r,mananger:s,islocked:a.isLocked}):null}),[a,s,r]),T=N.useMemo((function(){return s&&null!=s&&s.viewId&&f&&null!=a&&a.shapeOpt&&null!=a&&a.toolsTypes?N.createElement(xl,{open:8===l,setOpen:function(e){c(!0===e?8:0)},floatBarRef:v,workIds:r,toolsTypes:a.toolsTypes,shapeOpt:a.shapeOpt}):null}),[a,s,l,f,r,v]);return N.createElement("div",{className:"bezier-pencil-plugin-floatbtns",style:f,ref:v,onMouseOver:function(e){return e.stopPropagation(),e.cancelable&&e.preventDefault(),null==s||s.control.worker.blurCursor(s.viewId),!1},onMouseMove:function(e){return e.stopPropagation(),e.cancelable&&e.preventDefault(),!1}},s&&N.createElement(Gu,{workIds:r,mananger:s}),w,S,!(null==s||!s.viewId)&&N.createElement(Vu,{workIds:r,viewId:s.viewId}),T,x,b,y,_,m,g)})),Sl=function(e){var t=e.data,r=e.isActive,n=e.manager,i=e.workId,o=t.opt,a=t.scale,s=t.translate,u=t.x,l=t.y,c="scale(".concat(a||1,") ").concat(s&&"translate("+s[0]+"px,"+s[1]+"px)"||""),h=o.fontSize,d=o.fontFamily,f=o.underline,p=o.fontColor,v=o.lineThrough,g=o.textAlign,m=o.strokeColor,y=o.lineHeight,_=o.bold,b=o.italic,x=o.uid,w=o.workState,S=h,T=y||1.2*S,M={fontSize:"".concat(S,"px"),lineHeight:"".concat(T,"px"),color:p,borderColor:m,minHeight:"".concat(T,"px"),paddingRight:"".concat("italic"===b?Math.round(.3*S):5,"px")};d&&(M.fontFamily="".concat(d)),(v||f)&&(M.textDecoration="".concat(v?"line-through":"").concat(f?" underline":"")),_&&(M.fontWeight="".concat(_)),b&&(M.fontStyle="".concat(b)),g&&(M.textAlign="".concat(g));var k=N.useMemo((function(){var e=[];if(o.text)for(var t=ha(o.text),r=0;r
":'
').concat(n,"
")}else e='
');return e}),[g.fontBgColor,g.text]),B=N.useMemo((function(){return"string"==typeof z?N.createElement("div",{id:r,suppressContentEditableWarning:!0,contentEditable:!0,className:"editor",ref:R,style:D,onKeyDown:U,onKeyUp:a,onClick:F,onTouchEnd:F,onFocus:s,onPaste:V,onInput:H,dangerouslySetInnerHTML:{__html:z}}):null}),[z,D,r]);function F(){R.current&&R.current.focus(),c()}function U(e){if("Backspace"===e.key){var t=window.getSelection(),r=null==t?void 0:t.getRangeAt(0);if(null!=r&&r.collapsed)return e.cancelable&&e.preventDefault(),document.execCommand("delete",!1),!1}return c(),!1}function W(e,t){var r=null==window?void 0:window.getSelection();if(null!=r&&r.rangeCount&&e&&r&&r.anchorNode){var n=r.anchorOffset,o=r.anchorNode.textContent||"",a=o.slice(0,n)||"",s=o.slice(n)||"";!function(e,t,r){var n=null==window?void 0:window.getSelection();if(null==n||!n.rangeCount||!n.anchorNode)return;var o=e.split(/\n/),a=n.anchorNode.parentNode;a===r&&(a=n.anchorNode);for(var s,u=i(r.childNodes),l=[],c=n.anchorOffset;u.length;){var d=u.pop();if(d){if(d===a){var f=o[0];1===o.length&&(c=o[0].length,f=o[0].concat(t)),"#text"===a.nodeName?(a.textContent=f,s=a):"DIV"===a.nodeName&&(a.innerText=f,s=a.childNodes[0]);break}l.push(d),r.removeChild(d)}}if(o.length>1)for(var p=1;p":m.innerText=v,r.appendChild(m),p===o.length-1&&(s=m.childNodes[0])}if(l.length){l.reverse();var y,_=h(l);try{for(_.s();!(y=_.n()).done;){var b=y.value;r.appendChild(b)}}catch(e){_.e(e)}finally{_.f()}}if(s&&"#text"===s.nodeName){n.deleteFromDocument();var x=document.createRange(),w=Math.min(c,(null==s?void 0:s.length)||0);x.setStart(s,w),x.collapse(!0),n.removeAllRanges(),n.addRange(x)}}(a.concat(e)||"",s,t)}}function V(e){if(e.cancelable&&e.preventDefault(),e.stopPropagation(),R.current){var t=(e.clipboardData||window.clipboardData).getData("text"),r=null==window?void 0:window.getSelection();if(null==r||!r.rangeCount)return;t&&r&&r.anchorNode&&W(t,R.current),c()}}function H(e){a(e),c()}return N.useEffect((function(){B&&R.current&&(R.current.click(),setTimeout((function(){var e;if(R.current){var t=null==window?void 0:window.getSelection(),r=R.current.lastChild;if(t&&r){var n=document.createRange(),i=(null==(e=r.textContent)?void 0:e.length)||0;"#text"===(null==r?void 0:r.nodeName)?n.setStart(r,i):n.setStart(r,i?1:0),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}}),20))}),[B,R.current]),N.useEffect((function(){var e,t,n,i;if(B&&(null!=(e=R.current)&&e.offsetWidth||null!=(t=R.current)&&t.offsetHeight||null!=(n=R.current)&&n.offsetLeft||null!=(i=R.current)&&i.offsetTop)){var o=[R.current.offsetWidth,R.current.offsetHeight];(O&&O[0]!==o[0]&&O[1]!==o[1]||!O)&&u({activeTextId:r,update:{boxSize:o,workState:G.Doing}})}}),[O,B,D,r]),N.createElement(N.Fragment,null,j,N.createElement("div",{className:"editor-box",style:L,onFocus:function(){l.control.room&&!l.control.room.disableDeviceInputs&&(v(l.control.room.disableDeviceInputs),l.control.room.disableDeviceInputs=!0)},onBlur:function(){null!=l&&l.control.room&&C.isBoolean(p)&&(l.control.room.disableDeviceInputs=p)}},B))},kl=function(e){v(r,e);var t=m(r);function r(e){return x(this,r),t.call(this,e)}return S(r,[{key:"getInnerText",value:function(e){for(var t=[],r=0;rthis.maxScreenshotWidth&&(f=this.maxScreenshotWidth/h*f,h=this.maxScreenshotWidth),d>this.maxScreenshotHeight&&(f=Math.min(this.maxScreenshotHeight/d*f,f),d=this.maxScreenshotHeight),u.scale=f,p=document.createElement("canvas"),v=p.getContext("2d"),p.width=h*(l||1),p.height=d*(l||1),v&&((t.mainView||n).screenshotToCanvas(v,o,h,d,u,l),r.drawImage(p,Math.floor((a-h)/2),Math.floor((s-d)/2),h*(l||1),d*(l||1),0,0,h,d),p.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(c=i.currentManager)?void 0:c.screenshotToCanvas(r,o,h,d,u,Math.floor((a-h)/2),Math.floor((s-d)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=c(regeneratorRuntime.mark((function e(r,o,a,s,u){var l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceMultiPlugin] scenePreview"),(t.mainView||n).scenePreview(r,o,a,s,u),(l=document.createElement("img")).style.position="absolute",l.style.top="0px",l.style.left="0px",l.style.width="100%",l.style.height="100%",l.style.pointerEvents="none",o.append(l),getComputedStyle(o).position||(o.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=14;break}return e.next=14,i.currentManager.scenePreview(r,l);case 14:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(n)&&n.isWritable?Xl.InternalMsgEmitter.on(e,t):o.call(n.callbacks,e,t)},_callbacksOnce:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(n)&&n.isWritable?Xl.InternalMsgEmitter.on(e,t):u.call(n.callbacks,e,t)},_callbacksOff:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(n)&&n.isWritable?Xl.InternalMsgEmitter.off(e,t):a.call(n.callbacks,e,t)},undo:function(){return i.logger.info("[ApplianceMultiPlugin] undo"),i.currentManager&&E.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceMultiPlugin] redo"),i.currentManager&&E.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(){i.logger.info("[ApplianceMultiPlugin] cleanCurrentScene"),i.currentManager&&E.isRoom(n)&&n.isWritable&&(i.currentManager.cleanCurrentScene(),l.call(t))},insertImage:function(e){i.logger.info("[ApplianceMultiPlugin] insertImage"),i.currentManager&&E.isRoom(n)&&n.isWritable&&i.currentManager.worker.insertImage(e)},lockImage:function(e,t){i.logger.info("[ApplianceMultiPlugin] lockImage"),i.currentManager&&E.isRoom(n)&&n.isWritable&&i.currentManager.worker.lockImage(e,t)},completeImageUpload:function(e,t){i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&E.isRoom(n)&&n.isWritable&&i.currentManager.worker.completeImageUpload(e,t)},getImagesInformation:function(e){return i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&E.isRoom(n)&&n.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return i.logger.info("[ApplianceMultiPlugin] callbacks bind"),s(s({},n.callbacks),{},{on:f._callbacksOn.bind(f),once:f._callbacksOnce.bind(f),off:f._callbacksOff.bind(f)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceMultiPlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0)},setMemberState:function(e){i.logger.info("[ApplianceMultiPlugin] setMemberState"),Object.keys(e).includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===D.laserPen?(e.currentApplianceName=D.pencil,e.useLaserPen=!0):e.currentApplianceName&&e.currentApplianceName===D.pencil&&(e.useLaserPen=!1)),h.call(t.mainView,e)}},p=function(e,t){i.logger.info("[ApplianceMultiPlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||T(e[t])>"u"?e[t]=f[t]:"callbacks"===t&&(e.callbacks.on=f._callbacksOn.bind(f),e.callbacks.off=f._callbacksOff.bind(f),e.callbacks.once=f._callbacksOnce.bind(f))},e.abrupt("return",(p(t,"undo"),p(t,"redo"),p(t,"cleanCurrentScene"),p(t,"insertImage"),p(t,"completeImageUpload"),p(t,"lockImage"),p(n,"getImagesInformation"),p(n,"callbacks"),p(n,"screenshotToCanvasAsync"),p(n,"getBoundingRectAsync"),p(n,"scenePreviewAsync"),p(t.mainView,"setMemberState"),s(s({},f),{},{callbacks:f.callbacks()})));case 13:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createApplianceMultiPlugin",value:(t=c(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.createInvisiblePlugin(i,{});case 2:if(n=t.getInvisiblePlugin(r),e.t0=n,e.t0){e.next=8;break}return e.next=7,i.createApplianceMultiPlugin(t,r);case 7:n=e.sent;case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})}]),i}(E.InvisiblePlugin);k(ql,"kind","appliance-multi-plugin"),k(ql,"currentManager"),k(ql,"logger",{info:console.log,warn:console.warn,error:console.error}),k(ql,"options",la),k(ql,"createCurrentManager",(function(e,t,r){if(ql.currentManager&&ql.currentManager.destroy(),t&&e){var n={plugin:r,displayer:e.displayer,options:t},i=new Xl(n);ql.logger.info("[ApplianceMultiPlugin] refresh ApplianceMultiManager object"),i.setWindowManager(e),ql.currentManager=i}}));var Ql=ql,Zl=function(e){v(r,e);var t=m(r);function r(e,n){var i;return x(this,r),i=t.call(this,e,n),k(_(i),"width",1e3),k(_(i),"height",1e3),k(_(i),"dpr",1),k(_(i),"vDom"),k(_(i),"viewId",bs),k(_(i),"eventTragetElement"),k(_(i),"snapshotContainerRef"),k(_(i),"canvasContainerRef",N.createRef()),k(_(i),"canvasTopRef",N.createRef()),k(_(i),"canvasServiceFloatRef",N.createRef()),k(_(i),"canvasFloatRef",N.createRef()),k(_(i),"canvasBgRef",N.createRef()),k(_(i),"floatBarRef",N.createRef()),k(_(i),"containerOffset",{x:0,y:0}),i.control.hasOffscreenCanvas()||(i.snapshotContainerRef=N.createRef()),i}return S(r,[{key:"setCanvassStyle",value:function(){if(this.eventTragetElement){var e=this.eventTragetElement.offsetWidth,t=this.eventTragetElement.offsetHeight;e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=vs()),e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=vs(),this.width=e,this.height=t),e&&t&&this.canvasBgRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=vs(this.canvasBgRef.current.getContext("2d")),this.width=e,this.height=t,this.canvasBgRef.current.width=e*this.dpr,this.canvasBgRef.current.height=t*this.dpr,this.canvasFloatRef.current&&(this.canvasFloatRef.current.width=e*this.dpr,this.canvasFloatRef.current.height=t*this.dpr),this.canvasServiceFloatRef.current&&(this.canvasServiceFloatRef.current.width=e*this.dpr,this.canvasServiceFloatRef.current.height=t*this.dpr),this.canvasTopRef.current&&(this.canvasTopRef.current.width=e*this.dpr,this.canvasTopRef.current.height=t*this.dpr))}}},{key:"createMainViewDisplayer",value:function(e){return this.vDom||(this.containerOffset=this.getContainerOffset(e,this.containerOffset),this.eventTragetElement=e.parentElement.children[0],e.innerHTML="",P.render(N.createElement(Vl,{viewId:this.viewId,mananger:this,refs:{canvasServiceFloatRef:this.canvasServiceFloatRef,canvasFloatRef:this.canvasFloatRef,canvasBgRef:this.canvasBgRef,floatBarRef:this.floatBarRef,canvasTopRef:this.canvasTopRef,canvasContainerRef:this.canvasContainerRef,snapshotContainerRef:this.snapshotContainerRef}}),e),this.control.room&&this.bindDisplayerEvent(this.eventTragetElement)),this}}]),r}(Au),Kl=function(e){v(n,e);var t,r=m(n);function n(e){var t;return x(this,n),t=r.call(this,e),k(_(t),"focuedViewId"),k(_(t),"control"),k(_(t),"focuedView"),t.control=e.control,t}return S(n,[{key:"bindMainView",value:function(){if(this.control.divMainView){var e=new Zl(this.control,xu.InternalMsgEmitter);this.focuedViewId=bs;var t=e.width,r=e.height,i={dpr:e.dpr,originalPoint:[t/2,r/2],offscreenCanvasOpt:s(s({},n.defaultScreenCanvasOpt),{},{width:t,height:r}),layerOpt:s(s({},n.defaultLayerOpt),{},{width:t,height:r}),cameraOpt:s(s({},n.defaultCameraOpt),{},{width:t,height:r})},a=this.control.room&&this.control.room.mainView||this.control.play&&this.control.play.mainView;if(a){var u=a.camera,l=u.scale,c=o(u,["scale"]);i.cameraOpt=s(s(s({},i.cameraOpt),c),{},{scale:l===1/0?1:l}),this.createMianView({id:bs,displayer:e,focusScenePath:a.focusScenePath||a.scenePath,cameraOpt:i.cameraOpt,viewData:a}),this.focuedView=this.mainView,e.createMainViewDisplayer(this.control.divMainView)}}}},{key:"mountView",value:(t=c(regeneratorRuntime.mark((function e(t){var r,i,a,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this.getView(t))){e.next=11;break}if(a=i.displayer,u=a.width,l=a.height,c=a.dpr,h={dpr:c,originalPoint:[u/2,l/2],offscreenCanvasOpt:s(s({},n.defaultScreenCanvasOpt),{},{width:u,height:l}),layerOpt:s(s({},n.defaultLayerOpt),{},{width:u,height:l}),cameraOpt:s(s({},n.defaultCameraOpt),{},{width:u,height:l})},i.viewData&&(d=i.viewData.camera,f=d.scale,p=o(d,["scale"]),h.cameraOpt=s(s(s({},h.cameraOpt),p),{},{scale:f===1/0?1:f})),e.t0=this.control.worker.isActive,e.t0){e.next=9;break}return this.control.cursor.activeCollector(),e.next=9,this.control.activeWorker();case 9:null==(r=this.control.worker)||r.createViewWorker(t,h),i.focusScenePath&&this.control.collector&&this.control.worker.pullServiceData(t,i.focusScenePath,{isAsync:!0,useAnimation:!1});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),n}(ku),Jl=function(e){v(n,e);var t,r=m(n);function n(e){var t;x(this,n),t=r.call(this,e),k(_(t),"viewContainerManager"),k(_(t),"divMainView"),k(_(t),"onCameraChange",yu((function(e){var r,n=t.viewContainerManager.mainView;n&&n.cameraOpt&&(n.cameraOpt.width!==e.width||n.cameraOpt.height!==e.height)&&(null==(r=t.viewContainerManager.mainView)||r.displayer.updateSize()),t.viewContainerManager.setFocuedViewCameraOpt(e)}),20,{leading:!1}));var i={control:_(t),internalMsgEmitter:n.InternalMsgEmitter};return t.viewContainerManager=new Kl(i),t}return S(n,[{key:"init",value:function(){var e=this;n.InternalMsgEmitter.on(B.BindMainView,(function(t){e.divMainView=t,e.plugin&&!e.viewContainerManager.mainView&&e.viewContainerManager.bindMainView()}))}},{key:"activePlugin",value:function(){var e=this;this.plugin&&this.divMainView&&!this.viewContainerManager.mainView&&this.viewContainerManager.bindMainView(),this.collector&&(this.collector.addStorageStateListener((function(t){var r,n;if(null!=(r=e.collector)&&r.storage&&0===Object.keys(e.collector.storage).length)null==(n=e.worker)||n.clearViewScenePath(bs,!0);else{var o,a,s=t.diffView,u=t.diffScenePath,l=t.diffData,c=new Map;if(s)Object.keys(s).forEach((function(t){var r,n=s[t];if(n&&!n.newValue)null==(r=e.worker)||r.clearViewScenePath(t,!0),n.oldValue&&(o=n.oldValue);else if(n&&n.newValue){for(var i=0,a=Object.keys(n.newValue);ithis.maxScreenshotWidth&&(d=this.maxScreenshotWidth/c*d,c=this.maxScreenshotWidth),h>this.maxScreenshotHeight&&(d=Math.min(this.maxScreenshotHeight/h*d,d),h=this.maxScreenshotHeight),s.scale=d,f=document.createElement("canvas"),p=f.getContext("2d"),f.width=c*(u||1),f.height=h*(u||1),p&&(t.screenshotToCanvas(p,n,c,h,s,u),r.drawImage(f,Math.floor((o-c)/2),Math.floor((a-h)/2),c*(u||1),h*(u||1),0,0,c,h),f.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(l=i.currentManager)?void 0:l.screenshotToCanvas(r,n,c,h,s,Math.floor((o-c)/2),Math.floor((a-h)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=c(regeneratorRuntime.mark((function e(r,n,o,a,s){var u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceSinglePlugin] scenePreview"),t.scenePreview(r,n,o,a,s),(u=document.createElement("img")).style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.width="100%",u.style.height="100%",u.style.pointerEvents="none",n.append(u),getComputedStyle(n).position||(n.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=14;break}return e.next=14,i.currentManager.scenePreview(r,u);case 14:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(t)&&t.isWritable?Jl.InternalMsgEmitter.on(e,r):n.call(t.callbacks,e,r)},_callbacksOnce:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(t)&&t.isWritable?Jl.InternalMsgEmitter.on(e,r):a.call(t.callbacks,e,r)},_callbacksOff:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&E.isRoom(t)&&t.isWritable?Jl.InternalMsgEmitter.off(e,r):o.call(t.callbacks,e,r)},undo:function(){return i.logger.info("[ApplianceSinglePlugin] undo"),i.currentManager&&E.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceSinglePlugin] redo"),i.currentManager&&E.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(e){i.logger.info("[ApplianceSinglePlugin] cleanCurrentScene"),i.currentManager&&E.isRoom(t)&&t.isWritable&&(i.currentManager.cleanCurrentScene(),u.call(t,e))},insertImage:function(e){i.logger.info("[ApplianceSinglePlugin] insertImage"),i.currentManager&&E.isRoom(t)&&t.isWritable&&i.currentManager.worker.insertImage(e)},lockImage:function(e,r){i.logger.info("[ApplianceSinglePlugin] lockImage"),i.currentManager&&E.isRoom(t)&&t.isWritable&&i.currentManager.worker.lockImage(e,r)},completeImageUpload:function(e,r){i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&E.isRoom(t)&&t.isWritable&&i.currentManager.worker.completeImageUpload(e,r)},getImagesInformation:function(e){return i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&E.isRoom(t)&&t.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return s(s({},t.callbacks),{},{on:d._callbacksOn.bind(d),once:d._callbacksOnce.bind(d),off:d._callbacksOff.bind(d)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceSinglePlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0,i.cursorAdapter=void 0)},setMemberState:function(e){i.logger.info("[ApplianceSinglePlugin] setMemberState"),Object.keys(e).includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===D.laserPen?(e.currentApplianceName=D.pencil,e.useLaserPen=!0):e.currentApplianceName&&e.currentApplianceName===D.pencil&&(e.useLaserPen=!1)),l(e)}},f=function(e,t){i.logger.info("[ApplianceSinglePlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||T(e[t])>"u"?e[t]=d[t]:"callbacks"===t&&(e.callbacks.on=d._callbacksOn.bind(d),e.callbacks.off=d._callbacksOff.bind(d),e.callbacks.once=d._callbacksOnce.bind(d))},e.abrupt("return",(f(t,"undo"),f(t,"redo"),f(t,"cleanCurrentScene"),f(t,"insertImage"),f(t,"completeImageUpload"),f(t,"lockImage"),f(t,"getImagesInformation"),f(t,"callbacks"),f(t,"screenshotToCanvasAsync"),f(t,"getBoundingRectAsync"),f(t,"scenePreviewAsync"),f(t,"setMemberState"),s(s({},d),{},{callbacks:d.callbacks()})));case 14:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createAppliancePlugin",value:(t=c(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.createInvisiblePlugin(i,{});case 2:if(n=t.getInvisiblePlugin(r),e.t0=n,e.t0){e.next=8;break}return e.next=7,i.createAppliancePlugin(t,r);case 7:n=e.sent;case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"effectInstance",value:function(){if(i.cursorAdapter){var e=i.cursorAdapter.onAddedCursor;i.cursorAdapter.onAddedCursor=function(t){t.onCursorMemberChanged=function(e){try{e.appliance===D.pencil||e.appliance===D.shape||e.appliance===D.text||e.appliance===D.arrow||e.appliance===D.straight||e.appliance===D.rectangle||e.appliance===D.ellipse?null!=t&&t.divElement&&(t.divElement.style.display="none"):null!=t&&t.divElement&&(t.divElement.style.display="block")}catch(e){}},e.call(i.cursorAdapter,t)}}}}]),i}(E.InvisiblePlugin);k(ec,"kind","appliance-aids-single-plugin"),k(ec,"cursorAdapter"),k(ec,"currentManager"),k(ec,"logger",{info:console.log,warn:console.warn,error:console.error}),k(ec,"options",la),k(ec,"createCurrentManager",(function(e,t,r){ec.currentManager&&ec.currentManager.destroy();var n=new Jl({plugin:r,displayer:e,options:t});n.init(),ec.logger.info("[ApplianceSinglePlugin] refresh ApplianceSingleManager object"),ec.currentManager=n}));var tc=ec,rc=function(e){v(r,e);var t=m(r);function r(){var e;return x(this,r),e=t.apply(this,arguments),k(_(e),"mainViewRef",null),e}return S(r,[{key:"componentDidMount",value:function(){r.emiter||(r.emiter=Jl.InternalMsgEmitter),r.emiter.emit(B.BindMainView,this.mainViewRef)}},{key:"render",value:function(){var e=this;return N.createElement(N.Fragment,null,this.props.children,N.createElement("div",{className:"teaching-aids-plugin-main-view-displayer",ref:function(t){return e.mainViewRef=t}}))}}]),r}(N.Component);k(rc,"emiter");var nc=rc;t.ActiveContainerType=F,t.ApplianceMultiPlugin=Ql,t.ApplianceNames=D,t.ApplianceSigleWrapper=nc,t.ApplianceSinglePlugin=tc,t.Cursor_Hover_Id="cursorhover",t.DefaultAppliancePluginOptions=la,t.ECanvasContextType=H,t.ECanvasShowType=Y,t.EDataType=W,t.EMatrixrRelationType=Z,t.EPostMessageType=V,t.EScaleType=q,t.EStrokeType=L,t.EToolsKey=U,t.ElayerType=X,t.EmitEventType=z,t.EventMessageType=$,t.EvevtWorkState=G,t.EvevtWorkType=Q,t.InternalMsgEmitterType=B,t.Main_View_Id=bs,t.Point2d=ca,t.ShapeType=j,t.Storage_Selector_key=va,t.Storage_Splitter=pa,t.Storage_ViewId_ALL="all",t.Task_Time_Interval=20,t.Vec2d=J,t.ViewContainerManager=ku,t._baseGetTag=_e,t.average=function(e,t){return"".concat(fs((e.x+t.x)/2),",").concat(fs((e.y+t.y)/2)," ")},t.checkOp=function(e){var t,r=h(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(isNaN(n)||n===1/0||n===-1/0)return!1}}catch(e){r.e(e)}finally{r.f()}return!0},t.cloneDeep=oa,t.computRect=function(e,t){if(e&&t){var r=Math.min(e.x,t.x),n=Math.min(e.y,t.y);return{x:r,y:n,w:Math.max(e.x+e.w,t.x+t.w)-r,h:Math.max(e.y+e.h,t.y+t.h)-n}}return t||e},t.fullWorker="/fullWorker.js",t.getDefaultExportFromCjs=re,t.getRectFromPoints=hs,t.getRectMatrixrRelation=function(e,t){return e.x+e.wt.x+t.w||e.y+e.ht.y+t.h?Z.outside:e.x>=t.x&&e.y>=t.y&&e.x+e.w<=t.x+t.w&&e.y+e.h<=t.y+t.h?Z.inside:Z.intersect},t.getRectRotated=function(e,t){var r=function(e,t){var r=new J(e.x,e.y),n=new J(e.x+e.w,e.y),i=new J(e.x+e.w,e.y+e.h),o=new J(e.x,e.y+e.h),a=new J(e.x+e.w/2,e.y+e.h/2),s=Math.PI*t/180;return[J.RotWith(r,a,s),J.RotWith(n,a,s),J.RotWith(i,a,s),J.RotWith(o,a,s)]}(e,t);return hs(r)},t.getRectTranslated=function(e,t){return{x:e.x+t[0],y:e.y+t[1],w:e.w,h:e.h}},t.getWHRatio=function(e,t){return[e<=t?1:e/t,t<=e?1:t/e]},t.isBoolean=ls,t.isEqual=os,t.isIntersect=function(e,t){return!(e.x+e.wt.x+t.w||e.y+e.ht.y+t.h)},t.isIntersectForPoint=ds,t.isObjectLike_1=be,t.precise=function(e){return"".concat(fs(e.x),",").concat(fs(e.y)," ")},t.rotatePoints=function(e,t,r){for(var n=new J(t[0],t[1]),i=0;i3&&void 0!==arguments[3]?arguments[3]:[0,0],i=new J(t[0],t[1]),o=0;o=1&&n<=126||65376<=n&&n<=65439?t++:t+=2}return t},t.subWorker="/subWorker.js",t.throttle=yu,t.transformToNormalData=ha,t.transformToSerializableData=da},15599:function(e,t,r){var n;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)} /*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 * * Copyright (c) 2013 hij1nx * Licensed under the MIT license. - */!function(o){var a=Object.hasOwnProperty,s=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},u="object"==("undefined"==typeof process?"undefined":i(process))&&"function"==typeof process.nextTick,l="function"==typeof Symbol,c="object"===("undefined"==typeof Reflect?"undefined":i(Reflect)),h="function"==typeof setImmediate?setImmediate:setTimeout,d=l?c&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function f(){this._events={},this._conf&&p.call(this,this._conf)}function p(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==o&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function v(e,t){var r="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(r+=" Event name: "+t+"."),"undefined"!=typeof process&&process.emitWarning){var n=new Error(r);n.name="MaxListenersExceededWarning",n.emitter=this,n.count=e,process.emitWarning(n)}else console.error(r),console.trace&&console.trace()}var g=function(e,t,r){var n=arguments.length;switch(n){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,r];default:for(var i=new Array(n);n--;)i[n]=arguments[n];return i}};function m(e,t){for(var r={},n=e.length,i=t?t.length:0,a=0;a0;)if(a===e[s])return n;o(t)}}Object.assign(y.prototype,{subscribe:function(e,t,r){var n=this,i=this._target,o=this._emitter,a=this._listeners,s=function(){var n=g.apply(null,arguments),a={data:n,name:t,original:e};if(r){var s=r.call(i,a);!1!==s&&o.emit.apply(o,[a.name].concat(n))}else o.emit.apply(o,[t].concat(n))};if(a[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!n._onNewListener?(this._onNewListener=function(r){r===t&&null===a[e]&&(a[e]=s,n._on.call(i,e,s))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(r){r===t&&!o.hasListeners(r)&&a[e]&&(a[e]=null,n._off.call(i,e,s))},a[e]=null,o.on("removeListener",this._onRemoveListener)):(a[e]=s,n._on.call(i,e,s))},unsubscribe:function(e){var t,r,n,i=this,o=this._listeners,a=this._emitter,s=this._off,u=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function l(){i._onNewListener&&(a.off("newListener",i._onNewListener),a.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=M.call(a,i);a._observers.splice(e,1)}if(e){if(!(t=o[e]))return;s.call(u,e,t),delete o[e],--this._listenersCount||l()}else{for(n=(r=d(o)).length;n-- >0;)e=r[n],s.call(u,e,o[e]);this._listeners={},this._listenersCount=0,l()}}});var w=x(["function"]),S=x(["object","function"]);function T(e,t,r){var n,i,o,a=0,s=new e((function(u,l,c){function h(){i&&(i=null),a&&(clearTimeout(a),a=0)}r=_(r,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),n=!r.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof c;var d=function(e){h(),u(e)},f=function(e){h(),l(e)};n?t(d,f,c):(i=[function(e){f(e||Error("canceled"))}],t(d,f,(function(e){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),o=!0),r.timeout>0&&(a=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",a=0,s.cancel(e),l(e)}),r.timeout))}));return n||(s.cancel=function(e){if(i){for(var t=i.length,r=1;r0;)"_listeners"!==(p=_[u])&&(b=k(e,t,r[p],n+1,o))&&(x?x.push.apply(x,b):x=b);return x}if("**"===w){for((y=n+1===o||n+2===o&&"*"===S)&&r._listeners&&(x=k(e,t,r,o,o)),u=(_=d(r)).length;u-- >0;)"_listeners"!==(p=_[u])&&("*"===p||"**"===p?(r[p]._listeners&&!y&&(b=k(e,t,r[p],o,o))&&(x?x.push.apply(x,b):x=b),b=k(e,t,r[p],n,o)):b=k(e,t,r[p],p===S?n+2:n,o),b&&(x?x.push.apply(x,b):x=b));return x}r[w]&&(x=k(e,t,r[w],n+1,o))}if((v=r["*"])&&k(e,t,v,n+1,o),g=r["**"])if(n0;)"_listeners"!==(p=_[u])&&(p===S?k(e,t,g[p],n+2,o):p===w?k(e,t,g[p],n+1,o):((m={})[p]=g[p],k(e,t,{"**":m},n+1,o)));else g._listeners?k(e,t,g,o,o):g["*"]&&g["*"]._listeners&&k(e,t,g["*"],o,o);return x}function E(e,t,r){var n,i,o=0,a=0,s=this.delimiter,u=s.length;if("string"==typeof e)if(-1!==(n=e.indexOf(s))){i=new Array(5);do{i[o++]=e.slice(a,n),a=n+u}while(-1!==(n=e.indexOf(s,a)));i[o++]=e.slice(a)}else i=[e],o=1;else i=e,o=e.length;if(o>1)for(n=0;n+10&&c._listeners.length>this._maxListeners&&(c._listeners.warned=!0,v.call(this,c._listeners.length,l))):c._listeners=t,!0;return!0}function I(e,t,r,n){for(var o,a,s,u,l=d(e),c=l.length,h=e._listeners;c-- >0;)o=e[a=l[c]],s="_listeners"===a?r:r?r.concat(a):[a],u=n||"symbol"===i(a),h&&t.push(u?s:s.join(this.delimiter)),"object"===i(o)&&I.call(this,o,t,s,u);return t}function A(e){for(var t,r,n,i=d(e),o=i.length;o-- >0;)(t=e[r=i[o]])&&(n=!0,"_listeners"===r||A(t)||delete e[r]);return n}function C(e,t,r){this.emitter=e,this.event=t,this.listener=r}function P(e,t,r){if(!0===r)a=!0;else if(!1===r)n=!0;else{if(!r||"object"!==i(r))throw TypeError("options should be an object or true");var n=r.async,a=r.promisify,s=r.nextTick,l=r.objectify}if(n||s||a){var c=t,d=t._origin||t;if(s&&!u)throw Error("process.nextTick is not supported");a===o&&(a="AsyncFunction"===t.constructor.name),t=function(){var e=arguments,t=this,r=this.event;return a?s?Promise.resolve():new Promise((function(e){h(e)})).then((function(){return t.event=r,c.apply(t,e)})):(s?process.nextTick:h)((function(){t.event=r,c.apply(t,e)}))},t._async=!0,t._origin=d}return[t,l?new C(this,e,t):this]}function N(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,p.call(this,e)}C.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},N.EventEmitter2=N,N.prototype.listenTo=function(e,t,r){if("object"!==i(e))throw TypeError("target musts be an object");var n=this;function a(t){if("object"!==i(t))throw TypeError("events must be an object");var o,a=r.reducers,s=M.call(n,e);o=-1===s?new y(n,e,r):n._observers[s];for(var u,l=d(t),c=l.length,h="function"==typeof a,f=0;f0;)n=r[o],e&&n._target!==e||(n.unsubscribe(t),a=!0);return a},N.prototype.delimiter=".",N.prototype.setMaxListeners=function(e){e!==o&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},N.prototype.getMaxListeners=function(){return this._maxListeners},N.prototype.event="",N.prototype.once=function(e,t,r){return this._once(e,t,!1,r)},N.prototype.prependOnceListener=function(e,t,r){return this._once(e,t,!0,r)},N.prototype._once=function(e,t,r,n){return this._many(e,1,t,r,n)},N.prototype.many=function(e,t,r,n){return this._many(e,t,r,!1,n)},N.prototype.prependMany=function(e,t,r,n){return this._many(e,t,r,!0,n)},N.prototype._many=function(e,t,r,n,i){var o=this;if("function"!=typeof r)throw new Error("many only accepts instances of Function");function a(){return 0==--t&&o.off(e,a),r.apply(this,arguments)}return a._origin=r,this._on(e,a,n,i)},N.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||f.call(this);var e,t,r,n,o,a,s=arguments[0],u=this.wildcard;if("newListener"===s&&!this._newListener&&!this._events.newListener)return!1;if(u&&(e=s,"newListener"!==s&&"removeListener"!==s&&"object"===i(s))){if(r=s.length,l)for(n=0;n3)for(t=new Array(h-1),o=1;o3)for(r=new Array(d-1),a=1;a0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,v.call(this,this._events[e].length,e))):this._events[e]=t,a)},N.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var r,n=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();if(!(n=k.call(this,null,i,this.listenerTree,0)))return this}else{if(!this._events[e])return this;r=this._events[e],n.push({_listeners:r})}for(var o=0;o0){for(r=0,n=(t=this._all).length;r0;)"function"==typeof(r=s[t[i]])?n.push(r):n.push.apply(n,r);return n}if(this.wildcard){if(!(a=this.listenerTree))return[];var u=[],l="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,u,l,a,0),u}return s&&(r=s[e])?"function"==typeof r?[r]:r:[]},N.prototype.eventNames=function(e){var t=this._events;return this.wildcard?I.call(this,this.listenerTree,[],null,e):t?d(t):[]},N.prototype.listenerCount=function(e){return this.listeners(e).length},N.prototype.hasListeners=function(e){if(this.wildcard){var t=[],r="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,t,r,this.listenerTree,0),t.length>0}var n=this._events,i=this._all;return!!(i&&i.length||n&&(e===o?d(n).length:n[e]))},N.prototype.listenersAny=function(){return this._all?this._all:[]},N.prototype.waitFor=function(e,t){var r=this,n=i(t);return"number"===n?t={timeout:t}:"function"===n&&(t={filter:t}),T((t=_(t,{timeout:0,filter:o,handleError:!1,Promise:Promise,overload:!1},{filter:w,Promise:b})).Promise,(function(n,i,o){function a(){var o=t.filter;if(!o||o.apply(r,arguments))if(r.off(e,a),t.handleError){var s=arguments[0];s?i(s):n(g.apply(null,arguments).slice(1))}else n(g.apply(null,arguments))}o((function(){r.off(e,a)})),r._on(e,a,!1)}),{timeout:t.timeout,overload:t.overload})};var O=N.prototype;Object.defineProperties(N,{defaultMaxListeners:{get:function(){return O._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");O._maxListeners=e},enumerable:!0},once:{value:function(e,t,r){return T((r=_(r,{Promise:Promise,timeout:0,overload:!1},{Promise:b})).Promise,(function(r,n,i){var o;if("function"==typeof e.addEventListener)return o=function(){r(g.apply(null,arguments))},i((function(){e.removeEventListener(t,o)})),void e.addEventListener(t,o,{once:!0});var a,s=function(){a&&e.removeListener("error",a),r(g.apply(null,arguments))};"error"!==t&&(a=function(r){e.removeListener(t,s),n(r)},e.once("error",a)),i((function(){a&&e.removeListener("error",a),e.removeListener(t,s)})),e.once(t,s)}),{timeout:r.timeout,overload:r.overload})},writable:!0,configurable:!0}}),Object.defineProperties(O,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),(n=function(){return N}.call(t,r,t,e))===o||(e.exports=n)}()},69331:function(e,t,r){var n=r(1135);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},13080:function(e,t,r){e.exports=r(69331)()},1135:function(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2138:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Resizable=void 0;var i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(22558)),o=r(82070),a=r(22898);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var u,l=(u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},u(e,t)},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0;)if(a===e[s])return n;o(t)}}Object.assign(y.prototype,{subscribe:function(e,t,r){var n=this,i=this._target,o=this._emitter,a=this._listeners,s=function(){var n=g.apply(null,arguments),a={data:n,name:t,original:e};if(r){var s=r.call(i,a);!1!==s&&o.emit.apply(o,[a.name].concat(n))}else o.emit.apply(o,[t].concat(n))};if(a[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!n._onNewListener?(this._onNewListener=function(r){r===t&&null===a[e]&&(a[e]=s,n._on.call(i,e,s))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(r){r===t&&!o.hasListeners(r)&&a[e]&&(a[e]=null,n._off.call(i,e,s))},a[e]=null,o.on("removeListener",this._onRemoveListener)):(a[e]=s,n._on.call(i,e,s))},unsubscribe:function(e){var t,r,n,i=this,o=this._listeners,a=this._emitter,s=this._off,u=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function l(){i._onNewListener&&(a.off("newListener",i._onNewListener),a.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=M.call(a,i);a._observers.splice(e,1)}if(e){if(!(t=o[e]))return;s.call(u,e,t),delete o[e],--this._listenersCount||l()}else{for(n=(r=d(o)).length;n-- >0;)e=r[n],s.call(u,e,o[e]);this._listeners={},this._listenersCount=0,l()}}});var w=x(["function"]),S=x(["object","function"]);function T(e,t,r){var n,i,o,a=0,s=new e((function(u,l,c){function h(){i&&(i=null),a&&(clearTimeout(a),a=0)}r=_(r,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),n=!r.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof c;var d=function(e){h(),u(e)},f=function(e){h(),l(e)};n?t(d,f,c):(i=[function(e){f(e||Error("canceled"))}],t(d,f,(function(e){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),o=!0),r.timeout>0&&(a=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",a=0,s.cancel(e),l(e)}),r.timeout))}));return n||(s.cancel=function(e){if(i){for(var t=i.length,r=1;r0;)"_listeners"!==(p=_[u])&&(b=k(e,t,r[p],n+1,o))&&(x?x.push.apply(x,b):x=b);return x}if("**"===w){for((y=n+1===o||n+2===o&&"*"===S)&&r._listeners&&(x=k(e,t,r,o,o)),u=(_=d(r)).length;u-- >0;)"_listeners"!==(p=_[u])&&("*"===p||"**"===p?(r[p]._listeners&&!y&&(b=k(e,t,r[p],o,o))&&(x?x.push.apply(x,b):x=b),b=k(e,t,r[p],n,o)):b=k(e,t,r[p],p===S?n+2:n,o),b&&(x?x.push.apply(x,b):x=b));return x}r[w]&&(x=k(e,t,r[w],n+1,o))}if((v=r["*"])&&k(e,t,v,n+1,o),g=r["**"])if(n0;)"_listeners"!==(p=_[u])&&(p===S?k(e,t,g[p],n+2,o):p===w?k(e,t,g[p],n+1,o):((m={})[p]=g[p],k(e,t,{"**":m},n+1,o)));else g._listeners?k(e,t,g,o,o):g["*"]&&g["*"]._listeners&&k(e,t,g["*"],o,o);return x}function E(e,t,r){var n,i,o=0,a=0,s=this.delimiter,u=s.length;if("string"==typeof e)if(-1!==(n=e.indexOf(s))){i=new Array(5);do{i[o++]=e.slice(a,n),a=n+u}while(-1!==(n=e.indexOf(s,a)));i[o++]=e.slice(a)}else i=[e],o=1;else i=e,o=e.length;if(o>1)for(n=0;n+10&&c._listeners.length>this._maxListeners&&(c._listeners.warned=!0,v.call(this,c._listeners.length,l))):c._listeners=t,!0;return!0}function A(e,t,r,n){for(var o,a,s,u,l=d(e),c=l.length,h=e._listeners;c-- >0;)o=e[a=l[c]],s="_listeners"===a?r:r?r.concat(a):[a],u=n||"symbol"===i(a),h&&t.push(u?s:s.join(this.delimiter)),"object"===i(o)&&A.call(this,o,t,s,u);return t}function I(e){for(var t,r,n,i=d(e),o=i.length;o-- >0;)(t=e[r=i[o]])&&(n=!0,"_listeners"===r||I(t)||delete e[r]);return n}function C(e,t,r){this.emitter=e,this.event=t,this.listener=r}function P(e,t,r){if(!0===r)a=!0;else if(!1===r)n=!0;else{if(!r||"object"!==i(r))throw TypeError("options should be an object or true");var n=r.async,a=r.promisify,s=r.nextTick,l=r.objectify}if(n||s||a){var c=t,d=t._origin||t;if(s&&!u)throw Error("process.nextTick is not supported");a===o&&(a="AsyncFunction"===t.constructor.name),t=function(){var e=arguments,t=this,r=this.event;return a?s?Promise.resolve():new Promise((function(e){h(e)})).then((function(){return t.event=r,c.apply(t,e)})):(s?process.nextTick:h)((function(){t.event=r,c.apply(t,e)}))},t._async=!0,t._origin=d}return[t,l?new C(this,e,t):this]}function N(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,p.call(this,e)}C.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},N.EventEmitter2=N,N.prototype.listenTo=function(e,t,r){if("object"!==i(e))throw TypeError("target musts be an object");var n=this;function a(t){if("object"!==i(t))throw TypeError("events must be an object");var o,a=r.reducers,s=M.call(n,e);o=-1===s?new y(n,e,r):n._observers[s];for(var u,l=d(t),c=l.length,h="function"==typeof a,f=0;f0;)n=r[o],e&&n._target!==e||(n.unsubscribe(t),a=!0);return a},N.prototype.delimiter=".",N.prototype.setMaxListeners=function(e){e!==o&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},N.prototype.getMaxListeners=function(){return this._maxListeners},N.prototype.event="",N.prototype.once=function(e,t,r){return this._once(e,t,!1,r)},N.prototype.prependOnceListener=function(e,t,r){return this._once(e,t,!0,r)},N.prototype._once=function(e,t,r,n){return this._many(e,1,t,r,n)},N.prototype.many=function(e,t,r,n){return this._many(e,t,r,!1,n)},N.prototype.prependMany=function(e,t,r,n){return this._many(e,t,r,!0,n)},N.prototype._many=function(e,t,r,n,i){var o=this;if("function"!=typeof r)throw new Error("many only accepts instances of Function");function a(){return 0==--t&&o.off(e,a),r.apply(this,arguments)}return a._origin=r,this._on(e,a,n,i)},N.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||f.call(this);var e,t,r,n,o,a,s=arguments[0],u=this.wildcard;if("newListener"===s&&!this._newListener&&!this._events.newListener)return!1;if(u&&(e=s,"newListener"!==s&&"removeListener"!==s&&"object"===i(s))){if(r=s.length,l)for(n=0;n3)for(t=new Array(h-1),o=1;o3)for(r=new Array(d-1),a=1;a0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,v.call(this,this._events[e].length,e))):this._events[e]=t,a)},N.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var r,n=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();if(!(n=k.call(this,null,i,this.listenerTree,0)))return this}else{if(!this._events[e])return this;r=this._events[e],n.push({_listeners:r})}for(var o=0;o0){for(r=0,n=(t=this._all).length;r0;)"function"==typeof(r=s[t[i]])?n.push(r):n.push.apply(n,r);return n}if(this.wildcard){if(!(a=this.listenerTree))return[];var u=[],l="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,u,l,a,0),u}return s&&(r=s[e])?"function"==typeof r?[r]:r:[]},N.prototype.eventNames=function(e){var t=this._events;return this.wildcard?A.call(this,this.listenerTree,[],null,e):t?d(t):[]},N.prototype.listenerCount=function(e){return this.listeners(e).length},N.prototype.hasListeners=function(e){if(this.wildcard){var t=[],r="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,t,r,this.listenerTree,0),t.length>0}var n=this._events,i=this._all;return!!(i&&i.length||n&&(e===o?d(n).length:n[e]))},N.prototype.listenersAny=function(){return this._all?this._all:[]},N.prototype.waitFor=function(e,t){var r=this,n=i(t);return"number"===n?t={timeout:t}:"function"===n&&(t={filter:t}),T((t=_(t,{timeout:0,filter:o,handleError:!1,Promise:Promise,overload:!1},{filter:w,Promise:b})).Promise,(function(n,i,o){function a(){var o=t.filter;if(!o||o.apply(r,arguments))if(r.off(e,a),t.handleError){var s=arguments[0];s?i(s):n(g.apply(null,arguments).slice(1))}else n(g.apply(null,arguments))}o((function(){r.off(e,a)})),r._on(e,a,!1)}),{timeout:t.timeout,overload:t.overload})};var O=N.prototype;Object.defineProperties(N,{defaultMaxListeners:{get:function(){return O._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");O._maxListeners=e},enumerable:!0},once:{value:function(e,t,r){return T((r=_(r,{Promise:Promise,timeout:0,overload:!1},{Promise:b})).Promise,(function(r,n,i){var o;if("function"==typeof e.addEventListener)return o=function(){r(g.apply(null,arguments))},i((function(){e.removeEventListener(t,o)})),void e.addEventListener(t,o,{once:!0});var a,s=function(){a&&e.removeListener("error",a),r(g.apply(null,arguments))};"error"!==t&&(a=function(r){e.removeListener(t,s),n(r)},e.once("error",a)),i((function(){a&&e.removeListener("error",a),e.removeListener(t,s)})),e.once(t,s)}),{timeout:r.timeout,overload:r.overload})},writable:!0,configurable:!0}}),Object.defineProperties(O,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),(n=function(){return N}.call(t,r,t,e))===o||(e.exports=n)}()},69331:function(e,t,r){var n=r(1135);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},13080:function(e,t,r){e.exports=r(69331)()},1135:function(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2138:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Resizable=void 0;var i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(22558)),o=r(82070),a=r(22898);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var u,l=(u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},u(e,t)},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;rt}return!1}function m(e,t,r,n,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var _=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function x(e,t,r,n){var i=y.hasOwnProperty(t)?y[t]:null;(null!==i?0!==i.type:n||!(2--u||o[s]!==a[u]){var l="\n"+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=s&&0<=u);break}}}finally{U=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?F(e):""}function G(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1);case 11:return e=W(e.type.render,!1);case 1:return e=W(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case M:return"Fragment";case T:return"Portal";case E:return"Profiler";case k:return"StrictMode";case P:return"Suspense";case N:return"SuspenseList"}if("object"===n(e))switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case C:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case O:return null!==(t=e.displayName||null)?t:V(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return V(e(t))}catch(e){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(t);case 8:return t===k?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function Y(e){switch(n(e)){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function $(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function X(e){e._valueTracker||(e._valueTracker=function(e){var t=$(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=$(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function Q(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function K(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=Y(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&x(e,"checked",t,!1)}function ee(e,t){J(e,t);var r=Y(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?re(e,t.type,r):t.hasOwnProperty("defaultValue")&&re(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function te(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function re(e,t,r){"number"===t&&Q(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ne=Array.isArray;function ie(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=he.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return de(e,t)}))}:de);function pe(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var ve={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ge=["Webkit","ms","Moz","O"];function me(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}function ye(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=me(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(ve).forEach((function(e){ge.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ve[t]=ve[e]}))}));var _e=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(_e[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==n(t.dangerouslySetInnerHTML)||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==n(t.style))throw Error(a(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Te=null,Me=null,ke=null;function Ee(e){if(e=xi(e)){if("function"!=typeof Te)throw Error(a(280));var t=e.stateNode;t&&(t=Si(t),Te(e.stateNode,e.type,t))}}function Ie(e){Me?ke?ke.push(e):ke=[e]:Me=e}function Ae(){if(Me){var e=Me,t=ke;if(ke=Me=null,Ee(e),t)for(e=0;e>>=0)?32:31-(lt(e)/ct|0)|0},lt=Math.log,ct=Math.LN2;var ht=64,dt=4194304;function ft(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pt(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes,a=268435455&r;if(0!==a){var s=a&~i;0!==s?n=ft(s):0!==(o&=a)&&(n=ft(o))}else 0!==(a=r&~i)?n=ft(a):0!==o&&(n=ft(o));if(0===n)return 0;if(0!==t&&t!==n&&0==(t&i)&&((i=n&-n)>=(o=t&-t)||16===i&&0!=(4194240&o)))return t;if(0!=(4&n)&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function _t(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ut(t)]=r}function bt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ut(r),i=1<=Lr),Br=String.fromCharCode(32),Fr=!1;function Ur(e,t){switch(e){case"keyup":return-1!==Rr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wr(e){return"object"===n(e=e.detail)&&"data"in e?e.data:null}var Gr=!1;var Vr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vr[e.type]:"textarea"===t}function Yr(e,t,r,n){Ie(n),0<(t=Xn(t,"onChange")).length&&(r=new hr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var $r=null,Xr=null;function qr(e){Fn(e,0)}function Qr(e){if(q(wi(e)))return e}function Zr(e,t){if("change"===e)return t}var Kr=!1;if(h){var Jr;if(h){var en="oninput"in document;if(!en){var tn=document.createElement("div");tn.setAttribute("oninput","return;"),en="function"==typeof tn.oninput}Jr=en}else Jr=!1;Kr=Jr&&(!document.documentMode||9=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hn(n)}}function fn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pn(){for(var e=window,t=Q();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=Q((e=t.contentWindow).document)}return t}function vn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function gn(e){var t=pn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&fn(r.ownerDocument.documentElement,r)){if(null!==n&&vn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=void 0===n.end?o:Math.min(n.end,i),!e.extend&&o>n&&(i=n,n=o,o=i),i=dn(r,o);var a=dn(r,n);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof r.focus&&r.focus(),r=0;r=document.documentMode,yn=null,_n=null,bn=null,xn=!1;function wn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;xn||null==yn||yn!==Q(n)||("selectionStart"in(n=yn)&&vn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},bn&&cn(bn,n)||(bn=n,0<(n=Xn(_n,"onSelect")).length&&(t=new hr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=yn)))}function Sn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Tn={animationend:Sn("Animation","AnimationEnd"),animationiteration:Sn("Animation","AnimationIteration"),animationstart:Sn("Animation","AnimationStart"),transitionend:Sn("Transition","TransitionEnd")},Mn={},kn={};function En(e){if(Mn[e])return Mn[e];if(!Tn[e])return e;var t,r=Tn[e];for(t in r)if(r.hasOwnProperty(t)&&t in kn)return Mn[e]=r[t];return e}h&&(kn=document.createElement("div").style,"AnimationEvent"in window||(delete Tn.animationend.animation,delete Tn.animationiteration.animation,delete Tn.animationstart.animation),"TransitionEvent"in window||delete Tn.transitionend.transition);var In=En("animationend"),An=En("animationiteration"),Cn=En("animationstart"),Pn=En("transitionend"),Nn=new Map,On="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Rn(e,t){Nn.set(e,t),l(t,[e])}for(var Dn=0;DnMi||(e.current=Ti[Mi],Ti[Mi]=null,Mi--)}function Ii(e,t){Mi++,Ti[Mi]=e.current,e.current=t}var Ai={},Ci=ki(Ai),Pi=ki(!1),Ni=Ai;function Oi(e,t){var r=e.type.contextTypes;if(!r)return Ai;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in r)o[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ri(e){return null!=(e=e.childContextTypes)}function Di(){Ei(Pi),Ei(Ci)}function Li(e,t,r){if(Ci.current!==Ai)throw Error(a(168));Ii(Ci,t),Ii(Pi,r)}function ji(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in t))throw Error(a(108,H(e)||"Unknown",i));return B({},r,n)}function zi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ai,Ni=Ci.current,Ii(Ci,e),Ii(Pi,Pi.current),!0}function Bi(e,t,r){var n=e.stateNode;if(!n)throw Error(a(169));r?(e=ji(e,t,Ni),n.__reactInternalMemoizedMergedChildContext=e,Ei(Pi),Ei(Ci),Ii(Ci,e)):Ei(Pi),Ii(Pi,r)}var Fi=null,Ui=!1,Wi=!1;function Gi(e){null===Fi?Fi=[e]:Fi.push(e)}function Vi(){if(!Wi&&null!==Fi){Wi=!0;var e=0,t=xt;try{var r=Fi;for(xt=1;e>=a,i-=a,Ki=1<<32-ut(t)+i|r<d?(g=h,h=null):g=h.sibling;var m=p(n,h,a[d],u);if(null===m){null===h&&(h=g);break}e&&h&&null===m.alternate&&t(n,h),o=s(m,o,d),null===c?l=m:c.sibling=m,c=m,h=g}if(d===a.length)return r(n,h),ao&&eo(n,d),l;if(null===h){for(;dg?(m=d,d=null):m=d.sibling;var _=p(n,d,y.value,l);if(null===_){null===d&&(d=m);break}e&&d&&null===_.alternate&&t(n,d),o=s(_,o,g),null===h?c=_:h.sibling=_,h=_,d=m}if(y.done)return r(n,d),ao&&eo(n,g),c;if(null===d){for(;!y.done;g++,y=u.next())null!==(y=f(n,y.value,l))&&(o=s(y,o,g),null===h?c=y:h.sibling=y,h=y);return ao&&eo(n,g),c}for(d=i(n,d);!y.done;g++,y=u.next())null!==(y=v(d,n,g,y.value,l))&&(e&&null!==y.alternate&&d.delete(null===y.key?g:y.key),o=s(y,o,g),null===h?c=y:h.sibling=y,h=y);return e&&d.forEach((function(e){return t(n,e)})),ao&&eo(n,g),c}return function e(i,a,s,l){if("object"===n(s)&&null!==s&&s.type===M&&null===s.key&&(s=s.props.children),"object"===n(s)&&null!==s){switch(s.$$typeof){case S:e:{for(var c=s.key,h=a;null!==h;){if(h.key===c){if((c=s.type)===M){if(7===h.tag){r(i,h.sibling),(a=o(h,s.props.children)).return=i,i=a;break e}}else if(h.elementType===c||"object"===n(c)&&null!==c&&c.$$typeof===R&&xo(c)===h.type){r(i,h.sibling),(a=o(h,s.props)).ref=_o(i,h,s),a.return=i,i=a;break e}r(i,h);break}t(i,h),h=h.sibling}s.type===M?((a=Ll(s.props.children,i.mode,l,s.key)).return=i,i=a):((l=Dl(s.type,s.key,s.props,null,i.mode,l)).ref=_o(i,a,s),l.return=i,i=l)}return u(i);case T:e:{for(h=s.key;null!==a;){if(a.key===h){if(4===a.tag&&a.stateNode.containerInfo===s.containerInfo&&a.stateNode.implementation===s.implementation){r(i,a.sibling),(a=o(a,s.children||[])).return=i,i=a;break e}r(i,a);break}t(i,a),a=a.sibling}(a=Bl(s,i.mode,l)).return=i,i=a}return u(i);case R:return e(i,a,(h=s._init)(s._payload),l)}if(ne(s))return g(i,a,s,l);if(j(s))return m(i,a,s,l);bo(i,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==a&&6===a.tag?(r(i,a.sibling),(a=o(a,s)).return=i,i=a):(r(i,a),(a=zl(s,i.mode,l)).return=i,i=a),u(i)):r(i,a)}}var So=wo(!0),To=wo(!1),Mo=ki(null),ko=null,Eo=null,Io=null;function Ao(){Io=Eo=ko=null}function Co(e){var t=Mo.current;Ei(Mo),e._currentValue=t}function Po(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){ko=e,Io=Eo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(xs=!0),e.firstContext=null)}function Oo(e){var t=e._currentValue;if(Io!==e)if(e={context:e,memoizedValue:t,next:null},null===Eo){if(null===ko)throw Error(a(308));Eo=e,ko.dependencies={lanes:0,firstContext:e}}else Eo=Eo.next=e;return t}var Ro=null;function Do(e){null===Ro?Ro=[e]:Ro.push(e)}function Lo(e,t,r,n){var i=t.interleaved;return null===i?(r.next=r,Do(t)):(r.next=i.next,i.next=r),t.interleaved=r,jo(e,n)}function jo(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var zo=!1;function Bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Uo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wo(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!=(2&Au)){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,jo(e,r)}return null===(i=n.interleaved)?(t.next=t,Do(n)):(t.next=i.next,i.next=t),n.interleaved=t,jo(e,r)}function Go(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&r))){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,bt(e,r)}}function Vo(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,o=null;if(null!==(r=r.firstBaseUpdate)){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===o?i=o=a:o=o.next=a,r=r.next}while(null!==r);null===o?i=o=t:o=o.next=t}else i=o=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ho(e,t,r,n){var i=e.updateQueue;zo=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var u=s,l=u.next;u.next=null,null===a?o=l:a.next=l,a=u;var c=e.alternate;null!==c&&((s=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===s?c.firstBaseUpdate=l:s.next=l,c.lastBaseUpdate=u))}if(null!==o){var h=i.baseState;for(a=0,c=l=u=null,s=o;;){var d=s.lane,f=s.eventTime;if((n&d)===d){null!==c&&(c=c.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,v=s;switch(d=t,f=r,v.tag){case 1:if("function"==typeof(p=v.payload)){h=p.call(f,h,d);break e}h=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(d="function"==typeof(p=v.payload)?p.call(f,h,d):p))break e;h=B({},h,d);break e;case 2:zo=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(d=i.effects)?i.effects=[s]:d.push(s))}else f={eventTime:f,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(l=c=f,u=h):c=c.next=f,a|=d;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(d=s).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}if(null===c&&(u=h),i.baseState=u,i.firstBaseUpdate=l,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);ju|=a,e.lanes=a,e.memoizedState=h}}function Yo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;tr?r:4,e(!0);var n=sa.transition;sa.transition={};try{e(!1),t()}finally{xt=r,sa.transition=n}}function Xa(){return xa().memoizedState}function qa(e,t,r){var n=rl(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Za(e))Ka(t,r);else if(null!==(r=Lo(e,t,r,n))){nl(r,e,n,tl()),Ja(r,t,n)}}function Qa(e,t,r){var n=rl(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Za(e))Ka(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,r);if(i.hasEagerState=!0,i.eagerState=s,ln(s,a)){var u=t.interleaved;return null===u?(i.next=i,Do(t)):(i.next=u.next,u.next=i),void(t.interleaved=i)}}catch(e){}null!==(r=Lo(e,t,i,n))&&(nl(r,e,n,i=tl()),Ja(r,t,n))}}function Za(e){var t=e.alternate;return e===la||null!==t&&t===la}function Ka(e,t){fa=da=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ja(e,t,r){if(0!=(4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,bt(e,r)}}var es={readContext:Oo,useCallback:ga,useContext:ga,useEffect:ga,useImperativeHandle:ga,useInsertionEffect:ga,useLayoutEffect:ga,useMemo:ga,useReducer:ga,useRef:ga,useState:ga,useDebugValue:ga,useDeferredValue:ga,useTransition:ga,useMutableSource:ga,useSyncExternalStore:ga,useId:ga,unstable_isNewReconciler:!1},ts={readContext:Oo,useCallback:function(e,t){return ba().memoizedState=[e,void 0===t?null:t],e},useContext:Oo,useEffect:ja,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,Da(4194308,4,Ua.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Da(4194308,4,e,t)},useInsertionEffect:function(e,t){return Da(4,2,e,t)},useMemo:function(e,t){var r=ba();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ba();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=qa.bind(null,la,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},ba().memoizedState=e},useState:Na,useDebugValue:Ga,useDeferredValue:function(e){return ba().memoizedState=e},useTransition:function(){var e=Na(!1),t=e[0];return e=$a.bind(null,e[1]),ba().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=la,i=ba();if(ao){if(void 0===r)throw Error(a(407));r=r()}else{if(r=t(),null===Cu)throw Error(a(349));0!=(30&ua)||Ea(n,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,ja(Aa.bind(null,n,o,e),[e]),n.flags|=2048,Oa(9,Ia.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=ba(),t=Cu.identifierPrefix;if(ao){var r=Ji;t=":"+t+"R"+(r=(Ki&~(1<<32-ut(Ki)-1)).toString(32)+r),0<(r=pa++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=va++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rs={readContext:Oo,useCallback:Va,useContext:Oo,useEffect:za,useImperativeHandle:Wa,useInsertionEffect:Ba,useLayoutEffect:Fa,useMemo:Ha,useReducer:Sa,useRef:Ra,useState:function(){return Sa(wa)},useDebugValue:Ga,useDeferredValue:function(e){return Ya(xa(),ca.memoizedState,e)},useTransition:function(){return[Sa(wa)[0],xa().memoizedState]},useMutableSource:Ma,useSyncExternalStore:ka,useId:Xa,unstable_isNewReconciler:!1},ns={readContext:Oo,useCallback:Va,useContext:Oo,useEffect:za,useImperativeHandle:Wa,useInsertionEffect:Ba,useLayoutEffect:Fa,useMemo:Ha,useReducer:Ta,useRef:Ra,useState:function(){return Ta(wa)},useDebugValue:Ga,useDeferredValue:function(e){var t=xa();return null===ca?t.memoizedState=e:Ya(t,ca.memoizedState,e)},useTransition:function(){return[Ta(wa)[0],xa().memoizedState]},useMutableSource:Ma,useSyncExternalStore:ka,useId:Xa,unstable_isNewReconciler:!1};function is(e,t){if(e&&e.defaultProps){for(var r in t=B({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}function os(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:B({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var as={isMounted:function(e){return!!(e=e._reactInternals)&&Ve(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=tl(),i=rl(e),o=Uo(n,i);o.payload=t,null!=r&&(o.callback=r),null!==(t=Wo(e,o,i))&&(nl(t,e,i,n),Go(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=tl(),i=rl(e),o=Uo(n,i);o.tag=1,o.payload=t,null!=r&&(o.callback=r),null!==(t=Wo(e,o,i))&&(nl(t,e,i,n),Go(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=tl(),n=rl(e),i=Uo(r,n);i.tag=2,null!=t&&(i.callback=t),null!==(t=Wo(e,i,n))&&(nl(t,e,n,r),Go(t,e,n))}};function ss(e,t,r,n,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!cn(r,n)||!cn(i,o))}function us(e,t,r){var i=!1,o=Ai,a=t.contextType;return"object"===n(a)&&null!==a?a=Oo(a):(o=Ri(t)?Ni:Ci.current,a=(i=null!=(i=t.contextTypes))?Oi(e,o):Ai),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=as,e.stateNode=t,t._reactInternals=e,i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function ls(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&as.enqueueReplaceState(t,t.state,null)}function cs(e,t,r,i){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},Bo(e);var a=t.contextType;"object"===n(a)&&null!==a?o.context=Oo(a):(a=Ri(t)?Ni:Ci.current,o.context=Oi(e,a)),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(os(e,t,a,r),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&as.enqueueReplaceState(o,o.state,null),Ho(e,r,o,i),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function hs(e,t){try{var r="",n=t;do{r+=G(n),n=n.return}while(n);var i=r}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function ds(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function fs(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var ps="function"==typeof WeakMap?WeakMap:Map;function vs(e,t,r){(r=Uo(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Hu||(Hu=!0,Yu=n),fs(0,t)},r}function gs(e,t,r){(r=Uo(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){fs(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(r.callback=function(){fs(0,t),"function"!=typeof n&&(null===$u?$u=new Set([this]):$u.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function ms(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new ps;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=kl.bind(null,e,t,r),t.then(e,e))}function ys(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function _s(e,t,r,n,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=Uo(-1,1)).tag=2,Wo(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var bs=w.ReactCurrentOwner,xs=!1;function ws(e,t,r,n){t.child=null===e?To(t,null,r,n):So(t,e.child,r,n)}function Ss(e,t,r,n,i){r=r.render;var o=t.ref;return No(t,i),n=ya(e,t,r,n,o,i),r=_a(),null===e||xs?(ao&&r&&ro(t),t.flags|=1,ws(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hs(e,t,i))}function Ts(e,t,r,n,i){if(null===e){var o=r.type;return"function"!=typeof o||Ol(o)||void 0!==o.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Dl(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Ms(e,t,o,n,i))}if(o=e.child,0==(e.lanes&i)){var a=o.memoizedProps;if((r=null!==(r=r.compare)?r:cn)(a,n)&&e.ref===t.ref)return Hs(e,t,i)}return t.flags|=1,(e=Rl(o,n)).ref=t.ref,e.return=t,t.child=e}function Ms(e,t,r,n,i){if(null!==e){var o=e.memoizedProps;if(cn(o,n)&&e.ref===t.ref){if(xs=!1,t.pendingProps=n=o,0==(e.lanes&i))return t.lanes=e.lanes,Hs(e,t,i);0!=(131072&e.flags)&&(xs=!0)}}return Is(e,t,r,n,i)}function ks(e,t,r){var n=t.pendingProps,i=n.children,o=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ii(Ru,Ou),Ou|=r;else{if(0==(1073741824&r))return e=null!==o?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ii(Ru,Ou),Ou|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==o?o.baseLanes:r,Ii(Ru,Ou),Ou|=n}else null!==o?(n=o.baseLanes|r,t.memoizedState=null):n=r,Ii(Ru,Ou),Ou|=n;return ws(e,t,i,r),t.child}function Es(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Is(e,t,r,n,i){var o=Ri(r)?Ni:Ci.current;return o=Oi(t,o),No(t,i),r=ya(e,t,r,n,o,i),n=_a(),null===e||xs?(ao&&n&&ro(t),t.flags|=1,ws(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hs(e,t,i))}function As(e,t,r,i,o){if(Ri(r)){var a=!0;zi(t)}else a=!1;if(No(t,o),null===t.stateNode)Vs(e,t),us(t,r,i),cs(t,r,i,o),i=!0;else if(null===e){var s=t.stateNode,u=t.memoizedProps;s.props=u;var l=s.context,c=r.contextType;"object"===n(c)&&null!==c?c=Oo(c):c=Oi(t,c=Ri(r)?Ni:Ci.current);var h=r.getDerivedStateFromProps,d="function"==typeof h||"function"==typeof s.getSnapshotBeforeUpdate;d||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(u!==i||l!==c)&&ls(t,s,i,c),zo=!1;var f=t.memoizedState;s.state=f,Ho(t,i,s,o),l=t.memoizedState,u!==i||f!==l||Pi.current||zo?("function"==typeof h&&(os(t,r,h,i),l=t.memoizedState),(u=zo||ss(t,r,u,i,f,l,c))?(d||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),s.props=i,s.state=l,s.context=c,i=u):("function"==typeof s.componentDidMount&&(t.flags|=4194308),i=!1)}else{s=t.stateNode,Fo(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:is(t.type,u),s.props=c,d=t.pendingProps,f=s.context,"object"===n(l=r.contextType)&&null!==l?l=Oo(l):l=Oi(t,l=Ri(r)?Ni:Ci.current);var p=r.getDerivedStateFromProps;(h="function"==typeof p||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(u!==d||f!==l)&&ls(t,s,i,l),zo=!1,f=t.memoizedState,s.state=f,Ho(t,i,s,o);var v=t.memoizedState;u!==d||f!==v||Pi.current||zo?("function"==typeof p&&(os(t,r,p,i),v=t.memoizedState),(c=zo||ss(t,r,c,i,f,v,l)||!1)?(h||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(i,v,l),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(i,v,l)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=v),s.props=i,s.state=v,s.context=l,i=c):("function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),i=!1)}return Cs(e,t,r,i,a,o)}function Cs(e,t,r,n,i,o){Es(e,t);var a=0!=(128&t.flags);if(!n&&!a)return i&&Bi(t,r,!1),Hs(e,t,o);n=t.stateNode,bs.current=t;var s=a&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&a?(t.child=So(t,e.child,null,o),t.child=So(t,null,s,o)):ws(e,t,s,o),t.memoizedState=n.state,i&&Bi(t,r,!0),t.child}function Ps(e){var t=e.stateNode;t.pendingContext?Li(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Li(0,t.context,!1),Ko(e,t.containerInfo)}function Ns(e,t,r,n,i){return go(),mo(i),t.flags|=256,ws(e,t,r,n),t.child}var Os,Rs,Ds,Ls={dehydrated:null,treeContext:null,retryLane:0};function js(e){return{baseLanes:e,cachePool:null,transitions:null}}function zs(e,t,r){var n,i=t.pendingProps,o=ra.current,s=!1,u=0!=(128&t.flags);if((n=u)||(n=(null===e||null!==e.memoizedState)&&0!=(2&o)),n?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Ii(ra,1&o),null===e)return ho(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(u=i.children,e=i.fallback,s?(i=t.mode,s=t.child,u={mode:"hidden",children:u},0==(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=u):s=jl(u,i,0,null),e=Ll(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=js(r),t.memoizedState=Ls,e):Bs(t,u));if(null!==(o=e.memoizedState)&&null!==(n=o.dehydrated))return function(e,t,r,n,i,o,s){if(r)return 256&t.flags?(t.flags&=-257,Fs(e,t,s,n=ds(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=n.fallback,i=t.mode,n=jl({mode:"visible",children:n.children},i,0,null),(o=Ll(o,i,s,null)).flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,0!=(1&t.mode)&&So(t,e.child,null,s),t.child.memoizedState=js(s),t.memoizedState=Ls,o);if(0==(1&t.mode))return Fs(e,t,s,null);if("$!"===i.data){if(n=i.nextSibling&&i.nextSibling.dataset)var u=n.dgst;return n=u,Fs(e,t,s,n=ds(o=Error(a(419)),n,void 0))}if(u=0!=(s&e.childLanes),xs||u){if(null!==(n=Cu)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!=(i&(n.suspendedLanes|s))?0:i)&&i!==o.retryLane&&(o.retryLane=i,jo(e,i),nl(n,e,i,-1))}return gl(),Fs(e,t,s,n=ds(Error(a(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Il.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,oo=hi(i.nextSibling),io=t,ao=!0,so=null,null!==e&&(qi[Qi++]=Ki,qi[Qi++]=Ji,qi[Qi++]=Zi,Ki=e.id,Ji=e.overflow,Zi=t),(t=Bs(t,n.children)).flags|=4096,t)}(e,t,u,i,n,o,r);if(s){s=i.fallback,u=t.mode,n=(o=e.child).sibling;var l={mode:"hidden",children:i.children};return 0==(1&u)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null):(i=Rl(o,l)).subtreeFlags=14680064&o.subtreeFlags,null!==n?s=Rl(n,s):(s=Ll(s,u,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,u=null===(u=e.child.memoizedState)?js(r):{baseLanes:u.baseLanes|r,cachePool:null,transitions:u.transitions},s.memoizedState=u,s.childLanes=e.childLanes&~r,t.memoizedState=Ls,i}return e=(s=e.child).sibling,i=Rl(s,{mode:"visible",children:i.children}),0==(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Bs(e,t){return(t=jl({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fs(e,t,r,n){return null!==n&&mo(n),So(t,e.child,null,r),(e=Bs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Us(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Po(e.return,t,r)}function Ws(e,t,r,n,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i)}function Gs(e,t,r){var n=t.pendingProps,i=n.revealOrder,o=n.tail;if(ws(e,t,n.children,r),0!=(2&(n=ra.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Us(e,r,t);else if(19===e.tag)Us(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ii(ra,n),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===na(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Ws(t,!1,i,r,o);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===na(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Ws(t,!0,r,null,o);break;case"together":Ws(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vs(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hs(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),ju|=t.lanes,0==(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(r=Rl(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Rl(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Ys(e,t){if(!ao)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function $s(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Xs(e,t,r){var n=t.pendingProps;switch(no(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $s(t),null;case 1:case 17:return Ri(t.type)&&Di(),$s(t),null;case 3:return n=t.stateNode,Jo(),Ei(Pi),Ei(Ci),oa(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(po(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==so&&(sl(so),so=null))),$s(t),null;case 5:ta(t);var i=Zo(Qo.current);if(r=t.type,null!==e&&null!=t.stateNode)Rs(e,t,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(a(166));return $s(t),null}if(e=Zo(Xo.current),po(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[pi]=t,n[vi]=o,e=0!=(1&t.mode),r){case"dialog":Un("cancel",n),Un("close",n);break;case"iframe":case"object":case"embed":Un("load",n);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),"select"===r&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[pi]=t,e[vi]=n,Os(e,t),t.stateNode=e;e:{switch(s=xe(r,n),r){case"dialog":Un("cancel",e),Un("close",e),i=n;break;case"iframe":case"object":case"embed":Un("load",e),i=n;break;case"video":case"audio":for(i=0;iGu&&(t.flags|=128,n=!0,Ys(o,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=na(s))){if(t.flags|=128,n=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Ys(o,!0),null===o.tail&&"hidden"===o.tailMode&&!s.alternate&&!ao)return $s(t),null}else 2*Je()-o.renderingStartTime>Gu&&1073741824!==r&&(t.flags|=128,n=!0,Ys(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(null!==(r=o.last)?r.sibling=s:t.child=s,o.last=s)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Je(),t.sibling=null,r=ra.current,Ii(ra,n?1&r|2:1&r),t):($s(t),null);case 22:case 23:return dl(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&Ou)&&($s(t),6&t.subtreeFlags&&(t.flags|=8192)):$s(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function qs(e,t){switch(no(t),t.tag){case 1:return Ri(t.type)&&Di(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Jo(),Ei(Pi),Ei(Ci),oa(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ta(t),null;case 13:if(Ei(ra),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));go()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ei(ra),null;case 4:return Jo(),null;case 10:return Co(t.type._context),null;case 22:case 23:return dl(),null;default:return null}}Os=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Rs=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Zo(Xo.current);var o,a=null;switch(r){case"input":i=Z(e,i),n=Z(e,n),a=[];break;case"select":i=B({},i,{value:void 0}),n=B({},n,{value:void 0}),a=[];break;case"textarea":i=oe(e,i),n=oe(e,n),a=[];break;default:"function"!=typeof i.onClick&&"function"==typeof n.onClick&&(e.onclick=ti)}for(c in be(r,n),r=null,i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var s=i[c];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(u.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var l=n[c];if(s=null!=i?i[c]:void 0,n.hasOwnProperty(c)&&l!==s&&(null!=l||null!=s))if("style"===c)if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(a||(a=[]),a.push(c,r)),r=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(a=a||[]).push(c,l)):"children"===c?"string"!=typeof l&&"number"!=typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(u.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&Un("scroll",e),a||s===l||(a=[])):(a=a||[]).push(c,l))}r&&(a=a||[]).push("style",r);var c=a;(t.updateQueue=c)&&(t.flags|=4)}},Ds=function(e,t,r,n){r!==n&&(t.flags|=4)};var Qs=!1,Zs=!1,Ks="function"==typeof WeakSet?WeakSet:Set,Js=null;function eu(e,t){var r=e.ref;if(null!==r)if("function"==typeof r)try{r(null)}catch(r){Ml(e,t,r)}else r.current=null}function tu(e,t,r){try{r()}catch(r){Ml(e,t,r)}}var ru=!1;function nu(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&tu(t,r,o)}i=i.next}while(i!==n)}}function iu(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ou(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"==typeof t?t(e):t.current=e}}function au(e){var t=e.alternate;null!==t&&(e.alternate=null,au(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[pi],delete t[vi],delete t[mi],delete t[yi],delete t[_i])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function su(e){return 5===e.tag||3===e.tag||4===e.tag}function uu(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||su(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function lu(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=ti));else if(4!==n&&null!==(e=e.child))for(lu(e,t,r),e=e.sibling;null!==e;)lu(e,t,r),e=e.sibling}function cu(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(cu(e,t,r),e=e.sibling;null!==e;)cu(e,t,r),e=e.sibling}var hu=null,du=!1;function fu(e,t,r){for(r=r.child;null!==r;)pu(e,t,r),r=r.sibling}function pu(e,t,r){if(st&&"function"==typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(at,r)}catch(e){}switch(r.tag){case 5:Zs||eu(r,t);case 6:var n=hu,i=du;hu=null,fu(e,t,r),du=i,null!==(hu=n)&&(du?(e=hu,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):hu.removeChild(r.stateNode));break;case 18:null!==hu&&(du?(e=hu,r=r.stateNode,8===e.nodeType?ci(e.parentNode,r):1===e.nodeType&&ci(e,r),Vt(e)):ci(hu,r.stateNode));break;case 4:n=hu,i=du,hu=r.stateNode.containerInfo,du=!0,fu(e,t,r),hu=n,du=i;break;case 0:case 11:case 14:case 15:if(!Zs&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(0!=(2&o)||0!=(4&o))&&tu(r,t,a),i=i.next}while(i!==n)}fu(e,t,r);break;case 1:if(!Zs&&(eu(r,t),"function"==typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(e){Ml(r,t,e)}fu(e,t,r);break;case 21:fu(e,t,r);break;case 22:1&r.mode?(Zs=(n=Zs)||null!==r.memoizedState,fu(e,t,r),Zs=n):fu(e,t,r);break;default:fu(e,t,r)}}function vu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Ks),t.forEach((function(t){var n=Al.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function gu(e,t){var r=t.deletions;if(null!==r)for(var n=0;ni&&(i=s),n&=~o}if(n=i,10<(n=(120>(n=Je()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Mu(n/1960))-n)){e.timeoutHandle=oi(wl.bind(null,e,Uu,Vu),n);break}wl(e,Uu,Vu);break;default:throw Error(a(329))}}}return il(e,Je()),e.callbackNode===r?ol.bind(null,e):null}function al(e,t){var r=Fu;return e.current.memoizedState.isDehydrated&&(fl(e,t).flags|=256),2!==(e=ml(e,t))&&(t=Uu,Uu=r,null!==t&&sl(t)),e}function sl(e){null===Uu?Uu=e:Uu.push.apply(Uu,e)}function ul(e,t){for(t&=~Bu,t&=~zu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===qu)var n=!1;else{if(e=qu,qu=null,Qu=0,0!=(6&Au))throw Error(a(331));var i=Au;for(Au|=4,Js=e.current;null!==Js;){var o=Js,s=o.child;if(0!=(16&Js.flags)){var u=o.deletions;if(null!==u){for(var l=0;lJe()-Wu?fl(e,0):Bu|=r),il(e,t)}function El(e,t){0===t&&(0==(1&e.mode)?t=1:(t=dt,0==(130023424&(dt<<=1))&&(dt=4194304)));var r=tl();null!==(e=jo(e,t))&&(_t(e,t,r),il(e,r))}function Il(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),El(e,r)}function Al(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(a(314))}null!==n&&n.delete(t),El(e,r)}function Cl(e,t){return qe(e,t)}function Pl(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nl(e,t,r,n){return new Pl(e,t,r,n)}function Ol(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rl(e,t){var r=e.alternate;return null===r?((r=Nl(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Dl(e,t,r,i,o,s){var u=2;if(i=e,"function"==typeof e)Ol(e)&&(u=1);else if("string"==typeof e)u=5;else e:switch(e){case M:return Ll(r.children,o,s,t);case k:u=8,o|=8;break;case E:return(e=Nl(12,r,t,2|o)).elementType=E,e.lanes=s,e;case P:return(e=Nl(13,r,t,o)).elementType=P,e.lanes=s,e;case N:return(e=Nl(19,r,t,o)).elementType=N,e.lanes=s,e;case D:return jl(r,o,s,t);default:if("object"===n(e)&&null!==e)switch(e.$$typeof){case I:u=10;break e;case A:u=9;break e;case C:u=11;break e;case O:u=14;break e;case R:u=16,i=null;break e}throw Error(a(130,null==e?e:n(e),""))}return(t=Nl(u,r,t,o)).elementType=e,t.type=i,t.lanes=s,t}function Ll(e,t,r,n){return(e=Nl(7,e,n,t)).lanes=r,e}function jl(e,t,r,n){return(e=Nl(22,e,n,t)).elementType=D,e.lanes=r,e.stateNode={isHidden:!1},e}function zl(e,t,r){return(e=Nl(6,e,null,t)).lanes=r,e}function Bl(e,t,r){return(t=Nl(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fl(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yt(0),this.expirationTimes=yt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ul(e,t,r,n,i,o,a,s,u){return e=new Fl(e,t,r,s,u),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Nl(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bo(o),e}function Wl(e,t,r){var n=3=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),n}return c(r,null,[{key:"getDerivedStateFromProps",value:function(e,t){var r=e.position,n=t.prevPropsPosition;return!r||n&&r.x===n.x&&r.y===n.y?null:((0,M.default)("Draggable: getDerivedStateFromProps %j",{position:r,prevPropsPosition:n}),{x:r.x,y:r.y,prevPropsPosition:s({},r)})}}]),c(r,[{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:_.default.findDOMNode(this)}},{key:"render",value:function(){var e,t=this.props,r=(t.axis,t.bounds,t.children),i=t.defaultPosition,o=t.defaultClassName,a=t.defaultClassNameDragging,l=t.defaultClassNameDragged,c=t.position,h=t.positionOffset,d=(t.scale,n(t,["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"])),f={},p=null,v=!Boolean(c)||this.state.dragging,g=c||i,y={x:(0,w.canDragX)(this)&&v?this.state.x:g.x,y:(0,w.canDragY)(this)&&v?this.state.y:g.y};this.state.isElementSVG?p=(0,x.createSVGTransform)(y,h):f=(0,x.createCSSTransform)(y,h);var _=(0,b.default)(r.props.className||"",o,(u(e={},a,this.state.dragging),u(e,l,this.state.dragged),e));return m.createElement(T.default,I({},d,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),m.cloneElement(m.Children.only(r),{className:_,style:s(s({},r.props.style),f),transform:p}))}}]),r}(m.Component);t.default=C,A(C,"displayName","Draggable"),A(C,"propTypes",s(s({},T.default.propTypes),{},{axis:y.default.oneOf(["both","x","y","none"]),bounds:y.default.oneOfType([y.default.shape({left:y.default.number,right:y.default.number,top:y.default.number,bottom:y.default.number}),y.default.string,y.default.oneOf([!1])]),defaultClassName:y.default.string,defaultClassNameDragging:y.default.string,defaultClassNameDragged:y.default.string,defaultPosition:y.default.shape({x:y.default.number,y:y.default.number}),positionOffset:y.default.shape({x:y.default.oneOfType([y.default.number,y.default.string]),y:y.default.oneOfType([y.default.number,y.default.string])}),position:y.default.shape({x:y.default.number,y:y.default.number}),className:S.dontSetMe,style:S.dontSetMe,transform:S.dontSetMe})),A(C,"defaultProps",s(s({},T.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))},83888:function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r not mounted on DragStart!");var n=r.ownerDocument;if(!(e.props.disabled||!(t.target instanceof n.defaultView.Node)||e.props.handle&&!(0,g.matchesSelectorAndParentsTo)(t.target,e.props.handle,r)||e.props.cancel&&(0,g.matchesSelectorAndParentsTo)(t.target,e.props.cancel,r))){"touchstart"===t.type&&t.preventDefault();var i=(0,g.getTouchIdentifier)(t);e.touchIdentifier=i;var o=(0,m.getControlPosition)(t,i,c(e));if(null!=o){var a=o.x,s=o.y,u=(0,m.createCoreData)(c(e),a,s);(0,_.default)("DraggableCore: handleDragStart: %j",u),(0,_.default)("calling",e.props.onStart),!1!==e.props.onStart(t,u)&&!1!==e.mounted&&(e.props.enableUserSelectHack&&(0,g.addUserSelectStyles)(n),e.dragging=!0,e.lastX=a,e.lastY=s,(0,g.addEvent)(n,M.move,e.handleDrag),(0,g.addEvent)(n,M.stop,e.handleDragStop))}}})),w(c(e),"handleDrag",(function(t){var r=(0,m.getControlPosition)(t,e.touchIdentifier,c(e));if(null!=r){var i=r.x,o=r.y;if(Array.isArray(e.props.grid)){var a=i-e.lastX,s=o-e.lastY,u=n((0,m.snapToGrid)(e.props.grid,a,s),2);if(a=u[0],s=u[1],!a&&!s)return;i=e.lastX+a,o=e.lastY+s}var l=(0,m.createCoreData)(c(e),i,o);if((0,_.default)("DraggableCore: handleDrag: %j",l),!1!==e.props.onDrag(t,l)&&!1!==e.mounted)e.lastX=i,e.lastY=o;else try{e.handleDragStop(new MouseEvent("mouseup"))}catch(t){var h=document.createEvent("MouseEvents");h.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.handleDragStop(h)}}})),w(c(e),"handleDragStop",(function(t){if(e.dragging){var r=(0,m.getControlPosition)(t,e.touchIdentifier,c(e));if(null!=r){var i=r.x,o=r.y;if(Array.isArray(e.props.grid)){var a=i-e.lastX||0,s=o-e.lastY||0,u=n((0,m.snapToGrid)(e.props.grid,a,s),2);a=u[0],s=u[1],i=e.lastX+a,o=e.lastY+s}var l=(0,m.createCoreData)(c(e),i,o);if(!1===e.props.onStop(t,l)||!1===e.mounted)return!1;var h=e.findDOMNode();h&&e.props.enableUserSelectHack&&(0,g.removeUserSelectStyles)(h.ownerDocument),(0,_.default)("DraggableCore: handleDragStop: %j",l),e.dragging=!1,e.lastX=NaN,e.lastY=NaN,h&&((0,_.default)("DraggableCore: Removing handlers"),(0,g.removeEvent)(h.ownerDocument,M.move,e.handleDrag),(0,g.removeEvent)(h.ownerDocument,M.stop,e.handleDragStop))}}})),w(c(e),"onMouseDown",(function(t){return M=T,e.handleDragStart(t)})),w(c(e),"onMouseUp",(function(t){return M=T,e.handleDragStop(t)})),w(c(e),"onTouchStart",(function(t){return M=S,e.handleDragStart(t)})),w(c(e),"onTouchEnd",(function(t){return M=S,e.handleDragStop(t)})),e}return t=h,(r=[{key:"componentDidMount",value:function(){this.mounted=!0;var e=this.findDOMNode();e&&(0,g.addEvent)(e,S.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.findDOMNode();if(e){var t=e.ownerDocument;(0,g.removeEvent)(t,T.move,this.handleDrag),(0,g.removeEvent)(t,S.move,this.handleDrag),(0,g.removeEvent)(t,T.stop,this.handleDragStop),(0,g.removeEvent)(t,S.stop,this.handleDragStop),(0,g.removeEvent)(e,S.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,g.removeUserSelectStyles)(t)}}},{key:"findDOMNode",value:function(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:v.default.findDOMNode(this)}},{key:"render",value:function(){return f.cloneElement(f.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&a(t.prototype,r),i&&a(t,i),h}(f.Component);t.default=k,w(k,"displayName","DraggableCore"),w(k,"propTypes",{allowAnyClick:p.default.bool,children:p.default.node.isRequired,disabled:p.default.bool,enableUserSelectHack:p.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:p.default.arrayOf(p.default.number),handle:p.default.string,cancel:p.default.string,nodeRef:p.default.object,onStart:p.default.func,onDrag:p.default.func,onStop:p.default.func,onMouseDown:p.default.func,scale:p.default.number,className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),w(k,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},9683:function(e,t,r){var n=r(73378),i=n.default,o=n.DraggableCore;e.exports=i,e.exports.default=i,e.exports.DraggableCore=o},90767:function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";var n=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!n)return"";if(t in n)return"";for(var o=0;o: Unmounted during event!");return t}},74640:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(var r=0,n=e.length;rt}return!1}function m(e,t,r,n,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var _=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function x(e,t,r,n){var i=y.hasOwnProperty(t)?y[t]:null;(null!==i?0!==i.type:n||!(2--u||o[s]!==a[u]){var l="\n"+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=s&&0<=u);break}}}finally{U=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?F(e):""}function G(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1);case 11:return e=W(e.type.render,!1);case 1:return e=W(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case M:return"Fragment";case T:return"Portal";case E:return"Profiler";case k:return"StrictMode";case P:return"Suspense";case N:return"SuspenseList"}if("object"===n(e))switch(e.$$typeof){case I:return(e.displayName||"Context")+".Consumer";case A:return(e._context.displayName||"Context")+".Provider";case C:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case O:return null!==(t=e.displayName||null)?t:V(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return V(e(t))}catch(e){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(t);case 8:return t===k?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function Y(e){switch(n(e)){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function $(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function X(e){e._valueTracker||(e._valueTracker=function(e){var t=$(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=$(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function Q(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function K(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=Y(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&x(e,"checked",t,!1)}function ee(e,t){J(e,t);var r=Y(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?re(e,t.type,r):t.hasOwnProperty("defaultValue")&&re(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function te(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function re(e,t,r){"number"===t&&Q(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ne=Array.isArray;function ie(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=he.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return de(e,t)}))}:de);function pe(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var ve={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ge=["Webkit","ms","Moz","O"];function me(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}function ye(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=me(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(ve).forEach((function(e){ge.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ve[t]=ve[e]}))}));var _e=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(_e[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==n(t.dangerouslySetInnerHTML)||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==n(t.style))throw Error(a(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Te=null,Me=null,ke=null;function Ee(e){if(e=xi(e)){if("function"!=typeof Te)throw Error(a(280));var t=e.stateNode;t&&(t=Si(t),Te(e.stateNode,e.type,t))}}function Ae(e){Me?ke?ke.push(e):ke=[e]:Me=e}function Ie(){if(Me){var e=Me,t=ke;if(ke=Me=null,Ee(e),t)for(e=0;e>>=0)?32:31-(lt(e)/ct|0)|0},lt=Math.log,ct=Math.LN2;var ht=64,dt=4194304;function ft(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pt(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes,a=268435455&r;if(0!==a){var s=a&~i;0!==s?n=ft(s):0!==(o&=a)&&(n=ft(o))}else 0!==(a=r&~i)?n=ft(a):0!==o&&(n=ft(o));if(0===n)return 0;if(0!==t&&t!==n&&0==(t&i)&&((i=n&-n)>=(o=t&-t)||16===i&&0!=(4194240&o)))return t;if(0!=(4&n)&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function _t(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ut(t)]=r}function bt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ut(r),i=1<=Lr),Br=String.fromCharCode(32),Fr=!1;function Ur(e,t){switch(e){case"keyup":return-1!==Rr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wr(e){return"object"===n(e=e.detail)&&"data"in e?e.data:null}var Gr=!1;var Vr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vr[e.type]:"textarea"===t}function Yr(e,t,r,n){Ae(n),0<(t=Xn(t,"onChange")).length&&(r=new hr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var $r=null,Xr=null;function qr(e){Fn(e,0)}function Qr(e){if(q(wi(e)))return e}function Zr(e,t){if("change"===e)return t}var Kr=!1;if(h){var Jr;if(h){var en="oninput"in document;if(!en){var tn=document.createElement("div");tn.setAttribute("oninput","return;"),en="function"==typeof tn.oninput}Jr=en}else Jr=!1;Kr=Jr&&(!document.documentMode||9=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hn(n)}}function fn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pn(){for(var e=window,t=Q();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=Q((e=t.contentWindow).document)}return t}function vn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function gn(e){var t=pn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&fn(r.ownerDocument.documentElement,r)){if(null!==n&&vn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=void 0===n.end?o:Math.min(n.end,i),!e.extend&&o>n&&(i=n,n=o,o=i),i=dn(r,o);var a=dn(r,n);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof r.focus&&r.focus(),r=0;r=document.documentMode,yn=null,_n=null,bn=null,xn=!1;function wn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;xn||null==yn||yn!==Q(n)||("selectionStart"in(n=yn)&&vn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},bn&&cn(bn,n)||(bn=n,0<(n=Xn(_n,"onSelect")).length&&(t=new hr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=yn)))}function Sn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Tn={animationend:Sn("Animation","AnimationEnd"),animationiteration:Sn("Animation","AnimationIteration"),animationstart:Sn("Animation","AnimationStart"),transitionend:Sn("Transition","TransitionEnd")},Mn={},kn={};function En(e){if(Mn[e])return Mn[e];if(!Tn[e])return e;var t,r=Tn[e];for(t in r)if(r.hasOwnProperty(t)&&t in kn)return Mn[e]=r[t];return e}h&&(kn=document.createElement("div").style,"AnimationEvent"in window||(delete Tn.animationend.animation,delete Tn.animationiteration.animation,delete Tn.animationstart.animation),"TransitionEvent"in window||delete Tn.transitionend.transition);var An=En("animationend"),In=En("animationiteration"),Cn=En("animationstart"),Pn=En("transitionend"),Nn=new Map,On="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Rn(e,t){Nn.set(e,t),l(t,[e])}for(var Dn=0;DnMi||(e.current=Ti[Mi],Ti[Mi]=null,Mi--)}function Ai(e,t){Mi++,Ti[Mi]=e.current,e.current=t}var Ii={},Ci=ki(Ii),Pi=ki(!1),Ni=Ii;function Oi(e,t){var r=e.type.contextTypes;if(!r)return Ii;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in r)o[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ri(e){return null!=(e=e.childContextTypes)}function Di(){Ei(Pi),Ei(Ci)}function Li(e,t,r){if(Ci.current!==Ii)throw Error(a(168));Ai(Ci,t),Ai(Pi,r)}function ji(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in t))throw Error(a(108,H(e)||"Unknown",i));return B({},r,n)}function zi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ii,Ni=Ci.current,Ai(Ci,e),Ai(Pi,Pi.current),!0}function Bi(e,t,r){var n=e.stateNode;if(!n)throw Error(a(169));r?(e=ji(e,t,Ni),n.__reactInternalMemoizedMergedChildContext=e,Ei(Pi),Ei(Ci),Ai(Ci,e)):Ei(Pi),Ai(Pi,r)}var Fi=null,Ui=!1,Wi=!1;function Gi(e){null===Fi?Fi=[e]:Fi.push(e)}function Vi(){if(!Wi&&null!==Fi){Wi=!0;var e=0,t=xt;try{var r=Fi;for(xt=1;e>=a,i-=a,Ki=1<<32-ut(t)+i|r<d?(g=h,h=null):g=h.sibling;var m=p(n,h,a[d],u);if(null===m){null===h&&(h=g);break}e&&h&&null===m.alternate&&t(n,h),o=s(m,o,d),null===c?l=m:c.sibling=m,c=m,h=g}if(d===a.length)return r(n,h),ao&&eo(n,d),l;if(null===h){for(;dg?(m=d,d=null):m=d.sibling;var _=p(n,d,y.value,l);if(null===_){null===d&&(d=m);break}e&&d&&null===_.alternate&&t(n,d),o=s(_,o,g),null===h?c=_:h.sibling=_,h=_,d=m}if(y.done)return r(n,d),ao&&eo(n,g),c;if(null===d){for(;!y.done;g++,y=u.next())null!==(y=f(n,y.value,l))&&(o=s(y,o,g),null===h?c=y:h.sibling=y,h=y);return ao&&eo(n,g),c}for(d=i(n,d);!y.done;g++,y=u.next())null!==(y=v(d,n,g,y.value,l))&&(e&&null!==y.alternate&&d.delete(null===y.key?g:y.key),o=s(y,o,g),null===h?c=y:h.sibling=y,h=y);return e&&d.forEach((function(e){return t(n,e)})),ao&&eo(n,g),c}return function e(i,a,s,l){if("object"===n(s)&&null!==s&&s.type===M&&null===s.key&&(s=s.props.children),"object"===n(s)&&null!==s){switch(s.$$typeof){case S:e:{for(var c=s.key,h=a;null!==h;){if(h.key===c){if((c=s.type)===M){if(7===h.tag){r(i,h.sibling),(a=o(h,s.props.children)).return=i,i=a;break e}}else if(h.elementType===c||"object"===n(c)&&null!==c&&c.$$typeof===R&&xo(c)===h.type){r(i,h.sibling),(a=o(h,s.props)).ref=_o(i,h,s),a.return=i,i=a;break e}r(i,h);break}t(i,h),h=h.sibling}s.type===M?((a=Ll(s.props.children,i.mode,l,s.key)).return=i,i=a):((l=Dl(s.type,s.key,s.props,null,i.mode,l)).ref=_o(i,a,s),l.return=i,i=l)}return u(i);case T:e:{for(h=s.key;null!==a;){if(a.key===h){if(4===a.tag&&a.stateNode.containerInfo===s.containerInfo&&a.stateNode.implementation===s.implementation){r(i,a.sibling),(a=o(a,s.children||[])).return=i,i=a;break e}r(i,a);break}t(i,a),a=a.sibling}(a=Bl(s,i.mode,l)).return=i,i=a}return u(i);case R:return e(i,a,(h=s._init)(s._payload),l)}if(ne(s))return g(i,a,s,l);if(j(s))return m(i,a,s,l);bo(i,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==a&&6===a.tag?(r(i,a.sibling),(a=o(a,s)).return=i,i=a):(r(i,a),(a=zl(s,i.mode,l)).return=i,i=a),u(i)):r(i,a)}}var So=wo(!0),To=wo(!1),Mo=ki(null),ko=null,Eo=null,Ao=null;function Io(){Ao=Eo=ko=null}function Co(e){var t=Mo.current;Ei(Mo),e._currentValue=t}function Po(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){ko=e,Ao=Eo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(xs=!0),e.firstContext=null)}function Oo(e){var t=e._currentValue;if(Ao!==e)if(e={context:e,memoizedValue:t,next:null},null===Eo){if(null===ko)throw Error(a(308));Eo=e,ko.dependencies={lanes:0,firstContext:e}}else Eo=Eo.next=e;return t}var Ro=null;function Do(e){null===Ro?Ro=[e]:Ro.push(e)}function Lo(e,t,r,n){var i=t.interleaved;return null===i?(r.next=r,Do(t)):(r.next=i.next,i.next=r),t.interleaved=r,jo(e,n)}function jo(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var zo=!1;function Bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Uo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wo(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!=(2&Iu)){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,jo(e,r)}return null===(i=n.interleaved)?(t.next=t,Do(n)):(t.next=i.next,i.next=t),n.interleaved=t,jo(e,r)}function Go(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&r))){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,bt(e,r)}}function Vo(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,o=null;if(null!==(r=r.firstBaseUpdate)){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===o?i=o=a:o=o.next=a,r=r.next}while(null!==r);null===o?i=o=t:o=o.next=t}else i=o=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ho(e,t,r,n){var i=e.updateQueue;zo=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var u=s,l=u.next;u.next=null,null===a?o=l:a.next=l,a=u;var c=e.alternate;null!==c&&((s=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===s?c.firstBaseUpdate=l:s.next=l,c.lastBaseUpdate=u))}if(null!==o){var h=i.baseState;for(a=0,c=l=u=null,s=o;;){var d=s.lane,f=s.eventTime;if((n&d)===d){null!==c&&(c=c.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,v=s;switch(d=t,f=r,v.tag){case 1:if("function"==typeof(p=v.payload)){h=p.call(f,h,d);break e}h=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(d="function"==typeof(p=v.payload)?p.call(f,h,d):p))break e;h=B({},h,d);break e;case 2:zo=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(d=i.effects)?i.effects=[s]:d.push(s))}else f={eventTime:f,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(l=c=f,u=h):c=c.next=f,a|=d;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(d=s).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}if(null===c&&(u=h),i.baseState=u,i.firstBaseUpdate=l,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);ju|=a,e.lanes=a,e.memoizedState=h}}function Yo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;tr?r:4,e(!0);var n=sa.transition;sa.transition={};try{e(!1),t()}finally{xt=r,sa.transition=n}}function Xa(){return xa().memoizedState}function qa(e,t,r){var n=rl(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Za(e))Ka(t,r);else if(null!==(r=Lo(e,t,r,n))){nl(r,e,n,tl()),Ja(r,t,n)}}function Qa(e,t,r){var n=rl(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Za(e))Ka(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,r);if(i.hasEagerState=!0,i.eagerState=s,ln(s,a)){var u=t.interleaved;return null===u?(i.next=i,Do(t)):(i.next=u.next,u.next=i),void(t.interleaved=i)}}catch(e){}null!==(r=Lo(e,t,i,n))&&(nl(r,e,n,i=tl()),Ja(r,t,n))}}function Za(e){var t=e.alternate;return e===la||null!==t&&t===la}function Ka(e,t){fa=da=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ja(e,t,r){if(0!=(4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,bt(e,r)}}var es={readContext:Oo,useCallback:ga,useContext:ga,useEffect:ga,useImperativeHandle:ga,useInsertionEffect:ga,useLayoutEffect:ga,useMemo:ga,useReducer:ga,useRef:ga,useState:ga,useDebugValue:ga,useDeferredValue:ga,useTransition:ga,useMutableSource:ga,useSyncExternalStore:ga,useId:ga,unstable_isNewReconciler:!1},ts={readContext:Oo,useCallback:function(e,t){return ba().memoizedState=[e,void 0===t?null:t],e},useContext:Oo,useEffect:ja,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,Da(4194308,4,Ua.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Da(4194308,4,e,t)},useInsertionEffect:function(e,t){return Da(4,2,e,t)},useMemo:function(e,t){var r=ba();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ba();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=qa.bind(null,la,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},ba().memoizedState=e},useState:Na,useDebugValue:Ga,useDeferredValue:function(e){return ba().memoizedState=e},useTransition:function(){var e=Na(!1),t=e[0];return e=$a.bind(null,e[1]),ba().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=la,i=ba();if(ao){if(void 0===r)throw Error(a(407));r=r()}else{if(r=t(),null===Cu)throw Error(a(349));0!=(30&ua)||Ea(n,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,ja(Ia.bind(null,n,o,e),[e]),n.flags|=2048,Oa(9,Aa.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=ba(),t=Cu.identifierPrefix;if(ao){var r=Ji;t=":"+t+"R"+(r=(Ki&~(1<<32-ut(Ki)-1)).toString(32)+r),0<(r=pa++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=va++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rs={readContext:Oo,useCallback:Va,useContext:Oo,useEffect:za,useImperativeHandle:Wa,useInsertionEffect:Ba,useLayoutEffect:Fa,useMemo:Ha,useReducer:Sa,useRef:Ra,useState:function(){return Sa(wa)},useDebugValue:Ga,useDeferredValue:function(e){return Ya(xa(),ca.memoizedState,e)},useTransition:function(){return[Sa(wa)[0],xa().memoizedState]},useMutableSource:Ma,useSyncExternalStore:ka,useId:Xa,unstable_isNewReconciler:!1},ns={readContext:Oo,useCallback:Va,useContext:Oo,useEffect:za,useImperativeHandle:Wa,useInsertionEffect:Ba,useLayoutEffect:Fa,useMemo:Ha,useReducer:Ta,useRef:Ra,useState:function(){return Ta(wa)},useDebugValue:Ga,useDeferredValue:function(e){var t=xa();return null===ca?t.memoizedState=e:Ya(t,ca.memoizedState,e)},useTransition:function(){return[Ta(wa)[0],xa().memoizedState]},useMutableSource:Ma,useSyncExternalStore:ka,useId:Xa,unstable_isNewReconciler:!1};function is(e,t){if(e&&e.defaultProps){for(var r in t=B({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}function os(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:B({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var as={isMounted:function(e){return!!(e=e._reactInternals)&&Ve(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=tl(),i=rl(e),o=Uo(n,i);o.payload=t,null!=r&&(o.callback=r),null!==(t=Wo(e,o,i))&&(nl(t,e,i,n),Go(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=tl(),i=rl(e),o=Uo(n,i);o.tag=1,o.payload=t,null!=r&&(o.callback=r),null!==(t=Wo(e,o,i))&&(nl(t,e,i,n),Go(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=tl(),n=rl(e),i=Uo(r,n);i.tag=2,null!=t&&(i.callback=t),null!==(t=Wo(e,i,n))&&(nl(t,e,n,r),Go(t,e,n))}};function ss(e,t,r,n,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!cn(r,n)||!cn(i,o))}function us(e,t,r){var i=!1,o=Ii,a=t.contextType;return"object"===n(a)&&null!==a?a=Oo(a):(o=Ri(t)?Ni:Ci.current,a=(i=null!=(i=t.contextTypes))?Oi(e,o):Ii),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=as,e.stateNode=t,t._reactInternals=e,i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function ls(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&as.enqueueReplaceState(t,t.state,null)}function cs(e,t,r,i){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},Bo(e);var a=t.contextType;"object"===n(a)&&null!==a?o.context=Oo(a):(a=Ri(t)?Ni:Ci.current,o.context=Oi(e,a)),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(os(e,t,a,r),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&as.enqueueReplaceState(o,o.state,null),Ho(e,r,o,i),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function hs(e,t){try{var r="",n=t;do{r+=G(n),n=n.return}while(n);var i=r}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function ds(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function fs(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var ps="function"==typeof WeakMap?WeakMap:Map;function vs(e,t,r){(r=Uo(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Hu||(Hu=!0,Yu=n),fs(0,t)},r}function gs(e,t,r){(r=Uo(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){fs(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(r.callback=function(){fs(0,t),"function"!=typeof n&&(null===$u?$u=new Set([this]):$u.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function ms(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new ps;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=kl.bind(null,e,t,r),t.then(e,e))}function ys(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function _s(e,t,r,n,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=Uo(-1,1)).tag=2,Wo(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var bs=w.ReactCurrentOwner,xs=!1;function ws(e,t,r,n){t.child=null===e?To(t,null,r,n):So(t,e.child,r,n)}function Ss(e,t,r,n,i){r=r.render;var o=t.ref;return No(t,i),n=ya(e,t,r,n,o,i),r=_a(),null===e||xs?(ao&&r&&ro(t),t.flags|=1,ws(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hs(e,t,i))}function Ts(e,t,r,n,i){if(null===e){var o=r.type;return"function"!=typeof o||Ol(o)||void 0!==o.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Dl(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Ms(e,t,o,n,i))}if(o=e.child,0==(e.lanes&i)){var a=o.memoizedProps;if((r=null!==(r=r.compare)?r:cn)(a,n)&&e.ref===t.ref)return Hs(e,t,i)}return t.flags|=1,(e=Rl(o,n)).ref=t.ref,e.return=t,t.child=e}function Ms(e,t,r,n,i){if(null!==e){var o=e.memoizedProps;if(cn(o,n)&&e.ref===t.ref){if(xs=!1,t.pendingProps=n=o,0==(e.lanes&i))return t.lanes=e.lanes,Hs(e,t,i);0!=(131072&e.flags)&&(xs=!0)}}return As(e,t,r,n,i)}function ks(e,t,r){var n=t.pendingProps,i=n.children,o=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ai(Ru,Ou),Ou|=r;else{if(0==(1073741824&r))return e=null!==o?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ai(Ru,Ou),Ou|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==o?o.baseLanes:r,Ai(Ru,Ou),Ou|=n}else null!==o?(n=o.baseLanes|r,t.memoizedState=null):n=r,Ai(Ru,Ou),Ou|=n;return ws(e,t,i,r),t.child}function Es(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function As(e,t,r,n,i){var o=Ri(r)?Ni:Ci.current;return o=Oi(t,o),No(t,i),r=ya(e,t,r,n,o,i),n=_a(),null===e||xs?(ao&&n&&ro(t),t.flags|=1,ws(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hs(e,t,i))}function Is(e,t,r,i,o){if(Ri(r)){var a=!0;zi(t)}else a=!1;if(No(t,o),null===t.stateNode)Vs(e,t),us(t,r,i),cs(t,r,i,o),i=!0;else if(null===e){var s=t.stateNode,u=t.memoizedProps;s.props=u;var l=s.context,c=r.contextType;"object"===n(c)&&null!==c?c=Oo(c):c=Oi(t,c=Ri(r)?Ni:Ci.current);var h=r.getDerivedStateFromProps,d="function"==typeof h||"function"==typeof s.getSnapshotBeforeUpdate;d||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(u!==i||l!==c)&&ls(t,s,i,c),zo=!1;var f=t.memoizedState;s.state=f,Ho(t,i,s,o),l=t.memoizedState,u!==i||f!==l||Pi.current||zo?("function"==typeof h&&(os(t,r,h,i),l=t.memoizedState),(u=zo||ss(t,r,u,i,f,l,c))?(d||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),s.props=i,s.state=l,s.context=c,i=u):("function"==typeof s.componentDidMount&&(t.flags|=4194308),i=!1)}else{s=t.stateNode,Fo(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:is(t.type,u),s.props=c,d=t.pendingProps,f=s.context,"object"===n(l=r.contextType)&&null!==l?l=Oo(l):l=Oi(t,l=Ri(r)?Ni:Ci.current);var p=r.getDerivedStateFromProps;(h="function"==typeof p||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(u!==d||f!==l)&&ls(t,s,i,l),zo=!1,f=t.memoizedState,s.state=f,Ho(t,i,s,o);var v=t.memoizedState;u!==d||f!==v||Pi.current||zo?("function"==typeof p&&(os(t,r,p,i),v=t.memoizedState),(c=zo||ss(t,r,c,i,f,v,l)||!1)?(h||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(i,v,l),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(i,v,l)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=v),s.props=i,s.state=v,s.context=l,i=c):("function"!=typeof s.componentDidUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||u===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),i=!1)}return Cs(e,t,r,i,a,o)}function Cs(e,t,r,n,i,o){Es(e,t);var a=0!=(128&t.flags);if(!n&&!a)return i&&Bi(t,r,!1),Hs(e,t,o);n=t.stateNode,bs.current=t;var s=a&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&a?(t.child=So(t,e.child,null,o),t.child=So(t,null,s,o)):ws(e,t,s,o),t.memoizedState=n.state,i&&Bi(t,r,!0),t.child}function Ps(e){var t=e.stateNode;t.pendingContext?Li(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Li(0,t.context,!1),Ko(e,t.containerInfo)}function Ns(e,t,r,n,i){return go(),mo(i),t.flags|=256,ws(e,t,r,n),t.child}var Os,Rs,Ds,Ls={dehydrated:null,treeContext:null,retryLane:0};function js(e){return{baseLanes:e,cachePool:null,transitions:null}}function zs(e,t,r){var n,i=t.pendingProps,o=ra.current,s=!1,u=0!=(128&t.flags);if((n=u)||(n=(null===e||null!==e.memoizedState)&&0!=(2&o)),n?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Ai(ra,1&o),null===e)return ho(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(u=i.children,e=i.fallback,s?(i=t.mode,s=t.child,u={mode:"hidden",children:u},0==(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=u):s=jl(u,i,0,null),e=Ll(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=js(r),t.memoizedState=Ls,e):Bs(t,u));if(null!==(o=e.memoizedState)&&null!==(n=o.dehydrated))return function(e,t,r,n,i,o,s){if(r)return 256&t.flags?(t.flags&=-257,Fs(e,t,s,n=ds(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=n.fallback,i=t.mode,n=jl({mode:"visible",children:n.children},i,0,null),(o=Ll(o,i,s,null)).flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,0!=(1&t.mode)&&So(t,e.child,null,s),t.child.memoizedState=js(s),t.memoizedState=Ls,o);if(0==(1&t.mode))return Fs(e,t,s,null);if("$!"===i.data){if(n=i.nextSibling&&i.nextSibling.dataset)var u=n.dgst;return n=u,Fs(e,t,s,n=ds(o=Error(a(419)),n,void 0))}if(u=0!=(s&e.childLanes),xs||u){if(null!==(n=Cu)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!=(i&(n.suspendedLanes|s))?0:i)&&i!==o.retryLane&&(o.retryLane=i,jo(e,i),nl(n,e,i,-1))}return gl(),Fs(e,t,s,n=ds(Error(a(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Al.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,oo=hi(i.nextSibling),io=t,ao=!0,so=null,null!==e&&(qi[Qi++]=Ki,qi[Qi++]=Ji,qi[Qi++]=Zi,Ki=e.id,Ji=e.overflow,Zi=t),(t=Bs(t,n.children)).flags|=4096,t)}(e,t,u,i,n,o,r);if(s){s=i.fallback,u=t.mode,n=(o=e.child).sibling;var l={mode:"hidden",children:i.children};return 0==(1&u)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null):(i=Rl(o,l)).subtreeFlags=14680064&o.subtreeFlags,null!==n?s=Rl(n,s):(s=Ll(s,u,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,u=null===(u=e.child.memoizedState)?js(r):{baseLanes:u.baseLanes|r,cachePool:null,transitions:u.transitions},s.memoizedState=u,s.childLanes=e.childLanes&~r,t.memoizedState=Ls,i}return e=(s=e.child).sibling,i=Rl(s,{mode:"visible",children:i.children}),0==(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Bs(e,t){return(t=jl({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fs(e,t,r,n){return null!==n&&mo(n),So(t,e.child,null,r),(e=Bs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Us(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Po(e.return,t,r)}function Ws(e,t,r,n,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i)}function Gs(e,t,r){var n=t.pendingProps,i=n.revealOrder,o=n.tail;if(ws(e,t,n.children,r),0!=(2&(n=ra.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Us(e,r,t);else if(19===e.tag)Us(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ai(ra,n),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===na(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Ws(t,!1,i,r,o);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===na(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Ws(t,!0,r,null,o);break;case"together":Ws(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vs(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hs(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),ju|=t.lanes,0==(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(r=Rl(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Rl(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Ys(e,t){if(!ao)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function $s(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Xs(e,t,r){var n=t.pendingProps;switch(no(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $s(t),null;case 1:case 17:return Ri(t.type)&&Di(),$s(t),null;case 3:return n=t.stateNode,Jo(),Ei(Pi),Ei(Ci),oa(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(po(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==so&&(sl(so),so=null))),$s(t),null;case 5:ta(t);var i=Zo(Qo.current);if(r=t.type,null!==e&&null!=t.stateNode)Rs(e,t,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(a(166));return $s(t),null}if(e=Zo(Xo.current),po(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[pi]=t,n[vi]=o,e=0!=(1&t.mode),r){case"dialog":Un("cancel",n),Un("close",n);break;case"iframe":case"object":case"embed":Un("load",n);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),"select"===r&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[pi]=t,e[vi]=n,Os(e,t),t.stateNode=e;e:{switch(s=xe(r,n),r){case"dialog":Un("cancel",e),Un("close",e),i=n;break;case"iframe":case"object":case"embed":Un("load",e),i=n;break;case"video":case"audio":for(i=0;iGu&&(t.flags|=128,n=!0,Ys(o,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=na(s))){if(t.flags|=128,n=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Ys(o,!0),null===o.tail&&"hidden"===o.tailMode&&!s.alternate&&!ao)return $s(t),null}else 2*Je()-o.renderingStartTime>Gu&&1073741824!==r&&(t.flags|=128,n=!0,Ys(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(null!==(r=o.last)?r.sibling=s:t.child=s,o.last=s)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Je(),t.sibling=null,r=ra.current,Ai(ra,n?1&r|2:1&r),t):($s(t),null);case 22:case 23:return dl(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&Ou)&&($s(t),6&t.subtreeFlags&&(t.flags|=8192)):$s(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function qs(e,t){switch(no(t),t.tag){case 1:return Ri(t.type)&&Di(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Jo(),Ei(Pi),Ei(Ci),oa(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ta(t),null;case 13:if(Ei(ra),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));go()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ei(ra),null;case 4:return Jo(),null;case 10:return Co(t.type._context),null;case 22:case 23:return dl(),null;default:return null}}Os=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Rs=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Zo(Xo.current);var o,a=null;switch(r){case"input":i=Z(e,i),n=Z(e,n),a=[];break;case"select":i=B({},i,{value:void 0}),n=B({},n,{value:void 0}),a=[];break;case"textarea":i=oe(e,i),n=oe(e,n),a=[];break;default:"function"!=typeof i.onClick&&"function"==typeof n.onClick&&(e.onclick=ti)}for(c in be(r,n),r=null,i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var s=i[c];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(u.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var l=n[c];if(s=null!=i?i[c]:void 0,n.hasOwnProperty(c)&&l!==s&&(null!=l||null!=s))if("style"===c)if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(a||(a=[]),a.push(c,r)),r=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(a=a||[]).push(c,l)):"children"===c?"string"!=typeof l&&"number"!=typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(u.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&Un("scroll",e),a||s===l||(a=[])):(a=a||[]).push(c,l))}r&&(a=a||[]).push("style",r);var c=a;(t.updateQueue=c)&&(t.flags|=4)}},Ds=function(e,t,r,n){r!==n&&(t.flags|=4)};var Qs=!1,Zs=!1,Ks="function"==typeof WeakSet?WeakSet:Set,Js=null;function eu(e,t){var r=e.ref;if(null!==r)if("function"==typeof r)try{r(null)}catch(r){Ml(e,t,r)}else r.current=null}function tu(e,t,r){try{r()}catch(r){Ml(e,t,r)}}var ru=!1;function nu(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&tu(t,r,o)}i=i.next}while(i!==n)}}function iu(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ou(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"==typeof t?t(e):t.current=e}}function au(e){var t=e.alternate;null!==t&&(e.alternate=null,au(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[pi],delete t[vi],delete t[mi],delete t[yi],delete t[_i])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function su(e){return 5===e.tag||3===e.tag||4===e.tag}function uu(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||su(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function lu(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=ti));else if(4!==n&&null!==(e=e.child))for(lu(e,t,r),e=e.sibling;null!==e;)lu(e,t,r),e=e.sibling}function cu(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(cu(e,t,r),e=e.sibling;null!==e;)cu(e,t,r),e=e.sibling}var hu=null,du=!1;function fu(e,t,r){for(r=r.child;null!==r;)pu(e,t,r),r=r.sibling}function pu(e,t,r){if(st&&"function"==typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(at,r)}catch(e){}switch(r.tag){case 5:Zs||eu(r,t);case 6:var n=hu,i=du;hu=null,fu(e,t,r),du=i,null!==(hu=n)&&(du?(e=hu,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):hu.removeChild(r.stateNode));break;case 18:null!==hu&&(du?(e=hu,r=r.stateNode,8===e.nodeType?ci(e.parentNode,r):1===e.nodeType&&ci(e,r),Vt(e)):ci(hu,r.stateNode));break;case 4:n=hu,i=du,hu=r.stateNode.containerInfo,du=!0,fu(e,t,r),hu=n,du=i;break;case 0:case 11:case 14:case 15:if(!Zs&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(0!=(2&o)||0!=(4&o))&&tu(r,t,a),i=i.next}while(i!==n)}fu(e,t,r);break;case 1:if(!Zs&&(eu(r,t),"function"==typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(e){Ml(r,t,e)}fu(e,t,r);break;case 21:fu(e,t,r);break;case 22:1&r.mode?(Zs=(n=Zs)||null!==r.memoizedState,fu(e,t,r),Zs=n):fu(e,t,r);break;default:fu(e,t,r)}}function vu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Ks),t.forEach((function(t){var n=Il.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function gu(e,t){var r=t.deletions;if(null!==r)for(var n=0;ni&&(i=s),n&=~o}if(n=i,10<(n=(120>(n=Je()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Mu(n/1960))-n)){e.timeoutHandle=oi(wl.bind(null,e,Uu,Vu),n);break}wl(e,Uu,Vu);break;default:throw Error(a(329))}}}return il(e,Je()),e.callbackNode===r?ol.bind(null,e):null}function al(e,t){var r=Fu;return e.current.memoizedState.isDehydrated&&(fl(e,t).flags|=256),2!==(e=ml(e,t))&&(t=Uu,Uu=r,null!==t&&sl(t)),e}function sl(e){null===Uu?Uu=e:Uu.push.apply(Uu,e)}function ul(e,t){for(t&=~Bu,t&=~zu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===qu)var n=!1;else{if(e=qu,qu=null,Qu=0,0!=(6&Iu))throw Error(a(331));var i=Iu;for(Iu|=4,Js=e.current;null!==Js;){var o=Js,s=o.child;if(0!=(16&Js.flags)){var u=o.deletions;if(null!==u){for(var l=0;lJe()-Wu?fl(e,0):Bu|=r),il(e,t)}function El(e,t){0===t&&(0==(1&e.mode)?t=1:(t=dt,0==(130023424&(dt<<=1))&&(dt=4194304)));var r=tl();null!==(e=jo(e,t))&&(_t(e,t,r),il(e,r))}function Al(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),El(e,r)}function Il(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(a(314))}null!==n&&n.delete(t),El(e,r)}function Cl(e,t){return qe(e,t)}function Pl(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nl(e,t,r,n){return new Pl(e,t,r,n)}function Ol(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rl(e,t){var r=e.alternate;return null===r?((r=Nl(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Dl(e,t,r,i,o,s){var u=2;if(i=e,"function"==typeof e)Ol(e)&&(u=1);else if("string"==typeof e)u=5;else e:switch(e){case M:return Ll(r.children,o,s,t);case k:u=8,o|=8;break;case E:return(e=Nl(12,r,t,2|o)).elementType=E,e.lanes=s,e;case P:return(e=Nl(13,r,t,o)).elementType=P,e.lanes=s,e;case N:return(e=Nl(19,r,t,o)).elementType=N,e.lanes=s,e;case D:return jl(r,o,s,t);default:if("object"===n(e)&&null!==e)switch(e.$$typeof){case A:u=10;break e;case I:u=9;break e;case C:u=11;break e;case O:u=14;break e;case R:u=16,i=null;break e}throw Error(a(130,null==e?e:n(e),""))}return(t=Nl(u,r,t,o)).elementType=e,t.type=i,t.lanes=s,t}function Ll(e,t,r,n){return(e=Nl(7,e,n,t)).lanes=r,e}function jl(e,t,r,n){return(e=Nl(22,e,n,t)).elementType=D,e.lanes=r,e.stateNode={isHidden:!1},e}function zl(e,t,r){return(e=Nl(6,e,null,t)).lanes=r,e}function Bl(e,t,r){return(t=Nl(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fl(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yt(0),this.expirationTimes=yt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ul(e,t,r,n,i,o,a,s,u){return e=new Fl(e,t,r,s,u),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Nl(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bo(o),e}function Wl(e,t,r){var n=3=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),n}return c(r,null,[{key:"getDerivedStateFromProps",value:function(e,t){var r=e.position,n=t.prevPropsPosition;return!r||n&&r.x===n.x&&r.y===n.y?null:((0,M.default)("Draggable: getDerivedStateFromProps %j",{position:r,prevPropsPosition:n}),{x:r.x,y:r.y,prevPropsPosition:s({},r)})}}]),c(r,[{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:_.default.findDOMNode(this)}},{key:"render",value:function(){var e,t=this.props,r=(t.axis,t.bounds,t.children),i=t.defaultPosition,o=t.defaultClassName,a=t.defaultClassNameDragging,l=t.defaultClassNameDragged,c=t.position,h=t.positionOffset,d=(t.scale,n(t,["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"])),f={},p=null,v=!Boolean(c)||this.state.dragging,g=c||i,y={x:(0,w.canDragX)(this)&&v?this.state.x:g.x,y:(0,w.canDragY)(this)&&v?this.state.y:g.y};this.state.isElementSVG?p=(0,x.createSVGTransform)(y,h):f=(0,x.createCSSTransform)(y,h);var _=(0,b.default)(r.props.className||"",o,(u(e={},a,this.state.dragging),u(e,l,this.state.dragged),e));return m.createElement(T.default,A({},d,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),m.cloneElement(m.Children.only(r),{className:_,style:s(s({},r.props.style),f),transform:p}))}}]),r}(m.Component);t.default=C,I(C,"displayName","Draggable"),I(C,"propTypes",s(s({},T.default.propTypes),{},{axis:y.default.oneOf(["both","x","y","none"]),bounds:y.default.oneOfType([y.default.shape({left:y.default.number,right:y.default.number,top:y.default.number,bottom:y.default.number}),y.default.string,y.default.oneOf([!1])]),defaultClassName:y.default.string,defaultClassNameDragging:y.default.string,defaultClassNameDragged:y.default.string,defaultPosition:y.default.shape({x:y.default.number,y:y.default.number}),positionOffset:y.default.shape({x:y.default.oneOfType([y.default.number,y.default.string]),y:y.default.oneOfType([y.default.number,y.default.string])}),position:y.default.shape({x:y.default.number,y:y.default.number}),className:S.dontSetMe,style:S.dontSetMe,transform:S.dontSetMe})),I(C,"defaultProps",s(s({},T.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))},83888:function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r not mounted on DragStart!");var n=r.ownerDocument;if(!(e.props.disabled||!(t.target instanceof n.defaultView.Node)||e.props.handle&&!(0,g.matchesSelectorAndParentsTo)(t.target,e.props.handle,r)||e.props.cancel&&(0,g.matchesSelectorAndParentsTo)(t.target,e.props.cancel,r))){"touchstart"===t.type&&t.preventDefault();var i=(0,g.getTouchIdentifier)(t);e.touchIdentifier=i;var o=(0,m.getControlPosition)(t,i,c(e));if(null!=o){var a=o.x,s=o.y,u=(0,m.createCoreData)(c(e),a,s);(0,_.default)("DraggableCore: handleDragStart: %j",u),(0,_.default)("calling",e.props.onStart),!1!==e.props.onStart(t,u)&&!1!==e.mounted&&(e.props.enableUserSelectHack&&(0,g.addUserSelectStyles)(n),e.dragging=!0,e.lastX=a,e.lastY=s,(0,g.addEvent)(n,M.move,e.handleDrag),(0,g.addEvent)(n,M.stop,e.handleDragStop))}}})),w(c(e),"handleDrag",(function(t){var r=(0,m.getControlPosition)(t,e.touchIdentifier,c(e));if(null!=r){var i=r.x,o=r.y;if(Array.isArray(e.props.grid)){var a=i-e.lastX,s=o-e.lastY,u=n((0,m.snapToGrid)(e.props.grid,a,s),2);if(a=u[0],s=u[1],!a&&!s)return;i=e.lastX+a,o=e.lastY+s}var l=(0,m.createCoreData)(c(e),i,o);if((0,_.default)("DraggableCore: handleDrag: %j",l),!1!==e.props.onDrag(t,l)&&!1!==e.mounted)e.lastX=i,e.lastY=o;else try{e.handleDragStop(new MouseEvent("mouseup"))}catch(t){var h=document.createEvent("MouseEvents");h.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.handleDragStop(h)}}})),w(c(e),"handleDragStop",(function(t){if(e.dragging){var r=(0,m.getControlPosition)(t,e.touchIdentifier,c(e));if(null!=r){var i=r.x,o=r.y;if(Array.isArray(e.props.grid)){var a=i-e.lastX||0,s=o-e.lastY||0,u=n((0,m.snapToGrid)(e.props.grid,a,s),2);a=u[0],s=u[1],i=e.lastX+a,o=e.lastY+s}var l=(0,m.createCoreData)(c(e),i,o);if(!1===e.props.onStop(t,l)||!1===e.mounted)return!1;var h=e.findDOMNode();h&&e.props.enableUserSelectHack&&(0,g.removeUserSelectStyles)(h.ownerDocument),(0,_.default)("DraggableCore: handleDragStop: %j",l),e.dragging=!1,e.lastX=NaN,e.lastY=NaN,h&&((0,_.default)("DraggableCore: Removing handlers"),(0,g.removeEvent)(h.ownerDocument,M.move,e.handleDrag),(0,g.removeEvent)(h.ownerDocument,M.stop,e.handleDragStop))}}})),w(c(e),"onMouseDown",(function(t){return M=T,e.handleDragStart(t)})),w(c(e),"onMouseUp",(function(t){return M=T,e.handleDragStop(t)})),w(c(e),"onTouchStart",(function(t){return M=S,e.handleDragStart(t)})),w(c(e),"onTouchEnd",(function(t){return M=S,e.handleDragStop(t)})),e}return t=h,(r=[{key:"componentDidMount",value:function(){this.mounted=!0;var e=this.findDOMNode();e&&(0,g.addEvent)(e,S.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.findDOMNode();if(e){var t=e.ownerDocument;(0,g.removeEvent)(t,T.move,this.handleDrag),(0,g.removeEvent)(t,S.move,this.handleDrag),(0,g.removeEvent)(t,T.stop,this.handleDragStop),(0,g.removeEvent)(t,S.stop,this.handleDragStop),(0,g.removeEvent)(e,S.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,g.removeUserSelectStyles)(t)}}},{key:"findDOMNode",value:function(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:v.default.findDOMNode(this)}},{key:"render",value:function(){return f.cloneElement(f.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&a(t.prototype,r),i&&a(t,i),h}(f.Component);t.default=k,w(k,"displayName","DraggableCore"),w(k,"propTypes",{allowAnyClick:p.default.bool,children:p.default.node.isRequired,disabled:p.default.bool,enableUserSelectHack:p.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:p.default.arrayOf(p.default.number),handle:p.default.string,cancel:p.default.string,nodeRef:p.default.object,onStart:p.default.func,onDrag:p.default.func,onStop:p.default.func,onMouseDown:p.default.func,scale:p.default.number,className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),w(k,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},9683:function(e,t,r){var n=r(73378),i=n.default,o=n.DraggableCore;e.exports=i,e.exports.default=i,e.exports.DraggableCore=o},90767:function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";var n=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!n)return"";if(t in n)return"";for(var o=0;o: Unmounted during event!");return t}},74640:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(var r=0,n=e.length;r>>1,i=e[n];if(!(0>>1;na(u,r))la(c,u)?(e[n]=c,e[l]=r,n=l):(e[n]=u,e[s]=r,n=s);else{if(!(la(c,r)))break e;e[n]=c,e[l]=r,n=l}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===("undefined"==typeof performance?"undefined":r(performance))&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var u=Date,l=u.now();t.unstable_now=function(){return u.now()-l}}var c=[],h=[],d=1,f=null,p=3,v=!1,g=!1,m=!1,y="function"==typeof setTimeout?setTimeout:null,_="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function x(e){for(var t=i(h);null!==t;){if(null===t.callback)o(h);else{if(!(t.startTime<=e))break;o(h),t.sortIndex=t.expirationTime,n(c,t)}t=i(h)}}function w(e){if(m=!1,x(e),!g)if(null!==i(c))g=!0,R(S);else{var t=i(h);null!==t&&D(w,t.startTime-e)}}function S(e,r){g=!1,m&&(m=!1,_(E),E=-1),v=!0;var n=p;try{for(x(r),f=i(c);null!==f&&(!(f.expirationTime>r)||e&&!C());){var a=f.callback;if("function"==typeof a){f.callback=null,p=f.priorityLevel;var s=a(f.expirationTime<=r);r=t.unstable_now(),"function"==typeof s?f.callback=s:f===i(c)&&o(c),x(r)}else o(c);f=i(c)}if(null!==f)var u=!0;else{var l=i(h);null!==l&&D(w,l.startTime-r),u=!1}return u}finally{f=null,p=n,v=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var T,M=!1,k=null,E=-1,I=5,A=-1;function C(){return!(t.unstable_now()-Ae||125s?(e.sortIndex=a,n(h,e),null===i(c)&&e===i(h)&&(m?(_(E),E=-1):m=!0,D(w,a-s))):(e.sortIndex=u,n(c,e),g||v||(g=!0,R(S))),e},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(e){var t=p;return function(){var r=p;p=t;try{return e.apply(this,arguments)}finally{p=r}}}},38199:function(e,t,r){e.exports=r(15523)},18808:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t,r,n,i,o,a,s,u;void 0===CanvasRenderingContext2D.prototype.ellipse&&(CanvasRenderingContext2D.prototype.ellipse=function(e,t,r,n,i,o,a,s){this.save(),this.translate(e,t),this.rotate(i),this.scale(r,n),this.arc(0,0,1,o,a,s),this.restore()}),void 0===CanvasRenderingContext2D.prototype.resetTransform&&(CanvasRenderingContext2D.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)}),void 0===CanvasRenderingContext2D.prototype.getTransform&&(CanvasRenderingContext2D.prototype.getTransform=function(){return this._t2stack&&this._t2stack[this._t2stack.length-1]||{a:1,b:0,c:0,d:1,e:0,f:0}},CanvasRenderingContext2D.prototype.save=(t=CanvasRenderingContext2D.prototype.save,function(){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var e=this._t2stack[this._t2stack.length-1];this._t2stack.push(e&&{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}),t.call(this)}),CanvasRenderingContext2D.prototype.restore=(r=CanvasRenderingContext2D.prototype.restore,function(){this._t2stack&&this._t2stack.pop(),r.call(this)}),CanvasRenderingContext2D.prototype.transform=(n=CanvasRenderingContext2D.prototype.transform,function(e,t,r,i,o,a){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var s=this._t2stack[this._t2stack.length-1],u=s.a*e+s.c*t,l=s.b*e+s.d*t,c=s.a*r+s.c*i,h=s.b*r+s.d*i,d=s.e+s.a*o+s.c*a,f=s.f+s.b*o+s.d*a;s.a=u,s.b=l,s.c=c,s.d=h,s.e=d,s.f=f,n.call(this,e,t,r,i,o,a)}),CanvasRenderingContext2D.prototype.setTransform=(i=CanvasRenderingContext2D.prototype.setTransform,function(t,r,n,o,a,s){if(this._t2stack||(this._t2stack=[{}]),"object"===e(t)||void 0===t){var u=t.a,l=t.b,c=t.c,h=t.d,d=t.e,f=t.f;this._t2stack[this._t2stack.length-1]={a:u,b:l,c:c,d:h,e:d,f:f},i.call(this,u,l,c,h,d,f)}else this._t2stack[this._t2stack.length-1]={a:t,b:r,c:n,d:o,e:a,f:s},i.call(this,t,r,n,o,a,s)}),CanvasRenderingContext2D.prototype.resetTransform=(o=CanvasRenderingContext2D.prototype.resetTransform,function(){this._t2stack||(this._t2stack=[{}]),this._t2stack[this._t2stack.length-1]={a:1,b:0,c:0,d:1,e:0,f:0},o&&o.call(this)}),CanvasRenderingContext2D.prototype.scale=(a=CanvasRenderingContext2D.prototype.scale,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var r=this._t2stack[this._t2stack.length-1];e=e||1,t=t||e,r.a*=e,r.c*=t,r.b*=e,r.d*=t,a.call(this,e,t)}),CanvasRenderingContext2D.prototype.rotate=(s=CanvasRenderingContext2D.prototype.rotate,function(e){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var t=this._t2stack[this._t2stack.length-1],r=Math.cos(-e),n=Math.sin(-e),i=t.a*r-t.c*n,o=t.b*r-t.d*n,a=t.c*r+t.a*n,u=t.d*r+t.b*n;return t.a=i,t.b=o,t.c=a,t.d=u,s.call(this,e)}),CanvasRenderingContext2D.prototype.translate=(u=CanvasRenderingContext2D.prototype.translate,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var r=this._t2stack[this._t2stack.length-1];return r.e+=e*r.a+t*r.c,r.f+=e*r.b+t*r.d,u.call(this,e,t)}))},92710:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}({"./src/CombinePlayerImplement.ts":function(e,t,r){r.d(t,"a",(function(){return y}));var n=r("@babel/runtime/regenerator"),i=r.n(n),o=r("@babel/runtime/helpers/asyncToGenerator"),a=r.n(o),s=r("@babel/runtime/helpers/classCallCheck"),u=r.n(s),l=r("@babel/runtime/helpers/createClass"),c=r.n(l),h=function(e,t,r){"string"==typeof r?console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),r):console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),JSON.stringify(r,null,2))},d=r("./src/StatusContant.ts"),f=r("./src/EventEmitter.ts"),p=r("./src/ErrorConstant.ts");function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(this.statusIgnoreCrashByDisabled[0]);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.video;if(t===o.whiteboard&&a===e){n=!0;break}}}catch(e){i.e(e)}finally{i.f()}return!n}},{key:"unlockCombineStatus",value:function(){this.statusLockInfo.isLocked=!1,this.statusLockInfo.allowStatusList=[],this.statusLockInfo.unLockStatusList=[]}},{key:"setPreviousStatus",value:function(e,t){this.whiteboardStatus.previous=e,this.videoStatus.previous=t}},{key:"dispatchEvent",value:function(e){var t=this,r=e.videoStatus,n=e.whiteboardStatus,i=e.combineStatus,o={whiteboard:this.getStatus(d.a.Whiteboard).previous,video:this.getStatus(d.a.Video).previous},a={whiteboard:n,video:r};this.debug("CombinedStatus",i,{previous:{whiteboard:d.b[o.whiteboard],video:d.b[o.video]},current:{whiteboard:d.b[a.whiteboard],video:d.b[a.video]}}),this.events.emit(i,o,a,(function(){t.setPreviousStatus(n,r)}))}},{key:"initTables",value:function(){var e=function(e){return function(t,r){return Object.freeze({combineStatus:e,whiteboardStatus:t,videoStatus:r})}},t=e(d.c.PauseSeeking),r=e(d.c.PlayingSeeking),n=e(d.c.PauseBuffering),i=e(d.c.PlayingBuffering),o=e(d.c.ToPlay),a=e(d.c.ToPause),s=e(d.c.Pause),u=e(d.c.Playing),l=e(d.c.Disabled),c=e(d.c.Ended);return Object.freeze([Object.freeze([t(d.b.PauseSeeking,d.b.PauseSeeking),t(d.b.PauseSeeking,d.b.Pause),l(d.b.PauseSeeking,d.b.PauseBuffering),l(d.b.PauseSeeking,d.b.PlayingBuffering),l(d.b.PauseSeeking,d.b.Playing),l(d.b.PauseSeeking,d.b.PlayingSeeking),t(d.b.PauseSeeking,d.b.Ended)]),Object.freeze([t(d.b.Pause,d.b.PauseSeeking),s(d.b.Pause,d.b.Pause),n(d.b.Pause,d.b.PauseBuffering),i(d.b.Pause,d.b.PlayingBuffering),o(d.b.Pause,d.b.Playing),r(d.b.Pause,d.b.PlayingSeeking),c(d.b.Pause,d.b.Ended)]),Object.freeze([l(d.b.PauseBuffering,d.b.PauseSeeking),n(d.b.PauseBuffering,d.b.Pause),n(d.b.PauseBuffering,d.b.PauseBuffering),l(d.b.PauseBuffering,d.b.PlayingBuffering),l(d.b.PauseBuffering,d.b.Playing),l(d.b.PauseBuffering,d.b.PlayingSeeking),l(d.b.PauseBuffering,d.b.Ended)]),[l(d.b.PlayingBuffering,d.b.PauseSeeking),i(d.b.PlayingBuffering,d.b.Pause),l(d.b.PlayingBuffering,d.b.PauseBuffering),i(d.b.PlayingBuffering,d.b.PlayingBuffering),a(d.b.PlayingBuffering,d.b.Playing),l(d.b.PlayingBuffering,d.b.PlayingSeeking),l(d.b.PlayingBuffering,d.b.Ended)],Object.freeze([l(d.b.Playing,d.b.PauseSeeking),o(d.b.Playing,d.b.Pause),l(d.b.Playing,d.b.PauseBuffering),a(d.b.Playing,d.b.PlayingBuffering),u(d.b.Playing,d.b.Playing),a(d.b.Playing,d.b.PlayingSeeking),a(d.b.Playing,d.b.Ended)]),Object.freeze([l(d.b.PlayingSeeking,d.b.PauseSeeking),r(d.b.PlayingSeeking,d.b.Pause),l(d.b.PlayingSeeking,d.b.PauseBuffering),l(d.b.PlayingSeeking,d.b.PlayingBuffering),a(d.b.PlayingSeeking,d.b.Playing),r(d.b.PlayingSeeking,d.b.PlayingSeeking),r(d.b.PlayingSeeking,d.b.Ended)]),Object.freeze([t(d.b.Ended,d.b.PauseSeeking),c(d.b.Ended,d.b.Pause),l(d.b.Ended,d.b.PauseBuffering),l(d.b.Ended,d.b.PlayingBuffering),a(d.b.Ended,d.b.Playing),r(d.b.Ended,d.b.PlayingSeeking),c(d.b.Ended,d.b.Ended)])])}}]),e}(),m=function(){function e(){u()(this,e),this.queue=[],this.isHanding=!1}var t;return c()(e,[{key:"append",value:function(e){var t=this;return new Promise((function(r,n){var i={handler:e,resolve:r,reject:n};t.queue.push(i),t.isHanding||t.startHandingTasksLoop()}))}},{key:"destroy",value:function(){this.queue=[]}},{key:"startHandingTasksLoop",value:(t=a()(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.isHanding=!0;case 2:if(!(this.queue.length>0)){e.next=20;break}return t=this.queue[0],e.prev=4,e.t0=t,e.next=8,t.handler();case 8:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=15;break;case 12:e.prev=12,e.t2=e.catch(4),t.reject(e.t2);case 15:return e.prev=15,this.queue.shift(),e.finish(15);case 18:e.next=2;break;case 20:e.next=25;break;case 22:throw e.prev=22,e.t3=e.catch(0),new Error(e.t3);case 25:return e.prev=25,this.isHanding=!1,e.finish(25);case 28:case"end":return e.stop()}}),e,this,[[0,22,25,28],[4,12,15,18]])}))),function(){return t.apply(this,arguments)})}]),e}(),y=function(){function e(t){u()(this,e),this.video=void 0,this.whiteboard=void 0,this.videoOptions=void 0,this.stateMachine=void 0,this._playbackRate=1,this.seekTime=NaN,this.triggerSource=d.e.None,this.currentCombineStatus=d.d.PauseBuffering,this.whiteboardEmitter=void 0,this.taskQueue=new m,this.onStatusChangeHandleList=[];var r=t.videoConfig,n=t.whiteboard,i=t.whiteboardEmitter,o=t.debug;this.videoOptions=r.videoOptions,this.video=r.video,this.whiteboard=n,this.whiteboardEmitter=i,this.stateMachine=new g(o),this.initOnCrashByDisabledStatusCallback(),this.initVideo(r.isCanplay),this.initWhiteboard()}var t,r,n,o,s,l,h,f,v,y,_,b,x,w,S,T,M,k;return c()(e,[{key:"setOnStatusChange",value:function(e){this.onStatusChangeHandleList.push(e)}},{key:"removeStatusChange",value:function(e){this.onStatusChangeHandleList=this.onStatusChangeHandleList.filter((function(t){return t!==e}))}},{key:"removeAllStatusChange",value:function(){this.onStatusChangeHandleList=[]}},{key:"getStatus",value:function(){return this.combinedStatus}},{key:"playbackSpeed",value:function(e){this.playbackRate=e}},{key:"stop",value:function(){if(this.currentCombineStatus===d.d.Stopped)throw new Error(p.d);if(this.currentCombineStatus===d.d.Disabled)throw new Error(p.c);this.releaseEvents(),this.onStatusUpdate(d.d.Stopped)}},{key:"play",value:(k=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.taskQueue.append(a()(i.a.mark((function e(){var r,n,o;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.triggerSource=d.e.Plugin,r=t.stateMachine.getCombinationStatus().current,e.t0=r,e.next=e.t0===d.c.Pause?5:e.t0===d.c.PauseBuffering?8:e.t0===d.c.Ended?24:27;break;case 5:return e.next=7,t.playWhenPause();case 7:return e.abrupt("break",27);case 8:if(n=t.stateMachine.getStatus(d.a.Video).current,o=t.stateMachine.getStatus(d.a.Whiteboard).current,n!==d.b.Pause||o!==d.b.PauseBuffering){e.next=15;break}return e.next=13,t.playWhenVideoIsPauseAndWhiteboardIsPauseBuffering();case 13:e.next=23;break;case 15:if(n!==d.b.PauseBuffering||o!==d.b.Pause){e.next=21;break}return t.onStatusUpdate(d.d.PlayingBuffering),e.next=19,t.playWhenPause();case 19:e.next=23;break;case 21:return e.next=23,t.playWhenAllPlayerIsPauseBuffering();case 23:return e.abrupt("break",27);case 24:return e.next=26,t.playWhenEnded();case 26:return e.abrupt("break",27);case 27:if(isNaN(t.seekTime)){e.next=31;break}return e.next=30,t.seekWhenPlaying(t.seekTime);case 30:t.seekTime=NaN;case 31:t.triggerSource=d.e.None;case 32:case"end":return e.stop()}}),e)}))));case 4:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{key:"pause",value:(M=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.triggerSource=d.e.Plugin,t.stateMachine.getCombinationStatus().current!==d.c.Playing){e.next=5;break}return e.next=5,t.pauseWhenPlaying();case 5:t.triggerSource=d.e.None;case 6:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(){return M.apply(this,arguments)})},{key:"seek",value:(T=a()(i.a.mark((function e(t){var r=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){var n,o,a,s,u,l,c,h,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.whiteboard.progressTime,o=r.video.currentTime(),0!==n||0!==o){e.next=5;break}return 0!==t&&(r.seekTime=t),e.abrupt("return");case 5:r.triggerSource=d.e.Plugin,a=r.stateMachine.getCombinationStatus().current,e.t0=a,e.next=e.t0===d.c.Playing?10:e.t0===d.c.Pause||e.t0===d.c.PauseBuffering?13:e.t0===d.c.Ended?23:30;break;case 10:return e.next=12,r.seekWhenPlaying(t);case 12:return e.abrupt("break",30);case 13:if(s=r.getPlayerDuration(),u=s.video,l=s.whiteboard,!(t>u||t>l)){e.next=20;break}return e.next=18,r.seekWhenPauseFinallyIsEnded(t,s);case 18:e.next=22;break;case 20:return e.next=22,r.seekWhenPause(t);case 22:return e.abrupt("break",30);case 23:if(c=r.getPlayerDuration(),h=c.video,f=c.whiteboard,!(t<=h&&t<=f)){e.next=29;break}return e.next=27,r.seekWhenPause(t);case 27:return e.next=29,r.playWhenPause();case 29:return e.abrupt("break",30);case 30:r.triggerSource=d.e.None;case 31:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"initVideo",value:function(e){this.stateMachine.setStatus(d.a.Video,e?d.b.Pause:d.b.PauseBuffering),e||(this.currentCombineStatus=d.d.PauseBuffering),this.initVideoJSEvents()}},{key:"initVideoJSEvents",value:function(){var e=this,t=!1,r=function(t){return a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Video){r.next=4;break}return e.triggerSource=d.e.Video,r.next=4,t();case 4:case"end":return r.stop()}}),r)})))};this.video.on("canplay",(function(){var t=e.stateMachine.getStatus(d.a.Whiteboard).current;e.stateMachine.getStatus(d.a.Video).current===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Video,d.b.Pause),t===d.b.Pause&&e.onStatusUpdate(d.d.Pause))})),this.video.on("seeking",r(a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.taskQueue.append((function(){t=!0}));case 2:case"end":return r.stop()}}),r)}))))),this.video.on("waiting",r(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.onStatusUpdate(d.d.PlayingBuffering),t.next=3,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoWaiting()}));case 3:e.triggerSource=d.e.None;case 4:case"end":return t.stop()}}),t)}))))),this.video.on("playing",r(a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.taskQueue.append(a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t){r.next=2;break}return r.abrupt("return",e.playingWhiteboardWhenVideoPlayingDropFrame());case 2:return r.abrupt("return",e.playingWhiteboardWhenVideoPlaying());case 3:case"end":return r.stop()}}),r)}))));case 2:t=!1,e.triggerSource=d.e.None;case 4:case"end":return r.stop()}}),r)}))))),this.video.on("ended",r(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoEnded()}));case 2:e.triggerSource=d.e.None;case 3:case"end":return t.stop()}}),t)}))))),this.video.on("fullscreenchange",r(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){var t=e.stateMachine.getStatus(d.a.Video).current;t!==d.b.Playing&&t!==d.b.PlayingBuffering||!e.video.isFullscreen()&&e.video.paused()&&(e.whiteboardEmitter.one("pause",(function(){e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),e.stateMachine.setStatus(d.a.Video,d.b.Pause),e.onStatusUpdate(d.d.Pause)})),e.whiteboard.pause()),e.triggerSource=d.e.None}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"initWhiteboard",value:function(){this.initWhiteboardIsPlayable(),this.initWhiteboardEvents(),this.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseBuffering),this.currentCombineStatus=d.d.PauseBuffering,this.whiteboard.seekToProgressTime(0)}},{key:"initWhiteboardIsPlayable",value:function(){var e=this;this.whiteboardEmitter.addListener("playableChange",(function(t){var r=e.stateMachine.getStatus(d.a.Whiteboard).current,n=e.stateMachine.getStatus(d.a.Video).current;t&&r===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),n===d.b.Pause&&e.onStatusUpdate(d.d.Pause))}))}},{key:"initWhiteboardEvents",value:function(){var e=this,t=function(t){return a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Whiteboard){r.next=5;break}return e.triggerSource=d.e.Whiteboard,r.next=4,t();case 4:e.triggerSource=d.e.None;case 5:case"end":return r.stop()}}),r)})))};this.whiteboardEmitter.addListener("buffering",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardBuffering()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("playing",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.playingVideoWhenWhiteboardPlaying()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("ended",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardEnded()}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"playWhenPause",value:(S=a()(i.a.mark((function e(){var t,r,n,o,s=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){s.stateMachine.setStatus(d.a.Video,d.b.Playing)},r=function(){s.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},this.whiteboardEmitter.one("playing",r),n=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),o=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.onStatusUpdate(d.d.Playing);case 1:case"end":return e.stop()}}),e)})))),this.video.one("playing",t),this.video.play(),e.next=10,Promise.all([n,o]);case 10:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"playWhenVideoIsPauseAndWhiteboardIsPauseBuffering",value:(w=a()(i.a.mark((function e(){var t,r,n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Pause,d.c.PauseBuffering,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},r=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},o=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},s=function(){f.whiteboardEmitter.removeListener("playing",o),f.whiteboardEmitter.removeListener("buffering",n),f.video.off("playing",t),f.video.off("pause",r)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.pause();case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),u=this.stateMachine.one(d.c.PauseBuffering,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),l=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),c=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.play();case 1:case"end":return e.stop()}}),e)})))),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.off([d.c.PauseBuffering,d.c.Pause,d.c.ToPlay]),s();case 3:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",n),this.whiteboardEmitter.one("playing",o),this.video.on("playing",t),this.video.one("pause",r),this.video.play(),e.next=18,Promise.all([Promise.race([u,l]),c,h]);case 18:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"playWhenAllPlayerIsPauseBuffering",value:(x=a()(i.a.mark((function e(){var t,r,n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.ToPause,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},s=function(){f.stateMachine.setStatus(d.a.Video,d.b.PlayingBuffering)},u=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PlayingBuffering,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.PlayingBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.Playing}],function(){var e=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(r=t.current).video===d.b.Playing?f.video.pause():r.whiteboard===d.b.Playing&&f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){throw Error(e)}));case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),l=this.stateMachine.one(d.c.ToPause,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.video.pause():f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c=this.stateMachine.one(d.c.ToPlay,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.whiteboard.play():f.video.play();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.cancelOneButNotCrashByDisabled(),f.stateMachine.off([d.c.ToPause,d.c.ToPlay]),f.video.off("playing",o),f.whiteboardEmitter.removeListener("playing",r),f.whiteboardEmitter.removeListener("pause",n);case 6:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",t),this.whiteboardEmitter.addListener("playing",r),this.whiteboardEmitter.one("pause",n),this.video.on("playing",o),this.video.one("play",s),this.video.one("pause",u),this.video.play(),this.whiteboard.play(),e.next=21,Promise.all([Promise.race([l,c]),h]);case 21:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"playWhenEnded",value:(b=a()(i.a.mark((function e(){var t,r,n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingBuffering),t=NaN,this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.whiteboard.pause()},s=function(){f.video.off("pause",u),f.video.off("play",l),f.video.one("play",(function(){f.video.one("pause",(function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)})),f.video.pause()})),f.video.play()},u=function(){f.video.play()},l=function(){f.video.pause()},c=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),t=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(t),f.video.play())}),500)},h=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f.whiteboardEmitter.removeListener("buffering",r),f.whiteboardEmitter.removeListener("playing",o),clearInterval(t),e.next=5,f.playWhenPause();case 5:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",r),this.whiteboardEmitter.one("pause",n),this.whiteboardEmitter.one("playing",o),this.video.one("seeking",c),this.video.one("seeked",s),this.video.on("play",l),this.video.on("pause",u),this.whiteboard.seekToProgressTime(0),this.video.currentTime(0),e.next=22,h;case 22:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"pauseWhenPlaying",value:(_=a()(i.a.mark((function e(){var t,r,n,o=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),t=function(){o.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},r=function(){o.stateMachine.setStatus(d.a.Video,d.b.Pause)},n=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.onStatusUpdate(d.d.Pause);case 1:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("pause",t),this.video.one("pause",r),this.whiteboard.pause(),this.video.pause(),e.next=10,n;case 10:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"seekWhenPlaying",value:(y=a()(i.a.mark((function e(t){var r,n,o,s,u,l,c,h,f,p,v,g=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingSeeking),r=NaN,n=this.getPlayerDuration(),this.stateMachine.lockCombineStatus([d.c.Pause,d.c.Ended,d.c.PlayingSeeking],[d.c.Pause,d.c.Ended]),o=function(){g.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingSeeking)},s=function(){t=d.f.HAVE_CURRENT_DATA&&(clearInterval(r),t=d.f.HAVE_CURRENT_DATA&&(clearInterval(r),h.stateMachine.setStatus(d.a.Video,d.b.Pause))}),500)},o=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},s=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},u=function(){h.whiteboard.pause()},l=function(){clearInterval(r),h.video.off("seeking",n),h.whiteboardEmitter.removeListener("buffering",o),h.whiteboardEmitter.removeListener("pause",s)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PauseSeeking,whiteboard:d.b.PauseSeeking}]).catch((function(e){throw Error(e)})),c=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.onStatusUpdate(d.d.Pause),h.stateMachine.cancelOneButNotCrashByDisabled(),h.stateMachine.off(d.c.Ended),h.whiteboardEmitter.removeListener("playing",u),l();case 5:case"end":return e.stop()}}),e)})))),this.video.one("seeking",n),this.whiteboardEmitter.one("buffering",o),this.whiteboardEmitter.one("playing",u),this.whiteboardEmitter.one("pause",s),this.whiteboard.seekToProgressTime(t),this.video.currentTime(t/1e3),e.next=18,c;case 18:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"seekWhenPauseFinallyIsEnded",value:(f=a()(i.a.mark((function e(t,r){var n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PauseSeeking),n=NaN,this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Ended],[d.c.Ended]),o=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),n=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(n),f.stateMachine.setStatus(d.a.Video,d.b.Pause),t>=r.video&&f.stateMachine.setStatus(d.a.Video,d.b.Ended))}),500)},s=function(){t1?t-1:0),n=1;n2&&void 0!==arguments[2]&&arguments[2];a()(this,e),this.videoOptions=void 0,this.whiteboard=void 0,this.debug=void 0,Object(l.a)(r);var i=e.videoDefaultOptions(r);this.videoOptions=y(y(y({},i),r),{},{videoJsOptions:y(y({},i.videoJsOptions),r.videoJsOptions)}),this.whiteboard=t,this.debug=n}return u()(e,[{key:"create",value:function(){var e=new c.a;this.handleWhiteboardCallback(e);var t=this.getVideoDOM(),r=f()(t,this.videoOptions.videoJsOptions);return r.src(this.videoOptions.url),new h.a({videoConfig:{videoOptions:this.videoOptions,video:r,isCanplay:r.readyState()>p.f.HAVE_CURRENT_DATA},whiteboard:this.whiteboard,whiteboardEmitter:e,debug:this.debug})}},{key:"getVideoDOM",value:function(){return void 0!==this.videoOptions.videoElementID?document.getElementById(this.videoOptions.videoElementID):this.videoOptions.videoDOM}},{key:"handleWhiteboardCallback",value:function(e){this.whiteboard.callbacks.on("onPhaseChanged",(function(t){e.emit(t)})),this.whiteboard.callbacks.on("onIsPlayableChanged",(function(t){e.emit("playableChange",t)}))}}],[{key:"videoDefaultOptions",value:function(e){var t={videoJsOptions:{preload:"auto"}};return e.videoDOM||e.videoElementID||(t.videoDOM=document.createElement("video")),t}}]),e}()},0:function(e,t,r){e.exports=r("./src/index.ts")},"@babel/runtime/helpers/asyncToGenerator":function(e,t){e.exports=r(34397)},"@babel/runtime/helpers/classCallCheck":function(e,t){e.exports=r(57750)},"@babel/runtime/helpers/createClass":function(e,t){e.exports=r(67338)},"@babel/runtime/helpers/defineProperty":function(e,t){e.exports=r(91566)},"@babel/runtime/regenerator":function(e,t){e.exports=r(64910)},"video.js":function(e,t){e.exports=r(30825)}})},20597:function(e,t,r){var n,i,o,a;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}e=r.nmd(e),window,a=function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==s(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="},function(e,t,r){r.r(t),r.d(t,"CursorTool",(function(){return y}));var n,i=r(0),o=r(1),a=r(2),s=r.n(a),u=r(3),l=r.n(u),c=r(4),h=r.n(c),d=r(5),f=r.n(d),p=r(6),v=r.n(p),g=(r(8),n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),m=function(e){function t(t){var r=e.call(this,t)||this;return r.renderAvatar=function(e){var t,n="rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")";if(r.detectAvatar(e)){var o=r.detectCursorName(e);return i.createElement("img",{className:"cursor-selector-avatar",style:{width:o?19:28,height:o?19:28,position:o?"initial":"absolute",borderColor:o?"white":n,marginRight:o?4:0},src:null===(t=e.payload)||void 0===t?void 0:t.avatar,alt:"avatar"})}return null},r.getOpacity=function(e){var t=r.getCursorName(e),n=r.detectAvatar(e);return void 0===t&&void 0===n?0:1},r.getCursorName=function(e){return e.payload&&e.payload.cursorName?e.payload.cursorName:void 0},r.getThemeClass=function(e){return e.payload&&e.payload.theme?"cursor-inner-mellow":"cursor-inner"},r.getCursorBackgroundColor=function(e){var t=r.detectCursorName(e);return e.payload&&e.payload.cursorBackgroundColor?e.payload.cursorBackgroundColor:t?"rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")":void 0},r.getCursorTextColor=function(e){return e.payload&&e.payload.cursorTextColor?e.payload.cursorTextColor:"#FFFFFF"},r.getCursorTagBackgroundColor=function(e){return e.payload&&e.payload.cursorTagBackgroundColor?e.payload.cursorTagBackgroundColor:r.getCursorBackgroundColor(e)},r.detectCursorName=function(e){return!(!e.payload||!e.payload.cursorName)},r.detectAvatar=function(e){return!(!e.payload||!e.payload.avatar)},r.renderTag=function(e){return e.payload&&e.payload.cursorTagName?i.createElement("span",{className:"cursor-tag-name",style:{backgroundColor:r.getCursorTagBackgroundColor(e)}},e.payload.cursorTagName):void 0},r}return g(t,e),t.prototype.render=function(){var e=this.props.roomMember,t=this.getCursorName(e);switch(e.memberState.currentApplianceName){case o.ApplianceNames.pencil:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:s.a,alt:"pencilCursor"}))));case o.ApplianceNames.selector:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-selector-offset"},i.createElement("div",null,i.createElement("img",{className:"cursor-selector-image",src:l.a,alt:"selectorCursor"})),i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e)))));case o.ApplianceNames.eraser:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:h.a,alt:"selectorCursor"}))));case o.ApplianceNames.text:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-text-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:v.a,alt:"selectorCursor"}))));default:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-shape-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:f.a,alt:"shapeCursor"}))))}},t}(i.Component),y=function(){function e(){this.cursors={},this.roomMembers=[],this.isFirstFrameReady=!1,this.isCursorDisappear=function(e){return!(!e.payload||!e.payload.disappearCursor)}}return e.prototype.createCursor=function(){return{x:64,y:64,width:128,height:128}},e.prototype.onAddedCursor=function(e){for(var t=0,r=this.roomMembers;t0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]this.totalPage)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.NextPage,{})}},t.prototype.handlePrevPage=function(){if(this.canOperation){var e=this.currentPage-1;if(e<0)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.PrevPage,{})}},t.prototype.handlePageTo=function(e){if(this.canOperation){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;var r=t-1;this.displayer.setSceneIndex(r),this.dispatchMagixEvent(h.PageTo,r)}},t.prototype.handleRemoveAllMagixEvent=function(){var e=this;this.magixEventMap.forEach((function(t,r){e.displayer.removeMagixEventListener(r,t)})),this.magixEventMap.clear()},t.prototype.handleGetAttributes=function(){this.postMessage({kind:h.GetAttributes,payload:this.attributes})},t.prototype.postMessage=function(e){var t;this.iframe&&(null===(t=this.iframe.contentWindow)||void 0===t||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))},t.prototype.dispatchMagixEvent=function(t,r){this.canOperation&&(e.prototype.setAttributes.call(this,{lastEvent:{name:t,payload:r}}),this.displayer.dispatchMagixEvent(t,r))},Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this.displayer.state.sceneState.index},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPage",{get:function(){return this.currentIndex+1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalPage",{get:function(){return this.displayer.state.sceneState.scenes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return!this.displayer.isWritable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReplay",{get:function(){return(0,o.isPlayer)(this.displayer)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisplaySceneDir",{get:function(){return this.displayer.state.sceneState.scenePath.startsWith(this.attributes.displaySceneDir)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canOperation",{get:function(){return!this.isReplay&&(!this.readonly&&this.displayer.phase===o.RoomPhase.Connected)},enumerable:!1,configurable:!0}),t.prototype.isClicker=function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)},Object.defineProperty(t.prototype,"isDisableInput",{get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iframeOrigin",{get:function(){return this.iframe?new URL(this.iframe.src).origin:void 0},enumerable:!1,configurable:!0}),t.prototype._destory=function(){var e=this;window.removeEventListener("message",this.messageListener),this.magixEventMap.forEach((function(t,r){e.displayer.removeMagixEventListener(r,t)})),this.displayer.callbacks.off(this.callbackName,this.stateChangeListener),this.displayer.callbacks.off("onPhaseChanged",this.onPhaseChangedListener),this.magixEventMap.clear(),this.iframe&&(t.emitter.emit(h.Destory),this.iframe=null,t.alreadyCreate=!1),this.bridgeDisposer(),t.emitter.removeAllListeners()},t.kind="IframeBridge",t.emitter=new a.EventEmitter2,t.alreadyCreate=!1,t}(o.InvisiblePlugin);t.IframeBridge=m},24182:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.times=void 0;t.times=function(e,t){return new Array(e).fill(0).map((function(e,r){return t(r)}))}},82372:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.EffectPlugin=void 0;var n,i=r(26913),o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=function(e){function t(r,n,i){var o,a,s,u,l,c,h,d=e.call(this)||this;return d._volume=50,d._currentTime=0,d._isPaused=!0,d._duration=0,d.timer=null,d._startPos=0,d.onDurationBack=function(e,t){d.url===e&&(d._duration=t/1e3),d.emit("load")},d.onEffectStop=function(e){e===d.soundIndex&&(window.clearInterval(d.timer),d._isPaused=!0,d._duration=0,d._currentTime=0,d.emit("pause"))},d.onEffectPause=function(e){e===d.soundIndex&&(d._isPaused=!0,d.emit("pause"))},d.onEffectFinished=function(e){d.onEffectPause(e),d._currentTime=d._duration},d.onEffectPlay=function(e){e===d.soundIndex&&(d.timer&&clearInterval(d.timer),d.timer=window.setInterval((function(){var e;null===(e=t.audioEffector)||void 0===e||e.getEffectCurrentPosition(d.soundIndex).then((function(e){var r;d._currentTime=e,null===(r=t.ctx)||void 0===r||r.logger.info("rtc callback position, "+e+", endPos: "+d._endPos)})).catch((function(){}))}),300),d._isPaused=!1,d.emit("play"))},null===(o=t.ctx)||void 0===o||o.logger.info("url: "+r+", start: "+n+", end: "+i),d.url=r,n&&(d._startPos=n),i&&(d._endPos=i),d.soundIndex=t.nextSoundIndex(),window.addEventListener("message",(function(e){e.data&&"resumeAllAudioInterruptByAudioSessionChanged"===e.data.name&&d.emit("resumeAllAudioInterruptByAudioSessionChanged")})),null===(a=t.audioEffector)||void 0===a||a.on("play",d.onEffectPlay),null===(s=t.audioEffector)||void 0===s||s.on("pause",d.onEffectPause),null===(u=t.audioEffector)||void 0===u||u.on("effectFinished",d.onEffectPause),null===(l=t.audioEffector)||void 0===l||l.on("error",d.onEffectStop),null===(c=t.audioEffector)||void 0===c||c.on("duration",d.onDurationBack),null===(h=t.audioEffector)||void 0===h||h.getEffectDuration(d.url),d.onEffectPause(d.soundIndex),d}return o(t,e),t.nextSoundIndex=function(){return t.soundIndex+=1,t.soundIndex},t.prototype.play=function(){var e,r,n;clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info("effect play call, "+this.url),null===(r=t.ctx)||void 0===r||r.logger.info("play "+this.url+" from "+this._startPos+" by slide, current is "+this.currentTime),null===(n=t.audioEffector)||void 0===n||n.playEffect(this.soundIndex,this.url,0,1,0,this._volume,!1,Math.max(this._currentTime,this._startPos))},t.prototype.pause=function(){var e,r;null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" pause by slide"),null===(r=t.audioEffector)||void 0===r||r.pauseEffect(this.soundIndex)},t.prototype.destroy=function(){var e,r,n,i,o,a,s,u;this._startPos=0,window.clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" destroy by slide"),null===(r=t.audioEffector)||void 0===r||r.stopEffect(this.soundIndex),null===(n=t.audioEffector)||void 0===n||n.unloadEffect(this.soundIndex),null===(i=t.audioEffector)||void 0===i||i.removeListener("play",this.onEffectPlay),null===(o=t.audioEffector)||void 0===o||o.removeListener("pause",this.onEffectPause),null===(a=t.audioEffector)||void 0===a||a.removeListener("effectFinished",this.onEffectFinished),null===(s=t.audioEffector)||void 0===s||s.removeListener("error",this.onEffectStop),null===(u=t.audioEffector)||void 0===u||u.removeListener("duration",this.onDurationBack)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._currentTime/1e3},set:function(e){var r;this._currentTime=1e3*e,null===(r=t.audioEffector)||void 0===r||r.setEffectPosition(this.soundIndex,1e3*e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this._isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),t.prototype.volume=function(e){var r;null===(r=t.audioEffector)||void 0===r||r.setEffectsVolume(100*e)},t.audioEffector=null,t.ctx=null,t.soundIndex=0,t}(i.EventEmitter),s=function(){function e(e){this.hookPoint="Slide.initConfig",this.rtc=e}return e.prototype.after=function(e){return e},e.prototype.before=function(e){var t=e[0];return a.audioEffector=this.rtc,t.rtcAudio=a,[t]},e.prototype.context=function(e){a.ctx=e},e}();t.EffectPlugin=s},29181:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MixingPlugin=void 0;var n,i=r(26913),o=r(5495),a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});var s=function(e){function t(r){var n=e.call(this)||this;return n.isStartPlaying=!1,n.isAudioPlaying=!1,n._volume=50,n.commandCaches=[],n.onError=function(e){var r;null===(r=t.ctx)||void 0===r||r.logger.error("audio error: "+e)},n.onAudioStalled=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.warn(n.url+" Failed to fetch data, but trying.")},n.onMetaLoaded=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.info(n.url+" load"),n.emit("load")},n.onAudioPlay=function(){var e,r,i,o;null===(e=t.ctx)||void 0===e||e.logger.info(n.url+" audio play"),null===(r=t.audioMixer)||void 0===r||r.startAudioMixing(n.url,!1,!1,1,(i=function(e,r){var i,o,a;n.isAudioPlaying=!0,n.isStartPlaying=!1,n.emit("play");var s=n.audio.seek();null===(i=t.audioMixer)||void 0===i||i.setAudioMixingPosition(Math.round(1e3*s)),(null===(o=t.audioMixer)||void 0===o?void 0:o.adjustAudioMixingVolume)&&(null===(a=t.audioMixer)||void 0===a||a.adjustAudioMixingVolume(n._volume)),n.commandCaches.forEach((function(e){return e()})),n.commandCaches=[]},o=0,function(){for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:R.kind;return e=function(e){s(r,e);var t=l(r);function r(){return _(this,r),t.apply(this,arguments)}return r}(R),e.kind=t,e},t.SyncedStorePlugin=t.SyncedStore=t.Storage=t.STORAGE_NS=t.MAIN_STORAGE=void 0;var n=r(71895),i=r(73549),o=r(63266),a=r(5094);function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d(e);if(t){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function c(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){p(o,n,i,a,s,"next",e)}function s(e){p(o,n,i,a,s,"throw",e)}a(void 0)}))}}function g(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:(0,i.genUID)();return w(t={},E,1),w(t,"k",r),w(t,"v",e),t}(e,this.genKey()),this.refMap.set(e,t)),this.refKeys.add(t.k),t}},{key:"deleteRefKey",value:function(e){var t=this.state[e],r=this.refMap.get(t);return r&&this.refKeys.delete(r.k),t}}]),e}(),A="_WM-StOrAgE_";t.STORAGE_NS=A;var C="_WM-MaIn-StOrAgE_";t.MAIN_STORAGE=C;var P=function(){function e(t){var r=this,a=t.plugin$,s=t.isWritable$,u=t.namespace,l=void 0===u?C:u,c=t.defaultState,h=void 0===c?{}:c;if(_(this,e),this._sideEffect=new i.SideEffectManager,this._events=new o.Remitter,this._disconnected=!1,h&&!T(h))throw new Error("Default state for Storage ".concat(l," is not an object."));this.on=this._events.on.bind(this._events),this.off=this._events.off.bind(this._events);var d=function(){var e,t;return null==(t=null==(e=a.value)?void 0:e.attributes[A])?void 0:t[l]};this.namespace=l,this.defaultState=h,this._plugin$=a,this._isWritable$=s,this._refine=new I((0,n.toJS)(d()),h);var f=function(e){e&&r._events.emit("stateChanged",e)},p=function(){var e,t=(0,n.reaction)(d,(function(){var t=d();t&&(f(r._refine.replaceState((0,n.toJS)(t))),null==e||e(),e=function(e){var t=function(e){if(!(e.length<=0)){for(var t={},i=!1,o=0;o0&&r._sideEffect.addDisposer(t,"plugin-init")})))}return x(e,[{key:"setState",value:function(e){var t=this._requireAccess("setState");if(!this.isWritable)throw new Error('Cannot setState on Storage "'.concat(this.namespace,'" without writable access'));for(var r=k(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?function(){return e.forEach(h)}:e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach(h),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}}]),e}();t.SideEffectManager=d;var f=function(){function e(){i(this,e),this.finished=Promise.resolve(),this.disposers=new Map,this._nextTask=new Map,this._isRunning=new Set}var t,r;return a(e,[{key:"add",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this._isRunning.has(r)?this._nextTask.set(r,(function(){return t._add(e,r)})):this._add(e,r),r}},{key:"_add",value:(r=n(regeneratorRuntime.mark((function e(t,r){var i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._startTask(r),!(i=this.remove(r))){e.next=11;break}return e.prev=3,e.next=6,i();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:return e.prev=11,e.next=14,t();case 14:(o=e.sent)&&this.disposers.set(r,Array.isArray(o)?n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(o.map(h)));case 1:case"end":return e.stop()}}),e)}))):o),e.next=21;break;case 18:e.prev=18,e.t1=e.catch(11),console.error(e.t1);case 21:this._endTask(r),(a=this._nextTask.get(r))&&(this._nextTask.delete(r),a());case 24:case"end":return e.stop()}}),e,this,[[3,8],[11,18]])}))),function(e,t){return r.apply(this,arguments)})},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.add((function(){return e}),t)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this;this._isRunning.has(e)?this._nextTask.set(e,(function(){return t._flush(e)})):this._flush(e)}},{key:"_flush",value:(t=n(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.remove(t))){e.next=12;break}return this._startTask(t),e.prev=3,e.next=6,r();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:this._endTask(t);case 12:(n=this._nextTask.get(t))&&(this._nextTask.delete(t),n());case 14:case"end":return e.stop()}}),e,this,[[3,8]])}))),function(e){return t.apply(this,arguments)})},{key:"flushAll",value:function(){var e=this;this.disposers.forEach((function(t,r){return e.flush(r)}))}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}},{key:"_startTask",value:function(e){var t=this;this._isRunning.add(e),this._resolveFinished||(this.finished=new Promise((function(e){t._resolveFinished=e})))}},{key:"_endTask",value:function(e){this._isRunning.delete(e),this._resolveFinished&&this._isRunning.size<=0&&this._nextTask.size<=0&&(this._resolveFinished(),this._resolveFinished=void 0)}}]),e}();t.AsyncSideEffectManager=f},59849:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.videoJsPlugin=t.Version=t.PluginId=void 0;var n,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==w(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r(17328)),o=(n=r(30825))&&n.__esModule?n:{default:n},a=r(71895);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){u(o,n,i,a,s,"next",e)}function s(e){u(o,n,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r=t||r<0||h&&e-l>=o}function g(){var e=re();if(v(e))return m(e);s=setTimeout(g,function(e){var r=t-(e-u);return h?ie(r,o-(e-l)):r}(e))}function m(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=re(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(g,t),f(u)}return void 0===s&&(s=setTimeout(g,t)),a}return t=te(t)||0,Q(r)&&(c=!!r.leading,o=(h="maxWait"in r)?ne(te(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:m(re())},y};function ae(e){var t=document.createElement("style"),r=document.createTextNode(e);t.appendChild(r),document.head.appendChild(t)}ae(".vjs-p .player-controller{position:absolute;z-index:100;bottom:0px;left:0;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;height:64px;background-image:linear-gradient(0deg,#000,transparent);transition:opacity .2s}.vjs-p .player-menu-box{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-bottom:40px}.vjs-p .player-menu-cell{width:100%;text-align:center;font-size:12px;color:#7a7b7c}.vjs-p .player-multiple-play{width:64px;height:120px}.vjs-p .player-controller-actions-left{display:flex;justify-content:center;align-items:center;flex-shrink:0}.vjs-p .player-right-box{font-size:14px;color:#7a7b7c;cursor:pointer;margin-right:12px}.vjs-p .player-controller-actions{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-left:8px;padding-right:8px;margin-top:2px}.vjs-p .player-mid-box-time{font-size:9px;display:flex;justify-content:center;align-items:center;color:#fff;flex-shrink:0;margin-right:8px;font-family:monospace}.vjs-p .player-controller-play{display:flex;align-items:center;justify-content:center;cursor:pointer;padding-right:4px}.vjs-p .player-controller-progress{width:calc(100% - 28px);margin-left:14px;display:flex;align-items:center;justify-content:center;margin-top:8px}.vjs-p .player-volume{display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:16px;margin-left:16px}.vjs-p .player-volume-slider{width:60px;margin-right:12px;display:flex;align-items:center}.vjs-p .player-volume-box{display:flex;flex-direction:row}\n");ae(".vjs-p .seek-slider{position:relative;width:100%}.vjs-p .seek-slider:focus{outline:none}.vjs-p .seek-slider .track{padding:10px 0;cursor:pointer;outline:none}.vjs-p .seek-slider .track:focus{border:0;outline:none}.vjs-p .seek-slider .track .main{width:100%;height:3px;background-color:#ffffff4d;border-radius:30px;position:absolute;left:0;top:8.5px;transition:transform .4s;outline:none}.vjs-p .seek-slider .track .main:focus{border:0;outline:none}.vjs-p .seek-slider .track .main .buffered{position:absolute;background-color:#ffffff4d;width:100%;height:100%;transform:scaleX(.8);z-index:2;transform-origin:0 0}.vjs-p .seek-slider .track .main .seek-hover{position:absolute;background-color:#ffffff80;width:100%;height:100%;z-index:1;transform:scaleX(.6);transform-origin:0 0;opacity:0;transition:opacity .4s}.vjs-p .seek-slider .track .main .connect{position:absolute;background-color:#fff;width:100%;height:100%;z-index:3;left:0;transform:scaleX(.13);transform-origin:0 0}.vjs-p .seek-slider .track.active .main{transform:scaleY(2)}.vjs-p .seek-slider .thumb{pointer-events:none;position:absolute;width:12px;height:12px;left:-6px;top:4px;z-index:4;transform:translate(100px)}.vjs-p .seek-slider .thumb .handler{border-radius:100%;width:100%;height:100%;background-color:#fff;opacity:0;transform:scale(.4);cursor:pointer;transition:transform .2s;pointer-events:none}.vjs-p .seek-slider .thumb.active .handler{opacity:1;transform:scale(1)}.vjs-p .seek-slider .hover-time{position:absolute;background-color:#0000004d;line-height:18px;font-size:16px;color:#ddd;top:-25px;left:0;padding:5px 10px;border-radius:5px;box-shadow:0 0 5px #0000004d;opacity:0;transform:translate(150px);pointer-events:none}.vjs-p .seek-slider .hover-time.active{opacity:1}.vjs-p .seek-slider:hover .track .main .seek-hover{opacity:1}\n");var se=function(e){f(r,e);var t=v(r);function r(e){var n;return c(this,r),n=t.call(this,e),T(m(n),"seeking",!1),T(m(n),"mobileSeeking",!1),T(m(n),"track",null),T(m(n),"hoverTime",null),T(m(n),"offset",0),T(m(n),"secondsPrefix","00:00:"),T(m(n),"minutesPrefix","00:"),T(m(n),"seekPause",!1),T(m(n),"handleTouchSeeking",(function(e){for(var t=0,r=0;rthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),r=e%3600,n=Math.floor(r/60),i=Math.ceil(r%60);return{hh:t.toString(),mm:n<10?"0"+n:n.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),r=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+r.ss:this.props.total+this.offset<3600?this.minutesPrefix+r.mm+":"+r.ss:r.hh+":"+r.mm+":"+r.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:i.default.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return i.default.createElement("div",{className:"seek-slider"},i.default.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},i.default.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),r}(i.Component),ue=function(e){f(r,e);var t=v(r);function r(e){var n;return c(this,r),n=t.call(this,e),T(m(n),"stageVolume",0),T(m(n),"updateVolumeTimer",0),T(m(n),"onVolumeSeeking",!1),T(m(n),"onClickOperationButton",(function(){n.props.paused?n.props.play():n.props.pause()})),T(m(n),"operationButton",(function(){return n.props.paused?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxwYXRoIGQ9Im03LjUxNCA1LjkwOSA3LjA1NyA0LjIzNGExIDEgMCAwIDEgMCAxLjcxNGwtNy4wNTcgNC4yMzRBMSAxIDAgMCAxIDYgMTUuMjM0VjYuNzY2YTEgMSAwIDAgMSAxLjUxNC0uODU3eiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxyZWN0IHg9IjciIHk9IjYiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIvPjxyZWN0IHg9IjEzIiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSIxMCIgcng9IjEiLz48L2c+PC9zdmc+"})})),T(m(n),"operationVolumeButton",(function(){return n.props.volume>.9?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGQ9Ik0xNC45MDYgNy40MTJhLjU3Ni41NzYgMCAwIDAgMCAuODk4IDQuMDcyIDQuMDcyIDAgMCAxIDAgNi40MTIuNTc2LjU3NiAwIDAgMCAwIC44OTYuODAzLjgwMyAwIDAgMCAxLjA3NiAwIDUuMjIzIDUuMjIzIDAgMCAwLS4wMDMtOC4yMDhoLjAwM2EuODA0LjgwNCAwIDAgMC0xLjA3Ni4wMDJ6Ii8+PHBhdGggZmlsbC1vcGFjaXR5PSIuMDEiIGQ9Ik0wIDBoMjJ2MjJIMHoiLz48L2c+PC9zdmc+"}):0===n.props.volume?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXoiLz48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGZpbGwtb3BhY2l0eT0iLjAxIiBkPSJNMCAwaDIydjIySDB6Ii8+PC9nPjwvc3ZnPg=="})})),T(m(n),"handleClickVolume",(function(){0===n.props.volume?0!==n.stageVolume?n.props.setVolume(n.stageVolume):n.props.setVolume(1):(n.stageVolume=n.props.volume,n.props.setVolume(0))})),T(m(n),"onChange",(function(e){n.setState({currentTime:e}),e&&n.changeTime(e)})),T(m(n),"changeTime",oe((function(e){n.props.setCurrentTime(e)}),50)),T(m(n),"onVolumeChange",(function(e){n.changeVolume(e),n.setState({seekVolume:e/100})})),T(m(n),"changeVolume",oe((function(e){n.props.setVolume(e/100)}),50)),T(m(n),"onVolumeSeekStart",(function(){n.onVolumeSeeking=!0})),T(m(n),"onVolumeSeekEnd",oe((function(){n.onVolumeSeeking=!1}),500)),T(m(n),"onProgressSeekStart",(function(){return n.setState({isPlayerSeeking:!0})})),T(m(n),"onProgressSeekEnd",oe((function(){n.setState({isPlayerSeeking:!1})}),500)),n.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},n.stageVolume=e.volume,n}return d(r,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,r=t.duration,n=t.currentTime;return i.default.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},i.default.createElement("div",{className:"player-controller-progress"},i.default.createElement(se,{total:r,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),i.default.createElement("div",{className:"player-controller-actions"},i.default.createElement("div",{className:"player-controller-actions-left"},i.default.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),i.default.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},i.default.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),i.default.createElement("div",{className:"player-volume-slider"},i.default.createElement(se,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),i.default.createElement("div",{className:"player-mid-box-time"},le(Math.floor(n/1e3))," /"," ",le(Math.floor(r/1e3)))))}}]),r}(i.Component);function le(e){var t=e%60,r=(e-t)/60;if(r>=60){var n=r%60;return"".concat(ce((r-n)/60),":").concat(ce(n),":").concat(ce(t))}return"".concat(ce(r),":").concat(ce(t))}function ce(e){return e<=9?"0".concat(e):"".concat(e)}function he(e){var t=e.scale,r=void 0===t?1:t,n=e.size,o=e.children;return i.default.createElement("div",{style:{width:n.width/r,height:n.height/r,transform:"scale(".concat(r,")"),transformOrigin:"top left",display:"flex",overflow:"hidden"}},o)}ae('.vjs-p{display:flex;flex-grow:1;position:relative}.vjs-p *{pointer-events:auto}.vjs-p.disabled *{pointer-events:none}.vjs-p .videojs-plugin-close-icon,.vjs-p .player-controller,.vjs-p .videojs-plugin-muted-alert{pointer-events:auto}.vjs-p.disabled .videojs-plugin-close-icon,.vjs-p.disabled .player-controller{pointer-events:none}.vjs-p .video-js-plugin-header{position:absolute;z-index:100;top:-.5px;height:30px;width:100%;display:flex;background:linear-gradient(rgba(0,0,0,.85),rgba(0,0,0,.45) 40%,rgba(0,0,0,0));transition:opacity .2s;user-select:none}.vjs-p .video-js-plugin-title{padding:10px;font-size:14px;color:#fff}.vjs-p .video-js-plugin-player{position:absolute;top:0;left:0;right:0;bottom:0}.video-js,[data-vjs-player]{width:100%;height:100%}.vjs-p .videojs-plugin-close-icon.disabled{display:none}.vjs-p .videojs-plugin-close-icon{pointer-events:auto;z-index:42;color:#fff;position:absolute;top:0;right:0;width:32px;height:32px;font-size:20px;display:flex;align-items:center;justify-content:center}.vjs-p .videojs-plugin-muted-alert{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43}.vjs-p .videojs-plugin-muted-alert:before{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43;content:"";background:rgba(0,0,0,.3);font-family:VideoJS;font-size:2em;display:flex;align-items:center;justify-content:center;color:#fff}.vjs-p .videojs-plugin-recovery-mode{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:44}.vjs-p .videojs-plugin-recovery-mode button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n');var de=function(e){f(r,e);var t=v(r);function r(){return c(this,r),t.apply(this,arguments)}return d(r,[{key:"render",value:function(){var e=this,t=this.props,r=t.cnode,n=t.size,o=t.scale;return i.default.createElement(a.CNode,{context:r},i.default.createElement(he,{size:n,scale:o},i.default.createElement(a.RoomConsumer,null,(function(t){return t&&i.default.createElement(fe,b({room:t},e.props))})),i.default.createElement(a.PlayerConsumer,null,(function(t){return t&&i.default.createElement(fe,b({player:t},e.props))}))))}}]),r}(i.Component),fe=function(e){f(r,e);var t=v(r);function r(e){var n;return c(this,r),n=t.call(this,e),T(m(n),"closeIcon",null),T(m(n),"alertMask",null),T(m(n),"container",i.default.createRef()),T(m(n),"player"),T(m(n),"controllerHiddenTimer",0),T(m(n),"syncPlayerTimer",0),T(m(n),"retryCount",0),T(m(n),"decreaseRetryTimer",0),T(m(n),"disposer"),T(m(n),"showController",(function(){n.setState({controllerVisible:!0}),n.debounceHidingController()})),T(m(n),"play",(function(){var e,t=null==(e=n.props.room)?void 0:e.calibrationTimestamp;n.debug(">>> play",{paused:!1,hostTime:t}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!1,hostTime:t})})),T(m(n),"pause",(function(){var e=n.getAttributes();if(e){var t=A(e,n.props);n.debug(">>> pause",{paused:!0,currentTime:t}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:t})}})),T(m(n),"setVolume",(function(e){n.debug(">>> volume",{volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e,muted:0===e})})),T(m(n),"setCurrentTime",(function(e){var t,r=null==(t=n.props.room)?void 0:t.calibrationTimestamp;n.debug(">>> seek",{currentTime:e/1e3,hostTime:r}),n.isEnabled()&&n.props.plugin.putAttributes({currentTime:e/1e3,hostTime:r})})),T(m(n),"resetPlayer",(function(){var e;null==(e=n.player)||e.autoplay(!1),n.debug(">>> ended",{paused:!0,currentTime:0}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:0})})),T(m(n),"syncPlayerWithAttributes",(function(){var e;n.props.plugin.context;var t=n.getAttributes();if(t){var r=n.player;if(r){r.paused()!==t.paused&&(n.debug("<<< paused -> %o",t.paused),t.paused?r.pause():null==(e=r.play())||e.catch(n.catchPlayFail)),r.muted()!==t.muted&&(n.debug("<<< muted -> %o",t.muted),r.muted(t.muted)),r.volume()!==t.volume&&(n.debug("<<< volume -> %o",t.volume),r.volume(t.volume));var i=A(t,n.props);i>r.duration()?n.resetPlayer():Math.abs(r.currentTime()-i)>I.currentTimeMaxError&&(n.debug("<<< currentTime -> %o",i),r.currentTime(i))}}})),T(m(n),"debounceHidingController",(function(){n.controllerHiddenTimer&&(clearTimeout(n.controllerHiddenTimer),n.controllerHiddenTimer=0),n.controllerHiddenTimer=setTimeout((function(){n.setState({controllerVisible:!1}),n.controllerHiddenTimer=0}),3e3)})),T(m(n),"decreaseRetryCount",(function(){n.player&&n.retryCount>0&&(n.retryCount=n.retryCount-1)})),T(m(n),"catchPlayFail",(function(e){var t,r,i=String(e);if(C&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=n.player)||t.autoplay("any"),n.setState({NoSound:!0});else{var o=null==(r=n.player)?void 0:r.error();o&&(n.retryCount<=3?(n.initPlayer(),n.retryCount=n.retryCount+1):(n.debug("catch videojs media error",o),n.setState({MediaError:!0}))),n.debug("catch error",e)}})),T(m(n),"fixPlayFail",(function(){n.debug("try to fix play state"),n.setState({NoSound:!1});var e=n.getAttributes(),t=e.muted,r=e.volume;n.player&&(n.player.muted(t),n.player.volume(r))})),T(m(n),"initPlayer",l(regeneratorRuntime.mark((function e(){var t,r,i,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=n.player)||t.dispose(),n.player=void 0,n.debug("creating elements ..."),r=n.getAttributes(),i=r.type,a=r.src,s=r.poster,(u=document.createElement("div")).setAttribute("data-vjs-player",""),(l=document.createElement("video")).className="video-js",s&&(l.poster=s),l.setAttribute("playsInline",""),l.setAttribute("webkit-playsinline",""),c=document.createElement("source"),new URL(a).pathname.endsWith(".m3u8")?c.type="application/x-mpegURL":l.src=a,c.src=a,i&&(c.type=i),l.appendChild(c),u.appendChild(l),n.container.current.appendChild(u),e.next=20,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 20:n.debug("initializing videojs() ..."),h=(0,o.default)(l),n.player=h,h.one("loadedmetadata",n.gracefullyUpdate),h.on("ready",(function(){var e,t;null==(t=(e=I).onPlayer)||t.call(e,h),h.on("timeupdate",n.gracefullyUpdate),h.on("volumechange",n.gracefullyUpdate),h.on("seeked",n.gracefullyUpdate),h.on("play",n.gracefullyUpdate),h.on("pause",n.gracefullyUpdate),h.on("ended",n.resetPlayer)})),h.on("error",n.catchPlayFail),n.setState({MediaError:!1});case 27:case"end":return e.stop()}}),e)})))),T(m(n),"gracefullyUpdate",(function(){return n.setState({updater:!n.state.updater})})),T(m(n),"setupClose",(function(e){e&&(e.addEventListener("touchstart",n.removeSelf),e.addEventListener("click",n.removeSelf)),n.closeIcon=e})),T(m(n),"setupAlert",(function(e){e&&(e.addEventListener("touchstart",n.fixPlayFail),e.addEventListener("click",n.fixPlayFail)),n.alertMask=e})),T(m(n),"setupReload",(function(e){e&&(e.addEventListener("touchstart",n.initPlayer),e.addEventListener("click",n.initPlayer))})),T(m(n),"removeSelf",(function(){return n.props.plugin.remove()})),n.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/video-js-plugin@".concat(M," requires white-web-sdk@^2.13.8 to work properly."))}(e.room),n}return d(r,[{key:"getAttributes",value:function(){var e,t=this.props.plugin.attributes;if(t){var r=[a.PlayerPhase.Pause,a.PlayerPhase.Ended,a.PlayerPhase.Stopped];if(!t.paused&&r.includes(null==(e=this.props.player)?void 0:e.phase)){var n=A(t,this.props);t=b(b({},t),{},{currentTime:n,paused:!0})}return t}}},{key:"render",value:function(){var e,t,r,n;if(!this.props.room&&!this.props.player)return null;var o=this.getAttributes();if(!o)return null;var a=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),s=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return i.default.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},i.default.createElement("div",{className:"video-js-plugin-player",ref:this.container}),i.default.createElement("div",{className:"video-js-plugin-header"},o.title&&i.default.createElement("div",{className:"video-js-plugin-title"},o.title),(null==(r=o.close)||r)&&i.default.createElement("div",{className:"videojs-plugin-close-icon",ref:this.setupClose},"×")),i.default.createElement(ue,{duration:a,volume:o.volume,setVolume:this.setVolume,paused:o.paused,play:this.play,pause:this.pause,currentTime:1e3*A(o,this.props),setCurrentTime:this.setCurrentTime,buffered:a*s,scale:this.props.scale,visible:!0}),!(null==(n=this.props.plugin.context)?void 0:n.hideMuteAlert)&&this.state.NoSound&&i.default.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&i.default.createElement("div",{className:"videojs-plugin-recovery-mode"},i.default.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){var t;if(null==(t=this.props.plugin.context)?void 0:t.verbose){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i>>1,i=e[n];if(!(0>>1;na(u,r))la(c,u)?(e[n]=c,e[l]=r,n=l):(e[n]=u,e[s]=r,n=s);else{if(!(la(c,r)))break e;e[n]=c,e[l]=r,n=l}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===("undefined"==typeof performance?"undefined":r(performance))&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var u=Date,l=u.now();t.unstable_now=function(){return u.now()-l}}var c=[],h=[],d=1,f=null,p=3,v=!1,g=!1,m=!1,y="function"==typeof setTimeout?setTimeout:null,_="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function x(e){for(var t=i(h);null!==t;){if(null===t.callback)o(h);else{if(!(t.startTime<=e))break;o(h),t.sortIndex=t.expirationTime,n(c,t)}t=i(h)}}function w(e){if(m=!1,x(e),!g)if(null!==i(c))g=!0,R(S);else{var t=i(h);null!==t&&D(w,t.startTime-e)}}function S(e,r){g=!1,m&&(m=!1,_(E),E=-1),v=!0;var n=p;try{for(x(r),f=i(c);null!==f&&(!(f.expirationTime>r)||e&&!C());){var a=f.callback;if("function"==typeof a){f.callback=null,p=f.priorityLevel;var s=a(f.expirationTime<=r);r=t.unstable_now(),"function"==typeof s?f.callback=s:f===i(c)&&o(c),x(r)}else o(c);f=i(c)}if(null!==f)var u=!0;else{var l=i(h);null!==l&&D(w,l.startTime-r),u=!1}return u}finally{f=null,p=n,v=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var T,M=!1,k=null,E=-1,A=5,I=-1;function C(){return!(t.unstable_now()-Ie||125s?(e.sortIndex=a,n(h,e),null===i(c)&&e===i(h)&&(m?(_(E),E=-1):m=!0,D(w,a-s))):(e.sortIndex=u,n(c,e),g||v||(g=!0,R(S))),e},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(e){var t=p;return function(){var r=p;p=t;try{return e.apply(this,arguments)}finally{p=r}}}},38199:function(e,t,r){e.exports=r(15523)},18808:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t,r,n,i,o,a,s,u;void 0===CanvasRenderingContext2D.prototype.ellipse&&(CanvasRenderingContext2D.prototype.ellipse=function(e,t,r,n,i,o,a,s){this.save(),this.translate(e,t),this.rotate(i),this.scale(r,n),this.arc(0,0,1,o,a,s),this.restore()}),void 0===CanvasRenderingContext2D.prototype.resetTransform&&(CanvasRenderingContext2D.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)}),void 0===CanvasRenderingContext2D.prototype.getTransform&&(CanvasRenderingContext2D.prototype.getTransform=function(){return this._t2stack&&this._t2stack[this._t2stack.length-1]||{a:1,b:0,c:0,d:1,e:0,f:0}},CanvasRenderingContext2D.prototype.save=(t=CanvasRenderingContext2D.prototype.save,function(){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var e=this._t2stack[this._t2stack.length-1];this._t2stack.push(e&&{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}),t.call(this)}),CanvasRenderingContext2D.prototype.restore=(r=CanvasRenderingContext2D.prototype.restore,function(){this._t2stack&&this._t2stack.pop(),r.call(this)}),CanvasRenderingContext2D.prototype.transform=(n=CanvasRenderingContext2D.prototype.transform,function(e,t,r,i,o,a){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var s=this._t2stack[this._t2stack.length-1],u=s.a*e+s.c*t,l=s.b*e+s.d*t,c=s.a*r+s.c*i,h=s.b*r+s.d*i,d=s.e+s.a*o+s.c*a,f=s.f+s.b*o+s.d*a;s.a=u,s.b=l,s.c=c,s.d=h,s.e=d,s.f=f,n.call(this,e,t,r,i,o,a)}),CanvasRenderingContext2D.prototype.setTransform=(i=CanvasRenderingContext2D.prototype.setTransform,function(t,r,n,o,a,s){if(this._t2stack||(this._t2stack=[{}]),"object"===e(t)||void 0===t){var u=t.a,l=t.b,c=t.c,h=t.d,d=t.e,f=t.f;this._t2stack[this._t2stack.length-1]={a:u,b:l,c:c,d:h,e:d,f:f},i.call(this,u,l,c,h,d,f)}else this._t2stack[this._t2stack.length-1]={a:t,b:r,c:n,d:o,e:a,f:s},i.call(this,t,r,n,o,a,s)}),CanvasRenderingContext2D.prototype.resetTransform=(o=CanvasRenderingContext2D.prototype.resetTransform,function(){this._t2stack||(this._t2stack=[{}]),this._t2stack[this._t2stack.length-1]={a:1,b:0,c:0,d:1,e:0,f:0},o&&o.call(this)}),CanvasRenderingContext2D.prototype.scale=(a=CanvasRenderingContext2D.prototype.scale,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var r=this._t2stack[this._t2stack.length-1];e=e||1,t=t||e,r.a*=e,r.c*=t,r.b*=e,r.d*=t,a.call(this,e,t)}),CanvasRenderingContext2D.prototype.rotate=(s=CanvasRenderingContext2D.prototype.rotate,function(e){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var t=this._t2stack[this._t2stack.length-1],r=Math.cos(-e),n=Math.sin(-e),i=t.a*r-t.c*n,o=t.b*r-t.d*n,a=t.c*r+t.a*n,u=t.d*r+t.b*n;return t.a=i,t.b=o,t.c=a,t.d=u,s.call(this,e)}),CanvasRenderingContext2D.prototype.translate=(u=CanvasRenderingContext2D.prototype.translate,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var r=this._t2stack[this._t2stack.length-1];return r.e+=e*r.a+t*r.c,r.f+=e*r.b+t*r.d,u.call(this,e,t)}))},92710:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}({"./src/CombinePlayerImplement.ts":function(e,t,r){r.d(t,"a",(function(){return y}));var n=r("@babel/runtime/regenerator"),i=r.n(n),o=r("@babel/runtime/helpers/asyncToGenerator"),a=r.n(o),s=r("@babel/runtime/helpers/classCallCheck"),u=r.n(s),l=r("@babel/runtime/helpers/createClass"),c=r.n(l),h=function(e,t,r){"string"==typeof r?console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),r):console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),JSON.stringify(r,null,2))},d=r("./src/StatusContant.ts"),f=r("./src/EventEmitter.ts"),p=r("./src/ErrorConstant.ts");function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(this.statusIgnoreCrashByDisabled[0]);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.video;if(t===o.whiteboard&&a===e){n=!0;break}}}catch(e){i.e(e)}finally{i.f()}return!n}},{key:"unlockCombineStatus",value:function(){this.statusLockInfo.isLocked=!1,this.statusLockInfo.allowStatusList=[],this.statusLockInfo.unLockStatusList=[]}},{key:"setPreviousStatus",value:function(e,t){this.whiteboardStatus.previous=e,this.videoStatus.previous=t}},{key:"dispatchEvent",value:function(e){var t=this,r=e.videoStatus,n=e.whiteboardStatus,i=e.combineStatus,o={whiteboard:this.getStatus(d.a.Whiteboard).previous,video:this.getStatus(d.a.Video).previous},a={whiteboard:n,video:r};this.debug("CombinedStatus",i,{previous:{whiteboard:d.b[o.whiteboard],video:d.b[o.video]},current:{whiteboard:d.b[a.whiteboard],video:d.b[a.video]}}),this.events.emit(i,o,a,(function(){t.setPreviousStatus(n,r)}))}},{key:"initTables",value:function(){var e=function(e){return function(t,r){return Object.freeze({combineStatus:e,whiteboardStatus:t,videoStatus:r})}},t=e(d.c.PauseSeeking),r=e(d.c.PlayingSeeking),n=e(d.c.PauseBuffering),i=e(d.c.PlayingBuffering),o=e(d.c.ToPlay),a=e(d.c.ToPause),s=e(d.c.Pause),u=e(d.c.Playing),l=e(d.c.Disabled),c=e(d.c.Ended);return Object.freeze([Object.freeze([t(d.b.PauseSeeking,d.b.PauseSeeking),t(d.b.PauseSeeking,d.b.Pause),l(d.b.PauseSeeking,d.b.PauseBuffering),l(d.b.PauseSeeking,d.b.PlayingBuffering),l(d.b.PauseSeeking,d.b.Playing),l(d.b.PauseSeeking,d.b.PlayingSeeking),t(d.b.PauseSeeking,d.b.Ended)]),Object.freeze([t(d.b.Pause,d.b.PauseSeeking),s(d.b.Pause,d.b.Pause),n(d.b.Pause,d.b.PauseBuffering),i(d.b.Pause,d.b.PlayingBuffering),o(d.b.Pause,d.b.Playing),r(d.b.Pause,d.b.PlayingSeeking),c(d.b.Pause,d.b.Ended)]),Object.freeze([l(d.b.PauseBuffering,d.b.PauseSeeking),n(d.b.PauseBuffering,d.b.Pause),n(d.b.PauseBuffering,d.b.PauseBuffering),l(d.b.PauseBuffering,d.b.PlayingBuffering),l(d.b.PauseBuffering,d.b.Playing),l(d.b.PauseBuffering,d.b.PlayingSeeking),l(d.b.PauseBuffering,d.b.Ended)]),[l(d.b.PlayingBuffering,d.b.PauseSeeking),i(d.b.PlayingBuffering,d.b.Pause),l(d.b.PlayingBuffering,d.b.PauseBuffering),i(d.b.PlayingBuffering,d.b.PlayingBuffering),a(d.b.PlayingBuffering,d.b.Playing),l(d.b.PlayingBuffering,d.b.PlayingSeeking),l(d.b.PlayingBuffering,d.b.Ended)],Object.freeze([l(d.b.Playing,d.b.PauseSeeking),o(d.b.Playing,d.b.Pause),l(d.b.Playing,d.b.PauseBuffering),a(d.b.Playing,d.b.PlayingBuffering),u(d.b.Playing,d.b.Playing),a(d.b.Playing,d.b.PlayingSeeking),a(d.b.Playing,d.b.Ended)]),Object.freeze([l(d.b.PlayingSeeking,d.b.PauseSeeking),r(d.b.PlayingSeeking,d.b.Pause),l(d.b.PlayingSeeking,d.b.PauseBuffering),l(d.b.PlayingSeeking,d.b.PlayingBuffering),a(d.b.PlayingSeeking,d.b.Playing),r(d.b.PlayingSeeking,d.b.PlayingSeeking),r(d.b.PlayingSeeking,d.b.Ended)]),Object.freeze([t(d.b.Ended,d.b.PauseSeeking),c(d.b.Ended,d.b.Pause),l(d.b.Ended,d.b.PauseBuffering),l(d.b.Ended,d.b.PlayingBuffering),a(d.b.Ended,d.b.Playing),r(d.b.Ended,d.b.PlayingSeeking),c(d.b.Ended,d.b.Ended)])])}}]),e}(),m=function(){function e(){u()(this,e),this.queue=[],this.isHanding=!1}var t;return c()(e,[{key:"append",value:function(e){var t=this;return new Promise((function(r,n){var i={handler:e,resolve:r,reject:n};t.queue.push(i),t.isHanding||t.startHandingTasksLoop()}))}},{key:"destroy",value:function(){this.queue=[]}},{key:"startHandingTasksLoop",value:(t=a()(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.isHanding=!0;case 2:if(!(this.queue.length>0)){e.next=20;break}return t=this.queue[0],e.prev=4,e.t0=t,e.next=8,t.handler();case 8:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=15;break;case 12:e.prev=12,e.t2=e.catch(4),t.reject(e.t2);case 15:return e.prev=15,this.queue.shift(),e.finish(15);case 18:e.next=2;break;case 20:e.next=25;break;case 22:throw e.prev=22,e.t3=e.catch(0),new Error(e.t3);case 25:return e.prev=25,this.isHanding=!1,e.finish(25);case 28:case"end":return e.stop()}}),e,this,[[0,22,25,28],[4,12,15,18]])}))),function(){return t.apply(this,arguments)})}]),e}(),y=function(){function e(t){u()(this,e),this.video=void 0,this.whiteboard=void 0,this.videoOptions=void 0,this.stateMachine=void 0,this._playbackRate=1,this.seekTime=NaN,this.triggerSource=d.e.None,this.currentCombineStatus=d.d.PauseBuffering,this.whiteboardEmitter=void 0,this.taskQueue=new m,this.onStatusChangeHandleList=[];var r=t.videoConfig,n=t.whiteboard,i=t.whiteboardEmitter,o=t.debug;this.videoOptions=r.videoOptions,this.video=r.video,this.whiteboard=n,this.whiteboardEmitter=i,this.stateMachine=new g(o),this.initOnCrashByDisabledStatusCallback(),this.initVideo(r.isCanplay),this.initWhiteboard()}var t,r,n,o,s,l,h,f,v,y,_,b,x,w,S,T,M,k;return c()(e,[{key:"setOnStatusChange",value:function(e){this.onStatusChangeHandleList.push(e)}},{key:"removeStatusChange",value:function(e){this.onStatusChangeHandleList=this.onStatusChangeHandleList.filter((function(t){return t!==e}))}},{key:"removeAllStatusChange",value:function(){this.onStatusChangeHandleList=[]}},{key:"getStatus",value:function(){return this.combinedStatus}},{key:"playbackSpeed",value:function(e){this.playbackRate=e}},{key:"stop",value:function(){if(this.currentCombineStatus===d.d.Stopped)throw new Error(p.d);if(this.currentCombineStatus===d.d.Disabled)throw new Error(p.c);this.releaseEvents(),this.onStatusUpdate(d.d.Stopped)}},{key:"play",value:(k=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.taskQueue.append(a()(i.a.mark((function e(){var r,n,o;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.triggerSource=d.e.Plugin,r=t.stateMachine.getCombinationStatus().current,e.t0=r,e.next=e.t0===d.c.Pause?5:e.t0===d.c.PauseBuffering?8:e.t0===d.c.Ended?24:27;break;case 5:return e.next=7,t.playWhenPause();case 7:return e.abrupt("break",27);case 8:if(n=t.stateMachine.getStatus(d.a.Video).current,o=t.stateMachine.getStatus(d.a.Whiteboard).current,n!==d.b.Pause||o!==d.b.PauseBuffering){e.next=15;break}return e.next=13,t.playWhenVideoIsPauseAndWhiteboardIsPauseBuffering();case 13:e.next=23;break;case 15:if(n!==d.b.PauseBuffering||o!==d.b.Pause){e.next=21;break}return t.onStatusUpdate(d.d.PlayingBuffering),e.next=19,t.playWhenPause();case 19:e.next=23;break;case 21:return e.next=23,t.playWhenAllPlayerIsPauseBuffering();case 23:return e.abrupt("break",27);case 24:return e.next=26,t.playWhenEnded();case 26:return e.abrupt("break",27);case 27:if(isNaN(t.seekTime)){e.next=31;break}return e.next=30,t.seekWhenPlaying(t.seekTime);case 30:t.seekTime=NaN;case 31:t.triggerSource=d.e.None;case 32:case"end":return e.stop()}}),e)}))));case 4:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{key:"pause",value:(M=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.triggerSource=d.e.Plugin,t.stateMachine.getCombinationStatus().current!==d.c.Playing){e.next=5;break}return e.next=5,t.pauseWhenPlaying();case 5:t.triggerSource=d.e.None;case 6:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(){return M.apply(this,arguments)})},{key:"seek",value:(T=a()(i.a.mark((function e(t){var r=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){var n,o,a,s,u,l,c,h,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.whiteboard.progressTime,o=r.video.currentTime(),0!==n||0!==o){e.next=5;break}return 0!==t&&(r.seekTime=t),e.abrupt("return");case 5:r.triggerSource=d.e.Plugin,a=r.stateMachine.getCombinationStatus().current,e.t0=a,e.next=e.t0===d.c.Playing?10:e.t0===d.c.Pause||e.t0===d.c.PauseBuffering?13:e.t0===d.c.Ended?23:30;break;case 10:return e.next=12,r.seekWhenPlaying(t);case 12:return e.abrupt("break",30);case 13:if(s=r.getPlayerDuration(),u=s.video,l=s.whiteboard,!(t>u||t>l)){e.next=20;break}return e.next=18,r.seekWhenPauseFinallyIsEnded(t,s);case 18:e.next=22;break;case 20:return e.next=22,r.seekWhenPause(t);case 22:return e.abrupt("break",30);case 23:if(c=r.getPlayerDuration(),h=c.video,f=c.whiteboard,!(t<=h&&t<=f)){e.next=29;break}return e.next=27,r.seekWhenPause(t);case 27:return e.next=29,r.playWhenPause();case 29:return e.abrupt("break",30);case 30:r.triggerSource=d.e.None;case 31:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"initVideo",value:function(e){this.stateMachine.setStatus(d.a.Video,e?d.b.Pause:d.b.PauseBuffering),e||(this.currentCombineStatus=d.d.PauseBuffering),this.initVideoJSEvents()}},{key:"initVideoJSEvents",value:function(){var e=this,t=!1,r=function(t){return a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Video){r.next=4;break}return e.triggerSource=d.e.Video,r.next=4,t();case 4:case"end":return r.stop()}}),r)})))};this.video.on("canplay",(function(){var t=e.stateMachine.getStatus(d.a.Whiteboard).current;e.stateMachine.getStatus(d.a.Video).current===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Video,d.b.Pause),t===d.b.Pause&&e.onStatusUpdate(d.d.Pause))})),this.video.on("seeking",r(a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.taskQueue.append((function(){t=!0}));case 2:case"end":return r.stop()}}),r)}))))),this.video.on("waiting",r(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.onStatusUpdate(d.d.PlayingBuffering),t.next=3,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoWaiting()}));case 3:e.triggerSource=d.e.None;case 4:case"end":return t.stop()}}),t)}))))),this.video.on("playing",r(a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.taskQueue.append(a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t){r.next=2;break}return r.abrupt("return",e.playingWhiteboardWhenVideoPlayingDropFrame());case 2:return r.abrupt("return",e.playingWhiteboardWhenVideoPlaying());case 3:case"end":return r.stop()}}),r)}))));case 2:t=!1,e.triggerSource=d.e.None;case 4:case"end":return r.stop()}}),r)}))))),this.video.on("ended",r(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoEnded()}));case 2:e.triggerSource=d.e.None;case 3:case"end":return t.stop()}}),t)}))))),this.video.on("fullscreenchange",r(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){var t=e.stateMachine.getStatus(d.a.Video).current;t!==d.b.Playing&&t!==d.b.PlayingBuffering||!e.video.isFullscreen()&&e.video.paused()&&(e.whiteboardEmitter.one("pause",(function(){e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),e.stateMachine.setStatus(d.a.Video,d.b.Pause),e.onStatusUpdate(d.d.Pause)})),e.whiteboard.pause()),e.triggerSource=d.e.None}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"initWhiteboard",value:function(){this.initWhiteboardIsPlayable(),this.initWhiteboardEvents(),this.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseBuffering),this.currentCombineStatus=d.d.PauseBuffering,this.whiteboard.seekToProgressTime(0)}},{key:"initWhiteboardIsPlayable",value:function(){var e=this;this.whiteboardEmitter.addListener("playableChange",(function(t){var r=e.stateMachine.getStatus(d.a.Whiteboard).current,n=e.stateMachine.getStatus(d.a.Video).current;t&&r===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),n===d.b.Pause&&e.onStatusUpdate(d.d.Pause))}))}},{key:"initWhiteboardEvents",value:function(){var e=this,t=function(t){return a()(i.a.mark((function r(){return i.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Whiteboard){r.next=5;break}return e.triggerSource=d.e.Whiteboard,r.next=4,t();case 4:e.triggerSource=d.e.None;case 5:case"end":return r.stop()}}),r)})))};this.whiteboardEmitter.addListener("buffering",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardBuffering()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("playing",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.playingVideoWhenWhiteboardPlaying()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("ended",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardEnded()}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"playWhenPause",value:(S=a()(i.a.mark((function e(){var t,r,n,o,s=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){s.stateMachine.setStatus(d.a.Video,d.b.Playing)},r=function(){s.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},this.whiteboardEmitter.one("playing",r),n=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),o=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.onStatusUpdate(d.d.Playing);case 1:case"end":return e.stop()}}),e)})))),this.video.one("playing",t),this.video.play(),e.next=10,Promise.all([n,o]);case 10:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"playWhenVideoIsPauseAndWhiteboardIsPauseBuffering",value:(w=a()(i.a.mark((function e(){var t,r,n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Pause,d.c.PauseBuffering,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},r=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},o=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},s=function(){f.whiteboardEmitter.removeListener("playing",o),f.whiteboardEmitter.removeListener("buffering",n),f.video.off("playing",t),f.video.off("pause",r)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.pause();case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),u=this.stateMachine.one(d.c.PauseBuffering,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),l=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),c=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.play();case 1:case"end":return e.stop()}}),e)})))),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.off([d.c.PauseBuffering,d.c.Pause,d.c.ToPlay]),s();case 3:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",n),this.whiteboardEmitter.one("playing",o),this.video.on("playing",t),this.video.one("pause",r),this.video.play(),e.next=18,Promise.all([Promise.race([u,l]),c,h]);case 18:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"playWhenAllPlayerIsPauseBuffering",value:(x=a()(i.a.mark((function e(){var t,r,n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.ToPause,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},s=function(){f.stateMachine.setStatus(d.a.Video,d.b.PlayingBuffering)},u=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PlayingBuffering,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.PlayingBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.Playing}],function(){var e=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(r=t.current).video===d.b.Playing?f.video.pause():r.whiteboard===d.b.Playing&&f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){throw Error(e)}));case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),l=this.stateMachine.one(d.c.ToPause,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.video.pause():f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c=this.stateMachine.one(d.c.ToPlay,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.whiteboard.play():f.video.play();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.cancelOneButNotCrashByDisabled(),f.stateMachine.off([d.c.ToPause,d.c.ToPlay]),f.video.off("playing",o),f.whiteboardEmitter.removeListener("playing",r),f.whiteboardEmitter.removeListener("pause",n);case 6:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",t),this.whiteboardEmitter.addListener("playing",r),this.whiteboardEmitter.one("pause",n),this.video.on("playing",o),this.video.one("play",s),this.video.one("pause",u),this.video.play(),this.whiteboard.play(),e.next=21,Promise.all([Promise.race([l,c]),h]);case 21:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"playWhenEnded",value:(b=a()(i.a.mark((function e(){var t,r,n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingBuffering),t=NaN,this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.whiteboard.pause()},s=function(){f.video.off("pause",u),f.video.off("play",l),f.video.one("play",(function(){f.video.one("pause",(function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)})),f.video.pause()})),f.video.play()},u=function(){f.video.play()},l=function(){f.video.pause()},c=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),t=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(t),f.video.play())}),500)},h=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f.whiteboardEmitter.removeListener("buffering",r),f.whiteboardEmitter.removeListener("playing",o),clearInterval(t),e.next=5,f.playWhenPause();case 5:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",r),this.whiteboardEmitter.one("pause",n),this.whiteboardEmitter.one("playing",o),this.video.one("seeking",c),this.video.one("seeked",s),this.video.on("play",l),this.video.on("pause",u),this.whiteboard.seekToProgressTime(0),this.video.currentTime(0),e.next=22,h;case 22:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"pauseWhenPlaying",value:(_=a()(i.a.mark((function e(){var t,r,n,o=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),t=function(){o.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},r=function(){o.stateMachine.setStatus(d.a.Video,d.b.Pause)},n=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.onStatusUpdate(d.d.Pause);case 1:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("pause",t),this.video.one("pause",r),this.whiteboard.pause(),this.video.pause(),e.next=10,n;case 10:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"seekWhenPlaying",value:(y=a()(i.a.mark((function e(t){var r,n,o,s,u,l,c,h,f,p,v,g=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingSeeking),r=NaN,n=this.getPlayerDuration(),this.stateMachine.lockCombineStatus([d.c.Pause,d.c.Ended,d.c.PlayingSeeking],[d.c.Pause,d.c.Ended]),o=function(){g.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingSeeking)},s=function(){t=d.f.HAVE_CURRENT_DATA&&(clearInterval(r),t=d.f.HAVE_CURRENT_DATA&&(clearInterval(r),h.stateMachine.setStatus(d.a.Video,d.b.Pause))}),500)},o=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},s=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},u=function(){h.whiteboard.pause()},l=function(){clearInterval(r),h.video.off("seeking",n),h.whiteboardEmitter.removeListener("buffering",o),h.whiteboardEmitter.removeListener("pause",s)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PauseSeeking,whiteboard:d.b.PauseSeeking}]).catch((function(e){throw Error(e)})),c=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.onStatusUpdate(d.d.Pause),h.stateMachine.cancelOneButNotCrashByDisabled(),h.stateMachine.off(d.c.Ended),h.whiteboardEmitter.removeListener("playing",u),l();case 5:case"end":return e.stop()}}),e)})))),this.video.one("seeking",n),this.whiteboardEmitter.one("buffering",o),this.whiteboardEmitter.one("playing",u),this.whiteboardEmitter.one("pause",s),this.whiteboard.seekToProgressTime(t),this.video.currentTime(t/1e3),e.next=18,c;case 18:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"seekWhenPauseFinallyIsEnded",value:(f=a()(i.a.mark((function e(t,r){var n,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PauseSeeking),n=NaN,this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Ended],[d.c.Ended]),o=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),n=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(n),f.stateMachine.setStatus(d.a.Video,d.b.Pause),t>=r.video&&f.stateMachine.setStatus(d.a.Video,d.b.Ended))}),500)},s=function(){t1?t-1:0),n=1;n2&&void 0!==arguments[2]&&arguments[2];a()(this,e),this.videoOptions=void 0,this.whiteboard=void 0,this.debug=void 0,Object(l.a)(r);var i=e.videoDefaultOptions(r);this.videoOptions=y(y(y({},i),r),{},{videoJsOptions:y(y({},i.videoJsOptions),r.videoJsOptions)}),this.whiteboard=t,this.debug=n}return u()(e,[{key:"create",value:function(){var e=new c.a;this.handleWhiteboardCallback(e);var t=this.getVideoDOM(),r=f()(t,this.videoOptions.videoJsOptions);return r.src(this.videoOptions.url),new h.a({videoConfig:{videoOptions:this.videoOptions,video:r,isCanplay:r.readyState()>p.f.HAVE_CURRENT_DATA},whiteboard:this.whiteboard,whiteboardEmitter:e,debug:this.debug})}},{key:"getVideoDOM",value:function(){return void 0!==this.videoOptions.videoElementID?document.getElementById(this.videoOptions.videoElementID):this.videoOptions.videoDOM}},{key:"handleWhiteboardCallback",value:function(e){this.whiteboard.callbacks.on("onPhaseChanged",(function(t){e.emit(t)})),this.whiteboard.callbacks.on("onIsPlayableChanged",(function(t){e.emit("playableChange",t)}))}}],[{key:"videoDefaultOptions",value:function(e){var t={videoJsOptions:{preload:"auto"}};return e.videoDOM||e.videoElementID||(t.videoDOM=document.createElement("video")),t}}]),e}()},0:function(e,t,r){e.exports=r("./src/index.ts")},"@babel/runtime/helpers/asyncToGenerator":function(e,t){e.exports=r(34397)},"@babel/runtime/helpers/classCallCheck":function(e,t){e.exports=r(57750)},"@babel/runtime/helpers/createClass":function(e,t){e.exports=r(67338)},"@babel/runtime/helpers/defineProperty":function(e,t){e.exports=r(91566)},"@babel/runtime/regenerator":function(e,t){e.exports=r(64910)},"video.js":function(e,t){e.exports=r(30825)}})},20597:function(e,t,r){var n,i,o,a;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}e=r.nmd(e),window,a=function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==s(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="},function(e,t,r){r.r(t),r.d(t,"CursorTool",(function(){return y}));var n,i=r(0),o=r(1),a=r(2),s=r.n(a),u=r(3),l=r.n(u),c=r(4),h=r.n(c),d=r(5),f=r.n(d),p=r(6),v=r.n(p),g=(r(8),n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),m=function(e){function t(t){var r=e.call(this,t)||this;return r.renderAvatar=function(e){var t,n="rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")";if(r.detectAvatar(e)){var o=r.detectCursorName(e);return i.createElement("img",{className:"cursor-selector-avatar",style:{width:o?19:28,height:o?19:28,position:o?"initial":"absolute",borderColor:o?"white":n,marginRight:o?4:0},src:null===(t=e.payload)||void 0===t?void 0:t.avatar,alt:"avatar"})}return null},r.getOpacity=function(e){var t=r.getCursorName(e),n=r.detectAvatar(e);return void 0===t&&void 0===n?0:1},r.getCursorName=function(e){return e.payload&&e.payload.cursorName?e.payload.cursorName:void 0},r.getThemeClass=function(e){return e.payload&&e.payload.theme?"cursor-inner-mellow":"cursor-inner"},r.getCursorBackgroundColor=function(e){var t=r.detectCursorName(e);return e.payload&&e.payload.cursorBackgroundColor?e.payload.cursorBackgroundColor:t?"rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")":void 0},r.getCursorTextColor=function(e){return e.payload&&e.payload.cursorTextColor?e.payload.cursorTextColor:"#FFFFFF"},r.getCursorTagBackgroundColor=function(e){return e.payload&&e.payload.cursorTagBackgroundColor?e.payload.cursorTagBackgroundColor:r.getCursorBackgroundColor(e)},r.detectCursorName=function(e){return!(!e.payload||!e.payload.cursorName)},r.detectAvatar=function(e){return!(!e.payload||!e.payload.avatar)},r.renderTag=function(e){return e.payload&&e.payload.cursorTagName?i.createElement("span",{className:"cursor-tag-name",style:{backgroundColor:r.getCursorTagBackgroundColor(e)}},e.payload.cursorTagName):void 0},r}return g(t,e),t.prototype.render=function(){var e=this.props.roomMember,t=this.getCursorName(e);switch(e.memberState.currentApplianceName){case o.ApplianceNames.pencil:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:s.a,alt:"pencilCursor"}))));case o.ApplianceNames.selector:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-selector-offset"},i.createElement("div",null,i.createElement("img",{className:"cursor-selector-image",src:l.a,alt:"selectorCursor"})),i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e)))));case o.ApplianceNames.eraser:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:h.a,alt:"selectorCursor"}))));case o.ApplianceNames.text:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-text-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:v.a,alt:"selectorCursor"}))));default:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-shape-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:f.a,alt:"shapeCursor"}))))}},t}(i.Component),y=function(){function e(){this.cursors={},this.roomMembers=[],this.isFirstFrameReady=!1,this.isCursorDisappear=function(e){return!(!e.payload||!e.payload.disappearCursor)}}return e.prototype.createCursor=function(){return{x:64,y:64,width:128,height:128}},e.prototype.onAddedCursor=function(e){for(var t=0,r=this.roomMembers;t0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]this.totalPage)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.NextPage,{})}},t.prototype.handlePrevPage=function(){if(this.canOperation){var e=this.currentPage-1;if(e<0)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.PrevPage,{})}},t.prototype.handlePageTo=function(e){if(this.canOperation){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;var r=t-1;this.displayer.setSceneIndex(r),this.dispatchMagixEvent(h.PageTo,r)}},t.prototype.handleRemoveAllMagixEvent=function(){var e=this;this.magixEventMap.forEach((function(t,r){e.displayer.removeMagixEventListener(r,t)})),this.magixEventMap.clear()},t.prototype.handleGetAttributes=function(){this.postMessage({kind:h.GetAttributes,payload:this.attributes})},t.prototype.postMessage=function(e){var t;this.iframe&&(null===(t=this.iframe.contentWindow)||void 0===t||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))},t.prototype.dispatchMagixEvent=function(t,r){this.canOperation&&(e.prototype.setAttributes.call(this,{lastEvent:{name:t,payload:r}}),this.displayer.dispatchMagixEvent(t,r))},Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this.displayer.state.sceneState.index},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPage",{get:function(){return this.currentIndex+1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalPage",{get:function(){return this.displayer.state.sceneState.scenes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return!this.displayer.isWritable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReplay",{get:function(){return(0,o.isPlayer)(this.displayer)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisplaySceneDir",{get:function(){return this.displayer.state.sceneState.scenePath.startsWith(this.attributes.displaySceneDir)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canOperation",{get:function(){return!this.isReplay&&(!this.readonly&&this.displayer.phase===o.RoomPhase.Connected)},enumerable:!1,configurable:!0}),t.prototype.isClicker=function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)},Object.defineProperty(t.prototype,"isDisableInput",{get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iframeOrigin",{get:function(){return this.iframe?new URL(this.iframe.src).origin:void 0},enumerable:!1,configurable:!0}),t.prototype._destory=function(){var e=this;window.removeEventListener("message",this.messageListener),this.magixEventMap.forEach((function(t,r){e.displayer.removeMagixEventListener(r,t)})),this.displayer.callbacks.off(this.callbackName,this.stateChangeListener),this.displayer.callbacks.off("onPhaseChanged",this.onPhaseChangedListener),this.magixEventMap.clear(),this.iframe&&(t.emitter.emit(h.Destory),this.iframe=null,t.alreadyCreate=!1),this.bridgeDisposer(),t.emitter.removeAllListeners()},t.kind="IframeBridge",t.emitter=new a.EventEmitter2,t.alreadyCreate=!1,t}(o.InvisiblePlugin);t.IframeBridge=m},24182:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.times=void 0;t.times=function(e,t){return new Array(e).fill(0).map((function(e,r){return t(r)}))}},82372:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.EffectPlugin=void 0;var n,i=r(26913),o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=function(e){function t(r,n,i){var o,a,s,u,l,c,h,d=e.call(this)||this;return d._volume=50,d._currentTime=0,d._isPaused=!0,d._duration=0,d.timer=null,d._startPos=0,d.onDurationBack=function(e,t){d.url===e&&(d._duration=t/1e3),d.emit("load")},d.onEffectStop=function(e){e===d.soundIndex&&(window.clearInterval(d.timer),d._isPaused=!0,d._duration=0,d._currentTime=0,d.emit("pause"))},d.onEffectPause=function(e){e===d.soundIndex&&(d._isPaused=!0,d.emit("pause"))},d.onEffectFinished=function(e){d.onEffectPause(e),d._currentTime=d._duration},d.onEffectPlay=function(e){e===d.soundIndex&&(d.timer&&clearInterval(d.timer),d.timer=window.setInterval((function(){var e;null===(e=t.audioEffector)||void 0===e||e.getEffectCurrentPosition(d.soundIndex).then((function(e){var r;d._currentTime=e,null===(r=t.ctx)||void 0===r||r.logger.info("rtc callback position, "+e+", endPos: "+d._endPos)})).catch((function(){}))}),300),d._isPaused=!1,d.emit("play"))},null===(o=t.ctx)||void 0===o||o.logger.info("url: "+r+", start: "+n+", end: "+i),d.url=r,n&&(d._startPos=n),i&&(d._endPos=i),d.soundIndex=t.nextSoundIndex(),window.addEventListener("message",(function(e){e.data&&"resumeAllAudioInterruptByAudioSessionChanged"===e.data.name&&d.emit("resumeAllAudioInterruptByAudioSessionChanged")})),null===(a=t.audioEffector)||void 0===a||a.on("play",d.onEffectPlay),null===(s=t.audioEffector)||void 0===s||s.on("pause",d.onEffectPause),null===(u=t.audioEffector)||void 0===u||u.on("effectFinished",d.onEffectPause),null===(l=t.audioEffector)||void 0===l||l.on("error",d.onEffectStop),null===(c=t.audioEffector)||void 0===c||c.on("duration",d.onDurationBack),null===(h=t.audioEffector)||void 0===h||h.getEffectDuration(d.url),d.onEffectPause(d.soundIndex),d}return o(t,e),t.nextSoundIndex=function(){return t.soundIndex+=1,t.soundIndex},t.prototype.play=function(){var e,r,n;clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info("effect play call, "+this.url),null===(r=t.ctx)||void 0===r||r.logger.info("play "+this.url+" from "+this._startPos+" by slide, current is "+this.currentTime),null===(n=t.audioEffector)||void 0===n||n.playEffect(this.soundIndex,this.url,0,1,0,this._volume,!1,Math.max(this._currentTime,this._startPos))},t.prototype.pause=function(){var e,r;null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" pause by slide"),null===(r=t.audioEffector)||void 0===r||r.pauseEffect(this.soundIndex)},t.prototype.destroy=function(){var e,r,n,i,o,a,s,u;this._startPos=0,window.clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" destroy by slide"),null===(r=t.audioEffector)||void 0===r||r.stopEffect(this.soundIndex),null===(n=t.audioEffector)||void 0===n||n.unloadEffect(this.soundIndex),null===(i=t.audioEffector)||void 0===i||i.removeListener("play",this.onEffectPlay),null===(o=t.audioEffector)||void 0===o||o.removeListener("pause",this.onEffectPause),null===(a=t.audioEffector)||void 0===a||a.removeListener("effectFinished",this.onEffectFinished),null===(s=t.audioEffector)||void 0===s||s.removeListener("error",this.onEffectStop),null===(u=t.audioEffector)||void 0===u||u.removeListener("duration",this.onDurationBack)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._currentTime/1e3},set:function(e){var r;this._currentTime=1e3*e,null===(r=t.audioEffector)||void 0===r||r.setEffectPosition(this.soundIndex,1e3*e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this._isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),t.prototype.volume=function(e){var r;null===(r=t.audioEffector)||void 0===r||r.setEffectsVolume(100*e)},t.audioEffector=null,t.ctx=null,t.soundIndex=0,t}(i.EventEmitter),s=function(){function e(e){this.hookPoint="Slide.initConfig",this.rtc=e}return e.prototype.after=function(e){return e},e.prototype.before=function(e){var t=e[0];return a.audioEffector=this.rtc,t.rtcAudio=a,[t]},e.prototype.context=function(e){a.ctx=e},e}();t.EffectPlugin=s},29181:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MixingPlugin=void 0;var n,i=r(26913),o=r(5495),a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});var s=function(e){function t(r){var n=e.call(this)||this;return n.isStartPlaying=!1,n.isAudioPlaying=!1,n._volume=50,n.commandCaches=[],n.onError=function(e){var r;null===(r=t.ctx)||void 0===r||r.logger.error("audio error: "+e)},n.onAudioStalled=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.warn(n.url+" Failed to fetch data, but trying.")},n.onMetaLoaded=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.info(n.url+" load"),n.emit("load")},n.onAudioPlay=function(){var e,r,i,o;null===(e=t.ctx)||void 0===e||e.logger.info(n.url+" audio play"),null===(r=t.audioMixer)||void 0===r||r.startAudioMixing(n.url,!1,!1,1,(i=function(e,r){var i,o,a;n.isAudioPlaying=!0,n.isStartPlaying=!1,n.emit("play");var s=n.audio.seek();null===(i=t.audioMixer)||void 0===i||i.setAudioMixingPosition(Math.round(1e3*s)),(null===(o=t.audioMixer)||void 0===o?void 0:o.adjustAudioMixingVolume)&&(null===(a=t.audioMixer)||void 0===a||a.adjustAudioMixingVolume(n._volume)),n.commandCaches.forEach((function(e){return e()})),n.commandCaches=[]},o=0,function(){for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:R.kind;return e=function(e){s(r,e);var t=l(r);function r(){return _(this,r),t.apply(this,arguments)}return r}(R),e.kind=t,e},t.SyncedStorePlugin=t.SyncedStore=t.Storage=t.STORAGE_NS=t.MAIN_STORAGE=void 0;var n=r(71895),i=r(73549),o=r(63266),a=r(5094);function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d(e);if(t){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function c(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){p(o,n,i,a,s,"next",e)}function s(e){p(o,n,i,a,s,"throw",e)}a(void 0)}))}}function g(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:(0,i.genUID)();return w(t={},E,1),w(t,"k",r),w(t,"v",e),t}(e,this.genKey()),this.refMap.set(e,t)),this.refKeys.add(t.k),t}},{key:"deleteRefKey",value:function(e){var t=this.state[e],r=this.refMap.get(t);return r&&this.refKeys.delete(r.k),t}}]),e}(),I="_WM-StOrAgE_";t.STORAGE_NS=I;var C="_WM-MaIn-StOrAgE_";t.MAIN_STORAGE=C;var P=function(){function e(t){var r=this,a=t.plugin$,s=t.isWritable$,u=t.namespace,l=void 0===u?C:u,c=t.defaultState,h=void 0===c?{}:c;if(_(this,e),this._sideEffect=new i.SideEffectManager,this._events=new o.Remitter,this._disconnected=!1,h&&!T(h))throw new Error("Default state for Storage ".concat(l," is not an object."));this.on=this._events.on.bind(this._events),this.off=this._events.off.bind(this._events);var d=function(){var e,t;return null==(t=null==(e=a.value)?void 0:e.attributes[I])?void 0:t[l]};this.namespace=l,this.defaultState=h,this._plugin$=a,this._isWritable$=s,this._refine=new A((0,n.toJS)(d()),h);var f=function(e){e&&r._events.emit("stateChanged",e)},p=function(){var e,t=(0,n.reaction)(d,(function(){var t=d();t&&(f(r._refine.replaceState((0,n.toJS)(t))),null==e||e(),e=function(e){var t=function(e){if(!(e.length<=0)){for(var t={},i=!1,o=0;o0&&r._sideEffect.addDisposer(t,"plugin-init")})))}return x(e,[{key:"setState",value:function(e){var t=this._requireAccess("setState");if(!this.isWritable)throw new Error('Cannot setState on Storage "'.concat(this.namespace,'" without writable access'));for(var r=k(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?function(){return e.forEach(h)}:e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach(h),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}}]),e}();t.SideEffectManager=d;var f=function(){function e(){i(this,e),this.finished=Promise.resolve(),this.disposers=new Map,this._nextTask=new Map,this._isRunning=new Set}var t,r;return a(e,[{key:"add",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this._isRunning.has(r)?this._nextTask.set(r,(function(){return t._add(e,r)})):this._add(e,r),r}},{key:"_add",value:(r=n(regeneratorRuntime.mark((function e(t,r){var i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._startTask(r),!(i=this.remove(r))){e.next=11;break}return e.prev=3,e.next=6,i();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:return e.prev=11,e.next=14,t();case 14:(o=e.sent)&&this.disposers.set(r,Array.isArray(o)?n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(o.map(h)));case 1:case"end":return e.stop()}}),e)}))):o),e.next=21;break;case 18:e.prev=18,e.t1=e.catch(11),console.error(e.t1);case 21:this._endTask(r),(a=this._nextTask.get(r))&&(this._nextTask.delete(r),a());case 24:case"end":return e.stop()}}),e,this,[[3,8],[11,18]])}))),function(e,t){return r.apply(this,arguments)})},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.add((function(){return e}),t)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this;this._isRunning.has(e)?this._nextTask.set(e,(function(){return t._flush(e)})):this._flush(e)}},{key:"_flush",value:(t=n(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.remove(t))){e.next=12;break}return this._startTask(t),e.prev=3,e.next=6,r();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:this._endTask(t);case 12:(n=this._nextTask.get(t))&&(this._nextTask.delete(t),n());case 14:case"end":return e.stop()}}),e,this,[[3,8]])}))),function(e){return t.apply(this,arguments)})},{key:"flushAll",value:function(){var e=this;this.disposers.forEach((function(t,r){return e.flush(r)}))}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}},{key:"_startTask",value:function(e){var t=this;this._isRunning.add(e),this._resolveFinished||(this.finished=new Promise((function(e){t._resolveFinished=e})))}},{key:"_endTask",value:function(e){this._isRunning.delete(e),this._resolveFinished&&this._isRunning.size<=0&&this._nextTask.size<=0&&(this._resolveFinished(),this._resolveFinished=void 0)}}]),e}();t.AsyncSideEffectManager=f},59849:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.videoJsPlugin=t.Version=t.PluginId=void 0;var n,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==w(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r(17328)),o=(n=r(30825))&&n.__esModule?n:{default:n},a=r(71895);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){u(o,n,i,a,s,"next",e)}function s(e){u(o,n,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r=t||r<0||h&&e-l>=o}function g(){var e=re();if(v(e))return m(e);s=setTimeout(g,function(e){var r=t-(e-u);return h?ie(r,o-(e-l)):r}(e))}function m(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=re(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(g,t),f(u)}return void 0===s&&(s=setTimeout(g,t)),a}return t=te(t)||0,Q(r)&&(c=!!r.leading,o=(h="maxWait"in r)?ne(te(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:m(re())},y};function ae(e){var t=document.createElement("style"),r=document.createTextNode(e);t.appendChild(r),document.head.appendChild(t)}ae(".vjs-p .player-controller{position:absolute;z-index:100;bottom:0px;left:0;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;height:64px;background-image:linear-gradient(0deg,#000,transparent);transition:opacity .2s}.vjs-p .player-menu-box{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-bottom:40px}.vjs-p .player-menu-cell{width:100%;text-align:center;font-size:12px;color:#7a7b7c}.vjs-p .player-multiple-play{width:64px;height:120px}.vjs-p .player-controller-actions-left{display:flex;justify-content:center;align-items:center;flex-shrink:0}.vjs-p .player-right-box{font-size:14px;color:#7a7b7c;cursor:pointer;margin-right:12px}.vjs-p .player-controller-actions{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-left:8px;padding-right:8px;margin-top:2px}.vjs-p .player-mid-box-time{font-size:9px;display:flex;justify-content:center;align-items:center;color:#fff;flex-shrink:0;margin-right:8px;font-family:monospace}.vjs-p .player-controller-play{display:flex;align-items:center;justify-content:center;cursor:pointer;padding-right:4px}.vjs-p .player-controller-progress{width:calc(100% - 28px);margin-left:14px;display:flex;align-items:center;justify-content:center;margin-top:8px}.vjs-p .player-volume{display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:16px;margin-left:16px}.vjs-p .player-volume-slider{width:60px;margin-right:12px;display:flex;align-items:center}.vjs-p .player-volume-box{display:flex;flex-direction:row}\n");ae(".vjs-p .seek-slider{position:relative;width:100%}.vjs-p .seek-slider:focus{outline:none}.vjs-p .seek-slider .track{padding:10px 0;cursor:pointer;outline:none}.vjs-p .seek-slider .track:focus{border:0;outline:none}.vjs-p .seek-slider .track .main{width:100%;height:3px;background-color:#ffffff4d;border-radius:30px;position:absolute;left:0;top:8.5px;transition:transform .4s;outline:none}.vjs-p .seek-slider .track .main:focus{border:0;outline:none}.vjs-p .seek-slider .track .main .buffered{position:absolute;background-color:#ffffff4d;width:100%;height:100%;transform:scaleX(.8);z-index:2;transform-origin:0 0}.vjs-p .seek-slider .track .main .seek-hover{position:absolute;background-color:#ffffff80;width:100%;height:100%;z-index:1;transform:scaleX(.6);transform-origin:0 0;opacity:0;transition:opacity .4s}.vjs-p .seek-slider .track .main .connect{position:absolute;background-color:#fff;width:100%;height:100%;z-index:3;left:0;transform:scaleX(.13);transform-origin:0 0}.vjs-p .seek-slider .track.active .main{transform:scaleY(2)}.vjs-p .seek-slider .thumb{pointer-events:none;position:absolute;width:12px;height:12px;left:-6px;top:4px;z-index:4;transform:translate(100px)}.vjs-p .seek-slider .thumb .handler{border-radius:100%;width:100%;height:100%;background-color:#fff;opacity:0;transform:scale(.4);cursor:pointer;transition:transform .2s;pointer-events:none}.vjs-p .seek-slider .thumb.active .handler{opacity:1;transform:scale(1)}.vjs-p .seek-slider .hover-time{position:absolute;background-color:#0000004d;line-height:18px;font-size:16px;color:#ddd;top:-25px;left:0;padding:5px 10px;border-radius:5px;box-shadow:0 0 5px #0000004d;opacity:0;transform:translate(150px);pointer-events:none}.vjs-p .seek-slider .hover-time.active{opacity:1}.vjs-p .seek-slider:hover .track .main .seek-hover{opacity:1}\n");var se=function(e){f(r,e);var t=v(r);function r(e){var n;return c(this,r),n=t.call(this,e),T(m(n),"seeking",!1),T(m(n),"mobileSeeking",!1),T(m(n),"track",null),T(m(n),"hoverTime",null),T(m(n),"offset",0),T(m(n),"secondsPrefix","00:00:"),T(m(n),"minutesPrefix","00:"),T(m(n),"seekPause",!1),T(m(n),"handleTouchSeeking",(function(e){for(var t=0,r=0;rthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),r=e%3600,n=Math.floor(r/60),i=Math.ceil(r%60);return{hh:t.toString(),mm:n<10?"0"+n:n.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),r=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+r.ss:this.props.total+this.offset<3600?this.minutesPrefix+r.mm+":"+r.ss:r.hh+":"+r.mm+":"+r.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:i.default.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return i.default.createElement("div",{className:"seek-slider"},i.default.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},i.default.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),r}(i.Component),ue=function(e){f(r,e);var t=v(r);function r(e){var n;return c(this,r),n=t.call(this,e),T(m(n),"stageVolume",0),T(m(n),"updateVolumeTimer",0),T(m(n),"onVolumeSeeking",!1),T(m(n),"onClickOperationButton",(function(){n.props.paused?n.props.play():n.props.pause()})),T(m(n),"operationButton",(function(){return n.props.paused?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxwYXRoIGQ9Im03LjUxNCA1LjkwOSA3LjA1NyA0LjIzNGExIDEgMCAwIDEgMCAxLjcxNGwtNy4wNTcgNC4yMzRBMSAxIDAgMCAxIDYgMTUuMjM0VjYuNzY2YTEgMSAwIDAgMSAxLjUxNC0uODU3eiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxyZWN0IHg9IjciIHk9IjYiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIvPjxyZWN0IHg9IjEzIiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSIxMCIgcng9IjEiLz48L2c+PC9zdmc+"})})),T(m(n),"operationVolumeButton",(function(){return n.props.volume>.9?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGQ9Ik0xNC45MDYgNy40MTJhLjU3Ni41NzYgMCAwIDAgMCAuODk4IDQuMDcyIDQuMDcyIDAgMCAxIDAgNi40MTIuNTc2LjU3NiAwIDAgMCAwIC44OTYuODAzLjgwMyAwIDAgMCAxLjA3NiAwIDUuMjIzIDUuMjIzIDAgMCAwLS4wMDMtOC4yMDhoLjAwM2EuODA0LjgwNCAwIDAgMC0xLjA3Ni4wMDJ6Ii8+PHBhdGggZmlsbC1vcGFjaXR5PSIuMDEiIGQ9Ik0wIDBoMjJ2MjJIMHoiLz48L2c+PC9zdmc+"}):0===n.props.volume?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXoiLz48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGZpbGwtb3BhY2l0eT0iLjAxIiBkPSJNMCAwaDIydjIySDB6Ii8+PC9nPjwvc3ZnPg=="})})),T(m(n),"handleClickVolume",(function(){0===n.props.volume?0!==n.stageVolume?n.props.setVolume(n.stageVolume):n.props.setVolume(1):(n.stageVolume=n.props.volume,n.props.setVolume(0))})),T(m(n),"onChange",(function(e){n.setState({currentTime:e}),e&&n.changeTime(e)})),T(m(n),"changeTime",oe((function(e){n.props.setCurrentTime(e)}),50)),T(m(n),"onVolumeChange",(function(e){n.changeVolume(e),n.setState({seekVolume:e/100})})),T(m(n),"changeVolume",oe((function(e){n.props.setVolume(e/100)}),50)),T(m(n),"onVolumeSeekStart",(function(){n.onVolumeSeeking=!0})),T(m(n),"onVolumeSeekEnd",oe((function(){n.onVolumeSeeking=!1}),500)),T(m(n),"onProgressSeekStart",(function(){return n.setState({isPlayerSeeking:!0})})),T(m(n),"onProgressSeekEnd",oe((function(){n.setState({isPlayerSeeking:!1})}),500)),n.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},n.stageVolume=e.volume,n}return d(r,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,r=t.duration,n=t.currentTime;return i.default.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},i.default.createElement("div",{className:"player-controller-progress"},i.default.createElement(se,{total:r,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),i.default.createElement("div",{className:"player-controller-actions"},i.default.createElement("div",{className:"player-controller-actions-left"},i.default.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),i.default.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},i.default.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),i.default.createElement("div",{className:"player-volume-slider"},i.default.createElement(se,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),i.default.createElement("div",{className:"player-mid-box-time"},le(Math.floor(n/1e3))," /"," ",le(Math.floor(r/1e3)))))}}]),r}(i.Component);function le(e){var t=e%60,r=(e-t)/60;if(r>=60){var n=r%60;return"".concat(ce((r-n)/60),":").concat(ce(n),":").concat(ce(t))}return"".concat(ce(r),":").concat(ce(t))}function ce(e){return e<=9?"0".concat(e):"".concat(e)}function he(e){var t=e.scale,r=void 0===t?1:t,n=e.size,o=e.children;return i.default.createElement("div",{style:{width:n.width/r,height:n.height/r,transform:"scale(".concat(r,")"),transformOrigin:"top left",display:"flex",overflow:"hidden"}},o)}ae('.vjs-p{display:flex;flex-grow:1;position:relative}.vjs-p *{pointer-events:auto}.vjs-p.disabled *{pointer-events:none}.vjs-p .videojs-plugin-close-icon,.vjs-p .player-controller,.vjs-p .videojs-plugin-muted-alert{pointer-events:auto}.vjs-p.disabled .videojs-plugin-close-icon,.vjs-p.disabled .player-controller{pointer-events:none}.vjs-p .video-js-plugin-header{position:absolute;z-index:100;top:-.5px;height:30px;width:100%;display:flex;background:linear-gradient(rgba(0,0,0,.85),rgba(0,0,0,.45) 40%,rgba(0,0,0,0));transition:opacity .2s;user-select:none}.vjs-p .video-js-plugin-title{padding:10px;font-size:14px;color:#fff}.vjs-p .video-js-plugin-player{position:absolute;top:0;left:0;right:0;bottom:0}.video-js,[data-vjs-player]{width:100%;height:100%}.vjs-p .videojs-plugin-close-icon.disabled{display:none}.vjs-p .videojs-plugin-close-icon{pointer-events:auto;z-index:42;color:#fff;position:absolute;top:0;right:0;width:32px;height:32px;font-size:20px;display:flex;align-items:center;justify-content:center}.vjs-p .videojs-plugin-muted-alert{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43}.vjs-p .videojs-plugin-muted-alert:before{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43;content:"";background:rgba(0,0,0,.3);font-family:VideoJS;font-size:2em;display:flex;align-items:center;justify-content:center;color:#fff}.vjs-p .videojs-plugin-recovery-mode{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:44}.vjs-p .videojs-plugin-recovery-mode button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n');var de=function(e){f(r,e);var t=v(r);function r(){return c(this,r),t.apply(this,arguments)}return d(r,[{key:"render",value:function(){var e=this,t=this.props,r=t.cnode,n=t.size,o=t.scale;return i.default.createElement(a.CNode,{context:r},i.default.createElement(he,{size:n,scale:o},i.default.createElement(a.RoomConsumer,null,(function(t){return t&&i.default.createElement(fe,b({room:t},e.props))})),i.default.createElement(a.PlayerConsumer,null,(function(t){return t&&i.default.createElement(fe,b({player:t},e.props))}))))}}]),r}(i.Component),fe=function(e){f(r,e);var t=v(r);function r(e){var n;return c(this,r),n=t.call(this,e),T(m(n),"closeIcon",null),T(m(n),"alertMask",null),T(m(n),"container",i.default.createRef()),T(m(n),"player"),T(m(n),"controllerHiddenTimer",0),T(m(n),"syncPlayerTimer",0),T(m(n),"retryCount",0),T(m(n),"decreaseRetryTimer",0),T(m(n),"disposer"),T(m(n),"showController",(function(){n.setState({controllerVisible:!0}),n.debounceHidingController()})),T(m(n),"play",(function(){var e,t=null==(e=n.props.room)?void 0:e.calibrationTimestamp;n.debug(">>> play",{paused:!1,hostTime:t}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!1,hostTime:t})})),T(m(n),"pause",(function(){var e=n.getAttributes();if(e){var t=I(e,n.props);n.debug(">>> pause",{paused:!0,currentTime:t}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:t})}})),T(m(n),"setVolume",(function(e){n.debug(">>> volume",{volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e,muted:0===e})})),T(m(n),"setCurrentTime",(function(e){var t,r=null==(t=n.props.room)?void 0:t.calibrationTimestamp;n.debug(">>> seek",{currentTime:e/1e3,hostTime:r}),n.isEnabled()&&n.props.plugin.putAttributes({currentTime:e/1e3,hostTime:r})})),T(m(n),"resetPlayer",(function(){var e;null==(e=n.player)||e.autoplay(!1),n.debug(">>> ended",{paused:!0,currentTime:0}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:0})})),T(m(n),"syncPlayerWithAttributes",(function(){var e;n.props.plugin.context;var t=n.getAttributes();if(t){var r=n.player;if(r){r.paused()!==t.paused&&(n.debug("<<< paused -> %o",t.paused),t.paused?r.pause():null==(e=r.play())||e.catch(n.catchPlayFail)),r.muted()!==t.muted&&(n.debug("<<< muted -> %o",t.muted),r.muted(t.muted)),r.volume()!==t.volume&&(n.debug("<<< volume -> %o",t.volume),r.volume(t.volume));var i=I(t,n.props);i>r.duration()?n.resetPlayer():Math.abs(r.currentTime()-i)>A.currentTimeMaxError&&(n.debug("<<< currentTime -> %o",i),r.currentTime(i))}}})),T(m(n),"debounceHidingController",(function(){n.controllerHiddenTimer&&(clearTimeout(n.controllerHiddenTimer),n.controllerHiddenTimer=0),n.controllerHiddenTimer=setTimeout((function(){n.setState({controllerVisible:!1}),n.controllerHiddenTimer=0}),3e3)})),T(m(n),"decreaseRetryCount",(function(){n.player&&n.retryCount>0&&(n.retryCount=n.retryCount-1)})),T(m(n),"catchPlayFail",(function(e){var t,r,i=String(e);if(C&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=n.player)||t.autoplay("any"),n.setState({NoSound:!0});else{var o=null==(r=n.player)?void 0:r.error();o&&(n.retryCount<=3?(n.initPlayer(),n.retryCount=n.retryCount+1):(n.debug("catch videojs media error",o),n.setState({MediaError:!0}))),n.debug("catch error",e)}})),T(m(n),"fixPlayFail",(function(){n.debug("try to fix play state"),n.setState({NoSound:!1});var e=n.getAttributes(),t=e.muted,r=e.volume;n.player&&(n.player.muted(t),n.player.volume(r))})),T(m(n),"initPlayer",l(regeneratorRuntime.mark((function e(){var t,r,i,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=n.player)||t.dispose(),n.player=void 0,n.debug("creating elements ..."),r=n.getAttributes(),i=r.type,a=r.src,s=r.poster,(u=document.createElement("div")).setAttribute("data-vjs-player",""),(l=document.createElement("video")).className="video-js",s&&(l.poster=s),l.setAttribute("playsInline",""),l.setAttribute("webkit-playsinline",""),c=document.createElement("source"),new URL(a).pathname.endsWith(".m3u8")?c.type="application/x-mpegURL":l.src=a,c.src=a,i&&(c.type=i),l.appendChild(c),u.appendChild(l),n.container.current.appendChild(u),e.next=20,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 20:n.debug("initializing videojs() ..."),h=(0,o.default)(l),n.player=h,h.one("loadedmetadata",n.gracefullyUpdate),h.on("ready",(function(){var e,t;null==(t=(e=A).onPlayer)||t.call(e,h),h.on("timeupdate",n.gracefullyUpdate),h.on("volumechange",n.gracefullyUpdate),h.on("seeked",n.gracefullyUpdate),h.on("play",n.gracefullyUpdate),h.on("pause",n.gracefullyUpdate),h.on("ended",n.resetPlayer)})),h.on("error",n.catchPlayFail),n.setState({MediaError:!1});case 27:case"end":return e.stop()}}),e)})))),T(m(n),"gracefullyUpdate",(function(){return n.setState({updater:!n.state.updater})})),T(m(n),"setupClose",(function(e){e&&(e.addEventListener("touchstart",n.removeSelf),e.addEventListener("click",n.removeSelf)),n.closeIcon=e})),T(m(n),"setupAlert",(function(e){e&&(e.addEventListener("touchstart",n.fixPlayFail),e.addEventListener("click",n.fixPlayFail)),n.alertMask=e})),T(m(n),"setupReload",(function(e){e&&(e.addEventListener("touchstart",n.initPlayer),e.addEventListener("click",n.initPlayer))})),T(m(n),"removeSelf",(function(){return n.props.plugin.remove()})),n.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/video-js-plugin@".concat(M," requires white-web-sdk@^2.13.8 to work properly."))}(e.room),n}return d(r,[{key:"getAttributes",value:function(){var e,t=this.props.plugin.attributes;if(t){var r=[a.PlayerPhase.Pause,a.PlayerPhase.Ended,a.PlayerPhase.Stopped];if(!t.paused&&r.includes(null==(e=this.props.player)?void 0:e.phase)){var n=I(t,this.props);t=b(b({},t),{},{currentTime:n,paused:!0})}return t}}},{key:"render",value:function(){var e,t,r,n;if(!this.props.room&&!this.props.player)return null;var o=this.getAttributes();if(!o)return null;var a=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),s=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return i.default.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},i.default.createElement("div",{className:"video-js-plugin-player",ref:this.container}),i.default.createElement("div",{className:"video-js-plugin-header"},o.title&&i.default.createElement("div",{className:"video-js-plugin-title"},o.title),(null==(r=o.close)||r)&&i.default.createElement("div",{className:"videojs-plugin-close-icon",ref:this.setupClose},"×")),i.default.createElement(ue,{duration:a,volume:o.volume,setVolume:this.setVolume,paused:o.paused,play:this.play,pause:this.pause,currentTime:1e3*I(o,this.props),setCurrentTime:this.setCurrentTime,buffered:a*s,scale:this.props.scale,visible:!0}),!(null==(n=this.props.plugin.context)?void 0:n.hideMuteAlert)&&this.state.NoSound&&i.default.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&i.default.createElement("div",{className:"videojs-plugin-recovery-mode"},i.default.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){var t;if(null==(t=this.props.plugin.context)?void 0:t.verbose){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i @@ -292,9 +292,9 @@ function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterat * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -t.videoJsPlugin=function(e){var t;return e&&(t=e,I=b(b({},E),t)),{kind:k,render:de,defaultAttributes:{src:"",poster:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1,close:!0}}}},14976:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]&&arguments[2];r?this.asyncMethods.set(e,t):this.methods.set(e,t)}},{key:"registerAsyn",value:function(e,t){this.asyncMethods.set(e,t)}},{key:"recv",value:function(e){if("string"==typeof e){var t=(0,o.parseBridgeMessage)(e),r=t.type,n=t.actionId,i=t.method,a=t.payload;switch(this.verbose&&console.log({type:r,actionId:n,method:i,payload:a}),r){case o.BridgeEventType.req:var s={data:void 0,actionId:n,complete:!0},u=function(e,t){try{s.data=e.apply(t,a);var r=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeSuccess,s);window.ReactNativeWebView.postMessage(r)}catch(e){var i=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeError,e);window.ReactNativeWebView.postMessage(i)}},l=function(e,t){a.push((function(e,t){s.data=e,s.complete=!1!==t;var r="",i=!1;if("string"==typeof e)try{var a=JSON.parse(e);i=!(!a.error&&!a.__error)}catch(e){}else i=!(!e||!e.error&&!e.__error);r=i?(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeError,s.data):(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeSuccess,s),window.ReactNativeWebView.postMessage(r)}));try{e.apply(t,a)}catch(e){var r=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeError,e);window.ReactNativeWebView.postMessage(r)}},c=this.methods.get(i),h=this.asyncMethods.get(i);if(c)u(c,this.methods);else if(h)l(h,this.asyncMethods);else{var d=i.split(".");if(d.length<2)return;var f=d.pop(),p=d.join("."),v=this.methods.get(p);if(v){var g=v[f];if(g&&"function"==typeof g)return void u(g,v)}var m=this.asyncMethods.get(p);if(m){var y=m[f];if(y&&"function"==typeof y)return void l(y,m)}console.log("method ".concat(i," not found"))}break;case o.BridgeEventType.ack:var _=a;if(this.queue.has(n)){var b=this.queue.get(n);b.ack=!0,i===o.ackTypeError?b.reject(a):(b.resolve(_.data),b.callback&&b.callback(_.data)),_.complete&&this.queue.delete(n)}}}}}],r&&n(t.prototype,r),a&&n(t,a),e}();t.Bridge=a},5419:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBridgeMessage=t.bridgeMessageTemplate=t.ackTypeError=t.ackTypeSuccess=t.BridgeEventType=void 0,function(e){e.req="req",e.evt="evt",e.ack="ack"}(t.BridgeEventType||(t.BridgeEventType={})),t.ackTypeSuccess="success",t.ackTypeError="error",t.bridgeMessageTemplate=function(e,t,r,n){return JSON.stringify({type:e,actionId:t,method:r,payload:n})},t.parseBridgeMessage=function(e){try{var t=JSON.parse(e);return{type:t.type,actionId:t.actionId,method:t.method,payload:t.payload}}catch(t){return console.log("parse bridge message ".concat(e," failed: "),t),{type:"fail",actionId:"",method:"",payload:e}}}},13324:function(e,t,r){var n=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RNBridge=t.RNCommon=void 0,t.RNCommon=o(r(5419));var a=r(5397);Object.defineProperty(t,"RNBridge",{enumerable:!0,get:function(){return a.Bridge}})},79888:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},87980:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)} -/*! For license information please see index.js.LICENSE.txt */var i;e=r.nmd(e),window,i=function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(t,r){t.exports=e},function(e,t,r){(function(e,i){r.d(t,"a",(function(){return et}));var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function a(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function l(){for(var e=[],t=0;t2&&re("box");var r=X(t);return new Me(e,q(r),r.name,!0,r.equals)},shallowBox:function(e,t){return arguments.length>2&&re("shallowBox"),te.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&re("array");var r=X(t);return new St(e,q(r),r.name)},shallowArray:function(e,t){return arguments.length>2&&re("shallowArray"),te.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&re("map");var r=X(t);return new Pt(e,q(r),r.name)},shallowMap:function(e,t){return arguments.length>2&&re("shallowMap"),te.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&re("set");var r=X(t);return new Dt(e,q(r),r.name)},object:function(e,t,r){"string"==typeof arguments[1]&&re("object");var n=X(r);return nt({},e,t,n)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&re("shallowObject"),te.object(e,{},{name:t,deep:!1})},ref:K,shallow:Z,deep:Q,struct:J},te=function e(t,r,n){if("string"==typeof arguments[1])return Q.apply(null,arguments);if(at(t))return t;var i=b(t)?e.object(t,r,n):Array.isArray(t)?e.array(t,r):T(t)?e.map(t,r):M(t)?e.set(t,r):t;if(i!==t)return i;v(!1)};function re(e){v("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ee).forEach((function(e){return te[e]=ee[e]}));var ne,ie,oe=W(!1,(function(e,t,r,n,i){var o=r.get,a=r.set,u=i[0]||{};!function(e,t,r){var n=zt(e);r.name=n.name+"."+t,r.context=e,n.values[t]=new ke(r),Object.defineProperty(e,t,function(e){return Ft[e]||(Ft[e]={configurable:Ce.computedConfigurable,enumerable:!1,get:function(){return Ut(this).read(this,e)},set:function(t){Ut(this).write(this,e,t)}})}(t))}(e,t,s({get:o,set:a},u))}));oe({equals:j.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(ne||(ne={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ie||(ie={}));var ae=function(e){this.cause=e};function se(e){return e instanceof ae}function ue(e){switch(e.dependenciesState){case ne.UP_TO_DATE:return!1;case ne.NOT_TRACKING:case ne.STALE:return!0;case ne.POSSIBLY_STALE:for(var t=ve(!0),r=fe(),n=e.observing,i=n.length,o=0;o0;Ce.computationDepth>0&&t&&v(!1),Ce.allowStateChanges||!t&&"strict"!==Ce.enforceActions||v(!1)}function ce(e,t,r){var n=ve(!0);me(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ce.runId;var i,o=Ce.trackingDerivation;if(Ce.trackingDerivation=e,!0===Ce.disableErrorBoundaries)i=t.call(r);else try{i=t.call(r)}catch(e){i=new ae(e)}return Ce.trackingDerivation=o,function(e){for(var t=e.observing,r=e.observing=e.newObserving,n=ne.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;an&&(n=s.dependenciesState);for(r.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&Ne(s,e),s.diffValue=0;for(;i--;){var s;1===(s=r[i]).diffValue&&(s.diffValue=0,Pe(s,e))}n!==ne.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}(e),e.observing.length,ge(n),i}function he(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)Ne(t[r],e);e.dependenciesState=ne.NOT_TRACKING}function de(e){var t=fe(),r=e();return pe(t),r}function fe(){var e=Ce.trackingDerivation;return Ce.trackingDerivation=null,e}function pe(e){Ce.trackingDerivation=e}function ve(e){var t=Ce.allowStateReads;return Ce.allowStateReads=e,t}function ge(e){Ce.allowStateReads=e}function me(e){if(e.dependenciesState!==ne.UP_TO_DATE){e.dependenciesState=ne.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=ne.UP_TO_DATE}}var ye=0,_e=1,be=Object.getOwnPropertyDescriptor((function(){}),"name");function xe(e,t){var r=function(){return we(e,t,this,arguments)};return r.isMobxAction=!0,r}function we(e,t,r,n){var i=function(e,t,r){var n=We()&&!!e,i=0;if(n){i=Date.now();var o=r&&r.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(Ae=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ie).version&&(Ae=!1),Ae?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ie):(setTimeout((function(){v("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ie)}();function Pe(e,t){var r=e.observers.length;r&&(e.observersIndexes[t.__mapid]=r),e.observers[r]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ne(e,t){if(1===e.observers.length)e.observers.length=0,Oe(e);else{var r=e.observers,n=e.observersIndexes,i=r.pop();if(i!==t){var o=n[t.__mapid]||0;o?n[i.__mapid]=o:delete n[i.__mapid],r[o]=i}delete n[t.__mapid]}}function Oe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ce.pendingUnobservations.push(e))}function Re(){Ce.inBatch++}function De(){if(0==--Ce.inBatch){Be();for(var e=Ce.pendingUnobservations,t=0;t0&&Oe(e),!1)}function je(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ie.BREAK){var r=[];!function e(t,r,n){r.length>=1e3?r.push("(and many more)"):(r.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,r,n+1)})))}((n=e,it(Vt(n,void 0))),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof ke?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}var n}var ze=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+p()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=ne.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+p(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ie.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ce.pendingReactions.push(this),Be())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Re(),this._isScheduled=!1,ue(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&We()&&Ge({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}De()}},e.prototype.track=function(e){Re();var t,r=We();r&&(t=Date.now(),Ve({name:this.name,type:"reaction"})),this._isRunning=!0;var n=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&he(this),se(n)&&this.reportExceptionInDerivation(n.cause),r&&Ye({time:Date.now()-t}),De()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ce.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ce.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),We()&&Ge({type:"error",name:this.name,message:r,error:""+e}),Ce.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Re(),he(this),De()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ce.isRunningReactions||function(e){e()}(Fe)}function Fe(){Ce.isRunningReactions=!0;for(var e=Ce.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n",e):2===arguments.length&&"function"==typeof t?xe(e,t):1===arguments.length&&"string"==typeof e?Xe(e):!0!==n?Xe(t).apply(null,arguments):void(e[t]=xe(e.name||t,r.value))};function Ze(e,t,r){x(e,t,xe(t,r.bind(e)))}Qe.bound=function(e,t,r,n){return!0===n?(Ze(e,t,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return Ze(this,t,r.value||r.initializer.call(this)),this[t]},set:$e}:{enumerable:!1,configurable:!0,set:function(e){Ze(this,t,e)},get:function(){}}};var Ke=function(e){return e()};function Je(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Ke}function et(e,t,r){void 0===r&&(r=h),"boolean"==typeof r&&(r={fireImmediately:r});var n,i,o,a=r.name||"Reaction@"+p(),s=Qe(a,r.onError?(n=r.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){n.call(this,e)}}):t),u=!r.scheduler&&!r.delay,l=Je(r),c=!0,d=!1,f=r.compareStructural?j.structural:r.equals||j.default,v=new ze(a,(function(){c||u?g():d||(d=!0,l(g))}),r.onError,r.requiresObservable);function g(){if(d=!1,!v.isDisposed){var t=!1;v.track((function(){var r=e(v);t=c||!f(o,r),o=r})),c&&r.fireImmediately&&s(o,v),c||!0!==t||s(o,v),c&&(c=!1)}}return v.schedule(),v.getDisposer()}function tt(e,t,r){return rt("onBecomeUnobserved",e,t,r)}function rt(e,t,r,n){var i="function"==typeof n?Vt(t,r):Vt(t),o="function"==typeof n?n:r,a=i[e];return"function"!=typeof a?v(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function nt(e,t,r,n){var i=(n=X(n)).defaultDecorator||(!1===n.deep?K:Q);U(e),zt(e,n.name,i.enhancer),Re();try{for(var o in t){var a=Object.getOwnPropertyDescriptor(t,o),s=(r&&o in r?r[o]:a.get?oe:i)(e,o,a,!0);s&&Object.defineProperty(e,o,s)}}finally{De()}return e}function it(e){var t,r,n={name:e.name};return e.observing&&e.observing.length>0&&(n.dependencies=(t=e.observing,r=[],t.forEach((function(e){-1===r.indexOf(e)&&r.push(e)})),r).map(it)),n}function ot(e,t){if(null==e)return!1;if(void 0!==t){if(Gt(e)){var r=e.$mobx;return r.values&&!!r.values[t]}return!1}return Gt(e)||!!e.$mobx||D(e)||Ue(e)||Ee(e)}function at(e){return 1!==arguments.length&&v(!1),ot(e)}function st(e){switch(e.length){case 0:return Ce.trackingDerivation;case 1:return Vt(e[0]);case 2:return Vt(e[0],e[1])}}function ut(e,t){void 0===t&&(t=void 0),Re();try{return e.apply(t)}finally{De()}}function lt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function ct(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),m((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function ht(e,t){var r=fe();try{var n=e.interceptors;if(n)for(var i=0,o=n.length;i0}function ft(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),m((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function pt(e,t){var r=fe(),n=e.changeListeners;if(n){for(var i=0,o=(n=n.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return ct(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ft(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n0&&e+t+1>bt&&Et(e+t+1)},e.prototype.spliceWithArray=function(e,t,r){var n=this;le(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===r&&(r=c),lt(this)){var o=ht(this,{object:this.array,type:"splice",index:e,removedCount:t,added:r});if(!o)return c;t=o.removedCount,r=o.added}var a=(r=0===r.length?r:r.map((function(e){return n.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<1e4)return(n=this.values).splice.apply(n,l([e,t],r));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&We(),i=dt(this),o=i||n?{object:this.array,type:"update",index:e,newValue:t,oldValue:r}:null;n&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),n&&Ye()},e.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&We(),i=dt(this),o=i||n?{object:this.array,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;n&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),n&&Ye()},e}(),St=function(e){function t(t,r,n,i){void 0===n&&(n="ObservableArray@"+p()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new wt(n,r,o,i);if(w(o,"$mobx",a),t&&t.length){var s=Se(!0);o.spliceWithArray(0,0,t),Te(s)}return _t&&Object.defineProperty(a.array,"0",Tt),o}return a(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function r(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(r.call(this,e),r.call(this,t),e!==t){var n,i=this.$mobx.values;n=e1)for(var r=1;r=2&&(this.player.currentTime=e)},e}(),d=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},p=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(r.lastSyncProgressTimestamp=n,r.selfUserInf&&r.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:r.playerState}))},r.handleSeekReaction=function(e,t){r.isHost()||r.player.current&&void 0!==t&&(r.player.current.currentTime=e+Date.now()/1e3-t)},r.handleRemove=function(){return f(r,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},r.timeUpdate=function(){if(r.player.current){var e=r.player.current.currentTime;r.onTimeUpdate(e)}},r.detectAudioClickEnable=function(){var e=r.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},r.renderMuteBox=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&r.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){r.setState({selfMute:!1})},onTouchStart:function(){r.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},r.renderDeleteBtn=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:r.handleRemove},o.createElement("img",{src:c,alt:"delete_icon"})):null},r.renderNavigation=function(){return!0===r.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-audio-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"audio_plugin"}),o.createElement("span",null,"Audio Player")),r.renderDeleteBtn())},r.handleFirstSeek=function(e){if(!e){var t,n=r.props.plugin,i=Date.now()/1e3;t=n.attributes.seekTime?n.attributes.seek+i-n.attributes.seekTime:n.attributes.seek,r.syncNode.syncProgress(t)}},r.player=o.createRef(),r.reactionPlayDisposer=r.startPlayReaction(),r.reactionSeekDisposer=r.startSeekReaction(),r.reactionVolumeDisposer=r.startVolumeReaction(),r.reactionMuteDisposer=r.startMuteTimeReaction(),r.reactionSeekTimeDisposer=r.startSeekTimeReaction(),r.reactionSyncDisposer=r.startSyncReaction(),r.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},r}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(r){e.handleSeekReaction(t.attributes.seek,r)}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(r){e.handleSeekReaction(r,t.attributes.seekTime)}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this,t=this.props,r=t.size,n=t.plugin,a=t.scale,s=0===a?1:a,u=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);return o.createElement("div",{className:"plugin-audio-box",style:{width:r.width/s,height:r.height/s,transform:"scale("+s+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-audio-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-audio-box"},o.createElement("audio",{className:"white-plugin-audio",src:n.attributes.pluginAudioUrl,ref:this.player,muted:this.state.mute?this.state.mute:this.state.selfMute,style:{width:"100%",height:54,pointerEvents:this.detectAudioClickEnable(),outline:"none"},onLoadedMetadataCapture:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return u?[4,v(300)]:[3,2];case 1:e.sent(),this.handleFirstSeek(this.state.isEnd),e.label=2;case 2:return[2]}}))}))},onEnded:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(n.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return e.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:e.sent(),this.player.current.load(),e.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:e.sent(),this.player.current.load(),e.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"auto"}))))},t}(o.Component),_=(m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),b=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},x=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-audio-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-audio-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-audio-plugin-nav-delete > img {\n width: 14px;\n}\n.white-audio-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-audio-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n}\n.white-audio-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,r){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(r=a,n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+n),f=l+(d-c)/1e3,Math.abs(r.currentTime-f)>2&&(r.currentTime=f)),this.changedMap.changed("rate",i)&&(r.playbackRate=i),[2]}}))}))}));this.disposers.push(n),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,r=e.scale||1;return{width:t.width/r,height:t.height/r,transform:"scale("+r+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,r=e.player,n=e.plugin;return t||r?i.a.createElement("div",{className:"white-audio-plugin-container",style:this.containerStyle},!n.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-audio-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"audio_plugin"}),i.a.createElement("span",{className:"white-audio-plugin-nav-title"},"Audio Player"),i.a.createElement("span",{className:"white-audio-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-audio-plugin-body"},i.a.createElement("audio",{src:n.attributes.src,style:this.pointerEventsStyle,controls:!!t,controlsList:"nodownload nofullscreen",preload:"auto",ref:this.player}))):null},t}(n.Component);r.d(t,"audioPlugin2",(function(){return x}));var x=Object.freeze({kind:"audio2",render:_,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==n(t)&&"object"==n(e)?e.exports=i(r(17328),r(71895)):r.amdD([,],i)},52056:function(e,t){function r(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}),t.prepare=function(e,t){return a.apply(this,arguments)};var i=["api.whiteboard.sd-rtn.com","api.baiban.shengwang.cn","api.whiteboard.rtelink.com","api.netless.link","api.whiteboard.agora.io"],o=function(e){var t=new Array(e.length),r=0;return new Promise((function(n,i){e.forEach((function(o,a){Promise.resolve(o).then(n).catch((function(n){t[a]=n,(r+=1)===e.length&&i(t)}))}))}))};function a(){return a=n(regeneratorRuntime.mark((function e(t,r){var n,a,s,u,l,c,h,d,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>2&&void 0!==f[2]?f[2]:432e5,e.prev=1,a={},s=null,window.AbortController&&(s=new window.AbortController,a.signal=s.signal),e.next=7,o(i.map((function(e){return new Promise((function(r,n){fetch("https://".concat(e,"/v5/configs/regions?app=").concat(encodeURIComponent(t)),a).then((function(e){e.ok?e.json().then(r,n):n(new Error("fetch failed"))}),(function(){n(new Error("fetch failed"))}))}))})));case 7:return u=e.sent,s&&s.abort(),l={method:"head"},c=u.configmap.realtime.hosts[r],h=null,window.AbortController&&(h=new window.AbortController,l.signal=h.signal),e.next=15,o(c.map((function(e){return new Promise((function(t,r){fetch("https://".concat(e,"/ping"),l).then((function(n){n.ok?t(e):r(new Error("fetch failed"))}),(function(){return r(new Error("fetch failed"))}))}))})));case 15:d=e.sent,h&&h.abort(),localStorage.setItem("white-prefer-gateway",JSON.stringify({host:d,region:r,expire:Date.now()+n})),e.next=22;break;case 20:e.prev=20,e.t0=e.catch(1);case 22:case"end":return e.stop()}}),e,null,[[1,20]])}))),a.apply(this,arguments)}},44112:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)} -/*! For license information please see index.js.LICENSE.txt */var i;e=r.nmd(e),window,i=function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(t,r){t.exports=e},function(e,t,r){(function(e,i){r.d(t,"a",(function(){return rt}));var o=[];Object.freeze(o);var a={};Object.freeze(a);var s={};function u(){return"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:s}function l(){return++Ne.mobxGuid}function c(e){throw h(!1,e),"X"}function h(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is an production build."))}function d(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var f=function(){};function p(e){return null!==e&&"object"==n(e)}function v(e){if(null===e||"object"!=n(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function g(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function m(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function y(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(e){return p(e)&&!0===e[r]}}function _(e){return void 0!==u().Map&&e instanceof u().Map}function b(e){return e instanceof Set}function x(e){for(var t=[];;){var r=e.next();if(r.done)break;t.push(r.value)}return t}function w(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function S(e){return null===e?null:"object"==n(e)?""+e:e}function T(e,t){for(var r=e.next();!r.done;)t(r.value),r=e.next()}function M(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function k(e,t){m(e,M(),t)}function E(e){return e[M()]=A,e}function I(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function A(){return this}var C=function(){function e(e){void 0===e&&(e="Atom@"+l()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=oe.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return ze(this)},e.prototype.reportChanged=function(){Le(),function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===oe.UP_TO_DATE&&(n.isTracing!==ae.NONE&&Be(n,e),n.onBecomeStale()),n.dependenciesState=oe.STALE}}}(this),je()},e.prototype.toString=function(){return this.name},e}(),P=y("Atom",C);function N(e,t,r){void 0===t&&(t=f),void 0===r&&(r=f);var n=new C(e);return it("onBecomeObserved",n,t,void 0),nt(n,r),n}function O(e,t){return e===t}var R={identity:O,structural:function(e,t){return qt(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||O(e,t)},shallow:function(e,t){return qt(e,t,1)}},D=function(e,t){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function L(e,t){function r(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var j=function(){return(j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function B(){for(var e=[],t=0;t2&&ie("box");var r=Q(t);return new Ee(e,Z(r),r.name,!0,r.equals)},shallowBox:function(e,t){return arguments.length>2&&ie("shallowBox"),ne.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ie("array");var r=Q(t);return new Mt(e,Z(r),r.name)},shallowArray:function(e,t){return arguments.length>2&&ie("shallowArray"),ne.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ie("map");var r=Q(t);return new Ot(e,Z(r),r.name)},shallowMap:function(e,t){return arguments.length>2&&ie("shallowMap"),ne.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ie("set");var r=Q(t);return new jt(e,Z(r),r.name)},object:function(e,t,r){"string"==typeof arguments[1]&&ie("object");var n=Q(r);return ot({},e,t,n)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ie("shallowObject"),ne.object(e,{},{name:t,deep:!1})},ref:ee,shallow:J,deep:K,struct:te},ne=function e(t,r,n){if("string"==typeof arguments[1])return K.apply(null,arguments);if(ut(t))return t;var i=v(t)?e.object(t,r,n):Array.isArray(t)?e.array(t,r):_(t)?e.map(t,r):b(t)?e.set(t,r):t;if(i!==t)return i;c(!1)};function ie(e){c("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(re).forEach((function(e){return ne[e]=re[e]}));var oe,ae,se=V(!1,(function(e,t,r,n,i){var o=r.get,a=r.set,s=i[0]||{};!function(e,t,r){var n=Ft(e);r.name=n.name+"."+t,r.context=e,n.values[t]=new Ie(r),Object.defineProperty(e,t,function(e){return Wt[e]||(Wt[e]={configurable:Ne.computedConfigurable,enumerable:!1,get:function(){return Gt(this).read(this,e)},set:function(t){Gt(this).write(this,e,t)}})}(t))}(e,t,j({get:o,set:a},s))}));se({equals:R.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(oe||(oe={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ae||(ae={}));var ue=function(e){this.cause=e};function le(e){return e instanceof ue}function ce(e){switch(e.dependenciesState){case oe.UP_TO_DATE:return!1;case oe.NOT_TRACKING:case oe.STALE:return!0;case oe.POSSIBLY_STALE:for(var t=me(!0),r=ve(),n=e.observing,i=n.length,o=0;o0;Ne.computationDepth>0&&t&&c(!1),Ne.allowStateChanges||!t&&"strict"!==Ne.enforceActions||c(!1)}function de(e,t,r){var n=me(!0);_e(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ne.runId;var i,o=Ne.trackingDerivation;if(Ne.trackingDerivation=e,!0===Ne.disableErrorBoundaries)i=t.call(r);else try{i=t.call(r)}catch(e){i=new ue(e)}return Ne.trackingDerivation=o,function(e){for(var t=e.observing,r=e.observing=e.newObserving,n=oe.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;an&&(n=s.dependenciesState);for(r.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&Re(s,e),s.diffValue=0;for(;i--;){var s;1===(s=r[i]).diffValue&&(s.diffValue=0,Oe(s,e))}n!==oe.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}(e),e.observing.length,ye(n),i}function fe(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)Re(t[r],e);e.dependenciesState=oe.NOT_TRACKING}function pe(e){var t=ve(),r=e();return ge(t),r}function ve(){var e=Ne.trackingDerivation;return Ne.trackingDerivation=null,e}function ge(e){Ne.trackingDerivation=e}function me(e){var t=Ne.allowStateReads;return Ne.allowStateReads=e,t}function ye(e){Ne.allowStateReads=e}function _e(e){if(e.dependenciesState!==oe.UP_TO_DATE){e.dependenciesState=oe.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=oe.UP_TO_DATE}}var be=0,xe=1,we=Object.getOwnPropertyDescriptor((function(){}),"name");function Se(e,t){var r=function(){return Te(e,t,this,arguments)};return r.isMobxAction=!0,r}function Te(e,t,r,n){var i=function(e,t,r){var n=Ve()&&!!e,i=0;if(n){i=Date.now();var o=r&&r.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(Pe=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ce).version&&(Pe=!1),Pe?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ce):(setTimeout((function(){c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ce)}();function Oe(e,t){var r=e.observers.length;r&&(e.observersIndexes[t.__mapid]=r),e.observers[r]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Re(e,t){if(1===e.observers.length)e.observers.length=0,De(e);else{var r=e.observers,n=e.observersIndexes,i=r.pop();if(i!==t){var o=n[t.__mapid]||0;o?n[i.__mapid]=o:delete n[i.__mapid],r[o]=i}delete n[t.__mapid]}}function De(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ne.pendingUnobservations.push(e))}function Le(){Ne.inBatch++}function je(){if(0==--Ne.inBatch){Ue();for(var e=Ne.pendingUnobservations,t=0;t0&&De(e),!1)}function Be(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ae.BREAK){var r=[];!function e(t,r,n){r.length>=1e3?r.push("(and many more)"):(r.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,r,n+1)})))}((n=e,at(Yt(n,void 0))),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Ie?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}var n}var Fe=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+l()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ae.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ne.pendingReactions.push(this),Ue())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Le(),this._isScheduled=!1,ce(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ve()&&He({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}je()}},e.prototype.track=function(e){Le();var t,r=Ve();r&&(t=Date.now(),Ye({name:this.name,type:"reaction"})),this._isRunning=!0;var n=de(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&fe(this),le(n)&&this.reportExceptionInDerivation(n.cause),r&&Xe({time:Date.now()-t}),je()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ne.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ne.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),Ve()&&He({type:"error",name:this.name,message:r,error:""+e}),Ne.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Le(),fe(this),je()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ne.isRunningReactions||function(e){e()}(We)}function We(){Ne.isRunningReactions=!0;for(var e=Ne.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n",e):2===arguments.length&&"function"==typeof t?Se(e,t):1===arguments.length&&"string"==typeof e?Qe(e):!0!==n?Qe(t).apply(null,arguments):void(e[t]=Se(e.name||t,r.value))};function Je(e,t,r){g(e,t,Se(t,r.bind(e)))}Ke.bound=function(e,t,r,n){return!0===n?(Je(e,t,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return Je(this,t,r.value||r.initializer.call(this)),this[t]},set:qe}:{enumerable:!1,configurable:!0,set:function(e){Je(this,t,e)},get:function(){}}};var et=function(e){return e()};function tt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:et}function rt(e,t,r){void 0===r&&(r=a),"boolean"==typeof r&&(r={fireImmediately:r});var n,i,o,s=r.name||"Reaction@"+l(),u=Ke(s,r.onError?(n=r.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){n.call(this,e)}}):t),c=!r.scheduler&&!r.delay,h=tt(r),d=!0,f=!1,p=r.compareStructural?R.structural:r.equals||R.default,v=new Fe(s,(function(){d||c?g():f||(f=!0,h(g))}),r.onError,r.requiresObservable);function g(){if(f=!1,!v.isDisposed){var t=!1;v.track((function(){var r=e(v);t=d||!p(o,r),o=r})),d&&r.fireImmediately&&u(o,v),d||!0!==t||u(o,v),d&&(d=!1)}}return v.schedule(),v.getDisposer()}function nt(e,t,r){return it("onBecomeUnobserved",e,t,r)}function it(e,t,r,n){var i="function"==typeof n?Yt(t,r):Yt(t),o="function"==typeof n?n:r,a=i[e];return"function"!=typeof a?c(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function ot(e,t,r,n){var i=(n=Q(n)).defaultDecorator||(!1===n.deep?ee:K);G(e),Ft(e,n.name,i.enhancer),Le();try{for(var o=Object.getOwnPropertyNames(t),a=0,s=o.length;a0&&(n.dependencies=(t=e.observing,r=[],t.forEach((function(e){-1===r.indexOf(e)&&r.push(e)})),r).map(at)),n}function st(e,t){if(null==e)return!1;if(void 0!==t){if(Ht(e)){var r=e.$mobx;return r.values&&!!r.values[t]}return!1}return Ht(e)||!!e.$mobx||P(e)||Ge(e)||Ae(e)}function ut(e){return 1!==arguments.length&&c(!1),st(e)}function lt(e){switch(e.length){case 0:return Ne.trackingDerivation;case 1:return Yt(e[0]);case 2:return Yt(e[0],e[1])}}function ct(e,t){void 0===t&&(t=void 0),Le();try{return e.apply(t)}finally{je()}}function ht(e){return void 0!==e.interceptors&&e.interceptors.length>0}function dt(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),d((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function ft(e,t){var r=ve();try{var n=e.interceptors;if(n)for(var i=0,o=n.length;i0}function vt(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),d((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function gt(e,t){var r=ve(),n=e.changeListeners;if(n){for(var i=0,o=(n=n.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return dt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),vt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n0&&e+t+1>wt&&At(e+t+1)},e.prototype.spliceWithArray=function(e,t,r){var n=this;he(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===r&&(r=o),ht(this)){var a=ft(this,{object:this.array,type:"splice",index:e,removedCount:t,added:r});if(!a)return o;t=a.removedCount,r=a.added}var s=(r=0===r.length?r:r.map((function(e){return n.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,s);var u=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<1e4)return(n=this.values).splice.apply(n,B([e,t],r));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&Ve(),i=pt(this),o=i||n?{object:this.array,type:"update",index:e,newValue:t,oldValue:r}:null;n&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&>(this,o),n&&Xe()},e.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&Ve(),i=pt(this),o=i||n?{object:this.array,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;n&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&>(this,o),n&&Xe()},e}(),Mt=function(e){function t(t,r,n,i){void 0===n&&(n="ObservableArray@"+l()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new Tt(n,r,o,i);if(m(o,"$mobx",a),t&&t.length){var s=Me(!0);o.spliceWithArray(0,0,t),ke(s)}return xt&&Object.defineProperty(a.array,"0",kt),o}return L(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function r(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(r.call(this,e),r.call(this,t),e!==t){var n,i=this.$mobx.values;n=e1)for(var r=1;r=2&&(this.player.currentTime=e)},e}(),d=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},p=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(r.lastSyncProgressTimestamp=n,r.selfUserInf&&r.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:r.playerState}))},r.handleNativePlayerState=function(e){return f(r,void 0,void 0,(function(){var t;return p(this,(function(r){switch(r.label){case 0:if(!e)return[3,7];if(!this.player.current)return[3,6];r.label=1;case 1:return r.trys.push([1,3,,6]),[4,this.player.current.play()];case 2:return r.sent(),[3,6];case 3:return""+(t=r.sent()).name!="NotAllowedError"&&""+t.name!="AbortError"?[3,5]:(this.setState({selfMute:!0}),[4,this.player.current.play()]);case 4:r.sent(),r.label=5;case 5:return[3,6];case 6:return[3,8];case 7:this.player.current&&this.player.current.pause(),r.label=8;case 8:return[2]}}))}))},r.handleSeekReaction=function(e,t){return f(r,void 0,void 0,(function(){return p(this,(function(r){return this.isHost()||this.player.current&&void 0!==t&&(this.player.current.currentTime=e+Date.now()/1e3-t),[2]}))}))},r.timeUpdate=function(){if(r.player.current){var e=r.player.current.currentTime;r.onTimeUpdate(e)}},r.detectVideoClickEnable=function(){var e=r.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},r.renderMuteBox=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&r.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){r.setState({selfMute:!1})},onTouchStart:function(){r.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},r.handleRemove=function(){return f(r,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},r.renderDeleteBtn=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:r.handleRemove},o.createElement("img",{src:c,alt:"delete"})):null},r.renderNavigation=function(){return!0===r.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-video-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"video_plugin"}),o.createElement("span",null,"Video Player")),r.renderDeleteBtn())},r.handleOnEnd=function(){return f(r,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(e.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return t.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:t.sent(),this.player.current.load(),t.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:t.sent(),this.player.current.load(),t.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},r.handleOnLoadedMetadataCapture=function(){return f(r,void 0,void 0,(function(){var e,t;return p(this,(function(r){switch(r.label){case 0:return e=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),t=this.state.isEnd,e?[4,v(300)]:[3,2];case 1:r.sent(),this.handleFirstSeek(t),r.label=2;case 2:return[2]}}))}))},r.player=o.createRef(),r.reactionSeekDisposer=r.startSeekReaction(),r.reactionSeekTimeDisposer=r.startSeekTimeReaction(),r.reactionPlayDisposer=r.startPlayReaction(),r.reactionVolumeDisposer=r.startVolumeReaction(),r.reactionMuteDisposer=r.startMuteTimeReaction(),r.reactionSyncDisposer=r.startSyncReaction(),r.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},r}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(r){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(r,t.attributes.seekTime)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(r){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(t.attributes.seek,r)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSeekTimeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this.props,t=e.size,r=e.plugin,n=e.scale,i=this.state,a=i.mute,s=i.selfMute,u=0===n?1:n;return o.createElement("div",{className:"plugin-video-box",style:{width:t.width/u,height:t.height/u,transform:"scale("+u+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-video-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-video-box"},o.createElement("video",{"webkit-playsinline":"true",playsInline:!0,poster:r.attributes.poster,className:"white-plugin-video",src:r.attributes.pluginVideoUrl,ref:this.player,muted:a||s,style:{width:"100%",height:"100%",pointerEvents:this.detectVideoClickEnable(),outline:"none"},disablePictureInPicture:!0,onLoadedMetadataCapture:this.handleOnLoadedMetadataCapture,onEnded:this.handleOnEnd,controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"metadata"}))))},t}(o.Component),y=(g=function(e,t){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},b=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-video-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-video-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-video-plugin-nav-delete > img {\n width: 14px;\n}\n.white-video-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-video-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n height: calc(100% - 32px);\n}\n.white-video-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,r){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(r=a,n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+n),f=l+(d-c)/1e3,Math.abs(r.currentTime-f)>2&&(r.currentTime=f)),this.changedMap.changed("rate",i)&&(r.playbackRate=i),[2]}}))}))}));this.disposers.push(n),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,r=e.scale||1;return{width:t.width/r,height:t.height/r,transform:"scale("+r+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,r=e.player,n=e.plugin;return t||r?i.a.createElement("div",{className:"white-video-plugin-container",style:this.containerStyle},!n.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-video-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"video_plugin"}),i.a.createElement("span",{className:"white-video-plugin-nav-title"},"Video Player"),i.a.createElement("span",{className:"white-video-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-video-plugin-body"},i.a.createElement("video",{src:n.attributes.src,style:g({maxWidth:"100%",maxHeight:"100%"},this.pointerEventsStyle),controls:!!t,controlsList:"nodownload nofullscreen",preload:"metadata",ref:this.player,playsInline:!0,"webkit-playsinline":"true",poster:n.attributes.poster,disablePictureInPicture:!0}))):null},t}(n.Component);r.d(t,"videoPlugin2",(function(){return x}));var x=Object.freeze({kind:"video2",render:_,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==n(t)&&"object"==n(e)?e.exports=i(r(17328),r(71895)):r.amdD([,],i)},18371:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.playerStateNameSpace=t.playerNameSpace=t.sdkNameSpace=t.roomStateNamespace=t.roomNamespace=t.roomSyncNamespace=t.pptNamespace=t.ScaleMode=void 0,function(e){e[e.Scale=0]="Scale",e[e.AspectFit=1]="AspectFit",e[e.AspectFitScale=2]="AspectFitScale",e[e.AspectFitSpace=3]="AspectFitSpace",e[e.AspectFill=4]="AspectFill",e[e.AspectFillScale=5]="AspectFillScale"}(t.ScaleMode||(t.ScaleMode={})),t.pptNamespace="ppt",t.roomSyncNamespace="room.sync",t.roomNamespace="room",t.roomStateNamespace="room.state",t.sdkNameSpace="sdk",t.playerNameSpace="player",t.playerStateNameSpace="player.state"},46640:function(e,t,r){var n;function i(e,t,r){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}},i(e,t,r||e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||T(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||T(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function u(e){var t=f();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l(this,r)}}function l(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?c(e):t}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,v(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)},h(e)}function d(e,t,r){return d=f()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&p(i,r.prototype),i},d.apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){g(o,n,i,a,s,"next",e)}function s(e){g(o,n,i,a,s,"throw",e)}a(void 0)}))}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function T(e,t){if(e){if("string"==typeof e)return M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(this.timer=this.initInterval())}},{key:"invoke",value:function(){var e=this;if(0!==this.list.length&&void 0===this.currentInvoker){var t=this.list.shift();t&&(this.currentInvoker=t,t().then((function(){e.invoked()})).catch((function(t){console.error("[WindowManager]: create app error: ".concat(t.message)),e.invoked()})))}}},{key:"emitReady",value:function(){this.isEmit||setTimeout((function(){oe.emit("ready")}),50),this.isEmit=!0}},{key:"empty",value:function(){this.list=[],this.clear()}},{key:"destroy",value:function(){this.timer&&this.clear()}}]),e}(),se=new $.default,ue=function(){var e=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,t){var r=indexedDB.open("__WindowManagerAppCache",2);r.onerror=function(e){t(e)},r.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains("apps")||t.createObjectStore("apps",{keyPath:"kind"}).createIndex("kind","kind",{unique:!0})},r.onsuccess=function(){var t=r.result;e(t)}}));case 2:H=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(e,t){if(H)return function(e,t){return new Promise((function(r,n){var i=e.transaction(["apps"],"readwrite").objectStore("apps").add(t);i.onsuccess=function(){return r()},i.onerror=function(){return n()}}))}(H,{kind:e,sourceCode:t})},ce=function(){var e=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!H){e.next=6;break}return e.next=3,he(H,t);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=null;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function he(e,t){return new Promise((function(r,n){var i=e.transaction(["apps"]).objectStore("apps").index("kind").get(t);i.onerror=function(e){return n(e)},i.onsuccess=function(){i.result?r(i.result):r(null)}}))}var de=function(){var e=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ce(t);case 2:if(!(r=e.sent)){e.next=5;break}return e.abrupt("return",r.sourceCode);case 5:return e.next=7,ge(t,{timeout:1e4});case 7:return e.next=9,e.sent.text();case 9:return n=e.sent,e.next=12,le(t,n);case 12:return e.abrupt("return",n);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fe=function(e,t){var r=Function(e+"\n;return ".concat(t))();return void 0===r&&(r=window[t]),r},pe=function(){var e=m(regeneratorRuntime.mark((function e(t,r,n){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n||"NetlessApp"+r,oe.emit("loadApp",{kind:r,status:"start"}),e.prev=2,e.next=5,de(t);case 5:if((o=e.sent)&&0!==o.length){e.next=8;break}throw oe.emit("loadApp",{kind:r,status:"failed",reason:"script is empty."}),new Error("[WindowManager]: script is empty.");case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(2),oe.emit("loadApp",{kind:r,status:"failed",reason:e.t0.message}),e.t0;case 13:return e.abrupt("return",ve(o,i,r));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,r,n){return e.apply(this,arguments)}}(),ve=function(e,t,r){try{var n=fe(e,t);return oe.emit("loadApp",{kind:r,status:"success"}),n}catch(n){if(n.message.includes("Can only have one anonymous define call per script file")){var i=window.define;"function"==typeof i&&i.amd&&delete i.amd;var o=fe(e,t);return oe.emit("loadApp",{kind:r,status:"success"}),o}throw oe.emit("loadApp",{kind:r,status:"failed",reason:n.message}),n}};function ge(e,t){return me.apply(this,arguments)}function me(){return me=m(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timeout,i=void 0===n?1e4:n,o=new AbortController,a=setTimeout((function(){return o.abort()}),i),e.next=6,fetch(t,R(O({},r),{signal:o.signal,headers:{"content-type":"text/plain"}}));case 6:return s=e.sent,e.abrupt("return",(clearTimeout(a),s));case 8:case"end":return e.stop()}}),e)}))),me.apply(this,arguments)}var ye=function(){function e(){var t=this;y(this,e),this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=function(e){t.register({kind:e.kind,src:e.src})}}var t,r;return b(e,[{key:"setSyncRegisterApp",value:function(e){this.syncRegisterApp=e}},{key:"register",value:(r=m(regeneratorRuntime.mark((function e(t){var r,n,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appClassesCache.delete(t.kind),this.registered.set(t.kind,t),"string"==typeof(r=t.src)&&(n=function(){var e=m(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(r,t.kind,t.name);case 2:return n=e.sent,e.abrupt("return",n.__esModule?n.default:n);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),this.syncRegisterApp&&this.syncRegisterApp({kind:t.kind,src:r,name:t.name})),"function"==typeof r&&(n=function(){var e=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",((t.__esModule||t.default)&&(t=t.default),t));case 5:throw new Error("[WindowManager]: load remote script failed, ".concat(r));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),"object"==x(r)&&(n=function(){var e=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),this.appClasses.set(t.kind,m(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.appClassesCache.get(t.kind),e.abrupt("return",(r||(r=n(),o.appClassesCache.set(t.kind,r)),r));case 2:case"end":return e.stop()}}),e)})))),t.addHooks&&(i=this.createKindEmitter(t.kind))&&t.addHooks(i);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"unregister",value:function(e){this.appClasses.delete(e),this.appClassesCache.delete(e),this.registered.delete(e);var t=this.kindEmitters.get(e);t&&(t.clearListeners(),this.kindEmitters.delete(e))}},{key:"notifyApp",value:(t=m(regeneratorRuntime.mark((function e(t,r,n){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.kindEmitters.get(t),e.next=3,null==i?void 0:i.emit(r,n);case 3:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"createKindEmitter",value:function(e){if(!this.kindEmitters.has(e)){var t=new $.default;this.kindEmitters.set(e,t)}return this.kindEmitters.get(e)}}]),e}(),_e=new ye,be=function(){var e=m(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==(r=_e.appClasses.get(t))?void 0:r();case 2:return i=e.sent,e.abrupt("return",i&&(null==(n=i.config)?void 0:n.singleton)?t:"".concat(t,"-").concat(B.v4().replace("-","").slice(0,8)));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xe=function(e,t){if(e.focusScenePath!==t)return e.focusScenePath=t,e},we=function(e,t){if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){var r="/"===t?"":t;e.setScenePath(r)}},Se=function(e,t,r){e&&e.scenePathType(t)!==z.ScenePathType.None&&e.removeScenes(t,r)};j.debounce((function(e,t){e.emit("mainViewModeChange",t)}),200);var Te=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Me(e)[t];if(n){var i=n[r];if(i){var o=i.name;return t===ne?"/".concat(o):"".concat(t,"/").concat(o)}}},Me=function(e){return e.entireScenes()},ke=function(e,t,r,n){for(var i,o=0;o1&&void 0!==arguments[1]?arguments[1]:He();return this.flush(t),this.disposers.set(t,e()),t}},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He();return this.flush(t),this.disposers.set(t,e),t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:He();return this.add((function(){return e.addEventListener(t,r,n),function(){return e.removeEventListener(t,r,n)}}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:He();return this.add((function(){var i=window.setTimeout((function(){r.remove(n),e()}),t);return function(){return window.clearTimeout(i)}}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:He();return this.add((function(){var r=window.setInterval(e,t);return function(){return window.clearInterval(r)}}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach((function(e){try{e()}catch(e){console.error(e)}})),this.disposers.clear()}}]),e}(),$e=function(e){return function(t,r){if(void 0!==t){if(z.listenUpdated){var n=function(t){t.map((function(e){return e.kind})).includes(e)&&r()};return z.listenUpdated(t,n),r(),function(){return z.unlistenUpdated(t,n)}}return z.reaction((function(){return t}),(function(){r()}),{fireImmediately:!0})}}},Xe=function(e,t,r){var n=null,i=z.reaction(e,(function(){n&&(n(),n=null);var i=e();j.isObject(i)?(n=function(){return z.unlistenUpdated(i,t)},z.listenUpdated(i,t)):null==r||r(i)}),{fireImmediately:!0});return function(){null==n||n(),i()}},qe=$e(z.UpdateEventKind.Removed);$e(z.UpdateEventKind.Inserted);var Qe=function(){function e(){y(this,e),this.listeners=new Set}return b(e,[{key:"dispatch",value:function(e){this.listeners.forEach((function(t){return t(e)}))}},{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"removeListener",value:function(e){this.listeners.delete(e)}},{key:"length",get:function(){return this.listeners.size}}]),e}(),Ze=Object.keys;function Ke(e){return Boolean(j.has(e,"__isRef"))}var Je="_WM-STORAGE_",et=function(){function e(t,r,n){var i=this;if(y(this,e),this._sideEffect=new Ye,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Qe,n&&!j.isObject(n))throw new Error("Default state for Storage ".concat(r," is not an object."));this._context=t,this.id=r||null,this._state={};var o=this._getRawState(this._state);this._context.getIsWritable()&&(null===this.id?t.isAddApp&&n&&this.setState(n):(o===this._state||!j.isObject(o))&&(j.get(this._context.getAttributes(),[Je])||this._context.updateAttributes([Je],{}),this._context.updateAttributes([Je,this.id],this._state),n&&this.setState(n))),Ze(o).forEach((function(e){if(null!==i.id||e!==Je)try{var t=j.isObject(o[e])?JSON.parse(JSON.stringify(o[e])):o[e];Ke(t)?(i._state[e]=t.v,j.isObject(t.v)&&i._refMap.set(t.v,t)):i._state[e]=t}catch(t){console.error(t)}})),this._sideEffect.addDisposer(Xe((function(){return null===i.id?t.getAttributes():j.get(t.getAttributes(),[Je,i.id])}),this._updateProperties.bind(this),this.destroy.bind(this)))}return b(e,[{key:"addStateChangedListener",value:function(e){var t=this;return this.onStateChanged.addListener(e),function(){return t.onStateChanged.removeListener(e)}}},{key:"ensureState",value:function(e){var t=this;return this.setState(Ze(e).reduce((function(r,n){return j.has(t._state,n)||(r[n]=e[n]),r}),{}))}},{key:"setState",value:function(e){var t=this;if(this._destroyed)console.error(new Error('Cannot call setState on destroyed Storage "'.concat(this.id,'".')));else if(this._context.getIsWritable()){var r=Ze(e);r.length>0&&r.forEach((function(r){var n=e[r];if(n!==t._state[r])if(void 0===n)t._lastValue.set(r,t._state[r]),delete t._state[r],t._setRawState(r,n);else{t._lastValue.set(r,t._state[r]),t._state[r]=n;var i=n;if(j.isObject(n)){var o=t._refMap.get(n);o||(o=function(e){return{k:He(),v:e,__isRef:!0}}(n),t._refMap.set(n,o)),i=o}t._setRawState(r,i)}}))}else console.error(new Error('Cannot setState on Storage "'.concat(this.id,'" without writable access')),e)}},{key:"emptyStorage",value:function(){if(!(j.size(this._state)<=0)){if(this._destroyed)return void console.error(new Error('Cannot empty destroyed Storage "'.concat(this.id,'".')));if(!this._context.getIsWritable())return void console.error(new Error('Cannot empty Storage "'.concat(this.id,'" without writable access.')));this.setState(j.mapValues(this._state,j.noop))}}},{key:"deleteStorage",value:function(){if(null===this.id)throw new Error("Cannot delete main Storage");this._context.getIsWritable()?(this.destroy(),this._context.updateAttributes([Je,this.id],void 0)):console.error(new Error('Cannot delete Storage "'.concat(this.id,'" without writable access.')))}},{key:"destroy",value:function(){this._destroyed=!0,this._sideEffect.flushAll()}},{key:"_getRawState",value:function(e){var t;return null===this.id?null!=(t=this._context.getAttributes())?t:e:j.get(this._context.getAttributes(),[Je,this.id],e)}},{key:"_setRawState",value:function(e,t){if(null===this.id){if(e===Je)throw new Error('Cannot set attribute internal filed "'.concat(Je,'"'));return this._context.updateAttributes([e],t)}return this._context.updateAttributes([Je,this.id,e],t)}},{key:"_updateProperties",value:function(e){var t;if(this._destroyed)console.error(new Error('Cannot call _updateProperties on destroyed Storage "'.concat(this.id,'".')));else if(e.length>0){for(var r={},n=0;ns.pageState.length-1?(console.warn("[WindowManager] nextPage: index out of range"),!1):(s.appProxy.setSceneIndex(t),!0));case 2:case"end":return e.stop()}}),e)}))),this.jumpPage=function(){var e=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",0<=t&&t=s.pageState.length?(console.warn("[WindowManager]: page index ".concat(t," out of range")),!1):s.appProxy.removeSceneByIndex(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.emitter=i.appEmitter,this.isAddApp=i.isAddApp}return b(e,[{key:"dispatchAppEvent",value:function(e,t){se.emit("custom-".concat(this.kind),{kind:this.kind,appId:this.appId,type:e,value:t})}},{key:"storage",get:function(){return this._storage||(this._storage=new et(this)),this._storage}},{key:"pageState",get:function(){return this.appProxy.pageState}},{key:"kind",get:function(){return this.appProxy.kind}}]),e}(),rt=function(){function e(t){var r=this;y(this,e),this.params=t,this.sceneNode=null,this.onSceneChange=function(e){r.sceneNode=e,r.params.notifyPageStateChange()};var n=this.params,i=n.displayer,o=n.scenePath;o&&(this.sceneNode=i.createScenesCallback(o,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}return b(e,[{key:"getFullPath",value:function(e){var t,r=null==(t=this.sceneNode)?void 0:t.scenes;if(this.params.scenePath&&r){var n=r[e];if(n)return"".concat(this.params.scenePath,"/").concat(n)}}},{key:"toObject",value:function(){var e,t;return{index:(null==(e=this.params.view)?void 0:e.focusSceneIndex)||0,length:(null==(t=this.sceneNode)?void 0:t.scenes.length)||0}}},{key:"destroy",value:function(){var e;null==(e=this.sceneNode)||e.dispose()}}]),e}(),nt=function(e){return e.Apps="apps",e.Focus="focus",e.State="state",e.BoxState="boxState",e.MainViewCamera="mainViewCamera",e.MainViewSize="mainViewSize",e.Broadcaster="broadcaster",e.Cursors="cursors",e.Position="position",e.CursorState="cursorState",e.FullPath="fullPath",e.Registered="registered",e.IframeBridge="iframeBridge",e}(nt||{}),it=new(function(){function e(t){var r=this;y(this,e),this.context=t,this.setAppFocus=function(e,t){t?r.context.safeSetAttributes({focus:e}):r.context.safeSetAttributes({focus:void 0})}}return b(e,[{key:"setContext",value:function(e){this.context=e}},{key:"apps",value:function(){return j.get(this.attributes,["apps"])}},{key:"getAppAttributes",value:function(e){return j.get(this.apps(),[e])}},{key:"getAppState",value:function(e){return j.get(this.apps(),[e,"state"])}},{key:"getMaximized",value:function(){return j.get(this.attributes,["maximized"])}},{key:"getMinimized",value:function(){return j.get(this.attributes,["minimized"])}},{key:"setupAppAttributes",value:function(e,t,r){var n;this.attributes.apps||this.context.safeSetAttributes({apps:{}});var i=["scenePath","title"];r||i.push("scenes");var o=j.pick(e.options,i),a={kind:e.kind,options:o,isDynamicPPT:r};"string"==typeof e.src&&(a.src=e.src),a.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",t],a),this.context.safeUpdateAttributes(["apps",t,"state"],(w(n={},K.Size,{}),w(n,K.Position,{}),w(n,K.SceneIndex,0),n))}},{key:"updateAppState",value:function(e,t,r){j.get(this.attributes,["apps",e,"state"])&&this.context.safeUpdateAttributes(["apps",e,"state",t],r)}},{key:"cleanAppAttributes",value:function(e){this.context.safeUpdateAttributes(["apps",e],void 0),this.context.safeSetAttributes(w({},e,void 0)),this.attributes.focus===e&&this.cleanFocus()}},{key:"cleanFocus",value:function(){this.context.safeSetAttributes({focus:void 0})}},{key:"getAppSceneIndex",value:function(e){var t;return null==(t=this.getAppState(e))?void 0:t[K.SceneIndex]}},{key:"getAppScenePath",value:function(e){var t,r;return null==(r=null==(t=this.getAppAttributes(e))?void 0:t.options)?void 0:r.scenePath}},{key:"getMainViewScenePath",value:function(){return this.attributes._mainScenePath}},{key:"getMainViewSceneIndex",value:function(){return this.attributes._mainSceneIndex}},{key:"getBoxState",value:function(){return this.attributes.boxState}},{key:"setMainViewScenePath",value:function(e){this.context.safeSetAttributes({_mainScenePath:e})}},{key:"setMainViewSceneIndex",value:function(e){this.context.safeSetAttributes({_mainSceneIndex:e})}},{key:"getMainViewCamera",value:function(){return j.get(this.attributes,["mainViewCamera"])}},{key:"getMainViewSize",value:function(){return j.get(this.attributes,["mainViewSize"])}},{key:"setMainViewCamera",value:function(e){this.context.safeSetAttributes({mainViewCamera:O({},e)})}},{key:"setMainViewSize",value:function(e){0===e.width||0===e.height||this.context.safeSetAttributes({mainViewSize:O({},e)})}},{key:"setMainViewCameraAndSize",value:function(e,t){0===t.width||0===t.height||this.context.safeSetAttributes({mainViewCamera:O({},e),mainViewSize:O({},t)})}},{key:"updateCursor",value:function(e,t){j.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"position"],t)}},{key:"updateCursorState",value:function(e,t){j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"cursorState"],t)}},{key:"getCursorState",value:function(e){return j.get(this.attributes,["cursors",e,"cursorState"])}},{key:"cleanCursor",value:function(e){this.context.safeUpdateAttributes(["cursors",e],void 0)}},{key:"setMainViewFocusPath",value:function(e){var t=this.getMainViewScenePath();t&&xe(e,t)}},{key:"getIframeBridge",value:function(){return j.get(this.attributes,["iframeBridge"])}},{key:"setIframeBridge",value:function(e){if(j.isObject(e)){var t=this.getIframeBridge();for(var r in e){var n=e[r];t[r]!==n&&this.context.safeUpdateAttributes(["iframeBridge",r],n)}}}},{key:"attributes",get:function(){return this.context.getAttributes()}},{key:"focus",get:function(){return j.get(this.attributes,["focus"])}}]),e}())({getAttributes:function(){throw new Error("getAttributes not implemented")},safeSetAttributes:function(){throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:function(){throw new Error("safeUpdateAttributes not implemented")}}),ot=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n0&&o.zIndex!==(null==(r=a.box)?void 0:r.zIndex)&&(null==(n=a.boxManager)||n.setZIndex(e,o.zIndex),null==(i=a.boxManager)||i.focusBox({appId:e}))}))})),a.manager.refresher.add("".concat(e,"-fullPath"),(function(){return z.autorun((function(){var e,t=null==(e=a.appAttributes)?void 0:e.fullPath;a.setFocusScenePathHandler(t),a._prevFullPath!==t&&(a.notifyPageStateChange(),a._prevFullPath=t)}))}))},this.setFocusScenePathHandler=j.debounce((function(e){var t;a.view&&e&&e!==(null==(t=a.view)?void 0:t.focusScenePath)&&(xe(a.view,e),oe.emit("onAppScenePathChange",{appId:a.id,view:a.view}))}),50),this.notifyPageStateChange=j.debounce((function(){a.appEmitter.emit("pageStateChange",a.pageState)}),50),this.kind=t.kind,this.id=n,this.stateKey="".concat(this.id,"_state"),this.appProxies.set(this.id,this),this.appEmitter=new $.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=i,this.initScenes(),null!=(o=this.params.options)&&o.scenePath&&this.createView(),this._pageState=new rt({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange})}var t,r,n,i,o,a,s,u;return b(e,[{key:"initScenes",value:function(){var e,t=this.params.options;t&&(this.scenePath=t.scenePath,(null==(e=this.appAttributes)?void 0:e.isDynamicPPT)&&this.scenePath?this.scenes=Me(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}},{key:"getFullScenePath",value:function(){if(this.scenePath)return j.get(this.appAttributes,[nt.FullPath])||this.getFullScenePathFromScenes()}},{key:"getFullScenePathFromScenes",value:function(){var e=j.get(this.appAttributes,["state","SceneIndex"],0),t=function(e,t,r){var n;if(e&&t){var i=null==(n=Me(e)[t])?void 0:n[r];if(i)return"".concat(t,"/").concat(i.name)}}(this.manager.room,this.scenePath,e);return t&&this.setFullPath(t),t}},{key:"setFullPath",value:function(e){this.manager.safeUpdateAttributes(["apps",this.id,nt.FullPath],e)}},{key:"baseInsertApp",value:(u=m(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]&&a[0],(n=this.params).kind){e.next=4;break}throw new Error("[WindowManager]: kind require");case 4:return e.next=6,null==(r=_e.appClasses.get(n.kind))?void 0:r();case 6:if(i=e.sent,o=_e.registered.get(n.kind),!i){e.next=13;break}return e.next=11,this.setupApp(this.id,t,i,n.options,null==o?void 0:o.appOptions);case 11:e.next=14;break;case 13:throw new Error("[WindowManager]: app load failed ".concat(n.kind," ").concat(n.src));case 14:return e.abrupt("return",(se.emit("updateManagerRect"),{appId:this.id,app:i}));case 15:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"setupApp",value:(s=m(regeneratorRuntime.mark((function e(t,r,n,i,o){var a,s,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ot("setupApp",t,n,i),this.boxManager){e.next=2;break}throw new Fe;case 2:s=new tt(this.manager,this.boxManager,t,this,o),this.appContext=s,e.prev=4,se.once("".concat(t).concat(q.WindowCreated)).then(m(regeneratorRuntime.mark((function e(){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r||(o=u.getAppInitState(t),null==(i=u.boxManager)||i.updateBoxState(o)),u.appEmitter.onAny(u.appListener),u.appAttributesUpdateListener(t),u.setViewFocusScenePath(),setTimeout(m(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("setup app",n),e.next=3,n.setup(s);case 3:r=e.sent,u.appResult=r,_e.notifyApp(u.kind,"created",{appId:t,result:r}),u.afterSetupApp(o),u.fixMobileSize(),oe.emit("onAppSetup",t);case 5:case"end":return e.stop()}}),e)}))),50);case 1:case"end":return e.stop()}}),e)})))),null==(a=this.boxManager)||a.createBox({appId:t,app:n,options:i,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),this.isAddApp&&this.box&&(this.store.updateAppState(t,K.ZIndex,this.box.zIndex),this.store.updateAppState(t,K.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:t},!1)),e.next=11;break;case 8:throw e.prev=8,e.t0=e.catch(4),console.error(e.t0),new Error("[WindowManager]: app setup error: ".concat(e.t0.message));case 11:case"end":return e.stop()}}),e,this,[[4,8]])}))),function(e,t,r,n,i){return s.apply(this,arguments)})},{key:"fixMobileSize",value:function(){var e,t,r=null==(e=this.boxManager)?void 0:e.getBox(this.id);r&&(null==(t=this.boxManager)||t.resizeBox({appId:this.id,width:r.intrinsicWidth+.001,height:r.intrinsicHeight+.001,skipUpdate:!0}))}},{key:"afterSetupApp",value:function(e){var t;e&&(null==e||!e.x||!e.y)&&(null==(t=this.boxManager)||t.setBoxInitState(this.id))}},{key:"onSeek",value:(a=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appEmitter.emit("seek",t).catch((function(e){console.log("[WindowManager]: emit seek error: ".concat(e.message))})),n=this.getAppInitState(this.id),null==(r=this.boxManager)||r.updateBoxState(n);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"onReconnected",value:(o=m(regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Boolean(this.manager.attributes.apps[this.id])){t.next=4;break}return t.next=3,this.destroy(!0,!1,!0);case 3:return t.abrupt("return");case 4:return this.appEmitter.emit("reconnected",void 0),n=this.getAppInitState(this.id),t.next=8,this.destroy(!0,!1,!0);case 8:return i=this.params,t.next=11,new e(i,this.manager,this.id,this.isAddApp).baseInsertApp(!0);case 11:null==(r=this.boxManager)||r.updateBoxState(n);case 12:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"onRemoveScene",value:(i=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.scenePath&&t.startsWith(this.scenePath+"/")&&(r=this.pageState.index,(n=this._pageState.getFullPath(r))||(r=0,n=this._pageState.getFullPath(r)),n&&this.setFullPath(n),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=r));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"emitAppSceneStateChange",value:function(e){this.appEmitter.emit("sceneStateChange",e)}},{key:"emitAppIsWritableChange",value:function(){this.appEmitter.emit("writableChange",this.isWritable)}},{key:"makeAppEventListener",value:function(e){var t=this;return function(r,n){var i,o,a,s;if(t.manager.canOperate)switch(r){case"setBoxSize":null==(i=t.boxManager)||i.resizeBox({appId:e,width:n.width,height:n.height,skipUpdate:!1});break;case"setBoxMinSize":null==(o=t.boxManager)||o.setBoxMinSize({appId:e,minWidth:n.minwidth,minHeight:n.minheight});break;case"setBoxTitle":null==(a=t.boxManager)||a.setBoxTitle({appId:e,title:n.title});break;case J.destroy:if("destroyed"===t.status)return;t.destroy(!0,!1,!0,null==n?void 0:n.error),null!=n&&n.error&&console.error(null==n?void 0:n.error);break;case"focus":null==(s=t.boxManager)||s.focusBox({appId:t.id}),st.emit("focus",{appId:t.id})}}}},{key:"setScenePath",value:function(){if(this.manager.canOperate){var e=this.getFullScenePath();this.manager.room&&e&&this.view&&we(this.manager.room,e)}}},{key:"setViewFocusScenePath",value:function(){var e=this.getFullScenePath();return e&&this.view&&xe(this.view,e),e}},{key:"createView",value:(n=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.viewManager.createView(this.id);case 2:return t=e.sent,e.abrupt("return",(this.setViewFocusScenePath(),t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"removeSceneByIndex",value:(r=m(regeneratorRuntime.mark((function e(t){var r,n,i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._pageState.getFullPath(t))){e.next=6;break}return n=at(t,this.pageState),e.abrupt("return",(this.setSceneIndexWithoutSync(n),this.manager.dispatchInternalEvent(q.SetAppFocusIndex,{type:"app",appID:this.id,index:n}),setTimeout((function(){Se(i.manager.room,r,t)}),100),!0));case 6:return e.abrupt("return",!1);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setSceneIndexWithoutSync",value:function(e){this.view&&(this.view.focusSceneIndex=e)}},{key:"setSceneIndex",value:function(e){if(this.view){this.view.focusSceneIndex=e;var t=this._pageState.getFullPath(e);t&&this.setFullPath(t)}}},{key:"destroy",value:(t=m(regeneratorRuntime.mark((function e(t,r,n,i){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("destroyed"===this.status){e.next=13;break}return this.status="destroyed",e.prev=2,e.next=5,_e.notifyApp(this.kind,"destroy",{appId:this.id});case 5:return e.next=7,this.appEmitter.emit("destroy",{error:i});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error("[WindowManager]: notifyApp error",e.t0.message,e.t0.stack);case 12:this.appEmitter.clearListeners(),se.emit("destroy-".concat(this.id),{error:i}),t&&(null==(o=this.boxManager)||o.closeBox(this.id,n)),r&&(this.store.cleanAppAttributes(this.id),this.scenePath&&Se(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this._pageState.destroy(),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),this.manager.refresher.remove(this.id),this.manager.refresher.remove(this.stateKey),this.manager.refresher.remove("".concat(this.id,"-fullPath")),this._prevFullPath=void 0;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,r,n,i){return t.apply(this,arguments)})},{key:"close",value:function(){return this.destroy(!0,!0,!1)}},{key:"view",get:function(){return this.manager.viewManager.getView(this.id)}},{key:"viewIndex",get:function(){var e;return null==(e=this.view)?void 0:e.focusSceneIndex}},{key:"isWritable",get:function(){var e;return this.manager.canOperate&&!(null!=(e=this.box)&&e.readonly)}},{key:"attributes",get:function(){return this.manager.attributes[this.id]}},{key:"appAttributes",get:function(){return this.store.getAppAttributes(this.id)}},{key:"box",get:function(){var e;return null==(e=this.boxManager)?void 0:e.getBox(this.id)}},{key:"pageState",get:function(){return this._pageState.toObject()}}]),e}(),lt=function(){function e(t){y(this,e),this.displayer=t,this.views=new Map}return b(e,[{key:"createView",value:function(e){var t=ct(this.displayer);return this.views.set(e,t),t}},{key:"getView",value:function(e){return this.views.get(e)}},{key:"destroyView",value:function(e){var t=this.views.get(e);if(t){try{t.release()}catch(e){}this.views.delete(e)}}},{key:"setViewScenePath",value:function(e,t){var r=this.views.get(e);r&&(r.focusScenePath=t)}},{key:"destroy",value:function(){this.views.forEach((function(e){try{e.release()}catch(e){}})),this.views.clear()}}]),e}(),ct=function(e){var t=e.views.createView();return ht(t),t},ht=function(e){e.setCameraBound({maxContentMode:function(){return 10},minContentMode:function(){return.1}})},dt=function(){function e(t){var r=this;y(this,e),this.manager=t,this.polling=!1,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.viewMode=this.manager.windowManger.viewMode,this.sideEffectManager=new Ye,this.syncCamera=function(){if(r.polling&&r.viewMode===z.ViewMode.Broadcaster){var e=r.mainViewCamera;e&&e.id!==r.manager.uid&&r.moveCameraSizeByAttributes()}},this.startListenWritableChange=function(){r.sideEffectManager.add((function(){return se.on("writableChange",(function(e){e&&r.ensureCameraAndSize(),r.manager.room&&r.syncMainView(r.manager.room)}))}))},this.addCameraReaction=function(){r.manager.refresher.add(nt.MainViewCamera,r.cameraReaction)},this.cameraReaction=function(){return z.reaction((function(){return r.mainViewCamera}),(function(e){e&&e.id!==r.manager.uid&&(r.moveCameraToContian(r.mainViewSize),r.moveCamera(e))}),{fireImmediately:!0})},this.sizeChangeHandler=j.debounce((function(e){e&&(r.moveCameraToContian(e),r.moveCamera(r.mainViewCamera)),r.ensureMainViewSize()}),30),this.onUpdateContainerSizeRatio=function(){var e=r.store.getMainViewSize();r.sizeChangeHandler(e)},this.onCameraUpdatedByDevice=function(e){r.viewMode!==z.ViewMode.Follower&&(r.store.setMainViewCamera(R(O({},e),{id:r.manager.uid})),j.isEqual(r.mainViewSize,R(O({},r.mainView.size),{id:r.manager.uid}))||r.setMainViewSize(r.view.size))},this.mainViewClickListener=function(){r.mainViewClickHandler()},this.setMainViewSize=j.debounce((function(e){r.store.setMainViewSize(R(O({},e),{id:r.manager.uid}))}),50),this._syncMainViewTimer=0,this.onCameraOrSizeUpdated=function(){oe.emit("cameraStateChange",r.cameraState),r.manager.room&&r.manager.room.syncMainView&&(clearTimeout(r._syncMainViewTimer),r._syncMainViewTimer=setTimeout(r.syncMainView,100,r.manager.room)),r.ensureMainViewSize()},this.syncMainView=function(e){e.isWritable&&e.syncMainView(r.mainView)},this.setViewMode=function(e){r.viewMode=e},this.mainView=this.createMainView(),this.moveCameraSizeByAttributes(),se.once("mainViewMounted").then((function(){r.addMainViewListener(),r.start(),r.ensureCameraAndSize(),r.startListenWritableChange()}));var n=function(){r.sizeChangeHandler(r.mainViewSize)};this.sideEffectManager.add((function(){return se.on("playgroundSizeChange",n)})),this.sideEffectManager.add((function(){return se.on("containerSizeRatioUpdate",r.onUpdateContainerSizeRatio)})),this.sideEffectManager.add((function(){return se.on("startReconnect",(function(){r.didRelease||r.mainView.release()}))})),this.sideEffectManager.setInterval(this.syncCamera,1500)}var t;return b(e,[{key:"ensureCameraAndSize",value:function(){this.viewMode===z.ViewMode.Broadcaster&&(!this.mainViewCamera||!this.mainViewSize)&&(this.manager.dispatchInternalEvent(q.InitMainViewCamera),this.setCameraAndSize())}},{key:"moveCameraSizeByAttributes",value:function(){this.moveCameraToContian(this.mainViewSize),this.moveCamera(this.mainViewCamera)}},{key:"start",value:function(){this.sizeChangeHandler(this.mainViewSize),!this.started&&(this.addCameraListener(),this.addCameraReaction(),this.manager.room&&this.syncMainView(this.manager.room),this.started=!0)}},{key:"setCameraAndSize",value:function(){var e=R(O({},this.mainView.camera),{id:this.manager.uid}),t=R(O({},this.mainView.size),{id:this.manager.uid});this.store.setMainViewCameraAndSize(e,t)}},{key:"createMainView",value:function(){var e=ct(this.manager.displayer),t=this.store.getMainViewScenePath();return t&&xe(e,t),e}},{key:"onReconnect",value:function(){if(this.didRelease)this.rebind();else{var e=this.store.getMainViewScenePath();this.setFocusScenePath(e)}}},{key:"setFocusScenePath",value:function(e){if(e)return xe(this.view,e)}},{key:"rebind",value:function(){var e=this.mainView.divElement,t=this.mainView.disableCameraTransform;this.stop(),this.didRelease||this.mainView.release(),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=t,this.mainView.divElement=e,this.addMainViewListener(),this.start(),oe.emit("onMainViewRebind",this.mainView)}},{key:"addMainViewListener",value:function(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}},{key:"removeMainViewListener",value:function(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}},{key:"mainViewClickHandler",value:(t=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!this.manager.canOperate||(this.store.cleanFocus(),null==(t=this.manager.boxManager)||t.blurAllBox());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"addCameraListener",value:function(){this.view.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"removeCameraListener",value:function(){this.view.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"ensureMainViewSize",value:function(){(!this.mainViewSize||0===this.mainViewSize.width||0===this.mainViewSize.height)&&this.mainView.size.width>0&&this.mainView.size.height>0&&this.setMainViewSize(this.mainView.size)}},{key:"moveCameraToContian",value:function(e){j.isEmpty(e)||(this.view.moveCameraToContain({width:e.width,height:e.height,originX:-e.width/2,originY:-e.height/2,animationMode:z.AnimationMode.Immediately}),this.scale=this.view.camera.scale)}},{key:"moveCamera",value:function(e){if(!j.isEmpty(e)){if(j.isEqual(e,this.view.camera))return;var t=e.centerX,r=e.centerY,n=e.scale*(this.scale||1);this.view.moveCamera({centerX:t,centerY:r,scale:n,animationMode:z.AnimationMode.Immediately})}}},{key:"stop",value:function(){this.removeCameraListener(),this.manager.refresher.remove(nt.MainViewCamera),this.manager.refresher.remove(nt.MainViewSize),this.started=!1}},{key:"destroy",value:function(){this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}},{key:"mainViewCamera",get:function(){return this.store.getMainViewCamera()}},{key:"mainViewSize",get:function(){return this.store.getMainViewSize()}},{key:"didRelease",get:function(){return j.get(this.view,["didRelease"])}},{key:"view",get:function(){return this.mainView}},{key:"cameraState",get:function(){return O(O({},this.view.camera),this.view.size)}}]),e}(),ft=function(){function e(t){var r=this;y(this,e),this.context=t,this.addRedoUndoListeners=function(e){if(void 0===e)r.addViewCallbacks(r.context.mainView(),r.onCanRedoStepsUpdate,r.onCanUndoStepsUpdate);else{var t=r.context.getAppProxy(e);t&&t.view&&r.addViewCallbacks(t.view,r.onCanRedoStepsUpdate,r.onCanUndoStepsUpdate)}},this.addViewCallbacks=function(e,t,r){t(e.canRedoSteps),r(e.canUndoSteps),e.callbacks.on("onCanRedoStepsUpdate",t),e.callbacks.on("onCanUndoStepsUpdate",r)},this.disposeViewCallbacks=function(e){e.callbacks.off("onCanRedoStepsUpdate",r.onCanRedoStepsUpdate),e.callbacks.off("onCanUndoStepsUpdate",r.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=function(e){oe.emit("canRedoStepsChange",e)},this.onCanUndoStepsUpdate=function(e){oe.emit("canUndoStepsChange",e)},this.disposePrevFocusViewRedoUndoListeners=function(e){var t;if(void 0===e)t=r.context.mainView();else{var n=r.context.getAppProxy(e);n&&n.view&&(t=n.view)}t&&r.disposeViewCallbacks(t)},se.on("focusedChange",(function(e){r.disposePrevFocusViewRedoUndoListeners(e.prev),setTimeout((function(){r.addRedoUndoListeners(e.focused)}),0)})),se.on("rootDirRemoved",(function(){r.disposePrevFocusViewRedoUndoListeners(t.focus()),r.addRedoUndoListeners(t.focus())})),this.addRedoUndoListeners(t.focus())}return b(e,[{key:"destroy",value:function(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}]),e}(),pt=function(){function e(t){var r=this;y(this,e),this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=it,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new ae,this.sideEffectManager=new Ye,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((o=t.scenePath)!==ne){e.next=6;break}return e.next=4,r.onRootDirRemoved();case 4:return r.dispatchInternalEvent(q.RootDirRemoved),e.abrupt("return");case 6:if(!Pe(o)){e.next=14;break}return a=r.mainView.focusSceneIndex||0,(s=null==(n=r.callbacksNode)?void 0:n.scenes[a])||(a=0,s=null==(i=r.callbacksNode)?void 0:i.scenes[a]),s&&r.setMainViewScenePath("".concat(ne).concat(s)),e.next=12,r.setMainViewSceneIndex(a);case 12:e.next=15;break;case 14:r.appProxies.forEach((function(e){e.onRemoveScene(o)}));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReadonlyChanged=function(){r.appProxies.forEach((function(e){e.emitAppIsWritableChange()}))},this.onPlayerSeekStart=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.closeAll();case 2:case"end":return e.stop()}}),e)}))),this.onPlayerSeekDone=function(){var e=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.attributesUpdateCallback(r.attributes.apps);case 2:r.appProxies.forEach((function(e){e.onSeek(t)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.createRootDirScenesCallback=function(){var e,t=!1;r.callbacksNode&&(r.callbacksNode.dispose(),t=!0),r.callbacksNode=r.displayer.createScenesCallback(ne,{onAddScene:r.onSceneChange,onRemoveScene:(e=m(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.onSceneChange(t);case 2:se.emit("rootDirSceneRemoved",n);case 3:case"end":return e.stop()}}),e)}))),function(t,r){return e.apply(this,arguments)})}),r.callbacksNode&&(r.updateSceneState(r.callbacksNode),r.mainViewScenesLength=r.callbacksNode.scenes.length,t&&r.emitMainViewScenesChange(r.callbacksNode.scenes.length))},this.removeSceneByIndex=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=at(t,r.windowManger.pageState),r.setSceneIndexWithoutSync(i),r.dispatchInternalEvent(q.SetAppFocusIndex,{type:"main",index:i}),o=null==(n=r.callbacksNode)?void 0:n.scenes[t],e.abrupt("return",(setTimeout((function(){o&&Se(r.room,"".concat(ne).concat(o),t)}),100),new Promise((function(e,t){se.once("rootDirSceneRemoved").then((function(t){t===o&&e(!0)})).catch((function(e){console.log("[WindowManager]: removePage error: ".concat(e)),t(!1)}))}))));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.setSceneIndexWithoutSync=function(e){var t,n=null==(t=r.callbacksNode)?void 0:t.scenes[e];n&&r.mainViewProxy.setFocusScenePath("".concat(ne).concat(n))},this.onSceneChange=function(e){return r.mainViewScenesLength=e.scenes.length,r.updateSceneState(e),r.emitMainViewScenesChange(r.mainViewScenesLength)},this.emitMainViewScenesChange=function(e){return Promise.all([oe.emit("mainViewScenesLengthChange",e),se.emit("changePageState")])},this.updateSceneState=function(e){var t=r.store.getMainViewSceneIndex()||0,n=e.scenes[t];n||(n=e.scenes[r.mainView.focusSceneIndex||0]),r.sceneState={scenePath:"".concat(ne).concat(n),contextPath:e.path,index:t,scenes:e.scenes.map((function(e){return{name:e}})),sceneName:n},oe.emit("sceneStateChange",r.sceneState)},this.onBoxMove=function(e){r.dispatchInternalEvent(q.AppMove,e),r.store.updateAppState(e.appId,K.Position,{x:e.x,y:e.y}),oe.emit("onBoxMove",e)},this.onBoxResize=function(e){e.width&&e.height&&(r.dispatchInternalEvent(q.AppResize,e),r.store.updateAppState(e.appId,K.Size,{width:e.width,height:e.height}),oe.emit("onBoxResize",e))},this.onBoxFocus=function(e){r.windowManger.safeSetAttributes({focus:e.appId}),oe.emit("onBoxFocus",e)},this.onBoxClose=function(e){var t=r.appProxies.get(e.appId);t&&t.destroy(!1,!0,!0,e.error),oe.emit("onBoxClose",e)},this.onBoxStateChange=function(e){r.dispatchInternalEvent(q.AppBoxStateChange,e),oe.emit("onBoxStateChange",e)},this.addAppsChangeListener=function(){r.refresher.add("apps",(function(){return Xe((function(){return r.attributes.apps}),(function(){r.attributesUpdateCallback(r.attributes.apps)}))}))},this.addAppCloseListener=function(){r.refresher.add("appsClose",(function(){return qe(r.attributes.apps,(function(){r.onAppDelete(r.attributes.apps)}))}))},this.onMainViewIndexChange=function(e){void 0!==e&&r._prevSceneIndex!==e&&(oe.emit("mainViewSceneIndexChange",e),se.emit("changePageState"),r.callbacksNode&&r.updateSceneState(r.callbacksNode),r._prevSceneIndex=e)},this.onFocusChange=function(e){var t;r._prevFocused!==e&&(oe.emit("focusedChange",e),se.emit("focusedChange",{focused:e,prev:r._prevFocused}),r._prevFocused=e,void 0!==e&&(null==(t=r.boxManager)||t.focusBox({appId:e}),setTimeout((function(){var t=r.appProxies.get(e);t&&_e.notifyApp(t.kind,"focus",{appId:e})}),0)))},this.attributesUpdateCallback=j.debounce((function(e){return r._attributesUpdateCallback(e)}),100),this._appIds=[],this.onRegisteredChange=function(e){!e||Object.entries(e).forEach((function(e){var t=o(e,2),r=t[0],n=t[1];_e.appClasses.has(r)||_e.register({kind:r,src:n.src,name:n.name})}))},this.onMinimized=function(e){var t,n;(null==(t=r.boxManager)?void 0:t.minimized)!==e&&(!0===e&&(null==(n=r.boxManager)||n.blurAllBox()),setTimeout((function(){var t;null==(t=r.boxManager)||t.setMinimized(Boolean(e))}),0))},this.onAppDelete=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object.keys(t),i=S(r.appProxies.entries()),e.prev=2,i.s();case 4:if((a=i.n()).done){e.next=12;break}if(s=o(a.value,2),u=s[0],l=s[1],e.t0=n.includes(u),e.t0){e.next=10;break}return e.next=10,l.destroy(!0,!1,!0);case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t1=e.catch(2),i.e(e.t1);case 17:return e.prev=17,i.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[2,14,17,20]])})));return function(t){return e.apply(this,arguments)}}(),this.closeAll=m(regeneratorRuntime.mark((function e(){var t,n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=S(r.appProxies.entries()),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return i=o(n.value,2),i[0],a=i[1],e.next=7,a.destroy(!0,!1,!0);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])}))),this.displayerStateListener=function(e){r.appProxies.forEach((function(t){t.appEmitter.emit("roomStateChange",e)})),se.emit("observerIdChange",r.displayer.observerId)},this.displayerWritableListener=function(e){var t,n,i=!e,o=void 0===r.windowManger.readonly||!1===r.windowManger.readonly;void 0===r.windowManger.readonly?null==(t=r.boxManager)||t.setReadonly(e):null==(n=r.boxManager)||n.setReadonly(!(i&&o)),r.appProxies.forEach((function(e){e.emitAppIsWritableChange()})),se.emit("writableChange",i)},this.updateSceneIndex=function(){var e=r.store.getMainViewScenePath(),t=Ee(e),n=Me(r.displayer)[t];if(n.length){var i=e.replace(t,"").replace("/",""),o=n.findIndex((function(e){return e.name===i}));j.isInteger(o)&&o>=0&&r.safeSetAttributes({_mainSceneIndex:o})}},this.updateRootDirRemoving=function(e){r.rootDirRemoving=e},this.displayer=t.displayer,this.store.setContext({getAttributes:function(){return r.attributes},safeSetAttributes:function(e){return r.safeSetAttributes(e)},safeUpdateAttributes:function(e,t){return r.safeUpdateAttributes(e,t)}}),this.mainViewProxy=new dt(this),this.viewManager=new lt(this.displayer),this.appListeners=new Ne(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=q_,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:se}),this.sideEffectManager.addDisposer((function(){var e,t;r.appCreateQueue.destroy(),r.mainViewProxy.destroy(),r.refresher.destroy(),r.viewManager.destroy(),null==(e=r.boxManager)||e.destroy(),null==(t=r.callbacksNode)||t.dispose()})),se.once("onCreated").then((function(){return r.onCreated()})),se.on("onReconnected",(function(){return r.onReconnected()})),z.isPlayer(this.displayer)&&(se.on("seekStart",this.onPlayerSeekStart),se.on("seek",this.onPlayerSeekDone)),se.on("removeScenes",this.onRemoveScenes),se.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),_e.setSyncRegisterApp((function(e){r.safeUpdateAttributes([nt.Registered,e.kind],e)}))}var t,r,n,i,a,s,u,l,c,h,d;return b(e,[{key:"getMemberState",value:function(){var e;return(null==(e=this.room)?void 0:e.state.memberState)||{strokeColor:[0,0,0]}}},{key:"onRootDirRemoved",value:(d=m(regeneratorRuntime.mark((function e(){var t,r,n,i,a,s,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!(u.length>0&&void 0!==u[0])||u[0],this.setMainViewScenePath(ie),this.createRootDirScenesCallback(),r=S(this.appProxies.entries()),e.prev=3,r.s();case 5:if((n=r.n()).done){e.next=13;break}if(i=o(n.value,2),a=i[0],s=i[1],e.t0=s.view,!e.t0){e.next=11;break}return e.next=11,this.closeApp(a,t);case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(3),r.e(e.t1);case 18:return e.prev=18,r.f(),e.finish(18);case 21:this.mainViewProxy.rebind(),se.emit("rootDirRemoved"),this.updateRootDirRemoving(!1);case 22:case"end":return e.stop()}}),e,this,[[3,15,18,21]])}))),function(){return d.apply(this,arguments)})},{key:"getMainViewSceneDir",value:function(){var e=this.store.getMainViewScenePath();if(e)return Ee(e);throw new Error("[WindowManager]: mainViewSceneDir not found")}},{key:"onCreated",value:(h=m(regeneratorRuntime.mark((function e(){var t,r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.attributesUpdateCallback(this.attributes.apps);case 2:if(se.emit("updateManagerRect"),st.on("move",this.onBoxMove),st.on("resize",this.onBoxResize),st.on("focus",this.onBoxFocus),st.on("close",this.onBoxClose),st.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),this.refresher.add("maximized",(function(){return z.autorun((function(){var e,t=n.attributes.maximized;null==(e=n.boxManager)||e.setMaximized(Boolean(t))}))})),this.refresher.add("minimized",(function(){return z.autorun((function(){var e=n.attributes.minimized;n.onMinimized(e)}))})),this.refresher.add("mainViewIndex",(function(){return z.autorun((function(){var e=j.get(n.attributes,"_mainSceneIndex");n.onMainViewIndexChange(e)}))})),this.refresher.add("focusedChange",(function(){return z.autorun((function(){var e=j.get(n.attributes,"focus");n.onFocusChange(e)}))})),this.refresher.add("registeredChange",(function(){return z.autorun((function(){var e=j.get(n.attributes,nt.Registered);n.onRegisteredChange(e)}))})),this.attributes.apps&&0!==Object.keys(this.attributes.apps).length){e.next=20;break}if(r=this.store.getMainViewScenePath()){e.next=19;break}return e.abrupt("return");case 19:this.resetScenePath(r);case 20:this.displayerWritableListener(!(null!=(t=this.room)&&t.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this._prevFocused=this.attributes.focus,this.sideEffectManager.add((function(){var e=new ft({mainView:function(){return n.mainViewProxy.view},focus:function(){return n.attributes.focus},getAppProxy:function(e){return n.appProxies.get(e)}});return function(){return e.destroy()}}));case 21:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"notifyAppsChange",value:function(e){(this._appIds.length!==e.length||!this._appIds.every((function(t){return e.includes(t)})))&&(this._appIds=e,oe.emit("appsChange",e))}},{key:"_attributesUpdateCallback",value:(c=m(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&Z_.container){0===(r=Object.keys(t)).length&&this.appCreateQueue.emitReady(),n=j.orderBy(r.map((function(e){return{id:e,createdAt:t[e].createdAt}})),"createdAt","asc").map((function(e){return e.id})),this.notifyAppsChange(n),i=S(n);try{for(a=function(){var e=o.value;if(!s.appProxies.has(e)&&!s.appStatus.has(e)){var r=t[e];try{if(!s.attributes[e])throw new Error("appAttributes is undefined");s.appCreateQueue.push((function(){return s.appStatus.set(e,ee.StartCreate),s.baseInsertApp({kind:r.kind,options:r.options,isDynamicPPT:r.isDynamicPPT},e,!1)})),s.focusByAttributes(t)}catch(e){console.warn("[WindowManager]: Insert App Error",e)}}},i.s();!(o=i.n()).done;)a()}catch(e){i.e(e)}finally{i.f()}}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"refresh",value:function(){this.attributesUpdateCallback(this.attributes.apps)}},{key:"setBoxManager",value:function(e){this.boxManager=e}},{key:"resetMaximized",value:function(){var e;null==(e=this.boxManager)||e.setMaximized(Boolean(this.store.getMaximized()))}},{key:"resetMinimized",value:function(){var e;null==(e=this.boxManager)||e.setMinimized(Boolean(this.store.getMinimized()))}},{key:"bindMainView",value:function(e,t){var r=this.mainViewProxy.view;r.disableCameraTransform=t,r.divElement=e,r.focusScenePath||this.setMainViewFocusPath(),se.emit("mainViewMounted"),oe.emit("onMainViewMounted",r)}},{key:"setMainViewFocusPath",value:function(e){var t,r=e||this.store.getMainViewScenePath();if(r)return xe(this.mainView,r),(null==(t=this.mainView)?void 0:t.focusScenePath)===r}},{key:"resetScenePath",value:function(e){this.displayer.state.sceneState.scenePath!==e&&we(this.room,e)}},{key:"addApp",value:(l=m(regeneratorRuntime.mark((function e(t,r){var n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ot("addApp",t),e.next=3,this.beforeAddApp(t,r);case 3:return n=e.sent,i=n.appId,o=n.needFocus,e.next=8,this.baseInsertApp(t,i,!0,o);case 8:return a=e.sent,e.abrupt("return",(this.afterAddApp(a),null==a?void 0:a.id));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"beforeAddApp",value:(u=m(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,be(t.kind);case 2:return o=e.sent,this.appStatus.set(o,ee.StartCreate),a=null!=(n=t.attributes)?n:{},this.safeUpdateAttributes([o],a),this.store.setupAppAttributes(t,o,r),s=!(null!=(i=this.boxManager)&&i.minimized),e.abrupt("return",(s&&this.store.setAppFocus(o,!0),{appId:o,needFocus:s}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"afterAddApp",value:function(e){var t,r;if(e&&e.box){var n=e.box;st.emit("move",{appId:e.id,x:null==n?void 0:n.intrinsicX,y:null==n?void 0:n.intrinsicY}),this.store.updateAppState(e.id,K.ZIndex,n.zIndex)}null!=(t=this.boxManager)&&t.minimized&&(null==(r=this.boxManager)||r.setMinimized(!1,!1))}},{key:"closeApp",value:(s=m(regeneratorRuntime.mark((function e(t){var r,n,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!(i.length>1&&void 0!==i[1])||i[1],(n=this.appProxies.get(t))&&n.destroy(!0,r,!1);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"baseInsertApp",value:(a=m(regeneratorRuntime.mark((function e(t,r,n,i){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appProxies.has(r)){e.next=3;break}return console.warn("[WindowManager]: app duplicate exists and cannot be created again"),e.abrupt("return");case 3:if(!(o=new ut(t,this,r,n))){e.next=9;break}return e.next=7,o.baseInsertApp(i);case 7:return this.appStatus.delete(r),e.abrupt("return",o);case 9:throw this.appStatus.delete(r),new Error("[WindowManger]: initialize AppProxy failed");case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return a.apply(this,arguments)})},{key:"safeSetAttributes",value:function(e){this.windowManger.safeSetAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.windowManger.safeUpdateAttributes(e,t)}},{key:"setMainViewScenePath",value:(i=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=17;break}if(r=this.displayer.scenePathType(t),Ee(t)===ne){e.next=4;break}throw new Error('[WindowManager]: main view scenePath must in root dir "/"');case 4:if(r!==z.ScenePathType.None){e.next=6;break}throw new Error("[WindowManager]: ".concat(t," not valid scene"));case 6:if(r!==z.ScenePathType.Page){e.next=11;break}return e.next=9,this._setMainViewScenePath(t);case 9:e.next=17;break;case 11:if(r!==z.ScenePathType.Dir){e.next=17;break}if(n=Te(this.displayer,t),e.t0=n,!e.t0){e.next=17;break}return e.next=17,this._setMainViewScenePath(n);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_setMainViewScenePath",value:(n=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setMainViewFocusPath(t)&&(this.safeSetAttributes({_mainScenePath:t}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(r=m(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=9;break}if(this.store.getMainViewSceneIndex()!==t){e.next=3;break}return e.abrupt("return");case 3:if(n=null==(r=this.callbacksNode)?void 0:r.scenes[t],i="".concat(ne).concat(n),!n){e.next=8;break}this.setMainViewFocusPath(i)&&(this.store.setMainViewScenePath(i),this.store.setMainViewSceneIndex(t),this.dispatchSetMainViewScenePath(i)),e.next=9;break;case 8:throw new Error("[WindowManager]: ".concat(t," not valid index"));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"dispatchSetMainViewScenePath",value:function(e){this.dispatchInternalEvent(q.SetMainViewScenePath,{nextScenePath:e}),oe.emit("mainViewScenePathChange",e),we(this.room,e)}},{key:"getAppInitPath",value:function(e){var t,r=this.store.getAppAttributes(e);if(r)return null==(t=null==r?void 0:r.options)?void 0:t.scenePath}},{key:"safeDispatchMagixEvent",value:function(e,t){this.canOperate&&this.displayer.dispatchMagixEvent(e,t)}},{key:"focusByAttributes",value:function(e){var t;if(e&&Object.keys(e).length===(null==(t=this.boxManager)?void 0:t.boxSize)){var r=this.store.focus;r&&this.boxManager.focusBox({appId:r})}}},{key:"onReconnected",value:(t=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.attributesUpdateCallback(this.attributes.apps),t=Array.from(this.appProxies.values()).map((function(e){return e.onReconnected()})),this.mainViewProxy.onReconnect(),e.next=5,Promise.all(t);case 5:this.callbacksNode&&this.onSceneChange(this.callbacksNode);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"notifyContainerRectUpdate",value:function(e){this.appProxies.forEach((function(t){t.appEmitter.emit("containerRectUpdate",e)}))}},{key:"dispatchInternalEvent",value:function(e,t){this.safeDispatchMagixEvent(Q,{eventName:e,payload:t})}},{key:"destroy",value:function(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),st.clearListeners(),se.clearListeners(),this.appProxies.size&&this.appProxies.forEach((function(e){e.destroy(!0,!1,!0)})),oe.clearListeners(),this.sideEffectManager.flushAll(),this._prevFocused=void 0,this._prevSceneIndex=void 0}},{key:"eventName",get:function(){return z.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}},{key:"attributes",get:function(){return this.windowManger.attributes}},{key:"canOperate",get:function(){return this.windowManger.canOperate}},{key:"room",get:function(){return z.isRoom(this.displayer)?this.displayer:void 0}},{key:"mainView",get:function(){return this.mainViewProxy.view}},{key:"polling",get:function(){return this.mainViewProxy.polling},set:function(e){this.mainViewProxy.polling=e}},{key:"focusApp",get:function(){if(this.store.focus)return this.appProxies.get(this.store.focus)}},{key:"uid",get:function(){var e;return(null==(e=this.room)?void 0:e.uid)||""}}]),e}(),vt=function(){if(Ae(z.WhiteVersion)Z_.containerSizeRatio?(i=n*Z_.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(n=i/Z_.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!1)),r.style.width="".concat(n,"px"),r.style.height="".concat(i,"px"))}},{key:"disconnect",value:function(){var e;null==(e=this.containerResizeObserver)||e.disconnect(),j.isFunction(this.disposer)&&(this.disposer(),this.disposer=void 0)}}],[{key:"create",value:function(t,r,n,i){var o=new e(i);return o.observePlaygroundSize(t,r,n),o}}]),e}(),xt={exports:{}},wt={},St=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable;function kt(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var Et=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,i=kt(e),o=1;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]&&arguments[2];r?this.asyncMethods.set(e,t):this.methods.set(e,t)}},{key:"registerAsyn",value:function(e,t){this.asyncMethods.set(e,t)}},{key:"recv",value:function(e){if("string"==typeof e){var t=(0,o.parseBridgeMessage)(e),r=t.type,n=t.actionId,i=t.method,a=t.payload;switch(this.verbose&&console.log({type:r,actionId:n,method:i,payload:a}),r){case o.BridgeEventType.req:var s={data:void 0,actionId:n,complete:!0},u=function(e,t){try{s.data=e.apply(t,a);var r=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeSuccess,s);window.ReactNativeWebView.postMessage(r)}catch(e){var i=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeError,e);window.ReactNativeWebView.postMessage(i)}},l=function(e,t){a.push((function(e,t){s.data=e,s.complete=!1!==t;var r="",i=!1;if("string"==typeof e)try{var a=JSON.parse(e);i=!(!a.error&&!a.__error)}catch(e){}else i=!(!e||!e.error&&!e.__error);r=i?(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeError,s.data):(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeSuccess,s),window.ReactNativeWebView.postMessage(r)}));try{e.apply(t,a)}catch(e){var r=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,n,o.ackTypeError,e);window.ReactNativeWebView.postMessage(r)}},c=this.methods.get(i),h=this.asyncMethods.get(i);if(c)u(c,this.methods);else if(h)l(h,this.asyncMethods);else{var d=i.split(".");if(d.length<2)return;var f=d.pop(),p=d.join("."),v=this.methods.get(p);if(v){var g=v[f];if(g&&"function"==typeof g)return void u(g,v)}var m=this.asyncMethods.get(p);if(m){var y=m[f];if(y&&"function"==typeof y)return void l(y,m)}console.log("method ".concat(i," not found"))}break;case o.BridgeEventType.ack:var _=a;if(this.queue.has(n)){var b=this.queue.get(n);b.ack=!0,i===o.ackTypeError?b.reject(a):(b.resolve(_.data),b.callback&&b.callback(_.data)),_.complete&&this.queue.delete(n)}}}}}],r&&n(t.prototype,r),a&&n(t,a),e}();t.Bridge=a},5419:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBridgeMessage=t.bridgeMessageTemplate=t.ackTypeError=t.ackTypeSuccess=t.BridgeEventType=void 0,function(e){e.req="req",e.evt="evt",e.ack="ack"}(t.BridgeEventType||(t.BridgeEventType={})),t.ackTypeSuccess="success",t.ackTypeError="error",t.bridgeMessageTemplate=function(e,t,r,n){return JSON.stringify({type:e,actionId:t,method:r,payload:n})},t.parseBridgeMessage=function(e){try{var t=JSON.parse(e);return{type:t.type,actionId:t.actionId,method:t.method,payload:t.payload}}catch(t){return console.log("parse bridge message ".concat(e," failed: "),t),{type:"fail",actionId:"",method:"",payload:e}}}},13324:function(e,t,r){var n=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RNBridge=t.RNCommon=void 0,t.RNCommon=o(r(5419));var a=r(5397);Object.defineProperty(t,"RNBridge",{enumerable:!0,get:function(){return a.Bridge}})},79888:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},87980:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)} +/*! For license information please see index.js.LICENSE.txt */var i;e=r.nmd(e),window,i=function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(t,r){t.exports=e},function(e,t,r){(function(e,i){r.d(t,"a",(function(){return et}));var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function a(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function l(){for(var e=[],t=0;t2&&re("box");var r=X(t);return new Me(e,q(r),r.name,!0,r.equals)},shallowBox:function(e,t){return arguments.length>2&&re("shallowBox"),te.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&re("array");var r=X(t);return new St(e,q(r),r.name)},shallowArray:function(e,t){return arguments.length>2&&re("shallowArray"),te.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&re("map");var r=X(t);return new Pt(e,q(r),r.name)},shallowMap:function(e,t){return arguments.length>2&&re("shallowMap"),te.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&re("set");var r=X(t);return new Dt(e,q(r),r.name)},object:function(e,t,r){"string"==typeof arguments[1]&&re("object");var n=X(r);return nt({},e,t,n)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&re("shallowObject"),te.object(e,{},{name:t,deep:!1})},ref:K,shallow:Z,deep:Q,struct:J},te=function e(t,r,n){if("string"==typeof arguments[1])return Q.apply(null,arguments);if(at(t))return t;var i=b(t)?e.object(t,r,n):Array.isArray(t)?e.array(t,r):T(t)?e.map(t,r):M(t)?e.set(t,r):t;if(i!==t)return i;v(!1)};function re(e){v("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ee).forEach((function(e){return te[e]=ee[e]}));var ne,ie,oe=W(!1,(function(e,t,r,n,i){var o=r.get,a=r.set,u=i[0]||{};!function(e,t,r){var n=zt(e);r.name=n.name+"."+t,r.context=e,n.values[t]=new ke(r),Object.defineProperty(e,t,function(e){return Ft[e]||(Ft[e]={configurable:Ce.computedConfigurable,enumerable:!1,get:function(){return Ut(this).read(this,e)},set:function(t){Ut(this).write(this,e,t)}})}(t))}(e,t,s({get:o,set:a},u))}));oe({equals:j.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(ne||(ne={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ie||(ie={}));var ae=function(e){this.cause=e};function se(e){return e instanceof ae}function ue(e){switch(e.dependenciesState){case ne.UP_TO_DATE:return!1;case ne.NOT_TRACKING:case ne.STALE:return!0;case ne.POSSIBLY_STALE:for(var t=ve(!0),r=fe(),n=e.observing,i=n.length,o=0;o0;Ce.computationDepth>0&&t&&v(!1),Ce.allowStateChanges||!t&&"strict"!==Ce.enforceActions||v(!1)}function ce(e,t,r){var n=ve(!0);me(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ce.runId;var i,o=Ce.trackingDerivation;if(Ce.trackingDerivation=e,!0===Ce.disableErrorBoundaries)i=t.call(r);else try{i=t.call(r)}catch(e){i=new ae(e)}return Ce.trackingDerivation=o,function(e){for(var t=e.observing,r=e.observing=e.newObserving,n=ne.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;an&&(n=s.dependenciesState);for(r.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&Ne(s,e),s.diffValue=0;for(;i--;){var s;1===(s=r[i]).diffValue&&(s.diffValue=0,Pe(s,e))}n!==ne.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}(e),e.observing.length,ge(n),i}function he(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)Ne(t[r],e);e.dependenciesState=ne.NOT_TRACKING}function de(e){var t=fe(),r=e();return pe(t),r}function fe(){var e=Ce.trackingDerivation;return Ce.trackingDerivation=null,e}function pe(e){Ce.trackingDerivation=e}function ve(e){var t=Ce.allowStateReads;return Ce.allowStateReads=e,t}function ge(e){Ce.allowStateReads=e}function me(e){if(e.dependenciesState!==ne.UP_TO_DATE){e.dependenciesState=ne.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=ne.UP_TO_DATE}}var ye=0,_e=1,be=Object.getOwnPropertyDescriptor((function(){}),"name");function xe(e,t){var r=function(){return we(e,t,this,arguments)};return r.isMobxAction=!0,r}function we(e,t,r,n){var i=function(e,t,r){var n=We()&&!!e,i=0;if(n){i=Date.now();var o=r&&r.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(Ie=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ae).version&&(Ie=!1),Ie?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ae):(setTimeout((function(){v("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ae)}();function Pe(e,t){var r=e.observers.length;r&&(e.observersIndexes[t.__mapid]=r),e.observers[r]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ne(e,t){if(1===e.observers.length)e.observers.length=0,Oe(e);else{var r=e.observers,n=e.observersIndexes,i=r.pop();if(i!==t){var o=n[t.__mapid]||0;o?n[i.__mapid]=o:delete n[i.__mapid],r[o]=i}delete n[t.__mapid]}}function Oe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ce.pendingUnobservations.push(e))}function Re(){Ce.inBatch++}function De(){if(0==--Ce.inBatch){Be();for(var e=Ce.pendingUnobservations,t=0;t0&&Oe(e),!1)}function je(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ie.BREAK){var r=[];!function e(t,r,n){r.length>=1e3?r.push("(and many more)"):(r.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,r,n+1)})))}((n=e,it(Vt(n,void 0))),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof ke?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}var n}var ze=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+p()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=ne.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+p(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ie.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ce.pendingReactions.push(this),Be())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Re(),this._isScheduled=!1,ue(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&We()&&Ge({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}De()}},e.prototype.track=function(e){Re();var t,r=We();r&&(t=Date.now(),Ve({name:this.name,type:"reaction"})),this._isRunning=!0;var n=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&he(this),se(n)&&this.reportExceptionInDerivation(n.cause),r&&Ye({time:Date.now()-t}),De()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ce.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ce.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),We()&&Ge({type:"error",name:this.name,message:r,error:""+e}),Ce.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Re(),he(this),De()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ce.isRunningReactions||function(e){e()}(Fe)}function Fe(){Ce.isRunningReactions=!0;for(var e=Ce.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n",e):2===arguments.length&&"function"==typeof t?xe(e,t):1===arguments.length&&"string"==typeof e?Xe(e):!0!==n?Xe(t).apply(null,arguments):void(e[t]=xe(e.name||t,r.value))};function Ze(e,t,r){x(e,t,xe(t,r.bind(e)))}Qe.bound=function(e,t,r,n){return!0===n?(Ze(e,t,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return Ze(this,t,r.value||r.initializer.call(this)),this[t]},set:$e}:{enumerable:!1,configurable:!0,set:function(e){Ze(this,t,e)},get:function(){}}};var Ke=function(e){return e()};function Je(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Ke}function et(e,t,r){void 0===r&&(r=h),"boolean"==typeof r&&(r={fireImmediately:r});var n,i,o,a=r.name||"Reaction@"+p(),s=Qe(a,r.onError?(n=r.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){n.call(this,e)}}):t),u=!r.scheduler&&!r.delay,l=Je(r),c=!0,d=!1,f=r.compareStructural?j.structural:r.equals||j.default,v=new ze(a,(function(){c||u?g():d||(d=!0,l(g))}),r.onError,r.requiresObservable);function g(){if(d=!1,!v.isDisposed){var t=!1;v.track((function(){var r=e(v);t=c||!f(o,r),o=r})),c&&r.fireImmediately&&s(o,v),c||!0!==t||s(o,v),c&&(c=!1)}}return v.schedule(),v.getDisposer()}function tt(e,t,r){return rt("onBecomeUnobserved",e,t,r)}function rt(e,t,r,n){var i="function"==typeof n?Vt(t,r):Vt(t),o="function"==typeof n?n:r,a=i[e];return"function"!=typeof a?v(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function nt(e,t,r,n){var i=(n=X(n)).defaultDecorator||(!1===n.deep?K:Q);U(e),zt(e,n.name,i.enhancer),Re();try{for(var o in t){var a=Object.getOwnPropertyDescriptor(t,o),s=(r&&o in r?r[o]:a.get?oe:i)(e,o,a,!0);s&&Object.defineProperty(e,o,s)}}finally{De()}return e}function it(e){var t,r,n={name:e.name};return e.observing&&e.observing.length>0&&(n.dependencies=(t=e.observing,r=[],t.forEach((function(e){-1===r.indexOf(e)&&r.push(e)})),r).map(it)),n}function ot(e,t){if(null==e)return!1;if(void 0!==t){if(Gt(e)){var r=e.$mobx;return r.values&&!!r.values[t]}return!1}return Gt(e)||!!e.$mobx||D(e)||Ue(e)||Ee(e)}function at(e){return 1!==arguments.length&&v(!1),ot(e)}function st(e){switch(e.length){case 0:return Ce.trackingDerivation;case 1:return Vt(e[0]);case 2:return Vt(e[0],e[1])}}function ut(e,t){void 0===t&&(t=void 0),Re();try{return e.apply(t)}finally{De()}}function lt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function ct(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),m((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function ht(e,t){var r=fe();try{var n=e.interceptors;if(n)for(var i=0,o=n.length;i0}function ft(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),m((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function pt(e,t){var r=fe(),n=e.changeListeners;if(n){for(var i=0,o=(n=n.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return ct(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ft(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n0&&e+t+1>bt&&Et(e+t+1)},e.prototype.spliceWithArray=function(e,t,r){var n=this;le(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===r&&(r=c),lt(this)){var o=ht(this,{object:this.array,type:"splice",index:e,removedCount:t,added:r});if(!o)return c;t=o.removedCount,r=o.added}var a=(r=0===r.length?r:r.map((function(e){return n.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<1e4)return(n=this.values).splice.apply(n,l([e,t],r));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&We(),i=dt(this),o=i||n?{object:this.array,type:"update",index:e,newValue:t,oldValue:r}:null;n&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),n&&Ye()},e.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&We(),i=dt(this),o=i||n?{object:this.array,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;n&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),n&&Ye()},e}(),St=function(e){function t(t,r,n,i){void 0===n&&(n="ObservableArray@"+p()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new wt(n,r,o,i);if(w(o,"$mobx",a),t&&t.length){var s=Se(!0);o.spliceWithArray(0,0,t),Te(s)}return _t&&Object.defineProperty(a.array,"0",Tt),o}return a(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function r(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(r.call(this,e),r.call(this,t),e!==t){var n,i=this.$mobx.values;n=e1)for(var r=1;r=2&&(this.player.currentTime=e)},e}(),d=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},p=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(r.lastSyncProgressTimestamp=n,r.selfUserInf&&r.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:r.playerState}))},r.handleSeekReaction=function(e,t){r.isHost()||r.player.current&&void 0!==t&&(r.player.current.currentTime=e+Date.now()/1e3-t)},r.handleRemove=function(){return f(r,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},r.timeUpdate=function(){if(r.player.current){var e=r.player.current.currentTime;r.onTimeUpdate(e)}},r.detectAudioClickEnable=function(){var e=r.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},r.renderMuteBox=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&r.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){r.setState({selfMute:!1})},onTouchStart:function(){r.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},r.renderDeleteBtn=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:r.handleRemove},o.createElement("img",{src:c,alt:"delete_icon"})):null},r.renderNavigation=function(){return!0===r.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-audio-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"audio_plugin"}),o.createElement("span",null,"Audio Player")),r.renderDeleteBtn())},r.handleFirstSeek=function(e){if(!e){var t,n=r.props.plugin,i=Date.now()/1e3;t=n.attributes.seekTime?n.attributes.seek+i-n.attributes.seekTime:n.attributes.seek,r.syncNode.syncProgress(t)}},r.player=o.createRef(),r.reactionPlayDisposer=r.startPlayReaction(),r.reactionSeekDisposer=r.startSeekReaction(),r.reactionVolumeDisposer=r.startVolumeReaction(),r.reactionMuteDisposer=r.startMuteTimeReaction(),r.reactionSeekTimeDisposer=r.startSeekTimeReaction(),r.reactionSyncDisposer=r.startSyncReaction(),r.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},r}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(r){e.handleSeekReaction(t.attributes.seek,r)}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(r){e.handleSeekReaction(r,t.attributes.seekTime)}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this,t=this.props,r=t.size,n=t.plugin,a=t.scale,s=0===a?1:a,u=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);return o.createElement("div",{className:"plugin-audio-box",style:{width:r.width/s,height:r.height/s,transform:"scale("+s+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-audio-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-audio-box"},o.createElement("audio",{className:"white-plugin-audio",src:n.attributes.pluginAudioUrl,ref:this.player,muted:this.state.mute?this.state.mute:this.state.selfMute,style:{width:"100%",height:54,pointerEvents:this.detectAudioClickEnable(),outline:"none"},onLoadedMetadataCapture:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return u?[4,v(300)]:[3,2];case 1:e.sent(),this.handleFirstSeek(this.state.isEnd),e.label=2;case 2:return[2]}}))}))},onEnded:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(n.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return e.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:e.sent(),this.player.current.load(),e.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:e.sent(),this.player.current.load(),e.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"auto"}))))},t}(o.Component),_=(m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),b=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},x=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-audio-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-audio-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-audio-plugin-nav-delete > img {\n width: 14px;\n}\n.white-audio-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-audio-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n}\n.white-audio-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,r){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(r=a,n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+n),f=l+(d-c)/1e3,Math.abs(r.currentTime-f)>2&&(r.currentTime=f)),this.changedMap.changed("rate",i)&&(r.playbackRate=i),[2]}}))}))}));this.disposers.push(n),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,r=e.scale||1;return{width:t.width/r,height:t.height/r,transform:"scale("+r+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,r=e.player,n=e.plugin;return t||r?i.a.createElement("div",{className:"white-audio-plugin-container",style:this.containerStyle},!n.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-audio-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"audio_plugin"}),i.a.createElement("span",{className:"white-audio-plugin-nav-title"},"Audio Player"),i.a.createElement("span",{className:"white-audio-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-audio-plugin-body"},i.a.createElement("audio",{src:n.attributes.src,style:this.pointerEventsStyle,controls:!!t,controlsList:"nodownload nofullscreen",preload:"auto",ref:this.player}))):null},t}(n.Component);r.d(t,"audioPlugin2",(function(){return x}));var x=Object.freeze({kind:"audio2",render:_,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==n(t)&&"object"==n(e)?e.exports=i(r(17328),r(71895)):r.amdD([,],i)},52056:function(e,t){function r(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}),t.prepare=function(e,t){return a.apply(this,arguments)};var i=["api.whiteboard.sd-rtn.com","api.baiban.shengwang.cn","api.whiteboard.rtelink.com","api.netless.link","api.whiteboard.agora.io"],o=function(e){var t=new Array(e.length),r=0;return new Promise((function(n,i){e.forEach((function(o,a){Promise.resolve(o).then(n).catch((function(n){t[a]=n,(r+=1)===e.length&&i(t)}))}))}))};function a(){return a=n(regeneratorRuntime.mark((function e(t,r){var n,a,s,u,l,c,h,d,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>2&&void 0!==f[2]?f[2]:432e5,e.prev=1,a={},s=null,window.AbortController&&(s=new window.AbortController,a.signal=s.signal),e.next=7,o(i.map((function(e){return new Promise((function(r,n){fetch("https://".concat(e,"/v5/configs/regions?app=").concat(encodeURIComponent(t)),a).then((function(e){e.ok?e.json().then(r,n):n(new Error("fetch failed"))}),(function(){n(new Error("fetch failed"))}))}))})));case 7:return u=e.sent,s&&s.abort(),l={method:"head"},c=u.configmap.realtime.hosts[r],h=null,window.AbortController&&(h=new window.AbortController,l.signal=h.signal),e.next=15,o(c.map((function(e){return new Promise((function(t,r){fetch("https://".concat(e,"/ping"),l).then((function(n){n.ok?t(e):r(new Error("fetch failed"))}),(function(){return r(new Error("fetch failed"))}))}))})));case 15:d=e.sent,h&&h.abort(),localStorage.setItem("white-prefer-gateway",JSON.stringify({host:d,region:r,expire:Date.now()+n})),e.next=22;break;case 20:e.prev=20,e.t0=e.catch(1);case 22:case"end":return e.stop()}}),e,null,[[1,20]])}))),a.apply(this,arguments)}},44112:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)} +/*! For license information please see index.js.LICENSE.txt */var i;e=r.nmd(e),window,i=function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(t,r){t.exports=e},function(e,t,r){(function(e,i){r.d(t,"a",(function(){return rt}));var o=[];Object.freeze(o);var a={};Object.freeze(a);var s={};function u(){return"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:s}function l(){return++Ne.mobxGuid}function c(e){throw h(!1,e),"X"}function h(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is an production build."))}function d(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var f=function(){};function p(e){return null!==e&&"object"==n(e)}function v(e){if(null===e||"object"!=n(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function g(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function m(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function y(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(e){return p(e)&&!0===e[r]}}function _(e){return void 0!==u().Map&&e instanceof u().Map}function b(e){return e instanceof Set}function x(e){for(var t=[];;){var r=e.next();if(r.done)break;t.push(r.value)}return t}function w(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function S(e){return null===e?null:"object"==n(e)?""+e:e}function T(e,t){for(var r=e.next();!r.done;)t(r.value),r=e.next()}function M(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function k(e,t){m(e,M(),t)}function E(e){return e[M()]=I,e}function A(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function I(){return this}var C=function(){function e(e){void 0===e&&(e="Atom@"+l()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=oe.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return ze(this)},e.prototype.reportChanged=function(){Le(),function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===oe.UP_TO_DATE&&(n.isTracing!==ae.NONE&&Be(n,e),n.onBecomeStale()),n.dependenciesState=oe.STALE}}}(this),je()},e.prototype.toString=function(){return this.name},e}(),P=y("Atom",C);function N(e,t,r){void 0===t&&(t=f),void 0===r&&(r=f);var n=new C(e);return it("onBecomeObserved",n,t,void 0),nt(n,r),n}function O(e,t){return e===t}var R={identity:O,structural:function(e,t){return qt(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||O(e,t)},shallow:function(e,t){return qt(e,t,1)}},D=function(e,t){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function L(e,t){function r(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var j=function(){return(j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function B(){for(var e=[],t=0;t2&&ie("box");var r=Q(t);return new Ee(e,Z(r),r.name,!0,r.equals)},shallowBox:function(e,t){return arguments.length>2&&ie("shallowBox"),ne.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ie("array");var r=Q(t);return new Mt(e,Z(r),r.name)},shallowArray:function(e,t){return arguments.length>2&&ie("shallowArray"),ne.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ie("map");var r=Q(t);return new Ot(e,Z(r),r.name)},shallowMap:function(e,t){return arguments.length>2&&ie("shallowMap"),ne.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ie("set");var r=Q(t);return new jt(e,Z(r),r.name)},object:function(e,t,r){"string"==typeof arguments[1]&&ie("object");var n=Q(r);return ot({},e,t,n)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ie("shallowObject"),ne.object(e,{},{name:t,deep:!1})},ref:ee,shallow:J,deep:K,struct:te},ne=function e(t,r,n){if("string"==typeof arguments[1])return K.apply(null,arguments);if(ut(t))return t;var i=v(t)?e.object(t,r,n):Array.isArray(t)?e.array(t,r):_(t)?e.map(t,r):b(t)?e.set(t,r):t;if(i!==t)return i;c(!1)};function ie(e){c("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(re).forEach((function(e){return ne[e]=re[e]}));var oe,ae,se=V(!1,(function(e,t,r,n,i){var o=r.get,a=r.set,s=i[0]||{};!function(e,t,r){var n=Ft(e);r.name=n.name+"."+t,r.context=e,n.values[t]=new Ae(r),Object.defineProperty(e,t,function(e){return Wt[e]||(Wt[e]={configurable:Ne.computedConfigurable,enumerable:!1,get:function(){return Gt(this).read(this,e)},set:function(t){Gt(this).write(this,e,t)}})}(t))}(e,t,j({get:o,set:a},s))}));se({equals:R.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(oe||(oe={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ae||(ae={}));var ue=function(e){this.cause=e};function le(e){return e instanceof ue}function ce(e){switch(e.dependenciesState){case oe.UP_TO_DATE:return!1;case oe.NOT_TRACKING:case oe.STALE:return!0;case oe.POSSIBLY_STALE:for(var t=me(!0),r=ve(),n=e.observing,i=n.length,o=0;o0;Ne.computationDepth>0&&t&&c(!1),Ne.allowStateChanges||!t&&"strict"!==Ne.enforceActions||c(!1)}function de(e,t,r){var n=me(!0);_e(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ne.runId;var i,o=Ne.trackingDerivation;if(Ne.trackingDerivation=e,!0===Ne.disableErrorBoundaries)i=t.call(r);else try{i=t.call(r)}catch(e){i=new ue(e)}return Ne.trackingDerivation=o,function(e){for(var t=e.observing,r=e.observing=e.newObserving,n=oe.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;an&&(n=s.dependenciesState);for(r.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&Re(s,e),s.diffValue=0;for(;i--;){var s;1===(s=r[i]).diffValue&&(s.diffValue=0,Oe(s,e))}n!==oe.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}(e),e.observing.length,ye(n),i}function fe(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)Re(t[r],e);e.dependenciesState=oe.NOT_TRACKING}function pe(e){var t=ve(),r=e();return ge(t),r}function ve(){var e=Ne.trackingDerivation;return Ne.trackingDerivation=null,e}function ge(e){Ne.trackingDerivation=e}function me(e){var t=Ne.allowStateReads;return Ne.allowStateReads=e,t}function ye(e){Ne.allowStateReads=e}function _e(e){if(e.dependenciesState!==oe.UP_TO_DATE){e.dependenciesState=oe.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=oe.UP_TO_DATE}}var be=0,xe=1,we=Object.getOwnPropertyDescriptor((function(){}),"name");function Se(e,t){var r=function(){return Te(e,t,this,arguments)};return r.isMobxAction=!0,r}function Te(e,t,r,n){var i=function(e,t,r){var n=Ve()&&!!e,i=0;if(n){i=Date.now();var o=r&&r.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(Pe=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ce).version&&(Pe=!1),Pe?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ce):(setTimeout((function(){c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ce)}();function Oe(e,t){var r=e.observers.length;r&&(e.observersIndexes[t.__mapid]=r),e.observers[r]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Re(e,t){if(1===e.observers.length)e.observers.length=0,De(e);else{var r=e.observers,n=e.observersIndexes,i=r.pop();if(i!==t){var o=n[t.__mapid]||0;o?n[i.__mapid]=o:delete n[i.__mapid],r[o]=i}delete n[t.__mapid]}}function De(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ne.pendingUnobservations.push(e))}function Le(){Ne.inBatch++}function je(){if(0==--Ne.inBatch){Ue();for(var e=Ne.pendingUnobservations,t=0;t0&&De(e),!1)}function Be(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ae.BREAK){var r=[];!function e(t,r,n){r.length>=1e3?r.push("(and many more)"):(r.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,r,n+1)})))}((n=e,at(Yt(n,void 0))),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Ae?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}var n}var Fe=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+l()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ae.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ne.pendingReactions.push(this),Ue())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Le(),this._isScheduled=!1,ce(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ve()&&He({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}je()}},e.prototype.track=function(e){Le();var t,r=Ve();r&&(t=Date.now(),Ye({name:this.name,type:"reaction"})),this._isRunning=!0;var n=de(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&fe(this),le(n)&&this.reportExceptionInDerivation(n.cause),r&&Xe({time:Date.now()-t}),je()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ne.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ne.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),Ve()&&He({type:"error",name:this.name,message:r,error:""+e}),Ne.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Le(),fe(this),je()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ne.isRunningReactions||function(e){e()}(We)}function We(){Ne.isRunningReactions=!0;for(var e=Ne.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n",e):2===arguments.length&&"function"==typeof t?Se(e,t):1===arguments.length&&"string"==typeof e?Qe(e):!0!==n?Qe(t).apply(null,arguments):void(e[t]=Se(e.name||t,r.value))};function Je(e,t,r){g(e,t,Se(t,r.bind(e)))}Ke.bound=function(e,t,r,n){return!0===n?(Je(e,t,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return Je(this,t,r.value||r.initializer.call(this)),this[t]},set:qe}:{enumerable:!1,configurable:!0,set:function(e){Je(this,t,e)},get:function(){}}};var et=function(e){return e()};function tt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:et}function rt(e,t,r){void 0===r&&(r=a),"boolean"==typeof r&&(r={fireImmediately:r});var n,i,o,s=r.name||"Reaction@"+l(),u=Ke(s,r.onError?(n=r.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){n.call(this,e)}}):t),c=!r.scheduler&&!r.delay,h=tt(r),d=!0,f=!1,p=r.compareStructural?R.structural:r.equals||R.default,v=new Fe(s,(function(){d||c?g():f||(f=!0,h(g))}),r.onError,r.requiresObservable);function g(){if(f=!1,!v.isDisposed){var t=!1;v.track((function(){var r=e(v);t=d||!p(o,r),o=r})),d&&r.fireImmediately&&u(o,v),d||!0!==t||u(o,v),d&&(d=!1)}}return v.schedule(),v.getDisposer()}function nt(e,t,r){return it("onBecomeUnobserved",e,t,r)}function it(e,t,r,n){var i="function"==typeof n?Yt(t,r):Yt(t),o="function"==typeof n?n:r,a=i[e];return"function"!=typeof a?c(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function ot(e,t,r,n){var i=(n=Q(n)).defaultDecorator||(!1===n.deep?ee:K);G(e),Ft(e,n.name,i.enhancer),Le();try{for(var o=Object.getOwnPropertyNames(t),a=0,s=o.length;a0&&(n.dependencies=(t=e.observing,r=[],t.forEach((function(e){-1===r.indexOf(e)&&r.push(e)})),r).map(at)),n}function st(e,t){if(null==e)return!1;if(void 0!==t){if(Ht(e)){var r=e.$mobx;return r.values&&!!r.values[t]}return!1}return Ht(e)||!!e.$mobx||P(e)||Ge(e)||Ie(e)}function ut(e){return 1!==arguments.length&&c(!1),st(e)}function lt(e){switch(e.length){case 0:return Ne.trackingDerivation;case 1:return Yt(e[0]);case 2:return Yt(e[0],e[1])}}function ct(e,t){void 0===t&&(t=void 0),Le();try{return e.apply(t)}finally{je()}}function ht(e){return void 0!==e.interceptors&&e.interceptors.length>0}function dt(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),d((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function ft(e,t){var r=ve();try{var n=e.interceptors;if(n)for(var i=0,o=n.length;i0}function vt(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),d((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function gt(e,t){var r=ve(),n=e.changeListeners;if(n){for(var i=0,o=(n=n.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return dt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),vt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n0&&e+t+1>wt&&It(e+t+1)},e.prototype.spliceWithArray=function(e,t,r){var n=this;he(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===r&&(r=o),ht(this)){var a=ft(this,{object:this.array,type:"splice",index:e,removedCount:t,added:r});if(!a)return o;t=a.removedCount,r=a.added}var s=(r=0===r.length?r:r.map((function(e){return n.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,s);var u=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<1e4)return(n=this.values).splice.apply(n,B([e,t],r));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&Ve(),i=pt(this),o=i||n?{object:this.array,type:"update",index:e,newValue:t,oldValue:r}:null;n&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&>(this,o),n&&Xe()},e.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&Ve(),i=pt(this),o=i||n?{object:this.array,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;n&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&>(this,o),n&&Xe()},e}(),Mt=function(e){function t(t,r,n,i){void 0===n&&(n="ObservableArray@"+l()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new Tt(n,r,o,i);if(m(o,"$mobx",a),t&&t.length){var s=Me(!0);o.spliceWithArray(0,0,t),ke(s)}return xt&&Object.defineProperty(a.array,"0",kt),o}return L(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function r(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(r.call(this,e),r.call(this,t),e!==t){var n,i=this.$mobx.values;n=e1)for(var r=1;r=2&&(this.player.currentTime=e)},e}(),d=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},p=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(r.lastSyncProgressTimestamp=n,r.selfUserInf&&r.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:r.playerState}))},r.handleNativePlayerState=function(e){return f(r,void 0,void 0,(function(){var t;return p(this,(function(r){switch(r.label){case 0:if(!e)return[3,7];if(!this.player.current)return[3,6];r.label=1;case 1:return r.trys.push([1,3,,6]),[4,this.player.current.play()];case 2:return r.sent(),[3,6];case 3:return""+(t=r.sent()).name!="NotAllowedError"&&""+t.name!="AbortError"?[3,5]:(this.setState({selfMute:!0}),[4,this.player.current.play()]);case 4:r.sent(),r.label=5;case 5:return[3,6];case 6:return[3,8];case 7:this.player.current&&this.player.current.pause(),r.label=8;case 8:return[2]}}))}))},r.handleSeekReaction=function(e,t){return f(r,void 0,void 0,(function(){return p(this,(function(r){return this.isHost()||this.player.current&&void 0!==t&&(this.player.current.currentTime=e+Date.now()/1e3-t),[2]}))}))},r.timeUpdate=function(){if(r.player.current){var e=r.player.current.currentTime;r.onTimeUpdate(e)}},r.detectVideoClickEnable=function(){var e=r.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},r.renderMuteBox=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&r.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){r.setState({selfMute:!1})},onTouchStart:function(){r.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},r.handleRemove=function(){return f(r,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},r.renderDeleteBtn=function(){var e=r.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:r.handleRemove},o.createElement("img",{src:c,alt:"delete"})):null},r.renderNavigation=function(){return!0===r.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-video-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"video_plugin"}),o.createElement("span",null,"Video Player")),r.renderDeleteBtn())},r.handleOnEnd=function(){return f(r,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(e.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return t.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:t.sent(),this.player.current.load(),t.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:t.sent(),this.player.current.load(),t.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},r.handleOnLoadedMetadataCapture=function(){return f(r,void 0,void 0,(function(){var e,t;return p(this,(function(r){switch(r.label){case 0:return e=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),t=this.state.isEnd,e?[4,v(300)]:[3,2];case 1:r.sent(),this.handleFirstSeek(t),r.label=2;case 2:return[2]}}))}))},r.player=o.createRef(),r.reactionSeekDisposer=r.startSeekReaction(),r.reactionSeekTimeDisposer=r.startSeekTimeReaction(),r.reactionPlayDisposer=r.startPlayReaction(),r.reactionVolumeDisposer=r.startVolumeReaction(),r.reactionMuteDisposer=r.startMuteTimeReaction(),r.reactionSyncDisposer=r.startSyncReaction(),r.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},r}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(r){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(r,t.attributes.seekTime)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(r){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(t.attributes.seek,r)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSeekTimeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this.props,t=e.size,r=e.plugin,n=e.scale,i=this.state,a=i.mute,s=i.selfMute,u=0===n?1:n;return o.createElement("div",{className:"plugin-video-box",style:{width:t.width/u,height:t.height/u,transform:"scale("+u+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-video-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-video-box"},o.createElement("video",{"webkit-playsinline":"true",playsInline:!0,poster:r.attributes.poster,className:"white-plugin-video",src:r.attributes.pluginVideoUrl,ref:this.player,muted:a||s,style:{width:"100%",height:"100%",pointerEvents:this.detectVideoClickEnable(),outline:"none"},disablePictureInPicture:!0,onLoadedMetadataCapture:this.handleOnLoadedMetadataCapture,onEnded:this.handleOnEnd,controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"metadata"}))))},t}(o.Component),y=(g=function(e,t){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},b=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-video-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-video-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-video-plugin-nav-delete > img {\n width: 14px;\n}\n.white-video-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-video-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n height: calc(100% - 32px);\n}\n.white-video-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,r){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(r=a,n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+n),f=l+(d-c)/1e3,Math.abs(r.currentTime-f)>2&&(r.currentTime=f)),this.changedMap.changed("rate",i)&&(r.playbackRate=i),[2]}}))}))}));this.disposers.push(n),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,r=e.scale||1;return{width:t.width/r,height:t.height/r,transform:"scale("+r+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,r=e.player,n=e.plugin;return t||r?i.a.createElement("div",{className:"white-video-plugin-container",style:this.containerStyle},!n.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-video-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"video_plugin"}),i.a.createElement("span",{className:"white-video-plugin-nav-title"},"Video Player"),i.a.createElement("span",{className:"white-video-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-video-plugin-body"},i.a.createElement("video",{src:n.attributes.src,style:g({maxWidth:"100%",maxHeight:"100%"},this.pointerEventsStyle),controls:!!t,controlsList:"nodownload nofullscreen",preload:"metadata",ref:this.player,playsInline:!0,"webkit-playsinline":"true",poster:n.attributes.poster,disablePictureInPicture:!0}))):null},t}(n.Component);r.d(t,"videoPlugin2",(function(){return x}));var x=Object.freeze({kind:"video2",render:_,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==n(t)&&"object"==n(e)?e.exports=i(r(17328),r(71895)):r.amdD([,],i)},18371:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.playerStateNameSpace=t.playerNameSpace=t.sdkNameSpace=t.roomStateNamespace=t.roomNamespace=t.roomSyncNamespace=t.pptNamespace=t.ScaleMode=void 0,function(e){e[e.Scale=0]="Scale",e[e.AspectFit=1]="AspectFit",e[e.AspectFitScale=2]="AspectFitScale",e[e.AspectFitSpace=3]="AspectFitSpace",e[e.AspectFill=4]="AspectFill",e[e.AspectFillScale=5]="AspectFillScale"}(t.ScaleMode||(t.ScaleMode={})),t.pptNamespace="ppt",t.roomSyncNamespace="room.sync",t.roomNamespace="room",t.roomStateNamespace="room.state",t.sdkNameSpace="sdk",t.playerNameSpace="player",t.playerStateNameSpace="player.state"},46640:function(e,t,r){var n;function i(e,t,r){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}},i(e,t,r||e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||T(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||T(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function u(e){var t=f();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l(this,r)}}function l(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?c(e):t}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,v(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)},h(e)}function d(e,t,r){return d=f()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&p(i,r.prototype),i},d.apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){g(o,n,i,a,s,"next",e)}function s(e){g(o,n,i,a,s,"throw",e)}a(void 0)}))}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function T(e,t){if(e){if("string"==typeof e)return M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(this.timer=this.initInterval())}},{key:"invoke",value:function(){var e=this;if(0!==this.list.length&&void 0===this.currentInvoker){var t=this.list.shift();t&&(this.currentInvoker=t,t().then((function(){e.invoked()})).catch((function(t){console.error("[WindowManager]: create app error: ".concat(t.message)),e.invoked()})))}}},{key:"emitReady",value:function(){this.isEmit||setTimeout((function(){oe.emit("ready")}),50),this.isEmit=!0}},{key:"empty",value:function(){this.list=[],this.clear()}},{key:"destroy",value:function(){this.timer&&this.clear()}}]),e}(),se=new $.default,ue=function(){var e=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,t){var r=indexedDB.open("__WindowManagerAppCache",2);r.onerror=function(e){t(e)},r.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains("apps")||t.createObjectStore("apps",{keyPath:"kind"}).createIndex("kind","kind",{unique:!0})},r.onsuccess=function(){var t=r.result;e(t)}}));case 2:H=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(e,t){if(H)return function(e,t){return new Promise((function(r,n){var i=e.transaction(["apps"],"readwrite").objectStore("apps").add(t);i.onsuccess=function(){return r()},i.onerror=function(){return n()}}))}(H,{kind:e,sourceCode:t})},ce=function(){var e=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!H){e.next=6;break}return e.next=3,he(H,t);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=null;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function he(e,t){return new Promise((function(r,n){var i=e.transaction(["apps"]).objectStore("apps").index("kind").get(t);i.onerror=function(e){return n(e)},i.onsuccess=function(){i.result?r(i.result):r(null)}}))}var de=function(){var e=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ce(t);case 2:if(!(r=e.sent)){e.next=5;break}return e.abrupt("return",r.sourceCode);case 5:return e.next=7,ge(t,{timeout:1e4});case 7:return e.next=9,e.sent.text();case 9:return n=e.sent,e.next=12,le(t,n);case 12:return e.abrupt("return",n);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fe=function(e,t){var r=Function(e+"\n;return ".concat(t))();return void 0===r&&(r=window[t]),r},pe=function(){var e=m(regeneratorRuntime.mark((function e(t,r,n){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n||"NetlessApp"+r,oe.emit("loadApp",{kind:r,status:"start"}),e.prev=2,e.next=5,de(t);case 5:if((o=e.sent)&&0!==o.length){e.next=8;break}throw oe.emit("loadApp",{kind:r,status:"failed",reason:"script is empty."}),new Error("[WindowManager]: script is empty.");case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(2),oe.emit("loadApp",{kind:r,status:"failed",reason:e.t0.message}),e.t0;case 13:return e.abrupt("return",ve(o,i,r));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,r,n){return e.apply(this,arguments)}}(),ve=function(e,t,r){try{var n=fe(e,t);return oe.emit("loadApp",{kind:r,status:"success"}),n}catch(n){if(n.message.includes("Can only have one anonymous define call per script file")){var i=window.define;"function"==typeof i&&i.amd&&delete i.amd;var o=fe(e,t);return oe.emit("loadApp",{kind:r,status:"success"}),o}throw oe.emit("loadApp",{kind:r,status:"failed",reason:n.message}),n}};function ge(e,t){return me.apply(this,arguments)}function me(){return me=m(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timeout,i=void 0===n?1e4:n,o=new AbortController,a=setTimeout((function(){return o.abort()}),i),e.next=6,fetch(t,R(O({},r),{signal:o.signal,headers:{"content-type":"text/plain"}}));case 6:return s=e.sent,e.abrupt("return",(clearTimeout(a),s));case 8:case"end":return e.stop()}}),e)}))),me.apply(this,arguments)}var ye=function(){function e(){var t=this;y(this,e),this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=function(e){t.register({kind:e.kind,src:e.src})}}var t,r;return b(e,[{key:"setSyncRegisterApp",value:function(e){this.syncRegisterApp=e}},{key:"register",value:(r=m(regeneratorRuntime.mark((function e(t){var r,n,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appClassesCache.delete(t.kind),this.registered.set(t.kind,t),"string"==typeof(r=t.src)&&(n=function(){var e=m(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(r,t.kind,t.name);case 2:return n=e.sent,e.abrupt("return",n.__esModule?n.default:n);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),this.syncRegisterApp&&this.syncRegisterApp({kind:t.kind,src:r,name:t.name})),"function"==typeof r&&(n=function(){var e=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",((t.__esModule||t.default)&&(t=t.default),t));case 5:throw new Error("[WindowManager]: load remote script failed, ".concat(r));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),"object"==x(r)&&(n=function(){var e=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),this.appClasses.set(t.kind,m(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.appClassesCache.get(t.kind),e.abrupt("return",(r||(r=n(),o.appClassesCache.set(t.kind,r)),r));case 2:case"end":return e.stop()}}),e)})))),t.addHooks&&(i=this.createKindEmitter(t.kind))&&t.addHooks(i);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"unregister",value:function(e){this.appClasses.delete(e),this.appClassesCache.delete(e),this.registered.delete(e);var t=this.kindEmitters.get(e);t&&(t.clearListeners(),this.kindEmitters.delete(e))}},{key:"notifyApp",value:(t=m(regeneratorRuntime.mark((function e(t,r,n){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.kindEmitters.get(t),e.next=3,null==i?void 0:i.emit(r,n);case 3:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"createKindEmitter",value:function(e){if(!this.kindEmitters.has(e)){var t=new $.default;this.kindEmitters.set(e,t)}return this.kindEmitters.get(e)}}]),e}(),_e=new ye,be=function(){var e=m(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==(r=_e.appClasses.get(t))?void 0:r();case 2:return i=e.sent,e.abrupt("return",i&&(null==(n=i.config)?void 0:n.singleton)?t:"".concat(t,"-").concat(B.v4().replace("-","").slice(0,8)));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xe=function(e,t){if(e.focusScenePath!==t)return e.focusScenePath=t,e},we=function(e,t){if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){var r="/"===t?"":t;e.setScenePath(r)}},Se=function(e,t,r){e&&e.scenePathType(t)!==z.ScenePathType.None&&e.removeScenes(t,r)};j.debounce((function(e,t){e.emit("mainViewModeChange",t)}),200);var Te=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Me(e)[t];if(n){var i=n[r];if(i){var o=i.name;return t===ne?"/".concat(o):"".concat(t,"/").concat(o)}}},Me=function(e){return e.entireScenes()},ke=function(e,t,r,n){for(var i,o=0;o1&&void 0!==arguments[1]?arguments[1]:He();return this.flush(t),this.disposers.set(t,e()),t}},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He();return this.flush(t),this.disposers.set(t,e),t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:He();return this.add((function(){return e.addEventListener(t,r,n),function(){return e.removeEventListener(t,r,n)}}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:He();return this.add((function(){var i=window.setTimeout((function(){r.remove(n),e()}),t);return function(){return window.clearTimeout(i)}}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:He();return this.add((function(){var r=window.setInterval(e,t);return function(){return window.clearInterval(r)}}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach((function(e){try{e()}catch(e){console.error(e)}})),this.disposers.clear()}}]),e}(),$e=function(e){return function(t,r){if(void 0!==t){if(z.listenUpdated){var n=function(t){t.map((function(e){return e.kind})).includes(e)&&r()};return z.listenUpdated(t,n),r(),function(){return z.unlistenUpdated(t,n)}}return z.reaction((function(){return t}),(function(){r()}),{fireImmediately:!0})}}},Xe=function(e,t,r){var n=null,i=z.reaction(e,(function(){n&&(n(),n=null);var i=e();j.isObject(i)?(n=function(){return z.unlistenUpdated(i,t)},z.listenUpdated(i,t)):null==r||r(i)}),{fireImmediately:!0});return function(){null==n||n(),i()}},qe=$e(z.UpdateEventKind.Removed);$e(z.UpdateEventKind.Inserted);var Qe=function(){function e(){y(this,e),this.listeners=new Set}return b(e,[{key:"dispatch",value:function(e){this.listeners.forEach((function(t){return t(e)}))}},{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"removeListener",value:function(e){this.listeners.delete(e)}},{key:"length",get:function(){return this.listeners.size}}]),e}(),Ze=Object.keys;function Ke(e){return Boolean(j.has(e,"__isRef"))}var Je="_WM-STORAGE_",et=function(){function e(t,r,n){var i=this;if(y(this,e),this._sideEffect=new Ye,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Qe,n&&!j.isObject(n))throw new Error("Default state for Storage ".concat(r," is not an object."));this._context=t,this.id=r||null,this._state={};var o=this._getRawState(this._state);this._context.getIsWritable()&&(null===this.id?t.isAddApp&&n&&this.setState(n):(o===this._state||!j.isObject(o))&&(j.get(this._context.getAttributes(),[Je])||this._context.updateAttributes([Je],{}),this._context.updateAttributes([Je,this.id],this._state),n&&this.setState(n))),Ze(o).forEach((function(e){if(null!==i.id||e!==Je)try{var t=j.isObject(o[e])?JSON.parse(JSON.stringify(o[e])):o[e];Ke(t)?(i._state[e]=t.v,j.isObject(t.v)&&i._refMap.set(t.v,t)):i._state[e]=t}catch(t){console.error(t)}})),this._sideEffect.addDisposer(Xe((function(){return null===i.id?t.getAttributes():j.get(t.getAttributes(),[Je,i.id])}),this._updateProperties.bind(this),this.destroy.bind(this)))}return b(e,[{key:"addStateChangedListener",value:function(e){var t=this;return this.onStateChanged.addListener(e),function(){return t.onStateChanged.removeListener(e)}}},{key:"ensureState",value:function(e){var t=this;return this.setState(Ze(e).reduce((function(r,n){return j.has(t._state,n)||(r[n]=e[n]),r}),{}))}},{key:"setState",value:function(e){var t=this;if(this._destroyed)console.error(new Error('Cannot call setState on destroyed Storage "'.concat(this.id,'".')));else if(this._context.getIsWritable()){var r=Ze(e);r.length>0&&r.forEach((function(r){var n=e[r];if(n!==t._state[r])if(void 0===n)t._lastValue.set(r,t._state[r]),delete t._state[r],t._setRawState(r,n);else{t._lastValue.set(r,t._state[r]),t._state[r]=n;var i=n;if(j.isObject(n)){var o=t._refMap.get(n);o||(o=function(e){return{k:He(),v:e,__isRef:!0}}(n),t._refMap.set(n,o)),i=o}t._setRawState(r,i)}}))}else console.error(new Error('Cannot setState on Storage "'.concat(this.id,'" without writable access')),e)}},{key:"emptyStorage",value:function(){if(!(j.size(this._state)<=0)){if(this._destroyed)return void console.error(new Error('Cannot empty destroyed Storage "'.concat(this.id,'".')));if(!this._context.getIsWritable())return void console.error(new Error('Cannot empty Storage "'.concat(this.id,'" without writable access.')));this.setState(j.mapValues(this._state,j.noop))}}},{key:"deleteStorage",value:function(){if(null===this.id)throw new Error("Cannot delete main Storage");this._context.getIsWritable()?(this.destroy(),this._context.updateAttributes([Je,this.id],void 0)):console.error(new Error('Cannot delete Storage "'.concat(this.id,'" without writable access.')))}},{key:"destroy",value:function(){this._destroyed=!0,this._sideEffect.flushAll()}},{key:"_getRawState",value:function(e){var t;return null===this.id?null!=(t=this._context.getAttributes())?t:e:j.get(this._context.getAttributes(),[Je,this.id],e)}},{key:"_setRawState",value:function(e,t){if(null===this.id){if(e===Je)throw new Error('Cannot set attribute internal filed "'.concat(Je,'"'));return this._context.updateAttributes([e],t)}return this._context.updateAttributes([Je,this.id,e],t)}},{key:"_updateProperties",value:function(e){var t;if(this._destroyed)console.error(new Error('Cannot call _updateProperties on destroyed Storage "'.concat(this.id,'".')));else if(e.length>0){for(var r={},n=0;ns.pageState.length-1?(console.warn("[WindowManager] nextPage: index out of range"),!1):(s.appProxy.setSceneIndex(t),!0));case 2:case"end":return e.stop()}}),e)}))),this.jumpPage=function(){var e=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",0<=t&&t=s.pageState.length?(console.warn("[WindowManager]: page index ".concat(t," out of range")),!1):s.appProxy.removeSceneByIndex(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.emitter=i.appEmitter,this.isAddApp=i.isAddApp}return b(e,[{key:"dispatchAppEvent",value:function(e,t){se.emit("custom-".concat(this.kind),{kind:this.kind,appId:this.appId,type:e,value:t})}},{key:"storage",get:function(){return this._storage||(this._storage=new et(this)),this._storage}},{key:"pageState",get:function(){return this.appProxy.pageState}},{key:"kind",get:function(){return this.appProxy.kind}}]),e}(),rt=function(){function e(t){var r=this;y(this,e),this.params=t,this.sceneNode=null,this.onSceneChange=function(e){r.sceneNode=e,r.params.notifyPageStateChange()};var n=this.params,i=n.displayer,o=n.scenePath;o&&(this.sceneNode=i.createScenesCallback(o,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}return b(e,[{key:"getFullPath",value:function(e){var t,r=null==(t=this.sceneNode)?void 0:t.scenes;if(this.params.scenePath&&r){var n=r[e];if(n)return"".concat(this.params.scenePath,"/").concat(n)}}},{key:"toObject",value:function(){var e,t;return{index:(null==(e=this.params.view)?void 0:e.focusSceneIndex)||0,length:(null==(t=this.sceneNode)?void 0:t.scenes.length)||0}}},{key:"destroy",value:function(){var e;null==(e=this.sceneNode)||e.dispose()}}]),e}(),nt=function(e){return e.Apps="apps",e.Focus="focus",e.State="state",e.BoxState="boxState",e.MainViewCamera="mainViewCamera",e.MainViewSize="mainViewSize",e.Broadcaster="broadcaster",e.Cursors="cursors",e.Position="position",e.CursorState="cursorState",e.FullPath="fullPath",e.Registered="registered",e.IframeBridge="iframeBridge",e}(nt||{}),it=new(function(){function e(t){var r=this;y(this,e),this.context=t,this.setAppFocus=function(e,t){t?r.context.safeSetAttributes({focus:e}):r.context.safeSetAttributes({focus:void 0})}}return b(e,[{key:"setContext",value:function(e){this.context=e}},{key:"apps",value:function(){return j.get(this.attributes,["apps"])}},{key:"getAppAttributes",value:function(e){return j.get(this.apps(),[e])}},{key:"getAppState",value:function(e){return j.get(this.apps(),[e,"state"])}},{key:"getMaximized",value:function(){return j.get(this.attributes,["maximized"])}},{key:"getMinimized",value:function(){return j.get(this.attributes,["minimized"])}},{key:"setupAppAttributes",value:function(e,t,r){var n;this.attributes.apps||this.context.safeSetAttributes({apps:{}});var i=["scenePath","title"];r||i.push("scenes");var o=j.pick(e.options,i),a={kind:e.kind,options:o,isDynamicPPT:r};"string"==typeof e.src&&(a.src=e.src),a.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",t],a),this.context.safeUpdateAttributes(["apps",t,"state"],(w(n={},K.Size,{}),w(n,K.Position,{}),w(n,K.SceneIndex,0),n))}},{key:"updateAppState",value:function(e,t,r){j.get(this.attributes,["apps",e,"state"])&&this.context.safeUpdateAttributes(["apps",e,"state",t],r)}},{key:"cleanAppAttributes",value:function(e){this.context.safeUpdateAttributes(["apps",e],void 0),this.context.safeSetAttributes(w({},e,void 0)),this.attributes.focus===e&&this.cleanFocus()}},{key:"cleanFocus",value:function(){this.context.safeSetAttributes({focus:void 0})}},{key:"getAppSceneIndex",value:function(e){var t;return null==(t=this.getAppState(e))?void 0:t[K.SceneIndex]}},{key:"getAppScenePath",value:function(e){var t,r;return null==(r=null==(t=this.getAppAttributes(e))?void 0:t.options)?void 0:r.scenePath}},{key:"getMainViewScenePath",value:function(){return this.attributes._mainScenePath}},{key:"getMainViewSceneIndex",value:function(){return this.attributes._mainSceneIndex}},{key:"getBoxState",value:function(){return this.attributes.boxState}},{key:"setMainViewScenePath",value:function(e){this.context.safeSetAttributes({_mainScenePath:e})}},{key:"setMainViewSceneIndex",value:function(e){this.context.safeSetAttributes({_mainSceneIndex:e})}},{key:"getMainViewCamera",value:function(){return j.get(this.attributes,["mainViewCamera"])}},{key:"getMainViewSize",value:function(){return j.get(this.attributes,["mainViewSize"])}},{key:"setMainViewCamera",value:function(e){this.context.safeSetAttributes({mainViewCamera:O({},e)})}},{key:"setMainViewSize",value:function(e){0===e.width||0===e.height||this.context.safeSetAttributes({mainViewSize:O({},e)})}},{key:"setMainViewCameraAndSize",value:function(e,t){0===t.width||0===t.height||this.context.safeSetAttributes({mainViewCamera:O({},e),mainViewSize:O({},t)})}},{key:"updateCursor",value:function(e,t){j.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"position"],t)}},{key:"updateCursorState",value:function(e,t){j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"cursorState"],t)}},{key:"getCursorState",value:function(e){return j.get(this.attributes,["cursors",e,"cursorState"])}},{key:"cleanCursor",value:function(e){this.context.safeUpdateAttributes(["cursors",e],void 0)}},{key:"setMainViewFocusPath",value:function(e){var t=this.getMainViewScenePath();t&&xe(e,t)}},{key:"getIframeBridge",value:function(){return j.get(this.attributes,["iframeBridge"])}},{key:"setIframeBridge",value:function(e){if(j.isObject(e)){var t=this.getIframeBridge();for(var r in e){var n=e[r];t[r]!==n&&this.context.safeUpdateAttributes(["iframeBridge",r],n)}}}},{key:"attributes",get:function(){return this.context.getAttributes()}},{key:"focus",get:function(){return j.get(this.attributes,["focus"])}}]),e}())({getAttributes:function(){throw new Error("getAttributes not implemented")},safeSetAttributes:function(){throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:function(){throw new Error("safeUpdateAttributes not implemented")}}),ot=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n0&&o.zIndex!==(null==(r=a.box)?void 0:r.zIndex)&&(null==(n=a.boxManager)||n.setZIndex(e,o.zIndex),null==(i=a.boxManager)||i.focusBox({appId:e}))}))})),a.manager.refresher.add("".concat(e,"-fullPath"),(function(){return z.autorun((function(){var e,t=null==(e=a.appAttributes)?void 0:e.fullPath;a.setFocusScenePathHandler(t),a._prevFullPath!==t&&(a.notifyPageStateChange(),a._prevFullPath=t)}))}))},this.setFocusScenePathHandler=j.debounce((function(e){var t;a.view&&e&&e!==(null==(t=a.view)?void 0:t.focusScenePath)&&(xe(a.view,e),oe.emit("onAppScenePathChange",{appId:a.id,view:a.view}))}),50),this.notifyPageStateChange=j.debounce((function(){a.appEmitter.emit("pageStateChange",a.pageState)}),50),this.kind=t.kind,this.id=n,this.stateKey="".concat(this.id,"_state"),this.appProxies.set(this.id,this),this.appEmitter=new $.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=i,this.initScenes(),null!=(o=this.params.options)&&o.scenePath&&this.createView(),this._pageState=new rt({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange})}var t,r,n,i,o,a,s,u;return b(e,[{key:"initScenes",value:function(){var e,t=this.params.options;t&&(this.scenePath=t.scenePath,(null==(e=this.appAttributes)?void 0:e.isDynamicPPT)&&this.scenePath?this.scenes=Me(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}},{key:"getFullScenePath",value:function(){if(this.scenePath)return j.get(this.appAttributes,[nt.FullPath])||this.getFullScenePathFromScenes()}},{key:"getFullScenePathFromScenes",value:function(){var e=j.get(this.appAttributes,["state","SceneIndex"],0),t=function(e,t,r){var n;if(e&&t){var i=null==(n=Me(e)[t])?void 0:n[r];if(i)return"".concat(t,"/").concat(i.name)}}(this.manager.room,this.scenePath,e);return t&&this.setFullPath(t),t}},{key:"setFullPath",value:function(e){this.manager.safeUpdateAttributes(["apps",this.id,nt.FullPath],e)}},{key:"baseInsertApp",value:(u=m(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]&&a[0],(n=this.params).kind){e.next=4;break}throw new Error("[WindowManager]: kind require");case 4:return e.next=6,null==(r=_e.appClasses.get(n.kind))?void 0:r();case 6:if(i=e.sent,o=_e.registered.get(n.kind),!i){e.next=13;break}return e.next=11,this.setupApp(this.id,t,i,n.options,null==o?void 0:o.appOptions);case 11:e.next=14;break;case 13:throw new Error("[WindowManager]: app load failed ".concat(n.kind," ").concat(n.src));case 14:return e.abrupt("return",(se.emit("updateManagerRect"),{appId:this.id,app:i}));case 15:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"setupApp",value:(s=m(regeneratorRuntime.mark((function e(t,r,n,i,o){var a,s,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ot("setupApp",t,n,i),this.boxManager){e.next=2;break}throw new Fe;case 2:s=new tt(this.manager,this.boxManager,t,this,o),this.appContext=s,e.prev=4,se.once("".concat(t).concat(q.WindowCreated)).then(m(regeneratorRuntime.mark((function e(){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r||(o=u.getAppInitState(t),null==(i=u.boxManager)||i.updateBoxState(o)),u.appEmitter.onAny(u.appListener),u.appAttributesUpdateListener(t),u.setViewFocusScenePath(),setTimeout(m(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("setup app",n),e.next=3,n.setup(s);case 3:r=e.sent,u.appResult=r,_e.notifyApp(u.kind,"created",{appId:t,result:r}),u.afterSetupApp(o),u.fixMobileSize(),oe.emit("onAppSetup",t);case 5:case"end":return e.stop()}}),e)}))),50);case 1:case"end":return e.stop()}}),e)})))),null==(a=this.boxManager)||a.createBox({appId:t,app:n,options:i,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),this.isAddApp&&this.box&&(this.store.updateAppState(t,K.ZIndex,this.box.zIndex),this.store.updateAppState(t,K.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:t},!1)),e.next=11;break;case 8:throw e.prev=8,e.t0=e.catch(4),console.error(e.t0),new Error("[WindowManager]: app setup error: ".concat(e.t0.message));case 11:case"end":return e.stop()}}),e,this,[[4,8]])}))),function(e,t,r,n,i){return s.apply(this,arguments)})},{key:"fixMobileSize",value:function(){var e,t,r=null==(e=this.boxManager)?void 0:e.getBox(this.id);r&&(null==(t=this.boxManager)||t.resizeBox({appId:this.id,width:r.intrinsicWidth+.001,height:r.intrinsicHeight+.001,skipUpdate:!0}))}},{key:"afterSetupApp",value:function(e){var t;e&&(null==e||!e.x||!e.y)&&(null==(t=this.boxManager)||t.setBoxInitState(this.id))}},{key:"onSeek",value:(a=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appEmitter.emit("seek",t).catch((function(e){console.log("[WindowManager]: emit seek error: ".concat(e.message))})),n=this.getAppInitState(this.id),null==(r=this.boxManager)||r.updateBoxState(n);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"onReconnected",value:(o=m(regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Boolean(this.manager.attributes.apps[this.id])){t.next=4;break}return t.next=3,this.destroy(!0,!1,!0);case 3:return t.abrupt("return");case 4:return this.appEmitter.emit("reconnected",void 0),n=this.getAppInitState(this.id),t.next=8,this.destroy(!0,!1,!0);case 8:return i=this.params,t.next=11,new e(i,this.manager,this.id,this.isAddApp).baseInsertApp(!0);case 11:null==(r=this.boxManager)||r.updateBoxState(n);case 12:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"onRemoveScene",value:(i=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.scenePath&&t.startsWith(this.scenePath+"/")&&(r=this.pageState.index,(n=this._pageState.getFullPath(r))||(r=0,n=this._pageState.getFullPath(r)),n&&this.setFullPath(n),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=r));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"emitAppSceneStateChange",value:function(e){this.appEmitter.emit("sceneStateChange",e)}},{key:"emitAppIsWritableChange",value:function(){this.appEmitter.emit("writableChange",this.isWritable)}},{key:"makeAppEventListener",value:function(e){var t=this;return function(r,n){var i,o,a,s;if(t.manager.canOperate)switch(r){case"setBoxSize":null==(i=t.boxManager)||i.resizeBox({appId:e,width:n.width,height:n.height,skipUpdate:!1});break;case"setBoxMinSize":null==(o=t.boxManager)||o.setBoxMinSize({appId:e,minWidth:n.minwidth,minHeight:n.minheight});break;case"setBoxTitle":null==(a=t.boxManager)||a.setBoxTitle({appId:e,title:n.title});break;case J.destroy:if("destroyed"===t.status)return;t.destroy(!0,!1,!0,null==n?void 0:n.error),null!=n&&n.error&&console.error(null==n?void 0:n.error);break;case"focus":null==(s=t.boxManager)||s.focusBox({appId:t.id}),st.emit("focus",{appId:t.id})}}}},{key:"setScenePath",value:function(){if(this.manager.canOperate){var e=this.getFullScenePath();this.manager.room&&e&&this.view&&we(this.manager.room,e)}}},{key:"setViewFocusScenePath",value:function(){var e=this.getFullScenePath();return e&&this.view&&xe(this.view,e),e}},{key:"createView",value:(n=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.viewManager.createView(this.id);case 2:return t=e.sent,e.abrupt("return",(this.setViewFocusScenePath(),t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"removeSceneByIndex",value:(r=m(regeneratorRuntime.mark((function e(t){var r,n,i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._pageState.getFullPath(t))){e.next=6;break}return n=at(t,this.pageState),e.abrupt("return",(this.setSceneIndexWithoutSync(n),this.manager.dispatchInternalEvent(q.SetAppFocusIndex,{type:"app",appID:this.id,index:n}),setTimeout((function(){Se(i.manager.room,r,t)}),100),!0));case 6:return e.abrupt("return",!1);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setSceneIndexWithoutSync",value:function(e){this.view&&(this.view.focusSceneIndex=e)}},{key:"setSceneIndex",value:function(e){if(this.view){this.view.focusSceneIndex=e;var t=this._pageState.getFullPath(e);t&&this.setFullPath(t)}}},{key:"destroy",value:(t=m(regeneratorRuntime.mark((function e(t,r,n,i){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("destroyed"===this.status){e.next=13;break}return this.status="destroyed",e.prev=2,e.next=5,_e.notifyApp(this.kind,"destroy",{appId:this.id});case 5:return e.next=7,this.appEmitter.emit("destroy",{error:i});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error("[WindowManager]: notifyApp error",e.t0.message,e.t0.stack);case 12:this.appEmitter.clearListeners(),se.emit("destroy-".concat(this.id),{error:i}),t&&(null==(o=this.boxManager)||o.closeBox(this.id,n)),r&&(this.store.cleanAppAttributes(this.id),this.scenePath&&Se(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this._pageState.destroy(),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),this.manager.refresher.remove(this.id),this.manager.refresher.remove(this.stateKey),this.manager.refresher.remove("".concat(this.id,"-fullPath")),this._prevFullPath=void 0;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,r,n,i){return t.apply(this,arguments)})},{key:"close",value:function(){return this.destroy(!0,!0,!1)}},{key:"view",get:function(){return this.manager.viewManager.getView(this.id)}},{key:"viewIndex",get:function(){var e;return null==(e=this.view)?void 0:e.focusSceneIndex}},{key:"isWritable",get:function(){var e;return this.manager.canOperate&&!(null!=(e=this.box)&&e.readonly)}},{key:"attributes",get:function(){return this.manager.attributes[this.id]}},{key:"appAttributes",get:function(){return this.store.getAppAttributes(this.id)}},{key:"box",get:function(){var e;return null==(e=this.boxManager)?void 0:e.getBox(this.id)}},{key:"pageState",get:function(){return this._pageState.toObject()}}]),e}(),lt=function(){function e(t){y(this,e),this.displayer=t,this.views=new Map}return b(e,[{key:"createView",value:function(e){var t=ct(this.displayer);return this.views.set(e,t),t}},{key:"getView",value:function(e){return this.views.get(e)}},{key:"destroyView",value:function(e){var t=this.views.get(e);if(t){try{t.release()}catch(e){}this.views.delete(e)}}},{key:"setViewScenePath",value:function(e,t){var r=this.views.get(e);r&&(r.focusScenePath=t)}},{key:"destroy",value:function(){this.views.forEach((function(e){try{e.release()}catch(e){}})),this.views.clear()}}]),e}(),ct=function(e){var t=e.views.createView();return ht(t),t},ht=function(e){e.setCameraBound({maxContentMode:function(){return 10},minContentMode:function(){return.1}})},dt=function(){function e(t){var r=this;y(this,e),this.manager=t,this.polling=!1,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.viewMode=this.manager.windowManger.viewMode,this.sideEffectManager=new Ye,this.syncCamera=function(){if(r.polling&&r.viewMode===z.ViewMode.Broadcaster){var e=r.mainViewCamera;e&&e.id!==r.manager.uid&&r.moveCameraSizeByAttributes()}},this.startListenWritableChange=function(){r.sideEffectManager.add((function(){return se.on("writableChange",(function(e){e&&r.ensureCameraAndSize(),r.manager.room&&r.syncMainView(r.manager.room)}))}))},this.addCameraReaction=function(){r.manager.refresher.add(nt.MainViewCamera,r.cameraReaction)},this.cameraReaction=function(){return z.reaction((function(){return r.mainViewCamera}),(function(e){e&&e.id!==r.manager.uid&&(r.moveCameraToContian(r.mainViewSize),r.moveCamera(e))}),{fireImmediately:!0})},this.sizeChangeHandler=j.debounce((function(e){e&&(r.moveCameraToContian(e),r.moveCamera(r.mainViewCamera)),r.ensureMainViewSize()}),30),this.onUpdateContainerSizeRatio=function(){var e=r.store.getMainViewSize();r.sizeChangeHandler(e)},this.onCameraUpdatedByDevice=function(e){r.viewMode!==z.ViewMode.Follower&&(r.store.setMainViewCamera(R(O({},e),{id:r.manager.uid})),j.isEqual(r.mainViewSize,R(O({},r.mainView.size),{id:r.manager.uid}))||r.setMainViewSize(r.view.size))},this.mainViewClickListener=function(){r.mainViewClickHandler()},this.setMainViewSize=j.debounce((function(e){r.store.setMainViewSize(R(O({},e),{id:r.manager.uid}))}),50),this._syncMainViewTimer=0,this.onCameraOrSizeUpdated=function(){oe.emit("cameraStateChange",r.cameraState),r.manager.room&&r.manager.room.syncMainView&&(clearTimeout(r._syncMainViewTimer),r._syncMainViewTimer=setTimeout(r.syncMainView,100,r.manager.room)),r.ensureMainViewSize()},this.syncMainView=function(e){e.isWritable&&e.syncMainView(r.mainView)},this.setViewMode=function(e){r.viewMode=e},this.mainView=this.createMainView(),this.moveCameraSizeByAttributes(),se.once("mainViewMounted").then((function(){r.addMainViewListener(),r.start(),r.ensureCameraAndSize(),r.startListenWritableChange()}));var n=function(){r.sizeChangeHandler(r.mainViewSize)};this.sideEffectManager.add((function(){return se.on("playgroundSizeChange",n)})),this.sideEffectManager.add((function(){return se.on("containerSizeRatioUpdate",r.onUpdateContainerSizeRatio)})),this.sideEffectManager.add((function(){return se.on("startReconnect",(function(){r.didRelease||r.mainView.release()}))})),this.sideEffectManager.setInterval(this.syncCamera,1500)}var t;return b(e,[{key:"ensureCameraAndSize",value:function(){this.viewMode===z.ViewMode.Broadcaster&&(!this.mainViewCamera||!this.mainViewSize)&&(this.manager.dispatchInternalEvent(q.InitMainViewCamera),this.setCameraAndSize())}},{key:"moveCameraSizeByAttributes",value:function(){this.moveCameraToContian(this.mainViewSize),this.moveCamera(this.mainViewCamera)}},{key:"start",value:function(){this.sizeChangeHandler(this.mainViewSize),!this.started&&(this.addCameraListener(),this.addCameraReaction(),this.manager.room&&this.syncMainView(this.manager.room),this.started=!0)}},{key:"setCameraAndSize",value:function(){var e=R(O({},this.mainView.camera),{id:this.manager.uid}),t=R(O({},this.mainView.size),{id:this.manager.uid});this.store.setMainViewCameraAndSize(e,t)}},{key:"createMainView",value:function(){var e=ct(this.manager.displayer),t=this.store.getMainViewScenePath();return t&&xe(e,t),e}},{key:"onReconnect",value:function(){if(this.didRelease)this.rebind();else{var e=this.store.getMainViewScenePath();this.setFocusScenePath(e)}}},{key:"setFocusScenePath",value:function(e){if(e)return xe(this.view,e)}},{key:"rebind",value:function(){var e=this.mainView.divElement,t=this.mainView.disableCameraTransform;this.stop(),this.didRelease||this.mainView.release(),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=t,this.mainView.divElement=e,this.addMainViewListener(),this.start(),oe.emit("onMainViewRebind",this.mainView)}},{key:"addMainViewListener",value:function(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}},{key:"removeMainViewListener",value:function(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}},{key:"mainViewClickHandler",value:(t=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!this.manager.canOperate||(this.store.cleanFocus(),null==(t=this.manager.boxManager)||t.blurAllBox());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"addCameraListener",value:function(){this.view.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"removeCameraListener",value:function(){this.view.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"ensureMainViewSize",value:function(){(!this.mainViewSize||0===this.mainViewSize.width||0===this.mainViewSize.height)&&this.mainView.size.width>0&&this.mainView.size.height>0&&this.setMainViewSize(this.mainView.size)}},{key:"moveCameraToContian",value:function(e){j.isEmpty(e)||(this.view.moveCameraToContain({width:e.width,height:e.height,originX:-e.width/2,originY:-e.height/2,animationMode:z.AnimationMode.Immediately}),this.scale=this.view.camera.scale)}},{key:"moveCamera",value:function(e){if(!j.isEmpty(e)){if(j.isEqual(e,this.view.camera))return;var t=e.centerX,r=e.centerY,n=e.scale*(this.scale||1);this.view.moveCamera({centerX:t,centerY:r,scale:n,animationMode:z.AnimationMode.Immediately})}}},{key:"stop",value:function(){this.removeCameraListener(),this.manager.refresher.remove(nt.MainViewCamera),this.manager.refresher.remove(nt.MainViewSize),this.started=!1}},{key:"destroy",value:function(){this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}},{key:"mainViewCamera",get:function(){return this.store.getMainViewCamera()}},{key:"mainViewSize",get:function(){return this.store.getMainViewSize()}},{key:"didRelease",get:function(){return j.get(this.view,["didRelease"])}},{key:"view",get:function(){return this.mainView}},{key:"cameraState",get:function(){return O(O({},this.view.camera),this.view.size)}}]),e}(),ft=function(){function e(t){var r=this;y(this,e),this.context=t,this.addRedoUndoListeners=function(e){if(void 0===e)r.addViewCallbacks(r.context.mainView(),r.onCanRedoStepsUpdate,r.onCanUndoStepsUpdate);else{var t=r.context.getAppProxy(e);t&&t.view&&r.addViewCallbacks(t.view,r.onCanRedoStepsUpdate,r.onCanUndoStepsUpdate)}},this.addViewCallbacks=function(e,t,r){t(e.canRedoSteps),r(e.canUndoSteps),e.callbacks.on("onCanRedoStepsUpdate",t),e.callbacks.on("onCanUndoStepsUpdate",r)},this.disposeViewCallbacks=function(e){e.callbacks.off("onCanRedoStepsUpdate",r.onCanRedoStepsUpdate),e.callbacks.off("onCanUndoStepsUpdate",r.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=function(e){oe.emit("canRedoStepsChange",e)},this.onCanUndoStepsUpdate=function(e){oe.emit("canUndoStepsChange",e)},this.disposePrevFocusViewRedoUndoListeners=function(e){var t;if(void 0===e)t=r.context.mainView();else{var n=r.context.getAppProxy(e);n&&n.view&&(t=n.view)}t&&r.disposeViewCallbacks(t)},se.on("focusedChange",(function(e){r.disposePrevFocusViewRedoUndoListeners(e.prev),setTimeout((function(){r.addRedoUndoListeners(e.focused)}),0)})),se.on("rootDirRemoved",(function(){r.disposePrevFocusViewRedoUndoListeners(t.focus()),r.addRedoUndoListeners(t.focus())})),this.addRedoUndoListeners(t.focus())}return b(e,[{key:"destroy",value:function(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}]),e}(),pt=function(){function e(t){var r=this;y(this,e),this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=it,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new ae,this.sideEffectManager=new Ye,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((o=t.scenePath)!==ne){e.next=6;break}return e.next=4,r.onRootDirRemoved();case 4:return r.dispatchInternalEvent(q.RootDirRemoved),e.abrupt("return");case 6:if(!Pe(o)){e.next=14;break}return a=r.mainView.focusSceneIndex||0,(s=null==(n=r.callbacksNode)?void 0:n.scenes[a])||(a=0,s=null==(i=r.callbacksNode)?void 0:i.scenes[a]),s&&r.setMainViewScenePath("".concat(ne).concat(s)),e.next=12,r.setMainViewSceneIndex(a);case 12:e.next=15;break;case 14:r.appProxies.forEach((function(e){e.onRemoveScene(o)}));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReadonlyChanged=function(){r.appProxies.forEach((function(e){e.emitAppIsWritableChange()}))},this.onPlayerSeekStart=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.closeAll();case 2:case"end":return e.stop()}}),e)}))),this.onPlayerSeekDone=function(){var e=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.attributesUpdateCallback(r.attributes.apps);case 2:r.appProxies.forEach((function(e){e.onSeek(t)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.createRootDirScenesCallback=function(){var e,t=!1;r.callbacksNode&&(r.callbacksNode.dispose(),t=!0),r.callbacksNode=r.displayer.createScenesCallback(ne,{onAddScene:r.onSceneChange,onRemoveScene:(e=m(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.onSceneChange(t);case 2:se.emit("rootDirSceneRemoved",n);case 3:case"end":return e.stop()}}),e)}))),function(t,r){return e.apply(this,arguments)})}),r.callbacksNode&&(r.updateSceneState(r.callbacksNode),r.mainViewScenesLength=r.callbacksNode.scenes.length,t&&r.emitMainViewScenesChange(r.callbacksNode.scenes.length))},this.removeSceneByIndex=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=at(t,r.windowManger.pageState),r.setSceneIndexWithoutSync(i),r.dispatchInternalEvent(q.SetAppFocusIndex,{type:"main",index:i}),o=null==(n=r.callbacksNode)?void 0:n.scenes[t],e.abrupt("return",(setTimeout((function(){o&&Se(r.room,"".concat(ne).concat(o),t)}),100),new Promise((function(e,t){se.once("rootDirSceneRemoved").then((function(t){t===o&&e(!0)})).catch((function(e){console.log("[WindowManager]: removePage error: ".concat(e)),t(!1)}))}))));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.setSceneIndexWithoutSync=function(e){var t,n=null==(t=r.callbacksNode)?void 0:t.scenes[e];n&&r.mainViewProxy.setFocusScenePath("".concat(ne).concat(n))},this.onSceneChange=function(e){return r.mainViewScenesLength=e.scenes.length,r.updateSceneState(e),r.emitMainViewScenesChange(r.mainViewScenesLength)},this.emitMainViewScenesChange=function(e){return Promise.all([oe.emit("mainViewScenesLengthChange",e),se.emit("changePageState")])},this.updateSceneState=function(e){var t=r.store.getMainViewSceneIndex()||0,n=e.scenes[t];n||(n=e.scenes[r.mainView.focusSceneIndex||0]),r.sceneState={scenePath:"".concat(ne).concat(n),contextPath:e.path,index:t,scenes:e.scenes.map((function(e){return{name:e}})),sceneName:n},oe.emit("sceneStateChange",r.sceneState)},this.onBoxMove=function(e){r.dispatchInternalEvent(q.AppMove,e),r.store.updateAppState(e.appId,K.Position,{x:e.x,y:e.y}),oe.emit("onBoxMove",e)},this.onBoxResize=function(e){e.width&&e.height&&(r.dispatchInternalEvent(q.AppResize,e),r.store.updateAppState(e.appId,K.Size,{width:e.width,height:e.height}),oe.emit("onBoxResize",e))},this.onBoxFocus=function(e){r.windowManger.safeSetAttributes({focus:e.appId}),oe.emit("onBoxFocus",e)},this.onBoxClose=function(e){var t=r.appProxies.get(e.appId);t&&t.destroy(!1,!0,!0,e.error),oe.emit("onBoxClose",e)},this.onBoxStateChange=function(e){r.dispatchInternalEvent(q.AppBoxStateChange,e),oe.emit("onBoxStateChange",e)},this.addAppsChangeListener=function(){r.refresher.add("apps",(function(){return Xe((function(){return r.attributes.apps}),(function(){r.attributesUpdateCallback(r.attributes.apps)}))}))},this.addAppCloseListener=function(){r.refresher.add("appsClose",(function(){return qe(r.attributes.apps,(function(){r.onAppDelete(r.attributes.apps)}))}))},this.onMainViewIndexChange=function(e){void 0!==e&&r._prevSceneIndex!==e&&(oe.emit("mainViewSceneIndexChange",e),se.emit("changePageState"),r.callbacksNode&&r.updateSceneState(r.callbacksNode),r._prevSceneIndex=e)},this.onFocusChange=function(e){var t;r._prevFocused!==e&&(oe.emit("focusedChange",e),se.emit("focusedChange",{focused:e,prev:r._prevFocused}),r._prevFocused=e,void 0!==e&&(null==(t=r.boxManager)||t.focusBox({appId:e}),setTimeout((function(){var t=r.appProxies.get(e);t&&_e.notifyApp(t.kind,"focus",{appId:e})}),0)))},this.attributesUpdateCallback=j.debounce((function(e){return r._attributesUpdateCallback(e)}),100),this._appIds=[],this.onRegisteredChange=function(e){!e||Object.entries(e).forEach((function(e){var t=o(e,2),r=t[0],n=t[1];_e.appClasses.has(r)||_e.register({kind:r,src:n.src,name:n.name})}))},this.onMinimized=function(e){var t,n;(null==(t=r.boxManager)?void 0:t.minimized)!==e&&(!0===e&&(null==(n=r.boxManager)||n.blurAllBox()),setTimeout((function(){var t;null==(t=r.boxManager)||t.setMinimized(Boolean(e))}),0))},this.onAppDelete=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object.keys(t),i=S(r.appProxies.entries()),e.prev=2,i.s();case 4:if((a=i.n()).done){e.next=12;break}if(s=o(a.value,2),u=s[0],l=s[1],e.t0=n.includes(u),e.t0){e.next=10;break}return e.next=10,l.destroy(!0,!1,!0);case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t1=e.catch(2),i.e(e.t1);case 17:return e.prev=17,i.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[2,14,17,20]])})));return function(t){return e.apply(this,arguments)}}(),this.closeAll=m(regeneratorRuntime.mark((function e(){var t,n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=S(r.appProxies.entries()),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return i=o(n.value,2),i[0],a=i[1],e.next=7,a.destroy(!0,!1,!0);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])}))),this.displayerStateListener=function(e){r.appProxies.forEach((function(t){t.appEmitter.emit("roomStateChange",e)})),se.emit("observerIdChange",r.displayer.observerId)},this.displayerWritableListener=function(e){var t,n,i=!e,o=void 0===r.windowManger.readonly||!1===r.windowManger.readonly;void 0===r.windowManger.readonly?null==(t=r.boxManager)||t.setReadonly(e):null==(n=r.boxManager)||n.setReadonly(!(i&&o)),r.appProxies.forEach((function(e){e.emitAppIsWritableChange()})),se.emit("writableChange",i)},this.updateSceneIndex=function(){var e=r.store.getMainViewScenePath(),t=Ee(e),n=Me(r.displayer)[t];if(n.length){var i=e.replace(t,"").replace("/",""),o=n.findIndex((function(e){return e.name===i}));j.isInteger(o)&&o>=0&&r.safeSetAttributes({_mainSceneIndex:o})}},this.updateRootDirRemoving=function(e){r.rootDirRemoving=e},this.displayer=t.displayer,this.store.setContext({getAttributes:function(){return r.attributes},safeSetAttributes:function(e){return r.safeSetAttributes(e)},safeUpdateAttributes:function(e,t){return r.safeUpdateAttributes(e,t)}}),this.mainViewProxy=new dt(this),this.viewManager=new lt(this.displayer),this.appListeners=new Ne(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=q_,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:se}),this.sideEffectManager.addDisposer((function(){var e,t;r.appCreateQueue.destroy(),r.mainViewProxy.destroy(),r.refresher.destroy(),r.viewManager.destroy(),null==(e=r.boxManager)||e.destroy(),null==(t=r.callbacksNode)||t.dispose()})),se.once("onCreated").then((function(){return r.onCreated()})),se.on("onReconnected",(function(){return r.onReconnected()})),z.isPlayer(this.displayer)&&(se.on("seekStart",this.onPlayerSeekStart),se.on("seek",this.onPlayerSeekDone)),se.on("removeScenes",this.onRemoveScenes),se.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),_e.setSyncRegisterApp((function(e){r.safeUpdateAttributes([nt.Registered,e.kind],e)}))}var t,r,n,i,a,s,u,l,c,h,d;return b(e,[{key:"getMemberState",value:function(){var e;return(null==(e=this.room)?void 0:e.state.memberState)||{strokeColor:[0,0,0]}}},{key:"onRootDirRemoved",value:(d=m(regeneratorRuntime.mark((function e(){var t,r,n,i,a,s,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!(u.length>0&&void 0!==u[0])||u[0],this.setMainViewScenePath(ie),this.createRootDirScenesCallback(),r=S(this.appProxies.entries()),e.prev=3,r.s();case 5:if((n=r.n()).done){e.next=13;break}if(i=o(n.value,2),a=i[0],s=i[1],e.t0=s.view,!e.t0){e.next=11;break}return e.next=11,this.closeApp(a,t);case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(3),r.e(e.t1);case 18:return e.prev=18,r.f(),e.finish(18);case 21:this.mainViewProxy.rebind(),se.emit("rootDirRemoved"),this.updateRootDirRemoving(!1);case 22:case"end":return e.stop()}}),e,this,[[3,15,18,21]])}))),function(){return d.apply(this,arguments)})},{key:"getMainViewSceneDir",value:function(){var e=this.store.getMainViewScenePath();if(e)return Ee(e);throw new Error("[WindowManager]: mainViewSceneDir not found")}},{key:"onCreated",value:(h=m(regeneratorRuntime.mark((function e(){var t,r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.attributesUpdateCallback(this.attributes.apps);case 2:if(se.emit("updateManagerRect"),st.on("move",this.onBoxMove),st.on("resize",this.onBoxResize),st.on("focus",this.onBoxFocus),st.on("close",this.onBoxClose),st.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),this.refresher.add("maximized",(function(){return z.autorun((function(){var e,t=n.attributes.maximized;null==(e=n.boxManager)||e.setMaximized(Boolean(t))}))})),this.refresher.add("minimized",(function(){return z.autorun((function(){var e=n.attributes.minimized;n.onMinimized(e)}))})),this.refresher.add("mainViewIndex",(function(){return z.autorun((function(){var e=j.get(n.attributes,"_mainSceneIndex");n.onMainViewIndexChange(e)}))})),this.refresher.add("focusedChange",(function(){return z.autorun((function(){var e=j.get(n.attributes,"focus");n.onFocusChange(e)}))})),this.refresher.add("registeredChange",(function(){return z.autorun((function(){var e=j.get(n.attributes,nt.Registered);n.onRegisteredChange(e)}))})),this.attributes.apps&&0!==Object.keys(this.attributes.apps).length){e.next=20;break}if(r=this.store.getMainViewScenePath()){e.next=19;break}return e.abrupt("return");case 19:this.resetScenePath(r);case 20:this.displayerWritableListener(!(null!=(t=this.room)&&t.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this._prevFocused=this.attributes.focus,this.sideEffectManager.add((function(){var e=new ft({mainView:function(){return n.mainViewProxy.view},focus:function(){return n.attributes.focus},getAppProxy:function(e){return n.appProxies.get(e)}});return function(){return e.destroy()}}));case 21:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"notifyAppsChange",value:function(e){(this._appIds.length!==e.length||!this._appIds.every((function(t){return e.includes(t)})))&&(this._appIds=e,oe.emit("appsChange",e))}},{key:"_attributesUpdateCallback",value:(c=m(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&Z_.container){0===(r=Object.keys(t)).length&&this.appCreateQueue.emitReady(),n=j.orderBy(r.map((function(e){return{id:e,createdAt:t[e].createdAt}})),"createdAt","asc").map((function(e){return e.id})),this.notifyAppsChange(n),i=S(n);try{for(a=function(){var e=o.value;if(!s.appProxies.has(e)&&!s.appStatus.has(e)){var r=t[e];try{if(!s.attributes[e])throw new Error("appAttributes is undefined");s.appCreateQueue.push((function(){return s.appStatus.set(e,ee.StartCreate),s.baseInsertApp({kind:r.kind,options:r.options,isDynamicPPT:r.isDynamicPPT},e,!1)})),s.focusByAttributes(t)}catch(e){console.warn("[WindowManager]: Insert App Error",e)}}},i.s();!(o=i.n()).done;)a()}catch(e){i.e(e)}finally{i.f()}}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"refresh",value:function(){this.attributesUpdateCallback(this.attributes.apps)}},{key:"setBoxManager",value:function(e){this.boxManager=e}},{key:"resetMaximized",value:function(){var e;null==(e=this.boxManager)||e.setMaximized(Boolean(this.store.getMaximized()))}},{key:"resetMinimized",value:function(){var e;null==(e=this.boxManager)||e.setMinimized(Boolean(this.store.getMinimized()))}},{key:"bindMainView",value:function(e,t){var r=this.mainViewProxy.view;r.disableCameraTransform=t,r.divElement=e,r.focusScenePath||this.setMainViewFocusPath(),se.emit("mainViewMounted"),oe.emit("onMainViewMounted",r)}},{key:"setMainViewFocusPath",value:function(e){var t,r=e||this.store.getMainViewScenePath();if(r)return xe(this.mainView,r),(null==(t=this.mainView)?void 0:t.focusScenePath)===r}},{key:"resetScenePath",value:function(e){this.displayer.state.sceneState.scenePath!==e&&we(this.room,e)}},{key:"addApp",value:(l=m(regeneratorRuntime.mark((function e(t,r){var n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ot("addApp",t),e.next=3,this.beforeAddApp(t,r);case 3:return n=e.sent,i=n.appId,o=n.needFocus,e.next=8,this.baseInsertApp(t,i,!0,o);case 8:return a=e.sent,e.abrupt("return",(this.afterAddApp(a),null==a?void 0:a.id));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"beforeAddApp",value:(u=m(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,be(t.kind);case 2:return o=e.sent,this.appStatus.set(o,ee.StartCreate),a=null!=(n=t.attributes)?n:{},this.safeUpdateAttributes([o],a),this.store.setupAppAttributes(t,o,r),s=!(null!=(i=this.boxManager)&&i.minimized),e.abrupt("return",(s&&this.store.setAppFocus(o,!0),{appId:o,needFocus:s}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"afterAddApp",value:function(e){var t,r;if(e&&e.box){var n=e.box;st.emit("move",{appId:e.id,x:null==n?void 0:n.intrinsicX,y:null==n?void 0:n.intrinsicY}),this.store.updateAppState(e.id,K.ZIndex,n.zIndex)}null!=(t=this.boxManager)&&t.minimized&&(null==(r=this.boxManager)||r.setMinimized(!1,!1))}},{key:"closeApp",value:(s=m(regeneratorRuntime.mark((function e(t){var r,n,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!(i.length>1&&void 0!==i[1])||i[1],(n=this.appProxies.get(t))&&n.destroy(!0,r,!1);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"baseInsertApp",value:(a=m(regeneratorRuntime.mark((function e(t,r,n,i){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appProxies.has(r)){e.next=3;break}return console.warn("[WindowManager]: app duplicate exists and cannot be created again"),e.abrupt("return");case 3:if(!(o=new ut(t,this,r,n))){e.next=9;break}return e.next=7,o.baseInsertApp(i);case 7:return this.appStatus.delete(r),e.abrupt("return",o);case 9:throw this.appStatus.delete(r),new Error("[WindowManger]: initialize AppProxy failed");case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return a.apply(this,arguments)})},{key:"safeSetAttributes",value:function(e){this.windowManger.safeSetAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.windowManger.safeUpdateAttributes(e,t)}},{key:"setMainViewScenePath",value:(i=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=17;break}if(r=this.displayer.scenePathType(t),Ee(t)===ne){e.next=4;break}throw new Error('[WindowManager]: main view scenePath must in root dir "/"');case 4:if(r!==z.ScenePathType.None){e.next=6;break}throw new Error("[WindowManager]: ".concat(t," not valid scene"));case 6:if(r!==z.ScenePathType.Page){e.next=11;break}return e.next=9,this._setMainViewScenePath(t);case 9:e.next=17;break;case 11:if(r!==z.ScenePathType.Dir){e.next=17;break}if(n=Te(this.displayer,t),e.t0=n,!e.t0){e.next=17;break}return e.next=17,this._setMainViewScenePath(n);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_setMainViewScenePath",value:(n=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setMainViewFocusPath(t)&&(this.safeSetAttributes({_mainScenePath:t}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(r=m(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=9;break}if(this.store.getMainViewSceneIndex()!==t){e.next=3;break}return e.abrupt("return");case 3:if(n=null==(r=this.callbacksNode)?void 0:r.scenes[t],i="".concat(ne).concat(n),!n){e.next=8;break}this.setMainViewFocusPath(i)&&(this.store.setMainViewScenePath(i),this.store.setMainViewSceneIndex(t),this.dispatchSetMainViewScenePath(i)),e.next=9;break;case 8:throw new Error("[WindowManager]: ".concat(t," not valid index"));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"dispatchSetMainViewScenePath",value:function(e){this.dispatchInternalEvent(q.SetMainViewScenePath,{nextScenePath:e}),oe.emit("mainViewScenePathChange",e),we(this.room,e)}},{key:"getAppInitPath",value:function(e){var t,r=this.store.getAppAttributes(e);if(r)return null==(t=null==r?void 0:r.options)?void 0:t.scenePath}},{key:"safeDispatchMagixEvent",value:function(e,t){this.canOperate&&this.displayer.dispatchMagixEvent(e,t)}},{key:"focusByAttributes",value:function(e){var t;if(e&&Object.keys(e).length===(null==(t=this.boxManager)?void 0:t.boxSize)){var r=this.store.focus;r&&this.boxManager.focusBox({appId:r})}}},{key:"onReconnected",value:(t=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.attributesUpdateCallback(this.attributes.apps),t=Array.from(this.appProxies.values()).map((function(e){return e.onReconnected()})),this.mainViewProxy.onReconnect(),e.next=5,Promise.all(t);case 5:this.callbacksNode&&this.onSceneChange(this.callbacksNode);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"notifyContainerRectUpdate",value:function(e){this.appProxies.forEach((function(t){t.appEmitter.emit("containerRectUpdate",e)}))}},{key:"dispatchInternalEvent",value:function(e,t){this.safeDispatchMagixEvent(Q,{eventName:e,payload:t})}},{key:"destroy",value:function(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),st.clearListeners(),se.clearListeners(),this.appProxies.size&&this.appProxies.forEach((function(e){e.destroy(!0,!1,!0)})),oe.clearListeners(),this.sideEffectManager.flushAll(),this._prevFocused=void 0,this._prevSceneIndex=void 0}},{key:"eventName",get:function(){return z.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}},{key:"attributes",get:function(){return this.windowManger.attributes}},{key:"canOperate",get:function(){return this.windowManger.canOperate}},{key:"room",get:function(){return z.isRoom(this.displayer)?this.displayer:void 0}},{key:"mainView",get:function(){return this.mainViewProxy.view}},{key:"polling",get:function(){return this.mainViewProxy.polling},set:function(e){this.mainViewProxy.polling=e}},{key:"focusApp",get:function(){if(this.store.focus)return this.appProxies.get(this.store.focus)}},{key:"uid",get:function(){var e;return(null==(e=this.room)?void 0:e.uid)||""}}]),e}(),vt=function(){if(Ie(z.WhiteVersion)Z_.containerSizeRatio?(i=n*Z_.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(n=i/Z_.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!1)),r.style.width="".concat(n,"px"),r.style.height="".concat(i,"px"))}},{key:"disconnect",value:function(){var e;null==(e=this.containerResizeObserver)||e.disconnect(),j.isFunction(this.disposer)&&(this.disposer(),this.disposer=void 0)}}],[{key:"create",value:function(t,r,n,i){var o=new e(i);return o.observePlaygroundSize(t,r,n),o}}]),e}(),xt={exports:{}},wt={},St=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable;function kt(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var Et=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,i=kt(e),o=1;otr.length&&tr.push(e)}function ir(e,t,r,n){var i=x(e);("undefined"===i||"boolean"===i)&&(e=null);var o=!1;if(null===e)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ct:case Pt:o=!0}}if(o)return r(n,e,""===t?"."+ar(e,0):t),1;if(o=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;atr.length&&tr.push(e)}function ir(e,t,r,n){var i=x(e);("undefined"===i||"boolean"===i)&&(e=null);var o=!1;if(null===e)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ct:case Pt:o=!0}}if(o)return r(n,e,""===t?"."+ar(e,0):t),1;if(o=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;a4?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),t+=t,r+=r,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),cn={test:function(e){return"string"==typeof e&&Vr.test(e)||en(e)||tn(e)},parse:function(e){return sn.test(e)?sn.parse(e):un.test(e)?un.parse(e):ln.test(e)?ln.parse(e):e},transform:function(e){return en(e)?sn.transform(e):tn(e)?un.transform(e):e}},hn=function(e){var t=e.onRead,r=e.onRender,n=e.uncachedValues,i=void 0===n?new Set:n,o=e.useCache,a=void 0===o||o;return function(e){void 0===e&&(e={});var n=kr(e,[]),o={},s=[],u=!1;function l(e,t){e.startsWith("--")&&(n.hasCSSVariable=!0);var r=o[e];o[e]=t,o[e]!==r&&(-1===s.indexOf(e)&&s.push(e),u||(u=!0,jr.render(c.render)))}var c={get:function(e,r){return void 0===r&&(r=!1),!r&&a&&!i.has(e)&&void 0!==o[e]?o[e]:t(e,n)},set:function(e,t){if("string"==typeof e)l(e,t);else for(var r in e)l(r,e[r]);return this},render:function(e){return void 0===e&&(e=!1),(u||!0===e)&&(r(o,n,s),u=!1,s.length=0),this}};return c}},dn=/([a-z])([A-Z])/g,fn=function(e){return e.replace(dn,"$1-$2").toLowerCase()},pn=new Map,vn=new Map,gn=["Webkit","Moz","O","ms",""],mn=gn.length,yn="undefined"!=typeof document,_n=function(e,t){return vn.set(e,fn(t))},bn=function(e,t){void 0===t&&(t=!1);var r=t?vn:pn;return r.has(e)||(yn?function(e){an=an||document.createElement("div");for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:ui();return this.flush(t),this.disposers.set(t,e()),t}},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ui();return this.flush(t),this.disposers.set(t,e),t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ui();return this.add((function(){return e.addEventListener(t,r,n),function(){return e.removeEventListener(t,r,n)}}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ui();return this.add((function(){var i=window.setTimeout((function(){r.remove(n),e()}),t);return function(){return window.clearTimeout(i)}}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ui();return this.add((function(){var r=window.setInterval(e,t);return function(){return window.clearInterval(r)}}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach((function(e){try{e()}catch(e){console.error(e)}})),this.disposers.clear()}}]),e}(),ci=Object.defineProperty,hi=(r(80782),function(e,t,r){return n=e,i="symbol"!=x(t)?t+"":t,o=r,i in n?ci(n,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[i]=o,r;var n,i,o}),di=function(){function e(t,r){y(this,e),hi(this,"_value"),hi(this,"_beforeDestroys"),hi(this,"_subscribers"),this._value=t,r&&(this.compare=r)}return b(e,[{key:"setValue",value:function(e,t){if(!this.compare(e,this._value)){var r=this._value;this._value=e,this._subscribers&&this._subscribers.forEach((function(n){return n(e,r,t)}))}}},{key:"reaction",value:function(e){var t=this;return this._subscribers||(this._subscribers=new Set),this._subscribers.add(e),function(){t._subscribers&&t._subscribers.delete(e)}}},{key:"subscribe",value:function(e,t){var r=this.reaction(e);return e(this._value,void 0,t),r}},{key:"derive",value:function(t,r,n){var i=new e(t(this.value,void 0,n),r),o=this.reaction((function(e,r,n){i.setValue(t(e,r,n))}));return i.addBeforeDestroy(o),i}},{key:"destroy",value:function(){this._beforeDestroys&&(this._beforeDestroys.forEach((function(e){return e()})),this._beforeDestroys.clear()),this._subscribers&&this._subscribers.clear()}},{key:"addBeforeDestroy",value:function(e){var t=this;return this._beforeDestroys||(this._beforeDestroys=new Set),this._beforeDestroys.add(e),function(){t._beforeDestroys&&t._beforeDestroys.delete(e)}}},{key:"compare",value:function(e,t){return e===t}},{key:"value",get:function(){return this._value}}]),e}();function fi(e,t){Object.keys(t).forEach((function(r){!function(e,t,r){var n,i;Object.defineProperties(e,(w(n={},t,{get:function(){return r.value}}),w(n,"_".concat(t,"$"),{value:r}),w(n,"set".concat((i=t)[0].toUpperCase()+i.slice(1)),{value:function(e,t){return r.setValue(e,t)}}),n))}(e,r,t[r])}))}function pi(e){var t=function(t){var r=e.addDisposer((function(){t.destroy()}));return t.addBeforeDestroy((function(){e.remove(r)})),t};return{bindSideEffect:t,combine:function(e,r,n,i){return t(function(e,t,r,n){var i=e.map((function(e){return e.value})),o=new di(t(i,void 0,n),r);return e.forEach((function(e,r){var n=e.reaction((function(e,n,a){var s=i.slice();s[r]=e;var u=i;i=s,o.setValue(t(s,u,a),a)}));o.addBeforeDestroy(n)})),o}(e,r,n,i))},createVal:function(e,r){return t(new di(e,r))}}}!function(e){e.Light="light",e.Dark="dark",e.Auto="auto"}(Jn||(Jn={})),function(e){e.Normal="normal",e.Minimized="minimized",e.Maximized="maximized"}(ei||(ei={})),function(e){e.DarkMode="dark_mode",e.PrefersColorScheme="prefers_color_scheme",e.Close="close",e.Focus="focus",e.Blur="blur",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.State="state",e.Minimized="minimized",e.Maximized="maximized",e.Readonly="readonly",e.Destroyed="destroyed"}(ti||(ti={})),function(e){e.Close="close",e.Maximize="maximize",e.Minimize="minimize"}(ri||(ri={})),function(e){e.North="n",e.South="s",e.West="w",e.East="e",e.NorthWest="nw",e.NorthEast="ne",e.SouthEast="se",e.SouthWest="sw"}(ni||(ni={}));var vi="dh";function gi(e,t,r){return Math.min(Math.max(e,t),r)}function mi(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function yi(e){return e.touches?e.touches[0]:e}function _i(){return Date.now().toString().slice(6)+Math.random().toString().slice(2,8)}var bi=1;function xi(){return"New Box ".concat(bi++)}function wi(e){return Boolean(e)}function Si(e){return!e}var Ti=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.readonly,i=void 0!==n&&n,o=r.title,a=r.buttons,s=r.onEvent,u=r.onDragStart,l=r.namespace,c=void 0===l?"telebox":l,h=r.state,d=void 0===h?ei.Normal:h;y(this,e),this.$btns=[],this.sideEffect=new li,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=function(e){var r;if(!(t.readonly||0!==e.button||null!=(r=e.target.dataset)&&r.teleTitleBarNoDblClick)){mi(e);var n=Date.now();n-t.lastTitleBarClick.timestamp<=500?Math.abs(e.clientX-t.lastTitleBarClick.clientX)<=5&&Math.abs(e.clientY-t.lastTitleBarClick.clientY)<=5&&t.onEvent&&t.onEvent({type:ri.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarClick.timestamp=n,t.lastTitleBarClick.clientX=e.clientX,t.lastTitleBarClick.clientY=e.clientY}},this.lastTitleBarTouch={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarTouch=function(e){var r;if(!(t.readonly||null!=(r=e.target.dataset)&&r.teleTitleBarNoDblClick)){mi(e);var n=Date.now(),i=e.touches[0]||{},o=i.clientX,a=void 0===o?t.lastTitleBarTouch.clientX+100:o,s=i.clientY,u=void 0===s?t.lastTitleBarTouch.clientY+100:s;n-t.lastTitleBarTouch.timestamp<=500?Math.abs(a-t.lastTitleBarTouch.clientX)<=10&&Math.abs(u-t.lastTitleBarTouch.clientY)<=10&&t.onEvent&&t.onEvent({type:ri.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarTouch.timestamp=n,t.lastTitleBarTouch.clientX=a,t.lastTitleBarTouch.clientY=u}},this.readonly=i,this.onEvent=s,this.onDragStart=u,this.namespace=c,this.title=o,this.state=d,this.buttons=a||[{type:ri.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:ri.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:function(e){return e===ei.Maximized}},{type:ri.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}return b(e,[{key:"setTitle",value:function(e){this.title=e,this.$title&&(this.$title.textContent=e,this.$title.title=e)}},{key:"setState",value:function(e){var t=this;this.state!==e&&(this.state=e,this.buttons.forEach((function(r,n){r.isActive&&t.$btns[n].classList.toggle("is-active",r.isActive(e))})))}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e)}},{key:"render",value:function(){var e=this;if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");var t=document.createElement("div");t.className=this.wrapClassName("title-area"),t.dataset.teleBoxHandle=vi,this.$title=document.createElement("h1"),this.$title.className=this.wrapClassName("title"),this.$title.dataset.teleBoxHandle=vi,this.title&&(this.$title.textContent=this.title,this.$title.title=this.title),t.appendChild(this.$title),t.appendChild(this.$dragArea);var r=document.createElement("div");r.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach((function(t,n){var i=t.iconClassName,o=t.isActive,a=String(n),s=document.createElement("button");s.className="".concat(e.wrapClassName("titlebar-btn")," ").concat(i),s.dataset.teleTitleBarBtnIndex=a,s.dataset.teleTitleBarNoDblClick="true",o&&s.classList.toggle("is-active",o(e.state)),e.$btns.push(s),r.appendChild(s)})),this.sideEffect.addEventListener(r,"click",(function(t){var r;if(!e.readonly){var n=t.target,i=Number(null==(r=n.dataset)?void 0:r.teleTitleBarBtnIndex);if(!Number.isNaN(i)&&i0&&void 0!==arguments[0]?arguments[0]:{},n=r.id,i=void 0===n?_i():n,a=r.title,s=void 0===a?xi():a,u=r.prefersColorScheme,l=void 0===u?Jn.Light:u,c=r.darkMode,h=r.visible,d=void 0===h||h,f=r.width,p=void 0===f?.5:f,v=r.height,g=void 0===v?.5:v,m=r.minWidth,_=void 0===m?0:m,b=r.minHeight,x=void 0===b?0:b,w=r.x,S=void 0===w?.1:w,T=r.y,M=void 0===T?.1:T,k=r.minimized,E=void 0!==k&&k,I=r.maximized,A=void 0!==I&&I,C=r.readonly,P=void 0!==C&&C,N=r.resizable,O=void 0===N||N,R=r.draggable,D=void 0===R||R,L=r.fence,j=void 0===L||L,z=r.fixRatio,B=void 0!==z&&z,F=r.focus,U=void 0!==F&&F,W=r.zIndex,G=void 0===W?100:W,V=r.namespace,H=void 0===V?"telebox":V,Y=r.titleBar,$=r.content,X=r.footer,q=r.styles,Q=r.containerRect,Z=void 0===Q?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:Q,K=r.collectorRect;y(this,e),this._renderSideEffect=new li,this.handleTrackStart=function(e){var r;return null==(r=t._handleTrackStart)?void 0:r.call(t,e)},this._sideEffect=new li,this._valSideEffectBinder=pi(this._sideEffect);var J=this._valSideEffectBinder,ee=J.combine,te=J.createVal;this.id=i,this.namespace=H,this.events=new Tr,this._delegateEvents=new Tr;var re=te(l);re.reaction((function(e,r,n){n||t.events.emit(ti.PrefersColorScheme,e)}));var ne=te(Boolean(c));null==c&&re.subscribe((function(e,r,n){t._sideEffect.add((function(){if("auto"===e){var t=window.matchMedia("(prefers-color-scheme: dark)");if(t){ne.setValue(t.matches,n);var r=function(e){ne.setValue(e.matches,n)};return t.addListener(r),function(){return t.removeListener(r)}}return ki}return ne.setValue("dark"===e,n),ki}),"prefers-color-scheme")})),ne.reaction((function(e,r,n){n||t.events.emit(ti.DarkMode,e)}));var ie=te(Z,ii),oe=te(K,ii),ae=te(s),se=te(d);se.reaction((function(e,r,n){!n&&!e&&t.events.emit(ti.Close)}));var ue=te(P);ue.reaction((function(e,r,n){n||t.events.emit(ti.Readonly,e)}));var le=te(O),ce=te(D),he=te(j),de=te(B),fe=te(G);fe.reaction((function(e,r,n){n||t.events.emit(ti.ZIndex,e)}));var pe=te(U);pe.reaction((function(e,r,n){n||t.events.emit(e?ti.Focus:ti.Blur)}));var ve=te(E);ve.reaction((function(e,r,n){n||t.events.emit(ti.Minimized,e)}));var ge=te(A);ge.reaction((function(e,r,n){n||t.events.emit(ti.Maximized,e)}));var me=ee([ve,ge],(function(e){var t=o(e,2),r=t[0],n=t[1];return r?ei.Minimized:n?ei.Maximized:ei.Normal}));me.reaction((function(e,r,n){n||t.events.emit(ti.State,e)}));var ye=te({width:gi(_,0,1),height:gi(x,0,1)},ii),_e=te({width:gi(p,ye.value.width,1),height:gi(g,ye.value.height,1)},ii);ye.reaction((function(e,t,r){_e.setValue({width:gi(p,e.width,1),height:gi(g,e.height,1)},r)})),_e.reaction((function(e,r,n){n||t.events.emit(ti.IntrinsicResize,e)}));var be=ee([_e,ge],(function(e){var t=o(e,2),r=t[0];return t[1]?{width:1,height:1}:r}),ii);be.reaction((function(e,r,n){n||t.events.emit(ti.Resize,e)}));var xe=ee([be,ve,ie,oe],(function(e){var t=o(e,4),r=t[0],n=t[1],i=t[2],a=t[3];return n&&a?{width:a.width/r.width/i.width,height:a.height/r.height/i.height}:r}),ii);xe.reaction((function(e,r,n){n||t.events.emit(ti.VisualResize,e)}));var we=te({x:gi(S,0,1),y:gi(M,0,1)},ii);we.reaction((function(e,r,n){n||t.events.emit(ti.IntrinsicMove,e)}));var Se=ee([we,_e,ie,oe,ve,ge],(function(e){var t=o(e,6),r=t[0],n=t[1],i=t[2],a=t[3],s=t[4],u=t[5];return s&&a?u?{x:(a.x+a.width/2)/i.width-.5,y:(a.y+a.height/2)/i.height-.5}:{x:(a.x+a.width/2)/i.width-n.width/2,y:(a.y+a.height/2)/i.height-n.height/2}:u?{x:0,y:0}:r}),ii);Se.reaction((function(e,r,n){n||t.events.emit(ti.Move,e)})),this.titleBar=Y||new Ti({readonly:ue.value,title:ae.value,namespace:this.namespace,onDragStart:function(e){var r;return null==(r=t._handleTrackStart)?void 0:r.call(t,e)},onEvent:function(e){if(t._delegateEvents.listeners.length>0)t._delegateEvents.emit(e.type);else switch(e.type){case ri.Maximize:ge.setValue(!ge.value);break;case ri.Minimize:ve.setValue(!0);break;case ri.Close:se.setValue(!1);break;default:console.error("Unsupported titleBar event:",e)}}}),ue.reaction((function(e){t.titleBar.setReadonly(e)}));var Te=te($),Me=te(X),ke=te(q);fi(this,{prefersColorScheme:re,darkMode:ne,containerRect:ie,collectorRect:oe,title:ae,visible:se,readonly:ue,resizable:le,draggable:ce,fence:he,fixRatio:de,focus:pe,zIndex:fe,minimized:ve,maximized:ge,$userContent:Te,$userFooter:Me,$userStyles:ke}),this._state$=me,this._minSize$=ye,this._size$=be,this._intrinsicSize$=_e,this._visualSize$=xe,this._coord$=Se,this._intrinsicCoord$=we,this.fixRatio&&this.transform(Se.value.x,Se.value.y,be.value.width,be.value.height,!0),this.$box=this.render()}return b(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case ei.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case ei.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"setMinWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:e,height:this.minHeight},t),this}},{key:"setMinHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:this.minWidth,height:e},t),this}},{key:"resize",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicSize$.setValue({width:e,height:t},r),this}},{key:"move",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicCoord$.setValue({x:e,y:t},r),this}},{key:"transform",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(this.fixRatio){var o=this.intrinsicHeight/this.intrinsicWidth*r;t!==this.intrinsicY&&(t-=o-n),n=o}return t<0&&(t=0,n>this.intrinsicHeight&&(n=this.intrinsicHeight)),this._intrinsicCoord$.setValue({x:r>=this.minWidth?e:this.intrinsicX,y:n>=this.minHeight?t:this.intrinsicY},i),this._intrinsicSize$.setValue({width:gi(r,this.minWidth,1),height:gi(n,this.minHeight,1)},i),this}},{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$box&&this.$box.remove(),this}},{key:"mountContent",value:function(e){return this.set$userContent(e),this}},{key:"unmountContent",value:function(){return this.set$userContent(void 0),this}},{key:"mountFooter",value:function(e){return this.set$userFooter(e),this}},{key:"unmountFooter",value:function(){return this.set$userFooter(void 0),this}},{key:"getUserStyles",value:function(){return this.$userStyles}},{key:"mountStyles",value:function(e){var t;return"string"==typeof e?(t=document.createElement("style")).textContent=e:t=e,this.set$userStyles(t),this}},{key:"unmountStyles",value:function(){return this.set$userStyles(void 0),this}},{key:"render",value:function(e){var t=this;if(e){if(e===this.$box)return this.$box;this.$box=e}else{if(this.$box)return this.$box;this.$box=document.createElement("div")}this._renderSideEffect.flushAll(),this.$box.classList.add(this.wrapClassName("box"));var r=function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wi;return t._renderSideEffect.add((function(){var o=t.wrapClassName(n);return r.subscribe((function(t){e.classList.toggle(o,i(t))}))}))};r(this.$box,this._readonly$,"readonly"),r(this.$box,this._draggable$,"no-drag",Si),r(this.$box,this._resizable$,"no-resize",Si),r(this.$box,this._focus$,"blur",Si),r(this.$box,this._darkMode$,"color-scheme-dark"),r(this.$box,this._darkMode$,"color-scheme-light",Si),this._renderSideEffect.add((function(){var e=t.wrapClassName("minimized"),r=t.wrapClassName("maximized"),n="box-maximized-timer";return t._state$.subscribe((function(i){t.$box.classList.toggle(e,i===ei.Minimized),i===ei.Maximized?(t._renderSideEffect.flush(n),t.$box.classList.toggle(r,!0)):t._renderSideEffect.setTimeout((function(){t.$box.classList.toggle(r,!1)}),0,n)}))})),this._renderSideEffect.add((function(){return t._visible$.subscribe((function(e){t.$box.style.display=e?"block":"none"}))})),this._renderSideEffect.add((function(){return t._zIndex$.subscribe((function(e){t.$box.style.zIndex=String(e)}))}));var n=Kn(this.$box);this.$box.dataset.teleBoxID=this.id,this.$box.style.width=this.absoluteWidth+"px",this.$box.style.height=this.absoluteHeight+"px";var i=this.x*this.containerRect.width+this.containerRect.x,a=this.y*this.containerRect.height+this.containerRect.y;this.$box.style.transform="translate(".concat(i-10,"px,").concat(a-10,"px)"),this._valSideEffectBinder.combine([this._coord$,this._size$,this._minimized$,this._containerRect$,this._collectorRect$],(function(e){var t=o(e,5),r=t[0],n=t[1],i=t[2],a=t[3],s=t[4],u=n.width*a.width,l=n.height*a.height;return{width:u+(i&&s?1:0),height:l+(i&&s?1:0),x:r.x*a.width,y:r.y*a.height,scaleX:i&&s?s.width/u:1,scaleY:i&&s?s.height/l:1}}),ii).subscribe((function(e){n.set(e)})),n.set({x:i,y:a});var s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);var u=document.createElement("div");u.className=this.wrapClassName("titlebar-wrap"),u.appendChild(this.titleBar.render()),this.$titleBar=u;var l=document.createElement("div");l.className=this.wrapClassName("content-wrap");var c=document.createElement("div");c.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=c,this._renderSideEffect.add((function(){var e;return t._$userStyles$.subscribe((function(t){e&&e.remove(),e=t,t&&l.appendChild(t)}))})),this._renderSideEffect.add((function(){var e;return t._$userContent$.subscribe((function(t){e&&e.remove(),e=t,t&&c.appendChild(t)}))})),l.appendChild(c);var h=document.createElement("div");return h.className=this.wrapClassName("footer-wrap"),this.$footer=h,this._renderSideEffect.add((function(){var e;return t._$userFooter$.subscribe((function(t){e&&e.remove(),e=t,t&&h.appendChild(t)}))})),s.appendChild(u),s.appendChild(l),s.appendChild(h),this._renderResizeHandlers(),this.$box}},{key:"_renderResizeHandlers",value:function(){var e=this,t=document.createElement("div");t.className=this.wrapClassName("resize-handles"),Object.values(ni).forEach((function(r){var n=document.createElement("div");n.className=e.wrapClassName(r)+" "+e.wrapClassName("resize-handle"),n.dataset.teleBoxHandle=r,t.appendChild(n)})),this.$box.appendChild(t);var r,n,i="handle-tracking-listener",o=this.wrapClassName("transforming"),a=0,s=0,u=0,l=0,c=0,h=0,d=function(t){if(e.state===ei.Normal){mi(t);var r=yi(t),i=r.pageX,o=r.pageY;o<0&&(o=0);var d=(i-c)/e.containerRect.width,f=(o-h)/e.containerRect.height;switch(n){case ni.North:e.transform(e.x,s+f,e.width,l-f);break;case ni.South:e.transform(e.x,e.y,e.width,l+f);break;case ni.West:e.transform(a+d,e.y,u-d,e.height);break;case ni.East:e.transform(e.x,e.y,u+d,e.height);break;case ni.NorthWest:e.transform(a+d,s+f,u-d,l-f);break;case ni.NorthEast:e.transform(e.x,s+f,u+d,l-f);break;case ni.SouthEast:e.transform(e.x,e.y,u+d,l+f);break;case ni.SouthWest:e.transform(a+d,e.y,u-d,l+f);break;default:if(e.fence)e.move(gi(a+d,0,1-e.width),gi(s+f,0,1-e.height));else{var p=20/e.containerRect.width,v=20/e.containerRect.height;e.move(gi(a+d,p-e.width,1-p),gi(s+f,0,1-v))}}}},f=function(t){n=void 0,r&&(mi(t),e.$box.classList.toggle(o,!1),e._sideEffect.flush(i),r.remove())},p=function(t){var p;if(!(e.readonly||null!=t.button&&0!==t.button||!e.draggable||n||e.state!==ei.Normal)){var v=t.target;if(null!=(p=v.dataset)&&p.teleBoxHandle){var g;mi(t),a=e.x,s=e.y,u=e.width,l=e.height,g=yi(t),c=g.pageX,h=g.pageY,n=v.dataset.teleBoxHandle,r||(r=document.createElement("div"));var m=n?e.wrapClassName("cursor-".concat(n)):"";r.className=e.wrapClassName("track-mask".concat(m?" ".concat(m):"")),e.$box.appendChild(r),e.$box.classList.add(o),e._sideEffect.add((function(){return window.addEventListener("mousemove",d),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("mouseup",f),window.addEventListener("touchend",f,{passive:!1}),window.addEventListener("touchcancel",f,{passive:!1}),function(){window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),window.removeEventListener("touchcancel",f)}}),i)}}};this._handleTrackStart=p,this._sideEffect.addEventListener(t,"mousedown",p,{},"box-resizeHandles-mousedown"),this._sideEffect.addEventListener(t,"touchstart",p,{passive:!1},"box-resizeHandles-touchstart")}},{key:"destroy",value:function(){this.$box.remove(),this.events.emit(ti.Destroyed),this._sideEffect.flushAll(),this._renderSideEffect.flushAll(),this.events.removeAllListeners(),this._delegateEvents.removeAllListeners()}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}},{key:"minWidth",get:function(){return this._minSize$.value.width}},{key:"minHeight",get:function(){return this._minSize$.value.height}},{key:"intrinsicWidth",get:function(){return this._intrinsicSize$.value.width}},{key:"intrinsicHeight",get:function(){return this._intrinsicSize$.value.height}},{key:"width",get:function(){return this._size$.value.width}},{key:"height",get:function(){return this._size$.value.height}},{key:"absoluteWidth",get:function(){return this.width*this.containerRect.width}},{key:"absoluteHeight",get:function(){return this.height*this.containerRect.height}},{key:"visualWidth",get:function(){return this._visualSize$.value.width}},{key:"visualHeight",get:function(){return this._visualSize$.value.height}},{key:"intrinsicX",get:function(){return this._intrinsicCoord$.value.x}},{key:"intrinsicY",get:function(){return this._intrinsicCoord$.value.y}},{key:"x",get:function(){return this._coord$.value.x}},{key:"y",get:function(){return this._coord$.value.y}}]),e}();function ki(){}var Ei,Ii=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.visible,i=void 0===n||n,o=r.readonly,a=void 0!==o&&o,s=r.darkMode,u=void 0!==s&&s,l=r.namespace,c=void 0===l?"telebox":l,h=r.styles,d=void 0===h?{}:h,f=r.onClick;y(this,e),this.handleCollectorClick=function(){!t._readonly&&t.onClick&&t.onClick()},this._visible=i,this._readonly=a,this._darkMode=u,this.namespace=c,this.styles=d,this.onClick=f}return b(e,[{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$collector&&this.$collector.remove(),this}},{key:"setVisible",value:function(e){return this._visible!==e&&(this._visible=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-visible"),e)),this}},{key:"setReadonly",value:function(e){return this._readonly!==e&&(this._readonly=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-readonly"),e)),this}},{key:"setDarkMode",value:function(e){return this._darkMode!==e&&(this._darkMode=e,this.$collector&&(this.$collector.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$collector.classList.toggle(this.wrapClassName("color-scheme-light"),!e))),this}},{key:"setStyles",value:function(e){if(Object.assign(this.styles,e),this.$collector){var t=this.$collector;Object.keys(e).forEach((function(r){var n=e[r];null!=n&&(t.style[r]=n)}))}return this}},{key:"render",value:function(){return this.$collector||(this.$collector=document.createElement("button"),this.$collector.className=this.wrapClassName("collector"),this.$collector.style.backgroundImage="url('".concat("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K","')"),this.$collector.addEventListener("click",this.handleCollectorClick),this._visible&&this.$collector.classList.add(this.wrapClassName("collector-visible")),this._readonly&&this.$collector.classList.add(this.wrapClassName("collector-readonly")),this.$collector.classList.add(this.wrapClassName(this._darkMode?"color-scheme-dark":"color-scheme-light")),this.setStyles(this.styles)),this.$collector}},{key:"destroy",value:function(){this.$collector&&(this.$collector.removeEventListener("click",this.handleCollectorClick),this.$collector.remove(),this.$collector=void 0),this.onClick=void 0}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"visible",get:function(){return this._visible}},{key:"readonly",get:function(){return this._readonly}},{key:"darkMode",get:function(){return this._darkMode}}]),e}();!function(e){e.Focused="focused",e.Blurred="blurred",e.Created="created",e.Removed="removed",e.State="state",e.Maximized="maximized",e.Minimized="minimized",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.PrefersColorScheme="prefers_color_scheme",e.DarkMode="dark_mode"}(Ei||(Ei={}));var Ai,Ci,Pi=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).boxes=e.boxes,n.focusedBox=e.focusedBox,n.containerRect=e.containerRect,n.darkMode=e.darkMode,n}return b(r,[{key:"focusBox",value:function(e){var t;if(!this.focusedBox||this.focusedBox!==e){if(this.$titles&&this.state===ei.Maximized)for(var r=this.$titles.firstElementChild.children,n=r.length-1;n>=0;n-=1){var i=r[n],o=null==(t=i.dataset)?void 0:t.teleBoxID;o&&(e&&o===e.id?i.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&o===this.focusedBox.id&&i.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}this.focusedBox=e}}},{key:"setContainerRect",value:function(e){if(this.containerRect=e,this.$titleBar){var t=e.x,r=e.y,n=e.width;this.$titleBar.style.transform="translate(".concat(t,"px, ").concat(r,"px)"),this.$titleBar.style.width=n+"px"}}},{key:"setBoxes",value:function(e){this.boxes=e,this.updateTitles()}},{key:"setState",value:function(e){i(v(r.prototype),"setState",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"),e===ei.Maximized),this.updateTitles()}},{key:"setReadonly",value:function(e){i(v(r.prototype),"setReadonly",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("readonly"),this.readonly)}},{key:"setDarkMode",value:function(e){e!==this.darkMode&&(this.darkMode=e,this.$titleBar&&(this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-light"),!e)))}},{key:"render",value:function(){var e=i(v(r.prototype),"render",this).call(this),t=this.containerRect,n=t.x,o=t.y,a=t.width;e.style.transform="translate(".concat(n,"px, ").concat(o,"px)"),e.style.width=a+"px",e.classList.add(this.wrapClassName("max-titlebar")),e.classList.toggle(this.wrapClassName("max-titlebar-maximized"),this.state===ei.Maximized),e.classList.toggle(this.wrapClassName("readonly"),this.readonly),e.classList.add(this.wrapClassName(this.darkMode?"color-scheme-dark":"color-scheme-light"));var s=document.createElement("div");return s.classList.add(this.wrapClassName("titles-area")),e.insertBefore(s,e.firstElementChild),this.updateTitles(),e}},{key:"destroy",value:function(){i(v(r.prototype),"destroy",this).call(this),this.$titles=void 0,this.boxes.length=0,this.focusedBox=void 0}},{key:"updateTitles",value:function(){this.$titleBar&&this.state===ei.Maximized&&(this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-single-title"),1===this.boxes.length),1===this.boxes.length?this.setTitle(this.boxes[0].title):this.$titleBar.replaceChild(this.renderTitles(),this.$titleBar.firstElementChild))}},{key:"renderTitles",value:function(){var e=this;this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.$titles.addEventListener("wheel",(function(e){e.currentTarget.scrollBy({left:e.deltaY>0?250:-250,behavior:"smooth"})}),{passive:!1});var t=document.createElement("div");return t.className=this.wrapClassName("titles-content"),this.$titles.appendChild(t),this.boxes.forEach((function(r){var n=document.createElement("button");n.className=e.wrapClassName("titles-tab"),n.textContent=r.title,n.dataset.teleBoxID=r.id,n.dataset.teleTitleBarNoDblClick="true",e.focusedBox&&r.id===e.focusedBox.id&&n.classList.add(e.wrapClassName("titles-tab-focus")),t.appendChild(n)})),this.$titles}}]),r}(Ti),Ni=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.root,i=void 0===n?document.body:n,a=r.prefersColorScheme,s=void 0===a?Jn.Light:a,u=r.minimized,l=void 0!==u&&u,c=r.maximized,h=void 0!==c&&c,d=r.fence,f=void 0===d||d,p=r.containerRect,v=void 0===p?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:p,g=r.collector,m=r.namespace,_=void 0===m?"telebox":m,b=r.readonly,x=void 0!==b&&b;y(this,e),this.events=new Tr,this._sideEffect=new li;var w=pi(this._sideEffect),S=w.combine,T=w.createVal;this.root=i,this.namespace=_,this.boxes$=T([]),this.topBox$=this.boxes$.derive((function(e){if(e.length>0)return e.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}))}));var M=window.matchMedia("(prefers-color-scheme: dark)"),k=T(!1);M&&(k.setValue(M.matches),this._sideEffect.add((function(){var e=function(e){k.setValue(e.matches)};return M.addListener(e),function(){return M.removeListener(e)}})));var E=T(s);E.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setPrefersColorScheme(e,n)})),n||t.events.emit(Ei.PrefersColorScheme,e)})),this._darkMode$=S([k,E],(function(e){var t=o(e,2),r=t[0],n=t[1];return"auto"===n?r:"dark"===n})),this._darkMode$.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setDarkMode(e,n)})),n||t.events.emit(Ei.DarkMode,e)}));var I=T(x);I.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setReadonly(e,n)}))}));var A=T(l),C=T(h);C.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setMaximized(e,n)})),n||t.events.emit(Ei.Maximized,e)}));var P=S([A,C],(function(e){var t=o(e,2),r=t[0],n=t[1];return r?ei.Minimized:n?ei.Maximized:ei.Normal}));P.reaction((function(e,r,n){t.maxTitleBar.setState(e),n||t.events.emit(Ei.State,e)}));var N=T(f);N.subscribe((function(e,r,n){t.boxes.forEach((function(t){return t.setFence(e,n)}))}));var O=T(v,ii);O.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setContainerRect(e,n)})),t.maxTitleBar.setContainerRect(e)}));var R=T(null===g?null:g||new Ii({visible:l,readonly:x,namespace:_}).mount(i));R.subscribe((function(e){e&&(e.setVisible(A.value),e.setReadonly(I.value),e.setDarkMode(t._darkMode$.value),t._sideEffect.add((function(){return e.onClick=function(){I.value||A.setValue(!1)},function(){return e.destroy()}}),"collect-onClick"))})),I.subscribe((function(e){var t;return null==(t=R.value)?void 0:t.setReadonly(e)})),this._darkMode$.subscribe((function(e){var t;null==(t=R.value)||t.setDarkMode(e)}));var D=function(){var e;if(null!=(e=R.value)&&e.$collector){var r=R.value.$collector.getBoundingClientRect(),n=r.x,i=r.y,o=r.width,a=r.height,s=t.root.getBoundingClientRect();return{x:n-s.x,y:i-s.y,width:o,height:a}}},L=T(A.value?D():void 0);L.subscribe((function(e,r,n){t.boxes.forEach((function(t){t.setCollectorRect(e,n)}))})),A.subscribe((function(e,r,n){var i,o;null==(i=R.value)||i.setVisible(e),e&&null!=(o=R.value)&&o.$collector&&L.setValue(D()),t.boxes.forEach((function(t){return t.setMinimized(e,n)})),n||t.events.emit(Ei.Minimized,e)}));var j=this.wrapClassName("titlebar-icon-close"),z=function(e){var r;if(!I.value){var n=e.target;if(n.tagName)for(var i=n;i;i=i.parentElement){if(i.classList&&i.classList.contains(j))return;var o=null==(r=i.dataset)?void 0:r.teleBoxID;if(o){var a=t.getBox(o);if(a)return t.focusBox(a),void t.makeBoxTop(a)}}}};this._sideEffect.addEventListener(window,"mousedown",z,!0),this._sideEffect.addEventListener(window,"touchstart",z,!0),this.maxTitleBar=new Pi({darkMode:this.darkMode,readonly:I.value,namespace:this.namespace,state:P.value,boxes:this.boxes$.value,containerRect:O.value,onEvent:function(e){switch(e.type){case ri.Maximize:C.setValue(!C.value);break;case ri.Minimize:A.setValue(!0);break;case ti.Close:t.removeTopBox(),t.focusTopBox()}}}),I.subscribe((function(e){return t.maxTitleBar.setReadonly(e)})),this._darkMode$.subscribe((function(e){t.maxTitleBar.setDarkMode(e)})),this.boxes$.reaction((function(e){t.maxTitleBar.setBoxes(e)})),fi(this,{prefersColorScheme:E,containerRect:O,collector:R,collectorRect:L,readonly:I,fence:N,minimized:A,maximized:C}),this._state$=P,this.root.appendChild(this.maxTitleBar.render())}return b(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case ei.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case ei.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"create",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=new Mi(wr(xr({zIndex:this.topBox?this.topBox.zIndex+1:100},r?this.smartPosition(t):t),{darkMode:this.darkMode,prefersColorScheme:this.prefersColorScheme,maximized:this.maximized,minimized:this.minimized,fence:this.fence,namespace:this.namespace,containerRect:this.containerRect,readonly:this.readonly,collectorRect:this.collectorRect}));return n.mount(this.root),n.focus&&(this.focusBox(n),r&&this.makeBoxTop(n)),this.boxes$.setValue([].concat(a(this.boxes),[n])),n._delegateEvents.on(ri.Maximize,(function(){e.setMaximized(!e.maximized)})),n._delegateEvents.on(ri.Minimize,(function(){e.setMinimized(!0)})),n._delegateEvents.on(ri.Close,(function(){e.remove(n),e.focusTopBox()})),n._coord$.reaction((function(t,r,i){i||e.events.emit(Ei.Move,n)})),n._size$.reaction((function(t,r,i){i||e.events.emit(Ei.Resize,n)})),n._intrinsicCoord$.reaction((function(t,r,i){i||e.events.emit(Ei.IntrinsicMove,n)})),n._intrinsicSize$.reaction((function(t,r,i){i||e.events.emit(Ei.IntrinsicResize,n)})),n._visualSize$.reaction((function(t,r,i){i||e.events.emit(Ei.VisualResize,n)})),n._zIndex$.reaction((function(t,r,i){if(e.boxes.length>0){var o=e.boxes.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}));e.topBox$.setValue(o)}i||e.events.emit(Ei.ZIndex,n)})),this.events.emit(Ei.Created,n),n}},{key:"query",value:function(e){return e?this.boxes.filter(this.teleBoxMatcher(e)):a(this.boxes)}},{key:"queryOne",value:function(e){return e?this.boxes.find(this.teleBoxMatcher(e)):this.boxes[0]}},{key:"update",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.boxes.find((function(t){return t.id===e}));if(n)return this.updateBox(n,t,r)}},{key:"updateAll",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.boxes.forEach((function(n){t.updateBox(n,e,r)}))}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBoxIndex(e);if(r>=0){var n=this.boxes.slice(),i=n.splice(r,1);return this.boxes$.setValue(n),i.forEach((function(e){return e.destroy()})),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(Ei.Removed,i)),i[0]}}},{key:"removeTopBox",value:function(){if(this.topBox)return this.remove(this.topBox)}},{key:"removeAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.boxes$.value;return this.boxes$.setValue([]),t.forEach((function(e){return e.destroy()})),e||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(Ei.Removed,t)),t}},{key:"destroy",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.events.removeAllListeners(),this._sideEffect.flushAll(),this.removeAll(t),Object.keys(this).forEach((function(t){var r=e[t];r instanceof di&&r.destroy()}))}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"focusBox",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getBox(e);n&&(this.boxes.forEach((function(e){if(n===e){var i=!1;n.focus||(i=!0,n.setFocus(!0,r)),i&&!r&&t.events.emit(Ei.Focused,n)}else e.focus&&t.blurBox(e,r)})),this.maxTitleBar.focusBox(n))}},{key:"focusTopBox",value:function(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}},{key:"blurBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBox(e);r&&(r.focus&&(r.setFocus(!1,t),t||this.events.emit(Ei.Blurred,r)),this.maxTitleBar.focusedBox===r&&this.maxTitleBar.focusBox())}},{key:"blurAll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.boxes.forEach((function(r){r.focus&&(r.setFocus(!1,t),t||e.events.emit(Ei.Blurred,r))})),this.maxTitleBar.focusedBox&&this.maxTitleBar.focusBox()}},{key:"teleBoxMatcher",value:function(e){var t=Object.keys(e);return function(r){return t.every((function(t){return e[t]===r[t]}))}}},{key:"updateBox",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(null!=t.x||null!=t.y)&&e.move(null==t.x?e.intrinsicX:t.x,null==t.y?e.intrinsicY:t.y,r),(null!=t.width||null!=t.height)&&e.resize(null==t.width?e.intrinsicWidth:t.width,null==t.height?e.intrinsicHeight:t.height,r),null!=t.title&&(e.setTitle(t.title),this.maxTitleBar.updateTitles()),null!=t.visible&&e.setVisible(t.visible,r),null!=t.minHeight&&e.setMinHeight(t.minHeight,r),null!=t.minWidth&&e.setMinWidth(t.minWidth,r),null!=t.resizable&&e.setResizable(t.resizable,r),null!=t.draggable&&e.setDraggable(t.draggable,r),null!=t.fixRatio&&e.setFixRatio(t.fixRatio,r),null!=t.zIndex&&e.setZIndex(t.zIndex,r),null!=t.content&&e.mountContent(t.content),null!=t.footer&&e.mountFooter(t.footer)}},{key:"smartPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=e.y,n=e.width,i=void 0===n?.5:n,o=e.height,a=void 0===o?.5:o;if(null==t){var s=20;this.topBox&&((s=this.topBox.intrinsicX*this.containerRect.width+20)>this.containerRect.width-i*this.containerRect.width&&(s=20)),t=s/this.containerRect.width}if(null==r){var u=20;this.topBox&&((u=this.topBox.intrinsicY*this.containerRect.height+20)>this.containerRect.height-a*this.containerRect.height&&(u=20)),r=u/this.containerRect.height}return wr(xr({},e),{x:t,y:r,width:i,height:a})}},{key:"makeBoxTop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.topBox&&e!==this.topBox&&e.setZIndex(this.topBox.zIndex+1,t)}},{key:"getBoxIndex",value:function(e){return"string"==typeof e?this.boxes.findIndex((function(t){return t.id===e})):this.boxes.findIndex((function(t){return t===e}))}},{key:"getBox",value:function(e){return"string"==typeof e?this.boxes.find((function(t){return t.id===e})):e}},{key:"boxes",get:function(){return this.boxes$.value}},{key:"topBox",get:function(){return this.topBox$.value}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}}]),e}(),Oi=function(){function e(t,r){var n=this;y(this,e),this.context=t,this.createTeleBoxManagerConfig=r;var i=t.emitter,o=t.callbacks,a=t.boxEmitter;this.teleBoxManager=this.setupBoxManager(r),this.teleBoxManager._state$.reaction((function(e){o.emit("boxStateChange",e),i.emit("boxStateChange",e)})),this.teleBoxManager._darkMode$.reaction((function(e){o.emit("darkModeChange",e)})),this.teleBoxManager._prefersColorScheme$.reaction((function(e){o.emit("prefersColorSchemeChange",e)})),this.teleBoxManager._minimized$.reaction((function(e){e||setTimeout((function(){var e=.001*(Math.random()>.5?1:-1);n.teleBoxManager.boxes.forEach((function(t){t.resize(t.intrinsicWidth+e,t.intrinsicHeight+e,!0)}))}),400)})),this.teleBoxManager.events.on("minimized",(function(e){if(n.context.safeSetAttributes({minimized:e}),e)n.context.cleanFocus(),n.blurAllBox();else{var t=n.getTopBox();t&&(n.context.setAppFocus(t.id),n.focusBox({appId:t.id},!1))}})),this.teleBoxManager.events.on("maximized",(function(e){n.context.safeSetAttributes({maximized:e})})),this.teleBoxManager.events.on("removed",(function(e){e.forEach((function(e){a.emit("close",{appId:e.id})}))})),this.teleBoxManager.events.on("intrinsic_move",j.debounce((function(e){a.emit("move",{appId:e.id,x:e.intrinsicX,y:e.intrinsicY})}),50)),this.teleBoxManager.events.on("intrinsic_resize",j.debounce((function(e){a.emit("resize",{appId:e.id,width:e.intrinsicWidth,height:e.intrinsicHeight})}),200)),this.teleBoxManager.events.on("focused",(function(e){e&&(n.canOperate?a.emit("focus",{appId:e.id}):n.teleBoxManager.blurBox(e.id))})),this.teleBoxManager.events.on("z_index",(function(e){n.context.updateAppState(e.id,K.ZIndex,e.zIndex)})),i.on("playgroundSizeChange",(function(){return n.updateManagerRect()})),i.on("updateManagerRect",(function(){return n.updateManagerRect()}))}return b(e,[{key:"createBox",value:function(e){var t,r,n;if(this.teleBoxManager){var i=null!=(t=e.app.config)?t:{},o=i.minwidth,a=void 0===o?.4722222222222222:o,s=i.minheight,u=void 0===s?.4722222222222222:s,l=null!=(r=e.app.config)?r:{},c=l.width,h=l.height,d=(null==(n=e.options)?void 0:n.title)||e.appId,f=this.teleBoxManager.containerRect;a>1&&(a/=f.width),u>1&&(u/=f.height);var p={title:d,minWidth:a,minHeight:u,width:c,height:h,id:e.appId};this.teleBoxManager.create(p,e.smartPosition),this.context.emitter.emit("".concat(e.appId).concat(q.WindowCreated))}}},{key:"setBoxInitState",value:function(e){var t=this.teleBoxManager.queryOne({id:e});t&&t.state===ei.Maximized&&this.context.boxEmitter.emit("resize",{appId:e,x:t.x,y:t.y,width:t.intrinsicWidth,height:t.intrinsicHeight})}},{key:"setupBoxManager",value:function(e){var t=Z_.wrapper?Z_.wrapper:document.body,r=t.getBoundingClientRect(),n={root:t,containerRect:{x:0,y:0,width:r.width,height:r.height},fence:!1,prefersColorScheme:null==e?void 0:e.prefersColorScheme},i=new Ni(n);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=i;var o=(null==e?void 0:e.collectorContainer)||Z_.wrapper;return o&&this.setCollectorContainer(o),i}},{key:"setCollectorContainer",value:function(e){var t,r=new Ii({styles:null==(t=this.createTeleBoxManagerConfig)?void 0:t.collectorStyles}).mount(e);this.teleBoxManager.setCollector(r)}},{key:"getBox",value:function(e){return this.teleBoxManager.queryOne({id:e})}},{key:"closeBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.teleBoxManager.remove(e,t)}},{key:"boxIsFocus",value:function(e){var t=this.getBox(e);return null==t?void 0:t.focus}},{key:"getFocusBox",value:function(){return this.teleBoxManager.query({focus:!0})[0]}},{key:"getTopBox",value:function(){return this.teleBoxManager.topBox}},{key:"updateBoxState",value:function(e){var t=this;if(e){var r=this.getBox(e.id);r&&(this.teleBoxManager.update(r.id,{x:e.x,y:e.y,width:e.width||.5,height:e.height||.5,zIndex:e.zIndex},!0),setTimeout((function(){e.focus&&t.teleBoxManager.focusBox(r.id,!0),null!=e.maximized&&t.teleBoxManager.setMaximized(Boolean(e.maximized),!0),null!=e.minimized&&t.teleBoxManager.setMinimized(Boolean(e.minimized),!0)}),50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}}},{key:"updateManagerRect",value:function(){var e,t=null==(e=this.mainView.divElement)?void 0:e.getBoundingClientRect();if(t&&t.width>0&&t.height>0){var r={x:0,y:0,width:t.width,height:t.height};this.teleBoxManager.setContainerRect(r),this.context.notifyContainerRectUpdate(this.teleBoxManager.containerRect)}}},{key:"moveBox",value:function(e){var t=e.appId,r=e.x,n=e.y;this.teleBoxManager.update(t,{x:r,y:n},!0)}},{key:"focusBox",value:function(e){var t=e.appId,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.focusBox(t,r)}},{key:"resizeBox",value:function(e){var t=e.appId,r=e.width,n=e.height,i=e.skipUpdate;this.teleBoxManager.update(t,{width:r,height:n},i)}},{key:"setBoxMinSize",value:function(e){this.teleBoxManager.update(e.appId,{minWidth:e.minWidth,minHeight:e.minHeight},!0)}},{key:"setBoxTitle",value:function(e){this.teleBoxManager.update(e.appId,{title:e.title},!0)}},{key:"blurAllBox",value:function(){this.teleBoxManager.blurAll()}},{key:"updateAll",value:function(e){this.teleBoxManager.updateAll(e)}},{key:"setMaximized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e!==this.maximized&&this.teleBoxManager.setMaximized(e,t)}},{key:"setMinimized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.setMinimized(e,t)}},{key:"focusTopBox",value:function(){if(this.teleBoxManager.query().length>=1){var e=this.getTopBox();e&&this.focusBox({appId:e.id},!1)}}},{key:"updateBox",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,t,r)}},{key:"setReadonly",value:function(e){this.teleBoxManager.setReadonly(e)}},{key:"setPrefersColorScheme",value:function(e){this.teleBoxManager.setPrefersColorScheme(e)}},{key:"setZIndex",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,{zIndex:t},r)}},{key:"destroy",value:function(){this.teleBoxManager.destroy()}},{key:"mainView",get:function(){return this.context.getMainView()}},{key:"canOperate",get:function(){return this.context.canOperate()}},{key:"boxState",get:function(){return this.teleBoxManager.state}},{key:"maximized",get:function(){return this.teleBoxManager.maximized}},{key:"minimized",get:function(){return this.teleBoxManager.minimized}},{key:"darkMode",get:function(){return this.teleBoxManager.darkMode}},{key:"prefersColorScheme",get:function(){return this.teleBoxManager.prefersColorScheme}},{key:"boxSize",get:function(){return this.teleBoxManager.boxes.length}}]),e}();function Ri(){}function Di(e){return e()}function Li(){return Object.create(null)}function ji(e){e.forEach(Di)}function zi(e){return"function"==typeof e}function Bi(e,t){return e!=e?t==t:e!==t||e&&"object"==x(e)||"function"==typeof e}function Fi(e,t){return Ai||(Ai=document.createElement("a")),Ai.href=t,e===Ai.href}function Ui(e,t){e.appendChild(t)}function Wi(e,t,r){e.insertBefore(t,r||null)}function Gi(e){e.parentNode.removeChild(e)}function Vi(e){return document.createElement(e)}function Hi(e){return document.createTextNode(e)}function Yi(){return Hi(" ")}function $i(e,t,r){null==r?e.removeAttribute(t):e.getAttribute(t)!==r&&e.setAttribute(t,r)}function Xi(e){return Array.from(e.childNodes)}function qi(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Qi(e,t,r,n){null===r?e.style.removeProperty(t):e.style.setProperty(t,r,n?"important":"")}function Zi(e){Ci=e}var Ki=[],Ji=[],eo=[],to=[],ro=Promise.resolve(),no=!1;function io(e){eo.push(e)}var oo=new Set,ao=0;function so(){var e=Ci;do{for(;ao7&&void 0!==arguments[7]?arguments[7]:[-1],u=Ci;Zi(e);var l=e.$$={fragment:null,ctx:null,props:o,update:Ri,not_equal:i,bound:Li(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Li(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(l.root);var c=!1;if(l.ctx=r?r(e,t.props||{},(function(t,r){var n=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:r;return l.ctx&&i(l.ctx[t],l.ctx[t]=n)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](n),c&&fo(e,t)),r})):[],l.update(),c=!0,ji(l.before_update),l.fragment=!!n&&n(l.ctx),t.target){if(t.hydrate){var h=Xi(t.target);l.fragment&&l.fragment.l(h),h.forEach(Gi)}else l.fragment&&l.fragment.c();t.intro&&co(e.$$.fragment),ho(e,t.target,t.anchor,t.customElement),so()}Zi(u)}(c(n=t.call(this)),e,_o,yo,Bi,{uid:0,cursorName:1,tagName:2,backgroundColor:3,appliance:4,x:5,y:6,src:7,visible:21,avatar:8,theme:9,color:10,cursorTagBackgroundColor:11,opacity:12,pencilEraserSize:22,custom:13}),n}return r}(po),xo="data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle cx='12' cy='12' r='2.5' stroke='%23000' stroke-linejoin='square'/%3E%3Ccircle cx='12' cy='12' r='3.5' stroke='%23FFF'/%3E%3C/g%3E%3C/svg%3E";function wo(e){return"data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle cx='12' cy='12' r='2.5' stroke='%23".concat(e,"' stroke-linejoin='square'/%3E%3Ccircle cx='12' cy='12' r='3.5' stroke='%23").concat(e,"'/%3E%3C/g%3E%3C/svg%3E")}function So(e){return"data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg' fill='none'%3E%3Cpath d='M5 12H19' stroke='%23".concat(e,"' stroke-linejoin='round'/%3E%3Cpath d='M12 5V19' stroke='%23").concat(e,"' stroke-linejoin='round'/%3E%3C/svg%3E")}function To(e){return'url("'.concat(e,'") 12 12, auto')}var Mo=document.createElement("style");var ko=new Set([z.ApplianceNames.rectangle,z.ApplianceNames.ellipse,z.ApplianceNames.straight,z.ApplianceNames.arrow,z.ApplianceNames.shape]);function Eo(e,t){return e===z.ApplianceNames.pencil?wo(t):e===z.ApplianceNames.eraser?xo:ko.has(e)?So(t):void 0}var Io=function(){function e(t,r,n,i){var o=this;y(this,e),this.manager=t,this.memberId=r,this.cursorManager=n,this.wrapper=i,this.style="default",this.move=function(e){var t;if("main"===e.type){var r=o.cursorManager.wrapperRect;o.component&&r&&(o.autoHidden(),o.moveCursor(e,r,o.manager.mainView))}else{var n=o.cursorManager.focusView,i=null==(t=null==n?void 0:n.divElement)?void 0:t.getBoundingClientRect(),a=null==n?void 0:n.camera;n&&i&&a&&o.component&&(o.autoHidden(),o.moveCursor(e,i,n))}},this.setStyle=function(e){o.style=e,o.component&&o.component.$set({src:o.getIcon(),custom:o.isCustomIcon()})},this.leave=function(){o.hide()},this.updateMember(),this.createCursor(),this.autoHidden(),this.setStyle(n.style)}var t;return b(e,[{key:"moveCursor",value:function(e,t,r){var n,i,o=e.x,a=e.y,s=e.type,u=null==r?void 0:r.screen.convertPointToScreen(o,a);if(u){var l=u.x-2,c=u.y-18;if(this.isCustomIcon()&&(l-=11,c+=4),"app"===s){var h=this.cursorManager.wrapperRect;h&&(l=l+t.x-h.x,c=c+t.y-h.y)}u.x<0||u.x>t.width||u.y<0||u.y>t.height?null==(n=this.component)||n.$set({visible:!1,x:l,y:c}):null==(i=this.component)||i.$set({visible:!0,x:l,y:c})}}},{key:"autoHidden",value:function(){var e=this;this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout((function(){e.hide()}),1e4)}},{key:"createCursor",value:(t=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.member&&this.wrapper&&(this.component=new bo({target:this.wrapper,props:this.initProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"initProps",value:function(){var e;return{uid:this.memberId,x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),custom:this.isCustomIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName,pencilEraserSize:null==(e=this.member)?void 0:e.memberState.pencilEraserSize}}},{key:"getIcon",value:function(){var e;if(this.member){var t=this.memberApplianceName,r=this.memberColorHex,n=this.cursorManager,i=n.userApplianceIcons,o=n.applianceIcons,a=this.memberApplianceName;a===z.ApplianceNames.pencilEraser&&(a="".concat(a).concat((null==(e=this.member)?void 0:e.memberState.pencilEraserSize)||1));var s=a&&i[a];if(s)return s;if("custom"===this.style&&t){var u=Eo(t,r);if(u)return u}return o[a||z.ApplianceNames.shape]||o[z.ApplianceNames.shape]}}},{key:"isCustomIcon",value:function(){var e;if(!this.member)return!1;var t=this.memberApplianceName,r=this.memberColorHex,n=this.cursorManager.userApplianceIcons,i=this.memberApplianceName;return i===z.ApplianceNames.pencilEraser&&(i="".concat(i).concat((null==(e=this.member)?void 0:e.memberState.pencilEraserSize)||1)),(!i||!n[i])&&!("custom"!==this.style||!t||!Eo(t,r))}},{key:"updateMember",value:function(){return this.member=gt(this.manager.room,this.memberId),this.updateComponent(),this.member}},{key:"updateComponent",value:function(){var e;null==(e=this.component)||e.$set(j.omit(this.initProps(),["x","y"]))}},{key:"destroy",value:function(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}},{key:"hide",value:function(){this.component&&(this.component.$set({visible:!1}),this.destroy())}},{key:"memberApplianceName",get:function(){var e,t;return null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.currentApplianceName}},{key:"memberColor",get:function(){var e,t;return"rgb(".concat(null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor.join(","),")")}},{key:"memberColorHex",get:function(){var e,t,r=o((null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor)||[236,52,85],3);return((1<<24)+(r[0]<<16)+(r[1]<<8)+r[2]).toString(16).slice(1)}},{key:"payload",get:function(){var e;return null==(e=this.member)?void 0:e.payload}},{key:"memberCursorName",get:function(){var e,t;return(null==(e=this.payload)?void 0:e.nickName)||(null==(t=this.payload)?void 0:t.cursorName)||this.memberId}},{key:"memberTheme",get:function(){var e;return null!=(e=this.payload)&&e.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}},{key:"memberCursorTextColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTextColor)||"#FFFFFF"}},{key:"memberCursorTagBackgroundColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTagBackgroundColor)||this.memberColor}},{key:"memberAvatar",get:function(){var e;return null==(e=this.payload)?void 0:e.avatar}},{key:"memberOpacity",get:function(){return this.memberCursorName||this.memberAvatar?1:0}},{key:"memberTagName",get:function(){var e;return null==(e=this.payload)?void 0:e.cursorTagName}}]),e}(),Ao=(w(n={},z.ApplianceNames.pencil,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="),w(n,z.ApplianceNames.selector,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="),w(n,z.ApplianceNames.eraser,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="),w(n,z.ApplianceNames.shape,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(n,z.ApplianceNames.text,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="),w(n,z.ApplianceNames.laserPointer,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(n,"pencilEraser1","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMjYiIHZpZXdCb3g9IjAgMCAxOCAyNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIxNyIgaGVpZ2h0PSIyNSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(n,"pencilEraser2","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjYiIGhlaWdodD0iMzQiIHZpZXdCb3g9IjAgMCAyNiAzNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIyNSIgaGVpZ2h0PSIzMyIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(n,"pencilEraser3","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iNTAiIHZpZXdCb3g9IjAgMCAzNCA1MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIzMyIgaGVpZ2h0PSI0OSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),n),Co="local-cursor",Po=function(){function e(t,r,n,i){var o,a=this;y(this,e),this.manager=t,this.enableCursor=r,this.cursorInstances=new Map,this.userApplianceIcons={},this.sideEffectManager=new Ye,this.store=this.manager.store,this.leaveFlag=!0,this._style="default",this.onCursorMove=function(e){var t=a.initCursorInstance(e.uid);if(e.state===te.Leave)t.leave();else{var r=t.updateMember();a.canMoveCursor(r)&&t.move(e.position)}},this.initCursorInstance=function(e){var t=a.cursorInstances.get(e);return t||(t=new Io(a.manager,e,a,Z_.wrapper),a.cursorInstances.set(e,t)),t},this.mouseMoveListener_=function(e,t){var r=a.getType(e);a.updateCursor(r,e.clientX,e.clientY),t&&a.showPencilEraserIfNeeded(r,e.clientX,e.clientY)},this.mouseMoveTimer=0,this.mouseMoveListener=function(e){var t="touch"===e.pointerType;if(!t||e.isPrimary){var r=Date.now();if(r-a.mouseMoveTimer>48){if(a.mouseMoveTimer=r,Z_.supportAppliancePlugin&&z.isRoom(Z_.displayer)&&Z_.displayer.disableDeviceInputs)return void(a.leaveFlag&&(a.manager.dispatchInternalEvent(q.CursorMove,{uid:a.manager.uid,state:te.Leave}),a.leaveFlag=!1));a.mouseMoveListener_(e,t),a.leaveFlag=!0}}},this.mouseLeaveListener=function(){a.hideCursor(a.manager.uid)},this.getPoint=function(e,t,r){var n,i=null==(n=null==e?void 0:e.divElement)?void 0:n.getBoundingClientRect();if(i)return null==e?void 0:e.convertToPointInWorld({x:t-i.x,y:r-i.y})},this.getType=function(e){var t,r=e.target,n=a.manager.focusApp;switch(r.parentElement){case a.mainViewElement:return{type:"main"};case null==(t=null==n?void 0:n.view)?void 0:t.divElement:return{type:"app"};default:return{type:"main"}}},this.roomMembers=null==(o=this.manager.room)?void 0:o.state.roomMembers;var s=Z_.wrapper;s&&this.setupWrapper(s),this.sideEffectManager.add((function(){return se.on("cursorMove",a.onCursorMove)})),this.sideEffectManager.add((function(){return se.on("playgroundSizeChange",(function(){return a.updateContainerRect()}))}));var u=this.manager.room;u&&this.sideEffectManager.add((function(){var e=function(e){"custom"===a.style&&e.memberState&&a.enableCustomCursor()};return u.callbacks.on("onRoomStateChanged",e),function(){return u.callbacks.off("onRoomStateChanged",e)}})),i&&(this.userApplianceIcons=i),this.style=(null==n?void 0:n.style)||"default"}return b(e,[{key:"enableCustomCursor",value:function(){var e=this;this.sideEffectManager.add((function(){return function(e){var t=o(e.strokeColor,3),r=((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1);return Mo.textContent=function(e){var t="";for(var r in e)t+=".netless-whiteboard.".concat(r," {cursor: ").concat(e[r],"}\n");return t}({"cursor-pencil":To(wo(r)),"cursor-eraser":To(xo),"cursor-rectangle":To(So(r)),"cursor-ellipse":To(So(r)),"cursor-straight":To(So(r)),"cursor-arrow":To(So(r)),"cursor-shape":To(So(r))}),document.head.appendChild(Mo),function(){null!=Mo.parentNode&&document.head.removeChild(Mo)}}(e.manager.getMemberState())}),Co)}},{key:"canMoveCursor",value:function(e){var t=(null==e?void 0:e.memberState.currentApplianceName)===z.ApplianceNames.laserPointer;return this.enableCursor||t}},{key:"setupWrapper",value:function(e){var t=this;this.sideEffectManager.add((function(){return e.addEventListener("pointerenter",t.mouseMoveListener),e.addEventListener("pointermove",t.mouseMoveListener),e.addEventListener("pointerleave",t.mouseLeaveListener),function(){e.removeEventListener("pointerenter",t.mouseMoveListener),e.removeEventListener("pointermove",t.mouseMoveListener),e.removeEventListener("pointerleave",t.mouseLeaveListener)}})),this.wrapperRect=e.getBoundingClientRect()}},{key:"setMainViewDivElement",value:function(e){this.mainViewElement=e}},{key:"showPencilEraserIfNeeded",value:function(e,t,r){var n=gt(this.manager.room,this.manager.uid),i=(null==n?void 0:n.memberState.currentApplianceName)===z.ApplianceNames.pencilEraser;if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(n)&&i){var o="main"===e.type?this.manager.mainView:this.focusView,a=this.getPoint(o,t,r);a&&this.onCursorMove({uid:this.manager.uid,position:{x:a.x,y:a.y,type:e.type}})}}},{key:"updateCursor",value:function(e,t,r){var n=gt(this.manager.room,this.manager.uid);if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(n)){var i="main"===e.type?this.manager.mainView:this.focusView,o=this.getPoint(i,t,r);o&&this.manager.dispatchInternalEvent(q.CursorMove,{uid:this.manager.uid,position:{x:o.x,y:o.y,type:e.type}})}}},{key:"updateContainerRect",value:function(){var e,t;this.containerRect=null==(e=Z_.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=Z_.wrapper)?void 0:t.getBoundingClientRect()}},{key:"deleteCursor",value:function(e){this.store.cleanCursor(e);var t=this.cursorInstances.get(e);t&&t.destroy()}},{key:"hideCursor",value:function(e){var t=this.cursorInstances.get(e);t&&t.hide()}},{key:"destroy",value:function(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach((function(e){e.destroy()})),this.cursorInstances.clear())}},{key:"applianceIcons",get:function(){return O(O({},Ao),this.userApplianceIcons)}},{key:"style",get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,this.cursorInstances.forEach((function(t){t.setStyle(e)})),"custom"===e?this.enableCustomCursor():this.sideEffectManager.flush(Co))}},{key:"boxState",get:function(){return this.store.getBoxState()}},{key:"focusView",get:function(){var e;return null==(e=this.manager.focusApp)?void 0:e.view}}]),e}(),No=function(){function e(t){var r=this;y(this,e),this.manager=t,se.on("changePageState",(function(){oe.emit("pageStateChange",r.toObject())}))}return b(e,[{key:"toObject",value:function(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}},{key:"index",get:function(){return this.manager.store.getMainViewSceneIndex()||0}},{key:"length",get:function(){return this.manager.mainViewScenesLength||0}}]),e}(),Oo=function(){function e(t){var r=this;y(this,e),this.ctx=t,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t===z.RoomPhase.Reconnecting&&r.ctx.emitter.emit("startReconnect"),e.t0=t===z.RoomPhase.Connected&&r.phase===z.RoomPhase.Reconnecting,!e.t0){e.next=10;break}if(null==(n=r.room)||!n.isWritable){e.next=7;break}null==(i=r.room)||i.dispatchMagixEvent(Z,{}),e.next=10;break;case 7:return e.next=9,Ce(500);case 9:r.onReconnected();case 10:r.phase=t;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReconnected=j.debounce((function(){r._onReconnected()}),1e3),this._onReconnected=function(){ot("onReconnected refresh reactors"),r.releaseDisposers(),r.reactors.forEach((function(e,t){j.isFunction(e)&&r.disposers.set(t,e())})),r.ctx.emitter.emit("onReconnected")}}return b(e,[{key:"setRoom",value:function(e){var t=this;this.room=e,this.phase=null==e?void 0:e.phase,e&&(e.callbacks.off("onPhaseChanged",this.onPhaseChanged),e.callbacks.on("onPhaseChanged",this.onPhaseChanged),e.addMagixEventListener(Z,(function(r){r.authorId===e.observerId&&t.onReconnected()}),{fireSelfEventAfterCommit:!0}))}},{key:"setContext",value:function(e){this.ctx=e}},{key:"releaseDisposers",value:function(){this.disposers.forEach((function(e){j.isFunction(e)&&e()})),this.disposers.clear()}},{key:"refresh",value:function(){this._onReconnected()}},{key:"add",value:function(e,t){var r=this.disposers.get(e);r&&j.isFunction(r)&&r(),j.isFunction(t)&&(this.reactors.set(e,t),this.disposers.set(e,t()))}},{key:"remove",value:function(e){this.reactors.has(e)&&this.reactors.delete(e);var t=this.disposers.get(e);t&&(j.isFunction(t)&&t(),this.disposers.delete(e))}},{key:"hasReactor",value:function(e){return this.reactors.has(e)}},{key:"destroy",value:function(){var e,t;null==(e=this.room)||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),null==(t=this.room)||t.removeMagixEventListener(Z,this.onReconnected),this.releaseDisposers()}}]),e}(),Ro=function(e,t){if(z.isPlayer(e))Lo(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get:function(){return t.mainView.disableCameraTransform},set:function(e){t.mainView.disableCameraTransform=e}}),Object.defineProperty(e,"canUndoSteps",{get:function(){return t.canUndoSteps}}),Object.defineProperty(e,"canRedoSteps",{get:function(){return t.canRedoSteps}}),e.moveCamera=function(e){return t.moveCamera(e)},e.moveCameraToContain=function(){return t.moveCameraToContain.apply(t,arguments)},e.convertToPointInWorld=function(){var e;return(e=t.mainView).convertToPointInWorld.apply(e,arguments)},e.setCameraBound=function(){var e;return(e=t.mainView).setCameraBound.apply(e,arguments)},e.scenePreview=function(){var e;return(e=t.mainView).scenePreview.apply(e,arguments)},e.fillSceneSnapshot=function(){var e;return(e=t.mainView).fillSceneSnapshot.apply(e,arguments)},e.generateScreenshot=function(){var e;return(e=t.mainView).generateScreenshot.apply(e,arguments)},e.setMemberState=function(){var e;return(e=t.mainView).setMemberState.apply(e,arguments)},e.redo=function(){return t.redo()},e.undo=function(){return t.undo()},e.cleanCurrentScene=function(){return t.cleanCurrentScene()},e.delete=function(){return t.delete()},e.copy=function(){return t.copy()},e.paste=function(){return t.paste()},e.duplicate=function(){return t.duplicate()},e.insertImage=function(){return t.insertImage.apply(t,arguments)},e.completeImageUpload=function(){return t.completeImageUpload.apply(t,arguments)},e.insertText=function(){return t.insertText.apply(t,arguments)},e.lockImage=function(){return t.lockImage.apply(t,arguments)},e.lockImages=function(){return t.lockImages.apply(t,arguments)},Do(e,t)}},Do=function(e,t){var r=e.removeScenes;e.removeScenes=function(n,i){var o;n===ne&&(null==(o=t.appManager)||o.updateRootDirRemoving(!0));var a=r.call(e,n);return se.emit("removeScenes",{scenePath:n,index:i}),a}},Lo=function(e){var t=e.seekToProgressTime;function r(){return(r=m(regeneratorRuntime.mark((function r(n){var i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,se.emit("seekStart");case 2:return r.next=4,t.call(e,n);case 4:return i=r.sent,r.abrupt("return",(se.emit("seek",n),i));case 6:case"end":return r.stop()}}),r)})))).apply(this,arguments)}e.seekToProgressTime=function(e){return r.apply(this,arguments)}},jo=Object.defineProperty,zo=Object.defineProperties,Bo=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,Wo=Object.prototype.propertyIsEnumerable,Go=function(e,t,r){return t in e?jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Vo=function(e,t){for(var r in t||(t={}))Uo.call(t,r)&&Go(e,r,t[r]);if(Fo){var n,i=S(Fo(t));try{for(i.s();!(n=i.n()).done;){r=n.value;Wo.call(t,r)&&Go(e,r,t[r])}}catch(e){i.e(e)}finally{i.f()}}return e},Ho=function(e,t){return zo(e,Bo(t))},Yo=function(e,t,r,n){if("length"!==r&&"prototype"!==r&&"arguments"!==r&&"caller"!==r){var i=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);!$o(i,o)&&n||Object.defineProperty(e,r,o)}},$o=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Xo=function(e,t){var r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},qo=function(e,t){return"/* Wrapped ".concat(e,"*/\n").concat(t)},Qo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Zo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ko=function(e,t,r){var n=""===r?"":"with ".concat(r.trim(),"() "),i=qo.bind(null,n,t.toString());Object.defineProperty(i,"name",Zo),Object.defineProperty(e,"toString",Ho(Vo({},Qo),{value:i}))};function Jo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.ignoreNonConfigurable,o=void 0!==i&&i,a=e.name,s=S(Reflect.ownKeys(t));try{for(s.s();!(r=s.n()).done;){var u=r.value;Yo(e,t,u,o)}}catch(e){s.e(e)}finally{s.f()}return Xo(e,t),Ko(e,t,a),e}var ea=[],ta=function(){for(var e=0;e<20;e++)ea[e]="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(87*Math.random());return ea.join("")};function ra(e){try{return e()}catch(e){console.error(e)}}var na=function(){function e(){y(this,e),this.push=this.addDisposer,this.disposers=new Map}return b(e,[{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?ia(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(ra),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=ta()}while(this.disposers.has(e));return e}}]),e}();function ia(e){return function(){return e.forEach(ra)}}var oa,aa=[],sa="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(oa||(oa={}));var ua,la=function(e){return Object.freeze(e)},ca=function(e,t){this.inlineSize=e,this.blockSize=t,la(this)},ha=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,la(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),da=function(e){return e instanceof SVGElement&&"getBBox"in e},fa=function(e){if(da(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},pa=function(e){var t;if(e instanceof Element)return!0;var r=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},va="undefined"!=typeof window?window:{},ga=new WeakMap,ma=/auto|scroll/,ya=/^tb|vertical/,_a=/msie|trident/i.test(va.navigator&&va.navigator.userAgent),ba=function(e){return parseFloat(e||"0")},xa=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new ca((r?t:e)||0,(r?e:t)||0)},wa=la({devicePixelContentBoxSize:xa(),borderBoxSize:xa(),contentBoxSize:xa(),contentRect:new ha(0,0,0,0)}),Sa=function(e,t){if(void 0===t&&(t=!1),ga.has(e)&&!t)return ga.get(e);if(fa(e))return ga.set(e,wa),wa;var r=getComputedStyle(e),n=da(e)&&e.ownerSVGElement&&e.getBBox(),i=!_a&&"border-box"===r.boxSizing,o=ya.test(r.writingMode||""),a=!n&&ma.test(r.overflowY||""),s=!n&&ma.test(r.overflowX||""),u=n?0:ba(r.paddingTop),l=n?0:ba(r.paddingRight),c=n?0:ba(r.paddingBottom),h=n?0:ba(r.paddingLeft),d=n?0:ba(r.borderTopWidth),f=n?0:ba(r.borderRightWidth),p=n?0:ba(r.borderBottomWidth),v=h+l,g=u+c,m=(n?0:ba(r.borderLeftWidth))+f,y=d+p,_=s?e.offsetHeight-y-e.clientHeight:0,b=a?e.offsetWidth-m-e.clientWidth:0,x=i?v+m:0,w=i?g+y:0,S=n?n.width:ba(r.width)-x-b,T=n?n.height:ba(r.height)-w-_,M=S+v+b+m,k=T+g+_+y,E=la({devicePixelContentBoxSize:xa(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:xa(M,k,o),contentBoxSize:xa(S,T,o),contentRect:new ha(h,u,S,T)});return ga.set(e,E),E},Ta=function(e,t,r){var n=Sa(e,r),i=n.borderBoxSize,o=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(t){case oa.DEVICE_PIXEL_CONTENT_BOX:return a;case oa.BORDER_BOX:return i;default:return o}},Ma=function(e){var t=Sa(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=la([t.borderBoxSize]),this.contentBoxSize=la([t.contentBoxSize]),this.devicePixelContentBoxSize=la([t.devicePixelContentBoxSize])},ka=function(e){if(fa(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},Ea=function(){var e=1/0,t=[];aa.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new Ma(t.target),i=ka(t.target);n.push(r),t.lastReportedSize=Ta(t.target,t.observedBox),ie?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},Aa=function(){var e=0;for(Ia(e);aa.some((function(e){return e.activeTargets.length>0}));)e=Ea(),Ia(e);return aa.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:sa}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=sa),window.dispatchEvent(e)}(),e>0},Ca=[],Pa=function(e){if(!ua){var t=0,r=document.createTextNode("");new MutationObserver((function(){return Ca.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),ua=function(){r.textContent="".concat(t?t--:t++)}}Ca.push(e),ua()},Na=0,Oa={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ra=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Da=function(e){return void 0===e&&(e=0),Date.now()+e},La=!1,ja=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!La){La=!0;var r=Da(e);!function(e){Pa((function(){requestAnimationFrame(e)}))}((function(){var n=!1;try{n=Aa()}finally{if(La=!1,e=r-Da(),!Na)return;n?t.run(1e3):e>0?t.run(e):t.start()}}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Oa)};document.body?t():va.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ra.forEach((function(t){return va.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Ra.forEach((function(t){return va.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}(),za=new ja,Ba=function(e){!Na&&e>0&&za.start(),!(Na+=e)&&za.stop()},Fa=function(){function e(e,t){this.target=e,this.observedBox=t||oa.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Ta(this.target,this.observedBox,!0);return function(e){return!da(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ua=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Wa=new WeakMap,Ga=function(e,t){for(var r=0;r=0&&(i&&aa.splice(aa.indexOf(r),1),r.observationTargets.splice(n,1),Ba(-1))},e.disconnect=function(e){var t=this,r=Wa.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Ha=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Va.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!pa(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Va.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!pa(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Va.unobserve(this,e)},e.prototype.disconnect=function(){Va.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var Ya="undefined"!=typeof window,$a=Ya&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Xa=Ya&&"IntersectionObserver"in window,qa=Ya&&"classList"in document.createElement("p"),Qa=Ya&&window.devicePixelRatio>1,Za={elements_selector:".lazy",container:$a||Ya?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Ka=function(e){return Object.assign({},Za,e)},Ja=function(e,t){var r,n="LazyLoad::Initialized",i=new e(t);try{r=new CustomEvent(n,{detail:{instance:i}})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(n,!1,!1,{instance:i})}window.dispatchEvent(r)},es="src",ts="srcset",rs="sizes",ns="poster",is="llOriginalAttrs",os="data",as="loading",ss="loaded",us="applied",ls="error",cs="native",hs="data-",ds="ll-status",fs=function(e,t){return e.getAttribute(hs+t)},ps=function(e){return fs(e,ds)},vs=function(e,t){return function(e,t,r){var n=hs+t;null!==r?e.setAttribute(n,r):e.removeAttribute(n)}(e,ds,t)},gs=function(e){return vs(e,null)},ms=function(e){return null===ps(e)},ys=function(e){return ps(e)===cs},_s=[as,ss,us,ls],bs=function(e,t,r,n){if(e){if(void 0!==n)return void e(t,r,n);if(void 0!==r)return void e(t,r);e(t)}},xs=function(e,t){qa?e.classList.add(t):e.className+=(e.className?" ":"")+t},ws=function(e,t){qa?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Ss=function(e){return e.llTempImage},Ts=function(e,t){if(t){var r=t._observer;!r||r.unobserve(e)}},Ms=function(e,t){!e||(e.loadingCount+=t)},ks=function(e,t){!e||(e.toLoadCount=t)},Es=function(e){for(var t,r=[],n=0;t=e.children[n];n+=1)"SOURCE"===t.tagName&&r.push(t);return r},Is=function(e,t){var r=e.parentNode;r&&"PICTURE"===r.tagName&&Es(r).forEach(t)},As=function(e,t){Es(e).forEach(t)},Cs=[es],Ps=[es,ns],Ns=[es,ts,rs],Os=[os],Rs=function(e){return!!e[is]},Ds=function(e){return e[is]},Ls=function(e){return delete e[is]},js=function(e,t){if(!Rs(e)){var r={};t.forEach((function(t){r[t]=e.getAttribute(t)})),e[is]=r}},zs=function(e,t){if(Rs(e)){var r=Ds(e);t.forEach((function(t){!function(e,t,r){r?e.setAttribute(t,r):e.removeAttribute(t)}(e,t,r[t])}))}},Bs=function(e,t,r){xs(e,t.class_applied),vs(e,us),r&&(t.unobserve_completed&&Ts(e,t),bs(t.callback_applied,e,r))},Fs=function(e,t,r){xs(e,t.class_loading),vs(e,as),r&&(Ms(r,1),bs(t.callback_loading,e,r))},Us=function(e,t,r){!r||e.setAttribute(t,r)},Ws=function(e,t){Us(e,rs,fs(e,t.data_sizes)),Us(e,ts,fs(e,t.data_srcset)),Us(e,es,fs(e,t.data_src))},Gs={IMG:function(e,t){Is(e,(function(e){js(e,Ns),Ws(e,t)})),js(e,Ns),Ws(e,t)},IFRAME:function(e,t){js(e,Cs),Us(e,es,fs(e,t.data_src))},VIDEO:function(e,t){As(e,(function(e){js(e,Cs),Us(e,es,fs(e,t.data_src))})),js(e,Ps),Us(e,ns,fs(e,t.data_poster)),Us(e,es,fs(e,t.data_src)),e.load()},OBJECT:function(e,t){js(e,Os),Us(e,os,fs(e,t.data_src))}},Vs=["IMG","IFRAME","VIDEO","OBJECT"],Hs=function(e,t){t&&!function(e){return e.loadingCount>0}(t)&&!function(e){return e.toLoadCount>0}(t)&&bs(e.callback_finish,t)},Ys=function(e,t,r){e.addEventListener(t,r),e.llEvLisnrs[t]=r},$s=function(e,t,r){e.removeEventListener(t,r)},Xs=function(e){return!!e.llEvLisnrs},qs=function(e){if(Xs(e)){var t=e.llEvLisnrs;for(var r in t){var n=t[r];$s(e,r,n)}delete e.llEvLisnrs}},Qs=function(e,t,r){(function(e){delete e.llTempImage})(e),Ms(r,-1),function(e){!e||(e.toLoadCount-=1)}(r),ws(e,t.class_loading),t.unobserve_completed&&Ts(e,r)},Zs=function(e,t,r){var n=Ss(e)||e;Xs(n)||function(e,t,r){Xs(e)||(e.llEvLisnrs={});var n="VIDEO"===e.tagName?"loadeddata":"load";Ys(e,n,t),Ys(e,"error",r)}(n,(function(i){(function(e,t,r,n){var i=ys(t);Qs(t,r,n),xs(t,r.class_loaded),vs(t,ss),bs(r.callback_loaded,t,n),i||Hs(r,n)})(0,e,t,r),qs(n)}),(function(i){(function(e,t,r,n){var i=ys(t);Qs(t,r,n),xs(t,r.class_error),vs(t,ls),bs(r.callback_error,t,n),r.restore_on_error&&zs(t,Ns),i||Hs(r,n)})(0,e,t,r),qs(n)}))},Ks=function(e,t,r){(function(e){e.llTempImage=document.createElement("IMG")})(e),Zs(e,t,r),function(e){Rs(e)||(e[is]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,r){var n=fs(e,t.data_bg),i=fs(e,t.data_bg_hidpi),o=Qa&&i?i:n;!o||(e.style.backgroundImage='url("'.concat(o,'")'),Ss(e).setAttribute(es,o),Fs(e,t,r))}(e,t,r),function(e,t,r){var n=fs(e,t.data_bg_multi),i=fs(e,t.data_bg_multi_hidpi),o=Qa&&i?i:n;!o||(e.style.backgroundImage=o,Bs(e,t,r))}(e,t,r),function(e,t,r){var n=fs(e,t.data_bg_set);if(n){var i=n.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),Bs(e,t,r)}}(e,t,r)},Js=function(e,t,r){Zs(e,t,r),function(e,t,r){var n=Gs[e.tagName];!n||(n(e,t),Fs(e,t,r))}(e,t,r)},eu=function(e,t,r){!function(e){return Vs.indexOf(e.tagName)>-1}(e)?Ks(e,t,r):Js(e,t,r)},tu=function(e,t,r){e.setAttribute("loading","lazy"),Zs(e,t,r),function(e,t){var r=Gs[e.tagName];!r||r(e,t)}(e,t),vs(e,cs)},ru=function(e){e.removeAttribute(es),e.removeAttribute(ts),e.removeAttribute(rs)},nu=function(e){Is(e,(function(e){zs(e,Ns)})),zs(e,Ns)},iu={IMG:nu,IFRAME:function(e){zs(e,Cs)},VIDEO:function(e){As(e,(function(e){zs(e,Cs)})),zs(e,Ps),e.load()},OBJECT:function(e){zs(e,Os)}},ou=function(e){var t=iu[e.tagName];t?t(e):function(e){if(Rs(e)){var t=Ds(e);e.style.backgroundImage=t.backgroundImage}}(e)},au=function(e,t){ou(e),function(e,t){ms(e)||ys(e)||(ws(e,t.class_entered),ws(e,t.class_exited),ws(e,t.class_applied),ws(e,t.class_loading),ws(e,t.class_loaded),ws(e,t.class_error))}(e,t),gs(e),Ls(e)},su=function(e,t,r,n){!r.cancel_on_exit||!function(e){return ps(e)===as}(e)||"IMG"===e.tagName&&(qs(e),function(e){Is(e,(function(e){ru(e)})),ru(e)}(e),nu(e),ws(e,r.class_loading),Ms(n,-1),gs(e),bs(r.callback_cancel,e,t,n))},uu=function(e,t,r,n){var i=function(e){return _s.indexOf(ps(e))>=0}(e);vs(e,"entered"),xs(e,r.class_entered),ws(e,r.class_exited),function(e,t,r){t.unobserve_entered&&Ts(e,r)}(e,r,n),bs(r.callback_enter,e,t,n),!i&&eu(e,r,n)},lu=["IMG","IFRAME","VIDEO"],cu=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},hu=function(e,t,r){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?uu(e.target,e,t,r):function(e,t,r,n){ms(e)||(xs(e,r.class_exited),su(e,t,r,n),bs(r.callback_exit,e,t,n))}(e.target,e,t,r)}))},du=function(e,t){!Xa||cu(e)||(t._observer=new IntersectionObserver((function(r){hu(r,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},fu=function(e){return Array.prototype.slice.call(e)},pu=function(e){return e.container.querySelectorAll(e.elements_selector)},vu=function(e){return function(e){return ps(e)===ls}(e)},gu=function(e,t){return function(e){return fu(e).filter(ms)}(e||pu(t))},mu=function(e,t){(function(e){return fu(e).filter(vu)})(pu(e)).forEach((function(t){ws(t,e.class_error),gs(t)})),t.update()},yu=function(e,t){var r=Ka(e);this._settings=r,this.loadingCount=0,du(r,this),function(e,t){!Ya||(t._onlineHandler=function(){mu(e,t)},window.addEventListener("online",t._onlineHandler))}(r,this),this.update(t)};yu.prototype={update:function(e){var t=this._settings,r=gu(e,t);ks(this,r.length),!$a&&Xa?cu(t)?function(e,t,r){e.forEach((function(e){-1!==lu.indexOf(e.tagName)&&tu(e,t,r)})),ks(r,0)}(r,t,this):function(e,t){(function(e){e.disconnect()})(e),function(e,t){t.forEach((function(t){e.observe(t)}))}(e,t)}(this._observer,r):this.loadAll(r)},destroy:function(){this._observer&&this._observer.disconnect(),function(e){!Ya||window.removeEventListener("online",e._onlineHandler)}(this),pu(this._settings).forEach((function(e){Ls(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,r=this._settings;gu(e,r).forEach((function(e){Ts(e,t),eu(e,r,t)}))},restoreAll:function(){var e=this._settings;pu(e).forEach((function(t){au(t,e)}))}},yu.load=function(e,t){var r=Ka(t);eu(e,r)},yu.resetStatus=function(e){gs(e)},Ya&&function(e,t){if(t)if(t.length)for(var r,n=0;r=t[n];n+=1)Ja(e,r);else Ja(e,t)}(yu,window.lazyLoadOptions);var _u=function(){function e(t){var r=t.readonly,n=t.box,i=t.pages,o=t.onNewPageIndex,a=t.onPlay;if(y(this,e),this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new na,i.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=r,this.box=n,this.pages=i,this.onNewPageIndex=o,this.onPlay=a,this.onPageIndexChanged=function(){},this.render()}return b(e,[{key:"mount",value:function(){var e=this;this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add((function(){var t=new yu({container:e.$preview,elements_selector:".".concat(e.wrapClassName("preview-page>img"))});return function(){return t.destroy()}}),"preview-lazyload")}},{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1),this.onPageIndexChanged(e))}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t;var r=this.wrapClassName("preview-page"),n=this.wrapClassName("preview-page-name");this.pages.forEach((function(i,o){var a,s=null!=(a=i.thumbnail)?a:i.src.startsWith("ppt")?void 0:i.src;if(s){var u=String(o),l=document.createElement("a");l.className=r+" "+e.wrapClassName("preview-page-".concat(o)),l.setAttribute("href","#"),l.dataset.pageIndex=u;var c=document.createElement("span");c.className=n,c.textContent=String(o+1),c.dataset.pageIndex=u;var h=document.createElement("img");h.width=i.width,h.height=i.height,h.dataset.src=s,h.dataset.pageIndex=u,l.appendChild(h),l.appendChild(c),t.appendChild(l)}})),this.sideEffect.addEventListener(t,"click",(function(t){var r;if(!e.readonly){var n=null==(r=t.target.dataset)?void 0:r.pageIndex;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(n)),e.togglePreview(!1))}}))}return this.$preview}},{key:"renderPreviewMask",value:function(){var e=this;return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",(function(t){e.readonly||t.target===e.$previewMask&&e.togglePreview(!1)}))),this.$previewMask}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");if(t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer")),this.pages.some((function(e){return e.thumbnail||!e.src.startsWith("ppt")}))){var r=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-sidebar")),r.setAttribute("viewBox","0 0 64 64");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(r,"click",(function(){e.readonly||e.togglePreview()})),this.$footer.appendChild(r)}var n=document.createElement("div");n.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),r.appendChild(n),r}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1)})),n.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-play")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),r.appendChild(n),r}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-pause")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(o.classList.toggle(e.wrapClassName("footer-btn-playing"),!0),e.onPlay&&e.onPlay(),e.sideEffect.setTimeout((function(){o.classList.toggle(e.wrapClassName("footer-btn-playing"),!1)}),500,"returnPlay"))})),n.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1)})),n.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1)}));var l=document.createElement("span");l.textContent=" / "+this.pages.length,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(n),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,r){var n=document.createElement("button");return n.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),n.appendChild(t),r&&n.appendChild(r),n}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&this.$preview.scrollTo({top:t.offsetTop-16})}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();function bu(e,t,r){return Math.min(Math.max(e,t),r)}function xu(e){return e.touches?e.touches[0]:e}function wu(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function Su(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}var Tu=function(){function e(t){var r,n,i,o=this;y(this,e),this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=function(e){if(!o.paused){var t=Math.floor((e-o._loopTimestamp)/1e3*60)+1;for(o._loopTimestamp=e;t-- >0;)o.stepper();o.onStep(o.current,o),!o.paused&&o.current!==o.target&&window.requestAnimationFrame(o.looper)}},this.current=null!=(r=t.start)?r:0,this.target=this.current,this.stiffness=null!=(n=t.stiffness)?n:170,this.damping=null!=(i=t.damping)?i:26,this.onStep=t.onStep}return b(e,[{key:"stepTo",value:function(e,t){this.paused&&null!=t&&(this.current=t),this.paused=!1,this.target=e,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}},{key:"pause",value:function(){this.paused=!0}},{key:"destroy",value:function(){this.pause()}},{key:"stepper",value:function(){var e=-this.stiffness*(this.current-this.target),t=-this.damping*this.velocity,r=this.velocity+(e+t)/60,n=this.current+r/60;Math.abs(r-0)<.01&&Math.abs(n-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=n,this.velocity=r)}}]),e}(),Mu=function(){function e(t,r,n,i){y(this,e),this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=t,this.page=r,this.scale=n,this.pageOffsetX=(i-r.width)/2;var o=document.createElement("div");o.className="page-renderer-page",o.dataset.index="".concat(t),o.style.width="".concat(r.width*n,"px"),o.style.height="".concat(r.height*n,"px"),r.thumbnail&&(o.style.backgroundImage='url("'.concat(r.thumbnail,'")'));var a=document.createElement("img");a.className="page-renderer-page-img",a.width=r.width,a.height=r.height,a.src=r.src,o.appendChild(a),this.$page=o}return b(e,[{key:"translateY",value:function(e){Math.abs(e-this.pageOffsetY)>=.001&&(this.pageOffsetY=e,this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setScale",value:function(e){Math.abs(e-this.scale)>=.001&&(this.scale=e,this.$page.style.width="".concat(this.page.width*this.scale,"px"),this.$page.style.height="".concat(this.page.height*this.scale,"px"),this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setVisible",value:function(e){e!==this.visible&&(this.visible=e,this.$page.style.opacity=e?"1":"0")}}]),e}(),ku=window.requestIdleCallback||function(e){return window.setTimeout(e,5e3)},Eu=window.cancelIdleCallback||window.clearTimeout,Iu=function(){function e(t,r,n){var i=this;y(this,e),this.pages=t,this.pagesIntrinsicWidth=r,this.scale=n,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=function(){if(i.gcTimer=null,i.els.size>i.maxElCount)for(var e=a(i.els.values()).sort((function(e,t){return t.lastVisit-e.lastVisit})),t=Math.floor(i.maxElCount/4);tthis.maxElCount&&null===this.gcTimer&&(this.gcTimer=ku(this.gc)),t}},{key:"setScale",value:function(e){e!==this.scale&&(this.scale=e,this.els.forEach((function(t){return t.setScale(e)})))}},{key:"destroy",value:function(){this.els.clear(),null!==this.gcTimer&&(Eu(this.gcTimer),this.gcTimer=null)}}]),e}(),Au=function(){function e(t){var r=this;y(this,e),this._hwaTimeout=NaN,this._turnOffHWA=function(){window.clearTimeout(r._hwaTimeout),r._hwaTimeout=NaN,r.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pages=t.pages.map((function(e){if(e.thumbnail)return e;try{var t=new URL(e.src);return t.searchParams.set("x-oss-process","image/resize,l_50"),Ho(Vo({},e),{thumbnail:t.toString()})}catch(t){return console.error(t),e}}));var n=Array(this.pages.length),i=1/0,o=0;this.pagesIntrinsicHeight=this.pages.reduce((function(e,t,r){return n[r]=e,t.width>o&&(o=t.width),t.height<=i&&(i=t.height),e+t.height}),0),this.pagesIntrinsicWidth=o,this.pagesMinHeight=i,this.pagesIntrinsicYs=n,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=t.onPageIndexChanged,this.pageScrollIndex=0,0!==this.pagesScrollTop&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new Iu(this.pages,o,this.scale),this.$pages=this.renderPages()}return b(e,[{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.$pages.style.width="".concat(this.containerWidth,"px"),this.$pages.style.height="".concat(this.containerHeight,"px"),this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.pageElManager.setScale(this.scale),this.$pages.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"renderPages",value:function(){var e=document.createElement("div");return e.className="page-renderer-pages-container",e.style.width="".concat(this.containerWidth,"px"),e.style.height="".concat(this.containerHeight,"px"),e}},{key:"pagesScrollTo",value:function(e,t){if(e=bu(e,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=e;for(var r=this.findScrollPageIndex(),n=Math.max(r-this.threshold,0),i=Math.min(r+this.threshold,this.pages.length-1),o=0;o=n&&s<=i||(a.remove(),o--)}for(var u=n;u<=i;u++){var l=this.pageElManager.getEl(u);l.$page.parentElement!==this.$pages&&this.$pages.appendChild(l.$page),l.translateY(this.pagesIntrinsicYs[u]-this.pagesScrollTop)}r!==this.pageScrollIndex&&(this.pageScrollIndex=r,this.onPageIndexChanged&&this.onPageIndexChanged(r))}}},{key:"findScrollPageIndex",value:function(){for(var e=0;e=.001)return e;return this.pagesIntrinsicYs.length-1}},{key:"mount",value:function(e){e.appendChild(this.$pages),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$pages.remove()}},{key:"destroy",value:function(){this.unmount(),this.onPageIndexChanged=void 0,this.pageElManager.destroy(),this._hwaTimeout&&(window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN)}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesIntrinsicWidth||1}},{key:"_calcThreshold",value:function(){return bu(Math.ceil(this.containerHeight/this.scale/this.pagesMinHeight/2),1,this.pages.length)}},{key:"_turnOnHWA",value:function(){this._hwaTimeout?window.clearTimeout(this._hwaTimeout):this.$pages.classList.toggle("is-hwa",!0),this._hwaTimeout=window.setTimeout(this._turnOffHWA,1e3)}}]),e}(),Cu=function(){function e(t){y(this,e),this.sideEffect=new na,this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pagesWidth=t.pagesWidth||1,this.pagesHeight=t.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=t.scrollbarMinHeight||30,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=t.readonly,this.wrapClassName=t.wrapClassName,this.onDragScroll=t.onDragScroll,this.$scrollbar=this.renderScrollbar()}return b(e,[{key:"mount",value:function(e){e.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$scrollbar.remove()}},{key:"setReadonly",value:function(e){this.readonly=e}},{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"pagesScrollTo",value:function(e,t){var r=this;if(e=bu(e,0,this.pagesHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this.pagesScrollTop=e;var n=this.pagesScrollTop*this.scale/(this.pagesHeight*this.scale-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame((function(){r.$scrollbar.style.transform="translateY(".concat(n,"px)")})):this.$scrollbar.style.transform="translateY(".concat(n,"px)")}}},{key:"destroy",value:function(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}},{key:"renderScrollbar",value:function(){var e=this,t=document.createElement("button");t.className=this.wrapClassName("scrollbar"),t.style.minHeight="".concat(this.scrollbarMinHeight,"px"),t.style.height="".concat(this.scrollbarHeight,"px");var r=function(r){if(!(e.readonly||null!=r.button&&0!==r.button)){wu(r);var n=e.wrapClassName("scrollbar-dragging");t.classList.toggle(n,!0);var i=e.pagesScrollTop,o=xu(r).clientY,a=function(t){if(!e.readonly){var r=(xu(t).clientY-o)/e.scale;Math.abs(r)>0&&e.onDragScroll&&e.onDragScroll(i+r*(e.pagesHeight*e.scale/e.containerHeight))}},s=function e(){t.classList.toggle(n,!1),window.removeEventListener("mousemove",a,!0),window.removeEventListener("touchmove",a,!0),window.removeEventListener("mouseup",e,!0),window.removeEventListener("touchend",e,!0),window.removeEventListener("touchcancel",e,!0)};window.addEventListener("mousemove",a,!0),window.addEventListener("touchmove",a,!0),window.addEventListener("mouseup",s,!0),window.addEventListener("touchend",s,!0),window.addEventListener("touchcancel",s,!0)}};return this.sideEffect.addEventListener(t,"mousedown",r),this.sideEffect.addEventListener(t,"touchstart",r),t}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesWidth||1}},{key:"_calcScrollbarHeight",value:function(){return bu(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}},{key:"_updateScrollbarHeight",value:function(){var e=this._calcScrollbarHeight();Math.abs(e-this.scrollbarHeight)>.001&&(this.scrollbarHeight=e,this.$scrollbar.style.height="".concat(e,"px"))}}]),e}(),Pu=window.ResizeObserver||Ha,Nu=640,Ou=function(){function e(t){var n=this,i=t.whiteboardView,a=t.readonly,s=t.box,u=t.pages,l=t.pageScrollTop,c=void 0===l?0:l,h=t.mountWhiteboard,d=t.onUserScroll,f=t.baseScenePath,p=t.appId;y(this,e),this.sideEffect=new na,this.userScrolling=!1,this.onNewPageIndex=function(e){n.scrollToPage(e)},this.toPdf=m(regeneratorRuntime.mark((function e(){var t,i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.createElement("canvas"),(i=t.getContext("2d"))&&n.baseScenePath){e.next=4;break}return n.reportProgress(100,null),e.abrupt("return");case 4:return a=n.whiteboardView.focusScenePath||"".concat(n.baseScenePath,"/1"),s=n.pages[0],e.next=8,Promise.resolve().then((function(){return G(r(88877))}));case 8:u=e.sent,l=u.jsPDF,c=new l({format:[s.width,s.height],orientation:s.width>s.height?"l":"p",compress:!0}),h=S(n.pages.entries()),e.prev=12,f=regeneratorRuntime.mark((function e(){var r,s,u,l,h,f,p,v,g,m,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o(d.value,2),s=r[0],u=r[1],l=u.width,h=u.height,f=u.src,t.width=l,t.height=h,p=l>h?"l":"p",s>0&&c.addPage([l,h],p),e.next=7,n.getBase64FromUrl(f);case 7:return v=e.sent,(g=document.createElement("img")).src=v,e.next=12,new Promise((function(e){return g.onload=e}));case 12:i.drawImage(g,0,0),m=t.toDataURL("image/jpeg",.6),i.clearRect(0,0,l,h),n.whiteboardView.screenshotToCanvas(i,a,l,h,{centerX:l/2,centerY:h/2+s*h,scale:1}),y=t.toDataURL("image/png"),c.addImage(m,"JPEG",0,0,l,h,"","FAST"),c.addImage(y,"PNG",0,0,l,h,"","FAST"),i.clearRect(0,0,l,h),Math.ceil((s+1)/n.pages.length*100)<100&&n.reportProgress(Math.ceil((s+1)/n.pages.length*100),null);case 17:case"end":return e.stop()}}),e)})),h.s();case 15:if((d=h.n()).done){e.next=19;break}return e.delegateYield(f(),"t0",17);case 17:e.next=15;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(12),h.e(e.t1);case 24:return e.prev=24,h.f(),e.finish(24);case 27:p=c.output("arraybuffer"),n.reportProgress(100,{pdf:p,title:n.box.title});case 29:case"end":return e.stop()}}),e,null,[[12,21,24,27]])}))),this.whiteboardView=i,this.readonly=a,this.box=s,this.pages=u,this.baseScenePath=f,this.appId=p,this.mountWhiteboard=h,this._onUserScroll=d;var v=this.debounce((function(){n.userScrolling=!1,n._onUserScroll&&n._onUserScroll(n.pageRenderer.pagesScrollTop)}),{wait:80},"debounce-updateUserScroll");this.updateUserScroll=function(){n.userScrolling=!0,v()},this.viewer=new _u({readonly:a,box:s,pages:u,onNewPageIndex:this.onNewPageIndex});var g=this.whiteboardView.size,_=g.width,b=g.height;this.pageRenderer=new Au({pagesScrollTop:c,pages:this.pages,containerWidth:_,containerHeight:b,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new Cu({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:_,containerHeight:b,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:function(e){n.pageScrollTo(e),n.updateUserScroll()}}),this.pageScrollStepper=new Tu({start:this.pageRenderer.pagesScrollTop,onStep:function(e){n.pageScrollTo(e)}}),this.render()}var t;return b(e,[{key:"mount",value:function(){var e=this;this.viewer.mount(),this.setupScrollListener();var t=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add((function(){var r=new Pu(t);return r.observe(e.viewer.$content),function(){return r.disconnect()}})),this.sideEffect.setTimeout((function(){e.userScrolling||e.pageScrollTo(e.pageRenderer.pagesScrollTop)}),100),this.sideEffect.add((function(){var t=function(t){"@netless/_request_save_pdf_"===t.data.type&&t.data.appId===e.appId&&e.toPdf().catch((function(){return e.reportProgress(100,null)}))};return window.addEventListener("message",t),function(){window.removeEventListener("message",t)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.viewer.setReadonly(e),this.scrollbar.setReadonly(e))}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}},{key:"syncPageScrollTop",value:function(e){!this.userScrolling&&e>=0&&Math.abs(this.pageRenderer.pagesScrollTop-e)>.01&&this.pageScrollStepper.stepTo(e,this.pageRenderer.pagesScrollTop)}},{key:"render",value:function(){this.pageRenderer.mount(this.viewer.$content),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.scrollbar.mount(this.viewer.$content),this.renderRatioHeight()}},{key:"renderRatioHeight",value:function(){var e=this.box.absoluteHeight,t=e<=Nu;if(this.viewer.setSmallBox(t),t){var r=26/e,n=Math.max((.08125-(r+0))/2,0);if(this.box.$titleBar){var i=r+n;this.box.$titleBar.style.height="".concat(100*i,"%")}if(this.box.$footer){var o=0+n;this.box.$footer.style.height="".concat(100*o,"%")}}else{if(this.box.$titleBar){var a=Math.max(26/Nu,26/e);this.box.$titleBar.style.height="".concat(100*a,"%")}if(this.box.$footer){var s=Math.max(26/Nu,26/e);this.box.$footer.style.height="".concat(100*s,"%")}}}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView),this.sideEffect.addEventListener(this.$whiteboardView,"wheel",(function(t){wu(t),e.readonly||(e.pageScrollTo(e.pageRenderer.pagesScrollTop+t.deltaY),e.updateUserScroll())}),{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",(function(t){e.readonly||t.touches.length<=1||e.updateUserScroll()}),{passive:!0,capture:!0})),this.$whiteboardView}},{key:"scrollTopPageToEl",value:function(e){return e*this.pageRenderer.scale}},{key:"scrollTopElToPage",value:function(e){return e/this.pageRenderer.scale}},{key:"elScrollTo",value:function(e){this.pageScrollTo(this.scrollTopElToPage(e))}},{key:"pageScrollTo",value:function(e){var t=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:bu(e+t,t,this.pageRenderer.pagesIntrinsicHeight-t),animationMode:"immediately"})}},{key:"scrollToPage",value:function(e){if(!this.readonly&&!Number.isNaN(e)){var t=this.pageRenderer.pagesIntrinsicYs[e];t>=0&&(this.pageScrollTo(t+5/this.pageRenderer.scale),this.updateUserScroll())}}},{key:"setupScrollListener",value:function(){var e=this;this.sideEffect.add((function(){var t=function(t){var r=e.whiteboardView.size,n=r.width,i=r.height;if(!(n<=0||i<=0)){var o=t.centerY-e.pageRenderer.containerHeight/e.pageRenderer.scale/2;e.pageRenderer.pagesScrollTo(o),e.scrollbar.pagesScrollTo(o)}};return e.whiteboardView.callbacks.on("onCameraUpdated",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdated",t)}})),this.sideEffect.add((function(){var t=e.updateUserScroll;return e.whiteboardView.callbacks.on("onCameraUpdatedByDevice",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdatedByDevice",t)}})),this.sideEffect.add((function(){var t=function(t){var r=t.width,n=t.height;if(!(r<=0||n<=0)){e.pageRenderer.setContainerSize(r,n),e.scrollbar.setContainerSize(r,n);var i=e.pageRenderer,o=i.pagesIntrinsicWidth,a=i.pagesIntrinsicHeight;e.whiteboardView.moveCameraToContain({originX:0,originY:e.pageRenderer.pagesScrollTop,width:o,height:n/e.pageRenderer.scale,animationMode:"immediately"}),e.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return e.pageRenderer.scale},minContentMode:function(){return e.pageRenderer.scale},centerX:o/2,centerY:a/2,width:o,height:a})}};return e.whiteboardView.callbacks.on("onSizeUpdated",t),function(){e.whiteboardView.callbacks.off("onSizeUpdated",t)}}),"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",(function(t){if(!e.readonly&&e.box.focus&&!e.box.minimized&&!Su(t.target)){var r=null;switch(t.key){case"PageDown":r=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"PageUp":r=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"ArrowDown":r=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/4/e.pageRenderer.scale;break;case"ArrowUp":r=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/4/e.pageRenderer.scale}null!==r&&(e._onUserScroll?e._onUserScroll(r):(e.pageScrollTo(r),e.updateUserScroll()))}}),{capture:!0})}},{key:"debounce",value:function(e,t,r){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e)throw new TypeError("Expected the first argument to be a function, got `".concat(x(e),"`"));var r,n,i,o=t.wait,a=void 0===o?0:o,s=t.maxWait,u=void 0===s?Number.Infinity:s,l=t.before,c=void 0!==l&&l,h=t.after,d=void 0===h||h;if(!c&&!d)throw new Error("Both `before` and `after` are false, function wouldn't be called.");var f=function(){for(var t=arguments.length,o=new Array(t),s=0;s0&&u!==Number.Infinity&&!n&&(n=setTimeout(f,u)),p&&(i=e.apply(l,o)),i};return Jo(f,e),f.cancel=function(){r&&(clearTimeout(r),r=void 0),n&&(clearTimeout(n),n=void 0)},f}(e,t);return this.sideEffect.addDisposer((function(){return n.cancel()}),r),n}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-static-"+e}},{key:"getBase64FromUrl",value:(t=m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this._invalidate(t));case 2:return e.next=4,e.sent.blob();case 4:return r=e.sent,e.abrupt("return",new Promise((function(e){var t=new FileReader;t.readAsDataURL(r),t.onloadend=function(){var r=t.result;e(r)}})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_invalidate",value:function(e){try{var t=new URL(e);return t.searchParams.set("t",Date.now().toString()),t.toString()}catch(t){return e}}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),Ru=function(){function e(t){var r=this,n=t.context,i=t.whiteboardView,o=t.box,a=t.pages;y(this,e),this.sideEffect=new na,this.onPlayPPT=function(){var e=r.context.getRoom();e&&e.pptNextStep()},this._scaleDocsToFitImpl=function(){var e=r.pages[r.getPageIndex()];e&&(r.whiteboardView.moveCameraToContain({originX:-e.width/2,originY:-e.height/2,width:e.width,height:e.height,animationMode:"immediately"}),r.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return r.whiteboardView.camera.scale},minContentMode:function(){return r.whiteboardView.camera.scale},centerX:0,centerY:0,width:e.width,height:e.height}))},this._scaleDocsToFitDebounced=function(){r.sideEffect.setTimeout(r._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=function(){r._scaleDocsToFitImpl(),r._scaleDocsToFitDebounced()},this.onNewPageIndex=function(e){r.jumpToPage(e,!0)},this.context=n,this.whiteboardView=i,this.box=o,this.pages=a,this.displayer=n.getDisplayer(),this.viewer=new _u({readonly:!n.getIsWritable(),box:o,pages:a,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add((function(){var e=function(e){r.viewer.setReadonly(!e)};return r.context.emitter.on("writableChange",e),function(){return r.context.emitter.off("writableChange",e)}})),this.sideEffect.add((function(){var e=function(e){r.jumpToPage(e.index)};return r.context.emitter.on("sceneStateChange",e),function(){return r.context.emitter.off("sceneStateChange",e)}}))}return b(e,[{key:"mount",value:function(){var e=this;this.viewer.mount();var t=this.getPageIndex();return 0!==t&&this.jumpToPage(t),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"getPageIndex",value:function(){return this.displayer.state.sceneState.index}},{key:"jumpToPage",value:function(e,t){var r,n;if((e=bu(e,0,this.pages.length-1))!==this.getPageIndex()&&this.context.getIsWritable()){var i=this.context.getInitScenePath(),o=null==(n=null==(r=this.context.getScenes())?void 0:r[e])?void 0:n.name;i&&o&&this.context.setScenePath("".concat(i,"/").concat(o)),this.scaleDocsToFit()}if(e!==this.viewer.pageIndex&&this.viewer.setPageIndex(e),t){var a=this.context.getRoom();if(a){var s=a.state.globalState.__pptState;a.setGlobalState({__pptState:s&&{uuid:s.uuid,pageIndex:e,disableAutoPlay:s.disableAutoPlay}})}}}},{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",(function(t){var r;if(e.box.focus&&!Su(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.jumpToPage(e.getPageIndex()-1,!0);break;case"ArrowRight":case"ArrowDown":null==(r=e.context.getRoom())||r.pptNextStep()}}))}},{key:"renderMask",value:function(){if(!this.$mask){var e=document.createElement("div");e.className=this.wrapClassName("mask"),this.$mask=e,document.createElement("button").className=this.wrapClassName("back"),document.createElement("button").className=this.wrapClassName("next")}return this.$mask}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.sideEffect.addEventListener(this.$whiteboardView,"click",(function(t){var r,n=e.context.getRoom();if(n&&"clicker"===n.state.memberState.currentApplianceName){for(var i=t.target;i;i=i.parentElement)if(null!=(r=i.classList)&&r.contains("ppt-event-source"))return;n.pptNextStep()}})),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-dynamic-"+e}}]),e}(),Du={kind:"DocsViewer",setup:function(e){var t=e.getBox(),r=e.getScenes();if(!r)throw new Error("[Docs Viewer]: scenes not found.");var n=e.getView();if(!n)throw new Error("[Docs Viewer]: no whiteboard view.");var i=r.map((function(e){var t=e.ppt;return t?{width:t.width,height:t.height,src:t.src,thumbnail:t.previewURL}:null})).filter((function(e){return Boolean(e)}));if(i.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(".netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-docs-viewer-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.netless-app-docs-viewer-readonly.netless-app-docs-viewer-float-footer{display:none}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{position:absolute;top:0;right:0;z-index:2147483647;width:8px;min-height:30px;margin:0;padding:0;border:none;outline:none;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;opacity:0;transition:background .4s,opacity .4s 3s,transform .2s;user-select:none}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{background:rgba(68,78,96,.6);opacity:1;transition:background .4s,opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar:hover,.netless-app-docs-viewer-static-scrollbar:focus{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-content:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.netless-app-docs-viewer-static-pages:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.page-renderer-pages-container{position:relative;overflow:hidden}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-wb-view,.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}\n"),i[0].src.startsWith("ppt")?function(e,t,r,n){t.disableCameraTransform=!0;var i=new Ru({context:e,whiteboardView:t,box:r,pages:n}).mount();i.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:n.length})},e.dispatchAppEvent("pageStateChange",{index:i.getPageIndex(),length:n.length}),e.mountView(i.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",(function(t){var i=t.width,o=t.height;if(n.length>0&&"maximized"!==r.state){var a=n[0],s=a.width,u=a.height/s*i-o;0!==u&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:r.width,height:r.height+u/r.containerRect.height})}}))}(e,n,t,i):function(e,t,r,n){var i;t.disableCameraTransform=!e.getIsWritable();var o=new Ou({whiteboardView:t,readonly:!e.getIsWritable(),box:r,pages:n,pageScrollTop:null==(i=e.getAttributes())?void 0:i.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:function(t){var n;(null==(n=e.getAttributes())?void 0:n.pageScrollTop)!==t&&!r.readonly&&e.updateAttributes(["pageScrollTop"],t)},baseScenePath:e.getInitScenePath(),appId:e.appId}).mount();o.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:n.length})},e.dispatchAppEvent("pageStateChange",{index:o.viewer.pageIndex,length:n.length}),e.emitter.on("attributesUpdate",(function(e){e&&null!=e.pageScrollTop&&o.syncPageScrollTop(e.pageScrollTop)})),e.emitter.on("writableChange",(function(e){o.setReadonly(!e),t.disableCameraTransform=!e}))}(e,n,t,i)}};var Lu={exports:{}},ju={},zu={exports:{}},Bu={}; +***************************************************************************** */var rn=function(e){return function(t){if("string"!=typeof t)return t;for(var r={},n=function(e){return function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))}(e).replace(/(,|\/)/g," ").split(/ \s*/)}(t),i=0;i<4;i++)r[e[i]]=void 0!==n[i]?parseFloat(n[i]):1;return r}},nn=Ur(Ur({},Hr),{transform:function(e){return Math.round(Jr(e))}});function on(e,t){return e.startsWith(t)&&Vr.test(e)}var an,sn={test:function(e){return"string"==typeof e?on(e,"rgb"):en(e)},parse:rn(["red","green","blue","alpha"]),transform:function(e){var t=e.red,r=e.green,n=e.blue,i=e.alpha,o=void 0===i?1:i;return function(e){var t=e.red,r=e.green,n=e.blue,i=e.alpha;return"rgba("+t+", "+r+", "+n+", "+(void 0===i?1:i)+")"}({red:nn.transform(t),green:nn.transform(r),blue:nn.transform(n),alpha:Gr(Yr.transform(o))})}},un={test:function(e){return"string"==typeof e?on(e,"hsl"):tn(e)},parse:rn(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,r=e.saturation,n=e.lightness,i=e.alpha,o=void 0===i?1:i;return function(e){var t=e.hue,r=e.saturation,n=e.lightness,i=e.alpha;return"hsla("+t+", "+r+", "+n+", "+(void 0===i?1:i)+")"}({hue:Math.round(t),saturation:Qr.transform(Gr(r)),lightness:Qr.transform(Gr(n)),alpha:Gr(Yr.transform(o))})}},ln=Ur(Ur({},sn),{test:function(e){return"string"==typeof e&&on(e,"#")},parse:function(e){var t="",r="",n="";return e.length>4?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),t+=t,r+=r,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),cn={test:function(e){return"string"==typeof e&&Vr.test(e)||en(e)||tn(e)},parse:function(e){return sn.test(e)?sn.parse(e):un.test(e)?un.parse(e):ln.test(e)?ln.parse(e):e},transform:function(e){return en(e)?sn.transform(e):tn(e)?un.transform(e):e}},hn=function(e){var t=e.onRead,r=e.onRender,n=e.uncachedValues,i=void 0===n?new Set:n,o=e.useCache,a=void 0===o||o;return function(e){void 0===e&&(e={});var n=kr(e,[]),o={},s=[],u=!1;function l(e,t){e.startsWith("--")&&(n.hasCSSVariable=!0);var r=o[e];o[e]=t,o[e]!==r&&(-1===s.indexOf(e)&&s.push(e),u||(u=!0,jr.render(c.render)))}var c={get:function(e,r){return void 0===r&&(r=!1),!r&&a&&!i.has(e)&&void 0!==o[e]?o[e]:t(e,n)},set:function(e,t){if("string"==typeof e)l(e,t);else for(var r in e)l(r,e[r]);return this},render:function(e){return void 0===e&&(e=!1),(u||!0===e)&&(r(o,n,s),u=!1,s.length=0),this}};return c}},dn=/([a-z])([A-Z])/g,fn=function(e){return e.replace(dn,"$1-$2").toLowerCase()},pn=new Map,vn=new Map,gn=["Webkit","Moz","O","ms",""],mn=gn.length,yn="undefined"!=typeof document,_n=function(e,t){return vn.set(e,fn(t))},bn=function(e,t){void 0===t&&(t=!1);var r=t?vn:pn;return r.has(e)||(yn?function(e){an=an||document.createElement("div");for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:ui();return this.flush(t),this.disposers.set(t,e()),t}},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ui();return this.flush(t),this.disposers.set(t,e),t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ui();return this.add((function(){return e.addEventListener(t,r,n),function(){return e.removeEventListener(t,r,n)}}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ui();return this.add((function(){var i=window.setTimeout((function(){r.remove(n),e()}),t);return function(){return window.clearTimeout(i)}}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ui();return this.add((function(){var r=window.setInterval(e,t);return function(){return window.clearInterval(r)}}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach((function(e){try{e()}catch(e){console.error(e)}})),this.disposers.clear()}}]),e}(),ci=Object.defineProperty,hi=(r(80782),function(e,t,r){return n=e,i="symbol"!=x(t)?t+"":t,o=r,i in n?ci(n,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[i]=o,r;var n,i,o}),di=function(){function e(t,r){y(this,e),hi(this,"_value"),hi(this,"_beforeDestroys"),hi(this,"_subscribers"),this._value=t,r&&(this.compare=r)}return b(e,[{key:"setValue",value:function(e,t){if(!this.compare(e,this._value)){var r=this._value;this._value=e,this._subscribers&&this._subscribers.forEach((function(n){return n(e,r,t)}))}}},{key:"reaction",value:function(e){var t=this;return this._subscribers||(this._subscribers=new Set),this._subscribers.add(e),function(){t._subscribers&&t._subscribers.delete(e)}}},{key:"subscribe",value:function(e,t){var r=this.reaction(e);return e(this._value,void 0,t),r}},{key:"derive",value:function(t,r,n){var i=new e(t(this.value,void 0,n),r),o=this.reaction((function(e,r,n){i.setValue(t(e,r,n))}));return i.addBeforeDestroy(o),i}},{key:"destroy",value:function(){this._beforeDestroys&&(this._beforeDestroys.forEach((function(e){return e()})),this._beforeDestroys.clear()),this._subscribers&&this._subscribers.clear()}},{key:"addBeforeDestroy",value:function(e){var t=this;return this._beforeDestroys||(this._beforeDestroys=new Set),this._beforeDestroys.add(e),function(){t._beforeDestroys&&t._beforeDestroys.delete(e)}}},{key:"compare",value:function(e,t){return e===t}},{key:"value",get:function(){return this._value}}]),e}();function fi(e,t){Object.keys(t).forEach((function(r){!function(e,t,r){var n,i;Object.defineProperties(e,(w(n={},t,{get:function(){return r.value}}),w(n,"_".concat(t,"$"),{value:r}),w(n,"set".concat((i=t)[0].toUpperCase()+i.slice(1)),{value:function(e,t){return r.setValue(e,t)}}),n))}(e,r,t[r])}))}function pi(e){var t=function(t){var r=e.addDisposer((function(){t.destroy()}));return t.addBeforeDestroy((function(){e.remove(r)})),t};return{bindSideEffect:t,combine:function(e,r,n,i){return t(function(e,t,r,n){var i=e.map((function(e){return e.value})),o=new di(t(i,void 0,n),r);return e.forEach((function(e,r){var n=e.reaction((function(e,n,a){var s=i.slice();s[r]=e;var u=i;i=s,o.setValue(t(s,u,a),a)}));o.addBeforeDestroy(n)})),o}(e,r,n,i))},createVal:function(e,r){return t(new di(e,r))}}}!function(e){e.Light="light",e.Dark="dark",e.Auto="auto"}(Jn||(Jn={})),function(e){e.Normal="normal",e.Minimized="minimized",e.Maximized="maximized"}(ei||(ei={})),function(e){e.DarkMode="dark_mode",e.PrefersColorScheme="prefers_color_scheme",e.Close="close",e.Focus="focus",e.Blur="blur",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.State="state",e.Minimized="minimized",e.Maximized="maximized",e.Readonly="readonly",e.Destroyed="destroyed"}(ti||(ti={})),function(e){e.Close="close",e.Maximize="maximize",e.Minimize="minimize"}(ri||(ri={})),function(e){e.North="n",e.South="s",e.West="w",e.East="e",e.NorthWest="nw",e.NorthEast="ne",e.SouthEast="se",e.SouthWest="sw"}(ni||(ni={}));var vi="dh";function gi(e,t,r){return Math.min(Math.max(e,t),r)}function mi(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function yi(e){return e.touches?e.touches[0]:e}function _i(){return Date.now().toString().slice(6)+Math.random().toString().slice(2,8)}var bi=1;function xi(){return"New Box ".concat(bi++)}function wi(e){return Boolean(e)}function Si(e){return!e}var Ti=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.readonly,i=void 0!==n&&n,o=r.title,a=r.buttons,s=r.onEvent,u=r.onDragStart,l=r.namespace,c=void 0===l?"telebox":l,h=r.state,d=void 0===h?ei.Normal:h;y(this,e),this.$btns=[],this.sideEffect=new li,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=function(e){var r;if(!(t.readonly||0!==e.button||null!=(r=e.target.dataset)&&r.teleTitleBarNoDblClick)){mi(e);var n=Date.now();n-t.lastTitleBarClick.timestamp<=500?Math.abs(e.clientX-t.lastTitleBarClick.clientX)<=5&&Math.abs(e.clientY-t.lastTitleBarClick.clientY)<=5&&t.onEvent&&t.onEvent({type:ri.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarClick.timestamp=n,t.lastTitleBarClick.clientX=e.clientX,t.lastTitleBarClick.clientY=e.clientY}},this.lastTitleBarTouch={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarTouch=function(e){var r;if(!(t.readonly||null!=(r=e.target.dataset)&&r.teleTitleBarNoDblClick)){mi(e);var n=Date.now(),i=e.touches[0]||{},o=i.clientX,a=void 0===o?t.lastTitleBarTouch.clientX+100:o,s=i.clientY,u=void 0===s?t.lastTitleBarTouch.clientY+100:s;n-t.lastTitleBarTouch.timestamp<=500?Math.abs(a-t.lastTitleBarTouch.clientX)<=10&&Math.abs(u-t.lastTitleBarTouch.clientY)<=10&&t.onEvent&&t.onEvent({type:ri.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarTouch.timestamp=n,t.lastTitleBarTouch.clientX=a,t.lastTitleBarTouch.clientY=u}},this.readonly=i,this.onEvent=s,this.onDragStart=u,this.namespace=c,this.title=o,this.state=d,this.buttons=a||[{type:ri.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:ri.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:function(e){return e===ei.Maximized}},{type:ri.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}return b(e,[{key:"setTitle",value:function(e){this.title=e,this.$title&&(this.$title.textContent=e,this.$title.title=e)}},{key:"setState",value:function(e){var t=this;this.state!==e&&(this.state=e,this.buttons.forEach((function(r,n){r.isActive&&t.$btns[n].classList.toggle("is-active",r.isActive(e))})))}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e)}},{key:"render",value:function(){var e=this;if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");var t=document.createElement("div");t.className=this.wrapClassName("title-area"),t.dataset.teleBoxHandle=vi,this.$title=document.createElement("h1"),this.$title.className=this.wrapClassName("title"),this.$title.dataset.teleBoxHandle=vi,this.title&&(this.$title.textContent=this.title,this.$title.title=this.title),t.appendChild(this.$title),t.appendChild(this.$dragArea);var r=document.createElement("div");r.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach((function(t,n){var i=t.iconClassName,o=t.isActive,a=String(n),s=document.createElement("button");s.className="".concat(e.wrapClassName("titlebar-btn")," ").concat(i),s.dataset.teleTitleBarBtnIndex=a,s.dataset.teleTitleBarNoDblClick="true",o&&s.classList.toggle("is-active",o(e.state)),e.$btns.push(s),r.appendChild(s)})),this.sideEffect.addEventListener(r,"click",(function(t){var r;if(!e.readonly){var n=t.target,i=Number(null==(r=n.dataset)?void 0:r.teleTitleBarBtnIndex);if(!Number.isNaN(i)&&i0&&void 0!==arguments[0]?arguments[0]:{},n=r.id,i=void 0===n?_i():n,a=r.title,s=void 0===a?xi():a,u=r.prefersColorScheme,l=void 0===u?Jn.Light:u,c=r.darkMode,h=r.visible,d=void 0===h||h,f=r.width,p=void 0===f?.5:f,v=r.height,g=void 0===v?.5:v,m=r.minWidth,_=void 0===m?0:m,b=r.minHeight,x=void 0===b?0:b,w=r.x,S=void 0===w?.1:w,T=r.y,M=void 0===T?.1:T,k=r.minimized,E=void 0!==k&&k,A=r.maximized,I=void 0!==A&&A,C=r.readonly,P=void 0!==C&&C,N=r.resizable,O=void 0===N||N,R=r.draggable,D=void 0===R||R,L=r.fence,j=void 0===L||L,z=r.fixRatio,B=void 0!==z&&z,F=r.focus,U=void 0!==F&&F,W=r.zIndex,G=void 0===W?100:W,V=r.namespace,H=void 0===V?"telebox":V,Y=r.titleBar,$=r.content,X=r.footer,q=r.styles,Q=r.containerRect,Z=void 0===Q?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:Q,K=r.collectorRect;y(this,e),this._renderSideEffect=new li,this.handleTrackStart=function(e){var r;return null==(r=t._handleTrackStart)?void 0:r.call(t,e)},this._sideEffect=new li,this._valSideEffectBinder=pi(this._sideEffect);var J=this._valSideEffectBinder,ee=J.combine,te=J.createVal;this.id=i,this.namespace=H,this.events=new Tr,this._delegateEvents=new Tr;var re=te(l);re.reaction((function(e,r,n){n||t.events.emit(ti.PrefersColorScheme,e)}));var ne=te(Boolean(c));null==c&&re.subscribe((function(e,r,n){t._sideEffect.add((function(){if("auto"===e){var t=window.matchMedia("(prefers-color-scheme: dark)");if(t){ne.setValue(t.matches,n);var r=function(e){ne.setValue(e.matches,n)};return t.addListener(r),function(){return t.removeListener(r)}}return ki}return ne.setValue("dark"===e,n),ki}),"prefers-color-scheme")})),ne.reaction((function(e,r,n){n||t.events.emit(ti.DarkMode,e)}));var ie=te(Z,ii),oe=te(K,ii),ae=te(s),se=te(d);se.reaction((function(e,r,n){!n&&!e&&t.events.emit(ti.Close)}));var ue=te(P);ue.reaction((function(e,r,n){n||t.events.emit(ti.Readonly,e)}));var le=te(O),ce=te(D),he=te(j),de=te(B),fe=te(G);fe.reaction((function(e,r,n){n||t.events.emit(ti.ZIndex,e)}));var pe=te(U);pe.reaction((function(e,r,n){n||t.events.emit(e?ti.Focus:ti.Blur)}));var ve=te(E);ve.reaction((function(e,r,n){n||t.events.emit(ti.Minimized,e)}));var ge=te(I);ge.reaction((function(e,r,n){n||t.events.emit(ti.Maximized,e)}));var me=ee([ve,ge],(function(e){var t=o(e,2),r=t[0],n=t[1];return r?ei.Minimized:n?ei.Maximized:ei.Normal}));me.reaction((function(e,r,n){n||t.events.emit(ti.State,e)}));var ye=te({width:gi(_,0,1),height:gi(x,0,1)},ii),_e=te({width:gi(p,ye.value.width,1),height:gi(g,ye.value.height,1)},ii);ye.reaction((function(e,t,r){_e.setValue({width:gi(p,e.width,1),height:gi(g,e.height,1)},r)})),_e.reaction((function(e,r,n){n||t.events.emit(ti.IntrinsicResize,e)}));var be=ee([_e,ge],(function(e){var t=o(e,2),r=t[0];return t[1]?{width:1,height:1}:r}),ii);be.reaction((function(e,r,n){n||t.events.emit(ti.Resize,e)}));var xe=ee([be,ve,ie,oe],(function(e){var t=o(e,4),r=t[0],n=t[1],i=t[2],a=t[3];return n&&a?{width:a.width/r.width/i.width,height:a.height/r.height/i.height}:r}),ii);xe.reaction((function(e,r,n){n||t.events.emit(ti.VisualResize,e)}));var we=te({x:gi(S,0,1),y:gi(M,0,1)},ii);we.reaction((function(e,r,n){n||t.events.emit(ti.IntrinsicMove,e)}));var Se=ee([we,_e,ie,oe,ve,ge],(function(e){var t=o(e,6),r=t[0],n=t[1],i=t[2],a=t[3],s=t[4],u=t[5];return s&&a?u?{x:(a.x+a.width/2)/i.width-.5,y:(a.y+a.height/2)/i.height-.5}:{x:(a.x+a.width/2)/i.width-n.width/2,y:(a.y+a.height/2)/i.height-n.height/2}:u?{x:0,y:0}:r}),ii);Se.reaction((function(e,r,n){n||t.events.emit(ti.Move,e)})),this.titleBar=Y||new Ti({readonly:ue.value,title:ae.value,namespace:this.namespace,onDragStart:function(e){var r;return null==(r=t._handleTrackStart)?void 0:r.call(t,e)},onEvent:function(e){if(t._delegateEvents.listeners.length>0)t._delegateEvents.emit(e.type);else switch(e.type){case ri.Maximize:ge.setValue(!ge.value);break;case ri.Minimize:ve.setValue(!0);break;case ri.Close:se.setValue(!1);break;default:console.error("Unsupported titleBar event:",e)}}}),ue.reaction((function(e){t.titleBar.setReadonly(e)}));var Te=te($),Me=te(X),ke=te(q);fi(this,{prefersColorScheme:re,darkMode:ne,containerRect:ie,collectorRect:oe,title:ae,visible:se,readonly:ue,resizable:le,draggable:ce,fence:he,fixRatio:de,focus:pe,zIndex:fe,minimized:ve,maximized:ge,$userContent:Te,$userFooter:Me,$userStyles:ke}),this._state$=me,this._minSize$=ye,this._size$=be,this._intrinsicSize$=_e,this._visualSize$=xe,this._coord$=Se,this._intrinsicCoord$=we,this.fixRatio&&this.transform(Se.value.x,Se.value.y,be.value.width,be.value.height,!0),this.$box=this.render()}return b(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case ei.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case ei.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"setMinWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:e,height:this.minHeight},t),this}},{key:"setMinHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:this.minWidth,height:e},t),this}},{key:"resize",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicSize$.setValue({width:e,height:t},r),this}},{key:"move",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicCoord$.setValue({x:e,y:t},r),this}},{key:"transform",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(this.fixRatio){var o=this.intrinsicHeight/this.intrinsicWidth*r;t!==this.intrinsicY&&(t-=o-n),n=o}return t<0&&(t=0,n>this.intrinsicHeight&&(n=this.intrinsicHeight)),this._intrinsicCoord$.setValue({x:r>=this.minWidth?e:this.intrinsicX,y:n>=this.minHeight?t:this.intrinsicY},i),this._intrinsicSize$.setValue({width:gi(r,this.minWidth,1),height:gi(n,this.minHeight,1)},i),this}},{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$box&&this.$box.remove(),this}},{key:"mountContent",value:function(e){return this.set$userContent(e),this}},{key:"unmountContent",value:function(){return this.set$userContent(void 0),this}},{key:"mountFooter",value:function(e){return this.set$userFooter(e),this}},{key:"unmountFooter",value:function(){return this.set$userFooter(void 0),this}},{key:"getUserStyles",value:function(){return this.$userStyles}},{key:"mountStyles",value:function(e){var t;return"string"==typeof e?(t=document.createElement("style")).textContent=e:t=e,this.set$userStyles(t),this}},{key:"unmountStyles",value:function(){return this.set$userStyles(void 0),this}},{key:"render",value:function(e){var t=this;if(e){if(e===this.$box)return this.$box;this.$box=e}else{if(this.$box)return this.$box;this.$box=document.createElement("div")}this._renderSideEffect.flushAll(),this.$box.classList.add(this.wrapClassName("box"));var r=function(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wi;return t._renderSideEffect.add((function(){var o=t.wrapClassName(n);return r.subscribe((function(t){e.classList.toggle(o,i(t))}))}))};r(this.$box,this._readonly$,"readonly"),r(this.$box,this._draggable$,"no-drag",Si),r(this.$box,this._resizable$,"no-resize",Si),r(this.$box,this._focus$,"blur",Si),r(this.$box,this._darkMode$,"color-scheme-dark"),r(this.$box,this._darkMode$,"color-scheme-light",Si),this._renderSideEffect.add((function(){var e=t.wrapClassName("minimized"),r=t.wrapClassName("maximized"),n="box-maximized-timer";return t._state$.subscribe((function(i){t.$box.classList.toggle(e,i===ei.Minimized),i===ei.Maximized?(t._renderSideEffect.flush(n),t.$box.classList.toggle(r,!0)):t._renderSideEffect.setTimeout((function(){t.$box.classList.toggle(r,!1)}),0,n)}))})),this._renderSideEffect.add((function(){return t._visible$.subscribe((function(e){t.$box.style.display=e?"block":"none"}))})),this._renderSideEffect.add((function(){return t._zIndex$.subscribe((function(e){t.$box.style.zIndex=String(e)}))}));var n=Kn(this.$box);this.$box.dataset.teleBoxID=this.id,this.$box.style.width=this.absoluteWidth+"px",this.$box.style.height=this.absoluteHeight+"px";var i=this.x*this.containerRect.width+this.containerRect.x,a=this.y*this.containerRect.height+this.containerRect.y;this.$box.style.transform="translate(".concat(i-10,"px,").concat(a-10,"px)"),this._valSideEffectBinder.combine([this._coord$,this._size$,this._minimized$,this._containerRect$,this._collectorRect$],(function(e){var t=o(e,5),r=t[0],n=t[1],i=t[2],a=t[3],s=t[4],u=n.width*a.width,l=n.height*a.height;return{width:u+(i&&s?1:0),height:l+(i&&s?1:0),x:r.x*a.width,y:r.y*a.height,scaleX:i&&s?s.width/u:1,scaleY:i&&s?s.height/l:1}}),ii).subscribe((function(e){n.set(e)})),n.set({x:i,y:a});var s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);var u=document.createElement("div");u.className=this.wrapClassName("titlebar-wrap"),u.appendChild(this.titleBar.render()),this.$titleBar=u;var l=document.createElement("div");l.className=this.wrapClassName("content-wrap");var c=document.createElement("div");c.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=c,this._renderSideEffect.add((function(){var e;return t._$userStyles$.subscribe((function(t){e&&e.remove(),e=t,t&&l.appendChild(t)}))})),this._renderSideEffect.add((function(){var e;return t._$userContent$.subscribe((function(t){e&&e.remove(),e=t,t&&c.appendChild(t)}))})),l.appendChild(c);var h=document.createElement("div");return h.className=this.wrapClassName("footer-wrap"),this.$footer=h,this._renderSideEffect.add((function(){var e;return t._$userFooter$.subscribe((function(t){e&&e.remove(),e=t,t&&h.appendChild(t)}))})),s.appendChild(u),s.appendChild(l),s.appendChild(h),this._renderResizeHandlers(),this.$box}},{key:"_renderResizeHandlers",value:function(){var e=this,t=document.createElement("div");t.className=this.wrapClassName("resize-handles"),Object.values(ni).forEach((function(r){var n=document.createElement("div");n.className=e.wrapClassName(r)+" "+e.wrapClassName("resize-handle"),n.dataset.teleBoxHandle=r,t.appendChild(n)})),this.$box.appendChild(t);var r,n,i="handle-tracking-listener",o=this.wrapClassName("transforming"),a=0,s=0,u=0,l=0,c=0,h=0,d=function(t){if(e.state===ei.Normal){mi(t);var r=yi(t),i=r.pageX,o=r.pageY;o<0&&(o=0);var d=(i-c)/e.containerRect.width,f=(o-h)/e.containerRect.height;switch(n){case ni.North:e.transform(e.x,s+f,e.width,l-f);break;case ni.South:e.transform(e.x,e.y,e.width,l+f);break;case ni.West:e.transform(a+d,e.y,u-d,e.height);break;case ni.East:e.transform(e.x,e.y,u+d,e.height);break;case ni.NorthWest:e.transform(a+d,s+f,u-d,l-f);break;case ni.NorthEast:e.transform(e.x,s+f,u+d,l-f);break;case ni.SouthEast:e.transform(e.x,e.y,u+d,l+f);break;case ni.SouthWest:e.transform(a+d,e.y,u-d,l+f);break;default:if(e.fence)e.move(gi(a+d,0,1-e.width),gi(s+f,0,1-e.height));else{var p=20/e.containerRect.width,v=20/e.containerRect.height;e.move(gi(a+d,p-e.width,1-p),gi(s+f,0,1-v))}}}},f=function(t){n=void 0,r&&(mi(t),e.$box.classList.toggle(o,!1),e._sideEffect.flush(i),r.remove())},p=function(t){var p;if(!(e.readonly||null!=t.button&&0!==t.button||!e.draggable||n||e.state!==ei.Normal)){var v=t.target;if(null!=(p=v.dataset)&&p.teleBoxHandle){var g;mi(t),a=e.x,s=e.y,u=e.width,l=e.height,g=yi(t),c=g.pageX,h=g.pageY,n=v.dataset.teleBoxHandle,r||(r=document.createElement("div"));var m=n?e.wrapClassName("cursor-".concat(n)):"";r.className=e.wrapClassName("track-mask".concat(m?" ".concat(m):"")),e.$box.appendChild(r),e.$box.classList.add(o),e._sideEffect.add((function(){return window.addEventListener("mousemove",d),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("mouseup",f),window.addEventListener("touchend",f,{passive:!1}),window.addEventListener("touchcancel",f,{passive:!1}),function(){window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),window.removeEventListener("touchcancel",f)}}),i)}}};this._handleTrackStart=p,this._sideEffect.addEventListener(t,"mousedown",p,{},"box-resizeHandles-mousedown"),this._sideEffect.addEventListener(t,"touchstart",p,{passive:!1},"box-resizeHandles-touchstart")}},{key:"destroy",value:function(){this.$box.remove(),this.events.emit(ti.Destroyed),this._sideEffect.flushAll(),this._renderSideEffect.flushAll(),this.events.removeAllListeners(),this._delegateEvents.removeAllListeners()}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}},{key:"minWidth",get:function(){return this._minSize$.value.width}},{key:"minHeight",get:function(){return this._minSize$.value.height}},{key:"intrinsicWidth",get:function(){return this._intrinsicSize$.value.width}},{key:"intrinsicHeight",get:function(){return this._intrinsicSize$.value.height}},{key:"width",get:function(){return this._size$.value.width}},{key:"height",get:function(){return this._size$.value.height}},{key:"absoluteWidth",get:function(){return this.width*this.containerRect.width}},{key:"absoluteHeight",get:function(){return this.height*this.containerRect.height}},{key:"visualWidth",get:function(){return this._visualSize$.value.width}},{key:"visualHeight",get:function(){return this._visualSize$.value.height}},{key:"intrinsicX",get:function(){return this._intrinsicCoord$.value.x}},{key:"intrinsicY",get:function(){return this._intrinsicCoord$.value.y}},{key:"x",get:function(){return this._coord$.value.x}},{key:"y",get:function(){return this._coord$.value.y}}]),e}();function ki(){}var Ei,Ai=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.visible,i=void 0===n||n,o=r.readonly,a=void 0!==o&&o,s=r.darkMode,u=void 0!==s&&s,l=r.namespace,c=void 0===l?"telebox":l,h=r.styles,d=void 0===h?{}:h,f=r.onClick;y(this,e),this.handleCollectorClick=function(){!t._readonly&&t.onClick&&t.onClick()},this._visible=i,this._readonly=a,this._darkMode=u,this.namespace=c,this.styles=d,this.onClick=f}return b(e,[{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$collector&&this.$collector.remove(),this}},{key:"setVisible",value:function(e){return this._visible!==e&&(this._visible=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-visible"),e)),this}},{key:"setReadonly",value:function(e){return this._readonly!==e&&(this._readonly=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-readonly"),e)),this}},{key:"setDarkMode",value:function(e){return this._darkMode!==e&&(this._darkMode=e,this.$collector&&(this.$collector.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$collector.classList.toggle(this.wrapClassName("color-scheme-light"),!e))),this}},{key:"setStyles",value:function(e){if(Object.assign(this.styles,e),this.$collector){var t=this.$collector;Object.keys(e).forEach((function(r){var n=e[r];null!=n&&(t.style[r]=n)}))}return this}},{key:"render",value:function(){return this.$collector||(this.$collector=document.createElement("button"),this.$collector.className=this.wrapClassName("collector"),this.$collector.style.backgroundImage="url('".concat("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K","')"),this.$collector.addEventListener("click",this.handleCollectorClick),this._visible&&this.$collector.classList.add(this.wrapClassName("collector-visible")),this._readonly&&this.$collector.classList.add(this.wrapClassName("collector-readonly")),this.$collector.classList.add(this.wrapClassName(this._darkMode?"color-scheme-dark":"color-scheme-light")),this.setStyles(this.styles)),this.$collector}},{key:"destroy",value:function(){this.$collector&&(this.$collector.removeEventListener("click",this.handleCollectorClick),this.$collector.remove(),this.$collector=void 0),this.onClick=void 0}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"visible",get:function(){return this._visible}},{key:"readonly",get:function(){return this._readonly}},{key:"darkMode",get:function(){return this._darkMode}}]),e}();!function(e){e.Focused="focused",e.Blurred="blurred",e.Created="created",e.Removed="removed",e.State="state",e.Maximized="maximized",e.Minimized="minimized",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.PrefersColorScheme="prefers_color_scheme",e.DarkMode="dark_mode"}(Ei||(Ei={}));var Ii,Ci,Pi=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).boxes=e.boxes,n.focusedBox=e.focusedBox,n.containerRect=e.containerRect,n.darkMode=e.darkMode,n}return b(r,[{key:"focusBox",value:function(e){var t;if(!this.focusedBox||this.focusedBox!==e){if(this.$titles&&this.state===ei.Maximized)for(var r=this.$titles.firstElementChild.children,n=r.length-1;n>=0;n-=1){var i=r[n],o=null==(t=i.dataset)?void 0:t.teleBoxID;o&&(e&&o===e.id?i.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&o===this.focusedBox.id&&i.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}this.focusedBox=e}}},{key:"setContainerRect",value:function(e){if(this.containerRect=e,this.$titleBar){var t=e.x,r=e.y,n=e.width;this.$titleBar.style.transform="translate(".concat(t,"px, ").concat(r,"px)"),this.$titleBar.style.width=n+"px"}}},{key:"setBoxes",value:function(e){this.boxes=e,this.updateTitles()}},{key:"setState",value:function(e){i(v(r.prototype),"setState",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"),e===ei.Maximized),this.updateTitles()}},{key:"setReadonly",value:function(e){i(v(r.prototype),"setReadonly",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("readonly"),this.readonly)}},{key:"setDarkMode",value:function(e){e!==this.darkMode&&(this.darkMode=e,this.$titleBar&&(this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-light"),!e)))}},{key:"render",value:function(){var e=i(v(r.prototype),"render",this).call(this),t=this.containerRect,n=t.x,o=t.y,a=t.width;e.style.transform="translate(".concat(n,"px, ").concat(o,"px)"),e.style.width=a+"px",e.classList.add(this.wrapClassName("max-titlebar")),e.classList.toggle(this.wrapClassName("max-titlebar-maximized"),this.state===ei.Maximized),e.classList.toggle(this.wrapClassName("readonly"),this.readonly),e.classList.add(this.wrapClassName(this.darkMode?"color-scheme-dark":"color-scheme-light"));var s=document.createElement("div");return s.classList.add(this.wrapClassName("titles-area")),e.insertBefore(s,e.firstElementChild),this.updateTitles(),e}},{key:"destroy",value:function(){i(v(r.prototype),"destroy",this).call(this),this.$titles=void 0,this.boxes.length=0,this.focusedBox=void 0}},{key:"updateTitles",value:function(){this.$titleBar&&this.state===ei.Maximized&&(this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-single-title"),1===this.boxes.length),1===this.boxes.length?this.setTitle(this.boxes[0].title):this.$titleBar.replaceChild(this.renderTitles(),this.$titleBar.firstElementChild))}},{key:"renderTitles",value:function(){var e=this;this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.$titles.addEventListener("wheel",(function(e){e.currentTarget.scrollBy({left:e.deltaY>0?250:-250,behavior:"smooth"})}),{passive:!1});var t=document.createElement("div");return t.className=this.wrapClassName("titles-content"),this.$titles.appendChild(t),this.boxes.forEach((function(r){var n=document.createElement("button");n.className=e.wrapClassName("titles-tab"),n.textContent=r.title,n.dataset.teleBoxID=r.id,n.dataset.teleTitleBarNoDblClick="true",e.focusedBox&&r.id===e.focusedBox.id&&n.classList.add(e.wrapClassName("titles-tab-focus")),t.appendChild(n)})),this.$titles}}]),r}(Ti),Ni=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.root,i=void 0===n?document.body:n,a=r.prefersColorScheme,s=void 0===a?Jn.Light:a,u=r.minimized,l=void 0!==u&&u,c=r.maximized,h=void 0!==c&&c,d=r.fence,f=void 0===d||d,p=r.containerRect,v=void 0===p?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:p,g=r.collector,m=r.namespace,_=void 0===m?"telebox":m,b=r.readonly,x=void 0!==b&&b;y(this,e),this.events=new Tr,this._sideEffect=new li;var w=pi(this._sideEffect),S=w.combine,T=w.createVal;this.root=i,this.namespace=_,this.boxes$=T([]),this.topBox$=this.boxes$.derive((function(e){if(e.length>0)return e.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}))}));var M=window.matchMedia("(prefers-color-scheme: dark)"),k=T(!1);M&&(k.setValue(M.matches),this._sideEffect.add((function(){var e=function(e){k.setValue(e.matches)};return M.addListener(e),function(){return M.removeListener(e)}})));var E=T(s);E.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setPrefersColorScheme(e,n)})),n||t.events.emit(Ei.PrefersColorScheme,e)})),this._darkMode$=S([k,E],(function(e){var t=o(e,2),r=t[0],n=t[1];return"auto"===n?r:"dark"===n})),this._darkMode$.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setDarkMode(e,n)})),n||t.events.emit(Ei.DarkMode,e)}));var A=T(x);A.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setReadonly(e,n)}))}));var I=T(l),C=T(h);C.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setMaximized(e,n)})),n||t.events.emit(Ei.Maximized,e)}));var P=S([I,C],(function(e){var t=o(e,2),r=t[0],n=t[1];return r?ei.Minimized:n?ei.Maximized:ei.Normal}));P.reaction((function(e,r,n){t.maxTitleBar.setState(e),n||t.events.emit(Ei.State,e)}));var N=T(f);N.subscribe((function(e,r,n){t.boxes.forEach((function(t){return t.setFence(e,n)}))}));var O=T(v,ii);O.reaction((function(e,r,n){t.boxes.forEach((function(t){return t.setContainerRect(e,n)})),t.maxTitleBar.setContainerRect(e)}));var R=T(null===g?null:g||new Ai({visible:l,readonly:x,namespace:_}).mount(i));R.subscribe((function(e){e&&(e.setVisible(I.value),e.setReadonly(A.value),e.setDarkMode(t._darkMode$.value),t._sideEffect.add((function(){return e.onClick=function(){A.value||I.setValue(!1)},function(){return e.destroy()}}),"collect-onClick"))})),A.subscribe((function(e){var t;return null==(t=R.value)?void 0:t.setReadonly(e)})),this._darkMode$.subscribe((function(e){var t;null==(t=R.value)||t.setDarkMode(e)}));var D=function(){var e;if(null!=(e=R.value)&&e.$collector){var r=R.value.$collector.getBoundingClientRect(),n=r.x,i=r.y,o=r.width,a=r.height,s=t.root.getBoundingClientRect();return{x:n-s.x,y:i-s.y,width:o,height:a}}},L=T(I.value?D():void 0);L.subscribe((function(e,r,n){t.boxes.forEach((function(t){t.setCollectorRect(e,n)}))})),I.subscribe((function(e,r,n){var i,o;null==(i=R.value)||i.setVisible(e),e&&null!=(o=R.value)&&o.$collector&&L.setValue(D()),t.boxes.forEach((function(t){return t.setMinimized(e,n)})),n||t.events.emit(Ei.Minimized,e)}));var j=this.wrapClassName("titlebar-icon-close"),z=function(e){var r;if(!A.value){var n=e.target;if(n.tagName)for(var i=n;i;i=i.parentElement){if(i.classList&&i.classList.contains(j))return;var o=null==(r=i.dataset)?void 0:r.teleBoxID;if(o){var a=t.getBox(o);if(a)return t.focusBox(a),void t.makeBoxTop(a)}}}};this._sideEffect.addEventListener(window,"mousedown",z,!0),this._sideEffect.addEventListener(window,"touchstart",z,!0),this.maxTitleBar=new Pi({darkMode:this.darkMode,readonly:A.value,namespace:this.namespace,state:P.value,boxes:this.boxes$.value,containerRect:O.value,onEvent:function(e){switch(e.type){case ri.Maximize:C.setValue(!C.value);break;case ri.Minimize:I.setValue(!0);break;case ti.Close:t.removeTopBox(),t.focusTopBox()}}}),A.subscribe((function(e){return t.maxTitleBar.setReadonly(e)})),this._darkMode$.subscribe((function(e){t.maxTitleBar.setDarkMode(e)})),this.boxes$.reaction((function(e){t.maxTitleBar.setBoxes(e)})),fi(this,{prefersColorScheme:E,containerRect:O,collector:R,collectorRect:L,readonly:A,fence:N,minimized:I,maximized:C}),this._state$=P,this.root.appendChild(this.maxTitleBar.render())}return b(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case ei.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case ei.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"create",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=new Mi(wr(xr({zIndex:this.topBox?this.topBox.zIndex+1:100},r?this.smartPosition(t):t),{darkMode:this.darkMode,prefersColorScheme:this.prefersColorScheme,maximized:this.maximized,minimized:this.minimized,fence:this.fence,namespace:this.namespace,containerRect:this.containerRect,readonly:this.readonly,collectorRect:this.collectorRect}));return n.mount(this.root),n.focus&&(this.focusBox(n),r&&this.makeBoxTop(n)),this.boxes$.setValue([].concat(a(this.boxes),[n])),n._delegateEvents.on(ri.Maximize,(function(){e.setMaximized(!e.maximized)})),n._delegateEvents.on(ri.Minimize,(function(){e.setMinimized(!0)})),n._delegateEvents.on(ri.Close,(function(){e.remove(n),e.focusTopBox()})),n._coord$.reaction((function(t,r,i){i||e.events.emit(Ei.Move,n)})),n._size$.reaction((function(t,r,i){i||e.events.emit(Ei.Resize,n)})),n._intrinsicCoord$.reaction((function(t,r,i){i||e.events.emit(Ei.IntrinsicMove,n)})),n._intrinsicSize$.reaction((function(t,r,i){i||e.events.emit(Ei.IntrinsicResize,n)})),n._visualSize$.reaction((function(t,r,i){i||e.events.emit(Ei.VisualResize,n)})),n._zIndex$.reaction((function(t,r,i){if(e.boxes.length>0){var o=e.boxes.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}));e.topBox$.setValue(o)}i||e.events.emit(Ei.ZIndex,n)})),this.events.emit(Ei.Created,n),n}},{key:"query",value:function(e){return e?this.boxes.filter(this.teleBoxMatcher(e)):a(this.boxes)}},{key:"queryOne",value:function(e){return e?this.boxes.find(this.teleBoxMatcher(e)):this.boxes[0]}},{key:"update",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.boxes.find((function(t){return t.id===e}));if(n)return this.updateBox(n,t,r)}},{key:"updateAll",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.boxes.forEach((function(n){t.updateBox(n,e,r)}))}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBoxIndex(e);if(r>=0){var n=this.boxes.slice(),i=n.splice(r,1);return this.boxes$.setValue(n),i.forEach((function(e){return e.destroy()})),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(Ei.Removed,i)),i[0]}}},{key:"removeTopBox",value:function(){if(this.topBox)return this.remove(this.topBox)}},{key:"removeAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.boxes$.value;return this.boxes$.setValue([]),t.forEach((function(e){return e.destroy()})),e||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(Ei.Removed,t)),t}},{key:"destroy",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.events.removeAllListeners(),this._sideEffect.flushAll(),this.removeAll(t),Object.keys(this).forEach((function(t){var r=e[t];r instanceof di&&r.destroy()}))}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"focusBox",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getBox(e);n&&(this.boxes.forEach((function(e){if(n===e){var i=!1;n.focus||(i=!0,n.setFocus(!0,r)),i&&!r&&t.events.emit(Ei.Focused,n)}else e.focus&&t.blurBox(e,r)})),this.maxTitleBar.focusBox(n))}},{key:"focusTopBox",value:function(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}},{key:"blurBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBox(e);r&&(r.focus&&(r.setFocus(!1,t),t||this.events.emit(Ei.Blurred,r)),this.maxTitleBar.focusedBox===r&&this.maxTitleBar.focusBox())}},{key:"blurAll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.boxes.forEach((function(r){r.focus&&(r.setFocus(!1,t),t||e.events.emit(Ei.Blurred,r))})),this.maxTitleBar.focusedBox&&this.maxTitleBar.focusBox()}},{key:"teleBoxMatcher",value:function(e){var t=Object.keys(e);return function(r){return t.every((function(t){return e[t]===r[t]}))}}},{key:"updateBox",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(null!=t.x||null!=t.y)&&e.move(null==t.x?e.intrinsicX:t.x,null==t.y?e.intrinsicY:t.y,r),(null!=t.width||null!=t.height)&&e.resize(null==t.width?e.intrinsicWidth:t.width,null==t.height?e.intrinsicHeight:t.height,r),null!=t.title&&(e.setTitle(t.title),this.maxTitleBar.updateTitles()),null!=t.visible&&e.setVisible(t.visible,r),null!=t.minHeight&&e.setMinHeight(t.minHeight,r),null!=t.minWidth&&e.setMinWidth(t.minWidth,r),null!=t.resizable&&e.setResizable(t.resizable,r),null!=t.draggable&&e.setDraggable(t.draggable,r),null!=t.fixRatio&&e.setFixRatio(t.fixRatio,r),null!=t.zIndex&&e.setZIndex(t.zIndex,r),null!=t.content&&e.mountContent(t.content),null!=t.footer&&e.mountFooter(t.footer)}},{key:"smartPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=e.y,n=e.width,i=void 0===n?.5:n,o=e.height,a=void 0===o?.5:o;if(null==t){var s=20;this.topBox&&((s=this.topBox.intrinsicX*this.containerRect.width+20)>this.containerRect.width-i*this.containerRect.width&&(s=20)),t=s/this.containerRect.width}if(null==r){var u=20;this.topBox&&((u=this.topBox.intrinsicY*this.containerRect.height+20)>this.containerRect.height-a*this.containerRect.height&&(u=20)),r=u/this.containerRect.height}return wr(xr({},e),{x:t,y:r,width:i,height:a})}},{key:"makeBoxTop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.topBox&&e!==this.topBox&&e.setZIndex(this.topBox.zIndex+1,t)}},{key:"getBoxIndex",value:function(e){return"string"==typeof e?this.boxes.findIndex((function(t){return t.id===e})):this.boxes.findIndex((function(t){return t===e}))}},{key:"getBox",value:function(e){return"string"==typeof e?this.boxes.find((function(t){return t.id===e})):e}},{key:"boxes",get:function(){return this.boxes$.value}},{key:"topBox",get:function(){return this.topBox$.value}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}}]),e}(),Oi=function(){function e(t,r){var n=this;y(this,e),this.context=t,this.createTeleBoxManagerConfig=r;var i=t.emitter,o=t.callbacks,a=t.boxEmitter;this.teleBoxManager=this.setupBoxManager(r),this.teleBoxManager._state$.reaction((function(e){o.emit("boxStateChange",e),i.emit("boxStateChange",e)})),this.teleBoxManager._darkMode$.reaction((function(e){o.emit("darkModeChange",e)})),this.teleBoxManager._prefersColorScheme$.reaction((function(e){o.emit("prefersColorSchemeChange",e)})),this.teleBoxManager._minimized$.reaction((function(e){e||setTimeout((function(){var e=.001*(Math.random()>.5?1:-1);n.teleBoxManager.boxes.forEach((function(t){t.resize(t.intrinsicWidth+e,t.intrinsicHeight+e,!0)}))}),400)})),this.teleBoxManager.events.on("minimized",(function(e){if(n.context.safeSetAttributes({minimized:e}),e)n.context.cleanFocus(),n.blurAllBox();else{var t=n.getTopBox();t&&(n.context.setAppFocus(t.id),n.focusBox({appId:t.id},!1))}})),this.teleBoxManager.events.on("maximized",(function(e){n.context.safeSetAttributes({maximized:e})})),this.teleBoxManager.events.on("removed",(function(e){e.forEach((function(e){a.emit("close",{appId:e.id})}))})),this.teleBoxManager.events.on("intrinsic_move",j.debounce((function(e){a.emit("move",{appId:e.id,x:e.intrinsicX,y:e.intrinsicY})}),50)),this.teleBoxManager.events.on("intrinsic_resize",j.debounce((function(e){a.emit("resize",{appId:e.id,width:e.intrinsicWidth,height:e.intrinsicHeight})}),200)),this.teleBoxManager.events.on("focused",(function(e){e&&(n.canOperate?a.emit("focus",{appId:e.id}):n.teleBoxManager.blurBox(e.id))})),this.teleBoxManager.events.on("z_index",(function(e){n.context.updateAppState(e.id,K.ZIndex,e.zIndex)})),i.on("playgroundSizeChange",(function(){return n.updateManagerRect()})),i.on("updateManagerRect",(function(){return n.updateManagerRect()}))}return b(e,[{key:"createBox",value:function(e){var t,r,n;if(this.teleBoxManager){var i=null!=(t=e.app.config)?t:{},o=i.minwidth,a=void 0===o?.4722222222222222:o,s=i.minheight,u=void 0===s?.4722222222222222:s,l=null!=(r=e.app.config)?r:{},c=l.width,h=l.height,d=(null==(n=e.options)?void 0:n.title)||e.appId,f=this.teleBoxManager.containerRect;a>1&&(a/=f.width),u>1&&(u/=f.height);var p={title:d,minWidth:a,minHeight:u,width:c,height:h,id:e.appId};this.teleBoxManager.create(p,e.smartPosition),this.context.emitter.emit("".concat(e.appId).concat(q.WindowCreated))}}},{key:"setBoxInitState",value:function(e){var t=this.teleBoxManager.queryOne({id:e});t&&t.state===ei.Maximized&&this.context.boxEmitter.emit("resize",{appId:e,x:t.x,y:t.y,width:t.intrinsicWidth,height:t.intrinsicHeight})}},{key:"setupBoxManager",value:function(e){var t=Z_.wrapper?Z_.wrapper:document.body,r=t.getBoundingClientRect(),n={root:t,containerRect:{x:0,y:0,width:r.width,height:r.height},fence:!1,prefersColorScheme:null==e?void 0:e.prefersColorScheme},i=new Ni(n);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=i;var o=(null==e?void 0:e.collectorContainer)||Z_.wrapper;return o&&this.setCollectorContainer(o),i}},{key:"setCollectorContainer",value:function(e){var t,r=new Ai({styles:null==(t=this.createTeleBoxManagerConfig)?void 0:t.collectorStyles}).mount(e);this.teleBoxManager.setCollector(r)}},{key:"getBox",value:function(e){return this.teleBoxManager.queryOne({id:e})}},{key:"closeBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.teleBoxManager.remove(e,t)}},{key:"boxIsFocus",value:function(e){var t=this.getBox(e);return null==t?void 0:t.focus}},{key:"getFocusBox",value:function(){return this.teleBoxManager.query({focus:!0})[0]}},{key:"getTopBox",value:function(){return this.teleBoxManager.topBox}},{key:"updateBoxState",value:function(e){var t=this;if(e){var r=this.getBox(e.id);r&&(this.teleBoxManager.update(r.id,{x:e.x,y:e.y,width:e.width||.5,height:e.height||.5,zIndex:e.zIndex},!0),setTimeout((function(){e.focus&&t.teleBoxManager.focusBox(r.id,!0),null!=e.maximized&&t.teleBoxManager.setMaximized(Boolean(e.maximized),!0),null!=e.minimized&&t.teleBoxManager.setMinimized(Boolean(e.minimized),!0)}),50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}}},{key:"updateManagerRect",value:function(){var e,t=null==(e=this.mainView.divElement)?void 0:e.getBoundingClientRect();if(t&&t.width>0&&t.height>0){var r={x:0,y:0,width:t.width,height:t.height};this.teleBoxManager.setContainerRect(r),this.context.notifyContainerRectUpdate(this.teleBoxManager.containerRect)}}},{key:"moveBox",value:function(e){var t=e.appId,r=e.x,n=e.y;this.teleBoxManager.update(t,{x:r,y:n},!0)}},{key:"focusBox",value:function(e){var t=e.appId,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.focusBox(t,r)}},{key:"resizeBox",value:function(e){var t=e.appId,r=e.width,n=e.height,i=e.skipUpdate;this.teleBoxManager.update(t,{width:r,height:n},i)}},{key:"setBoxMinSize",value:function(e){this.teleBoxManager.update(e.appId,{minWidth:e.minWidth,minHeight:e.minHeight},!0)}},{key:"setBoxTitle",value:function(e){this.teleBoxManager.update(e.appId,{title:e.title},!0)}},{key:"blurAllBox",value:function(){this.teleBoxManager.blurAll()}},{key:"updateAll",value:function(e){this.teleBoxManager.updateAll(e)}},{key:"setMaximized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e!==this.maximized&&this.teleBoxManager.setMaximized(e,t)}},{key:"setMinimized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.setMinimized(e,t)}},{key:"focusTopBox",value:function(){if(this.teleBoxManager.query().length>=1){var e=this.getTopBox();e&&this.focusBox({appId:e.id},!1)}}},{key:"updateBox",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,t,r)}},{key:"setReadonly",value:function(e){this.teleBoxManager.setReadonly(e)}},{key:"setPrefersColorScheme",value:function(e){this.teleBoxManager.setPrefersColorScheme(e)}},{key:"setZIndex",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,{zIndex:t},r)}},{key:"destroy",value:function(){this.teleBoxManager.destroy()}},{key:"mainView",get:function(){return this.context.getMainView()}},{key:"canOperate",get:function(){return this.context.canOperate()}},{key:"boxState",get:function(){return this.teleBoxManager.state}},{key:"maximized",get:function(){return this.teleBoxManager.maximized}},{key:"minimized",get:function(){return this.teleBoxManager.minimized}},{key:"darkMode",get:function(){return this.teleBoxManager.darkMode}},{key:"prefersColorScheme",get:function(){return this.teleBoxManager.prefersColorScheme}},{key:"boxSize",get:function(){return this.teleBoxManager.boxes.length}}]),e}();function Ri(){}function Di(e){return e()}function Li(){return Object.create(null)}function ji(e){e.forEach(Di)}function zi(e){return"function"==typeof e}function Bi(e,t){return e!=e?t==t:e!==t||e&&"object"==x(e)||"function"==typeof e}function Fi(e,t){return Ii||(Ii=document.createElement("a")),Ii.href=t,e===Ii.href}function Ui(e,t){e.appendChild(t)}function Wi(e,t,r){e.insertBefore(t,r||null)}function Gi(e){e.parentNode.removeChild(e)}function Vi(e){return document.createElement(e)}function Hi(e){return document.createTextNode(e)}function Yi(){return Hi(" ")}function $i(e,t,r){null==r?e.removeAttribute(t):e.getAttribute(t)!==r&&e.setAttribute(t,r)}function Xi(e){return Array.from(e.childNodes)}function qi(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Qi(e,t,r,n){null===r?e.style.removeProperty(t):e.style.setProperty(t,r,n?"important":"")}function Zi(e){Ci=e}var Ki=[],Ji=[],eo=[],to=[],ro=Promise.resolve(),no=!1;function io(e){eo.push(e)}var oo=new Set,ao=0;function so(){var e=Ci;do{for(;ao7&&void 0!==arguments[7]?arguments[7]:[-1],u=Ci;Zi(e);var l=e.$$={fragment:null,ctx:null,props:o,update:Ri,not_equal:i,bound:Li(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Li(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(l.root);var c=!1;if(l.ctx=r?r(e,t.props||{},(function(t,r){var n=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:r;return l.ctx&&i(l.ctx[t],l.ctx[t]=n)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](n),c&&fo(e,t)),r})):[],l.update(),c=!0,ji(l.before_update),l.fragment=!!n&&n(l.ctx),t.target){if(t.hydrate){var h=Xi(t.target);l.fragment&&l.fragment.l(h),h.forEach(Gi)}else l.fragment&&l.fragment.c();t.intro&&co(e.$$.fragment),ho(e,t.target,t.anchor,t.customElement),so()}Zi(u)}(c(n=t.call(this)),e,_o,yo,Bi,{uid:0,cursorName:1,tagName:2,backgroundColor:3,appliance:4,x:5,y:6,src:7,visible:21,avatar:8,theme:9,color:10,cursorTagBackgroundColor:11,opacity:12,pencilEraserSize:22,custom:13}),n}return r}(po),xo="data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle cx='12' cy='12' r='2.5' stroke='%23000' stroke-linejoin='square'/%3E%3Ccircle cx='12' cy='12' r='3.5' stroke='%23FFF'/%3E%3C/g%3E%3C/svg%3E";function wo(e){return"data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle cx='12' cy='12' r='2.5' stroke='%23".concat(e,"' stroke-linejoin='square'/%3E%3Ccircle cx='12' cy='12' r='3.5' stroke='%23").concat(e,"'/%3E%3C/g%3E%3C/svg%3E")}function So(e){return"data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg' fill='none'%3E%3Cpath d='M5 12H19' stroke='%23".concat(e,"' stroke-linejoin='round'/%3E%3Cpath d='M12 5V19' stroke='%23").concat(e,"' stroke-linejoin='round'/%3E%3C/svg%3E")}function To(e){return'url("'.concat(e,'") 12 12, auto')}var Mo=document.createElement("style");var ko=new Set([z.ApplianceNames.rectangle,z.ApplianceNames.ellipse,z.ApplianceNames.straight,z.ApplianceNames.arrow,z.ApplianceNames.shape]);function Eo(e,t){return e===z.ApplianceNames.pencil?wo(t):e===z.ApplianceNames.eraser?xo:ko.has(e)?So(t):void 0}var Ao=function(){function e(t,r,n,i){var o=this;y(this,e),this.manager=t,this.memberId=r,this.cursorManager=n,this.wrapper=i,this.style="default",this.move=function(e){var t;if("main"===e.type){var r=o.cursorManager.wrapperRect;o.component&&r&&(o.autoHidden(),o.moveCursor(e,r,o.manager.mainView))}else{var n=o.cursorManager.focusView,i=null==(t=null==n?void 0:n.divElement)?void 0:t.getBoundingClientRect(),a=null==n?void 0:n.camera;n&&i&&a&&o.component&&(o.autoHidden(),o.moveCursor(e,i,n))}},this.setStyle=function(e){o.style=e,o.component&&o.component.$set({src:o.getIcon(),custom:o.isCustomIcon()})},this.leave=function(){o.hide()},this.updateMember(),this.createCursor(),this.autoHidden(),this.setStyle(n.style)}var t;return b(e,[{key:"moveCursor",value:function(e,t,r){var n,i,o=e.x,a=e.y,s=e.type,u=null==r?void 0:r.screen.convertPointToScreen(o,a);if(u){var l=u.x-2,c=u.y-18;if(this.isCustomIcon()&&(l-=11,c+=4),"app"===s){var h=this.cursorManager.wrapperRect;h&&(l=l+t.x-h.x,c=c+t.y-h.y)}u.x<0||u.x>t.width||u.y<0||u.y>t.height?null==(n=this.component)||n.$set({visible:!1,x:l,y:c}):null==(i=this.component)||i.$set({visible:!0,x:l,y:c})}}},{key:"autoHidden",value:function(){var e=this;this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout((function(){e.hide()}),1e4)}},{key:"createCursor",value:(t=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.member&&this.wrapper&&(this.component=new bo({target:this.wrapper,props:this.initProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"initProps",value:function(){var e;return{uid:this.memberId,x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),custom:this.isCustomIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName,pencilEraserSize:null==(e=this.member)?void 0:e.memberState.pencilEraserSize}}},{key:"getIcon",value:function(){var e;if(this.member){var t=this.memberApplianceName,r=this.memberColorHex,n=this.cursorManager,i=n.userApplianceIcons,o=n.applianceIcons,a=this.memberApplianceName;a===z.ApplianceNames.pencilEraser&&(a="".concat(a).concat((null==(e=this.member)?void 0:e.memberState.pencilEraserSize)||1));var s=a&&i[a];if(s)return s;if("custom"===this.style&&t){var u=Eo(t,r);if(u)return u}return o[a||z.ApplianceNames.shape]||o[z.ApplianceNames.shape]}}},{key:"isCustomIcon",value:function(){var e;if(!this.member)return!1;var t=this.memberApplianceName,r=this.memberColorHex,n=this.cursorManager.userApplianceIcons,i=this.memberApplianceName;return i===z.ApplianceNames.pencilEraser&&(i="".concat(i).concat((null==(e=this.member)?void 0:e.memberState.pencilEraserSize)||1)),(!i||!n[i])&&!("custom"!==this.style||!t||!Eo(t,r))}},{key:"updateMember",value:function(){return this.member=gt(this.manager.room,this.memberId),this.updateComponent(),this.member}},{key:"updateComponent",value:function(){var e;null==(e=this.component)||e.$set(j.omit(this.initProps(),["x","y"]))}},{key:"destroy",value:function(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}},{key:"hide",value:function(){this.component&&(this.component.$set({visible:!1}),this.destroy())}},{key:"memberApplianceName",get:function(){var e,t;return null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.currentApplianceName}},{key:"memberColor",get:function(){var e,t;return"rgb(".concat(null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor.join(","),")")}},{key:"memberColorHex",get:function(){var e,t,r=o((null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor)||[236,52,85],3);return((1<<24)+(r[0]<<16)+(r[1]<<8)+r[2]).toString(16).slice(1)}},{key:"payload",get:function(){var e;return null==(e=this.member)?void 0:e.payload}},{key:"memberCursorName",get:function(){var e,t;return(null==(e=this.payload)?void 0:e.nickName)||(null==(t=this.payload)?void 0:t.cursorName)||this.memberId}},{key:"memberTheme",get:function(){var e;return null!=(e=this.payload)&&e.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}},{key:"memberCursorTextColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTextColor)||"#FFFFFF"}},{key:"memberCursorTagBackgroundColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTagBackgroundColor)||this.memberColor}},{key:"memberAvatar",get:function(){var e;return null==(e=this.payload)?void 0:e.avatar}},{key:"memberOpacity",get:function(){return this.memberCursorName||this.memberAvatar?1:0}},{key:"memberTagName",get:function(){var e;return null==(e=this.payload)?void 0:e.cursorTagName}}]),e}(),Io=(w(n={},z.ApplianceNames.pencil,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="),w(n,z.ApplianceNames.selector,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="),w(n,z.ApplianceNames.eraser,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="),w(n,z.ApplianceNames.shape,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(n,z.ApplianceNames.text,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="),w(n,z.ApplianceNames.laserPointer,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(n,"pencilEraser1","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMjYiIHZpZXdCb3g9IjAgMCAxOCAyNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIxNyIgaGVpZ2h0PSIyNSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(n,"pencilEraser2","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjYiIGhlaWdodD0iMzQiIHZpZXdCb3g9IjAgMCAyNiAzNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIyNSIgaGVpZ2h0PSIzMyIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(n,"pencilEraser3","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iNTAiIHZpZXdCb3g9IjAgMCAzNCA1MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIzMyIgaGVpZ2h0PSI0OSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),n),Co="local-cursor",Po=function(){function e(t,r,n,i){var o,a=this;y(this,e),this.manager=t,this.enableCursor=r,this.cursorInstances=new Map,this.userApplianceIcons={},this.sideEffectManager=new Ye,this.store=this.manager.store,this.leaveFlag=!0,this._style="default",this.onCursorMove=function(e){var t=a.initCursorInstance(e.uid);if(e.state===te.Leave)t.leave();else{var r=t.updateMember();a.canMoveCursor(r)&&t.move(e.position)}},this.initCursorInstance=function(e){var t=a.cursorInstances.get(e);return t||(t=new Ao(a.manager,e,a,Z_.wrapper),a.cursorInstances.set(e,t)),t},this.mouseMoveListener_=function(e,t){var r=a.getType(e);a.updateCursor(r,e.clientX,e.clientY),t&&a.showPencilEraserIfNeeded(r,e.clientX,e.clientY)},this.mouseMoveTimer=0,this.mouseMoveListener=function(e){var t="touch"===e.pointerType;if(!t||e.isPrimary){var r=Date.now();if(r-a.mouseMoveTimer>48){if(a.mouseMoveTimer=r,Z_.supportAppliancePlugin&&z.isRoom(Z_.displayer)&&Z_.displayer.disableDeviceInputs)return void(a.leaveFlag&&(a.manager.dispatchInternalEvent(q.CursorMove,{uid:a.manager.uid,state:te.Leave}),a.leaveFlag=!1));a.mouseMoveListener_(e,t),a.leaveFlag=!0}}},this.mouseLeaveListener=function(){a.hideCursor(a.manager.uid)},this.getPoint=function(e,t,r){var n,i=null==(n=null==e?void 0:e.divElement)?void 0:n.getBoundingClientRect();if(i)return null==e?void 0:e.convertToPointInWorld({x:t-i.x,y:r-i.y})},this.getType=function(e){var t,r=e.target,n=a.manager.focusApp;switch(r.parentElement){case a.mainViewElement:return{type:"main"};case null==(t=null==n?void 0:n.view)?void 0:t.divElement:return{type:"app"};default:return{type:"main"}}},this.roomMembers=null==(o=this.manager.room)?void 0:o.state.roomMembers;var s=Z_.wrapper;s&&this.setupWrapper(s),this.sideEffectManager.add((function(){return se.on("cursorMove",a.onCursorMove)})),this.sideEffectManager.add((function(){return se.on("playgroundSizeChange",(function(){return a.updateContainerRect()}))}));var u=this.manager.room;u&&this.sideEffectManager.add((function(){var e=function(e){"custom"===a.style&&e.memberState&&a.enableCustomCursor()};return u.callbacks.on("onRoomStateChanged",e),function(){return u.callbacks.off("onRoomStateChanged",e)}})),i&&(this.userApplianceIcons=i),this.style=(null==n?void 0:n.style)||"default"}return b(e,[{key:"enableCustomCursor",value:function(){var e=this;this.sideEffectManager.add((function(){return function(e){var t=o(e.strokeColor,3),r=((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1);return Mo.textContent=function(e){var t="";for(var r in e)t+=".netless-whiteboard.".concat(r," {cursor: ").concat(e[r],"}\n");return t}({"cursor-pencil":To(wo(r)),"cursor-eraser":To(xo),"cursor-rectangle":To(So(r)),"cursor-ellipse":To(So(r)),"cursor-straight":To(So(r)),"cursor-arrow":To(So(r)),"cursor-shape":To(So(r))}),document.head.appendChild(Mo),function(){null!=Mo.parentNode&&document.head.removeChild(Mo)}}(e.manager.getMemberState())}),Co)}},{key:"canMoveCursor",value:function(e){var t=(null==e?void 0:e.memberState.currentApplianceName)===z.ApplianceNames.laserPointer;return this.enableCursor||t}},{key:"setupWrapper",value:function(e){var t=this;this.sideEffectManager.add((function(){return e.addEventListener("pointerenter",t.mouseMoveListener),e.addEventListener("pointermove",t.mouseMoveListener),e.addEventListener("pointerleave",t.mouseLeaveListener),function(){e.removeEventListener("pointerenter",t.mouseMoveListener),e.removeEventListener("pointermove",t.mouseMoveListener),e.removeEventListener("pointerleave",t.mouseLeaveListener)}})),this.wrapperRect=e.getBoundingClientRect()}},{key:"setMainViewDivElement",value:function(e){this.mainViewElement=e}},{key:"showPencilEraserIfNeeded",value:function(e,t,r){var n=gt(this.manager.room,this.manager.uid),i=(null==n?void 0:n.memberState.currentApplianceName)===z.ApplianceNames.pencilEraser;if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(n)&&i){var o="main"===e.type?this.manager.mainView:this.focusView,a=this.getPoint(o,t,r);a&&this.onCursorMove({uid:this.manager.uid,position:{x:a.x,y:a.y,type:e.type}})}}},{key:"updateCursor",value:function(e,t,r){var n=gt(this.manager.room,this.manager.uid);if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(n)){var i="main"===e.type?this.manager.mainView:this.focusView,o=this.getPoint(i,t,r);o&&this.manager.dispatchInternalEvent(q.CursorMove,{uid:this.manager.uid,position:{x:o.x,y:o.y,type:e.type}})}}},{key:"updateContainerRect",value:function(){var e,t;this.containerRect=null==(e=Z_.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=Z_.wrapper)?void 0:t.getBoundingClientRect()}},{key:"deleteCursor",value:function(e){this.store.cleanCursor(e);var t=this.cursorInstances.get(e);t&&t.destroy()}},{key:"hideCursor",value:function(e){var t=this.cursorInstances.get(e);t&&t.hide()}},{key:"destroy",value:function(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach((function(e){e.destroy()})),this.cursorInstances.clear())}},{key:"applianceIcons",get:function(){return O(O({},Io),this.userApplianceIcons)}},{key:"style",get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,this.cursorInstances.forEach((function(t){t.setStyle(e)})),"custom"===e?this.enableCustomCursor():this.sideEffectManager.flush(Co))}},{key:"boxState",get:function(){return this.store.getBoxState()}},{key:"focusView",get:function(){var e;return null==(e=this.manager.focusApp)?void 0:e.view}}]),e}(),No=function(){function e(t){var r=this;y(this,e),this.manager=t,se.on("changePageState",(function(){oe.emit("pageStateChange",r.toObject())}))}return b(e,[{key:"toObject",value:function(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}},{key:"index",get:function(){return this.manager.store.getMainViewSceneIndex()||0}},{key:"length",get:function(){return this.manager.mainViewScenesLength||0}}]),e}(),Oo=function(){function e(t){var r=this;y(this,e),this.ctx=t,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=function(){var e=m(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t===z.RoomPhase.Reconnecting&&r.ctx.emitter.emit("startReconnect"),e.t0=t===z.RoomPhase.Connected&&r.phase===z.RoomPhase.Reconnecting,!e.t0){e.next=10;break}if(null==(n=r.room)||!n.isWritable){e.next=7;break}null==(i=r.room)||i.dispatchMagixEvent(Z,{}),e.next=10;break;case 7:return e.next=9,Ce(500);case 9:r.onReconnected();case 10:r.phase=t;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReconnected=j.debounce((function(){r._onReconnected()}),1e3),this._onReconnected=function(){ot("onReconnected refresh reactors"),r.releaseDisposers(),r.reactors.forEach((function(e,t){j.isFunction(e)&&r.disposers.set(t,e())})),r.ctx.emitter.emit("onReconnected")}}return b(e,[{key:"setRoom",value:function(e){var t=this;this.room=e,this.phase=null==e?void 0:e.phase,e&&(e.callbacks.off("onPhaseChanged",this.onPhaseChanged),e.callbacks.on("onPhaseChanged",this.onPhaseChanged),e.addMagixEventListener(Z,(function(r){r.authorId===e.observerId&&t.onReconnected()}),{fireSelfEventAfterCommit:!0}))}},{key:"setContext",value:function(e){this.ctx=e}},{key:"releaseDisposers",value:function(){this.disposers.forEach((function(e){j.isFunction(e)&&e()})),this.disposers.clear()}},{key:"refresh",value:function(){this._onReconnected()}},{key:"add",value:function(e,t){var r=this.disposers.get(e);r&&j.isFunction(r)&&r(),j.isFunction(t)&&(this.reactors.set(e,t),this.disposers.set(e,t()))}},{key:"remove",value:function(e){this.reactors.has(e)&&this.reactors.delete(e);var t=this.disposers.get(e);t&&(j.isFunction(t)&&t(),this.disposers.delete(e))}},{key:"hasReactor",value:function(e){return this.reactors.has(e)}},{key:"destroy",value:function(){var e,t;null==(e=this.room)||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),null==(t=this.room)||t.removeMagixEventListener(Z,this.onReconnected),this.releaseDisposers()}}]),e}(),Ro=function(e,t){if(z.isPlayer(e))Lo(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get:function(){return t.mainView.disableCameraTransform},set:function(e){t.mainView.disableCameraTransform=e}}),Object.defineProperty(e,"canUndoSteps",{get:function(){return t.canUndoSteps}}),Object.defineProperty(e,"canRedoSteps",{get:function(){return t.canRedoSteps}}),e.moveCamera=function(e){return t.moveCamera(e)},e.moveCameraToContain=function(){return t.moveCameraToContain.apply(t,arguments)},e.convertToPointInWorld=function(){var e;return(e=t.mainView).convertToPointInWorld.apply(e,arguments)},e.setCameraBound=function(){var e;return(e=t.mainView).setCameraBound.apply(e,arguments)},e.scenePreview=function(){var e;return(e=t.mainView).scenePreview.apply(e,arguments)},e.fillSceneSnapshot=function(){var e;return(e=t.mainView).fillSceneSnapshot.apply(e,arguments)},e.generateScreenshot=function(){var e;return(e=t.mainView).generateScreenshot.apply(e,arguments)},e.setMemberState=function(){var e;return(e=t.mainView).setMemberState.apply(e,arguments)},e.redo=function(){return t.redo()},e.undo=function(){return t.undo()},e.cleanCurrentScene=function(){return t.cleanCurrentScene()},e.delete=function(){return t.delete()},e.copy=function(){return t.copy()},e.paste=function(){return t.paste()},e.duplicate=function(){return t.duplicate()},e.insertImage=function(){return t.insertImage.apply(t,arguments)},e.completeImageUpload=function(){return t.completeImageUpload.apply(t,arguments)},e.insertText=function(){return t.insertText.apply(t,arguments)},e.lockImage=function(){return t.lockImage.apply(t,arguments)},e.lockImages=function(){return t.lockImages.apply(t,arguments)},Do(e,t)}},Do=function(e,t){var r=e.removeScenes;e.removeScenes=function(n,i){var o;n===ne&&(null==(o=t.appManager)||o.updateRootDirRemoving(!0));var a=r.call(e,n);return se.emit("removeScenes",{scenePath:n,index:i}),a}},Lo=function(e){var t=e.seekToProgressTime;function r(){return(r=m(regeneratorRuntime.mark((function r(n){var i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,se.emit("seekStart");case 2:return r.next=4,t.call(e,n);case 4:return i=r.sent,r.abrupt("return",(se.emit("seek",n),i));case 6:case"end":return r.stop()}}),r)})))).apply(this,arguments)}e.seekToProgressTime=function(e){return r.apply(this,arguments)}},jo=Object.defineProperty,zo=Object.defineProperties,Bo=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,Wo=Object.prototype.propertyIsEnumerable,Go=function(e,t,r){return t in e?jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Vo=function(e,t){for(var r in t||(t={}))Uo.call(t,r)&&Go(e,r,t[r]);if(Fo){var n,i=S(Fo(t));try{for(i.s();!(n=i.n()).done;){r=n.value;Wo.call(t,r)&&Go(e,r,t[r])}}catch(e){i.e(e)}finally{i.f()}}return e},Ho=function(e,t){return zo(e,Bo(t))},Yo=function(e,t,r,n){if("length"!==r&&"prototype"!==r&&"arguments"!==r&&"caller"!==r){var i=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);!$o(i,o)&&n||Object.defineProperty(e,r,o)}},$o=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Xo=function(e,t){var r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},qo=function(e,t){return"/* Wrapped ".concat(e,"*/\n").concat(t)},Qo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Zo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ko=function(e,t,r){var n=""===r?"":"with ".concat(r.trim(),"() "),i=qo.bind(null,n,t.toString());Object.defineProperty(i,"name",Zo),Object.defineProperty(e,"toString",Ho(Vo({},Qo),{value:i}))};function Jo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.ignoreNonConfigurable,o=void 0!==i&&i,a=e.name,s=S(Reflect.ownKeys(t));try{for(s.s();!(r=s.n()).done;){var u=r.value;Yo(e,t,u,o)}}catch(e){s.e(e)}finally{s.f()}return Xo(e,t),Ko(e,t,a),e}var ea=[],ta=function(){for(var e=0;e<20;e++)ea[e]="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(87*Math.random());return ea.join("")};function ra(e){try{return e()}catch(e){console.error(e)}}var na=function(){function e(){y(this,e),this.push=this.addDisposer,this.disposers=new Map}return b(e,[{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?ia(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(ra),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=ta()}while(this.disposers.has(e));return e}}]),e}();function ia(e){return function(){return e.forEach(ra)}}var oa,aa=[],sa="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(oa||(oa={}));var ua,la=function(e){return Object.freeze(e)},ca=function(e,t){this.inlineSize=e,this.blockSize=t,la(this)},ha=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,la(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),da=function(e){return e instanceof SVGElement&&"getBBox"in e},fa=function(e){if(da(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},pa=function(e){var t;if(e instanceof Element)return!0;var r=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},va="undefined"!=typeof window?window:{},ga=new WeakMap,ma=/auto|scroll/,ya=/^tb|vertical/,_a=/msie|trident/i.test(va.navigator&&va.navigator.userAgent),ba=function(e){return parseFloat(e||"0")},xa=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new ca((r?t:e)||0,(r?e:t)||0)},wa=la({devicePixelContentBoxSize:xa(),borderBoxSize:xa(),contentBoxSize:xa(),contentRect:new ha(0,0,0,0)}),Sa=function(e,t){if(void 0===t&&(t=!1),ga.has(e)&&!t)return ga.get(e);if(fa(e))return ga.set(e,wa),wa;var r=getComputedStyle(e),n=da(e)&&e.ownerSVGElement&&e.getBBox(),i=!_a&&"border-box"===r.boxSizing,o=ya.test(r.writingMode||""),a=!n&&ma.test(r.overflowY||""),s=!n&&ma.test(r.overflowX||""),u=n?0:ba(r.paddingTop),l=n?0:ba(r.paddingRight),c=n?0:ba(r.paddingBottom),h=n?0:ba(r.paddingLeft),d=n?0:ba(r.borderTopWidth),f=n?0:ba(r.borderRightWidth),p=n?0:ba(r.borderBottomWidth),v=h+l,g=u+c,m=(n?0:ba(r.borderLeftWidth))+f,y=d+p,_=s?e.offsetHeight-y-e.clientHeight:0,b=a?e.offsetWidth-m-e.clientWidth:0,x=i?v+m:0,w=i?g+y:0,S=n?n.width:ba(r.width)-x-b,T=n?n.height:ba(r.height)-w-_,M=S+v+b+m,k=T+g+_+y,E=la({devicePixelContentBoxSize:xa(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:xa(M,k,o),contentBoxSize:xa(S,T,o),contentRect:new ha(h,u,S,T)});return ga.set(e,E),E},Ta=function(e,t,r){var n=Sa(e,r),i=n.borderBoxSize,o=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(t){case oa.DEVICE_PIXEL_CONTENT_BOX:return a;case oa.BORDER_BOX:return i;default:return o}},Ma=function(e){var t=Sa(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=la([t.borderBoxSize]),this.contentBoxSize=la([t.contentBoxSize]),this.devicePixelContentBoxSize=la([t.devicePixelContentBoxSize])},ka=function(e){if(fa(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},Ea=function(){var e=1/0,t=[];aa.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new Ma(t.target),i=ka(t.target);n.push(r),t.lastReportedSize=Ta(t.target,t.observedBox),ie?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},Ia=function(){var e=0;for(Aa(e);aa.some((function(e){return e.activeTargets.length>0}));)e=Ea(),Aa(e);return aa.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:sa}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=sa),window.dispatchEvent(e)}(),e>0},Ca=[],Pa=function(e){if(!ua){var t=0,r=document.createTextNode("");new MutationObserver((function(){return Ca.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),ua=function(){r.textContent="".concat(t?t--:t++)}}Ca.push(e),ua()},Na=0,Oa={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ra=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Da=function(e){return void 0===e&&(e=0),Date.now()+e},La=!1,ja=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!La){La=!0;var r=Da(e);!function(e){Pa((function(){requestAnimationFrame(e)}))}((function(){var n=!1;try{n=Ia()}finally{if(La=!1,e=r-Da(),!Na)return;n?t.run(1e3):e>0?t.run(e):t.start()}}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Oa)};document.body?t():va.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ra.forEach((function(t){return va.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Ra.forEach((function(t){return va.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}(),za=new ja,Ba=function(e){!Na&&e>0&&za.start(),!(Na+=e)&&za.stop()},Fa=function(){function e(e,t){this.target=e,this.observedBox=t||oa.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Ta(this.target,this.observedBox,!0);return function(e){return!da(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ua=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Wa=new WeakMap,Ga=function(e,t){for(var r=0;r=0&&(i&&aa.splice(aa.indexOf(r),1),r.observationTargets.splice(n,1),Ba(-1))},e.disconnect=function(e){var t=this,r=Wa.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Ha=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Va.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!pa(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Va.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!pa(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Va.unobserve(this,e)},e.prototype.disconnect=function(){Va.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var Ya="undefined"!=typeof window,$a=Ya&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Xa=Ya&&"IntersectionObserver"in window,qa=Ya&&"classList"in document.createElement("p"),Qa=Ya&&window.devicePixelRatio>1,Za={elements_selector:".lazy",container:$a||Ya?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Ka=function(e){return Object.assign({},Za,e)},Ja=function(e,t){var r,n="LazyLoad::Initialized",i=new e(t);try{r=new CustomEvent(n,{detail:{instance:i}})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(n,!1,!1,{instance:i})}window.dispatchEvent(r)},es="src",ts="srcset",rs="sizes",ns="poster",is="llOriginalAttrs",os="data",as="loading",ss="loaded",us="applied",ls="error",cs="native",hs="data-",ds="ll-status",fs=function(e,t){return e.getAttribute(hs+t)},ps=function(e){return fs(e,ds)},vs=function(e,t){return function(e,t,r){var n=hs+t;null!==r?e.setAttribute(n,r):e.removeAttribute(n)}(e,ds,t)},gs=function(e){return vs(e,null)},ms=function(e){return null===ps(e)},ys=function(e){return ps(e)===cs},_s=[as,ss,us,ls],bs=function(e,t,r,n){if(e){if(void 0!==n)return void e(t,r,n);if(void 0!==r)return void e(t,r);e(t)}},xs=function(e,t){qa?e.classList.add(t):e.className+=(e.className?" ":"")+t},ws=function(e,t){qa?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Ss=function(e){return e.llTempImage},Ts=function(e,t){if(t){var r=t._observer;!r||r.unobserve(e)}},Ms=function(e,t){!e||(e.loadingCount+=t)},ks=function(e,t){!e||(e.toLoadCount=t)},Es=function(e){for(var t,r=[],n=0;t=e.children[n];n+=1)"SOURCE"===t.tagName&&r.push(t);return r},As=function(e,t){var r=e.parentNode;r&&"PICTURE"===r.tagName&&Es(r).forEach(t)},Is=function(e,t){Es(e).forEach(t)},Cs=[es],Ps=[es,ns],Ns=[es,ts,rs],Os=[os],Rs=function(e){return!!e[is]},Ds=function(e){return e[is]},Ls=function(e){return delete e[is]},js=function(e,t){if(!Rs(e)){var r={};t.forEach((function(t){r[t]=e.getAttribute(t)})),e[is]=r}},zs=function(e,t){if(Rs(e)){var r=Ds(e);t.forEach((function(t){!function(e,t,r){r?e.setAttribute(t,r):e.removeAttribute(t)}(e,t,r[t])}))}},Bs=function(e,t,r){xs(e,t.class_applied),vs(e,us),r&&(t.unobserve_completed&&Ts(e,t),bs(t.callback_applied,e,r))},Fs=function(e,t,r){xs(e,t.class_loading),vs(e,as),r&&(Ms(r,1),bs(t.callback_loading,e,r))},Us=function(e,t,r){!r||e.setAttribute(t,r)},Ws=function(e,t){Us(e,rs,fs(e,t.data_sizes)),Us(e,ts,fs(e,t.data_srcset)),Us(e,es,fs(e,t.data_src))},Gs={IMG:function(e,t){As(e,(function(e){js(e,Ns),Ws(e,t)})),js(e,Ns),Ws(e,t)},IFRAME:function(e,t){js(e,Cs),Us(e,es,fs(e,t.data_src))},VIDEO:function(e,t){Is(e,(function(e){js(e,Cs),Us(e,es,fs(e,t.data_src))})),js(e,Ps),Us(e,ns,fs(e,t.data_poster)),Us(e,es,fs(e,t.data_src)),e.load()},OBJECT:function(e,t){js(e,Os),Us(e,os,fs(e,t.data_src))}},Vs=["IMG","IFRAME","VIDEO","OBJECT"],Hs=function(e,t){t&&!function(e){return e.loadingCount>0}(t)&&!function(e){return e.toLoadCount>0}(t)&&bs(e.callback_finish,t)},Ys=function(e,t,r){e.addEventListener(t,r),e.llEvLisnrs[t]=r},$s=function(e,t,r){e.removeEventListener(t,r)},Xs=function(e){return!!e.llEvLisnrs},qs=function(e){if(Xs(e)){var t=e.llEvLisnrs;for(var r in t){var n=t[r];$s(e,r,n)}delete e.llEvLisnrs}},Qs=function(e,t,r){(function(e){delete e.llTempImage})(e),Ms(r,-1),function(e){!e||(e.toLoadCount-=1)}(r),ws(e,t.class_loading),t.unobserve_completed&&Ts(e,r)},Zs=function(e,t,r){var n=Ss(e)||e;Xs(n)||function(e,t,r){Xs(e)||(e.llEvLisnrs={});var n="VIDEO"===e.tagName?"loadeddata":"load";Ys(e,n,t),Ys(e,"error",r)}(n,(function(i){(function(e,t,r,n){var i=ys(t);Qs(t,r,n),xs(t,r.class_loaded),vs(t,ss),bs(r.callback_loaded,t,n),i||Hs(r,n)})(0,e,t,r),qs(n)}),(function(i){(function(e,t,r,n){var i=ys(t);Qs(t,r,n),xs(t,r.class_error),vs(t,ls),bs(r.callback_error,t,n),r.restore_on_error&&zs(t,Ns),i||Hs(r,n)})(0,e,t,r),qs(n)}))},Ks=function(e,t,r){(function(e){e.llTempImage=document.createElement("IMG")})(e),Zs(e,t,r),function(e){Rs(e)||(e[is]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,r){var n=fs(e,t.data_bg),i=fs(e,t.data_bg_hidpi),o=Qa&&i?i:n;!o||(e.style.backgroundImage='url("'.concat(o,'")'),Ss(e).setAttribute(es,o),Fs(e,t,r))}(e,t,r),function(e,t,r){var n=fs(e,t.data_bg_multi),i=fs(e,t.data_bg_multi_hidpi),o=Qa&&i?i:n;!o||(e.style.backgroundImage=o,Bs(e,t,r))}(e,t,r),function(e,t,r){var n=fs(e,t.data_bg_set);if(n){var i=n.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),Bs(e,t,r)}}(e,t,r)},Js=function(e,t,r){Zs(e,t,r),function(e,t,r){var n=Gs[e.tagName];!n||(n(e,t),Fs(e,t,r))}(e,t,r)},eu=function(e,t,r){!function(e){return Vs.indexOf(e.tagName)>-1}(e)?Ks(e,t,r):Js(e,t,r)},tu=function(e,t,r){e.setAttribute("loading","lazy"),Zs(e,t,r),function(e,t){var r=Gs[e.tagName];!r||r(e,t)}(e,t),vs(e,cs)},ru=function(e){e.removeAttribute(es),e.removeAttribute(ts),e.removeAttribute(rs)},nu=function(e){As(e,(function(e){zs(e,Ns)})),zs(e,Ns)},iu={IMG:nu,IFRAME:function(e){zs(e,Cs)},VIDEO:function(e){Is(e,(function(e){zs(e,Cs)})),zs(e,Ps),e.load()},OBJECT:function(e){zs(e,Os)}},ou=function(e){var t=iu[e.tagName];t?t(e):function(e){if(Rs(e)){var t=Ds(e);e.style.backgroundImage=t.backgroundImage}}(e)},au=function(e,t){ou(e),function(e,t){ms(e)||ys(e)||(ws(e,t.class_entered),ws(e,t.class_exited),ws(e,t.class_applied),ws(e,t.class_loading),ws(e,t.class_loaded),ws(e,t.class_error))}(e,t),gs(e),Ls(e)},su=function(e,t,r,n){!r.cancel_on_exit||!function(e){return ps(e)===as}(e)||"IMG"===e.tagName&&(qs(e),function(e){As(e,(function(e){ru(e)})),ru(e)}(e),nu(e),ws(e,r.class_loading),Ms(n,-1),gs(e),bs(r.callback_cancel,e,t,n))},uu=function(e,t,r,n){var i=function(e){return _s.indexOf(ps(e))>=0}(e);vs(e,"entered"),xs(e,r.class_entered),ws(e,r.class_exited),function(e,t,r){t.unobserve_entered&&Ts(e,r)}(e,r,n),bs(r.callback_enter,e,t,n),!i&&eu(e,r,n)},lu=["IMG","IFRAME","VIDEO"],cu=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},hu=function(e,t,r){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?uu(e.target,e,t,r):function(e,t,r,n){ms(e)||(xs(e,r.class_exited),su(e,t,r,n),bs(r.callback_exit,e,t,n))}(e.target,e,t,r)}))},du=function(e,t){!Xa||cu(e)||(t._observer=new IntersectionObserver((function(r){hu(r,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},fu=function(e){return Array.prototype.slice.call(e)},pu=function(e){return e.container.querySelectorAll(e.elements_selector)},vu=function(e){return function(e){return ps(e)===ls}(e)},gu=function(e,t){return function(e){return fu(e).filter(ms)}(e||pu(t))},mu=function(e,t){(function(e){return fu(e).filter(vu)})(pu(e)).forEach((function(t){ws(t,e.class_error),gs(t)})),t.update()},yu=function(e,t){var r=Ka(e);this._settings=r,this.loadingCount=0,du(r,this),function(e,t){!Ya||(t._onlineHandler=function(){mu(e,t)},window.addEventListener("online",t._onlineHandler))}(r,this),this.update(t)};yu.prototype={update:function(e){var t=this._settings,r=gu(e,t);ks(this,r.length),!$a&&Xa?cu(t)?function(e,t,r){e.forEach((function(e){-1!==lu.indexOf(e.tagName)&&tu(e,t,r)})),ks(r,0)}(r,t,this):function(e,t){(function(e){e.disconnect()})(e),function(e,t){t.forEach((function(t){e.observe(t)}))}(e,t)}(this._observer,r):this.loadAll(r)},destroy:function(){this._observer&&this._observer.disconnect(),function(e){!Ya||window.removeEventListener("online",e._onlineHandler)}(this),pu(this._settings).forEach((function(e){Ls(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,r=this._settings;gu(e,r).forEach((function(e){Ts(e,t),eu(e,r,t)}))},restoreAll:function(){var e=this._settings;pu(e).forEach((function(t){au(t,e)}))}},yu.load=function(e,t){var r=Ka(t);eu(e,r)},yu.resetStatus=function(e){gs(e)},Ya&&function(e,t){if(t)if(t.length)for(var r,n=0;r=t[n];n+=1)Ja(e,r);else Ja(e,t)}(yu,window.lazyLoadOptions);var _u=function(){function e(t){var r=t.readonly,n=t.box,i=t.pages,o=t.onNewPageIndex,a=t.onPlay;if(y(this,e),this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new na,i.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=r,this.box=n,this.pages=i,this.onNewPageIndex=o,this.onPlay=a,this.onPageIndexChanged=function(){},this.render()}return b(e,[{key:"mount",value:function(){var e=this;this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add((function(){var t=new yu({container:e.$preview,elements_selector:".".concat(e.wrapClassName("preview-page>img"))});return function(){return t.destroy()}}),"preview-lazyload")}},{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1),this.onPageIndexChanged(e))}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t;var r=this.wrapClassName("preview-page"),n=this.wrapClassName("preview-page-name");this.pages.forEach((function(i,o){var a,s=null!=(a=i.thumbnail)?a:i.src.startsWith("ppt")?void 0:i.src;if(s){var u=String(o),l=document.createElement("a");l.className=r+" "+e.wrapClassName("preview-page-".concat(o)),l.setAttribute("href","#"),l.dataset.pageIndex=u;var c=document.createElement("span");c.className=n,c.textContent=String(o+1),c.dataset.pageIndex=u;var h=document.createElement("img");h.width=i.width,h.height=i.height,h.dataset.src=s,h.dataset.pageIndex=u,l.appendChild(h),l.appendChild(c),t.appendChild(l)}})),this.sideEffect.addEventListener(t,"click",(function(t){var r;if(!e.readonly){var n=null==(r=t.target.dataset)?void 0:r.pageIndex;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(n)),e.togglePreview(!1))}}))}return this.$preview}},{key:"renderPreviewMask",value:function(){var e=this;return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",(function(t){e.readonly||t.target===e.$previewMask&&e.togglePreview(!1)}))),this.$previewMask}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");if(t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer")),this.pages.some((function(e){return e.thumbnail||!e.src.startsWith("ppt")}))){var r=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-sidebar")),r.setAttribute("viewBox","0 0 64 64");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(r,"click",(function(){e.readonly||e.togglePreview()})),this.$footer.appendChild(r)}var n=document.createElement("div");n.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),r.appendChild(n),r}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1)})),n.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-play")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),r.appendChild(n),r}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-pause")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(o.classList.toggle(e.wrapClassName("footer-btn-playing"),!0),e.onPlay&&e.onPlay(),e.sideEffect.setTimeout((function(){o.classList.toggle(e.wrapClassName("footer-btn-playing"),!1)}),500,"returnPlay"))})),n.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1)})),n.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1)}));var l=document.createElement("span");l.textContent=" / "+this.pages.length,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(n),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,r){var n=document.createElement("button");return n.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),n.appendChild(t),r&&n.appendChild(r),n}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&this.$preview.scrollTo({top:t.offsetTop-16})}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();function bu(e,t,r){return Math.min(Math.max(e,t),r)}function xu(e){return e.touches?e.touches[0]:e}function wu(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function Su(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}var Tu=function(){function e(t){var r,n,i,o=this;y(this,e),this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=function(e){if(!o.paused){var t=Math.floor((e-o._loopTimestamp)/1e3*60)+1;for(o._loopTimestamp=e;t-- >0;)o.stepper();o.onStep(o.current,o),!o.paused&&o.current!==o.target&&window.requestAnimationFrame(o.looper)}},this.current=null!=(r=t.start)?r:0,this.target=this.current,this.stiffness=null!=(n=t.stiffness)?n:170,this.damping=null!=(i=t.damping)?i:26,this.onStep=t.onStep}return b(e,[{key:"stepTo",value:function(e,t){this.paused&&null!=t&&(this.current=t),this.paused=!1,this.target=e,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}},{key:"pause",value:function(){this.paused=!0}},{key:"destroy",value:function(){this.pause()}},{key:"stepper",value:function(){var e=-this.stiffness*(this.current-this.target),t=-this.damping*this.velocity,r=this.velocity+(e+t)/60,n=this.current+r/60;Math.abs(r-0)<.01&&Math.abs(n-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=n,this.velocity=r)}}]),e}(),Mu=function(){function e(t,r,n,i){y(this,e),this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=t,this.page=r,this.scale=n,this.pageOffsetX=(i-r.width)/2;var o=document.createElement("div");o.className="page-renderer-page",o.dataset.index="".concat(t),o.style.width="".concat(r.width*n,"px"),o.style.height="".concat(r.height*n,"px"),r.thumbnail&&(o.style.backgroundImage='url("'.concat(r.thumbnail,'")'));var a=document.createElement("img");a.className="page-renderer-page-img",a.width=r.width,a.height=r.height,a.src=r.src,o.appendChild(a),this.$page=o}return b(e,[{key:"translateY",value:function(e){Math.abs(e-this.pageOffsetY)>=.001&&(this.pageOffsetY=e,this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setScale",value:function(e){Math.abs(e-this.scale)>=.001&&(this.scale=e,this.$page.style.width="".concat(this.page.width*this.scale,"px"),this.$page.style.height="".concat(this.page.height*this.scale,"px"),this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setVisible",value:function(e){e!==this.visible&&(this.visible=e,this.$page.style.opacity=e?"1":"0")}}]),e}(),ku=window.requestIdleCallback||function(e){return window.setTimeout(e,5e3)},Eu=window.cancelIdleCallback||window.clearTimeout,Au=function(){function e(t,r,n){var i=this;y(this,e),this.pages=t,this.pagesIntrinsicWidth=r,this.scale=n,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=function(){if(i.gcTimer=null,i.els.size>i.maxElCount)for(var e=a(i.els.values()).sort((function(e,t){return t.lastVisit-e.lastVisit})),t=Math.floor(i.maxElCount/4);tthis.maxElCount&&null===this.gcTimer&&(this.gcTimer=ku(this.gc)),t}},{key:"setScale",value:function(e){e!==this.scale&&(this.scale=e,this.els.forEach((function(t){return t.setScale(e)})))}},{key:"destroy",value:function(){this.els.clear(),null!==this.gcTimer&&(Eu(this.gcTimer),this.gcTimer=null)}}]),e}(),Iu=function(){function e(t){var r=this;y(this,e),this._hwaTimeout=NaN,this._turnOffHWA=function(){window.clearTimeout(r._hwaTimeout),r._hwaTimeout=NaN,r.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pages=t.pages.map((function(e){if(e.thumbnail)return e;try{var t=new URL(e.src);return t.searchParams.set("x-oss-process","image/resize,l_50"),Ho(Vo({},e),{thumbnail:t.toString()})}catch(t){return console.error(t),e}}));var n=Array(this.pages.length),i=1/0,o=0;this.pagesIntrinsicHeight=this.pages.reduce((function(e,t,r){return n[r]=e,t.width>o&&(o=t.width),t.height<=i&&(i=t.height),e+t.height}),0),this.pagesIntrinsicWidth=o,this.pagesMinHeight=i,this.pagesIntrinsicYs=n,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=t.onPageIndexChanged,this.pageScrollIndex=0,0!==this.pagesScrollTop&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new Au(this.pages,o,this.scale),this.$pages=this.renderPages()}return b(e,[{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.$pages.style.width="".concat(this.containerWidth,"px"),this.$pages.style.height="".concat(this.containerHeight,"px"),this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.pageElManager.setScale(this.scale),this.$pages.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"renderPages",value:function(){var e=document.createElement("div");return e.className="page-renderer-pages-container",e.style.width="".concat(this.containerWidth,"px"),e.style.height="".concat(this.containerHeight,"px"),e}},{key:"pagesScrollTo",value:function(e,t){if(e=bu(e,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=e;for(var r=this.findScrollPageIndex(),n=Math.max(r-this.threshold,0),i=Math.min(r+this.threshold,this.pages.length-1),o=0;o=n&&s<=i||(a.remove(),o--)}for(var u=n;u<=i;u++){var l=this.pageElManager.getEl(u);l.$page.parentElement!==this.$pages&&this.$pages.appendChild(l.$page),l.translateY(this.pagesIntrinsicYs[u]-this.pagesScrollTop)}r!==this.pageScrollIndex&&(this.pageScrollIndex=r,this.onPageIndexChanged&&this.onPageIndexChanged(r))}}},{key:"findScrollPageIndex",value:function(){for(var e=0;e=.001)return e;return this.pagesIntrinsicYs.length-1}},{key:"mount",value:function(e){e.appendChild(this.$pages),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$pages.remove()}},{key:"destroy",value:function(){this.unmount(),this.onPageIndexChanged=void 0,this.pageElManager.destroy(),this._hwaTimeout&&(window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN)}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesIntrinsicWidth||1}},{key:"_calcThreshold",value:function(){return bu(Math.ceil(this.containerHeight/this.scale/this.pagesMinHeight/2),1,this.pages.length)}},{key:"_turnOnHWA",value:function(){this._hwaTimeout?window.clearTimeout(this._hwaTimeout):this.$pages.classList.toggle("is-hwa",!0),this._hwaTimeout=window.setTimeout(this._turnOffHWA,1e3)}}]),e}(),Cu=function(){function e(t){y(this,e),this.sideEffect=new na,this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pagesWidth=t.pagesWidth||1,this.pagesHeight=t.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=t.scrollbarMinHeight||30,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=t.readonly,this.wrapClassName=t.wrapClassName,this.onDragScroll=t.onDragScroll,this.$scrollbar=this.renderScrollbar()}return b(e,[{key:"mount",value:function(e){e.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$scrollbar.remove()}},{key:"setReadonly",value:function(e){this.readonly=e}},{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"pagesScrollTo",value:function(e,t){var r=this;if(e=bu(e,0,this.pagesHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this.pagesScrollTop=e;var n=this.pagesScrollTop*this.scale/(this.pagesHeight*this.scale-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame((function(){r.$scrollbar.style.transform="translateY(".concat(n,"px)")})):this.$scrollbar.style.transform="translateY(".concat(n,"px)")}}},{key:"destroy",value:function(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}},{key:"renderScrollbar",value:function(){var e=this,t=document.createElement("button");t.className=this.wrapClassName("scrollbar"),t.style.minHeight="".concat(this.scrollbarMinHeight,"px"),t.style.height="".concat(this.scrollbarHeight,"px");var r=function(r){if(!(e.readonly||null!=r.button&&0!==r.button)){wu(r);var n=e.wrapClassName("scrollbar-dragging");t.classList.toggle(n,!0);var i=e.pagesScrollTop,o=xu(r).clientY,a=function(t){if(!e.readonly){var r=(xu(t).clientY-o)/e.scale;Math.abs(r)>0&&e.onDragScroll&&e.onDragScroll(i+r*(e.pagesHeight*e.scale/e.containerHeight))}},s=function e(){t.classList.toggle(n,!1),window.removeEventListener("mousemove",a,!0),window.removeEventListener("touchmove",a,!0),window.removeEventListener("mouseup",e,!0),window.removeEventListener("touchend",e,!0),window.removeEventListener("touchcancel",e,!0)};window.addEventListener("mousemove",a,!0),window.addEventListener("touchmove",a,!0),window.addEventListener("mouseup",s,!0),window.addEventListener("touchend",s,!0),window.addEventListener("touchcancel",s,!0)}};return this.sideEffect.addEventListener(t,"mousedown",r),this.sideEffect.addEventListener(t,"touchstart",r),t}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesWidth||1}},{key:"_calcScrollbarHeight",value:function(){return bu(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}},{key:"_updateScrollbarHeight",value:function(){var e=this._calcScrollbarHeight();Math.abs(e-this.scrollbarHeight)>.001&&(this.scrollbarHeight=e,this.$scrollbar.style.height="".concat(e,"px"))}}]),e}(),Pu=window.ResizeObserver||Ha,Nu=640,Ou=function(){function e(t){var n=this,i=t.whiteboardView,a=t.readonly,s=t.box,u=t.pages,l=t.pageScrollTop,c=void 0===l?0:l,h=t.mountWhiteboard,d=t.onUserScroll,f=t.baseScenePath,p=t.appId;y(this,e),this.sideEffect=new na,this.userScrolling=!1,this.onNewPageIndex=function(e){n.scrollToPage(e)},this.toPdf=m(regeneratorRuntime.mark((function e(){var t,i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.createElement("canvas"),(i=t.getContext("2d"))&&n.baseScenePath){e.next=4;break}return n.reportProgress(100,null),e.abrupt("return");case 4:return a=n.whiteboardView.focusScenePath||"".concat(n.baseScenePath,"/1"),s=n.pages[0],e.next=8,Promise.resolve().then((function(){return G(r(88877))}));case 8:u=e.sent,l=u.jsPDF,c=new l({format:[s.width,s.height],orientation:s.width>s.height?"l":"p",compress:!0}),h=S(n.pages.entries()),e.prev=12,f=regeneratorRuntime.mark((function e(){var r,s,u,l,h,f,p,v,g,m,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o(d.value,2),s=r[0],u=r[1],l=u.width,h=u.height,f=u.src,t.width=l,t.height=h,p=l>h?"l":"p",s>0&&c.addPage([l,h],p),e.next=7,n.getBase64FromUrl(f);case 7:return v=e.sent,(g=document.createElement("img")).src=v,e.next=12,new Promise((function(e){return g.onload=e}));case 12:i.drawImage(g,0,0),m=t.toDataURL("image/jpeg",.6),i.clearRect(0,0,l,h),n.whiteboardView.screenshotToCanvas(i,a,l,h,{centerX:l/2,centerY:h/2+s*h,scale:1}),y=t.toDataURL("image/png"),c.addImage(m,"JPEG",0,0,l,h,"","FAST"),c.addImage(y,"PNG",0,0,l,h,"","FAST"),i.clearRect(0,0,l,h),Math.ceil((s+1)/n.pages.length*100)<100&&n.reportProgress(Math.ceil((s+1)/n.pages.length*100),null);case 17:case"end":return e.stop()}}),e)})),h.s();case 15:if((d=h.n()).done){e.next=19;break}return e.delegateYield(f(),"t0",17);case 17:e.next=15;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(12),h.e(e.t1);case 24:return e.prev=24,h.f(),e.finish(24);case 27:p=c.output("arraybuffer"),n.reportProgress(100,{pdf:p,title:n.box.title});case 29:case"end":return e.stop()}}),e,null,[[12,21,24,27]])}))),this.whiteboardView=i,this.readonly=a,this.box=s,this.pages=u,this.baseScenePath=f,this.appId=p,this.mountWhiteboard=h,this._onUserScroll=d;var v=this.debounce((function(){n.userScrolling=!1,n._onUserScroll&&n._onUserScroll(n.pageRenderer.pagesScrollTop)}),{wait:80},"debounce-updateUserScroll");this.updateUserScroll=function(){n.userScrolling=!0,v()},this.viewer=new _u({readonly:a,box:s,pages:u,onNewPageIndex:this.onNewPageIndex});var g=this.whiteboardView.size,_=g.width,b=g.height;this.pageRenderer=new Iu({pagesScrollTop:c,pages:this.pages,containerWidth:_,containerHeight:b,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new Cu({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:_,containerHeight:b,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:function(e){n.pageScrollTo(e),n.updateUserScroll()}}),this.pageScrollStepper=new Tu({start:this.pageRenderer.pagesScrollTop,onStep:function(e){n.pageScrollTo(e)}}),this.render()}var t;return b(e,[{key:"mount",value:function(){var e=this;this.viewer.mount(),this.setupScrollListener();var t=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add((function(){var r=new Pu(t);return r.observe(e.viewer.$content),function(){return r.disconnect()}})),this.sideEffect.setTimeout((function(){e.userScrolling||e.pageScrollTo(e.pageRenderer.pagesScrollTop)}),100),this.sideEffect.add((function(){var t=function(t){"@netless/_request_save_pdf_"===t.data.type&&t.data.appId===e.appId&&e.toPdf().catch((function(){return e.reportProgress(100,null)}))};return window.addEventListener("message",t),function(){window.removeEventListener("message",t)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.viewer.setReadonly(e),this.scrollbar.setReadonly(e))}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}},{key:"syncPageScrollTop",value:function(e){!this.userScrolling&&e>=0&&Math.abs(this.pageRenderer.pagesScrollTop-e)>.01&&this.pageScrollStepper.stepTo(e,this.pageRenderer.pagesScrollTop)}},{key:"render",value:function(){this.pageRenderer.mount(this.viewer.$content),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.scrollbar.mount(this.viewer.$content),this.renderRatioHeight()}},{key:"renderRatioHeight",value:function(){var e=this.box.absoluteHeight,t=e<=Nu;if(this.viewer.setSmallBox(t),t){var r=26/e,n=Math.max((.08125-(r+0))/2,0);if(this.box.$titleBar){var i=r+n;this.box.$titleBar.style.height="".concat(100*i,"%")}if(this.box.$footer){var o=0+n;this.box.$footer.style.height="".concat(100*o,"%")}}else{if(this.box.$titleBar){var a=Math.max(26/Nu,26/e);this.box.$titleBar.style.height="".concat(100*a,"%")}if(this.box.$footer){var s=Math.max(26/Nu,26/e);this.box.$footer.style.height="".concat(100*s,"%")}}}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView),this.sideEffect.addEventListener(this.$whiteboardView,"wheel",(function(t){wu(t),e.readonly||(e.pageScrollTo(e.pageRenderer.pagesScrollTop+t.deltaY),e.updateUserScroll())}),{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",(function(t){e.readonly||t.touches.length<=1||e.updateUserScroll()}),{passive:!0,capture:!0})),this.$whiteboardView}},{key:"scrollTopPageToEl",value:function(e){return e*this.pageRenderer.scale}},{key:"scrollTopElToPage",value:function(e){return e/this.pageRenderer.scale}},{key:"elScrollTo",value:function(e){this.pageScrollTo(this.scrollTopElToPage(e))}},{key:"pageScrollTo",value:function(e){var t=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:bu(e+t,t,this.pageRenderer.pagesIntrinsicHeight-t),animationMode:"immediately"})}},{key:"scrollToPage",value:function(e){if(!this.readonly&&!Number.isNaN(e)){var t=this.pageRenderer.pagesIntrinsicYs[e];t>=0&&(this.pageScrollTo(t+5/this.pageRenderer.scale),this.updateUserScroll())}}},{key:"setupScrollListener",value:function(){var e=this;this.sideEffect.add((function(){var t=function(t){var r=e.whiteboardView.size,n=r.width,i=r.height;if(!(n<=0||i<=0)){var o=t.centerY-e.pageRenderer.containerHeight/e.pageRenderer.scale/2;e.pageRenderer.pagesScrollTo(o),e.scrollbar.pagesScrollTo(o)}};return e.whiteboardView.callbacks.on("onCameraUpdated",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdated",t)}})),this.sideEffect.add((function(){var t=e.updateUserScroll;return e.whiteboardView.callbacks.on("onCameraUpdatedByDevice",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdatedByDevice",t)}})),this.sideEffect.add((function(){var t=function(t){var r=t.width,n=t.height;if(!(r<=0||n<=0)){e.pageRenderer.setContainerSize(r,n),e.scrollbar.setContainerSize(r,n);var i=e.pageRenderer,o=i.pagesIntrinsicWidth,a=i.pagesIntrinsicHeight;e.whiteboardView.moveCameraToContain({originX:0,originY:e.pageRenderer.pagesScrollTop,width:o,height:n/e.pageRenderer.scale,animationMode:"immediately"}),e.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return e.pageRenderer.scale},minContentMode:function(){return e.pageRenderer.scale},centerX:o/2,centerY:a/2,width:o,height:a})}};return e.whiteboardView.callbacks.on("onSizeUpdated",t),function(){e.whiteboardView.callbacks.off("onSizeUpdated",t)}}),"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",(function(t){if(!e.readonly&&e.box.focus&&!e.box.minimized&&!Su(t.target)){var r=null;switch(t.key){case"PageDown":r=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"PageUp":r=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"ArrowDown":r=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/4/e.pageRenderer.scale;break;case"ArrowUp":r=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/4/e.pageRenderer.scale}null!==r&&(e._onUserScroll?e._onUserScroll(r):(e.pageScrollTo(r),e.updateUserScroll()))}}),{capture:!0})}},{key:"debounce",value:function(e,t,r){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e)throw new TypeError("Expected the first argument to be a function, got `".concat(x(e),"`"));var r,n,i,o=t.wait,a=void 0===o?0:o,s=t.maxWait,u=void 0===s?Number.Infinity:s,l=t.before,c=void 0!==l&&l,h=t.after,d=void 0===h||h;if(!c&&!d)throw new Error("Both `before` and `after` are false, function wouldn't be called.");var f=function(){for(var t=arguments.length,o=new Array(t),s=0;s0&&u!==Number.Infinity&&!n&&(n=setTimeout(f,u)),p&&(i=e.apply(l,o)),i};return Jo(f,e),f.cancel=function(){r&&(clearTimeout(r),r=void 0),n&&(clearTimeout(n),n=void 0)},f}(e,t);return this.sideEffect.addDisposer((function(){return n.cancel()}),r),n}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-static-"+e}},{key:"getBase64FromUrl",value:(t=m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this._invalidate(t));case 2:return e.next=4,e.sent.blob();case 4:return r=e.sent,e.abrupt("return",new Promise((function(e){var t=new FileReader;t.readAsDataURL(r),t.onloadend=function(){var r=t.result;e(r)}})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_invalidate",value:function(e){try{var t=new URL(e);return t.searchParams.set("t",Date.now().toString()),t.toString()}catch(t){return e}}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),Ru=function(){function e(t){var r=this,n=t.context,i=t.whiteboardView,o=t.box,a=t.pages;y(this,e),this.sideEffect=new na,this.onPlayPPT=function(){var e=r.context.getRoom();e&&e.pptNextStep()},this._scaleDocsToFitImpl=function(){var e=r.pages[r.getPageIndex()];e&&(r.whiteboardView.moveCameraToContain({originX:-e.width/2,originY:-e.height/2,width:e.width,height:e.height,animationMode:"immediately"}),r.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return r.whiteboardView.camera.scale},minContentMode:function(){return r.whiteboardView.camera.scale},centerX:0,centerY:0,width:e.width,height:e.height}))},this._scaleDocsToFitDebounced=function(){r.sideEffect.setTimeout(r._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=function(){r._scaleDocsToFitImpl(),r._scaleDocsToFitDebounced()},this.onNewPageIndex=function(e){r.jumpToPage(e,!0)},this.context=n,this.whiteboardView=i,this.box=o,this.pages=a,this.displayer=n.getDisplayer(),this.viewer=new _u({readonly:!n.getIsWritable(),box:o,pages:a,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add((function(){var e=function(e){r.viewer.setReadonly(!e)};return r.context.emitter.on("writableChange",e),function(){return r.context.emitter.off("writableChange",e)}})),this.sideEffect.add((function(){var e=function(e){r.jumpToPage(e.index)};return r.context.emitter.on("sceneStateChange",e),function(){return r.context.emitter.off("sceneStateChange",e)}}))}return b(e,[{key:"mount",value:function(){var e=this;this.viewer.mount();var t=this.getPageIndex();return 0!==t&&this.jumpToPage(t),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"getPageIndex",value:function(){return this.displayer.state.sceneState.index}},{key:"jumpToPage",value:function(e,t){var r,n;if((e=bu(e,0,this.pages.length-1))!==this.getPageIndex()&&this.context.getIsWritable()){var i=this.context.getInitScenePath(),o=null==(n=null==(r=this.context.getScenes())?void 0:r[e])?void 0:n.name;i&&o&&this.context.setScenePath("".concat(i,"/").concat(o)),this.scaleDocsToFit()}if(e!==this.viewer.pageIndex&&this.viewer.setPageIndex(e),t){var a=this.context.getRoom();if(a){var s=a.state.globalState.__pptState;a.setGlobalState({__pptState:s&&{uuid:s.uuid,pageIndex:e,disableAutoPlay:s.disableAutoPlay}})}}}},{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",(function(t){var r;if(e.box.focus&&!Su(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.jumpToPage(e.getPageIndex()-1,!0);break;case"ArrowRight":case"ArrowDown":null==(r=e.context.getRoom())||r.pptNextStep()}}))}},{key:"renderMask",value:function(){if(!this.$mask){var e=document.createElement("div");e.className=this.wrapClassName("mask"),this.$mask=e,document.createElement("button").className=this.wrapClassName("back"),document.createElement("button").className=this.wrapClassName("next")}return this.$mask}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.sideEffect.addEventListener(this.$whiteboardView,"click",(function(t){var r,n=e.context.getRoom();if(n&&"clicker"===n.state.memberState.currentApplianceName){for(var i=t.target;i;i=i.parentElement)if(null!=(r=i.classList)&&r.contains("ppt-event-source"))return;n.pptNextStep()}})),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-dynamic-"+e}}]),e}(),Du={kind:"DocsViewer",setup:function(e){var t=e.getBox(),r=e.getScenes();if(!r)throw new Error("[Docs Viewer]: scenes not found.");var n=e.getView();if(!n)throw new Error("[Docs Viewer]: no whiteboard view.");var i=r.map((function(e){var t=e.ppt;return t?{width:t.width,height:t.height,src:t.src,thumbnail:t.previewURL}:null})).filter((function(e){return Boolean(e)}));if(i.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(".netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-docs-viewer-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.netless-app-docs-viewer-readonly.netless-app-docs-viewer-float-footer{display:none}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{position:absolute;top:0;right:0;z-index:2147483647;width:8px;min-height:30px;margin:0;padding:0;border:none;outline:none;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;opacity:0;transition:background .4s,opacity .4s 3s,transform .2s;user-select:none}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{background:rgba(68,78,96,.6);opacity:1;transition:background .4s,opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar:hover,.netless-app-docs-viewer-static-scrollbar:focus{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-content:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.netless-app-docs-viewer-static-pages:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.page-renderer-pages-container{position:relative;overflow:hidden}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-wb-view,.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}\n"),i[0].src.startsWith("ppt")?function(e,t,r,n){t.disableCameraTransform=!0;var i=new Ru({context:e,whiteboardView:t,box:r,pages:n}).mount();i.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:n.length})},e.dispatchAppEvent("pageStateChange",{index:i.getPageIndex(),length:n.length}),e.mountView(i.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",(function(t){var i=t.width,o=t.height;if(n.length>0&&"maximized"!==r.state){var a=n[0],s=a.width,u=a.height/s*i-o;0!==u&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:r.width,height:r.height+u/r.containerRect.height})}}))}(e,n,t,i):function(e,t,r,n){var i;t.disableCameraTransform=!e.getIsWritable();var o=new Ou({whiteboardView:t,readonly:!e.getIsWritable(),box:r,pages:n,pageScrollTop:null==(i=e.getAttributes())?void 0:i.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:function(t){var n;(null==(n=e.getAttributes())?void 0:n.pageScrollTop)!==t&&!r.readonly&&e.updateAttributes(["pageScrollTop"],t)},baseScenePath:e.getInitScenePath(),appId:e.appId}).mount();o.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:n.length})},e.dispatchAppEvent("pageStateChange",{index:o.viewer.pageIndex,length:n.length}),e.emitter.on("attributesUpdate",(function(e){e&&null!=e.pageScrollTop&&o.syncPageScrollTop(e.pageScrollTop)})),e.emitter.on("writableChange",(function(e){o.setReadonly(!e),t.disableCameraTransform=!e}))}(e,n,t,i)}};var Lu={exports:{}},ju={},zu={exports:{}},Bu={}; /** @license React v0.19.1 * scheduler.production.min.js * @@ -334,7 +334,7 @@ PERFORMANCE OF THIS SOFTWARE. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. -*/!function(e){var t,r,n,i,o;if("undefined"==typeof window||"function"!=typeof MessageChannel){var a=null,s=null,u=function t(){if(null!==a)try{var r=e.unstable_now();a(!0,r),a=null}catch(e){throw setTimeout(t,0),e}},l=Date.now();e.unstable_now=function(){return Date.now()-l},t=function(e){null!==a?setTimeout(t,0,e):(a=e,setTimeout(u,0))},r=function(e,t){s=setTimeout(e,t)},n=function(){clearTimeout(s)},i=function(){return!1},o=e.unstable_forceFrameRate=function(){}}else{var c=window.performance,h=window.Date,d=window.setTimeout,f=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==x(c)&&"function"==typeof c.now)e.unstable_now=function(){return c.now()};else{var v=h.now();e.unstable_now=function(){return h.now()-v}}var g=!1,m=null,y=-1,_=5,b=0;i=function(){return e.unstable_now()>=b},o=function(){},e.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[n];if(!(void 0!==i&&0E(a,r))void 0!==u&&0>E(u,a)?(e[n]=u,e[s]=r,n=s):(e[n]=a,e[o]=r,n=o);else{if(!(void 0!==u&&0>E(u,r)))break e;e[n]=u,e[s]=r,n=s}}}return t}return null}function E(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var I=[],A=[],C=1,P=null,N=3,O=!1,R=!1,D=!1;function L(e){for(var t=M(A);null!==t;){if(null===t.callback)k(A);else{if(!(t.startTime<=e))break;k(A),t.sortIndex=t.expirationTime,T(I,t)}t=M(A)}}function j(e){if(D=!1,L(e),!R)if(null!==M(I))R=!0,t(z);else{var n=M(A);null!==n&&r(j,n.startTime-e)}}function z(t,o){R=!1,D&&(D=!1,n()),O=!0;var a=N;try{for(L(o),P=M(I);null!==P&&(!(P.expirationTime>o)||t&&!i());){var s=P.callback;if(null!==s){P.callback=null,N=P.priorityLevel;var u=s(P.expirationTime<=o);o=e.unstable_now(),"function"==typeof u?P.callback=u:P===M(I)&&k(I),L(o)}else k(I);P=M(I)}if(null!==P)var l=!0;else{var c=M(A);null!==c&&r(j,c.startTime-o),l=!1}return l}finally{P=null,N=a,O=!1}}function B(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=o;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){R||O||(R=!0,t(z))},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_getFirstCallbackNode=function(){return M(I)},e.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var r=N;N=t;try{return e()}finally{N=r}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=F,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=N;N=e;try{return t()}finally{N=r}},e.unstable_scheduleCallback=function(i,o,a){var s=e.unstable_now();if("object"==x(a)&&null!==a){var u=a.delay;u="number"==typeof u&&0s?(i.sortIndex=u,T(A,i),null===M(I)&&i===M(A)&&(D?n():D=!0,r(j,u-s))):(i.sortIndex=a,T(I,i),R||O||(R=!0,t(z))),i},e.unstable_shouldYield=function(){var t=e.unstable_now();L(t);var r=M(I);return r!==P&&null!==P&&null!==r&&null!==r.callback&&r.startTime<=t&&r.expirationTime=b},o=function(){},e.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[n];if(!(void 0!==i&&0E(a,r))void 0!==u&&0>E(u,a)?(e[n]=u,e[s]=r,n=s):(e[n]=a,e[o]=r,n=o);else{if(!(void 0!==u&&0>E(u,r)))break e;e[n]=u,e[s]=r,n=s}}}return t}return null}function E(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var A=[],I=[],C=1,P=null,N=3,O=!1,R=!1,D=!1;function L(e){for(var t=M(I);null!==t;){if(null===t.callback)k(I);else{if(!(t.startTime<=e))break;k(I),t.sortIndex=t.expirationTime,T(A,t)}t=M(I)}}function j(e){if(D=!1,L(e),!R)if(null!==M(A))R=!0,t(z);else{var n=M(I);null!==n&&r(j,n.startTime-e)}}function z(t,o){R=!1,D&&(D=!1,n()),O=!0;var a=N;try{for(L(o),P=M(A);null!==P&&(!(P.expirationTime>o)||t&&!i());){var s=P.callback;if(null!==s){P.callback=null,N=P.priorityLevel;var u=s(P.expirationTime<=o);o=e.unstable_now(),"function"==typeof u?P.callback=u:P===M(A)&&k(A),L(o)}else k(A);P=M(A)}if(null!==P)var l=!0;else{var c=M(I);null!==c&&r(j,c.startTime-o),l=!1}return l}finally{P=null,N=a,O=!1}}function B(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=o;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){R||O||(R=!0,t(z))},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_getFirstCallbackNode=function(){return M(A)},e.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var r=N;N=t;try{return e()}finally{N=r}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=F,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=N;N=e;try{return t()}finally{N=r}},e.unstable_scheduleCallback=function(i,o,a){var s=e.unstable_now();if("object"==x(a)&&null!==a){var u=a.delay;u="number"==typeof u&&0s?(i.sortIndex=u,T(I,i),null===M(A)&&i===M(I)&&(D?n():D=!0,r(j,u-s))):(i.sortIndex=a,T(A,i),R||O||(R=!0,t(z))),i},e.unstable_shouldYield=function(){var t=e.unstable_now();L(t);var r=M(A);return r!==P&&null!==P&&null!==r&&null!==r.callback&&r.startTime<=t&&r.expirationTimet}return!1}function Cl(e,t,r,n,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o}var Pl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){Pl[e]=new Cl(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];Pl[t]=new Cl(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){Pl[e]=new Cl(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){Pl[e]=new Cl(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){Pl[e]=new Cl(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){Pl[e]=new Cl(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){Pl[e]=new Cl(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){Pl[e]=new Cl(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){Pl[e]=new Cl(e,5,!1,e.toLowerCase(),null,!1)}));var Nl=/[\-:]([a-z])/g;function Ol(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(Nl,Ol);Pl[t]=new Cl(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Nl,Ol);Pl[t]=new Cl(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Nl,Ol);Pl[t]=new Cl(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){Pl[e]=new Cl(e,1,!1,e.toLowerCase(),null,!1)})),Pl.xlinkHref=new Cl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){Pl[e]=new Cl(e,1,!1,e.toLowerCase(),null,!0)}));var Rl=Fu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Dl(e,t,r,n){var i=Pl.hasOwnProperty(t)?Pl[t]:null;(null!==i?0===i.type:!n&&!(!(2=r.length))throw Error(Gu(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:rc(r)}}function gc(e,t){var r=rc(t.value),n=rc(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function mc(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var yc="http://www.w3.org/1999/xhtml",_c="http://www.w3.org/2000/svg";function bc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xc(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?bc(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var wc,Sc=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction((function(){return e(t,r)}))}:e}((function(e,t){if(e.namespaceURI!==_c||"innerHTML"in e)e.innerHTML=t;else{for((wc=wc||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=wc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Tc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}function Mc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var kc={animationend:Mc("Animation","AnimationEnd"),animationiteration:Mc("Animation","AnimationIteration"),animationstart:Mc("Animation","AnimationStart"),transitionend:Mc("Transition","TransitionEnd")},Ec={},Ic={};function Ac(e){if(Ec[e])return Ec[e];if(!kc[e])return e;var t,r=kc[e];for(t in r)if(r.hasOwnProperty(t)&&t in Ic)return Ec[e]=r[t];return e}cl&&(Ic=document.createElement("div").style,"AnimationEvent"in window||(delete kc.animationend.animation,delete kc.animationiteration.animation,delete kc.animationstart.animation),"TransitionEvent"in window||delete kc.transitionend.transition);var Cc=Ac("animationend"),Pc=Ac("animationiteration"),Nc=Ac("animationstart"),Oc=Ac("transitionend"),Rc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dc=new("function"==typeof WeakMap?WeakMap:Map);function Lc(e){var t=Dc.get(e);return void 0===t&&(t=new Map,Dc.set(e,t)),t}function jc(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function zc(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Bc(e){if(jc(e)!==e)throw Error(Gu(188))}function Fc(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=jc(e)))throw Error(Gu(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(n=i.return)){r=n;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===r)return Bc(i),e;if(o===n)return Bc(i),t;o=o.sibling}throw Error(Gu(188))}if(r.return!==n.return)r=i,n=o;else{for(var a=!1,s=i.child;s;){if(s===r){a=!0,r=i,n=o;break}if(s===n){a=!0,n=i,r=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===r){a=!0,r=o,n=i;break}if(s===n){a=!0,n=o,r=i;break}s=s.sibling}if(!a)throw Error(Gu(189))}}if(r.alternate!==n)throw Error(Gu(190))}if(3!==r.tag)throw Error(Gu(188));return r.stateNode.current===r?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Uc(e,t){if(null==t)throw Error(Gu(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Wc(e,t,r){Array.isArray(e)?e.forEach(t,r):e&&t.call(r,e)}var Gc=null;function Vc(e){if(e){var t=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(t))for(var n=0;nXc.length&&Xc.push(e)}function Qc(e,t,r,n){if(Xc.length){var i=Xc.pop();return i.topLevelType=e,i.eventSystemFlags=n,i.nativeEvent=t,i.targetInst=r,i}return{topLevelType:e,eventSystemFlags:n,nativeEvent:t,targetInst:r,ancestors:[]}}function Zc(e){var t=e.targetInst,r=t;do{if(!r){e.ancestors.push(r);break}var n=r;if(3===n.tag)n=n.stateNode.containerInfo;else{for(;n.return;)n=n.return;n=3!==n.tag?null:n.stateNode.containerInfo}if(!n)break;5!==(t=r.tag)&&6!==t||e.ancestors.push(r),r=fd(n)}while(r);for(r=0;r=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xh(n)}}function Qh(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Qh(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Zh(){for(var e=window,t=$h();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=$h((e=t.contentWindow).document)}return t}function Kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Jh="$?",ed="$!",td=null,rd=null;function nd(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function id(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==x(t.dangerouslySetInnerHTML)&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var od="function"==typeof setTimeout?setTimeout:void 0,ad="function"==typeof clearTimeout?clearTimeout:void 0;function sd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function ud(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||r===ed||r===Jh){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var ld=Math.random().toString(36).slice(2),cd="__reactInternalInstance$"+ld,hd="__reactEventHandlers$"+ld,dd="__reactContainere$"+ld;function fd(e){var t=e[cd];if(t)return t;for(var r=e.parentNode;r;){if(t=r[dd]||r[cd]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=ud(e);null!==e;){if(r=e[cd])return r;e=ud(e)}return t}r=(e=r).parentNode}return null}function pd(e){return!(e=e[cd]||e[dd])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function vd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Gu(33))}function gd(e){return e[hd]||null}function md(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function yd(e,t){var r=e.stateNode;if(!r)return null;var n=Zu(r);if(!n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(Gu(231,t,x(r)));return r}function _d(e,t,r){(t=yd(e,r.dispatchConfig.phasedRegistrationNames[t]))&&(r._dispatchListeners=Uc(r._dispatchListeners,t),r._dispatchInstances=Uc(r._dispatchInstances,e))}function bd(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,r=[];t;)r.push(t),t=md(t);for(t=r.length;0this.eventPool.length&&this.eventPool.push(e)}function Od(e){e.eventPool=[],e.getPooled=Pd,e.release=Nd}Uu(Cd.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Id)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Id)},persist:function(){this.isPersistent=Id},isPersistent:Ad,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Ad,this._dispatchInstances=this._dispatchListeners=null}}),Cd.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Cd.extend=function(e){function t(){}function r(){return n.apply(this,arguments)}var n=this;t.prototype=n.prototype;var i=new t;return Uu(i,r.prototype),r.prototype=i,r.prototype.constructor=r,r.Interface=Uu({},n.Interface,e),r.extend=n.extend,Od(r),r},Od(Cd);var Rd=Cd.extend({data:null}),Dd=Cd.extend({data:null}),Ld=[9,13,27,32],jd=cl&&"CompositionEvent"in window,zd=null;cl&&"documentMode"in document&&(zd=document.documentMode);var Bd=cl&&"TextEvent"in window&&!zd,Fd=cl&&(!jd||zd&&8=zd),Ud=String.fromCharCode(32),Wd={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Gd=!1;function Vd(e,t){switch(e){case"keyup":return-1!==Ld.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Hd(e){return"object"==x(e=e.detail)&&"data"in e?e.data:null}var Yd=!1;var $d={eventTypes:Wd,extractEvents:function(e,t,r,n){var i;if(jd)e:{switch(e){case"compositionstart":var o=Wd.compositionStart;break e;case"compositionend":o=Wd.compositionEnd;break e;case"compositionupdate":o=Wd.compositionUpdate;break e}o=void 0}else Yd?Vd(e,r)&&(o=Wd.compositionEnd):"keydown"===e&&229===r.keyCode&&(o=Wd.compositionStart);return o?(Fd&&"ko"!==r.locale&&(Yd||o!==Wd.compositionStart?o===Wd.compositionEnd&&Yd&&(i=Ed()):(Md="value"in(Td=n)?Td.value:Td.textContent,Yd=!0)),o=Rd.getPooled(o,t,r,n),i?o.data=i:null!==(i=Hd(r))&&(o.data=i),Sd(o),i=o):i=null,(e=Bd?function(e,t){switch(e){case"compositionend":return Hd(t);case"keypress":return 32!==t.which?null:(Gd=!0,Ud);case"textInput":return(e=t.data)===Ud&&Gd?null:e;default:return null}}(e,r):function(e,t){if(Yd)return"compositionend"===e||!jd&&Vd(e,t)?(e=Ed(),kd=Md=Td=null,Yd=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,If={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Af=null,Cf=null,Pf=null,Nf=!1;function Of(e,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Nf||null==Af||Af!==$h(r)?null:("selectionStart"in(r=Af)&&Kh(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Pf&&kf(Pf,r)?null:(Pf=r,(e=Cd.getPooled(If.select,Cf,e,t)).type="select",e.target=Af,Sd(e),e))}var Rf={eventTypes:If,extractEvents:function(e,t,r,n,i,o){if(!(o=!(i=o||(n.window===n?n.document:9===n.nodeType?n:n.ownerDocument)))){e:{i=Lc(i),o=ul.onSelect;for(var a=0;aXf||(e.current=$f[Xf],$f[Xf]=null,Xf--)}function Qf(e,t){Xf++,$f[Xf]=e.current,e.current=t}var Zf={},Kf={current:Zf},Jf={current:!1},ep=Zf;function tp(e,t){var r=e.type.contextTypes;if(!r)return Zf;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in r)o[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rp(e){return null!=(e=e.childContextTypes)}function np(){qf(Jf),qf(Kf)}function ip(e,t,r){if(Kf.current!==Zf)throw Error(Gu(168));Qf(Kf,t),Qf(Jf,r)}function op(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in e))throw Error(Gu(108,ec(t)||"Unknown",i));return Uu({},r,{},n)}function ap(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zf,ep=Kf.current,Qf(Kf,e),Qf(Jf,Jf.current),!0}function sp(e,t,r){var n=e.stateNode;if(!n)throw Error(Gu(169));r?(e=op(e,t,ep),n.__reactInternalMemoizedMergedChildContext=e,qf(Jf),qf(Kf),Qf(Kf,e)):qf(Jf),Qf(Jf,r)}var up=Wu.unstable_runWithPriority,lp=Wu.unstable_scheduleCallback,cp=Wu.unstable_cancelCallback,hp=Wu.unstable_requestPaint,dp=Wu.unstable_now,fp=Wu.unstable_getCurrentPriorityLevel,pp=Wu.unstable_ImmediatePriority,vp=Wu.unstable_UserBlockingPriority,gp=Wu.unstable_NormalPriority,mp=Wu.unstable_LowPriority,yp=Wu.unstable_IdlePriority,_p={},bp=Wu.unstable_shouldYield,xp=void 0!==hp?hp:function(){},wp=null,Sp=null,Tp=!1,Mp=dp(),kp=1e4>Mp?dp:function(){return dp()-Mp};function Ep(){switch(fp()){case pp:return 99;case vp:return 98;case gp:return 97;case mp:return 96;case yp:return 95;default:throw Error(Gu(332))}}function Ip(e){switch(e){case 99:return pp;case 98:return vp;case 97:return gp;case 96:return mp;case 95:return yp;default:throw Error(Gu(332))}}function Ap(e,t){return e=Ip(e),up(e,t)}function Cp(e,t,r){return e=Ip(e),lp(e,t,r)}function Pp(e){return null===wp?(wp=[e],Sp=lp(pp,Op)):wp.push(e),_p}function Np(){if(null!==Sp){var e=Sp;Sp=null,cp(e)}Op()}function Op(){if(!Tp&&null!==wp){Tp=!0;var e=0;try{var t=wp;Ap(99,(function(){for(;e=t&&(gg=!0),e.firstContext=null)}function Vp(e,t){if(Bp!==e&&!1!==t&&0!==t)if(("number"!=typeof t||1073741823===t)&&(Bp=e,t=1073741823),t={context:e,observedBits:t,next:null},null===zp){if(null===jp)throw Error(Gu(308));zp=t,jp.dependencies={expirationTime:0,firstContext:t,responders:null}}else zp=zp.next=t;return e._currentValue}var Hp=!1;function Yp(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function $p(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Xp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function qp(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function Qp(e,t){var r=e.alternate;null!==r&&$p(r,e),null===(r=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=r.next,r.next=t)}function Zp(e,t,r,n){var i=e.updateQueue;Hp=!1;var o=i.baseQueue,a=i.shared.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}o=a,i.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=a))}if(null!==o){s=o.next;var u=i.baseState,l=0,c=null,h=null,d=null;if(null!==s)for(var f=s;;){if((a=f.expirationTime)l&&(l=a)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:f.suspenseConfig,tag:f.tag,payload:f.payload,callback:f.callback,next:null}),qm(a,f.suspenseConfig);e:{var v=e,g=f;switch(a=t,p=r,g.tag){case 1:if("function"==typeof(v=g.payload)){u=v.call(p,u,a);break e}u=v;break e;case 3:v.effectTag=-4097&v.effectTag|64;case 0:if(null==(a="function"==typeof(v=g.payload)?v.call(p,u,a):v))break e;u=Uu({},u,a);break e;case 2:Hp=!0}}null!==f.callback&&(e.effectTag|=32,null===(a=i.effects)?i.effects=[f]:a.push(f))}if(null===(f=f.next)||f===s){if(null===(a=i.shared.pending))break;f=o.next=a.next,a.next=s,i.baseQueue=o=a,i.shared.pending=null}}null===d?c=u:d.next=h,i.baseState=c,i.baseQueue=d,Qm(l),e.expirationTime=l,e.memoizedState=u}}function Kp(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;tv?(g=p,p=null):g=p.sibling;var m=d(i,p,s[v],u);if(null===m){null===p&&(p=g);break}e&&p&&null===m.alternate&&t(i,p),a=o(m,a,v),null===c?l=m:c.sibling=m,c=m,p=g}if(v===s.length)return r(i,p),l;if(null===p){for(;vv?(g=p,p=null):g=p.sibling;var y=d(i,p,m.value,u);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(i,p),a=o(y,a,v),null===c?l=y:c.sibling=y,c=y,p=g}if(m.done)return r(i,p),l;if(null===p){for(;!m.done;v++,m=s.next())null!==(m=h(i,m.value,u))&&(a=o(m,a,v),null===c?l=m:c.sibling=m,c=m);return l}for(p=n(i,p);!m.done;v++,m=s.next())null!==(m=f(p,i,v,m.value,u))&&(e&&null!==m.alternate&&p.delete(null===m.key?v:m.key),a=o(m,a,v),null===c?l=m:c.sibling=m,c=m);return e&&p.forEach((function(e){return t(i,e)})),l}(s,u,l,c);if(v&&lv(s,l),void 0===l&&!p)switch(s.tag){case 1:case 0:throw s=s.type,Error(Gu(152,s.displayName||s.name||"Component"))}return r(s,u)}}var hv=cv(!0),dv=cv(!1),fv={},pv={current:fv},vv={current:fv},gv={current:fv};function mv(e){if(e===fv)throw Error(Gu(174));return e}function yv(e,t){switch(Qf(gv,t),Qf(vv,e),Qf(pv,fv),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xc(null,"");break;default:t=xc(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}qf(pv),Qf(pv,t)}function _v(){qf(pv),qf(vv),qf(gv)}function bv(e){mv(gv.current);var t=mv(pv.current),r=xc(t,e.type);t!==r&&(Qf(vv,e),Qf(pv,r))}function xv(e){vv.current===e&&(qf(pv),qf(vv))}var wv={current:0};function Sv(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||r.data===Jh||r.data===ed))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Tv(e,t){return{responder:e,props:t}}var Mv=Rl.ReactCurrentDispatcher,kv=Rl.ReactCurrentBatchConfig,Ev=0,Iv=null,Av=null,Cv=null,Pv=!1;function Nv(){throw Error(Gu(321))}function Ov(e,t){if(null===t)return!1;for(var r=0;ro))throw Error(Gu(301));o+=1,Cv=Av=null,t.updateQueue=null,Mv.current=og,e=r(n,i)}while(t.expirationTime===Ev)}if(Mv.current=rg,t=null!==Av&&null!==Av.next,Ev=0,Cv=Av=Iv=null,Pv=!1,t)throw Error(Gu(300));return e}function Dv(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Cv?Iv.memoizedState=Cv=e:Cv=Cv.next=e,Cv}function Lv(){if(null===Av){var e=Iv.alternate;e=null!==e?e.memoizedState:null}else e=Av.next;var t=null===Cv?Iv.memoizedState:Cv.next;if(null!==t)Cv=t,Av=e;else{if(null===e)throw Error(Gu(310));e={memoizedState:(Av=e).memoizedState,baseState:Av.baseState,baseQueue:Av.baseQueue,queue:Av.queue,next:null},null===Cv?Iv.memoizedState=Cv=e:Cv=Cv.next=e}return Cv}function jv(e,t){return"function"==typeof t?t(e):t}function zv(e){var t=Lv(),r=t.queue;if(null===r)throw Error(Gu(311));r.lastRenderedReducer=e;var n=Av,i=n.baseQueue,o=r.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}n.baseQueue=i=o,r.pending=null}if(null!==i){i=i.next,n=n.baseState;var s=a=o=null,u=i;do{var l=u.expirationTime;if(lIv.expirationTime&&(Iv.expirationTime=l,Qm(l))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:u.suspenseConfig,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),qm(l,u.suspenseConfig),n=u.eagerReducer===e?u.eagerState:e(n,u.action);u=u.next}while(null!==u&&u!==i);null===s?o=n:s.next=a,Tf(n,t.memoizedState)||(gg=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=s,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function Bv(e){var t=Lv(),r=t.queue;if(null===r)throw Error(Gu(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,o=t.memoizedState;if(null!==i){r.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);Tf(o,t.memoizedState)||(gg=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function Fv(e){var t=Dv();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:jv,lastRenderedState:e}).dispatch=tg.bind(null,Iv,e),[t.memoizedState,e]}function Uv(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=Iv.updateQueue)?(t={lastEffect:null},Iv.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Wv(){return Lv().memoizedState}function Gv(e,t,r,n){var i=Dv();Iv.effectTag|=e,i.memoizedState=Uv(1|t,r,void 0,void 0===n?null:n)}function Vv(e,t,r,n){var i=Lv();n=void 0===n?null:n;var o=void 0;if(null!==Av){var a=Av.memoizedState;if(o=a.destroy,null!==n&&Ov(n,a.deps))return void Uv(t,r,o,n)}Iv.effectTag|=e,i.memoizedState=Uv(1|t,r,o,n)}function Hv(e,t){return Gv(516,4,e,t)}function Yv(e,t){return Vv(516,4,e,t)}function $v(e,t){return Vv(4,2,e,t)}function Xv(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function qv(e,t,r){return r=null!=r?r.concat([e]):null,Vv(4,2,Xv.bind(null,t,e),r)}function Qv(){}function Zv(e,t){return Dv().memoizedState=[e,void 0===t?null:t],e}function Kv(e,t){var r=Lv();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&Ov(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Jv(e,t){var r=Lv();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&Ov(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function eg(e,t,r){var n=Ep();Ap(98>n?98:n,(function(){e(!0)})),Ap(97<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=a.createElement(i,{is:n.is}):(e=a.createElement(i),"select"===i&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,i),e[cd]=t,e[hd]=n,kg(e,t),t.stateNode=e,a=Gh(i,n),i){case"iframe":case"object":case"embed":Ph("load",e),s=n;break;case"video":case"audio":for(s=0;sn.tailExpiration&&1t)&&Nm.set(e,t))}}function Bm(e,t){e.expirationTime=(e=r>(e=e.nextKnownPendingLevel)?r:e)&&t!==e?0:e}function Um(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Pp(Gm.bind(null,e));else{var t=Fm(e),r=e.callbackNode;if(0===t)null!==r&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var n=Lm();if(1073741823===t?n=99:1===t||2===t?n=95:n=0>=(n=10*(1073741821-t)-10*(1073741821-n))?99:250>=n?98:5250>=n?97:95,null!==r){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=n)return;r!==_p&&cp(r)}e.callbackExpirationTime=t,e.callbackPriority=n,t=1073741823===t?Pp(Gm.bind(null,e)):Cp(n,Wm.bind(null,e),{timeout:10*(1073741821-t)-kp()}),e.callbackNode=t}}}function Wm(e,t){if(Dm=0,t)return My(e,t=Lm()),Um(e),null;var r=Fm(e);if(0!==r){if(t=e.callbackNode,0!=(48&fm))throw Error(Gu(327));if(oy(),e===pm&&r===gm||Ym(e,r),null!==vm){var n=fm;fm|=um;for(var i=Xm();;)try{Km();break}catch(t){$m(e,t)}if(Fp(),fm=n,am.current=i,1===mm)throw t=ym,Ym(e,r),Sy(e,r),Um(e),t;if(null===vm)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=r,n=mm,pm=null,n){case cm:case 1:throw Error(Gu(345));case 2:My(e,2=r){e.lastPingedTime=r,Ym(e,r);break}}if(0!==(o=Fm(e))&&o!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}e.timeoutHandle=od(ry.bind(null,e),i);break}ry(e);break;case dm:if(Sy(e,r),r===(n=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=ty(i)),Sm&&(0===(i=e.lastPingedTime)||i>=r)){e.lastPingedTime=r,Ym(e,r);break}if(0!==(i=Fm(e))&&i!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}if(1073741823!==bm?n=10*(1073741821-bm)-kp():1073741823===_m?n=0:(n=10*(1073741821-_m)-5e3,0>(n=(i=kp())-n)&&(n=0),(r=10*(1073741821-r)-i)<(n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*om(n/1960))-n)&&(n=r)),10=(n=0|a.busyMinDurationMs)?n=0:(i=0|a.busyDelayMs,n=(o=kp()-(10*(1073741821-o)-(0|a.timeoutMs||5e3)))<=i?0:i+n-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+tc(a))}5!==mm&&(mm=2),s=zg(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=t,Qp(h,rm(h,u,t));break e;case 1:u=s;var b=h.type,w=h.stateNode;if(0==(64&h.effectTag)&&("function"==typeof b.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===Im||!Im.has(w)))){h.effectTag|=4096,h.expirationTime=t,Qp(h,nm(h,u,t));break e}}h=h.return}while(null!==h)}vm=ey(vm)}catch(e){t=e;continue}break}}function Xm(){var e=am.current;return am.current=rg,null===e?rg:e}function qm(e,t){e<_m&&2wm&&(wm=e)}function Zm(){for(;null!==vm;)vm=Jm(vm)}function Km(){for(;null!==vm&&!bp();)vm=Jm(vm)}function Jm(e){var t=im(e.alternate,e,gm);return e.memoizedProps=e.pendingProps,null===t&&(t=ey(e)),sm.current=null,t}function ey(e){vm=e;do{var t=vm.alternate;if(e=vm.return,0==(2048&vm.effectTag)){if(t=Lg(t,vm,gm),1===gm||1!==vm.childExpirationTime){for(var r=0,n=vm.child;null!==n;){var i=n.expirationTime,o=n.childExpirationTime;i>r&&(r=i),o>r&&(r=o),n=n.sibling}vm.childExpirationTime=r}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=vm.firstEffect),null!==vm.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=vm.firstEffect),e.lastEffect=vm.lastEffect),1(e=e.childExpirationTime)?t:e}function ry(e){var t=Ep();return Ap(99,ny.bind(null,e,t)),null}function ny(e,t){do{oy()}while(null!==Cm);if(0!=(48&fm))throw Error(Gu(327));var r=e.finishedWork,n=e.finishedExpirationTime;if(null===r)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,r===e.current)throw Error(Gu(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=ty(r);if(e.firstPendingTime=i,n<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n<=e.firstSuspendedTime&&(e.firstSuspendedTime=n-1),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===pm&&(vm=pm=null,gm=0),1s&&(l=s,s=a,a=l),l=qh(_,a),c=qh(_,s),l&&c&&(1!==x.rangeCount||x.anchorNode!==l.node||x.anchorOffset!==l.offset||x.focusNode!==c.node||x.focusOffset!==c.offset)&&((b=b.createRange()).setStart(l.node,l.offset),x.removeAllRanges(),a>s?(x.addRange(b),x.extend(c.node,c.offset)):(b.setEnd(c.node,c.offset),x.addRange(b))))),b=[],x=_);x=x.parentNode;)1===x.nodeType&&b.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof _.focus&&_.focus(),_=0;_=r?Cg(e,t,r):(Qf(wv,1&wv.current),null!==(t=Rg(e,t,r))?t.sibling:null);Qf(wv,1&wv.current);break;case 19:if(n=t.childExpirationTime>=r,0!=(64&e.effectTag)){if(n)return Og(e,t,r);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Qf(wv,wv.current),!n)return null}return Rg(e,t,r)}gg=!1}}else gg=!1;switch(t.expirationTime=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=tp(t,Kf.current),Gp(t,r),i=Rv(null,t,n,e,i,r),t.effectTag|=1,"object"==x(i)&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,rp(n)){var o=!0;ap(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Yp(t);var a=n.getDerivedStateFromProps;"function"==typeof a&&tv(t,n,a,e),i.updater=rv,t.stateNode=i,i._reactInternalFiber=t,av(t,n,e,r),t=Tg(null,t,n,!0,o,r)}else t.tag=0,mg(null,t,i,r),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"==typeof e)return vy(e)?1:0;if(null!=e){if((e=e.$$typeof)===Yl)return 11;if(e===ql)return 14}return 2}(i),e=Dp(i,e),o){case 0:t=wg(null,t,i,e,r);break e;case 1:t=Sg(null,t,i,e,r);break e;case 11:t=yg(null,t,i,e,r);break e;case 14:t=_g(null,t,i,Dp(i.type,e),n,r);break e}throw Error(Gu(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,wg(e,t,n,i=t.elementType===n?i:Dp(n,i),r);case 1:return n=t.type,i=t.pendingProps,Sg(e,t,n,i=t.elementType===n?i:Dp(n,i),r);case 3:if(Mg(t),n=t.updateQueue,null===e||null===n)throw Error(Gu(282));if(n=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,$p(e,t),Zp(t,n,null,r),(n=t.memoizedState.element)===i)pg(),t=Rg(e,t,r);else{if((i=t.stateNode.hydrate)&&(sg=sd(t.stateNode.containerInfo.firstChild),ag=t,i=ug=!0),i)for(r=dv(t,null,n,r),t.child=r;r;)r.effectTag=-3&r.effectTag|1024,r=r.sibling;else mg(e,t,n,r),pg();t=t.child}return t;case 5:return bv(t),null===e&&hg(t),n=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,id(n,i)?a=null:null!==o&&id(n,o)&&(t.effectTag|=16),xg(e,t),4&t.mode&&1!==r&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(mg(e,t,a,r),t=t.child),t;case 6:return null===e&&hg(t),null;case 13:return Cg(e,t,r);case 4:return yv(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=hv(t,null,n,r):mg(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,yg(e,t,n,i=t.elementType===n?i:Dp(n,i),r);case 7:return mg(e,t,t.pendingProps,r),t.child;case 8:case 12:return mg(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value;var s=t.type._context;if(Qf(Lp,s._currentValue),s._currentValue=o,null!==a)if(s=a.value,0===(o=Tf(s,o)?0:0|("function"==typeof n._calculateChangedBits?n._calculateChangedBits(s,o):1073741823))){if(a.children===i.children&&!Jf.current){t=Rg(e,t,r);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var u=s.dependencies;if(null!==u){a=s.child;for(var l=u.firstContext;null!==l;){if(l.context===n&&0!=(l.observedBits&o)){1===s.tag&&((l=Xp(r,null)).tag=2,qp(s,l)),s.expirationTime=t&&e<=t}function Sy(e,t){var r=e.firstSuspendedTime,n=e.lastSuspendedTime;rt||0===r)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Ty(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var r=e.firstSuspendedTime;0!==r&&(t>=r?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function My(e,t){var r=e.lastExpiredTime;(0===r||r>t)&&(e.lastExpiredTime=t)}function ky(e,t,r,n){var i=t.current,o=Lm(),a=Jp.suspense;o=jm(o,i,a);e:if(r){t:{if(jc(r=r._reactInternalFiber)!==r||1!==r.tag)throw Error(Gu(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(rp(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(Gu(171))}if(1===r.tag){var u=r.type;if(rp(u)){r=op(r,u,s);break e}}r=s}else r=Zf;return null===t.context?t.context=r:t.pendingContext=r,(t=Xp(o,a)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),qp(i,t),zm(i,o),o}function Ey(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Iy(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=t||r<0||h&&e-l>=o}function g(){var e=b_();if(v(e))return m(e);s=setTimeout(g,function(e){var r=t-(e-u);return h?w_(r,o-(e-l)):r}(e))}function m(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=b_(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(g,t),f(u)}return void 0===s&&(s=setTimeout(g,t)),a}return t=__(t)||0,p_(r)&&(c=!!r.leading,o=(h="maxWait"in r)?x_(__(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:m(b_())},y}var T_=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).seeking=!1,n.mobileSeeking=!1,n.track=null,n.hoverTime=null,n.offset=0,n.secondsPrefix="00:00:",n.minutesPrefix="00:",n.seekPause=!1,n.handleTouchSeeking=function(e){for(var t=0,r=0;rthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),r=e%3600,n=Math.floor(r/60),i=Math.ceil(r%60);return{hh:t.toString(),mm:n<10?"0"+n:n.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),r=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+r.ss:this.props.total+this.offset<3600?this.minutesPrefix+r.mm+":"+r.ss:r.hh+":"+r.mm+":"+r.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:fr.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return fr.createElement("div",{className:"seek-slider"},fr.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},fr.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),r}(xt.exports.Component),M_=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).stageVolume=0,n.updateVolumeTimer=0,n.onVolumeSeeking=!1,n.onClickOperationButton=function(){n.props.paused?n.props.play():n.props.pause()},n.operationButton=function(){return n.props.paused?fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},n.operationVolumeButton=function(){return n.props.volume>.9?fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):0===n.props.volume?fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="})},n.handleClickVolume=function(){0===n.props.volume?0!==n.stageVolume?n.props.setVolume(n.stageVolume):n.props.setVolume(1):(n.stageVolume=n.props.volume,n.props.setVolume(0))},n.onChange=function(e){n.setState({currentTime:e}),e&&n.changeTime(e)},n.changeTime=S_((function(e){n.props.setCurrentTime(e)}),50),n.onVolumeChange=function(e){n.changeVolume(e),n.setState({seekVolume:e/100})},n.changeVolume=S_((function(e){n.props.setVolume(e/100)}),50),n.onVolumeSeekStart=function(){n.onVolumeSeeking=!0},n.onVolumeSeekEnd=S_((function(){n.onVolumeSeeking=!1}),500),n.onProgressSeekStart=function(){return n.setState({isPlayerSeeking:!0})},n.onProgressSeekEnd=S_((function(){n.setState({isPlayerSeeking:!1})}),500),n.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},n.stageVolume=e.volume,n}return b(r,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,r=t.duration,n=t.currentTime;return fr.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},fr.createElement("div",{className:"player-controller-progress"},fr.createElement(T_,{total:r,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),fr.createElement("div",{className:"player-controller-actions"},fr.createElement("div",{className:"player-controller-actions-left"},fr.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),fr.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},fr.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),fr.createElement("div",{className:"player-volume-slider"},fr.createElement(T_,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),fr.createElement("div",{className:"player-mid-box-time"},k_(Math.floor(n/1e3))," /"," ",k_(Math.floor(r/1e3)))))}}]),r}(xt.exports.Component);function k_(e){var t=e%60,r=(e-t)/60;if(r>=60){var n=r%60;return"".concat(E_((r-n)/60),":").concat(E_(n),":").concat(E_(t))}return"".concat(E_(r),":").concat(E_(t))}function E_(e){return e<=9?"0".concat(e):"".concat(e)}var I_,A_=99999;!function(e){e[e.Idle=0]="Idle",e[e.Playing=1]="Playing",e[e.Paused=2]="Paused"}(I_||(I_={}));var C_={};function P_(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i>> Setup",{playingId:n,src:r}),e.addListener("error",(function(e){P_(">>> Error",{soundId:e}),C_[e].playState=0})),e.addListener("effectFinished",(function(e){P_(">>> Finished",{soundId:e}),C_[e].playState=0})),t.on("play",(function(){switch(C_[n].playState){case 0:e.playEffect(n,r,0,1,0,100,!1,0).then((function(){P_(">>> Play Success",{playingId:n}),C_[n].seekEnable=!0})),C_[n].playState=1,P_(">>> Start play",{playingId:n});break;case 2:e.resumeEffect(n),C_[n].playState=1,P_(">>> Resume play",{playingId:n})}})),t.on("pause",(function(){if(1===C_[n].playState)e.pauseEffect(n),C_[n].playState=2,P_(">>> Pause play",{playingId:n})})),t.on("timeupdate",(function(){var r=C_[n];1===r.playState&&r.seekEnable&&e.getEffectCurrentPosition(n).then((function(r){var i=C_[n],o=r/1e3,a=0!==i.previousSeekTargetTime&&0!==i.previousBeginSeekTime;if(!(a&&o0){var u=t.currentTime(),l=u-o,c=Math.abs(l);if(c>.5)if(a){var h=Date.now()/1e3-s,d=h+(l>0?l:0),f=u+d;m(f,n),P_(">>> seeking after seeking lag",{jsPlayerTime:u,rtcEffectTime:o,jsPlayerTimerAdvance:l,lastSeekingCost:h,estimatedRTCLag:d,targetRTCSeekTime:f})}else if(c>10)m(u,n),P_(">>> direct seek",{jsPlayerTime:u,rtcEffectTime:o,jsPlayerTimerAdvance:l});else{var p=i.previousVideoJSAdvance,v=Math.max(p+l,0),g=u+v;i.previousVideoJSAdvance=v,m(g,n),P_(">>> normal lag seeking",{jsPlayerTime:u,rtcEffectTime:o,jsPlayerTimerAdvance:l,previousAdvance:p,estimatedRTCLag:v,targetRTCSeekTime:g})}else a&&(P_(">>> seeking finished with no log",{jsPlayerTime:u,rtcEffectTime:o,jsPlayerTimerAdvance:l,previousBeginSeekTime:s,rtcLagTolerance:.5}),i.previousBeginSeekTime=0,i.previousSeekTargetTime=0)}}function m(t,r){e.setEffectPosition(r,1e3*t),i.previousBeginSeekTime=Date.now()/1e3,i.previousSeekTargetTime=t}}))})),t.on("dispose",(function(){C_[n].playState&&(e.stopEffect(n),delete C_[n],P_(">>> Dispose",{playingId:n}))}))}))}var O_=function(e){s(r,e);var t=u(r);function r(){var e;return y(this,r),(e=t.apply(this,arguments)).putAttributes=function(t){var r=e.props.context,n=r.getAttributes()||{};for(var i in t)n[i]!==t[i]&&r.updateAttributes([i],t[i])},e}return b(r,[{key:"render",value:function(){var e=this.props.context,t=e.getRoom(),r=t?void 0:e.getDisplayer(),n=this.putAttributes;return fr.createElement(R_,{room:t,player:r,context:e,plugin:{putAttributes:n}})}}]),r}(xt.exports.Component),R_=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).alertMask=null,n.container=fr.createRef(),n.controllerHiddenTimer=0,n.syncPlayerTimer=0,n.retryCount=0,n.decreaseRetryTimer=0,n.noSoundSyncCount=0,n.showController=function(){n.setState({controllerVisible:!0}),n.debounceHidingController()},n.play=function(){var e,t=null==(e=n.props.room)?void 0:e.calibrationTimestamp;n.debug(">>> play",{paused:!1,hostTime:t}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!1,hostTime:t})},n.pause=function(){var e=Qy(n.getAttributes(),n.props);n.debug(">>> pause",{paused:!0,currentTime:e}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:e})},n.setVolume=function(e){n.debug(">>> volume",{volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e,muted:0===e})},n.setCurrentTime=function(e){var t,r=null==(t=n.props.room)?void 0:t.calibrationTimestamp;n.debug(">>> seek",{currentTime:e/1e3,hostTime:r}),n.isEnabled()&&n.props.plugin.putAttributes({currentTime:e/1e3,hostTime:r})},n.resetPlayer=function(){var e;null==(e=n.player)||e.autoplay(!1),n.state.NoSound||(n.debug(">>> ended",{paused:!0,currentTime:0}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:0}))},n.syncPlayerWithAttributes=function(){var e,t=n.getAttributes();if(t){var r=n.player;if(r&&(!n.state.NoSound||(n.noSoundSyncCount+=1)%8==0)){r.paused()!==t.paused&&(n.debug("<<< paused -> %o",t.paused),t.paused?r.pause():null==(e=r.play())||e.catch(n.catchPlayFail)),r.muted()!==t.muted&&(n.debug("<<< muted -> %o",t.muted),r.muted(t.muted)),r.volume()!==t.volume&&(n.debug("<<< volume -> %o",t.volume),r.volume(t.volume));var i=Qy(t,n.props),o=Xy.currentTimeMaxError;n.state.NoSound&&(o*=3),i>r.duration()?n.resetPlayer():Math.abs(r.currentTime()-i)>o&&(n.debug("<<< currentTime -> %o",i),r.currentTime(i))}}},n.debounceHidingController=function(){n.controllerHiddenTimer&&(clearTimeout(n.controllerHiddenTimer),n.controllerHiddenTimer=0),n.controllerHiddenTimer=setTimeout((function(){n.setState({controllerVisible:!1}),n.controllerHiddenTimer=0}),3e3)},n.decreaseRetryCount=function(){!n.player||n.retryCount>0&&(n.retryCount=n.retryCount-1)},n.catchPlayFail=function(e){var t,r,i=String(e);if(Zy&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=n.player)||t.autoplay("any"),n.setState({NoSound:!0});else{var o=null==(r=n.player)?void 0:r.error();o&&(n.retryCount<=3?(n.initPlayer(),n.retryCount=n.retryCount+1):(n.debug("catch videojs media error",o),n.setState({MediaError:!0}))),n.debug("catch error",e)}},n.fixPlayFail=function(){n.debug("try to fix play state"),n.setState({NoSound:!1});var e=n.getAttributes(),t=e.muted,r=e.volume;n.player&&(n.player.muted(t),n.player.volume(r))},n.initPlayer=m(regeneratorRuntime.mark((function e(){var t,r,i,o,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=n.player)||t.dispose(),n.player=void 0,n.debug("creating elements ..."),r=n.getAttributes(),i=r.type,o=r.src,a=r.poster,(s=document.createElement("div")).setAttribute("data-vjs-player",""),(u=document.createElement("video")).className="video-js",a&&(u.poster=a),u.setAttribute("playsInline",""),u.setAttribute("webkit-playsinline",""),l=document.createElement("source"),new URL(o).pathname.endsWith(".m3u8")?l.type="application/x-mpegURL":u.src=o,l.src=o,i&&(l.type=i),u.appendChild(l),s.appendChild(u),n.container.current.appendChild(s),e.next=14,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 14:n.debug("initializing videojs() ..."),c=X.default(u),n.player=c,window.player=c,c.one("loadedmetadata",n.gracefullyUpdate),void 0!==(h=window.__mediaPlayerAudioEffectClient)&&N_(h,c,o),c.on("ready",(function(){var e;null==(e=Xy.onPlayer)||e.call(Xy,c),c.on("timeupdate",n.gracefullyUpdate),c.on("volumechange",n.gracefullyUpdate),c.on("seeked",n.gracefullyUpdate),c.on("play",n.gracefullyUpdate),c.on("pause",n.gracefullyUpdate),c.on("ended",n.resetPlayer)})),c.on("error",n.catchPlayFail),n.setState({MediaError:!1});case 19:case"end":return e.stop()}}),e)}))),n.gracefullyUpdate=function(){return n.setState({updater:!n.state.updater})},n.setupAlert=function(e){e&&(e.addEventListener("touchstart",n.fixPlayFail),e.addEventListener("click",n.fixPlayFail)),n.alertMask=e},n.setupReload=function(e){e&&(e.addEventListener("touchstart",n.initPlayer),e.addEventListener("click",n.initPlayer))},n.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/app-media-player@".concat(Hy," requires white-web-sdk@^2.13.8 to work properly."))}(e.room),n}return b(r,[{key:"getAttributes",value:function(){var e=this.props.context.getAttributes();if(e){if(e=Vy(Vy({},Yy),e),this.player){var t=Qy(e,this.props),r=this.player.duration();!e.paused&&t>r&&(e=function(e,t){return zy(e,By(t))}(Vy({},e),{currentTime:0,paused:!0}),this.resetPlayer())}return e}}},{key:"isShowingPoster",value:function(){var e=this.getAttributes();return null==e||!e.src||Ky.some((function(t){return e.src.endsWith(t)}))}},{key:"render",value:function(){var e,t;if(!this.props.room&&!this.props.player)return null;var r=this.getAttributes();if(!r)return null;var n=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),i=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return fr.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},fr.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&fr.createElement("div",{className:"video-js-plugin-poster"},r.poster&&fr.createElement("img",{src:r.poster,alt:"",draggable:!1})),fr.createElement(M_,{duration:n,volume:r.volume,setVolume:this.setVolume,paused:r.paused,play:this.play,pause:this.pause,currentTime:1e3*Qy(r,this.props),setCurrentTime:this.setCurrentTime,buffered:n*i,visible:!0}),this.state.NoSound&&fr.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&fr.createElement("div",{className:"videojs-plugin-recovery-mode"},fr.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:z.AnimationMode.Immediately;if(this.inDisplaySceneDir){var t=this.attributes,r=t.width,n=void 0===r?1280:r,i=t.height,o=void 0===i?720:i,a=n?-n/2:0,s=o?-o/2:0;this.manager.moveCameraToContain({originX:a,originY:s,width:n,height:o,animationMode:e})}}},{key:"handleSetPage",value:function(e){if(!this.isReplay&&this.attributes.displaySceneDir){var t=e.payload,r=this.displayer,n=r.entireScenes()[this.attributes.displaySceneDir];if(!n||n.length!==t){var i=function(e,t){return new Array(e).fill(0).map((function(e,r){return t(r)}))}(t,(function(e){return{name:String(e+1)}}));r.putScenes(this.attributes.displaySceneDir,i),this.manager.setMainViewScenePath(this.attributes.displaySceneDir)}}}},{key:"listenIframe",value:function(t){var r=this;t.url&&this.iframe.src!==t.url&&(this.src_url_equal_anchor||(this.src_url_equal_anchor=document.createElement("a")),this.src_url_equal_anchor.href=t.url,this.src_url_equal_anchor.href!==this.iframe.src&&(this.iframe.src=t.url)),this.iframe.width="".concat(t.width,"px"),this.iframe.height="".concat(t.height,"px"),this.sideEffectManager.addEventListener(this.iframe,"load",(function(t){var n;r.postMessage({kind:"Init",payload:{attributes:r.attributes,roomState:null==(n=e.displayer)?void 0:n.state,currentPage:r.currentPage,observerId:r.displayer.observerId}}),e.emitter.emit("IframeLoad",t),r.sideEffectManager.addDisposer(e.emitter.on("Ready",(function(){var e;r.postMessage(null==(e=r.attributes.lastEvent)?void 0:e.payload)})),B_),r.computedStyleAndIframeDisplay()}),void 0,G_)}},{key:"listenDisplayerState",value:function(){var e=this;this.isReplay&&(this.displayer._phase===z.PlayerPhase.Playing&&this.computedStyleAndIframeDisplay(),this.sideEffectManager.add((function(){return e.displayer.callbacks.on("onPhaseChanged",e.onPhaseChangedListener),function(){return e.displayer.callbacks.off("onPhaseChanged",e.onPhaseChangedListener)}}),V_)),this.computedStyleAndIframeDisplay()}},{key:"computedStyleAndIframeDisplay",value:function(){this.computedStyle(this.displayer.state),this.computedIframeDisplay(this.displayer.state,this.attributes)}},{key:"listenDisplayerCallbacks",value:function(){this.displayer.callbacks.on(this.callbackName,this.stateChangeListener)}},{key:"computedStyle",value:function(e){var t=this.manager.cameraState,r=this.attributes.width||1280,n=this.attributes.height||720;if(this.iframe){var i=t.width,o=t.height,a=t.scale,s=t.centerX,u=t.centerY,l=this.rootRect||{x:0,y:0},c="".concat(i/2+l.x,"px"),h="".concat(o/2+l.y,"px"),d=-u*a+(o-n)/2*a,f=["position: absolute;","border: 0.1px solid rgba(0,0,0,0);","top: 0px;","left: 0px;","transform-origin: ".concat(c," ").concat(h,";"),"transform: translate(".concat(-s*a+(i-r)/2*a,"px,").concat(d,"px) scale(").concat(a,", ").concat(a,");")];this.cssList=f,this.computedZindex(),this.updateStyle()}}},{key:"computedIframeDisplay",value:function(t,r){this.inDisplaySceneDir?e.emitter.emit("DispayIframe"):e.emitter.emit("HideIframe")}},{key:"computedZindex",value:function(){var e="z-index: -1;",t=this.cssList.findIndex((function(t){return t===e}));-1!==t&&this.cssList.splice(t,1),(!this.isClicker()||this.isDisableInput)&&this.cssList.push(e)}},{key:"updateStyle",value:function(){this.iframe.style.cssText=this.cssList.join(" ")}},{key:"messageListener",value:function(e){if(ot("<<<",JSON.stringify(e.data)),e.origin===this.iframeOrigin){var t=e.data;switch(t.kind){case"SetAttributes":this.handleSetAttributes(t);break;case"RegisterMagixEvent":this.handleRegisterMagixEvent(t);break;case"RemoveMagixEvent":this.handleRemoveMagixEvent(t);break;case"DispatchMagixEvent":this.handleDispatchMagixEvent(t);break;case"RemoveAllMagixEvent":this.handleRemoveAllMagixEvent();break;case"NextPage":this.handleNextPage();break;case"PrevPage":this.handlePrevPage();break;case"SDKCreate":this.handleSDKCreate();break;case"SetPage":this.handleSetPage(t);break;case"GetAttributes":this.handleGetAttributes();break;case"PageTo":this.handlePageTo(t);break;default:ot("".concat(t.kind," not allow event."))}}}},{key:"handleSDKCreate",value:function(){this.postMessage({kind:"Init",payload:{attributes:this.attributes,roomState:this.displayer.state,currentPage:this.currentPage,observerId:this.displayer.observerId}})}},{key:"handleDispatchMagixEvent",value:function(e){var t=e.payload;this.appManager.safeDispatchMagixEvent(t.event,t.payload)}},{key:"handleSetAttributes",value:function(e){this.setAttributes(e.payload)}},{key:"handleRegisterMagixEvent",value:function(e){var t=this,r=e.payload,n=function(e){e.authorId!==t.displayer.observerId&&t.postMessage({kind:"ReciveMagixEvent",payload:e})};this.magixEventMap.set(r,n),this.displayer.addMagixEventListener(r,n)}},{key:"handleRemoveMagixEvent",value:function(e){var t=e.payload,r=this.magixEventMap.get(t);this.displayer.removeMagixEventListener(t,r)}},{key:"handleNextPage",value:function(){this.manager.canOperate&&(this.manager.nextPage(),this.dispatchMagixEvent("NextPage",{}))}},{key:"handlePrevPage",value:function(){this.manager.canOperate&&(this.manager.prevPage(),this.dispatchMagixEvent("PrevPage",{}))}},{key:"handlePageTo",value:function(e){if(this.manager.canOperate){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;this.manager.setMainViewSceneIndex(t-1),this.dispatchMagixEvent("PageTo",t-1)}}},{key:"handleRemoveAllMagixEvent",value:function(){var e=this;this.magixEventMap.forEach((function(t,r){e.displayer.removeMagixEventListener(r,t)})),this.magixEventMap.clear()}},{key:"handleGetAttributes",value:function(){this.postMessage({kind:"GetAttributes",payload:this.attributes})}},{key:"postMessage",value:function(e){var t;this.iframe&&(null==(t=this.iframe.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))}},{key:"dispatchMagixEvent",value:function(e,t){this.manager.canOperate&&(this.setAttributes({lastEvent:{name:e,payload:t}}),this.displayer.dispatchMagixEvent(e,t))}},{key:"isClicker",value:function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)}},{key:"attributes",get:function(){return this.appManager.store.getIframeBridge()}},{key:"isReplay",get:function(){return this.manager.isReplay}},{key:"callbackName",get:function(){return this.isReplay?"onPlayerStateChanged":"onRoomStateChanged"}},{key:"iframeOrigin",get:function(){if(this.iframe)try{return new URL(this.iframe.src).origin}catch(e){console.warn(e)}}},{key:"currentIndex",get:function(){return this.manager.mainViewSceneIndex}},{key:"currentPage",get:function(){return this.currentIndex+1}},{key:"totalPage",get:function(){return this.manager.mainViewScenesLength}},{key:"readonly",get:function(){return!this.displayer.isWritable}},{key:"inDisplaySceneDir",get:function(){return this.manager.mainViewSceneDir===this.attributes.displaySceneDir}},{key:"isDisableInput",get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs}}],[{key:"onCreate",value:function(t){e.emitter.emit("StartCreate"),e.emitter.emit("OnCreate",t),e.emitter.emit("created")}}]),e}(),X_=$_;X_.kind="IframeBridge",X_.hiddenClass="netless-iframe-brdige-hidden",X_.emitter=new $.default,X_.displayer=null,X_.alreadyCreate=!1;var q_=new Oo({emitter:se}),Q_=function(e){s(g,e);var t,r,n,i,o,a,l,c,h,d,f,p,v=u(g);function g(e){var t;return y(this,g),(t=v.call(this,e)).version="0.4.73",t.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.28",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@hyrious/dts":"^0.2.2","@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.6","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1","side-effect-manager":"0.1.5",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.9.9",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t.emitter=oe,t.viewMode=z.ViewMode.Broadcaster,t.isReplay=z.isPlayer(t.displayer),t._cursorUIDs=[],t.containerSizeRatio=g.containerSizeRatio,g.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.28",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@hyrious/dts":"^0.2.2","@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.6","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1","side-effect-manager":"0.1.5",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.9.9",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t}return b(g,[{key:"bindContainer",value:function(e){var t,r,n,i,o,a;if(z.isRoom(this.displayer)&&this.room.phase!==z.RoomPhase.Connected)throw new Ue;if(g.isCreated&&g.container)g.container.firstChild&&e.appendChild(g.container.firstChild);else if(g.params){var s=g.params,u=g.initContainer(this,e,s);this.boxManager&&this.boxManager.destroy();var l=function(e,t,r,n,i){return new Oi({safeSetAttributes:function(t){return e.safeSetAttributes(t)},getMainView:function(){return e.mainView},updateAppState:function(){var t,r;return null==(r=e.appManager)?void 0:(t=r.store).updateAppState.apply(t,arguments)},canOperate:function(){return e.canOperate},notifyContainerRectUpdate:function(t){var r;return null==(r=e.appManager)?void 0:r.notifyContainerRectUpdate(t)},cleanFocus:function(){var t;return null==(t=e.appManager)?void 0:t.store.cleanFocus()},setAppFocus:function(t){var r;return null==(r=e.appManager)?void 0:r.store.setAppFocus(t,!0)},callbacks:t,emitter:r,boxEmitter:n},i)}(this,oe,se,st,{collectorContainer:s.collectorContainer,collectorStyles:s.collectorStyles,prefersColorScheme:s.prefersColorScheme});this.boxManager=l,null==(t=this.appManager)||t.setBoxManager(l),this.bindMainView(u,s.disableCameraTransform),g.wrapper&&(null==(r=this.cursorManager)||r.setupWrapper(g.wrapper))}se.emit("updateManagerRect"),null==(n=this.appManager)||n.refresh(),null==(i=this.appManager)||i.resetMaximized(),null==(o=this.appManager)||o.resetMinimized(),null==(a=this.appManager)||a.displayerWritableListener(!this.room.isWritable),g.container=e}},{key:"bindCollectorContainer",value:function(e){g.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):g.params&&(g.params.collectorContainer=e)}},{key:"addApp",value:(p=m(regeneratorRuntime.mark((function e(t){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=2;break}return e.abrupt("return",this.appManager.rootDirRemoving?new Promise((function(e,n){se.once("rootDirRemoved").then(m(regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,r._addApp(t);case 3:o=i.sent,e(o),i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),n(i.t0.message);case 10:case"end":return i.stop()}}),i,null,[[0,7]])}))))})):this._addApp(t));case 2:throw new De;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"_addApp",value:(f=m(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=21;break}if(t.kind&&"string"==typeof t.kind){e.next=3;break}throw new je;case 3:return t.src&&"string"==typeof t.src&&_e.register({kind:t.kind,src:t.src}),e.next=6,null==(r=_e.appClasses.get(t.kind))?void 0:r();case 6:if(!((o=e.sent)&&(null==(n=o.config)?void 0:n.singleton)&&this.appManager.appProxies.has(t.kind))){e.next=9;break}throw new Oe;case 9:if(void 0!==(a=this.setupScenePath(t,this.appManager))){e.next=14;break}e.t0=void 0,e.next=18;break;case 14:return null!=(i=null==t?void 0:t.options)&&i.scenePath&&(t.options.scenePath=Ie(t.options.scenePath)),e.next=17,this.appManager.addApp(t,Boolean(a));case 17:e.t0=e.sent;case 18:return e.abrupt("return",e.t0);case 21:throw new De;case 22:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"setupScenePath",value:function(e,t){var r=!1;if(e.options){var n=e.options,i=n.scenePath,o=n.scenes;if(i){if(!function(e){return e.startsWith("/")}(i))throw new Be;for(var a=0,s=Object.keys(this.apps||{});a0&&(this.isDynamicPPT(o)?(r=!0,Me(this.displayer)[i]||ke(this.room,i,o)):Me(this.displayer)[i]||ke(this.room,i,[{name:o[0].name}])),i&&void 0===o&&ke(this.room,i,[{}])}return r}},{key:"setMainViewScenePath",value:(d=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewScenePath(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(h=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewSceneIndex(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"nextPage",value:(c=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex+1)>=this.mainViewScenesLength)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the last page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"prevPage",value:(l=m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex-1)<0)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the first page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"jumpPage",value:(a=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=11;break}if(!(t<0||t>=this.pageState.length)){e.next=5;break}e.t1=(console.warn("[WindowManager]: index ".concat(t," out of range")),!1),e.next=8;break;case 5:return e.next=7,this.appManager.setMainViewSceneIndex(t);case 7:e.t1=!0;case 8:e.t0=e.t1,e.next=12;break;case 11:e.t0=!1;case 12:return e.abrupt("return",e.t0);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"addPage",value:(o=m(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appManager&&(r=null==t?void 0:t.after,n=null==t?void 0:t.scene,r?(i=this.mainViewSceneIndex+1,this.room.putScenes(ne,[n||{}],i)):this.room.putScenes(ne,[n||{}]));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"removePage",value:(i=m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=5;break}return r=void 0===t?this.pageState.index:t,e.abrupt("return",1===this.pageState.length?(console.warn("[WindowManager]: can not remove the last page"),!1):r<0||r>=this.pageState.length?(console.warn("[WindowManager]: index ".concat(t," out of range")),!1):this.appManager.removeSceneByIndex(r));case 5:return e.abrupt("return",!1);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getMainViewScenePath",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewScenePath()}},{key:"getMainViewSceneIndex",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewSceneIndex()}},{key:"setReadonly",value:function(e){var t;this.readonly=e,null==(t=this.boxManager)||t.setReadonly(e),se.emit("setReadonly",e)}},{key:"switchMainViewToWriter",value:function(){var e;return null==(e=this.appManager)?void 0:e.mainViewProxy.mainViewClickHandler()}},{key:"onAppDestroy",value:function(e,t){!function(e,t){se.once(e).then(t)}("destroy-".concat(e),t)}},{key:"onAppEvent",value:function(e,t){return se.on("custom-".concat(e),t)}},{key:"setViewMode",value:function(e){var t,r,n,i;(e===z.ViewMode.Broadcaster||e===z.ViewMode.Follower)&&(this.canOperate&&e===z.ViewMode.Broadcaster&&(null==(t=this.appManager)||t.mainViewProxy.setCameraAndSize()),null==(r=this.appManager)||r.mainViewProxy.start()),e===z.ViewMode.Freedom&&(null==(n=this.appManager)||n.mainViewProxy.stop()),this.viewMode=e,null==(i=this.appManager)||i.mainViewProxy.setViewMode(e)}},{key:"setBoxState",value:function(e){if(this.canOperate)switch(e){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0)}}},{key:"setMaximized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMaximized(e,!1)}},{key:"setMinimized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMinimized(e,!1)}},{key:"setFullscreen",value:function(e){var t;this._fullscreen!==e&&(this._fullscreen=e,null==(t=g.sizer)||t.classList.toggle("netless-window-manager-fullscreen",e),oe.emit("fullscreenChange",e))}},{key:"setCursorUIDs",value:function(e){var t,r;if(this._cursorUIDs=e||[],0===this._cursorUIDs.length)null==(t=this._cursorUIDsStyleDOM)||t.remove();else{this._cursorUIDsStyleDOM||(this._cursorUIDsStyleDOM=document.createElement("style")),null==(r=g.playground)||r.appendChild(this._cursorUIDsStyleDOM);var n,i="[data-cursor-uid] { display: none }",o=S(this._cursorUIDs);try{for(o.s();!(n=o.n()).done;){var a=n.value;i+='\n[data-cursor-uid="'.concat(a,'"] { display: flex }')}}catch(e){o.e(e)}finally{o.f()}this._cursorUIDsStyleDOM.textContent=i}}},{key:"queryAll",value:function(){var e;return Array.from((null==(e=this.appManager)?void 0:e.appProxies.values())||[])}},{key:"queryOne",value:function(e){var t;return null==(t=this.appManager)?void 0:t.appProxies.get(e)}},{key:"closeApp",value:(n=m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null==(r=this.appManager)?void 0:r.closeApp(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"focusApp",value:function(e){var t,r,n,i=null==(t=this.boxManager)?void 0:t.getBox(e);i&&(null==(r=this.boxManager)||r.focusBox({appId:e},!1),(null==(n=this.boxManager)?void 0:n.teleBoxManager).makeBoxTop(i,!1))}},{key:"moveCamera",value:function(e){var t,r=this,n=j.omit(e,["animationMode"]),i=O({},this.mainView.camera);j.isEqual(O(O({},i),n),i)||(this.mainView.moveCamera(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCamera,e),setTimeout((function(){var e;null==(e=r.appManager)||e.mainViewProxy.setCameraAndSize()}),500))}},{key:"moveCameraToContain",value:function(e){var t,r=this;this.mainView.moveCameraToContain(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCameraToContain,e),setTimeout((function(){var e;null==(e=r.appManager)||e.mainViewProxy.setCameraAndSize()}),500)}},{key:"convertToPointInWorld",value:function(e){return this.mainView.convertToPointInWorld(e)}},{key:"setCameraBound",value:function(e){this.mainView.setCameraBound(e)}},{key:"onDestroy",value:function(){this._destroy()}},{key:"destroy",value:function(){this._destroy()}},{key:"_destroy",value:function(){var e,t,r,n,i;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(r=this.cursorManager)||r.destroy(),g.container=void 0,g.wrapper=void 0,g.sizer=void 0,g.isCreated=!1,g.playground&&(null==(n=g.playground.parentNode)||n.removeChild(g.playground)),g.params=void 0,null==(i=this._iframeBridge)||i.destroy(),this._iframeBridge=void 0,ot("Destroyed")}},{key:"bindMainView",value:function(e,t){var r;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),null==(r=this.cursorManager)||r.setMainViewDivElement(e))}},{key:"safeSetAttributes",value:function(e){this.canOperate&&this.setAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.canOperate&&this.updateAttributes(e,t)}},{key:"setPrefersColorScheme",value:function(e){var t,r;null==(r=null==(t=this.appManager)?void 0:t.boxManager)||r.setPrefersColorScheme(e)}},{key:"cleanCurrentScene",value:function(){var e;ot("clean current scene"),null==(e=this.focusedView)||e.cleanCurrentScene()}},{key:"redo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.redo())||0}},{key:"undo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.undo())||0}},{key:"delete",value:function(){var e;null==(e=this.focusedView)||e.delete()}},{key:"copy",value:function(){var e;null==(e=this.focusedView)||e.copy()}},{key:"paste",value:function(){var e;null==(e=this.focusedView)||e.paste()}},{key:"duplicate",value:function(){var e;null==(e=this.focusedView)||e.duplicate()}},{key:"insertText",value:function(e,t,r){var n;return(null==(n=this.focusedView)?void 0:n.insertText(e,t,r))||""}},{key:"insertImage",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.insertImage(e)}},{key:"completeImageUpload",value:function(e,t){var r;return null==(r=this.focusedView)?void 0:r.completeImageUpload(e,t)}},{key:"lockImage",value:function(e,t){var r;return null==(r=this.focusedView)?void 0:r.lockImage(e,t)}},{key:"lockImages",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.lockImages(e)}},{key:"refresh",value:function(){var e;this._refresh(),null==(e=this.appManager)||e.dispatchInternalEvent(q.Refresh)}},{key:"_refresh",value:function(){var e,t;null==(e=this.appManager)||e.mainViewProxy.rebind(),g.container&&this.bindContainer(g.container),null==(t=this.appManager)||t.refresher.refresh()}},{key:"setContainerSizeRatio",value:function(e){if(!(j.isNumber(e)&&e>0))throw new Error("[WindowManager]: updateContainerSizeRatio error, ratio must be a positive number. but got ".concat(e));g.containerSizeRatio=e,this.containerSizeRatio=e,se.emit("containerSizeRatioUpdate",e)}},{key:"isDynamicPPT",value:function(e){var t,r,n=null==(r=null==(t=e[0])?void 0:t.ppt)?void 0:r.src;return null==n?void 0:n.startsWith("pptx://")}},{key:"ensureAttributes",value:(r=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=j.isNull(this.attributes),!e.t0){e.next=4;break}return e.next=4,Ce(50);case 4:j.isObject(this.attributes)&&(this.attributes[nt.Apps]||this.safeSetAttributes(w({},nt.Apps,{})),this.attributes[nt.Cursors]||this.safeSetAttributes(w({},nt.Cursors,{})),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:ie}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[nt.Registered]||this.safeSetAttributes(w({},nt.Registered,{})),this.attributes[nt.IframeBridge]||this.safeSetAttributes(w({},nt.IframeBridge,{})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getIframeBridge",value:function(){if(!this.appManager)throw new Error("[WindowManager]: should call getIframeBridge() after await mount()");return this._iframeBridge||(this._iframeBridge=new X_(this,this.appManager)),this._iframeBridge}},{key:"cursorUIDs",get:function(){return this._cursorUIDs}},{key:"mainView",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new De}},{key:"camera",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new De}},{key:"cameraState",get:function(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new De}},{key:"apps",get:function(){var e;return null==(e=this.appManager)?void 0:e.store.apps()}},{key:"boxState",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.boxState;throw new De}},{key:"darkMode",get:function(){var e,t;return Boolean(null==(t=null==(e=this.appManager)?void 0:e.boxManager)?void 0:t.darkMode)}},{key:"prefersColorScheme",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.prefersColorScheme;throw new De}},{key:"focused",get:function(){return this.attributes.focus}},{key:"focusedView",get:function(){var e,t;return(null==(t=null==(e=this.appManager)?void 0:e.focusApp)?void 0:t.view)||this.mainView}},{key:"polling",get:function(){var e;return(null==(e=this.appManager)?void 0:e.polling)||!1},set:function(e){this.appManager&&(this.appManager.polling=e)}},{key:"cursorStyle",get:function(){var e;return(null==(e=this.cursorManager)?void 0:e.style)||"default"},set:function(e){if(!this.cursorManager)throw new Error("[WindowManager]: cursor is not enabled, please set { cursor: true }.");this.cursorManager.style=e}},{key:"mainViewSceneIndex",get:function(){var e;return(null==(e=this._pageState)?void 0:e.index)||0}},{key:"mainViewSceneDir",get:function(){var e;if(this.appManager)return null==(e=this.appManager)?void 0:e.getMainViewSceneDir();throw new De}},{key:"topApp",get:function(){var e,t;return null==(t=null==(e=this.boxManager)?void 0:e.getTopBox())?void 0:t.id}},{key:"mainViewScenesLength",get:function(){var e;return(null==(e=this._pageState)?void 0:e.length)||0}},{key:"canRedoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canRedoSteps)||0}},{key:"canUndoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canUndoSteps)||0}},{key:"sceneState",get:function(){if(this.appManager)return this.appManager.sceneState;throw new De}},{key:"pageState",get:function(){if(this._pageState)return this._pageState.toObject();throw new De}},{key:"fullscreen",get:function(){return Boolean(this._fullscreen)}},{key:"canOperate",get:function(){return!!z.isRoom(this.displayer)&&(this.displayer.isWritable&&this.displayer.phase===z.RoomPhase.Connected)}},{key:"room",get:function(){return this.displayer}}],[{key:"onCreate",value:function(e){g._resolve(e)}},{key:"mount",value:(t=m(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.room,g.container=t.container,g.supportAppliancePlugin=t.supportAppliancePlugin,n=t.containerSizeRatio,i=t.debug,o=t.cursor,g.params=t,g.displayer=t.room,vt(),!z.isRoom(r)){e.next=11;break}if(r.phase===z.RoomPhase.Connected){e.next=7;break}throw new Error("[WindowManager]: Room only Connected can be mount");case 7:return r.phase===z.RoomPhase.Connected&&r.isWritable&&(r.disableSerialization=!1),e.next=10,this.initManager(r);case 10:a=e.sent;case 11:if(!g.isCreated){e.next=13;break}throw new Error("[WindowManager]: Already created cannot be created again");case 13:if(this.debug=Boolean(i),this.debug&&qy({verbose:!0}),ot("Already insert room",a),!z.isRoom(this.displayer)){e.next=18;break}if(a){e.next=16;break}throw new Error("[WindowManager]: init InvisiblePlugin failed");case 16:e.next=20;break;case 18:return e.next=20,Y.default(function(){var e=m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.getInvisiblePlugin(g.kind)){e.next=2;break}throw ot("manager is empty. retrying ".concat(t)),new Error;case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),{retries:10,maxTimeout:5e3});case 20:if(a){e.next=22;break}throw new Error("[WindowManager]: create manager failed");case 22:return n&&(g.containerSizeRatio=n),e.next=25,a.ensureAttributes();case 25:return a._fullscreen=t.fullscreen,a.appManager=new pt(a),a.appManager.polling=t.polling||!1,a._pageState=new No(a.appManager),a.cursorManager=new Po(a.appManager,Boolean(o),t.cursorOptions,t.applianceIcons),n&&(a.containerSizeRatio=n),t.container&&a.bindContainer(t.container),Ro(r,a),se.emit("onCreated"),g.isCreated=!0,e.prev=35,e.next=38,ue();case 38:e.next=43;break;case 40:e.prev=40,e.t0=e.catch(35),console.warn("[WindowManager]: indexedDB open failed"),console.log(e.t0);case 43:return e.abrupt("return",a);case 44:case"end":return e.stop()}}),e,this,[[35,40]])}))),function(e){return t.apply(this,arguments)})},{key:"initManager",value:function(e){return mt(e)}},{key:"initContainer",value:function(e,t,r){var n=r.chessboard,i=r.overwriteStyles,o=r.fullscreen;g.container||(g.container=t);var a=function(e){var t=document.createElement("div");t.className="netless-window-manager-playground";var r=document.createElement("div");r.className="netless-window-manager-sizer";var n=document.createElement("div");n.className="netless-window-manager-wrapper";var i=document.createElement("div");return i.className="netless-window-manager-main-view",t.appendChild(r),r.appendChild(n),n.appendChild(i),e.appendChild(t),Z_.wrapper=n,{playground:t,wrapper:n,sizer:r,mainViewElement:i}}(t),s=a.playground,u=a.wrapper,l=a.sizer,c=a.mainViewElement;if(g.playground=s,n&&l.classList.add("netless-window-manager-chess-sizer"),o&&l.classList.add("netless-window-manager-fullscreen"),i){var h=document.createElement("style");h.textContent=i,s.appendChild(h)}return e.containerResizeObserver=bt.create(s,l,u,se),g.wrapper=u,g.sizer=l,c}},{key:"register",value:function(e){return _e.register(e)}},{key:"unregister",value:function(e){return _e.unregister(e)}},{key:"registered",get:function(){return _e.registered}}]),g}(z.InvisiblePlugin),Z_=Q_;Z_.kind="WindowManager",Z_.debug=!1,Z_.containerSizeRatio=9/16,Z_.isCreated=!1,Z_._resolve=function(e){},Z_.debug&&qy({verbose:!0}),Z_.register({kind:Du.kind,src:Du}),Z_.register({kind:D_.kind,src:D_}),t.AppCreateError=Oe,t.AppManagerNotInitError=De,t.AppNotRegisterError=Re,t.BindContainerRoomPhaseInvalidError=Ue,t.BoxManagerNotFoundError=Fe,t.BoxNotCreatedError=ze,t.BuiltinApps=L_,t.DomEvents=z_,t.IframeBridge=X_,t.IframeEvents=j_,t.InvalidScenePath=Be,t.ParamsInvalidError=je,t.WhiteWebSDKInvalidError=Le,t.WindowManager=Z_,t.calculateNextIndex=at,t.reconnectRefresher=q_},6513:function(e,t,r){var n=r(49766).Buffer;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.xml2json=t.xml2js=t.json2xml=t.js2xml=void 0;var a=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],u=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c=!1;function h(){c=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}function f(e){var t;c||h();for(var r=e.length,n=r%3,i="",o=[],a=16383,u=0,l=r-n;ul?l:u+a));return 1===n?(t=e[r-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}function p(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)}function v(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[r+f]=255&a,f+=p,a/=256,l-=8);e[r+f-p]|=128*v}var g={}.toString,m=Array.isArray||function(e){return"[object Array]"==g.call(e)};function y(){return b.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(e,t){if(y()=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return 0|e}function k(e){return!(null==e||!e._isBuffer)}function E(e,t){if(k(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ee(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return te(e).length;default:if(n)return ee(e).length;t=(""+t).toLowerCase(),n=!0}}function I(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return G(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return U(this,t,r);case"latin1":case"binary":return W(this,t,r);case"base64":return z(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function A(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function C(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=b.from(t,n)),k(t))return 0===t.length?-1:P(e,t,r,n,i);if("number"==typeof t)return t&=255,b.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):P(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function P(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function z(e,t,r){return 0===t&&r===e.length?f(e):f(e.slice(t,r))}function B(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=F)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},b.prototype.compare=function(e,t,r,n,i){if(!k(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return N(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":return R(this,e,t,r);case"latin1":case"binary":return D(this,e,t,r);case"base64":return L(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var F=4096;function U(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function Y(e,t,r,n,i,o){if(!k(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function $(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function X(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function q(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Q(e,t,r,n,i){return i||q(e,0,r,4),v(e,t,r,n,23,4),r+4}function Z(e,t,r,n,i){return i||q(e,0,r,8),v(e,t,r,n,52,8),r+8}b.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},b.prototype.readUInt8=function(e,t){return t||H(e,1,this.length),this[e]},b.prototype.readUInt16LE=function(e,t){return t||H(e,2,this.length),this[e]|this[e+1]<<8},b.prototype.readUInt16BE=function(e,t){return t||H(e,2,this.length),this[e]<<8|this[e+1]},b.prototype.readUInt32LE=function(e,t){return t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},b.prototype.readUInt32BE=function(e,t){return t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},b.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},b.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},b.prototype.readInt8=function(e,t){return t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},b.prototype.readInt16LE=function(e,t){t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt16BE=function(e,t){t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt32LE=function(e,t){return t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},b.prototype.readInt32BE=function(e,t){return t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},b.prototype.readFloatLE=function(e,t){return t||H(e,4,this.length),p(this,e,!0,23,4)},b.prototype.readFloatBE=function(e,t){return t||H(e,4,this.length),p(this,e,!1,23,4)},b.prototype.readDoubleLE=function(e,t){return t||H(e,8,this.length),p(this,e,!0,52,8)},b.prototype.readDoubleBE=function(e,t){return t||H(e,8,this.length),p(this,e,!1,52,8)},b.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Y(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},b.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,1,255,0),b.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},b.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},b.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},b.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):X(this,e,t,!0),t+4},b.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):X(this,e,t,!1),t+4},b.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Y(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},b.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Y(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},b.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,1,127,-128),b.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},b.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},b.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},b.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,2147483647,-2147483648),b.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):X(this,e,t,!0),t+4},b.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):X(this,e,t,!1),t+4},b.prototype.writeFloatLE=function(e,t,r){return Q(this,e,t,!0,r)},b.prototype.writeFloatBE=function(e,t,r){return Q(this,e,t,!1,r)},b.prototype.writeDoubleLE=function(e,t,r){return Z(this,e,t,!0,r)},b.prototype.writeDoubleBE=function(e,t,r){return Z(this,e,t,!1,r)},b.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!b.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function te(e){return function(e){var t,r,n,i,o,a;c||h();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new l(3*s/4-o),n=o>0?s-4:s;var d=0;for(t=0,r=0;t>16&255,a[d++]=i>>8&255,a[d++]=255&i;return 2===o?(i=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,a[d++]=255&i):1===o&&(i=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,a[d++]=i>>8&255,a[d++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function re(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ne(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ie={};function oe(){}function ae(){ae.init.call(this)}function se(e){return void 0===e._maxListeners?ae.defaultMaxListeners:e._maxListeners}function ue(e,t,r){if(t)e.call(r);else for(var n=e.length,i=ge(e,n),o=0;o0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function pe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function ve(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function ge(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function me(){throw new Error("setTimeout has not been defined")}function ye(){throw new Error("clearTimeout has not been defined")}oe.prototype=Object.create(null),ae.EventEmitter=ae,ae.usingDomains=!1,ae.prototype.domain=void 0,ae.prototype._events=void 0,ae.prototype._maxListeners=void 0,ae.defaultMaxListeners=10,ae.init=function(){this.domain=null,ae.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new oe,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ae.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ae.prototype.getMaxListeners=function(){return se(this)},ae.prototype.emit=function(e){var t,r,n,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:ue(r,c,this);break;case 2:le(r,c,this,arguments[1]);break;case 3:ce(r,c,this,arguments[1],arguments[2]);break;case 4:he(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new oe,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var _e=me,be=ye;function xe(e){if(_e===setTimeout)return setTimeout(e,0);if((_e===me||!_e)&&setTimeout)return _e=setTimeout,setTimeout(e,0);try{return _e(e,0)}catch(t){try{return _e.call(null,e,0)}catch(t){return _e.call(this,e,0)}}}"function"==typeof a.setTimeout&&(_e=setTimeout),"function"==typeof a.clearTimeout&&(be=clearTimeout);var we,Se=[],Te=!1,Me=-1;function ke(){Te&&we&&(Te=!1,we.length?Se=we.concat(Se):Me=-1,Se.length&&Ee())}function Ee(){if(!Te){var e=xe(ke);Te=!0;for(var t=Se.length;t;){for(we=Se,Se=[];++Me1)for(var r=1;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),et(t)?r.showHidden=t:t&&ct(r,t),nt(r.showHidden)&&(r.showHidden=!1),nt(r.depth)&&(r.depth=2),nt(r.colors)&&(r.colors=!1),nt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=qe),Ze(r,e,r.depth)}function qe(e,t){var r=Xe.styles[t];return r?"["+Xe.colors[r][0]+"m"+e+"["+Xe.colors[r][1]+"m":e}function Qe(e,t){return e}function Ze(e,t,r){if(e.customInspect&&t&&ut(t.inspect)&&t.inspect!==Xe&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return rt(n)||(n=Ze(e,n,r)),n}var i=function(e,t){if(nt(t))return e.stylize("undefined","undefined");if(rt(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(et(t))return e.stylize(""+t,"boolean");if(tt(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),st(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ke(t);if(0===o.length){if(ut(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(it(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(at(t))return e.stylize(Date.prototype.toString.call(t),"date");if(st(t))return Ke(t)}var u,l,c="",h=!1,d=["{","}"];(u=t,Array.isArray(u)&&(h=!0,d=["[","]"]),ut(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return it(t)&&(c=" "+RegExp.prototype.toString.call(t)),at(t)&&(c=" "+Date.prototype.toUTCString.call(t)),st(t)&&(c=" "+Ke(t)),0!==o.length||h&&0!=t.length?r<0?it(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=h?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,d)):d[0]+c+d[1]}function Ke(e){return"["+Error.prototype.toString.call(e)+"]"}function Je(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),ht(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=tt(r)?Ze(e,u.value,null):Ze(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),nt(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function et(e){return"boolean"==typeof e}function tt(e){return null===e}function rt(e){return"string"==typeof e}function nt(e){return void 0===e}function it(e){return ot(e)&&"[object RegExp]"===lt(e)}function ot(e){return"object"===i(e)&&null!==e}function at(e){return ot(e)&&"[object Date]"===lt(e)}function st(e){return ot(e)&&("[object Error]"===lt(e)||e instanceof Error)}function ut(e){return"function"==typeof e}function lt(e){return Object.prototype.toString.call(e)}function ct(e,t){if(!t||!ot(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function ht(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dt(){this.head=null,this.tail=null,this.length=0}Xe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Xe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},dt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},dt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},dt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},dt.prototype.clear=function(){this.head=this.tail=null,this.length=0},dt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},dt.prototype.concat=function(e){if(0===this.length)return b.alloc(0);if(1===this.length)return this.head.data;for(var t=b.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var ft=b.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pt(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!ft(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=gt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=mt;break;default:return void(this.write=vt)}this.charBuffer=new b(6),this.charReceived=0,this.charLength=0}function vt(e){return e.toString(this.encoding)}function gt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function mt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}pt.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},pt.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},pt.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t};var yt=Object.freeze({__proto__:null,StringDecoder:pt});xt.ReadableState=bt;var _t=function(e){if(nt(Ye)&&(Ye=Ue.env.NODE_DEBUG||""),e=e.toUpperCase(),!$e[e])if(new RegExp("\\b"+e+"\\b","i").test(Ye)){$e[e]=function(){var t=Ve.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else $e[e]=function(){};return $e[e]}("stream");function bt(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof qt&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new dt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new pt(e.encoding),this.encoding=e.encoding)}function xt(e){if(!(this instanceof xt))return new xt(e);this._readableState=new bt(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ae.call(this)}function wt(e,t,r,n,i){var o=function(e,t){var r=null;b.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Mt(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||n||(r=t.decoder.write(r),u=!t.objectMode&&0===r.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Mt(e))),function(e,t){t.readingMore||(t.readingMore=!0,Ie(Et,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=St?e=St:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Mt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_t("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ie(kt,e):kt(e))}function kt(e){_t("emit readable"),e.emit("readable"),Ct(e)}function Et(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=b.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function Nt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ie(Ot,t,e))}function Ot(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Rt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return _t("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Nt(this):Mt(this),null;if(0===(e=Tt(e,t))&&t.ended)return 0===t.length&&Nt(this),null;var n,i=t.needReadable;return _t("need readable",i),(0===t.length||t.length-e0?Pt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Nt(this)),null!==n&&this.emit("data",n),n},xt.prototype._read=function(e){this.emit("error",new Error("not implemented"))},xt.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,_t("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){_t("onunpipe"),e===r&&l()}function a(){_t("onend"),e.end()}n.endEmitted?Ie(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;_t("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,Ct(e))}}(r);e.on("drain",s);var u=!1;function l(){_t("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",l),r.removeListener("data",h),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var c=!1;function h(t){_t("ondata"),c=!1,!1!==e.write(t)||c||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Rt(n.pipes,e))&&!u&&(_t("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function d(t){var r;_t("onerror",t),v(),e.removeListener("error",d),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function f(){e.removeListener("finish",p),v()}function p(){_t("onfinish"),e.removeListener("close",f),v()}function v(){_t("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",r),n.flowing||(_t("pipe resume"),r.resume()),e},xt.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},zt.prototype._write=function(e,t,r){r(new Error("not implemented"))},zt.prototype._writev=null,zt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Vt(e,t),r&&(t.finished?Ie(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},We(qt,xt);for(var Yt=Object.keys(zt.prototype),$t=0;$t"===a?(k(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=S.TEXT):v(a)?(n.state=S.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case S.SGML_DECL_QUOTED:a===n.q&&(n.state=S.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case S.DOCTYPE:">"===a?(n.state=S.TEXT,k(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=S.DOCTYPE_DTD:v(a)&&(n.state=S.DOCTYPE_QUOTED,n.q=a));continue;case S.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:n.doctype+=a,"]"===a?n.state=S.DOCTYPE:v(a)&&(n.state=S.DOCTYPE_DTD_QUOTED,n.q=a);continue;case S.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=S.DOCTYPE_DTD,n.q="");continue;case S.COMMENT:"-"===a?n.state=S.COMMENT_ENDING:n.comment+=a;continue;case S.COMMENT_ENDING:"-"===a?(n.state=S.COMMENT_ENDED,n.comment=I(n.opt,n.comment),n.comment&&k(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==a?(P(n,"Malformed comment"),n.comment+="--"+a,n.state=S.COMMENT):n.state=S.TEXT;continue;case S.CDATA:"]"===a?n.state=S.CDATA_ENDING:n.cdata+=a;continue;case S.CDATA_ENDING:"]"===a?n.state=S.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===a?(n.cdata&&k(n,"oncdata",n.cdata),k(n,"onclosecdata"),n.cdata="",n.state=S.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=S.CDATA);continue;case S.PROC_INST:"?"===a?n.state=S.PROC_INST_ENDING:p(a)?n.state=S.PROC_INST_BODY:n.procInstName+=a;continue;case S.PROC_INST_BODY:if(!n.procInstBody&&p(a))continue;"?"===a?n.state=S.PROC_INST_ENDING:n.procInstBody+=a;continue;case S.PROC_INST_ENDING:">"===a?(k(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=S.TEXT):(n.procInstBody+="?"+a,n.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:m(h,a)?n.tagName+=a:(N(n),">"===a?D(n):"/"===a?n.state=S.OPEN_TAG_SLASH:(p(a)||P(n,"Invalid character in tag name"),n.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===a?(D(n,!0),L(n)):(P(n,"Forward-slash in opening tag not followed by >"),n.state=S.ATTRIB);continue;case S.ATTRIB:if(p(a))continue;">"===a?D(n):"/"===a?n.state=S.OPEN_TAG_SLASH:m(c,a)?(n.attribName=a,n.attribValue="",n.state=S.ATTRIB_NAME):P(n,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===a?n.state=S.ATTRIB_VALUE:">"===a?(P(n,"Attribute without value"),n.attribValue=n.attribName,R(n),D(n)):p(a)?n.state=S.ATTRIB_NAME_SAW_WHITE:m(h,a)?n.attribName+=a:P(n,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=S.ATTRIB_VALUE;else{if(p(a))continue;P(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",k(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?D(n):m(c,a)?(n.attribName=a,n.state=S.ATTRIB_NAME):(P(n,"Invalid attribute name"),n.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(p(a))continue;v(a)?(n.q=a,n.state=S.ATTRIB_VALUE_QUOTED):(P(n,"Unquoted attribute value"),n.state=S.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case S.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=S.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}R(n),n.q="",n.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:p(a)?n.state=S.ATTRIB:">"===a?D(n):"/"===a?n.state=S.OPEN_TAG_SLASH:m(c,a)?(P(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=S.ATTRIB_NAME):P(n,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!g(a)){"&"===a?n.state=S.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}R(n),">"===a?D(n):n.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(n.tagName)">"===a?L(n):m(h,a)?n.tagName+=a:n.script?(n.script+=""===a?L(n):P(n,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var l,_;switch(n.state){case S.TEXT_ENTITY:l=S.TEXT,_="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:l=S.ATTRIB_VALUE_QUOTED,_="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:l=S.ATTRIB_VALUE_UNQUOTED,_="attribValue"}";"===a?(n[_]+=j(n),n.entity="",n.state=l):m(n.entity.length?f:d,a)?n.entity+=a:(P(n,"Invalid character in entity name"),n[_]+="&"+n.entity+a,n.entity="",n.state=l);continue;default:throw new Error(n,"Unknown state: "+n.state)}n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,o=0,a=r.length;on)switch(r[o]){case"textNode":E(t);break;case"cdata":k(t,"oncdata",t.cdata),t.cdata="";break;case"script":k(t,"onscript",t.script),t.script="";break;default:A(t,"Max buffer length exceeded: "+r[o])}i=Math.max(i,s)}var u=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=u+t.position}(n);return n} -/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;E(e=this),""!==e.cdata&&(k(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(k(e,"onscript",e.script),e.script="")}};try{t=nr.Stream}catch(e){t=function(){}}var o=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,r){if(!(this instanceof a))return new a(e,r);t.apply(this),this._parser=new n(e,r),this.writable=!0,this.readable=!0;var i=this;this._parser.onend=function(){i.emit("end")},this._parser.onerror=function(e){i.emit("error",e),i._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(i,"on"+e,{get:function(){return i._parser["on"+e]},set:function(t){if(!t)return i.removeAllListeners(e),i._parser["on"+e]=t,t;i.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof b.isBuffer&&b.isBuffer(e)){if(!this._decoder){var t=ir.StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,r){var n=this;return n._parser["on"+e]||-1===o.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),t.prototype.on.call(n,e,r)};var s="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",l={xml:s,xmlns:u},c=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function v(e){return'"'===e||"'"===e}function g(e){return">"===e||p(e)}function m(e,t){return e.test(t)}function y(e,t){return!m(e,t)}var _,x,w,S=0;for(var T in e.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var r=e.ENTITIES[t],n="number"==typeof r?String.fromCharCode(r):r;e.ENTITIES[t]=n})),e.STATE)e.STATE[e.STATE[T]]=T;function M(e,t,r){e[t]&&e[t](r)}function k(e,t,r){e.textNode&&E(e),M(e,t,r)}function E(e){e.textNode=I(e.opt,e.textNode),e.textNode&&M(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function A(e,t){return E(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,M(e,"onerror",t),e}function C(e){return e.sawRoot&&!e.closedRoot&&P(e,"Unclosed root tag"),e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT&&A(e,"Unexpected end"),E(e),e.c="",e.closed=!0,M(e,"onend"),n.call(e,e.strict,e.opt),e}function P(e,t){if("object"!==i(e)||!(e instanceof n))throw new Error("bad call to strictFail");e.strict&&A(e,t)}function N(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,k(e,"onopentagstart",r)}function O(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],i=r[1];return t&&"xmlns"===e&&(n="xmlns",i=""),{prefix:n,local:i}}function R(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=O(e.attribName,!0),r=t.prefix,n=t.local;if("xmlns"===r)if("xml"===n&&e.attribValue!==s)P(e,"xml: prefix must be bound to "+s+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==u)P(e,"xmlns: prefix must be bound to "+u+"\nActual: "+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,k(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var r=e.tag,n=O(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(P(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix);var i=e.tags[e.tags.length-1]||e;r.ns&&i.ns!==r.ns&&Object.keys(r.ns).forEach((function(t){k(e,"onopennamespace",{prefix:t,uri:r.ns[t]})}));for(var o=0,a=e.attribList.length;o",e.tagName="",void(e.state=S.SCRIPT);k(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--;){if(e.tags[t].name===n)break;P(e,"Unexpected close tag")}if(t<0)return P(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=S.TEXT);e.tagName=r;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,k(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==u.ns&&Object.keys(o.ns).forEach((function(t){var r=o.ns[t];k(e,"onclosenamespace",{prefix:t,uri:r})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=S.TEXT}function j(e){var t,r=e.entity,n=r.toLowerCase(),i="";return e.ENTITIES[r]?e.ENTITIES[r]:e.ENTITIES[n]?e.ENTITIES[n]:("#"===(r=n).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),i=(t=parseInt(r,16)).toString(16)):(r=r.slice(1),i=(t=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==r?(P(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function z(e,t){"<"===t?(e.state=S.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(P(e,"Non-whitespace before first tag."),e.textNode=t,e.state=S.TEXT)}function B(e,t){var r="";return t1114111||x(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(i+1===o||n.length>r)&&(a+=_.apply(null,n),n.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(e)}(ie);var or,ar,sr=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},ur=sr,lr={copyOptions:function(e){var t,r={};for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r},ensureFlagExists:function(e,t){e in t&&"boolean"==typeof t[e]||(t[e]=!1)},ensureSpacesExists:function(e){(!("spaces"in e)||"number"!=typeof e.spaces&&"string"!=typeof e.spaces)&&(e.spaces=0)},ensureAlwaysArrayExists:function(e){"alwaysArray"in e&&("boolean"==typeof e.alwaysArray||ur(e.alwaysArray))||(e.alwaysArray=!1)},ensureKeyExists:function(e,t){e+"Key"in t&&"string"==typeof t[e+"Key"]||(t[e+"Key"]=t.compact?"_"+e:e)},checkFnExists:function(e,t){return e+"Fn"in t}},cr=ie,hr=lr,dr=sr;function fr(e){var t=Number(e);if(!isNaN(t))return t;var r=e.toLowerCase();return"true"===r||"false"!==r&&e}function pr(e,t){var r;if(or.compact){if(!ar[or[e+"Key"]]&&(dr(or.alwaysArray)?-1!==or.alwaysArray.indexOf(or[e+"Key"]):or.alwaysArray)&&(ar[or[e+"Key"]]=[]),ar[or[e+"Key"]]&&!dr(ar[or[e+"Key"]])&&(ar[or[e+"Key"]]=[ar[or[e+"Key"]]]),e+"Fn"in or&&"string"==typeof t&&(t=or[e+"Fn"](t,ar)),"instruction"===e&&("instructionFn"in or||"instructionNameFn"in or))for(r in t)if(t.hasOwnProperty(r))if("instructionFn"in or)t[r]=or.instructionFn(t[r],r,ar);else{var n=t[r];delete t[r],t[or.instructionNameFn(r,n,ar)]=n}dr(ar[or[e+"Key"]])?ar[or[e+"Key"]].push(t):ar[or[e+"Key"]]=t}else{ar[or.elementsKey]||(ar[or.elementsKey]=[]);var i={};if(i[or.typeKey]=e,"instruction"===e){for(r in t)if(t.hasOwnProperty(r))break;i[or.nameKey]="instructionNameFn"in or?or.instructionNameFn(r,t,ar):r,or.instructionHasAttributes?(i[or.attributesKey]=t[r][or.attributesKey],"instructionFn"in or&&(i[or.attributesKey]=or.instructionFn(i[or.attributesKey],r,ar))):("instructionFn"in or&&(t[r]=or.instructionFn(t[r],r,ar)),i[or.instructionKey]=t[r])}else e+"Fn"in or&&(t=or[e+"Fn"](t,ar)),i[or[e+"Key"]]=t;or.addParent&&(i[or.parentKey]=ar),ar[or.elementsKey].push(i)}}function vr(e){var t;if("attributesFn"in or&&e&&(e=or.attributesFn(e,ar)),(or.trim||"attributeValueFn"in or||"attributeNameFn"in or||or.nativeTypeAttributes)&&e)for(t in e)if(e.hasOwnProperty(t)&&(or.trim&&(e[t]=e[t].trim()),or.nativeTypeAttributes&&(e[t]=fr(e[t])),"attributeValueFn"in or&&(e[t]=or.attributeValueFn(e[t],t,ar)),"attributeNameFn"in or)){var r=e[t];delete e[t],e[or.attributeNameFn(t,e[t],ar)]=r}return e}function gr(e){var t={};if(e.body&&("xml"===e.name.toLowerCase()||or.instructionHasAttributes)){for(var r,n=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(r=n.exec(e.body));)t[r[1]]=r[2]||r[3]||r[4];t=vr(t)}if("xml"===e.name.toLowerCase()){if(or.ignoreDeclaration)return;ar[or.declarationKey]={},Object.keys(t).length&&(ar[or.declarationKey][or.attributesKey]=t),or.addParent&&(ar[or.declarationKey][or.parentKey]=ar)}else{if(or.ignoreInstruction)return;or.trim&&(e.body=e.body.trim());var i={};or.instructionHasAttributes&&Object.keys(t).length?(i[e.name]={},i[e.name][or.attributesKey]=t):i[e.name]=e.body,pr("instruction",i)}}function mr(e,t){var r;if("object"===i(e)&&(t=e.attributes,e=e.name),t=vr(t),"elementNameFn"in or&&(e=or.elementNameFn(e,ar)),or.compact){var n;if(r={},!or.ignoreAttributes&&t&&Object.keys(t).length)for(n in r[or.attributesKey]={},t)t.hasOwnProperty(n)&&(r[or.attributesKey][n]=t[n]);!(e in ar)&&(dr(or.alwaysArray)?-1!==or.alwaysArray.indexOf(e):or.alwaysArray)&&(ar[e]=[]),ar[e]&&!dr(ar[e])&&(ar[e]=[ar[e]]),dr(ar[e])?ar[e].push(r):ar[e]=r}else ar[or.elementsKey]||(ar[or.elementsKey]=[]),(r={})[or.typeKey]="element",r[or.nameKey]=e,!or.ignoreAttributes&&t&&Object.keys(t).length&&(r[or.attributesKey]=t),or.alwaysChildren&&(r[or.elementsKey]=[]),ar[or.elementsKey].push(r);r[or.parentKey]=ar,ar=r}function yr(e){or.ignoreText||(e.trim()||or.captureSpacesBetweenElements)&&(or.trim&&(e=e.trim()),or.nativeType&&(e=fr(e)),or.sanitize&&(e=e.replace(/&/g,"&").replace(//g,">")),pr("text",e))}function _r(e){or.ignoreComment||(or.trim&&(e=e.trim()),pr("comment",e))}function br(e){var t=ar[or.parentKey];or.addParent||delete ar[or.parentKey],ar=t}function xr(e){or.ignoreCdata||(or.trim&&(e=e.trim()),pr("cdata",e))}function wr(e){or.ignoreDoctype||(e=e.replace(/^ /,""),or.trim&&(e=e.trim()),pr("doctype",e))}function Sr(e){e.note=e,"onErrorFn"in or&&or.onErrorFn(e)}var Tr=function(e,t){var r=cr.parser(!0,{}),n={};ar=n,or=function(e){return or=hr.copyOptions(e),hr.ensureFlagExists("ignoreDeclaration",or),hr.ensureFlagExists("ignoreInstruction",or),hr.ensureFlagExists("ignoreAttributes",or),hr.ensureFlagExists("ignoreText",or),hr.ensureFlagExists("ignoreComment",or),hr.ensureFlagExists("ignoreCdata",or),hr.ensureFlagExists("ignoreDoctype",or),hr.ensureFlagExists("compact",or),hr.ensureFlagExists("alwaysChildren",or),hr.ensureFlagExists("addParent",or),hr.ensureFlagExists("trim",or),hr.ensureFlagExists("nativeType",or),hr.ensureFlagExists("nativeTypeAttributes",or),hr.ensureFlagExists("sanitize",or),hr.ensureFlagExists("instructionHasAttributes",or),hr.ensureFlagExists("captureSpacesBetweenElements",or),hr.ensureAlwaysArrayExists(or),hr.ensureKeyExists("declaration",or),hr.ensureKeyExists("instruction",or),hr.ensureKeyExists("attributes",or),hr.ensureKeyExists("text",or),hr.ensureKeyExists("comment",or),hr.ensureKeyExists("cdata",or),hr.ensureKeyExists("doctype",or),hr.ensureKeyExists("type",or),hr.ensureKeyExists("name",or),hr.ensureKeyExists("elements",or),hr.ensureKeyExists("parent",or),or}(t),r.opt={strictEntities:!0},r.onopentag=mr,r.ontext=yr,r.oncomment=_r,r.onclosetag=br,r.onerror=Sr,r.oncdata=xr,r.ondoctype=wr,r.onprocessinginstruction=gr;try{r.write(e).close()}catch(e){}if(n[or.elementsKey]){var i=n[or.elementsKey];delete n[or.elementsKey],n[or.elementsKey]=i,delete n.text}return n};t.xml2js=Tr;var Mr=lr,kr=Tr;t.xml2json=function(e,t){var r,n,i,o;return r=function(e){var t=Mr.copyOptions(e);return Mr.ensureSpacesExists(t),t}(t),n=kr(e,r),o="compact"in r&&r.compact?"_parent":"parent",i="addParent"in r&&r.addParent?JSON.stringify(n,(function(e,t){return e===o?"_":t}),r.spaces):JSON.stringify(n,null,r.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};var Er,Ir,Ar=lr,Cr=sr;function Pr(e,t,r){return(!r&&e.spaces?"\n":"")+Array(t+1).join(e.spaces)}function Nr(e,t,r){if(t.ignoreAttributes)return"";"attributesFn"in t&&(e=t.attributesFn(e,Ir,Er));var n,i,o,a,s=[];for(n in e)e.hasOwnProperty(n)&&null!==e[n]&&void 0!==e[n]&&(a=t.noQuotesForNativeAttributes&&"string"!=typeof e[n]?"":'"',i=(i=""+e[n]).replace(/&/g,"&").replace(/"}function Rr(e,t,r){if(t.ignoreInstruction)return"";var n;for(n in e)if(e.hasOwnProperty(n))break;var o="instructionNameFn"in t?t.instructionNameFn(n,e[n],Ir,Er):n;if("object"===i(e[n]))return Er=e,Ir=o,"";var a=e[n]?e[n]:"";return"instructionFn"in t&&(a=t.instructionFn(a,n,Ir,Er)),""}function Dr(e,t){return t.ignoreComment?"":"\x3c!--"+("commentFn"in t?t.commentFn(e,Ir,Er):e)+"--\x3e"}function Lr(e,t){return t.ignoreCdata?"":"","]]]]>"))+"]]>"}function jr(e,t){return t.ignoreDoctype?"":""}function zr(e,t){return t.ignoreText?"":(e=(e=(e=""+e).replace(/&/g,"&")).replace(/&/g,"&").replace(//g,">"),"textFn"in t?t.textFn(e,Ir,Er):e)}function Br(e,t,r,n){return e.reduce((function(e,i){var o=Pr(t,r,n&&!e);switch(i.type){case"element":return e+o+function(e,t,r){Er=e,Ir=e.name;var n=[],i="elementNameFn"in t?t.elementNameFn(e.name,e):e.name;n.push("<"+i),e[t.attributesKey]&&n.push(Nr(e[t.attributesKey],t,r));var o=e[t.elementsKey]&&e[t.elementsKey].length||e[t.attributesKey]&&"preserve"===e[t.attributesKey]["xml:space"];return o||(o="fullTagEmptyElementFn"in t?t.fullTagEmptyElementFn(e.name,e):t.fullTagEmptyElement),o?(n.push(">"),e[t.elementsKey]&&e[t.elementsKey].length&&(n.push(Br(e[t.elementsKey],t,r+1)),Er=e,Ir=e.name),n.push(t.spaces&&function(e,t){var r;if(e.elements&&e.elements.length)for(r=0;r")):n.push("/>"),n.join("")}(i,t,r);case"comment":return e+o+Dr(i[t.commentKey],t);case"doctype":return e+o+jr(i[t.doctypeKey],t);case"cdata":return e+(t.indentCdata?o:"")+Lr(i[t.cdataKey],t);case"text":return e+(t.indentText?o:"")+zr(i[t.textKey],t);case"instruction":var a={};return a[i[t.nameKey]]=i[t.attributesKey]?i:i[t.instructionKey],e+(t.indentInstruction?o:"")+Rr(a,t,r)}}),"")}function Fr(e,t,r){var n;for(n in e)if(e.hasOwnProperty(n))switch(n){case t.parentKey:case t.attributesKey:break;case t.textKey:if(t.indentText||r)return!0;break;case t.cdataKey:if(t.indentCdata||r)return!0;break;case t.instructionKey:if(t.indentInstruction||r)return!0;break;case t.doctypeKey:case t.commentKey:default:return!0}return!1}function Ur(e,t,r,n,o){Er=e,Ir=t;var a="elementNameFn"in r?r.elementNameFn(t,e):t;if(null==e||""===e)return"fullTagEmptyElementFn"in r&&r.fullTagEmptyElementFn(t,e)||r.fullTagEmptyElement?"<"+a+">":"<"+a+"/>";var s=[];if(t){if(s.push("<"+a),"object"!==i(e))return s.push(">"+zr(e,r)+""),s.join("");e[r.attributesKey]&&s.push(Nr(e[r.attributesKey],r,n));var u=Fr(e,r,!0)||e[r.attributesKey]&&"preserve"===e[r.attributesKey]["xml:space"];if(u||(u="fullTagEmptyElementFn"in r?r.fullTagEmptyElementFn(t,e):r.fullTagEmptyElement),!u)return s.push("/>"),s.join("");s.push(">")}return s.push(Wr(e,r,n+1,!1)),Er=e,Ir=t,t&&s.push((o?Pr(r,n,!1):"")+""),s.join("")}function Wr(e,t,r,n){var i,o,a,s=[];for(o in e)if(e.hasOwnProperty(o))for(a=Cr(e[o])?e[o]:[e[o]],i=0;i=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t-1;}var yi=mi,Si=Ge;function xi(h,r){var t=this.__data__,e=Si(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var Ti=xi,Mi=ii,Oi=hi,Ei=pi,Pi=yi,Ai=Ti;function Se(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r-1&&h%1==0&&h-1&&h%1==0&&h<=Ia;}var yn=La,ba=fe,Da=yn,wa=re,Na="[object Arguments]",Wa="[object Array]",Ba="[object Boolean]",Fa="[object Date]",ja="[object Error]",Ua="[object Function]",za="[object Map]",$a="[object Number]",Ga="[object Object]",Ha="[object RegExp]",Ka="[object Set]",Va="[object String]",Ya="[object WeakMap]",Xa="[object ArrayBuffer]",Ja="[object DataView]",Qa="[object Float32Array]",Za="[object Float64Array]",ka="[object Int8Array]",qa="[object Int16Array]",_a="[object Int32Array]",tl="[object Uint8Array]",el="[object Uint8ClampedArray]",rl="[object Uint16Array]",nl="[object Uint32Array]",Ft={};Ft[Qa]=Ft[Za]=Ft[ka]=Ft[qa]=Ft[_a]=Ft[tl]=Ft[el]=Ft[rl]=Ft[nl]=!0;Ft[Na]=Ft[Wa]=Ft[Xa]=Ft[Ba]=Ft[Ja]=Ft[Fa]=Ft[ja]=Ft[Ua]=Ft[za]=Ft[$a]=Ft[Ga]=Ft[Ha]=Ft[Ka]=Ft[Va]=Ft[Ya]=!1;function il(h){return wa(h)&&Da(h.length)&&!!Ft[ba(h)];}var sl=il;function ol(h){return function(r){return h(r);};}var ur=ol,Be={exports:{}};Be.exports;(function(h,r){var t=cn,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i&&t.process,o=function(){try{var s=n&&n.require&&n.require("util").types;return s||a&&a.binding&&a.binding("util");}catch(_unused5){}}();h.exports=o;})(Be,Be.exports);var hr=Be.exports,al=sl,ll=ur,br=hr,Dr=br&&br.isTypedArray,cl=Dr?ll(Dr):al,Sn=cl,fl=fa,ul=Ta,hl=Je,dl=fr,gl=Ra,pl=Sn,vl=Object.prototype,ml=vl.hasOwnProperty;function yl(h,r){var t=hl(h),e=!t&&ul(h),n=!t&&!e&&dl(h),i=!t&&!e&&!n&&pl(h),a=t||e||n||i,o=a?fl(h.length,String):[],s=o.length;for(var f in h)(r||ml.call(h,f))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.\nf=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.\nn&&(f=="offset"||f=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.\ni&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||// Skip index properties.\ngl(f,s)))&&o.push(f);return o;}var xn=yl,Sl=Object.prototype;function xl(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Sl;return h===t;}var dr=xl;function Tl(h,r){return function(t){return h(r(t));};}var Tn=Tl,Ml=Tn,Ol=Ml(Object.keys,Object),El=Ol,Pl=dr,Al=El,Cl=Object.prototype,Rl=Cl.hasOwnProperty;function Il(h){if(!Pl(h))return Al(h);var r=[];for(var t in Object(h))Rl.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Ll=Il,bl=un,Dl=yn;function wl(h){return h!=null&&Dl(h.length)&&!bl(h);}var Mn=wl,Nl=xn,Wl=Ll,Bl=Mn;function Fl(h){return Bl(h)?Nl(h):Wl(h);}var gr=Fl,jl=Xe,Ul=gr;function zl(h,r){return h&&jl(r,Ul(r),h);}var $l=zl;function Gl(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Hl=Gl,Kl=ae,Vl=dr,Yl=Hl,Xl=Object.prototype,Jl=Xl.hasOwnProperty;function Ql(h){if(!Kl(h))return Yl(h);var r=Vl(h),t=[];for(var e in h)e=="constructor"&&(r||!Jl.call(h,e))||t.push(e);return t;}var Zl=Ql,kl=xn,ql=Zl,_l=Mn;function tc(h){return _l(h)?kl(h,!0):ql(h);}var pr=tc,ec=Xe,rc=pr;function nc(h,r){return h&&ec(r,rc(r),h);}var ic=nc,Fe={exports:{}};Fe.exports;(function(h,r){var t=_t,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i?t.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(f,p){if(p)return f.slice();var c=f.length,v=o?o(c):new f.constructor(c);return f.copy(v),v;}h.exports=s;})(Fe,Fe.exports);var sc=Fe.exports;function oc(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t=1?1:1-Math.pow(2,-10*h);},easeInOutExpo:function easeInOutExpo(h){return h<=0?0:h>=1?1:h<0.5?Math.pow(2,20*h-10)/2:(2-Math.pow(2,-20*h+10))/2;}};var _=/*#__PURE__*/function(){function _(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,_);this.x=r,this.y=t,this.z=e;}return _createClass(_,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(r){return this.z=r,this;}},{key:"setXY",value:function setXY(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;return this.x=r,this.y=t,this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=r,this.y=t,this.z=e,this;}},{key:"setTo",value:function setTo(_ref){var _ref$x=_ref.x,r=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,e=_ref$z===void 0?1:_ref$z;return this.x=r,this.y=t,this.z=e,this;}},{key:"rot",value:function rot(r){if(r===0)return this;var t=this.x,e=this.y,n=Math.sin(r),i=Math.cos(r);return this.x=t*i-e*n,this.y=t*n+e*i,this;}},{key:"rotWith",value:function rotWith(r,t){if(t===0)return this;var e=this.x-r.x,n=this.y-r.y,i=Math.sin(t),a=Math.cos(t);return this.x=r.x+(e*a-n*i),this.y=r.y+(e*i+n*a),this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z;return new _(r,t,e);}},{key:"sub",value:function sub(r){return this.x-=r.x,this.y-=r.y,this;}},{key:"subXY",value:function subXY(r,t){return this.x-=r,this.y-=t,this;}},{key:"subScalar",value:function subScalar(r){return this.x-=r,this.y-=r,this;}},{key:"add",value:function add(r){return this.x+=r.x,this.y+=r.y,this;}},{key:"addXY",value:function addXY(r,t){return this.x+=r,this.y+=t,this;}},{key:"addScalar",value:function addScalar(r){return this.x+=r,this.y+=r,this;}},{key:"clamp",value:function clamp(r,t){return this.x=Math.max(this.x,r),this.y=Math.max(this.y,r),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(r){return this.x/=r,this.y/=r,this;}},{key:"divV",value:function divV(r){return this.x/=r.x,this.y/=r.y,this;}},{key:"mul",value:function mul(r){return this.x*=r,this.y*=r,this;}},{key:"mulV",value:function mulV(r){return this.x*=r.x,this.y*=r.y,this;}},{key:"abs",value:function abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this;}},{key:"nudge",value:function nudge(r,t){var e=_.Tan(r,this);return this.add(e.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(r){return this.x=this.y*r.z-this.z*r.y,this.y=this.z*r.x-this.x*r.z,this;}},{key:"dpr",value:function dpr(r){return _.Dpr(this,r);}},{key:"cpr",value:function cpr(r){return _.Cpr(this,r);}},{key:"len2",value:function len2(){return _.Len2(this);}},{key:"len",value:function len(){return _.Len(this);}},{key:"pry",value:function pry(r){return _.Pry(this,r);}},{key:"per",value:function per(){var r=this.x,t=this.y;return this.x=t,this.y=-r,this;}},{key:"uni",value:function uni(){return _.Uni(this);}},{key:"tan",value:function tan(r){return _.Tan(this,r);}},{key:"dist",value:function dist(r){return _.Dist(this,r);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(r,t){return _.DistanceToLineSegment(r,t,this);}},{key:"slope",value:function slope(r){return _.Slope(this,r);}},{key:"snapToGrid",value:function snapToGrid(r){return this.x=Math.round(this.x/r)*r,this.y=Math.round(this.y/r)*r,this;}},{key:"angle",value:function angle(r){return _.Angle(this,r);}},{key:"toAngle",value:function toAngle(){return _.ToAngle(this);}},{key:"lrp",value:function lrp(r,t){return this.x=this.x+(r.x-this.x)*t,this.y=this.y+(r.y-this.y)*t,this;}},{key:"equals",value:function equals(r,t){return _.Equals(this,r,t);}},{key:"equalsXY",value:function equalsXY(r,t){return _.EqualsXY(this,r,t);}},{key:"norm",value:function norm(){var r=this.len();return this.x=r===0?0:this.x/r,this.y=r===0?0:this.y/r,this;}},{key:"toFixed",value:function toFixed(){return _.ToFixed(this);}},{key:"toString",value:function toString(){return _.ToString(_.ToFixed(this));}},{key:"toJson",value:function toJson(){return _.ToJson(this);}},{key:"toArray",value:function toArray(){return _.ToArray(this);}}],[{key:"Add",value:function Add(r,t){return new _(r.x+t.x,r.y+t.y);}},{key:"AddXY",value:function AddXY(r,t,e){return new _(r.x+t,r.y+e);}},{key:"Sub",value:function Sub(r,t){return new _(r.x-t.x,r.y-t.y);}},{key:"SubXY",value:function SubXY(r,t,e){return new _(r.x-t,r.y-e);}},{key:"AddScalar",value:function AddScalar(r,t){return new _(r.x+t,r.y+t);}},{key:"SubScalar",value:function SubScalar(r,t){return new _(r.x-t,r.y-t);}},{key:"Div",value:function Div(r,t){return new _(r.x/t,r.y/t);}},{key:"Mul",value:function Mul(r,t){return new _(r.x*t,r.y*t);}},{key:"DivV",value:function DivV(r,t){return new _(r.x/t.x,r.y/t.y);}},{key:"MulV",value:function MulV(r,t){return new _(r.x*t.x,r.y*t.y);}},{key:"Neg",value:function Neg(r){return new _(-r.x,-r.y);}},{key:"Per",value:function Per(r){return new _(r.y,-r.x);}},{key:"Dist2",value:function Dist2(r,t){return _.Sub(r,t).len2();}},{key:"Abs",value:function Abs(r){return new _(Math.abs(r.x),Math.abs(r.y));}},{key:"Dist",value:function Dist(r,t){return Math.hypot(r.y-t.y,r.x-t.x);}},{key:"Dpr",value:function Dpr(r,t){return r.x*t.x+r.y*t.y;}},{key:"Cross",value:function Cross(r,t){return new _(r.y*t.z-r.z*t.y,r.z*t.x-r.x*t.z// A.z = A.x * V.y - A.y * V.x\n);}},{key:"Cpr",value:function Cpr(r,t){return r.x*t.y-t.x*r.y;}},{key:"Len2",value:function Len2(r){return r.x*r.x+r.y*r.y;}},{key:"Len",value:function Len(r){return Math.hypot(r.x,r.y);}},{key:"Pry",value:function Pry(r,t){return _.Dpr(r,t)/_.Len(t);}},{key:"Uni",value:function Uni(r){return _.Div(r,_.Len(r));}},{key:"Tan",value:function Tan(r,t){return _.Uni(_.Sub(r,t));}},{key:"Min",value:function Min(r,t){return new _(Math.min(r.x,t.x),Math.min(r.y,t.y));}},{key:"Max",value:function Max(r,t){return new _(Math.max(r.x,t.x),Math.max(r.y,t.y));}},{key:"From",value:function From(r){return new _().add(r);}},{key:"FromArray",value:function FromArray(r){return new _(r[0],r[1]);}},{key:"Rot",value:function Rot(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=Math.sin(t),n=Math.cos(t);return new _(r.x*n-r.y*e,r.x*e+r.y*n);}},{key:"RotWith",value:function RotWith(r,t,e){var n=r.x-t.x,i=r.y-t.y,a=Math.sin(e),o=Math.cos(e);return new _(t.x+(n*o-i*a),t.y+(n*a+i*o));}/**\n * Get the nearest point on a line with a known unit vector that passes through point A\n *\n * ```ts\n * Vec.nearestPointOnLineThroughPoint(A, u, Point)\n * ```\n *\n * @param A - Any point on the line\n * @param u - The unit vector for the line.\n * @param P - A point not on the line to test.\n */},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(r,t,e){return _.Mul(t,_.Sub(e,r).pry(t)).add(r);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var i=_.Tan(t,r),a=_.Add(r,_.Mul(i,_.Sub(e,r).pry(i)));if(n){if(a.xMath.max(r.x,t.x))return _.Cast(r.x>t.x?r:t);if(a.yMath.max(r.y,t.y))return _.Cast(r.y>t.y?r:t);}return a;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(r,t,e){return _.Dist(e,_.NearestPointOnLineThroughPoint(r,t,e));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return _.Dist(e,_.NearestPointOnLineSegment(r,t,e,n));}},{key:"Snap",value:function Snap(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}},{key:"Cast",value:function Cast(r){return r instanceof _?r:_.From(r);}},{key:"Slope",value:function Slope(r,t){return r.x===t.y?NaN:(r.y-t.y)/(r.x-t.x);}},{key:"Angle",value:function Angle(r,t){return Math.atan2(t.y-r.y,t.x-r.x);}},{key:"Lrp",value:function Lrp(r,t,e){return _.Sub(t,r).mul(e).add(r);}},{key:"Med",value:function Med(r,t){return new _((r.x+t.x)/2,(r.y+t.y)/2);}},{key:"Equals",value:function Equals(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(r.x-t.x)2&&arguments[2]!==undefined?arguments[2]:1e-4;return _.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))1&&arguments[1]!==undefined?arguments[1]:2;return new _(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t));}},{key:"Nudge",value:function Nudge(r,t,e){return _.Add(r,_.Tan(t,r).mul(e));}},{key:"ToString",value:function ToString(r){return"".concat(r.x,", ").concat(r.y);}},{key:"ToAngle",value:function ToAngle(r){var t=Math.atan2(r.y,r.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.cos(r)*t,Math.sin(r)*t);}},{key:"ToArray",value:function ToArray(r){return[r.x,r.y,r.z];}},{key:"ToJson",value:function ToJson(r){var t=r.x,e=r.y,n=r.z;return{x:t,y:e,z:n};}},{key:"Average",value:function Average(r){var t=r.length,e=new _(0,0);for(var n=0;n2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:8;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}}]);}();var Dh=function Dh(h){return h<0.5?2*h*h:-1+(4-2*h)*h;};var Tt=/*#__PURE__*/function(_ref2){function Tt(){var _this2;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Tt);_this2=_callSuper(this,Tt,[r,t,e]),_this2.x=r,_this2.y=t,_this2.z=e,_this2.v=n,_this2.t=i,_this2.a=a;return _this2;}_inherits(Tt,_ref2);return _createClass(Tt,[{key:"timestamp",get:function get(){return this.t;}},{key:"pressure",get:function get(){return this.z;}},{key:"angleNum",get:function get(){return this.a;}},{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setA",value:function setA(r){this.a=r;}},{key:"setT",value:function setT(r){this.t=r;}},{key:"setv",value:function setv(r){return this.v={x:r.x,y:r.y},this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a,o={x:n.x,y:n.y};return new Tt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return Tt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return Tt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return Tt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new Tt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new Tt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return Tt.Len(r.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(r,t,e){var n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,o=e.y-t.y;var s=0;var f=Math.sqrt(n*n+a*a),p=Math.sqrt(i*i+o*o);if(f&&p){var c=n*i+a*o;s=Math.acos(c/(f*p)),s=s/Math.PI*180;var v=n*o-a*i;v=v>0?1:-1,s=180+v*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return Tt.Len(r.clone().sub(t))3&&arguments[3]!==undefined?arguments[3]:2;var i=r.x-t.x,a=r.y-t.y,o=Math.sin(e),s=Math.cos(e),f=Math.pow(10,n),p=Math.floor((t.x+(i*s-a*o))*f)/f,c=Math.floor((t.y+(i*o+a*s))*f)/f;return new Tt(p,c);}/**\n * 根据圆心和半径,获取圆上的等份点\n * @param o 圆心\n * @param radius 半径 \n * @param average 均分数\n * @returns \n */},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new _(1,1),i=Math.PI+1e-3,a=Tt.Add(r,Tt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,f=s;f<=1;f+=s)o.push(Tt.RotWith(a,r,i*2*f));return o;}/**\n * 根据圆心和圆上的起始点,获取半圆上的等份点\n * @param o 圆心 \n * @param p 圆弧起始点\n * @param radian 1,逆时针180度 -1,顺时针 \n * @param average 均分数\n * @returns \n */},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var i=e*(Math.PI+1e-3),a=[];for(var o=1/n,s=o;s<=1;s+=o)a.push(Tt.RotWith(t,r,i*s));return a;}}]);}(_);function Ot(h,r){if(h&&r){var t=Math.min(h.x,r.x),_e2=Math.min(h.y,r.y),n=Math.max(h.x+h.w,r.x+r.w),i=Math.max(h.y+h.h,r.y+r.h),a=n-t,o=i-_e2;return{x:t,y:_e2,w:a,h:o};}return r||h;}function Wt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var e=1/0,n=1/0,i=-1/0,a=-1/0;return h.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),s=_o$XY[0],f=_o$XY[1];e=Math.min(e,s-r),n=Math.min(n,f-r),i=Math.max(i,s+r),a=Math.max(a,f+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function Re(h,r){return!(h.x+h.wr.x+r.w||h.y+h.hr.y+r.h);}function wt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(h.x-r),y:Math.floor(h.y-r),w:Math.floor(h.w+r*2),h:Math.floor(h.h+r*2)};}function Ie(h,r){return{x:h.x+r[0],y:h.y+r[1],w:h.w,h:h.h};}function Nn(h,r){var t=new _(h.x,h.y),e=new _(h.x+h.w,h.y),n=new _(h.x+h.w,h.y+h.h),i=new _(h.x,h.y+h.h),a=new _(h.x+h.w/2,h.y+h.h/2),o=Math.PI*r/180,s=_.RotWith(t,a,o),f=_.RotWith(e,a,o),p=_.RotWith(n,a,o),c=_.RotWith(i,a,o);return[s,f,p,c];}function Wn(h,r){var t=Nn(h,r);return Wt(t);}function Bn(h,r){var t=new _(h.x,h.y),e=new _(h.x+h.w,h.y),n=new _(h.x+h.w,h.y+h.h),i=new _(h.x,h.y+h.h),a=new _(h.x+h.w/2,h.y+h.h/2),o=new _(r[0],r[1]),s=_.ScaleWOrigin(t,o,a),f=_.ScaleWOrigin(e,o,a),p=_.ScaleWOrigin(n,o,a),c=_.ScaleWOrigin(i,o,a);return Wt([s,f,p,c]);}function wh(h,r,t){var e=[];for(var n=0;n=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function Fn(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}var jh=function jh(h){if(h.tagName==="GROUP"){var r=Object.getOwnPropertySymbols(h).find(function(t){return t.toString()==="Symbol(sealed)";});if(r&&h[r])return!0;}return!1;},Uh=function Uh(h){return!h.isHid;};function de(h){return"".concat(je(h.x),",").concat(je(h.y)," ");}function ge(h,r){return"".concat(je((h.x+r.x)/2),",").concat(je((h.y+r.y)/2)," ");}function je(h){return+h.toFixed(4);}var zh=fe,$h=re,Gh="[object Number]";function Hh(h){return typeof h=="number"||$h(h)&&zh(h)==Gh;}var Kh=Hh,kt=/* @__PURE__ */ye(Kh);var Xt=/*#__PURE__*/function(){function Xt(r){_classCallCheck(this,Xt);nt(this,"syncUnitTime",1e3);nt(this,"vNodes");nt(this,"drawLayer");nt(this,"fullLayer");nt(this,"workId");var t=r.vNodes,e=r.fullLayer,n=r.drawLayer;this.vNodes=t,this.fullLayer=e,this.drawLayer=n;}/** 设置工作id */return _createClass(Xt,[{key:"setWorkId",value:function setWorkId(r){this.workId=r;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(r){var n,i,a;this.workOptions=r,this.syncUnitTime=r.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),e=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&e&&(e.opt=r,(a=this.vNodes)==null||a.setInfo(t,e));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(r){var n,i;var t;var e=(n=this.workId)==null?void 0:n.toString();if(e&&r){var a=this.fullLayer.getElementsByName(e)||this.drawLayer&&this.drawLayer.getElementsByName(e)||[];if(a.length!==1)return;var o=a[0],s=r.pos,f=r.zIndex,p=r.scale,c=r.angle,v=r.translate,S={};kt(f)&&(S.zIndex=f),s&&(S.pos=[s[0],s[1]]),p&&(S.scale=p),c&&(S.rotate=c),v&&(S.translate=v),o.attr(S);var O=o==null?void 0:o.getBoundingClientRect();return O&&(t=Ot(t,{x:Math.floor(O.x-Xt.SafeBorderPadding),y:Math.floor(O.y-Xt.SafeBorderPadding),w:Math.floor(O.width+Xt.SafeBorderPadding*2),h:Math.floor(O.height+Xt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"replace",value:function replace(r,t,e){var o;var n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(var s=1;s0?(w[0]=(rt*k+ut*U+it*Y-lt*H)*2/at,w[1]=(it*k+ut*H+lt*U-rt*Y)*2/at,w[2]=(lt*k+ut*Y+rt*H-it*U)*2/at):(w[0]=(rt*k+ut*U+it*Y-lt*H)*2,w[1]=(it*k+ut*H+lt*U-rt*Y)*2,w[2]=(lt*k+ut*Y+rt*H-it*U)*2),L(y,P,w),y;}function I(y,P){return y[0]=P[12],y[1]=P[13],y[2]=P[14],y;}function C(y,P){var w=P[0],U=P[1],H=P[2],Y=P[4],k=P[5],rt=P[6],it=P[8],lt=P[9],ut=P[10];return y[0]=Math.hypot(w,U,H),y[1]=Math.hypot(Y,k,rt),y[2]=Math.hypot(it,lt,ut),y;}function W(y,P){var w=new e.ARRAY_TYPE(3);C(w,P);var U=1/w[0],H=1/w[1],Y=1/w[2],k=P[0]*U,rt=P[1]*H,it=P[2]*Y,lt=P[4]*U,ut=P[5]*H,at=P[6]*Y,st=P[8]*U,ft=P[9]*H,vt=P[10]*Y,mt=k+ut+vt,pt=0;return mt>0?(pt=Math.sqrt(mt+1)*2,y[3]=0.25*pt,y[0]=(at-ft)/pt,y[1]=(st-it)/pt,y[2]=(rt-lt)/pt):k>ut&&k>vt?(pt=Math.sqrt(1+k-ut-vt)*2,y[3]=(at-ft)/pt,y[0]=0.25*pt,y[1]=(rt+lt)/pt,y[2]=(st+it)/pt):ut>vt?(pt=Math.sqrt(1+ut-k-vt)*2,y[3]=(st-it)/pt,y[0]=(rt+lt)/pt,y[1]=0.25*pt,y[2]=(at+ft)/pt):(pt=Math.sqrt(1+vt-k-ut)*2,y[3]=(rt-lt)/pt,y[0]=(st+it)/pt,y[1]=(at+ft)/pt,y[2]=0.25*pt),y;}function G(y,P,w,U){var H=P[0],Y=P[1],k=P[2],rt=P[3],it=H+H,lt=Y+Y,ut=k+k,at=H*it,st=H*lt,ft=H*ut,vt=Y*lt,mt=Y*ut,pt=k*ut,St=rt*it,It=rt*lt,Et=rt*ut,Pt=U[0],At=U[1],Ct=U[2];return y[0]=(1-(vt+pt))*Pt,y[1]=(st+Et)*Pt,y[2]=(ft-It)*Pt,y[3]=0,y[4]=(st-Et)*At,y[5]=(1-(at+pt))*At,y[6]=(mt+St)*At,y[7]=0,y[8]=(ft+It)*Ct,y[9]=(mt-St)*Ct,y[10]=(1-(at+vt))*Ct,y[11]=0,y[12]=w[0],y[13]=w[1],y[14]=w[2],y[15]=1,y;}function K(y,P,w,U,H){var Y=P[0],k=P[1],rt=P[2],it=P[3],lt=Y+Y,ut=k+k,at=rt+rt,st=Y*lt,ft=Y*ut,vt=Y*at,mt=k*ut,pt=k*at,St=rt*at,It=it*lt,Et=it*ut,Pt=it*at,At=U[0],Ct=U[1],Gt=U[2],jt=H[0],Ut=H[1],zt=H[2],Ht=(1-(mt+St))*At,Kt=(ft+Pt)*At,Yt=(vt-Et)*At,bt=(ft-Pt)*Ct,Qt=(1-(st+St))*Ct,Ee=(pt+It)*Ct,Pe=(vt+Et)*Gt,Tr=(pt-It)*Gt,Mr=(1-(st+mt))*Gt;return y[0]=Ht,y[1]=Kt,y[2]=Yt,y[3]=0,y[4]=bt,y[5]=Qt,y[6]=Ee,y[7]=0,y[8]=Pe,y[9]=Tr,y[10]=Mr,y[11]=0,y[12]=w[0]+jt-(Ht*jt+bt*Ut+Pe*zt),y[13]=w[1]+Ut-(Kt*jt+Qt*Ut+Tr*zt),y[14]=w[2]+zt-(Yt*jt+Ee*Ut+Mr*zt),y[15]=1,y;}function J(y,P){var w=P[0],U=P[1],H=P[2],Y=P[3],k=w+w,rt=U+U,it=H+H,lt=w*k,ut=U*k,at=U*rt,st=H*k,ft=H*rt,vt=H*it,mt=Y*k,pt=Y*rt,St=Y*it;return y[0]=1-at-vt,y[1]=ut+St,y[2]=st-pt,y[3]=0,y[4]=ut-St,y[5]=1-lt-vt,y[6]=ft+mt,y[7]=0,y[8]=st+pt,y[9]=ft-mt,y[10]=1-lt-at,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function Z(y,P,w,U,H,Y,k){var rt=1/(w-P),it=1/(H-U),lt=1/(Y-k);return y[0]=Y*2*rt,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=Y*2*it,y[6]=0,y[7]=0,y[8]=(w+P)*rt,y[9]=(H+U)*it,y[10]=(k+Y)*lt,y[11]=-1,y[12]=0,y[13]=0,y[14]=k*Y*2*lt,y[15]=0,y;}function B(y,P,w,U,H){var Y=1/Math.tan(P/2),k;return y[0]=Y/w,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=Y,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[11]=-1,y[12]=0,y[13]=0,y[15]=0,H!=null&&H!==1/0?(k=1/(U-H),y[10]=(H+U)*k,y[14]=2*H*U*k):(y[10]=-1,y[14]=-2*U),y;}function $(y,P,w,U){var H=Math.tan(P.upDegrees*Math.PI/180),Y=Math.tan(P.downDegrees*Math.PI/180),k=Math.tan(P.leftDegrees*Math.PI/180),rt=Math.tan(P.rightDegrees*Math.PI/180),it=2/(k+rt),lt=2/(H+Y);return y[0]=it,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=lt,y[6]=0,y[7]=0,y[8]=-((k-rt)*it*0.5),y[9]=(H-Y)*lt*0.5,y[10]=U/(w-U),y[11]=-1,y[12]=0,y[13]=0,y[14]=U*w/(w-U),y[15]=0,y;}function Q(y,P,w,U,H,Y,k){var rt=1/(P-w),it=1/(U-H),lt=1/(Y-k);return y[0]=-2*rt,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*it,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*lt,y[11]=0,y[12]=(P+w)*rt,y[13]=(H+U)*it,y[14]=(k+Y)*lt,y[15]=1,y;}function et(y,P,w,U){var H,Y,k,rt,it,lt,ut,at,st,ft,vt=P[0],mt=P[1],pt=P[2],St=U[0],It=U[1],Et=U[2],Pt=w[0],At=w[1],Ct=w[2];return Math.abs(vt-Pt)0&&(ft=1/Math.sqrt(ft),ut*=ft,at*=ft,st*=ft);var vt=it*st-lt*at,mt=lt*ut-rt*st,pt=rt*at-it*ut;return ft=vt*vt+mt*mt+pt*pt,ft>0&&(ft=1/Math.sqrt(ft),vt*=ft,mt*=ft,pt*=ft),y[0]=vt,y[1]=mt,y[2]=pt,y[3]=0,y[4]=at*pt-st*mt,y[5]=st*vt-ut*pt,y[6]=ut*mt-at*vt,y[7]=0,y[8]=ut,y[9]=at,y[10]=st,y[11]=0,y[12]=H,y[13]=Y,y[14]=k,y[15]=1,y;}function ot(y){return"mat4("+y[0]+", "+y[1]+", "+y[2]+", "+y[3]+", "+y[4]+", "+y[5]+", "+y[6]+", "+y[7]+", "+y[8]+", "+y[9]+", "+y[10]+", "+y[11]+", "+y[12]+", "+y[13]+", "+y[14]+", "+y[15]+")";}function q(y){return Math.hypot(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]);}function gt(y,P,w){return y[0]=P[0]+w[0],y[1]=P[1]+w[1],y[2]=P[2]+w[2],y[3]=P[3]+w[3],y[4]=P[4]+w[4],y[5]=P[5]+w[5],y[6]=P[6]+w[6],y[7]=P[7]+w[7],y[8]=P[8]+w[8],y[9]=P[9]+w[9],y[10]=P[10]+w[10],y[11]=P[11]+w[11],y[12]=P[12]+w[12],y[13]=P[13]+w[13],y[14]=P[14]+w[14],y[15]=P[15]+w[15],y;}function dt(y,P,w){return y[0]=P[0]-w[0],y[1]=P[1]-w[1],y[2]=P[2]-w[2],y[3]=P[3]-w[3],y[4]=P[4]-w[4],y[5]=P[5]-w[5],y[6]=P[6]-w[6],y[7]=P[7]-w[7],y[8]=P[8]-w[8],y[9]=P[9]-w[9],y[10]=P[10]-w[10],y[11]=P[11]-w[11],y[12]=P[12]-w[12],y[13]=P[13]-w[13],y[14]=P[14]-w[14],y[15]=P[15]-w[15],y;}function F(y,P,w){return y[0]=P[0]*w,y[1]=P[1]*w,y[2]=P[2]*w,y[3]=P[3]*w,y[4]=P[4]*w,y[5]=P[5]*w,y[6]=P[6]*w,y[7]=P[7]*w,y[8]=P[8]*w,y[9]=P[9]*w,y[10]=P[10]*w,y[11]=P[11]*w,y[12]=P[12]*w,y[13]=P[13]*w,y[14]=P[14]*w,y[15]=P[15]*w,y;}function j(y,P,w,U){return y[0]=P[0]+w[0]*U,y[1]=P[1]+w[1]*U,y[2]=P[2]+w[2]*U,y[3]=P[3]+w[3]*U,y[4]=P[4]+w[4]*U,y[5]=P[5]+w[5]*U,y[6]=P[6]+w[6]*U,y[7]=P[7]+w[7]*U,y[8]=P[8]+w[8]*U,y[9]=P[9]+w[9]*U,y[10]=P[10]+w[10]*U,y[11]=P[11]+w[11]*U,y[12]=P[12]+w[12]*U,y[13]=P[13]+w[13]*U,y[14]=P[14]+w[14]*U,y[15]=P[15]+w[15]*U,y;}function V(y,P){return y[0]===P[0]&&y[1]===P[1]&&y[2]===P[2]&&y[3]===P[3]&&y[4]===P[4]&&y[5]===P[5]&&y[6]===P[6]&&y[7]===P[7]&&y[8]===P[8]&&y[9]===P[9]&&y[10]===P[10]&&y[11]===P[11]&&y[12]===P[12]&&y[13]===P[13]&&y[14]===P[14]&&y[15]===P[15];}function X(y,P){var w=y[0],U=y[1],H=y[2],Y=y[3],k=y[4],rt=y[5],it=y[6],lt=y[7],ut=y[8],at=y[9],st=y[10],ft=y[11],vt=y[12],mt=y[13],pt=y[14],St=y[15],It=P[0],Et=P[1],Pt=P[2],At=P[3],Ct=P[4],Gt=P[5],jt=P[6],Ut=P[7],zt=P[8],Ht=P[9],Kt=P[10],Yt=P[11],bt=P[12],Qt=P[13],Ee=P[14],Pe=P[15];return Math.abs(w-It)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(It))&&Math.abs(U-Et)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(Et))&&Math.abs(H-Pt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(Pt))&&Math.abs(Y-At)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(At))&&Math.abs(k-Ct)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(Ct))&&Math.abs(rt-Gt)<=e.EPSILON*Math.max(1,Math.abs(rt),Math.abs(Gt))&&Math.abs(it-jt)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(jt))&&Math.abs(lt-Ut)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs(Ut))&&Math.abs(ut-zt)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs(zt))&&Math.abs(at-Ht)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs(Ht))&&Math.abs(st-Kt)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs(Kt))&&Math.abs(ft-Yt)<=e.EPSILON*Math.max(1,Math.abs(ft),Math.abs(Yt))&&Math.abs(vt-bt)<=e.EPSILON*Math.max(1,Math.abs(vt),Math.abs(bt))&&Math.abs(mt-Qt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Qt))&&Math.abs(pt-Ee)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Ee))&&Math.abs(St-Pe)<=e.EPSILON*Math.max(1,Math.abs(St),Math.abs(Pe));}var N=O,z=dt;},/* 7 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return o;}),t.d(r,"identity",function(){return s;}),t.d(r,"setAxisAngle",function(){return f;}),t.d(r,"getAxisAngle",function(){return p;}),t.d(r,"getAngle",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotateX",function(){return S;}),t.d(r,"rotateY",function(){return O;}),t.d(r,"rotateZ",function(){return x;}),t.d(r,"calculateW",function(){return m;}),t.d(r,"exp",function(){return T;}),t.d(r,"ln",function(){return l;}),t.d(r,"pow",function(){return d;}),t.d(r,"slerp",function(){return u;}),t.d(r,"random",function(){return g;}),t.d(r,"invert",function(){return M;}),t.d(r,"conjugate",function(){return A;}),t.d(r,"fromMat3",function(){return R;}),t.d(r,"fromEuler",function(){return b;}),t.d(r,"str",function(){return E;}),t.d(r,"clone",function(){return L;}),t.d(r,"fromValues",function(){return D;}),t.d(r,"copy",function(){return I;}),t.d(r,"set",function(){return C;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return G;}),t.d(r,"scale",function(){return K;}),t.d(r,"dot",function(){return J;}),t.d(r,"lerp",function(){return Z;}),t.d(r,"length",function(){return B;}),t.d(r,"len",function(){return $;}),t.d(r,"squaredLength",function(){return Q;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return tt;}),t.d(r,"exactEquals",function(){return ot;}),t.d(r,"equals",function(){return q;}),t.d(r,"rotationTo",function(){return gt;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return F;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var j=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(j[0]=0,j[1]=0,j[2]=0),j[3]=1,j;}function s(j){return j[0]=0,j[1]=0,j[2]=0,j[3]=1,j;}function f(j,V,X){X=X*0.5;var N=Math.sin(X);return j[0]=N*V[0],j[1]=N*V[1],j[2]=N*V[2],j[3]=Math.cos(X),j;}function p(j,V){var X=Math.acos(V[3])*2,N=Math.sin(X/2);return N>e.EPSILON?(j[0]=V[0]/N,j[1]=V[1]/N,j[2]=V[2]/N):(j[0]=1,j[1]=0,j[2]=0),X;}function c(j,V){var X=J(j,V);return Math.acos(2*X*X-1);}function v(j,V,X){var N=V[0],z=V[1],y=V[2],P=V[3],w=X[0],U=X[1],H=X[2],Y=X[3];return j[0]=N*Y+P*w+z*H-y*U,j[1]=z*Y+P*U+y*w-N*H,j[2]=y*Y+P*H+N*U-z*w,j[3]=P*Y-N*w-z*U-y*H,j;}function S(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U+P*w,j[1]=z*U+y*w,j[2]=y*U-z*w,j[3]=P*U-N*w,j;}function O(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U-y*w,j[1]=z*U+P*w,j[2]=y*U+N*w,j[3]=P*U-z*w,j;}function x(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U+z*w,j[1]=z*U-N*w,j[2]=y*U+P*w,j[3]=P*U-y*w,j;}function m(j,V){var X=V[0],N=V[1],z=V[2];return j[0]=X,j[1]=N,j[2]=z,j[3]=Math.sqrt(Math.abs(1-X*X-N*N-z*z)),j;}function T(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=Math.sqrt(X*X+N*N+z*z),w=Math.exp(y),U=P>0?w*Math.sin(P)/P:0;return j[0]=X*U,j[1]=N*U,j[2]=z*U,j[3]=w*Math.cos(P),j;}function l(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=Math.sqrt(X*X+N*N+z*z),w=P>0?Math.atan2(P,y)/P:0;return j[0]=X*w,j[1]=N*w,j[2]=z*w,j[3]=0.5*Math.log(X*X+N*N+z*z+y*y),j;}function d(j,V,X){return l(j,V),K(j,j,X),T(j,j),j;}function u(j,V,X,N){var z=V[0],y=V[1],P=V[2],w=V[3],U=X[0],H=X[1],Y=X[2],k=X[3],rt,it,lt,ut,at;return it=z*U+y*H+P*Y+w*k,it<0&&(it=-it,U=-U,H=-H,Y=-Y,k=-k),1-it>e.EPSILON?(rt=Math.acos(it),lt=Math.sin(rt),ut=Math.sin((1-N)*rt)/lt,at=Math.sin(N*rt)/lt):(ut=1-N,at=N),j[0]=ut*z+at*U,j[1]=ut*y+at*H,j[2]=ut*P+at*Y,j[3]=ut*w+at*k,j;}function g(j){var V=e.RANDOM(),X=e.RANDOM(),N=e.RANDOM(),z=Math.sqrt(1-V),y=Math.sqrt(V);return j[0]=z*Math.sin(2*Math.PI*X),j[1]=z*Math.cos(2*Math.PI*X),j[2]=y*Math.sin(2*Math.PI*N),j[3]=y*Math.cos(2*Math.PI*N),j;}function M(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=X*X+N*N+z*z+y*y,w=P?1/P:0;return j[0]=-X*w,j[1]=-N*w,j[2]=-z*w,j[3]=y*w,j;}function A(j,V){return j[0]=-V[0],j[1]=-V[1],j[2]=-V[2],j[3]=V[3],j;}function R(j,V){var X=V[0]+V[4]+V[8],N;if(X>0)N=Math.sqrt(X+1),j[3]=0.5*N,N=0.5/N,j[0]=(V[5]-V[7])*N,j[1]=(V[6]-V[2])*N,j[2]=(V[1]-V[3])*N;else{var z=0;V[4]>V[0]&&(z=1),V[8]>V[z*3+z]&&(z=2);var y=(z+1)%3,P=(z+2)%3;N=Math.sqrt(V[z*3+z]-V[y*3+y]-V[P*3+P]+1),j[z]=0.5*N,N=0.5/N,j[3]=(V[y*3+P]-V[P*3+y])*N,j[y]=(V[y*3+z]+V[z*3+y])*N,j[P]=(V[P*3+z]+V[z*3+P])*N;}return j;}function b(j,V,X,N){var z=0.5*Math.PI/180;V*=z,X*=z,N*=z;var y=Math.sin(V),P=Math.cos(V),w=Math.sin(X),U=Math.cos(X),H=Math.sin(N),Y=Math.cos(N);return j[0]=y*U*Y-P*w*H,j[1]=P*w*Y+y*U*H,j[2]=P*U*H-y*w*Y,j[3]=P*U*Y+y*w*H,j;}function E(j){return"quat("+j[0]+", "+j[1]+", "+j[2]+", "+j[3]+")";}var L=a.clone,D=a.fromValues,I=a.copy,C=a.set,W=a.add,G=v,K=a.scale,J=a.dot,Z=a.lerp,B=a.length,$=B,Q=a.squaredLength,et=Q,tt=a.normalize,ot=a.exactEquals,q=a.equals,gt=function(){var j=i.create(),V=i.fromValues(1,0,0),X=i.fromValues(0,1,0);return function(N,z,y){var P=i.dot(z,y);return P<-0.999999?(i.cross(j,V,z),i.len(j)<1e-6&&i.cross(j,X,z),i.normalize(j,j),f(N,j,Math.PI),N):P>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(j,z,y),N[0]=j[0],N[1]=j[1],N[2]=j[2],N[3]=1+P,tt(N,N));};}(),dt=function(){var j=o(),V=o();return function(X,N,z,y,P,w){return u(j,N,P,w),u(V,z,y,w),u(X,j,V,2*w*(1-w)),X;};}(),F=function(){var j=n.create();return function(V,X,N,z){return j[0]=N[0],j[3]=N[1],j[6]=N[2],j[1]=z[0],j[4]=z[1],j[7]=z[2],j[2]=-X[0],j[5]=-X[1],j[8]=-X[2],tt(V,R(V,j));};}();},/* 8 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"length",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"add",function(){return p;}),t.d(r,"subtract",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"divide",function(){return S;}),t.d(r,"ceil",function(){return O;}),t.d(r,"floor",function(){return x;}),t.d(r,"min",function(){return m;}),t.d(r,"max",function(){return T;}),t.d(r,"round",function(){return l;}),t.d(r,"scale",function(){return d;}),t.d(r,"scaleAndAdd",function(){return u;}),t.d(r,"distance",function(){return g;}),t.d(r,"squaredDistance",function(){return M;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"hermite",function(){return C;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return G;}),t.d(r,"transformMat4",function(){return K;}),t.d(r,"transformMat3",function(){return J;}),t.d(r,"transformQuat",function(){return Z;}),t.d(r,"rotateX",function(){return B;}),t.d(r,"rotateY",function(){return $;}),t.d(r,"rotateZ",function(){return Q;}),t.d(r,"angle",function(){return et;}),t.d(r,"zero",function(){return tt;}),t.d(r,"str",function(){return ot;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return gt;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return F;}),t.d(r,"div",function(){return j;}),t.d(r,"dist",function(){return V;}),t.d(r,"sqrDist",function(){return X;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return z;}),t.d(r,"forEach",function(){return y;});var e=t(2);function n(){var P=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(P[0]=0,P[1]=0,P[2]=0),P;}function i(P){var w=new e.ARRAY_TYPE(3);return w[0]=P[0],w[1]=P[1],w[2]=P[2],w;}function a(P){var w=P[0],U=P[1],H=P[2];return Math.hypot(w,U,H);}function o(P,w,U){var H=new e.ARRAY_TYPE(3);return H[0]=P,H[1]=w,H[2]=U,H;}function s(P,w){return P[0]=w[0],P[1]=w[1],P[2]=w[2],P;}function f(P,w,U,H){return P[0]=w,P[1]=U,P[2]=H,P;}function p(P,w,U){return P[0]=w[0]+U[0],P[1]=w[1]+U[1],P[2]=w[2]+U[2],P;}function c(P,w,U){return P[0]=w[0]-U[0],P[1]=w[1]-U[1],P[2]=w[2]-U[2],P;}function v(P,w,U){return P[0]=w[0]*U[0],P[1]=w[1]*U[1],P[2]=w[2]*U[2],P;}function S(P,w,U){return P[0]=w[0]/U[0],P[1]=w[1]/U[1],P[2]=w[2]/U[2],P;}function O(P,w){return P[0]=Math.ceil(w[0]),P[1]=Math.ceil(w[1]),P[2]=Math.ceil(w[2]),P;}function x(P,w){return P[0]=Math.floor(w[0]),P[1]=Math.floor(w[1]),P[2]=Math.floor(w[2]),P;}function m(P,w,U){return P[0]=Math.min(w[0],U[0]),P[1]=Math.min(w[1],U[1]),P[2]=Math.min(w[2],U[2]),P;}function T(P,w,U){return P[0]=Math.max(w[0],U[0]),P[1]=Math.max(w[1],U[1]),P[2]=Math.max(w[2],U[2]),P;}function l(P,w){return P[0]=Math.round(w[0]),P[1]=Math.round(w[1]),P[2]=Math.round(w[2]),P;}function d(P,w,U){return P[0]=w[0]*U,P[1]=w[1]*U,P[2]=w[2]*U,P;}function u(P,w,U,H){return P[0]=w[0]+U[0]*H,P[1]=w[1]+U[1]*H,P[2]=w[2]+U[2]*H,P;}function g(P,w){var U=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return Math.hypot(U,H,Y);}function M(P,w){var U=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return U*U+H*H+Y*Y;}function A(P){var w=P[0],U=P[1],H=P[2];return w*w+U*U+H*H;}function R(P,w){return P[0]=-w[0],P[1]=-w[1],P[2]=-w[2],P;}function b(P,w){return P[0]=1/w[0],P[1]=1/w[1],P[2]=1/w[2],P;}function E(P,w){var U=w[0],H=w[1],Y=w[2],k=U*U+H*H+Y*Y;return k>0&&(k=1/Math.sqrt(k)),P[0]=w[0]*k,P[1]=w[1]*k,P[2]=w[2]*k,P;}function L(P,w){return P[0]*w[0]+P[1]*w[1]+P[2]*w[2];}function D(P,w,U){var H=w[0],Y=w[1],k=w[2],rt=U[0],it=U[1],lt=U[2];return P[0]=Y*lt-k*it,P[1]=k*rt-H*lt,P[2]=H*it-Y*rt,P;}function I(P,w,U,H){var Y=w[0],k=w[1],rt=w[2];return P[0]=Y+H*(U[0]-Y),P[1]=k+H*(U[1]-k),P[2]=rt+H*(U[2]-rt),P;}function C(P,w,U,H,Y,k){var rt=k*k,it=rt*(2*k-3)+1,lt=rt*(k-2)+k,ut=rt*(k-1),at=rt*(3-2*k);return P[0]=w[0]*it+U[0]*lt+H[0]*ut+Y[0]*at,P[1]=w[1]*it+U[1]*lt+H[1]*ut+Y[1]*at,P[2]=w[2]*it+U[2]*lt+H[2]*ut+Y[2]*at,P;}function W(P,w,U,H,Y,k){var rt=1-k,it=rt*rt,lt=k*k,ut=it*rt,at=3*k*it,st=3*lt*rt,ft=lt*k;return P[0]=w[0]*ut+U[0]*at+H[0]*st+Y[0]*ft,P[1]=w[1]*ut+U[1]*at+H[1]*st+Y[1]*ft,P[2]=w[2]*ut+U[2]*at+H[2]*st+Y[2]*ft,P;}function G(P,w){w=w||1;var U=e.RANDOM()*2*Math.PI,H=e.RANDOM()*2-1,Y=Math.sqrt(1-H*H)*w;return P[0]=Math.cos(U)*Y,P[1]=Math.sin(U)*Y,P[2]=H*w,P;}function K(P,w,U){var H=w[0],Y=w[1],k=w[2],rt=U[3]*H+U[7]*Y+U[11]*k+U[15];return rt=rt||1,P[0]=(U[0]*H+U[4]*Y+U[8]*k+U[12])/rt,P[1]=(U[1]*H+U[5]*Y+U[9]*k+U[13])/rt,P[2]=(U[2]*H+U[6]*Y+U[10]*k+U[14])/rt,P;}function J(P,w,U){var H=w[0],Y=w[1],k=w[2];return P[0]=H*U[0]+Y*U[3]+k*U[6],P[1]=H*U[1]+Y*U[4]+k*U[7],P[2]=H*U[2]+Y*U[5]+k*U[8],P;}function Z(P,w,U){var H=U[0],Y=U[1],k=U[2],rt=U[3],it=w[0],lt=w[1],ut=w[2],at=Y*ut-k*lt,st=k*it-H*ut,ft=H*lt-Y*it,vt=Y*ft-k*st,mt=k*at-H*ft,pt=H*st-Y*at,St=rt*2;return at*=St,st*=St,ft*=St,vt*=2,mt*=2,pt*=2,P[0]=it+at+vt,P[1]=lt+st+mt,P[2]=ut+ft+pt,P;}function B(P,w,U,H){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[0],k[1]=Y[1]*Math.cos(H)-Y[2]*Math.sin(H),k[2]=Y[1]*Math.sin(H)+Y[2]*Math.cos(H),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function $(P,w,U,H){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[2]*Math.sin(H)+Y[0]*Math.cos(H),k[1]=Y[1],k[2]=Y[2]*Math.cos(H)-Y[0]*Math.sin(H),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function Q(P,w,U,H){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[0]*Math.cos(H)-Y[1]*Math.sin(H),k[1]=Y[0]*Math.sin(H)+Y[1]*Math.cos(H),k[2]=Y[2],P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function et(P,w){var U=P[0],H=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2],lt=Math.sqrt(U*U+H*H+Y*Y),ut=Math.sqrt(k*k+rt*rt+it*it),at=lt*ut,st=at&&L(P,w)/at;return Math.acos(Math.min(Math.max(st,-1),1));}function tt(P){return P[0]=0,P[1]=0,P[2]=0,P;}function ot(P){return"vec3("+P[0]+", "+P[1]+", "+P[2]+")";}function q(P,w){return P[0]===w[0]&&P[1]===w[1]&&P[2]===w[2];}function gt(P,w){var U=P[0],H=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2];return Math.abs(U-k)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(k))&&Math.abs(H-rt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(rt))&&Math.abs(Y-it)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(it));}var dt=c,F=v,j=S,V=g,X=M,N=a,z=A,y=function(){var P=n();return function(w,U,H,Y,k,rt){var it,lt;for(U||(U=3),H||(H=0),Y?lt=Math.min(Y*U+H,w.length):lt=w.length,it=H;it0&&(y=1/Math.sqrt(y)),F[0]=V*y,F[1]=X*y,F[2]=N*y,F[3]=z*y,F;}function L(F,j){return F[0]*j[0]+F[1]*j[1]+F[2]*j[2]+F[3]*j[3];}function D(F,j,V,X){var N=V[0]*X[1]-V[1]*X[0],z=V[0]*X[2]-V[2]*X[0],y=V[0]*X[3]-V[3]*X[0],P=V[1]*X[2]-V[2]*X[1],w=V[1]*X[3]-V[3]*X[1],U=V[2]*X[3]-V[3]*X[2],H=j[0],Y=j[1],k=j[2],rt=j[3];return F[0]=Y*U-k*w+rt*P,F[1]=-(H*U)+k*y-rt*z,F[2]=H*w-Y*y+rt*N,F[3]=-(H*P)+Y*z-k*N,F;}function I(F,j,V,X){var N=j[0],z=j[1],y=j[2],P=j[3];return F[0]=N+X*(V[0]-N),F[1]=z+X*(V[1]-z),F[2]=y+X*(V[2]-y),F[3]=P+X*(V[3]-P),F;}function C(F,j){j=j||1;var V,X,N,z,y,P;do V=e.RANDOM()*2-1,X=e.RANDOM()*2-1,y=V*V+X*X;while(y>=1);do N=e.RANDOM()*2-1,z=e.RANDOM()*2-1,P=N*N+z*z;while(P>=1);var w=Math.sqrt((1-y)/P);return F[0]=j*V,F[1]=j*X,F[2]=j*N*w,F[3]=j*z*w,F;}function W(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3];return F[0]=V[0]*X+V[4]*N+V[8]*z+V[12]*y,F[1]=V[1]*X+V[5]*N+V[9]*z+V[13]*y,F[2]=V[2]*X+V[6]*N+V[10]*z+V[14]*y,F[3]=V[3]*X+V[7]*N+V[11]*z+V[15]*y,F;}function G(F,j,V){var X=j[0],N=j[1],z=j[2],y=V[0],P=V[1],w=V[2],U=V[3],H=U*X+P*z-w*N,Y=U*N+w*X-y*z,k=U*z+y*N-P*X,rt=-y*X-P*N-w*z;return F[0]=H*U+rt*-y+Y*-w-k*-P,F[1]=Y*U+rt*-P+k*-y-H*-w,F[2]=k*U+rt*-w+H*-P-Y*-y,F[3]=j[3],F;}function K(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=0,F;}function J(F){return"vec4("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}function Z(F,j){return F[0]===j[0]&&F[1]===j[1]&&F[2]===j[2]&&F[3]===j[3];}function B(F,j){var V=F[0],X=F[1],N=F[2],z=F[3],y=j[0],P=j[1],w=j[2],U=j[3];return Math.abs(V-y)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(y))&&Math.abs(X-P)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(P))&&Math.abs(N-w)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(w))&&Math.abs(z-U)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(U));}var $=p,Q=c,et=v,tt=u,ot=g,q=M,gt=A,dt=function(){var F=n();return function(j,V,X,N,z,y){var P,w;for(V||(V=4),X||(X=0),N?w=Math.min(N*V+X,j.length):w=j.length,P=X;P0){V=Math.sqrt(V);var X=j[0]/V,N=j[1]/V,z=j[2]/V,y=j[3]/V,P=j[4],w=j[5],U=j[6],H=j[7],Y=X*P+N*w+z*U+y*H;F[0]=X,F[1]=N,F[2]=z,F[3]=y,F[4]=(P-X*Y)/V,F[5]=(w-N*Y)/V,F[6]=(U-z*Y)/V,F[7]=(H-y*Y)/V;}return F;}function q(F){return"quat2("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+", "+F[6]+", "+F[7]+")";}function gt(F,j){return F[0]===j[0]&&F[1]===j[1]&&F[2]===j[2]&&F[3]===j[3]&&F[4]===j[4]&&F[5]===j[5]&&F[6]===j[6]&&F[7]===j[7];}function dt(F,j){var V=F[0],X=F[1],N=F[2],z=F[3],y=F[4],P=F[5],w=F[6],U=F[7],H=j[0],Y=j[1],k=j[2],rt=j[3],it=j[4],lt=j[5],ut=j[6],at=j[7];return Math.abs(V-H)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(H))&&Math.abs(X-Y)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Y))&&Math.abs(N-k)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(k))&&Math.abs(z-rt)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(rt))&&Math.abs(y-it)<=e.EPSILON*Math.max(1,Math.abs(y),Math.abs(it))&&Math.abs(P-lt)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(lt))&&Math.abs(w-ut)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(ut))&&Math.abs(U-at)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(at));}},/* 11 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return f;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return S;}),t.d(r,"floor",function(){return O;}),t.d(r,"min",function(){return x;}),t.d(r,"max",function(){return m;}),t.d(r,"round",function(){return T;}),t.d(r,"scale",function(){return l;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return G;}),t.d(r,"transformMat3",function(){return K;}),t.d(r,"transformMat4",function(){return J;}),t.d(r,"rotate",function(){return Z;}),t.d(r,"angle",function(){return B;}),t.d(r,"zero",function(){return $;}),t.d(r,"str",function(){return Q;}),t.d(r,"exactEquals",function(){return et;}),t.d(r,"equals",function(){return tt;}),t.d(r,"len",function(){return ot;}),t.d(r,"sub",function(){return q;}),t.d(r,"mul",function(){return gt;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return F;}),t.d(r,"sqrDist",function(){return j;}),t.d(r,"sqrLen",function(){return V;}),t.d(r,"forEach",function(){return X;});var e=t(2);function n(){var N=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0),N;}function i(N){var z=new e.ARRAY_TYPE(2);return z[0]=N[0],z[1]=N[1],z;}function a(N,z){var y=new e.ARRAY_TYPE(2);return y[0]=N,y[1]=z,y;}function o(N,z){return N[0]=z[0],N[1]=z[1],N;}function s(N,z,y){return N[0]=z,N[1]=y,N;}function f(N,z,y){return N[0]=z[0]+y[0],N[1]=z[1]+y[1],N;}function p(N,z,y){return N[0]=z[0]-y[0],N[1]=z[1]-y[1],N;}function c(N,z,y){return N[0]=z[0]*y[0],N[1]=z[1]*y[1],N;}function v(N,z,y){return N[0]=z[0]/y[0],N[1]=z[1]/y[1],N;}function S(N,z){return N[0]=Math.ceil(z[0]),N[1]=Math.ceil(z[1]),N;}function O(N,z){return N[0]=Math.floor(z[0]),N[1]=Math.floor(z[1]),N;}function x(N,z,y){return N[0]=Math.min(z[0],y[0]),N[1]=Math.min(z[1],y[1]),N;}function m(N,z,y){return N[0]=Math.max(z[0],y[0]),N[1]=Math.max(z[1],y[1]),N;}function T(N,z){return N[0]=Math.round(z[0]),N[1]=Math.round(z[1]),N;}function l(N,z,y){return N[0]=z[0]*y,N[1]=z[1]*y,N;}function d(N,z,y,P){return N[0]=z[0]+y[0]*P,N[1]=z[1]+y[1]*P,N;}function u(N,z){var y=z[0]-N[0],P=z[1]-N[1];return Math.hypot(y,P);}function g(N,z){var y=z[0]-N[0],P=z[1]-N[1];return y*y+P*P;}function M(N){var z=N[0],y=N[1];return Math.hypot(z,y);}function A(N){var z=N[0],y=N[1];return z*z+y*y;}function R(N,z){return N[0]=-z[0],N[1]=-z[1],N;}function b(N,z){return N[0]=1/z[0],N[1]=1/z[1],N;}function E(N,z){var y=z[0],P=z[1],w=y*y+P*P;return w>0&&(w=1/Math.sqrt(w)),N[0]=z[0]*w,N[1]=z[1]*w,N;}function L(N,z){return N[0]*z[0]+N[1]*z[1];}function D(N,z,y){var P=z[0]*y[1]-z[1]*y[0];return N[0]=N[1]=0,N[2]=P,N;}function I(N,z,y,P){var w=z[0],U=z[1];return N[0]=w+P*(y[0]-w),N[1]=U+P*(y[1]-U),N;}function C(N,z){z=z||1;var y=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(y)*z,N[1]=Math.sin(y)*z,N;}function W(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[2]*w,N[1]=y[1]*P+y[3]*w,N;}function G(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[2]*w+y[4],N[1]=y[1]*P+y[3]*w+y[5],N;}function K(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[3]*w+y[6],N[1]=y[1]*P+y[4]*w+y[7],N;}function J(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[4]*w+y[12],N[1]=y[1]*P+y[5]*w+y[13],N;}function Z(N,z,y,P){var w=z[0]-y[0],U=z[1]-y[1],H=Math.sin(P),Y=Math.cos(P);return N[0]=w*Y-U*H+y[0],N[1]=w*H+U*Y+y[1],N;}function B(N,z){var y=N[0],P=N[1],w=z[0],U=z[1],H=Math.sqrt(y*y+P*P)*Math.sqrt(w*w+U*U),Y=H&&(y*w+P*U)/H;return Math.acos(Math.min(Math.max(Y,-1),1));}function $(N){return N[0]=0,N[1]=0,N;}function Q(N){return"vec2("+N[0]+", "+N[1]+")";}function et(N,z){return N[0]===z[0]&&N[1]===z[1];}function tt(N,z){var y=N[0],P=N[1],w=z[0],U=z[1];return Math.abs(y-w)<=e.EPSILON*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(P-U)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(U));}var ot=M,q=p,gt=c,dt=v,F=u,j=g,V=A,X=function(){var N=n();return function(z,y,P,w,U,H){var Y,k;for(y||(y=2),P||(P=0),w?k=Math.min(w*y+P,z.length):k=z.length,Y=P;Y1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var I=D.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var C=L;L={getContext:function getContext(){return C;},width:D.width,height:D.height},C.canvas=L,I="2d";}if(this[M]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(D.contextType=I,this[d]=Object.assign({},O,D),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[d].webgl2=!0);var _C=new e["default"](L,this[d]);I==="webgl2"&&!_C.isWebGL2&&(D.contextType="webgl"),Object(S.createShaders)(_C),Object(S.applyShader)(_C),Object(S.createCloudShaders)(_C);var W=_C.gl;W.clearColor(0,0,0,0),W.blendFuncSeparate(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA,W.ONE,W.ONE_MINUS_SRC_ALPHA),this[T]=_C;}else this[l]=new i["default"](L,this[d]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(b,[{key:"canvas",get:function get(){return this[M];}},{key:"canvasRenderer",get:function get(){return this[l];}},{key:"glRenderer",get:function get(){return this[T];}},{key:"isWebGL2",get:function get(){return this[T]&&this[T].isWebGL2;}},{key:"options",get:function get(){return this[d];}},{key:"globalTransformMatrix",get:function get(){var L=this[u];return[L[0],L[1],L[3],L[4],L[6],L[7]];}},{key:"viewMatrix",get:function get(){return this[u];}},{key:g,value:function value(){var L=this[T]||this[l];if(this[T]){var _this$canvas=this.canvas,D=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[D,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,D=_this$canvas2.height,I=[// translation\n1,0,0,0,1,0,-L/2,-D/2,1],C=[// scale\n2/L,0,0,0,-2/D,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,L,D);}},{key:"createTexture",value:function createTexture(L,D){return(this[T]||this[l]).createTexture(L,D);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$useImageBitmap=_ref3.useImageBitmap,D=_ref3$useImageBitmap===void 0?!1:_ref3$useImageBitmap;return(this[T]||this[l]).loadTexture(L,{useImageBitmap:D});}},{key:"createText",value:function createText(L){var _ref4=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref4$font=_ref4.font,D=_ref4$font===void 0?"16px arial":_ref4$font,_ref4$fillColor=_ref4.fillColor,I=_ref4$fillColor===void 0?null:_ref4$fillColor,_ref4$strokeColor=_ref4.strokeColor,C=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[T]){var G=v["default"].createText(L,{font:D,fillColor:I,strokeColor:C,strokeWidth:W});return{image:this.createTexture(G.image),rect:G.rect};}return{_img:{font:D,fillColor:I,strokeColor:C,strokeWidth:W,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref5.vertex,D=_ref5.fragment,I=_ref5.options;if(this[T]){var C=this[T].compileSync(D,L);return C._attribOpts=I,C;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref6$vertex=_ref6.vertex,L=_ref6$vertex===void 0?x:_ref6$vertex,_ref6$fragment=_ref6.fragment,D=_ref6$fragment===void 0?m:_ref6$fragment,I=_ref6.options;return this.createProgram({vertex:L,fragment:D,options:I});}},{key:"useProgram",value:function useProgram(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[T]){var I=Object.assign({},L._attribOpts,D);return this[T].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[T]||this[l]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$l;if(this[T]){var D=this[T].gl;D.clear(D.COLOR_BUFFER_BIT);}else(_this$l=this[l]).clear.apply(_this$l,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(L){var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,D=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var C=this[T]||this[l],W=I||L.program;if(this[T]){var G=C.gl;if(D&&G.clear(G.COLOR_BUFFER_BIT),W)C.program!==W&&this.useProgram(W,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});else{var K=L.mesh.meshData,J=!!K.uniforms.u_texSampler,Z=!!K.uniforms.u_filterFlag,B=!!K.uniforms.u_radialGradientVector,$=L.hasCloudColor,Q=L.hasCloudFilter,et=!!K.uniforms.u_clipSampler;Object(S.applyCloudShader)(C,{hasTexture:J,hasFilter:Z,hasGradient:B,hasCloudColor:$,hasCloudFilter:Q,hasClipPath:et});}this[g](),C.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(G,L),A(C),L.afterRender&&L.afterRender(G,L);}else C.setTransform(this.globalTransformMatrix),C.drawMeshCloud(L,{clear:D,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(L){var _this3=this;var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$clear=_ref8.clear,D=_ref8$clear===void 0?!1:_ref8$clear,_ref8$program=_ref8.program,I=_ref8$program===void 0?null:_ref8$program;var C=this[T]||this[l];if(this[T]){var W=C.fbo,G=Object(a["default"])(this,L,I==null),K=C.gl;D&&K.clear(K.COLOR_BUFFER_BIT);var J=!Object(c.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator=_createForOfIteratorHelper(G),_step;try{var _loop=function _loop(){var Z=_step.value;_this3._drawCalls++;var B=I||Z.program;if(Z instanceof p["default"])_this3.drawMeshCloud(Z,{clear:D,program:B});else{var _this3$canvas=_this3.canvas,$=_this3$canvas.width,Q=_this3$canvas.height;if(Z.beforeRender&&Z.beforeRender(K,Z),Z.pass.length&&((!_this3.fbo||_this3.fbo.width!==$||_this3.fbo.height!==Q)&&(_this3.fbo={width:$,height:Q,target:C.createFBO(),buffer:C.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),C.bindFBO(_this3.fbo.target)),!B&&Z.filterCanvas){Object(S.applyShader)(C,{hasTexture:!0});var et=_this3.filterContext;et||(et=v["default"].createCanvas($,Q).getContext("2d"),_this3.filterContext=et);var tt=L[Z.packIndex],ot=tt.filter,q=L[Z.packIndex+1],gt=L[Z.packIndex-1];(!gt||!gt.filterCanvas||gt.filter!==ot)&&(!q||!q.filterCanvas||q.filter!==ot)?(J?(et.save(),Object(o.drawMesh2D)(tt,et,!1),et.restore(),Object(o.applyFilter)(et,ot)):Object(o.drawMesh2D)(tt,et,!0),_this3[g](),R(C,et,$,Q)):(J&&et.save(),Object(o.drawMesh2D)(tt,et,!1),J&&et.restore(),(!q||!q.filterCanvas||tt.filter!==q.filter)&&(Object(o.applyFilter)(et,ot),_this3[g](),R(C,et,$,Q)));}else{if(B)C.program!==B&&_this3.useProgram(B,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _et=!!Z.uniforms.u_texSampler,_tt=!!Z.uniforms.u_filterFlag,_ot=!!Z.uniforms.u_radialGradientVector,_q=!!Z.uniforms.u_clipSampler;Object(S.applyShader)(C,{hasTexture:_et,hasFilter:_tt,hasGradient:_ot,hasClipPath:_q});}Z.filterCanvas&&console.warn("User program ignored some filter effects."),_this3[g](),C.setMeshData([Z]),A(C);}if(Z.pass.length){var _et2=Z.pass.length;Z.pass.forEach(function(tt,ot){tt.blend=Z.enableBlend,tt.setTexture(C.fbo.texture),ot===_et2-1?C.bindFBO(W):(_this3.fbo.swap(),C.bindFBO(_this3.fbo.target)),tt.program?C.useProgram(tt.program):(_this3.defaultPassProgram=_this3.defaultPassProgram||_this3.createPassProgram(),C.useProgram(_this3.defaultPassProgram)),C.setMeshData([tt.meshData]),K.clear(K.COLOR_BUFFER_BIT),A(C);});}Z.afterRender&&Z.afterRender(K,Z);}};for(_iterator.s();!(_step=_iterator.n()).done;){_loop();}}catch(err){_iterator.e(err);}finally{_iterator.f();}}else C.setTransform(this.globalTransformMatrix),C.drawMeshes(L,{clear:D});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,D=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){D[_key-1]=arguments[_key];}var I=D.length;if(I<2)throw new TypeError("Failed to execute \'drawImage\' on \'Renderer\': 3 arguments required, but only ".concat(D.length+1," present."));if(I!==2&&I!==4&&I!==8)throw new TypeError("Failed to execute \'drawImage\' on \'Renderer\': Valid arities are: [3, 5, 9], but ".concat(D.length+1," arguments provided."));var C=null,W=null;I===2?C=[D[0],D[1],L.width,L.height]:I===4?C=D:I===8&&(W=D.slice(0,4),C=D.slice(4));var G=this.createTexture(L),_this$canvas3=this.canvas,K=_this$canvas3.width,J=_this$canvas3.height,Z=new s["default"]();Z.rect(C[0],C[1],K,J);var B=new f["default"](Z,{width:K,height:J});B.setTexture(G,{rect:C,srcRect:W}),this.drawMeshes([B]),this.deleteTexture(G);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[u]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var D=this[u];for(var _len2=arguments.length,L=new Array(_len2),_key2=0;_key2<_len2;_key2++){L[_key2]=arguments[_key2];}return this[u]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),D,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,D){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,D]),this.globalTransform.apply(this,_toConsumableArray(I));}},{key:"globalRotate",value:function globalRotate(L){var _ref10=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref11=_slicedToArray(_ref10,2),D=_ref11[0],I=_ref11[1];var C=n.mat3.create();return C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[D,I]),C=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),C,L),C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[-D,-I]),this.globalTransform.apply(this,_toConsumableArray(C));}},{key:"globalScale",value:function globalScale(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),I=_ref13[0],C=_ref13[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,C]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[L,D]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref14=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref15=_slicedToArray(_ref14,2),I=_ref15[0],C=_ref15[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,C]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(D),Math.tan(L),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,D,I){var C=this.globalTransformMatrix;I&&(C=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I));var W=L*C[0]+D*C[2]+C[4],G=L*C[1]+D*C[3]+C[5];return[W,G];}}]);}();},/* 14 */ /***/function(h,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;});var e=t(16),n=t(17),i=t(18),a=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var s={};function f(O){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var m=[],T=O.length;for(var l=0;l1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,S);this.options=Object.assign({},S.defaultOptions,m),this.canvas=x;var T;this.options.webgl2&&(T=x.getContext("webgl2",this.options)),T==null&&(T=Object(e.setupWebGL)(x,this.options),this.aia_ext=T.getExtension("ANGLE_instanced_arrays")),this.gl=T,T.viewport(0,0,x.width,x.height),T.clearColor(0,0,0,0),T.blendFuncSeparate(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA,T.ONE,T.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(S,[{key:"program",get:function get(){var x=this.gl;return x.getParameter(x.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()\n// WebGLRenderingContext.uniformMatrix[234]fv()\n},{key:"_declareUniform",value:function _declareUniform(x,m){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var l=this.gl,d=l.getUniformLocation(x,m);var u;var g=this;if(/^sampler/.test(T)){var M=x._samplerMap,A=x._bindTextures;Object.defineProperty(x.uniforms,m,{get:function get(){return u;},set:function set(R){u=R;var b=M[m]!=null?M[m]:A.length;A[b]=R,c(l,R,b),M[m]||(M[m]=b,l.uniform1i(d,b)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _M=T.indexOf("Matrix")===0,_A=!_M&&/v$/.test(T),R=l["uniform".concat(T)].bind(l);Object.defineProperty(x.uniforms,m,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_M?R(d,!1,b):_A?R(d,b):R.apply(void 0,[d].concat(_toConsumableArray(b))),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this4=this;var x=this.program;x.meshData.forEach(function(m,T){var l=m.positions,d=m.cells,u=m.instanceCount,g=m.cellsCount,M=m.attributes,A=m.uniforms,R=m.textureCoord,b=m.enableBlend,E=_this4.gl;var L=m.mode!=null?m.mode:E.TRIANGLES;typeof L=="string"&&(L=E[L]),b?E.enable(E.BLEND):E.disable(E.BLEND),E.bindBuffer(E.ARRAY_BUFFER,x._buffers.verticesBuffer),E.bufferData(E.ARRAY_BUFFER,l,E.STATIC_DRAW),d&&(E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,x._buffers.cellsBuffer),E.bufferData(E.ELEMENT_ARRAY_BUFFER,d,E.STATIC_DRAW));var D=[];M&&Object.values(M).forEach(function(_ref16){var C=_ref16.name,W=_ref16.data,G=_ref16.divisor;if(E.bindBuffer(E.ARRAY_BUFFER,x._buffers[C]),E.bufferData(E.ARRAY_BUFFER,W,E.STATIC_DRAW),G!=null){var K=E.getAttribLocation(x,C);K>=0&&(E.enableVertexAttribArray(K),D.push(K),E.vertexAttribDivisor?E.vertexAttribDivisor(K,G):_this4.aia_ext&&_this4.aia_ext.vertexAttribDivisorANGLE(K,G));}}),A&&Object.entries(A).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),C=_ref18[0],W=_ref18[1];_this4.uniforms[C]=W;});var I;if(!d){var C=x._dimension;I=l.length/C;}if(x._enableTextures&&x._buffers.texCoordBuffer){var _C2=R||f(l,x._dimension);E.bindBuffer(E.ARRAY_BUFFER,x._buffers.texCoordBuffer),E.bufferData(E.ARRAY_BUFFER,S.FLOAT(_C2),E.STATIC_DRAW);}u!=null?(d?E.drawElementsInstanced?E.drawElementsInstanced(L,g,E.UNSIGNED_SHORT,0,u):_this4.aia_ext&&_this4.aia_ext.drawElementsInstancedANGLE(L,g,E.UNSIGNED_SHORT,0,u):E.drawArraysInstanced?E.drawArraysInstanced(L,0,I,u):_this4.aia_ext.drawArraysInstancedANGLE(L,0,I,u),D.forEach(function(C){E.vertexAttribDivisor?E.vertexAttribDivisor(C,null):_this4.aia_ext&&_this4.aia_ext.vertexAttribDivisorANGLE(C,null);})):d?E.drawElements(L,g,E.UNSIGNED_SHORT,0):E.drawArrays(L,0,I);});}},{key:"isWebGL2",get:function get(){return(typeof WebGL2RenderingContext==="undefined"?"undefined":_typeof(WebGL2RenderingContext))<"u"&&this.gl instanceof WebGL2RenderingContext;}},{key:"enableTextures",get:function get(){return this.program&&this.program._enableTextures;}},{key:"uniforms",get:function get(){var x=this.program;if(!x||!x.uniforms)throw Error("No avaliable program.");return x.uniforms;}},{key:"deleteProgram",value:function deleteProgram(x){var m=this.gl;this.program===x&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),m.useProgram(null));var T=this.programs.indexOf(x);T>=0&&this.programs.splice(T,1),p(m,x),m.deleteProgram(x);}/**\n [{\n positions: ...\n cells: ...\n textureCoord: ...\n attributes: {name: {data:..., normalize: true}},\n uniforms: ...\n }]\n */},{key:"setMeshData",value:function setMeshData(x){var _this5=this;Array.isArray(x)||(x=[x]);var m=this.program;m.meshData=x.map(function(_ref19){var T=_ref19.mode,l=_ref19.positions,d=_ref19.instanceCount,u=_ref19.cells,g=_ref19.cellsCount,M=_ref19.attributes,A=_ref19.uniforms,R=_ref19.textureCoord,b=_ref19.enableBlend;var E={positions:S.FLOAT(l),uniforms:A,enableBlend:!!b,textureCoord:S.FLOAT(R)};if(u&&(E.cells=S.USHORT(u),E.cellsCount=g||E.cells.length),T!=null&&(E.mode=T),d!=null){if(!_this5.isWebGL2&&!_this5.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");E.instanceCount=d;}if(M){var L={};Object.entries(M).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),D=_ref21[0],I=_ref21[1];if(!m._attribute[D])m._attribute[D]="ignored";else if(m._attribute[D]!=="ignored"){var _m$_attribute$D=m._attribute[D],C=_m$_attribute$D.name,W=_m$_attribute$D.type;var G=I.data||I;if(Array.isArray(G)&&(G=S[W](G)),L[D]={name:C,data:G},I.divisor!=null){if(!_this5.isWebGL2&&!_this5.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[D].divisor=I.divisor;}}}),E.attributes=L;}return E;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(x,m){var _this6=this;var T=/^\\s*uniform\\s+sampler/mg.test(x);x==null&&(x=i["default"]),m==null&&(m=T?a["default"]:n["default"]);var l=this.gl,d=Object(e.createProgram)(l,m,x);d.shaderText={vertexShader:m,fragmentShader:x},d._buffers={},d._attribute={},d.uniforms={},d._samplerMap={},d._bindTextures=[];var u=new RegExp("(?:attribute|in) vec(\\\\d) ".concat(this.options.vertexPosition),"im");var g=m.match(u);g&&(d._dimension=Number(g[1]));var M=new RegExp("(?:attribute|in) vec(\\\\d) ".concat(this.options.vertexTextureCoord),"im");g=m.match(M),g&&(d._texCoordSize=Number(g[1]));var A=/^\\s*(?:attribute|in) (\\w+?)(\\d*) (\\w+)/gim;if(g=m.match(A),g)for(var E=0;E=0,d._enableTextures&&(d._buffers.texCoordBuffer=l.createBuffer()),this.programs.push(d),d;}},{key:"useProgram",value:function useProgram(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var T=this.gl;T.useProgram(x);var l=x._dimension;T.bindBuffer(T.ARRAY_BUFFER,x._buffers.verticesBuffer);var d=T.getAttribLocation(x,this.options.vertexPosition);if(T.vertexAttribPointer(d,l,T.FLOAT,!1,0,0),T.enableVertexAttribArray(d),x._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,x._buffers.texCoordBuffer);var u=T.getAttribLocation(x,this.options.vertexTextureCoord);T.vertexAttribPointer(u,x._texCoordSize||2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(u);}if(Object.entries(x._attribute).forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],g=_ref23[1];if(g!=="ignored"){var M=g.size,A=m[u]||{},R=!!A.normalize;var b=A.type||"FLOAT";var E=A.key||u;b==="UBYTE"&&(b="UNSIGNED_BYTE"),b==="USHORT"&&(b="UNSIGNED_SHORT"),g.type=b,E&&E!==u&&(x._attribute[E]=g),T.bindBuffer(T.ARRAY_BUFFER,x._buffers[u]);var L=T.getAttribLocation(x,u);L>=0&&(T.vertexAttribPointer(L,M,T[b],R,0,0),T.enableVertexAttribArray(L));}}),!x.meshData){var _u2=[[-1,-1,0,1].slice(0,l),[1,-1,0,1].slice(0,l),[1,1,0,1].slice(0,l),[-1,1,0,1].slice(0,l)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:_u2,cells:g});}return x;}},{key:"compileSync",value:function compileSync(x,m){x=x||i["default"];var T={};function l(M){M=M.replace(/^\\s*/mg,"");var A=[],R=M.match(/^#pragma\\s+include\\s+.*/mg);if(R){for(var b=0;b|")/);if(L){var D=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),T[I])A.push("/* included ".concat(I," */"));else if(T[I]=!0,D==="lib"){var C=l(s[I]);A.push(C);}else if(D==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}A.forEach(function(b){M=M.replace(/^#pragma\\s+include\\s+.*/m,b);});}return M;}var d=l(x),u=m?l(m):null;return this.createProgram(d,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(x,m){var T,l,_l4,d,u;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_l4=function _l6(){_l4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(M){var A,R,b,L,D,I,C,_C3;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:M=M.replace(/^\\s*/mg,"");A=[],R=M.match(/^#pragma\\s+include\\s+.*/mg);if(!R){_context2.next=32;break;}b=0;case 4:if(!(b|")/);if(!L){_context2.next=28;break;}D=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),T[I])){_context2.next=13;break;}A.push("/* included ".concat(I," */"));_context2.next=28;break;case 13:if(!(T[I]=!0,D==="lib")){_context2.next=20;break;}_context2.next=16;return l(s[I]);case 16:C=_context2.sent;A.push(C);_context2.next=28;break;case 20:if(!(D==="link")){_context2.next=28;break;}_context2.next=23;return S.fetchShader(I);case 23:_C3=_context2.sent;_context2.next=26;return l(_C3);case 26:_C3=_context2.sent;A.push(_C3);case 28:b++;_context2.next=4;break;case 31:A.forEach(function(b){M=M.replace(/^#pragma\\s+include\\s+.*/m,b);});case 32:return _context2.abrupt("return",M);case 33:case"end":return _context2.stop();}},_callee2);}));return _l4.apply(this,arguments);};l=function _l5(_x4){return _l4.apply(this,arguments);};x=x||i["default"];T={};_context3.next=6;return l(x);case 6:d=_context3.sent;if(!m){_context3.next=13;break;}_context3.next=10;return l(m);case 10:_context3.t0=_context3.sent;_context3.next=14;break;case 13:_context3.t0=null;case 14:u=_context3.t0;return _context3.abrupt("return",this.createProgram(d,u));case 16:case"end":return _context3.stop();}},_callee3,this);}));function compile(_x2,_x3){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(x){var m,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:m=_args4.length>1&&_args4[1]!==undefined?_args4[1]:null;_context4.next=3;return S.fetchShader(x);case 3:x=_context4.sent;_context4.t0=m;if(!_context4.t0){_context4.next=9;break;}_context4.next=8;return S.fetchShader(m);case 8:m=_context4.sent;case 9:return _context4.abrupt("return",this.compile(x,m));case 10:case"end":return _context4.stop();}},_callee4,this);}));function load(_x5){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this7=this;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref24=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref24$wrapS=_ref24.wrapS,m=_ref24$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapS,_ref24$wrapT=_ref24.wrapT,T=_ref24$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapT,_ref24$minFilter=_ref24.minFilter,l=_ref24$minFilter===void 0?this.gl.LINEAR:_ref24$minFilter,_ref24$magFilter=_ref24.magFilter,d=_ref24$magFilter===void 0?this.gl.LINEAR:_ref24$magFilter;var u=this.gl,g=Array.isArray(x)?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),u.activeTexture(u.TEXTURE0+this._max_texture_image_units-1);var M=u.createTexture();u.bindTexture(g,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,A=_this$canvas4.width,R=_this$canvas4.height;if(x){if(g===u.TEXTURE_CUBE_MAP)for(var b=0;b<6;b++)u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x[b]);else u.texImage2D(g,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x);}else if(g===u.TEXTURE_CUBE_MAP)for(var _b=0;_b<6;_b++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_b,0,u.RGBA,A,R,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(g,0,u.RGBA,A,R,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(g,u.TEXTURE_MIN_FILTER,l),u.texParameteri(g,u.TEXTURE_MAG_FILTER,d),u.texParameteri(g,u.TEXTURE_WRAP_S,m),u.texParameteri(g,u.TEXTURE_WRAP_T,T),g===u.TEXTURE_CUBE_MAP&&(x.width=x[0].width,x.height=x[0].height),u.bindTexture(g,null),M._img=x||{width:A,height:R},M["delete"]=function(){_this7.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(x){var m=x._img;this.gl.deleteTexture(x),typeof m.close=="function"&&m.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(x){var _ref25,_ref25$useImageBitmap,m,T,_args5=arguments;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_ref25=_args5.length>1&&_args5[1]!==undefined?_args5[1]:{},_ref25$useImageBitmap=_ref25.useImageBitmap,m=_ref25$useImageBitmap===void 0?!0:_ref25$useImageBitmap;_context5.next=3;return S.loadImage(x,{useImageBitmap:m});case 3:T=_context5.sent;return _context5.abrupt("return",this.createTexture(T));case 5:case"end":return _context5.stop();}},_callee5,this);}));function loadTexture(_x6){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$color=_ref26.color,x=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,m=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,T=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,l=_ref26$stencil===void 0?!!this.options.stencil:_ref26$stencil;var d=this.gl,u=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,u);var g=[];for(var R=0;R0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=x;}},{key:"render",value:function render(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,x=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var m=this.gl;var T=this.program;T||(T=this.createProgram(),this.useProgram(T)),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,this.fbo);var l=this.options.depth;l&&m.enable(m.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(l?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var d=this._renderFrameID;this._draw(),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,null),this._renderFrameID===d&&(this._renderFrameID=null);}},{key:"update",value:function update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)));}}],[{key:"addLibs",value:function addLibs(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,x);}},{key:"FLOAT",value:function FLOAT(x,m){return Object(e.pointsToBuffer)(x,Float32Array,m);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(x,m){return Object(e.pointsToBuffer)(x,Uint8Array,m);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(x,m){return Object(e.pointsToBuffer)(x,Uint16Array,m);}},{key:"BYTE",value:function BYTE(x,m){return Object(e.pointsToBuffer)(x,Int8Array,m);}},{key:"SHORT",value:function SHORT(x,m){return Object(e.pointsToBuffer)(x,Int16Array,m);}}]);}();o(S,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(S,"UBYTE",S.UNSIGNED_BYTE),o(S,"USHORT",S.UNSIGNED_SHORT),o(S,"fetchShader",e.fetchShader),o(S,"loadImage",e.loadImage);},/* 16 */ /***/function(h,r,t){t.r(r),t.d(r,"setupWebGL",function(){return n;}),t.d(r,"createProgram",function(){return i;}),t.d(r,"pointsToBuffer",function(){return a;}),t.d(r,"loadImage",function(){return s;}),t.d(r,"fetchShader",function(){return p;}),t(1).glMatrix.setMatrixArrayType(Array);function e(c,v){var S=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var O=null;for(var x=0;x1&&arguments[1]!==undefined?arguments[1]:Float32Array;var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(S&&!(S instanceof v))throw new TypeError("Wrong buffer type.");if(c==null||c instanceof v)return c;if(c[0]==null||c[0].length==null)return S?(S.set(c,0),S):new v(c);var O=c[0].length,x=c.length;S||(S=new v(O*x));var m=0;for(var _T10=0;_T101&&arguments[1]!==undefined?arguments[1]:{},_ref28$useImageBitmap=_ref28.useImageBitmap,v=_ref28$useImageBitmap===void 0?!0:_ref28$useImageBitmap,_ref28$alias=_ref28.alias,S=_ref28$alias===void 0?null:_ref28$alias;if(!o[c]){if(typeof Image=="function"){var O=new Image();typeof c=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(c)&&(O.crossOrigin="anonymous"),o[c]=new Promise(function(x){O.onload=function(){v&&typeof createImageBitmap=="function"?createImageBitmap(O,{imageOrientation:"flipY"}).then(function(m){o[c]=m,S&&(o[S]=m),x(m);}):(o[c]=O,S&&(o[S]=O),x(O));},O.src=c;}),S&&(o[S]=o[c]);}else if(typeof fetch=="function")return fetch(c,{method:"GET",mode:"cors",cache:"default"}).then(function(O){return O.blob();}).then(function(O){return createImageBitmap(O,{imageOrientation:"flipY"}).then(function(x){return o[c]=x,S&&(o[S]=x),x;});});}return o[c];}var f={};function p(_x7){return _p.apply(this,arguments);}function _p(){_p=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(c){var v,S;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!f[c]){_context6.next=2;break;}return _context6.abrupt("return",f[c]);case 2:_context6.next=4;return fetch(c);case 4:v=_context6.sent;if(!(v.status>=200&&v.status<300)){_context6.next=10;break;}_context6.next=8;return v.text();case 8:S=_context6.sent;return _context6.abrupt("return",(f[c]=S,S));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context6.stop();}},_callee6);}));return _p.apply(this,arguments);}},/* 17 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n gl_Position = vec4(a_vertexPosition, 1);\\n}";},/* 18 */ /***/function(h,r,t){t.r(r),r["default"]="#ifdef GL_ES\\nprecision mediump float;\\n#endif\\n\\nvoid main() {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);\\n}";},/* 19 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec4 a_vertexPosition;\\nattribute vec2 a_vertexTextureCoord;\\nvarying vec2 vTextureCoord;\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n gl_Position = a_vertexPosition;\\n vTextureCoord = a_vertexTextureCoord;\\n}";},/* 20 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return a;});var e=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var a=/*#__PURE__*/function(){function a(s,f){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=f,this[i]=[1,0,0,1,0,0];}return _createClass(a,[{key:"createTexture",value:function createTexture(s){return{_img:s};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s){var f;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e["default"].loadImage(s,{useImageBitmap:!1});case 2:f=_context7.sent;return _context7.abrupt("return",this.createTexture(f));case 4:case"end":return _context7.stop();}},_callee7,this);}));function loadTexture(_x8){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(s){return s;}},{key:"clear",value:function clear(s,f,p,c){var v=this.context;s=s||0,f=f||0,p=p||v.canvas.width-s,c=c||v.canvas.height-f,v.clearRect(s,f,p,c);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,f=_ref29$clear===void 0?!1:_ref29$clear;var p=[];for(var c=0;c1&&arguments[1]!==undefined?arguments[1]:{},_ref30$clear=_ref30.clear,f=_ref30$clear===void 0?!1:_ref30$clear,_ref30$hook=_ref30.hook,p=_ref30$hook===void 0?!0:_ref30$hook;var c=this.context;f&&c.clearRect(0,0,c.canvas.width,c.canvas.height);var v=null;var _c$canvas=c.canvas,S=_c$canvas.width,O=_c$canvas.height,x=s.length;s.forEach(function(m,T){var _m$_cloudOptions,_this8$filterBuffer;var l,d,u,g,M;p&&m.beforeRender&&m.beforeRender(c,m),m._cloudOptions&&((_m$_cloudOptions=_slicedToArray(m._cloudOptions,5),l=_m$_cloudOptions[0],d=_m$_cloudOptions[1],u=_m$_cloudOptions[2],g=_m$_cloudOptions[3],M=_m$_cloudOptions[4]),m=m.mesh);var A=m.filter;if(M&&(A=A?"".concat(A," ").concat(M):M),A&&!_this8.filterBuffer&&_this8.filterBuffer!==!1){var R=e["default"].createCanvas(S,O);R?_this8.filterBuffer=R.getContext("2d"):_this8.filterBuffer=!1;}v&&v!==A&&(Object(n.applyFilter)(_this8.filterBuffer,v),c.drawImage(_this8.filterBuffer.canvas,0,0,S,O),_this8.filterBuffer.clearRect(0,0,S,O),v=null),A&&_this8.filterBuffer?(_this8.filterBuffer.save(),(_this8$filterBuffer=_this8.filterBuffer).transform.apply(_this8$filterBuffer,_toConsumableArray(_this8[i])),Object(n.drawMesh2D)(m,_this8.filterBuffer,!1,l,d,u,g),_this8.filterBuffer.restore(),T===x-1?(Object(n.applyFilter)(_this8.filterBuffer,A),c.drawImage(_this8.filterBuffer.canvas,0,0,S,O),_this8.filterBuffer.clearRect(0,0,S,O)):v=A):(c.save(),c.transform.apply(c,_toConsumableArray(_this8[i])),Object(n.drawMesh2D)(m,c,!1,l,d,u,g),c.restore()),p&&m.afterRender&&m.afterRender(c,m);});}},{key:"setTransform",value:function setTransform(s){this[i]=s;}}]);}();},/* 21 */ /***/function(h,r,t){t.r(r),function(e){var n=t(14),i=t(23),a=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function s(S,O){var x=S.style,m=S.variant,T=S.weight,l=S.stretch,d=S.size,u=S.pxLineHeight,g=S.family;return l==="normal"?"".concat(x," ").concat(m," ").concat(T," ").concat(d*O,"px/").concat(u*O,"px ").concat(g):"".concat(x," ").concat(m," ").concat(T," ").concat(l," ").concat(d*O,"px/").concat(u*O,"px ").concat(g);}function f(S,_ref31){var O=_ref31.font,x=_ref31.fillColor,m=_ref31.strokeColor,T=_ref31.strokeWidth,_ref31$ratio=_ref31.ratio,l=_ref31$ratio===void 0?1:_ref31$ratio,d=_ref31.textCanvas,_ref31$cachable=_ref31.cachable,u=_ref31$cachable===void 0?!1:_ref31$cachable;var g;if(u){g=[S,O,String(x),String(m),String(T)].join("###");var G=o[g];if(G)return G;}d||(d=c(1,1));var M=d.getContext("2d");M.save(),M.font=O;var _M$measureText=M.measureText(S),A=_M$measureText.width;M.restore();var R=Object(i["default"])(O),b=Math.max(R.pxLineHeight,R.pxHeight*1.13);/italic|oblique/.test(O)&&(A+=b*Math.tan(15*Math.PI/180)),!x&&!m&&(x="#000");var E=M.canvas,L=Math.ceil(A),D=Math.ceil(b);E.width=Math.round(L*l),E.height=Math.round(D*l),M.save(),M.font=s(R,l),M.textAlign="center",M.textBaseline="middle";var I=E.height*0.5+R.pxHeight*0.05*l,C=E.width*0.5;if(x){if(Array.isArray(x))x=Object(a["default"])(x);else if(x.vector){var _G;var _x9=x,K=_x9.vector,J=_x9.colors;K.length===6?_G=M.createRadialGradient.apply(M,_toConsumableArray(K)):_G=M.createLinearGradient.apply(M,_toConsumableArray(K)),J.forEach(function(_ref32){var Z=_ref32.offset,B=_ref32.color;_G.addColorStop(Z,B);}),x=_G;}M.fillStyle=x,M.fillText(S,C,I);}if(m){if(M.lineWidth=T*l,Array.isArray(m))m=Object(a["default"])(m);else if(m.vector){var _G2;var _m=m,_K=_m.vector,_J=_m.colors;_K.length===6?_G2=M.createRadialGradient.apply(M,_toConsumableArray(_K)):_G2=M.createLinearGradient.apply(M,_toConsumableArray(_K)),_J.forEach(function(_ref33){var Z=_ref33.offset,B=_ref33.color;_G2.addColorStop(Z,B);}),m=_G2;}M.strokeStyle=m,M.strokeText(S,C,I);}M.restore();var W={image:d,rect:[0,0,L,D]};return u&&(o[g]=W),W;}var p=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var S=navigator.userAgent.toLowerCase().match(/chrome\\/(\\d+)/);S&&(p=Number(S[1])<70);}function c(S,O){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var m=x.offscreen||!p&&x.offscreen!==!1;var T;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(S,O,x):m&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(S,O):(T=document.createElement("canvas"),T.width=S,T.height=O),T;}var v={createCanvas:c,createText:f,loadImage:n["default"].loadImage};r["default"]=v;}.call(this,t(22));},/* 22 */ /***/function(h,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused7){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}h.exports=t;},/* 23 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return x;}),t(1).glMatrix.setMatrixArrayType(Array);function e(m,T){if(typeof m=="string"){var u=m.trim().match(/^([\\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);u?m={size:parseFloat(u[1]),unit:u[2]}:m={size:parseInt(m,10),unit:"px"};}var _m2=m,l=_m2.size,d=_m2.unit;if(d==="pt")l/=0.75;else if(d==="pc")l*=16;else if(d==="in")l*=96;else if(d==="cm")l*=96/2.54;else if(d==="mm")l*=96/25.4;else if(d==="em"||d==="rem"||d==="ex"){if(!T&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;T=e(_u3,16);}l*=T,d==="ex"&&(l/=2);}else if(d==="q")l*=96/25.4/4;else if(d==="vw"||d==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u4=d==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;l*=_u4/100;}}else if((d==="vmax"||d==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u5=document.documentElement.clientWidth,g=document.documentElement.clientHeight;d==="vmax"?l*=Math.max(_u5,g)/100:l*=Math.min(_u5,g)/100;}return l;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",s="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",f="\'([^\']+)\'|\\"([^\\"]+)\\"|([\\\\w-]|[\\u4E00-\\u9FA5])+",p=new RegExp("(".concat(n,") +"),"i"),c=new RegExp("(".concat(i,") +"),"i"),v=new RegExp("(".concat(a,") +"),"i"),S=new RegExp("(".concat(o,") +"),"i"),O=new RegExp("([\\\\d\\\\.]+)("+s+")(?:\\\\/([\\\\d\\\\.]+)("+s+"))? *((?:"+f+")( *, *(?:"+f+"))*)");function x(m,T){var l=O.exec(m);if(!l)return;var d=parseFloat(l[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(l[1]),unit:l[2],lineHeight:Number.isFinite(d)?d:void 0,lineHeightUnit:l[4],family:l[5].replace(/ *, */g,",")},g=m.substring(0,l.index),M=p.exec(g),A=c.exec(g),R=v.exec(g),b=S.exec(g);return M&&(u.weight=M[1]),A&&(u.style=A[1]),R&&(u.variant=R[1]),b&&(u.stretch=b[1]),u.pxHeight=e({size:u.size,unit:u.unit},T),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},T),u;}},/* 24 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 */ /***/function(h,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),t.d(r,"drawMesh2D",function(){return f;});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(p,c){var v=p.canvas;p.save(),p.filter=c,p.drawImage(v,0,0,v.width,v.height),p.restore();}function s(p,c){var v=/rgba\\((\\d+),(\\d+),(\\d+),(\\d+)\\)/;p=p.match(v).slice(1,5).map(Number),c=c.match(v).slice(1,5).map(Number);var S=[],O=c[3];for(var x=0;x<4;x++)S[x]=Object(a.mix)(p[x],c[x],O);return"rgba(".concat(S.join(),")");}function f(p,c){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var S=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var O=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var x=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var m=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;c.save();var T=!1,l=!1;if(c.globalAlpha=p.getOpacity(),p._updateMatrix&&p.transformScale/p.contours.scale>1.5&&p.accurate(p.transformScale),p.lineWidth){var g=p.gradient&&p.gradient.stroke;if(g){var _g=g,M=_g.vector,A=_g.colors;if(M.length===6)g=c.createRadialGradient.apply(c,_toConsumableArray(M));else if(M.length===4)g=c.createLinearGradient.apply(c,_toConsumableArray(M));else if(M.length===3)g=c.createCircularGradient.apply(c,_toConsumableArray(M));else throw new TypeError("Invalid vector dimension.");A.forEach(function(_ref34){var R=_ref34.offset,b=_ref34.color;var E=Object(n["default"])(b);O&&(E=s(E,O)),g.addColorStop(R,E);}),c.strokeStyle=g,T=!0;}else p.strokeStyle&&(O?c.strokeStyle=s(p.strokeStyle,O):c.strokeStyle=p.strokeStyle,T=!0);}T&&(c.lineWidth=p.lineWidth,c.lineJoin=p.lineJoin,c.lineCap=p.lineCap,c.miterLimit=p.miterLimit,p.lineDash&&(c.setLineDash(p.lineDash),p.lineDashOffset&&(c.lineDashOffset=p.lineDashOffset)));var d=p.gradient&&p.gradient.fill;if(d){var _d3=d,_g2=_d3.vector,_M2=_d3.colors;if(_g2.length===6)d=c.createRadialGradient.apply(c,_toConsumableArray(_g2));else if(_g2.length===4)d=c.createLinearGradient.apply(c,_toConsumableArray(_g2));else if(_g2.length===3)d=c.createCircularGradient.apply(c,_toConsumableArray(_g2));else throw new TypeError("Invalid vector dimension.");_M2.forEach(function(_ref35){var A=_ref35.offset,R=_ref35.color;var b=Object(n["default"])(R);O&&(b=s(b,O)),d.addColorStop(A,b);}),c.fillStyle=d,l=!0;}else p.fillStyle&&(S?c.fillStyle=s(p.fillStyle,S):c.fillStyle=p.fillStyle,l=!0);if(m&&c.transform.apply(c,_toConsumableArray(m)),c.transform.apply(c,_toConsumableArray(p.transformMatrix)),p.clipPath){var _g3=p.clipPath,_M3=new Path2D(_g3);c.clip(_M3);}var u=p.contours.length;if(p.contours.forEach(function(g,M){var A=g.length,R=A>1&&e.vec2.equals(g[0],g[A-1]),b=M===u-1&&p.texture;if(g&&A>0){if(l||T||b){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(g[0]));for(var E=1;Es&&(_ref36=[s,o],o=_ref36[0],s=_ref36[1],_ref36),as?s:a;}function n(a,o,s){return a*(1-s)+o*s;}function i(a,o){var _a2=_slicedToArray(a,2),s=_a2[0],f=_a2[1];return[s*o[0]+f*o[2]+o[4],s*o[1]+f*o[3]+o[5]];}},/* 27 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(f,p,c){var v=f.uniforms||{},S=p.uniforms||{};if(v.u_texSampler&&S.u_texSampler&&v.u_texSampler!==S.u_texSampler)return!1;var O=Object.keys(v),x=Object.keys(S),m=O.indexOf("u_texSampler"),T=x.indexOf("u_texSampler");if(m>=0&&O.splice(m,1),T>=0&&x.splice(T,1),O.length!==x.length)return!1;var l=O.every(function(d){var u=v[d],g=S[d];if(u===g)return!0;if(u.length&&g.length&&u.length===g.length){for(var M=0;M2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var v,S,O,x,m,_T11,_l8,u,d,_u6,g;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:v=[],S=f.options.bufferSize;O=0,x=!1;m=0;case 3:if(!(mS)){_context8.next=31;break;}_context8.t1=v.length;if(!_context8.t1){_context8.next=27;break;}_context8.next=27;return o(v,x);case 27:O=0;x=!1;_context8.next=39;break;case 31:if(!O){_context8.next=39;break;}g=v[v.length-1];_context8.t2=g&&(g.filterCanvas||g.afterRender||_T11.beforeRender||g.pass.length||_T11.pass.length||g.program!==_T11.program||!i(g,_T11,v));if(!_context8.t2){_context8.next=39;break;}_context8.next=37;return o(v,x);case 37:O=0;x=!1;case 39:v.push(_T11),x=x||_T11.enableBlend,O+=d;case 40:_context8.t3=m===p.length-1&&v.length;if(!_context8.t3){_context8.next=44;break;}_context8.next=44;return o(v,x);case 44:m++;_context8.next=3;break;case 47:case"end":return _context8.stop();}},_callee8);})();}},/* 28 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var e={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(a,o){var s=0,f=0,p=0,c=0,v=0,S=0,O=0;var x=a[0].program;for(var m=0;m0&&(u.a_sourceRect=v);var g={positions:s,cells:f,attributes:u,uniforms:m,cellsCount:x*3,program:T};return p&&p.length&&(g.textureCoord=p),d&&S.length>0&&(u.a_clipUV=S),g;}},/* 29 */ /***/function(h,r,t){t.r(r);var e=t(1),n=t(30),i=t(26),a=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(u,g){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(u);g&&(A=A.filter(function(R){return Object.getOwnPropertyDescriptor(u,R).enumerable;})),M.push.apply(M,A);}return M;}function s(u){for(var g=1;g1&&arguments[1]!==undefined?arguments[1]:null;var M=new Float32Array(3*u),A=new Float32Array(3*u),R=new Float32Array(4*u),b=new Float32Array(4*u),E=new Float32Array(4*u),L=new Float32Array(4*u),D=new Float32Array(4*u),I=new Uint8Array(u),C=new Uint8Array(4*u),W=new Uint8Array(4*u);return g&&(M.set(g.transform0,0),A.set(g.transform1,0),R.set(g.color0,0),b.set(g.color1,0),E.set(g.color2,0),L.set(g.color3,0),D.set(g.color4,0),I.set(g.frameIndex,0),C.set(g.fillColor,0),W.set(g.strokeColor,0)),{bufferSize:u,transform0:M,transform1:A,color0:R,color1:b,color2:E,color3:L,color4:D,frameIndex:I,fillColor:C,strokeColor:W};}r["default"]=/*#__PURE__*/function(){function _class(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref37=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref37$buffer=_ref37.buffer,M=_ref37$buffer===void 0?1e3:_ref37$buffer;_classCallCheck(this,_class);M=Math.max(M,g),this[c]=g,this[p]=u,this[l]=d(M),this[O]=[],this[S]=[],this[m]=!1,this[T]=!1,this[v]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var g=this[c];for(var M=u;M=this[c]||u<0)throw new Error("Out of range.");var _this$l2=this[l],g=_this$l2.transform0,M=_this$l2.transform1,A=_this$l2.color0,R=_this$l2.color1,b=_this$l2.color2,E=_this$l2.color3,L=_this$l2.color4,D=_this$l2.frameIndex,I=_this$l2.fillColor,C=_this$l2.strokeColor;g.set(g.subarray(3*(u+1)),3*u),M.set(M.subarray(3*(u+1)),3*u),A.set(A.subarray(4*(u+1)),4*u),R.set(R.subarray(4*(u+1)),4*u),b.set(b.subarray(4*(u+1)),4*u),E.set(E.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),D.set(D.subarray(u+1),u),I.set(I.subarray(4*(u+1)),4*u),C.set(C.subarray(4*(u+1)),4*u);for(var W in this[S])W===u?delete this[S][W]:W>u&&(this[S][W-1]=this[S][W],delete this[S][W]);this[c]--;}},{key:"setColorTransform",value:function setColorTransform(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l3=this[l],M=_this$l3.color0,A=_this$l3.color1,R=_this$l3.color2,b=_this$l3.color3,E=_this$l3.color4;return g!=null?(M.set([g[0],g[5],g[10],g[15]],u),A.set([g[1],g[6],g[11],g[16]],u),R.set([g[2],g[7],g[12],g[17]],u),b.set([g[3],g[8],g[13],g[18]],u),E.set([g[4],g[9],g[14],g[19]],u),this[v]=this[v]||g[18]<1,this[T]=!0):(M.set([1,0,0,0],u),A.set([0,1,0,0],u),R.set([0,0,1,0],u),b.set([0,0,0,1],u),E.set([0,0,0,0],u)),this;}},{key:"getColorTransform",value:function getColorTransform(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l4=this[l],g=_this$l4.color0,M=_this$l4.color1,A=_this$l4.color2,R=_this$l4.color3,b=_this$l4.color4;return[g[u],M[u],A[u],R[u],b[u],g[u+1],M[u+1],A[u+1],R[u+1],b[u+1],g[u+2],M[u+2],A[u+2],R[u+2],b[u+2],g[u+3],M[u+3],A[u+3],R[u+3],b[u+3]];}},{key:"transformColor",value:function transformColor(u,g){var M=this.getColorTransform(u);return M=Object(n.multiply)(M,g),this.setColorTransform(u,M),this;}},{key:"setFillColor",value:function setFillColor(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].fillColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].strokeColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"getCloudRGBA",value:function getCloudRGBA(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l5=this[l],g=_this$l5.fillColor,M=_this$l5.strokeColor,A=[g[u],g[u+1],g[u+2],g[u+3]],R=[M[u],M[u+1],M[u+2],M[u+3]];return A[3]/=255,R[3]/=255,{fill:"rgba(".concat(A.join(),")"),stroke:"rgba(".concat(R.join(),")")};}},{key:"grayscale",value:function grayscale(u,g){this.transformColor(u,Object(n.grayscale)(g)),this._getFilter(u).push("grayscale(".concat(100*g,"%)"));}},{key:"brightness",value:function brightness(u,g){this.transformColor(u,Object(n.brightness)(g)),this._getFilter(u).push("brightness(".concat(100*g,"%)"));}},{key:"saturate",value:function saturate(u,g){this.transformColor(u,Object(n.saturate)(g)),this._getFilter(u).push("saturate(".concat(100*g,"%)"));}},{key:"contrast",value:function contrast(u,g){this.transformColor(u,Object(n.contrast)(g)),this._getFilter(u).push("contrast(".concat(100*g,"%)"));}},{key:"invert",value:function invert(u,g){this.transformColor(u,Object(n.invert)(g)),this._getFilter(u).push("invert(".concat(100*g,"%)"));}},{key:"sepia",value:function sepia(u,g){this.transformColor(u,Object(n.sepia)(g)),this._getFilter(u).push("sepia(".concat(100*g,"%)"));}},{key:"opacity",value:function opacity(u,g){this.transformColor(u,Object(n.opacity)(g)),this._getFilter(u).push("opacity(".concat(100*g,"%)"));}},{key:"hueRotate",value:function hueRotate(u,g){this.transformColor(u,Object(n.hueRotate)(g)),this._getFilter(u).push("hue-rotate(".concat(g,"deg)"));}},{key:"setTransform",value:function setTransform(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$l6=this[l],M=_this$l6.transform0,A=_this$l6.transform1;return M.set([g[0],g[2],g[4]],u),A.set([g[1],g[3],g[5]],u),this;}},{key:"getTransform",value:function getTransform(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=3;var _this$l7=this[l],g=_this$l7.transform0,M=_this$l7.transform1;return[g[u],M[u],g[u+1],M[u+1],g[u+2],M[u+2]];}},{key:"getTextureFrame",value:function getTextureFrame(u){return this[O][this[l].frameIndex[u]];}},{key:"setTextureFrames",value:function setTextureFrames(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[p].setTexture(u[0],g),this[O]=u,this[x]=g;}},{key:"setFrameIndex",value:function setFrameIndex(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");var M=this[O].length;if(M<=0)throw new Error("No frames");this[l].frameIndex[u]=g%M;}},{key:"amount",get:function get(){return this[c];},set:function set(u){var g=this[c];u!==g&&(u>this[l].bufferSize&&(this[l]=d(Math.max(u,this[l].bufferSize+1e3),this[l])),this[c]=u,u>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$p$meshData=this[p].meshData,u=_this$p$meshData.attributes,g=_this$p$meshData.cells,M=_this$p$meshData.positions,A=_this$p$meshData.textureCoord,R=_this$p$meshData.uniforms,b=this[O],E={attributes:s({},u),cells:g,positions:M,textureCoord:A,uniforms:s({},R),instanceCount:this[c],enableBlend:this.enableBlend};b.length&&b.forEach(function($,Q){E.uniforms["u_texFrame".concat(Q)]=$;});var _this$l8=this[l],L=_this$l8.transform0,D=_this$l8.transform1,I=_this$l8.color0,C=_this$l8.color1,W=_this$l8.color2,G=_this$l8.color3,K=_this$l8.color4,J=_this$l8.fillColor,Z=_this$l8.strokeColor,B=_this$l8.frameIndex;return this[p].uniforms.u_texSampler&&(E.attributes.a_frameIndex={data:B,divisor:1}),E.attributes.a_transform0={data:L,divisor:1},E.attributes.a_transform1={data:D,divisor:1},E.attributes.a_colorCloud0={data:I,divisor:1},E.attributes.a_colorCloud1={data:C,divisor:1},E.attributes.a_colorCloud2={data:W,divisor:1},E.attributes.a_colorCloud3={data:G,divisor:1},E.attributes.a_colorCloud4={data:K,divisor:1},this.hasCloudColor&&(E.attributes.a_fillCloudColor={data:J,divisor:1},E.attributes.a_strokeCloudColor={data:Z,divisor:1}),E;}},{key:"setProgram",value:function setProgram(u){this[p].setProgram(u);}},{key:"program",get:function get(){return this[p].program;}},{key:"transform",value:function transform(u,g){var M=this.getTransform(u);return g=e.mat2d.multiply(Array.of(0,0,0,0,0,0),M,g),this.setTransform(u,g),this;}},{key:"translate",value:function translate(u,_ref38){var _ref39=_slicedToArray(_ref38,2),g=_ref39[0],M=_ref39[1];var A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[g,M]),this.transform(u,A);}},{key:"rotate",value:function rotate(u,g){var _ref40=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref41=_slicedToArray(_ref40,2),M=_ref41[0],A=_ref41[1];var R=e.mat2d.create();return R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[M,A]),R=e.mat2d.rotate(Array.of(0,0,0,0,0,0),R,g),R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[-M,-A]),this.transform(u,R);}},{key:"scale",value:function scale(u,_ref42){var _ref43=_slicedToArray(_ref42,2),g=_ref43[0],_ref43$=_ref43[1],M=_ref43$===void 0?g:_ref43$;var _ref44=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref45=_slicedToArray(_ref44,2),A=_ref45[0],R=_ref45[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),b=e.mat2d.scale(Array.of(0,0,0,0,0,0),b,[g,M]),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-R]),this.transform(u,b);}},{key:"skew",value:function skew(u,_ref46){var _ref47=_slicedToArray(_ref46,2),g=_ref47[0],_ref47$=_ref47[1],M=_ref47$===void 0?g:_ref47$;var _ref48=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref49=_slicedToArray(_ref48,2),A=_ref49[0],R=_ref49[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),b=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,e.mat2d.fromValues(1,Math.tan(M),Math.tan(g),1,0,0)),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-R]),this.transform(u,b);}},{key:"isPointCollision",value:function isPointCollision(u,_ref50){var _this$p;var _ref51=_slicedToArray(_ref50,2),g=_ref51[0],M=_ref51[1];var A=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var R=this.getTransform(u),b=Object(i.transformPoint)([g,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),R));return(_this$p=this[p]).isPointCollision.apply(_this$p,_toConsumableArray(b).concat([A]));}},{key:"isPointInFill",value:function isPointInFill(u,_ref52){var _ref53=_slicedToArray(_ref52,2),g=_ref53[0],M=_ref53[1];return this.isPointCollision(u,[g,M],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(u,_ref54){var _ref55=_slicedToArray(_ref54,2),g=_ref55[0],M=_ref55[1];return this.isPointCollision(u,[g,M],"stroke");}}]);}();},/* 30 */ /***/function(h,r,t){t.r(r),t.d(r,"multiply",function(){return n;}),t.d(r,"grayscale",function(){return i;}),t.d(r,"brightness",function(){return a;}),t.d(r,"saturate",function(){return o;}),t.d(r,"contrast",function(){return s;}),t.d(r,"invert",function(){return f;}),t.d(r,"sepia",function(){return p;}),t.d(r,"opacity",function(){return c;}),t.d(r,"hueRotate",function(){return v;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(S,O){var x=[],m=S[0],T=S[1],l=S[2],d=S[3],u=S[4],g=S[5],M=S[6],A=S[7],R=S[8],b=S[9],E=S[10],L=S[11],D=S[12],I=S[13],C=S[14],W=S[15],G=S[16],K=S[17],J=S[18],Z=S[19];var B=O[0],$=O[1],Q=O[2],et=O[3],tt=O[4];return x[0]=B*m+$*g+Q*E+et*W,x[1]=B*T+$*M+Q*L+et*G,x[2]=B*l+$*A+Q*D+et*K,x[3]=B*d+$*R+Q*I+et*J,x[4]=B*u+$*b+Q*C+et*Z+tt,B=O[5],$=O[6],Q=O[7],et=O[8],tt=O[9],x[5]=B*m+$*g+Q*E+et*W,x[6]=B*T+$*M+Q*L+et*G,x[7]=B*l+$*A+Q*D+et*K,x[8]=B*d+$*R+Q*I+et*J,x[9]=B*u+$*b+Q*C+et*Z+tt,B=O[10],$=O[11],Q=O[12],et=O[13],tt=O[14],x[10]=B*m+$*g+Q*E+et*W,x[11]=B*T+$*M+Q*L+et*G,x[12]=B*l+$*A+Q*D+et*K,x[13]=B*d+$*R+Q*I+et*J,x[14]=B*u+$*b+Q*C+et*Z+tt,B=O[15],$=O[16],Q=O[17],et=O[18],tt=O[19],x[15]=B*m+$*g+Q*E+et*W,x[16]=B*T+$*M+Q*L+et*G,x[17]=B*l+$*A+Q*D+et*K,x[18]=B*d+$*R+Q*I+et*J,x[19]=B*u+$*b+Q*C+et*Z+tt,x;}function i(S){S=Object(e.clamp)(0,1,S);var O=0.2126*S,x=0.7152*S,m=0.0722*S;return[O+1-S,x,m,0,0,O,x+1-S,m,0,0,O,x,m+1-S,0,0,0,0,0,1,0];}function a(S){return[S,0,0,0,0,0,S,0,0,0,0,0,S,0,0,0,0,0,1,0];}function o(S){var O=0.2126*(1-S),x=0.7152*(1-S),m=0.0722*(1-S);return[O+S,x,m,0,0,O,x+S,m,0,0,O,x,m+S,0,0,0,0,0,1,0];}function s(S){var O=0.5*(1-S);return[S,0,0,0,O,0,S,0,0,O,0,0,S,0,O,0,0,0,1,0];}function f(S){var O=1-2*S;return[O,0,0,0,S,0,O,0,0,S,0,0,O,0,S,0,0,0,1,0];}function p(S){return[1-0.607*S,0.769*S,0.189*S,0,0,0.349*S,1-0.314*S,0.168*S,0,0,0.272*S,0.534*S,1-0.869*S,0,0,0,0,0,1,0];}function c(S){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,S,0];}function v(S){var O=S/180*Math.PI,x=Math.cos(O),m=Math.sin(O),T=0.2126,l=0.7152,d=0.0722;return[T+x*(1-T)+m*-T,l+x*-l+m*-l,d+x*-d+m*(1-d),0,0,T+x*-T+m*0.143,l+x*(1-l)+m*0.14,d+x*-d+m*-0.283,0,0,T+x*-T+m*-(1-T),l+x*-l+m*l,d+x*(1-d)+m*d,0,0,0,0,0,1,0];}},/* 31 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);function i(a){var o=n()(a);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 */ /***/function(h,r,t){var e=t(33),n=t(37),i=t(39);h.exports=function(o){var s,f=e(o);return f.space?(s=Array(3),s[0]=i(f.values[0],0,255),s[1]=i(f.values[1],0,255),s[2]=i(f.values[2],0,255),f.space[0]==="h"&&(s=n.rgb(s)),s.push(i(f.alpha,0,1)),s):[];};},/* 33 */ /***/function(h,r,t){(function(e){var n=t(34),i=t(35),a=t(36);h.exports=s;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function s(f){var p,c=[],v=1,S;if(typeof f=="string"){if(n[f])c=n[f].slice(),S="rgb";else if(f==="transparent")v=0,S="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(f)){var O=f.slice(1),x=O.length,m=x<=4;v=1,m?(c=[parseInt(O[0]+O[0],16),parseInt(O[1]+O[1],16),parseInt(O[2]+O[2],16)],x===4&&(v=parseInt(O[3]+O[3],16)/255)):(c=[parseInt(O[0]+O[1],16),parseInt(O[2]+O[3],16),parseInt(O[4]+O[5],16)],x===8&&(v=parseInt(O[6]+O[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),S="rgb";}else if(p=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(f)){var T=p[1],l=T==="rgb",O=T.replace(/a$/,"");S=O;var x=O==="cmyk"?4:O==="gray"?1:3;c=p[2].trim().split(/\\s*,\\s*/).map(function(M,A){if(/%$/.test(M))return A===x?parseFloat(M)/100:O==="rgb"?parseFloat(M)*255/100:parseFloat(M);if(O[A]==="h"){if(/deg$/.test(M))return parseFloat(M);if(o[M]!==void 0)return o[M];}return parseFloat(M);}),T===O&&c.push(1),v=l||c[x]===void 0?1:c[x],c=c.slice(0,x);}else f.length>10&&/[0-9](?:\\s|\\/)/.test(f)&&(c=f.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),S=f.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(f))S="rgb",c=[f>>>16,(f&65280)>>>8,f&255];else if(i(f)){var d=a(f.r,f.red,f.R,null);d!==null?(S="rgb",c=[d,a(f.g,f.green,f.G),a(f.b,f.blue,f.B)]):(S="hsl",c=[a(f.h,f.hue,f.H),a(f.s,f.saturation,f.S),a(f.l,f.lightness,f.L,f.b,f.brightness)]),v=a(f.a,f.alpha,f.opacity,1),f.opacity!=null&&(v/=100);}else(Array.isArray(f)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(f))&&(c=[f[0],f[1],f[2]],S="rgb",v=f.length===4?f[3]:1);return{space:S,values:c,alpha:v};}}).call(this,t(22));},/* 34 */ /***/function(h,r,t){h.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};},/* 35 */ /***/function(h,r,t){var e=Object.prototype.toString;h.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 */ /***/function(h,r){h.exports=function(){for(var t=0;t1&&p--,6*p<1?v=s+(f-s)*6*p:2*p<1?v=f:3*p<2?v=s+(f-s)*(2/3-p)*6:v=s,c[S]=v*255;return c;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,o=n[2]/255,s=Math.min(i,a,o),f=Math.max(i,a,o),p=f-s,c,v,S;return f===s?c=0:i===f?c=(a-o)/p:a===f?c=2+(o-i)/p:o===f&&(c=4+(i-a)/p),c=Math.min(c*60,360),c<0&&(c+=360),S=(s+f)/2,f===s?v=0:S<=0.5?v=p/(f+s):v=p/(2-f-s),[c,v*100,S*100];};},/* 38 */ /***/function(h,r,t){h.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 */ /***/function(h,r){h.exports=t;function t(e,n,i){return ni?i:e:en?n:e;}},/* 40 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return d;});var e=t(41),n=/* @__PURE__ */t.n(e),i=t(42),a=/* @__PURE__ */t.n(i),o=t(43),s=/* @__PURE__ */t.n(o),f=t(44),p=t(46),c=/* @__PURE__ */t.n(p),v=t(53),S=t(55);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("contours"),x=Symbol("path"),m=Symbol("simplify"),T=Symbol("scale"),l=2*Math.PI;var d=/*#__PURE__*/function(){function d(){var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,d);typeof g=="string"&&(g={path:g}),g.path?this[x]=n()(g.path):this[x]=[],this[O]=null,this[m]=g.simplify!=null?g.simplify:0,this[T]=g.scale!=null?g.scale:2;}return _createClass(d,[{key:"contours",get:function get(){var g=null;if(!this[O]&&this[x]){var M=Object(f["default"])(s()(this[x]));this[O]=c()(M,this[T],this[m]),this[O].path=M,this[O].simplify=this[m],this[O].scale=this[T];}return this[O]&&(g=this[O].map(function(M){return _toConsumableArray(M);}),g.path=this[O].path,g.simplify=this[O].simplify,g.scale=this[O].scale),g;}},{key:"path",get:function get(){return this[x];}},{key:"simplify",get:function get(){return this[m];}},{key:"boundingBox",get:function get(){var g=this.contours;if(g&&g.length){var M=g.reduce(function(A,R){return[].concat(_toConsumableArray(A),_toConsumableArray(R));});return a()(M);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var g=this.boundingBox;return g?[0.5*(g[0][0]+g[1][0]),0.5*(g[0][1]+g[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$x;var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var A=Object(f["default"])(s()(this[x])).map(function(_ref56){var _ref57=_toArray(_ref56),R=_ref57[0],b=_ref57.slice(1);var E=[R];for(var L=0;L7&&arguments[7]!==undefined?arguments[7]:0;if(E+=b,L+=b,A<=0||R<=0||L===E)return;Ll&&(L=E+l);var I=L-E;I>=l&&(L-=1e-3);var C=this[x].length>0&&IMath.PI?1:0;D&&(J=1-J),C+=W.join(" "),C+="A".concat(A," ").concat(R," 0 ").concat(J," ").concat(K," ").concat(G.join(" ")),I>=l&&(C+="Z"),this.addPath(C);}},{key:"arc",value:function arc(g,M,A,R,b){var E=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,M,A,A,0,R,b,E);}},{key:"arcTo",value:function arcTo(g,M,A,R,b,E,L){this[O]=null,this[x].push(["A",g,M,A,R,b,E,L]);}},{key:"moveTo",value:function moveTo(g,M){this[O]=null,this[x].push(["M",g,M]);}},{key:"lineTo",value:function lineTo(g,M){this[O]=null,this[x].push(["L",g,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(g,M,A,R,b,E){this[O]=null,this[x].push(["C",g,M,A,R,b,E]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,M,A,R){this[O]=null,this[x].push(["Q",g,M,A,R]);}},{key:"rect",value:function rect(g,M,A,R){var b="M".concat(g," ").concat(M,"L").concat(g+A," ").concat(M,"L").concat(g+A," ").concat(M+R,"L").concat(g," ").concat(M+R,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[O]=null;var g=[];var M=this[x].length;M>0&&(g=this[x][M-1]),g[0]!=="Z"&&g[0]!=="z"&&this[x].push(["Z"]);}}]);}();},/* 41 */ /***/function(h,r){h.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(o){var s=[];return o.replace(e,function(f,p,c){var v=p.toLowerCase();for(c=a(c),v=="m"&&c.length>2&&(s.push([p].concat(c.splice(0,2))),v="l",p=p=="m"?"l":"L");;){if(c.length==t[v])return c.unshift(p),s.push(c);if(c.length4?(p=u[u.length-4],c=u[u.length-3]):(p=m,c=T),f.push(u);}return f;}function i(o,s,f,p){return["C",o,s,f,p,f,p];}function a(o,s,f,p,c,v){return["C",o/3+2/3*f,s/3+2/3*p,c/3+2/3*f,v/3+2/3*p,c,v];}},/* 45 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(s,f,p,c){var v=s*c-f*p<0?-1:1;var S=s*p+f*c;return S>1&&(S=1),S<-1&&(S=-1),v*Math.acos(S);}function i(s,f,p,c,v,S,O,x,m,T){var l=T*(s-p)/2+m*(f-c)/2,d=-m*(s-p)/2+T*(f-c)/2,u=O*O,g=x*x,M=l*l,A=d*d;var R=u*g-u*A-g*M;R<0&&(R=0),R/=u*A+g*M,R=Math.sqrt(R)*(v===S?-1:1);var b=R*O/x*d,E=R*-x/O*l,L=T*b-m*E+(s+p)/2,D=m*b+T*E+(f+c)/2,I=(l-b)/O,C=(d-E)/x,W=(-l-b)/O,G=(-d-E)/x,K=n(1,0,I,C);var J=n(I,C,W,G);return S===0&&J>0&&(J-=e),S===1&&J<0&&(J+=e),[L,D,K,J];}function a(s,f){var p=1.3333333333333333*Math.tan(f/4),c=Math.cos(s),v=Math.sin(s),S=Math.cos(s+f),O=Math.sin(s+f);return[c,v,c-v*p,v+c*p,S+O*p,O-S*p,S,O];}function o(s,f,p,c,v,S,O,x,m){var T=Math.sin(m*e/360),l=Math.cos(m*e/360),d=l*(s-p)/2+T*(f-c)/2,u=-T*(s-p)/2+l*(f-c)/2;if(d===0&&u===0)return[];if(O===0||x===0)return[];O=Math.abs(O),x=Math.abs(x);var g=d*d/(O*O)+u*u/(x*x);g>1&&(O*=Math.sqrt(g),x*=Math.sqrt(g));var M=i(s,f,p,c,v,S,O,x,T,l),A=[];var R=M[2],b=M[3];var E=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=E;for(var L=0;L0&&(x.push(m),m=[]);else if(l[0]==="C")p(m,S,T,l),a(T,l[5],l[6]);else throw new Error("illegal type in SVG: "+l[0]);}),m.length>0&&x.push(m),x.map(function(l){return i(l,O||0);});};},/* 47 */ /***/function(h,r,t){h.exports=t(48)();},/* 48 */ /***/function(h,r){function t(n){return[n[0],n[1]];}function e(n,i){return[n,i];}h.exports=function(i){i=i||{};var a=typeof i.recursion=="number"?i.recursion:8,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,s=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,f=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,p=i.angleTolerance||0,c=i.cuspLimit||0;return function(x,m,T,l,d,u){u||(u=[]),d=typeof d=="number"?d:1;var g=s/d;return g*=g,v(x,m,T,l,u,g),u;};function v(O,x,m,T,l,d){l.push(t(O));var u=O[0],g=O[1],M=x[0],A=x[1],R=m[0],b=m[1],E=T[0],L=T[1];S(u,g,M,A,R,b,E,L,l,d,0),l.push(t(T));}function S(O,x,m,T,l,d,u,g,M,A,R){if(!(R>a)){var b=Math.PI,E=(O+m)/2,L=(x+T)/2,D=(m+l)/2,I=(T+d)/2,C=(l+u)/2,W=(d+g)/2,G=(E+D)/2,K=(L+I)/2,J=(D+C)/2,Z=(I+W)/2,B=(G+J)/2,$=(K+Z)/2;if(R>0){var Q=u-O,et=g-x,tt=Math.abs((m-u)*et-(T-g)*Q),ot=Math.abs((l-u)*et-(d-g)*Q),q,gt;if(tt>o&&ot>o){if((tt+ot)*(tt+ot)<=A*(Q*Q+et*et)){if(p=b&&(q=2*b-q),gt>=b&&(gt=2*b-gt),q+gtc){M.push(e(m,T));return;}if(gt>c){M.push(e(l,d));return;}}}}else if(tt>o){if(tt*tt<=A*(Q*Q+et*et)){if(p=b&&(q=2*b-q),qc){M.push(e(m,T));return;}}}else if(ot>o){if(ot*ot<=A*(Q*Q+et*et)){if(p=b&&(q=2*b-q),qc){M.push(e(l,d));return;}}}else if(Q=B-(O+u)/2,et=$-(x+g)/2,Q*Q+et*et<=A){M.push(e(B,$));return;}}S(O,x,E,L,G,K,B,$,M,A,R+1),S(B,$,J,Z,C,W,u,g,M,A,R+1);}}};},/* 49 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return i;}),t.d(r,"clone",function(){return n;}),t.d(r,"copy",function(){return a;}),t.d(r,"scaleAndAdd",function(){return o;}),t.d(r,"dot",function(){return s;}),t.d(r,"rotate",function(){return f;}),t.d(r,"cross",function(){return p;}),t.d(r,"sub",function(){return c;}),t.d(r,"add",function(){return v;}),t.d(r,"computeMiter",function(){return m;}),t.d(r,"normal",function(){return T;}),t.d(r,"direction",function(){return l;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(d){return[d[0],d[1]];}function i(){return[0,0];}var a=e.vec2.copy,o=e.vec2.scaleAndAdd,s=e.vec2.dot,f=e.vec2.rotate,p=e.vec2.cross,c=e.vec2.sub,v=e.vec2.add,S=e.vec2.normalize,O=e.vec2.set,x=i();function m(d,u,g,M,A){v(d,g,M),S(d,d),O(u,-d[1],d[0]),O(x,-g[1],g[0]);var R=A/s(u,x);return Math.abs(R);}function T(d,u){return O(d,-u[1],u[0]),d;}function l(d,u,g){return c(d,u,g),S(d,d),d;}},/* 50 */ /***/function(h,r,t){var e=t(51),n=t(52);h.exports=function(a,o){return a=e(a,o),a=n(a,o),a;},h.exports.radialDistance=e,h.exports.douglasPeucker=n;},/* 51 */ /***/function(h,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a;}h.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var a=i*i,o=n[0],s=[o],f,p=1,c=n.length;pa&&(s.push(f),o=f);return o!==f&&s.push(f),s;};},/* 52 */ /***/function(h,r){function t(n,i,a){var o=i[0],s=i[1],f=a[0]-o,p=a[1]-s;if(f!==0||p!==0){var c=((n[0]-o)*f+(n[1]-s)*p)/(f*f+p*p);c>1?(o=a[0],s=a[1]):c>0&&(o+=f*c,s+=p*c);}return f=n[0]-o,p=n[1]-s,f*f+p*p;}function e(n,i,a,o,s){for(var f=o,p,c=i+1;cf&&(p=c,f=v);}f>o&&(p-i>1&&e(n,i,p,o,s),s.push(n[p]),a-p>1&&e(n,p,a,o,s));}h.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var o=a*a,s=i.length-1,f=[i[0]];return e(i,0,s,o,f),f.push(i[s]),f;};},/* 53 */ /***/function(h,r,t){t.r(r),t.d(r,"getTotalLength",function(){return n;}),t.d(r,"getPointAtLength",function(){return a;}),t.d(r,"getDashContours",function(){return o;});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(s){if(s.totalLength!=null)return s.totalLength;var f=0;return s.forEach(function(p){var c=p[0];for(var v=1;v2&&arguments[2]!==undefined?arguments[2]:!0;if(f=Number(f),!Number.isFinite(f))throw new TypeError("Failed to execute \'getPointAtLength\' on figure: The provided float value is non-finite.");if(f<=0)throw new TypeError("Length must > 0");var c=n(s);if(f>=c){var S=s[s.length-1],O=S[S.length-2],x=S[S.length-1],m=Math.atan2(x[1]-O[1],x[0]-O[0]);return{current:s.map(function(T){return _toConsumableArray(T);}),point:{x:x[0],y:x[1],angle:m}};}var v=[];for(var _S2=0;_S20&&v[_S2].push([g.x,g.y]),!p)return{current:v,point:g};var M=[],A=_S2;for(;_S20){do p-=f[c%x],c++;while(p>0);p<0&&(v=-p,c--);}else if(p<0){c=-1;do p+=f[c%x+x-1],c--;while(p<0);p>=0&&(c++,v=f[c%x+x-1]-p);}do{var m=i(S,v);S=m.rest,++c%2&&O.push.apply(O,_toConsumableArray(m.current));var _T15=c%x;_T15<0&&(_T15+=x),v=f[_T15];}while(S);return O;}},/* 54 */ /***/function(h,r,t){t.r(r),t.d(r,"normalize",function(){return e;}),t.d(r,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(_ref58,s,f,p){var _ref59=_slicedToArray(_ref58,3),i=_ref59[0],a=_ref59[1],o=_ref59[2];return i=i*2/s-1,a=1-a*2/f,Number.isFinite(p)?(o=o*2/p-1,[i,a,o]):[i,a];}function n(_ref60,_ref61){var _ref62=_slicedToArray(_ref60,3),i=_ref62[0],a=_ref62[1],_ref62$=_ref62[2],o=_ref62$===void 0?0:_ref62$;var _ref63=_slicedToArray(_ref61,3),s=_ref63[0],f=_ref63[1],_ref63$=_ref63[2],p=_ref63$===void 0?0:_ref63$;return Math.hypot(s-i,f-a,p-o);}},/* 55 */ /***/function(h,r,t){t.r(r),t.d(r,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(i,a,o,s,f){f%=e,f<0&&(f+=e);var p=Math.tan(f);if(Math.abs(p)<1e5){var c=a-p*i,v=1/Math.pow(o,2)+Math.pow(p,2)/Math.pow(s,2);var S=-1;(f<=Math.PI/2||f>3*Math.PI/2)&&(S=1);var O=S*Math.sqrt(1/v)+i,x=p*O+c;return[O,x];}return f=0)&&Object.prototype.propertyIsEnumerable.call(X,y)&&(z[y]=X[y]);}return z;}function u(X,N){if(X==null)return{};var z={},y=Object.keys(X),P,w;for(w=0;w=0)&&(z[P]=X[P]);return z;}var g=Symbol("mesh"),M=Symbol("contours"),A=Symbol("stroke"),R=Symbol("fill"),b=Symbol("strokeColor"),E=Symbol("fillColor"),L=Symbol("transform"),D=Symbol("invertTransform"),I=Symbol("uniforms"),C=Symbol("texOptions"),W=Symbol("blend"),G=Symbol("applyTexture"),K=Symbol("applyTransform"),J=Symbol("applyGradientTransform"),Z=Symbol("applyProgram"),B=Symbol("gradient"),$=Symbol("filter"),Q=Symbol("opacity"),et=Symbol("program"),tt=Symbol("attributes"),ot=Symbol("pass"),q=Symbol("clipContext"),gt=Symbol("applyClipPath");function dt(X,N){var z=X[1][0]-X[0][0],y=X[1][1]-X[0][1],P=[];for(var w=0;w1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[et]=N,this[g]&&this[Z](N);}},{key:"program",get:function get(){return this[et];}},{key:"setAttribute",value:function setAttribute(N,z){z==null?delete this[tt][N]:this[tt][N]=z;}},{key:"getOpacity",value:function getOpacity(){return this[Q];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach(function(z){z[2]=1/z[2]>0?N:-N;}),this[Q]=N;}},{key:"setClipPath",value:function setClipPath(N){this.clipPath=N,this[I].u_clipSampler&&this[I].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[gt]();}},{key:gt,value:function value(){if(this.clipPath){this[q]||(this[q]=l["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],z=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),y=_this$boundingBox$2[0],P=_this$boundingBox$2[1];y&&P&&(this[q].width=y-N,this[q].height=P-z);var w=this[q].getContext("2d"),U=new Path2D(this.clipPath);w.clearRect(0,0,this[q].width,this[q].height),w.save(),w.translate(-N,-z),w.fillStyle="white",w.fill(U),w.restore(),this[g].clipPath=this[q];var H=dt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=H;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(c.getPointAtLength)(this[M],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(c.getTotalLength)(this[M]);}},{key:"blend",get:function get(){return this[W]==null?"auto":this[W];}},{key:"blend",set:function set(N){this[W]=N,this[g]&&(this[g].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[g]&&this[g].boundingBox)return this[g].boundingBox;var N=this.meshData;if(N){var z=N.position0;if(z.length)N.boundingBox=i()(z);else return[[0,0],[0,0]];return N.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var N=this.boundingBox;return N?[0.5*(N[0][0]+N[1][0]),0.5*(N[0][1]+N[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[R]?this[R].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[A]?this[A].lineWidth:0;}},{key:"lineCap",get:function get(){return this[A]?this[A].lineCap:"";}},{key:"lineJoin",get:function get(){return this[A]?this[A].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[A]?this[A].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[b]&&this[b][3]!==0?Object(s["default"])(this[b]):"";}},{key:"lineDash",get:function get(){return this[A]?this[A].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[A]?this[A].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[E]&&this[E][3]!==0?Object(s["default"])(this[E]):"";}},{key:"gradient",get:function get(){return this[B];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].u_texSampler._img,options:this[C]}:null;}},{key:"enableBlend",get:function get(){return this[W]===!0||this[W]===!1?this[W]:this[Q]<1||this[b]!=null&&this[b][3]<1||this[E]!=null&&this[E][3]<1||this[I].u_colorMatrix!=null&&this[I].u_colorMatrix[18]<1||this[I].u_radialGradientVector!=null||this.beforeRender||this.afterRender;}},{key:"filterCanvas",get:function get(){return /blur|drop-shadow|url/.test(this.filter);}},{key:"filter",get:function get(){return this[$].join(" ");}},{key:"transformMatrix",get:function get(){return this[L];}},{key:"invertMatrix",get:function get(){if(!this[D]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[D]=N;}return this[D];}},{key:"transformScale",get:function get(){var N=this[L];return Math.max(Math.hypot(N[0],N[1]),Math.hypot(N[2],N[3]));}},{key:"uniforms",get:function get(){return this[I];}},{key:"pass",get:function get(){return this[ot];}},{key:Z,value:function value(N){var z=this[tt],y=this[g].position0,P=Object.entries(N._attribute);for(var w=0;w1.5&&this.accurate(this.transformScale),!this[g]){!this[R]&&!this[A]&&this.setFill();var N=this[M],z={};if(N&&N.length){if(this[R])try{var w=S()(N,this[R]);w.positions=w.positions.map(function(U){return U.push(_this9[Q]),U;}),w.attributes={a_color:Array.from({length:w.positions.length}).map(function(){return _this9[E].map(function(U){return Math.round(255*U);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),\n},z.fill=w;}catch(_unused8){}if(this[A]){var _w=this[A].lineDash;var U=N;if(_w){var Y=this[A].lineDashOffset;U=Object(c.getDashContours)(N,_w,Y);}var H=U.map(function(Y,k){var rt=Y.length>1&&e.vec2.equals(Y[0],Y[Y.length-1]),it=_this9[A].build(Y,rt);return S()([it]);});H.forEach(function(Y){Y.positions=Y.positions.map(function(k){return k.push(-_this9[Q]),k;}),Y.attributes={a_color:Array.from({length:Y.positions.length}).map(function(){return _this9[b].map(function(k){return Math.round(255*k);});})};}),z.stroke=Object(o["default"])(H);}}var y=Object(o["default"])([z.fill,z.stroke]);y.fillPointCount=z.fill?z.fill.positions.length:0,y.enableBlend=this.enableBlend,y.position0=y.positions.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),w=_ref70[0],U=_ref70[1],H=_ref70[2];return[w,U,H];}),y.uniforms=this[I],this[g]=y,this[I].u_texSampler&&this[G](y,this[C]);var P=this[L];Object(p.isUnitTransform)(P)||(this[K](y,P),this[I].u_radialGradientVector&&this[J]()),this.clipPath&&this[gt](),this[et]&&this[Z](this[et]);}return this._updateMatrix&&(this[g].matrix=this[L],this[K](this[g],this[L]),this[I].u_radialGradientVector&&this[J]()),this[g];}},{key:K,value:function value(N,z){var y=N.positions,P=N.position0;for(var w=0;w0){if(z.rotated){var at=rt*k[0]+it*k[2]+k[4],st=rt*k[1]+it*k[3]+k[5];rt=at;it=st;}var ut=F([rt,it],[Y[0]/Y[2],Y[1]/Y[3],Y[2],Y[3]],z);return z.repeat&&(ut[2]=1),ut;}return[-1,-1,-1];});}if(H){var _k2=[H[0]/w,H[1]/U,H[2]/w,H[3]/U];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_k2);});}else N.attributes.a_sourceRect=N.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(N){if(!this.contours)return;if(this.contours.path){var y=this.contours.simplify,P=j(this.contours.path,2*N,y);this[g]=null,this[M]=P;}}},{key:"canIgnore",value:function canIgnore(){var N=this[A]==null||this[A].lineWidth===0||this[b][3]===0,z=this[R]==null||this[E][3]===0,y=this[I].u_radialGradientVector==null,P=this[I].u_texSampler==null;return this[Q]===0||this[et]==null&&N&&z&&y&&P&&!this.beforeRender&&!this.afterRender;}// join: \'miter\' or \'bevel\'\n// cap: \'butt\' or \'square\'\n// lineDash: null\n// lineDashOffset: 0\n},{key:"setStroke",value:function setStroke(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$thickness=_ref73.thickness,N=_ref73$thickness===void 0?1:_ref73$thickness,_ref73$cap=_ref73.cap,z=_ref73$cap===void 0?"butt":_ref73$cap,_ref73$join=_ref73.join,y=_ref73$join===void 0?"miter":_ref73$join,_ref73$miterLimit=_ref73.miterLimit,P=_ref73$miterLimit===void 0?10:_ref73$miterLimit,_ref73$color=_ref73.color,w=_ref73$color===void 0?[0,0,0,0]:_ref73$color,_ref73$lineDash=_ref73.lineDash,U=_ref73$lineDash===void 0?null:_ref73$lineDash,_ref73$lineDashOffset=_ref73.lineDashOffset,H=_ref73$lineDashOffset===void 0?0:_ref73$lineDashOffset,_ref73$roundSegments=_ref73.roundSegments,Y=_ref73$roundSegments===void 0?20:_ref73$roundSegments;return this[g]=null,this[A]=new a["default"]({lineWidth:N,lineCap:z,lineJoin:y,miterLimit:P,roundSegments:Y}),typeof w=="string"&&(w=Object(m["default"])(w)),this[b]=w,this[A].lineDash=U,this[A].lineDashOffset=H,this;}},{key:"setFill",value:function setFill(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref74$rule=_ref74.rule,N=_ref74$rule===void 0?this.fillRule:_ref74$rule,_ref74$color=_ref74.color,z=_ref74$color===void 0?[0,0,0,0]:_ref74$color;return this[g]=null,this[R]={rule:N},typeof z=="string"&&(z=Object(m["default"])(z)),this[E]=z,this;}/**\n options: {\n scale: false,\n repeat: false,\n rotated: false,\n rect: [10, 10],\n srcRect: [...],\n hidden: false,\n }\n */},{key:"setTexture",value:function setTexture(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,y=_N.image,P=_N.rect;if(N=y,z.rect)for(var w=0;w0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,z=_ref75.colors,_ref75$type=_ref75.type,y=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:z,type:y});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,z=_ref76.colors,_ref76$type=_ref76.type,y=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:z,type:y});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,z=_ref77.colors,_ref77$type=_ref77.type,y=_ref77$type===void 0?"fill":_ref77$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:z,type:y});}/**\n vector: [x0, y0, r0, x1, y1, r1],\n colors: [{offset:0, color}, {offset:1, color}, ...],\n */},{key:"setGradient",value:function setGradient(){var _ref78=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref78.vector,z=_ref78.colors,_ref78$type=_ref78.type,y=_ref78$type===void 0?"fill":_ref78$type;z=z.map(function(_ref79){var U=_ref79.offset,H=_ref79.color;return typeof H=="string"&&(H=Object(m["default"])(H)),{offset:U,color:H};}),this[B]=this[B]||{},this[B][y]={vector:N,colors:z},z.sort(function(U,H){return U.offset-H.offset;});var P=[];z.forEach(function(_ref80){var U=_ref80.offset,H=_ref80.color;P.push.apply(P,[U].concat(_toConsumableArray(H)));});var w;if(N.length===4?w=[N[0],N[1],0,N[2],N[3],0]:w=_toConsumableArray(N),P.length<40&&P.push(-1),P.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=w,this[I].u_colorSteps=P,y==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[J](),this;}},{key:"setUniforms",value:function setUniforms(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[I],N),this;}},{key:"setTransform",value:function setTransform(){var z=this[L];for(var _len3=arguments.length,N=new Array(_len3),_key3=0;_key3<_len3;_key3++){N[_key3]=arguments[_key3];}return e.mat2d.equals(N,z)||(this[L]=N,delete this[D],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var z=this[L];for(var _len4=arguments.length,N=new Array(_len4),_key4=0;_key4<_len4;_key4++){N[_key4]=arguments[_key4];}return this[L]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),z,N),delete this[D],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,z){var y=e.mat2d.create();return y=e.mat2d.translate(Array.of(0,0,0,0,0,0),y,[N,z]),this.transform.apply(this,_toConsumableArray(y));}},{key:"rotate",value:function rotate(N){var _ref81=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref82=_slicedToArray(_ref81,2),z=_ref82[0],y=_ref82[1];var P=e.mat2d.create();return P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[z,y]),P=e.mat2d.rotate(Array.of(0,0,0,0,0,0),P,N),P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[-z,-y]),this.transform.apply(this,_toConsumableArray(P));}},{key:"scale",value:function scale(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),y=_ref84[0],P=_ref84[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[y,P]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[N,z]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-y,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"skew",value:function skew(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref85=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref86=_slicedToArray(_ref85,2),y=_ref86[0],P=_ref86[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[y,P]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan(z),Math.tan(N),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-y,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[$].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,N=new Array(_len5),_key5=0;_key5<_len5;_key5++){N[_key5]=arguments[_key5];}return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this;}// apply linear color transform\n},{key:"transformColor",value:function transformColor(){var z=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return z?z=Object(f.multiply)(z,N):z=N,this.setColorTransform.apply(this,_toConsumableArray(z)),this;}},{key:"blur",value:function blur(N){return this[$].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,z){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(P)&&(P=Object(s["default"])(P)),this[$].push("drop-shadow(".concat(N,"px ").concat(z,"px ").concat(y,"px ").concat(P,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371\n},{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[$].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(f.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.sepia)(N)));}},{key:"url",value:function url(N){return this[$].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,z){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var P=this.meshData,w=P.positions,U=P.cells,H=this.invertMatrix,Y=H[0]*N+H[2]*z+H[4],k=H[1]*N+H[3]*z+H[5],rt=this.boundingBox;if(Yrt[1][0]||krt[1][1])return!1;function it(_ref87,_ref88,_ref89){var _ref90=_slicedToArray(_ref87,2),lt=_ref90[0],ut=_ref90[1];var _ref91=_slicedToArray(_ref88,2),at=_ref91[0],st=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],vt=_ref92[1];var mt=ft-at,pt=vt-st,St=((lt-at)*mt+(ut-st)*pt)/(Math.pow(mt,2)+Math.pow(pt,2));return St>=0&&St<=1;}for(var lt=0;lt=P.fillPointCount)break;if(y==="stroke"&&ut[0]1&&arguments[1]!==undefined?arguments[1]:{};var y=z.width,P=z.height,w=d(z,["width","height"]);var U=new T["default"]();U.rect(0,0,y,P);var H=new V(U,{width:y,height:P});H.setUniforms(w),H.setProgram(N),this[ot].push(H);}}]);}();},/* 57 */ /***/function(h,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e.Stroke;},/* 58 */ /***/function(h,r,t){t.r(r),t.d(r,"Stroke",function(){return p;});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),o=Object(e.create)(),s=Object(e.create)(),f=1e20;var p=/*#__PURE__*/function(){function p(){var _ref93=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref93$lineWidth=_ref93.lineWidth,x=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,m=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,T=_ref93$miterLimit===void 0?10:_ref93$miterLimit,_ref93$lineCap=_ref93.lineCap,l=_ref93$lineCap===void 0?"butt":_ref93$lineCap,_ref93$roundSegments=_ref93.roundSegments,d=_ref93$roundSegments===void 0?20:_ref93$roundSegments;_classCallCheck(this,p);this.lineWidth=x,this.lineJoin=m,this.miterLimit=T,this.lineCap=l,this.roundSegments=d,this._normal=null;}return _createClass(p,[{key:"build",value:function build(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var T=x.length;if(x=_toConsumableArray(x),T<2)return x;m&&((x[0][0]!==x[T-1][0]||x[0][1]!==x[T-1][1])&&x.push(_toConsumableArray(x[0])),x.push(_toConsumableArray(x[1]))),T=x.length,this._normal=null;var l={left:[],right:[]},d=this.lineWidth/2,u=this.lineCap;if(!m&&u==="square"){Object(e.direction)(i,x[0],x[1]),Object(e.scaleAndAdd)(x[0],x[0],i,d);var M=x.length-1;Object(e.direction)(i,x[M],x[M-1]),Object(e.scaleAndAdd)(x[M],x[M],i,d);}for(var _M4=1;_M4this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,T,this._normal,-d*R),c(x,n,R);var E=1/0;m&&(E=Math.min(E,Math.hypot(T[0]-m[0],T[1]-m[1]))),l&&(E=Math.min(E,Math.hypot(l[0]-T[0],l[1]-T[1])));var L=Math.max(d,Math.min(A,E));if(Object(e.scaleAndAdd)(n,T,s,L*R),c(x,n,-R),l)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-d*R),M){var D=Object(e.clone)(n),I=R>0?x.left[x.left.length-1]:x.right[x.right.length-1],C=Object(e.clone)(T),W=Object(e.sub)(Object(e.create)(),I,C),G=Object(e.sub)(Object(e.create)(),D,C),K=Math.PI/this.roundSegments;for(var J=0;J0?O.left.push(Object(e.clone)(x)):O.right.push(Object(e.clone)(x));}function v(O,x,m,T){var l=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,x,m,-T),c(O,n,-l),Object(e.scaleAndAdd)(n,x,m,T),c(O,n,l);}function S(_ref94,m){var O=_ref94.left,x=_ref94.right;var T=Object(e.create)(),l=Object(e.create)();var d=O[0],u=x[0],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])];Object(e.sub)(l,d,g);for(var M=1;M<=m;M++){var A=-1*Math.PI*M/m;Object(e.rotate)(T,l,[0,0],A),Object(e.add)(n,g,T),O.unshift(Object(e.clone)(n));}d=x[x.length-1],u=O[O.length-1],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])],Object(e.sub)(l,d,g);for(var _M5=1;_M5<=m;_M5++){var _A2=-1*Math.PI*_M5/m;Object(e.rotate)(T,l,[0,0],_A2),Object(e.add)(n,g,T),x.push(Object(e.clone)(n));}}},/* 59 */ /***/function(h,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);h.exports=function(i,a){if(a=a||{},i=i.filter(function(m){return m.length>2;}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(m){return m.reduce(function(T,l){return T.concat(l);});});var o=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var s=e.tesselate(n({contours:i,windingRule:o,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),f=[],p=0;pOnext and b->Onext are exchanged. This can have various effects\n * depending on whether a and b belong to different face or vertex rings.\n * For more explanation see tessMeshSplice() below.\n */ // static void Splice( TESShalfEdge *a, TESShalfEdge *b )\nsplice_:function splice_(l,d){var u=l.Onext,g=d.Onext;u.Sym.Lnext=d,g.Sym.Lnext=l,l.Onext=g,d.Onext=u;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the\n * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives\n * a place to insert the new vertex in the global vertex list. We insert\n * the new vertex *before* vNext so that algorithms which walk the vertex\n * list will not see the newly created vertices.\n */ //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )\nmakeVertex_:function makeVertex_(l,d,u){var g=l;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d;var A=d;do A.Org=g,A=A.Onext;while(A!==d);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left\n * face of all edges in the face loop to which eOrig belongs. "fNext" gives\n * a place to insert the new face in the global face list. We insert\n * the new face *before* fNext so that algorithms which walk the face\n * list will not see the newly created faces.\n */ // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )\nmakeFace_:function makeFace_(l,d,u){var g=l;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d,g.trail=null,g.marked=!1,g.inside=u.inside;var A=d;do A.Lface=g,A=A.Lnext;while(A!==d);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),\n * and removes from the global edge list.\n */ //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )\nkillEdge_:function killEdge_(l){l.Sym.sideOnext <- OLD( eDst->Onext )\n *\teDst->Onext <- OLD( eOrg->Onext )\n * where OLD(...) means the value before the meshSplice operation.\n *\n * This can have two effects on the vertex structure:\n * - if eOrg->Org != eDst->Org, the two vertices are merged together\n * - if eOrg->Org == eDst->Org, the origin is split into two vertices\n * In both cases, eDst->Org is changed and eOrg->Org is untouched.\n *\n * Similarly (and independently) for the face structure,\n * - if eOrg->Lface == eDst->Lface, one loop is split into two\n * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one\n * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.\n *\n * Some special cases:\n * If eDst == eOrg, the operation has no effect.\n * If eDst == eOrg->Lnext, the new face will have a single edge.\n * If eDst == eOrg->Lprev, the old face will have a single edge.\n * If eDst == eOrg->Onext, the new vertex will have a single edge.\n * If eDst == eOrg->Oprev, the old vertex will have a single edge.\n */ //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )\nsplice:function splice(l,d){var u=!1,g=!1;if(l!==d){if(d.Org!==l.Org&&(g=!0,this.killVertex_(d.Org,l.Org)),d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(d,l),!g){var M=new a();this.makeVertex_(M,d,l.Org),l.Org.anEdge=l;}if(!u){var A=new o();this.makeFace_(A,d,l.Lface),l.Lface.anEdge=l;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:\n * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop\n * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;\n * the newly created loop will contain eDel->Dst. If the deletion of eDel\n * would create isolated vertices, those are deleted as well.\n *\n * This function could be implemented as two calls to tessMeshSplice\n * plus a few calls to memFree, but this would allocate and delete\n * unnecessary vertices and faces.\n */ //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )\n"delete":function _delete(l){var d=l.Sym,u=!1;if(l.Lface!==l.Rface&&(u=!0,this.killFace_(l.Lface,l.Rface)),l.Onext===l)this.killVertex_(l.Org,null);else if(l.Rface.anEdge=l.Oprev,l.Org.anEdge=l.Onext,this.splice_(l,l.Oprev),!u){var g=new o();this.makeFace_(g,l,l.Lface);}d.Onext===d?(this.killVertex_(d.Org,null),this.killFace_(d.Lface,null)):(l.Lface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),this.killEdge_(l);},/******************** Other Edge Operations **********************/ /* All these routines can be implemented with the basic edge\n * operations above. They are provided for convenience and efficiency.\n */ /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that\n * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.\n * eOrg and eNew will have the same left face.\n */ // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );\naddEdgeVertex:function addEdgeVertex(l){var d=this.makeEdge_(l),u=d.Sym;this.splice_(d,l.Lnext),d.Org=l.Dst;var g=new a();return this.makeVertex_(g,u,d.Org),d.Lface=u.Lface=l.Lface,d;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,\n * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.\n * eOrg and eNew will have the same left face.\n */ // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );\nsplitEdge:function splitEdge(l,d){var u=this.addEdgeVertex(l),g=u.Sym;return this.splice_(l.Sym,l.Sym.Oprev),this.splice_(l.Sym,g),l.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=l.Rface,g.winding=l.winding,g.Sym.winding=l.Sym.winding,g;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst\n * to eDst->Org, and returns the corresponding half-edge eNew.\n * If eOrg->Lface == eDst->Lface, this splits one loop into two,\n * and the newly created loop is eNew->Lface. Otherwise, two disjoint\n * loops are merged into one, and the loop eDst->Lface is destroyed.\n *\n * If (eOrg == eDst), the new face will have only two edges.\n * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.\n * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.\n */ // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );\nconnect:function connect(l,d){var u=!1,g=this.makeEdge_(l),M=g.Sym;if(d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(g,l.Lnext),this.splice_(M,d),g.Org=l.Dst,M.Org=d.Org,g.Lface=M.Lface=l.Lface,l.Lface.anEdge=M,!u){var A=new o();this.makeFace_(A,g,l.Lface);}return g;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the\n * global face list. All edges of fZap will have a NULL pointer as their\n * left face. Any edges which also have a NULL pointer as their right face\n * are deleted entirely (along with any isolated vertices this produces).\n * An entire mesh can be deleted by zapping its faces, one at a time,\n * in any order. Zapped faces cannot be used in further mesh operations!\n */zapFace:function zapFace(l){var d=l.anEdge,u,g,M,A,R;g=d.Lnext;do u=g,g=u.Lnext,u.Lface=null,u.Rface===null&&(u.Onext===u?this.killVertex_(u.Org,null):(u.Org.anEdge=u.Onext,this.splice_(u,u.Oprev)),M=u.Sym,M.Onext===M?this.killVertex_(M.Org,null):(M.Org.anEdge=M.Onext,this.splice_(M,M.Oprev)),this.killEdge_(u));while(u!=d);A=l.prev,R=l.next,R.prev=A,A.next=R;},countFaceVerts_:function countFaceVerts_(l){var d=l.anEdge,u=0;do u++,d=d.Lnext;while(d!==l.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )\nmergeConvexFaces:function mergeConvexFaces(l){var d,u,g,M,A,R,b;for(d=this.fHead.next;d!==this.fHead;d=d.next)if(d.inside)for(u=d.anEdge,A=u.Org;g=u.Lnext,M=u.Sym,M&&M.Lface&&M.Lface.inside&&(R=this.countFaceVerts_(d),b=this.countFaceVerts_(M.Lface),R+b-2<=l&&n.vertCCW(u.Lprev.Org,u.Org,M.Lnext.Lnext.Org)&&n.vertCCW(M.Lprev.Org,M.Org,u.Lnext.Lnext.Org)&&(g=M.Lnext,this["delete"](M),u=null,M=null)),!(u&&u.Lnext.Org===A);)u=g;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.\n */check:function check(){var l=this.fHead,d=this.vHead,u=this.eHead,g,M,A,R,b,E;for(M=l,M=l;(g=M.next)!==l;M=g){i(g.prev===M),b=g.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Lface===g),b=b.Lnext;while(b!==g.anEdge);}for(i(g.prev===M&&g.anEdge===null),R=d,R=d;(A=R.next)!==d;R=A){i(A.prev===R),b=A.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Org===A),b=b.Onext;while(b!==A.anEdge);}for(i(A.prev===R&&A.anEdge===null),E=u,E=u;(b=E.next)!==u;E=b)i(b.Sym.next===E.Sym),i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Org!==null),i(b.Dst!==null),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b);i(b.Sym.next===E.Sym&&b.Sym===this.eHeadSym&&b.Sym.Sym===b&&b.Org===null&&b.Dst===null&&b.Lface===null&&b.Rface===null);}},n.vertEq=function(l,d){return l.s===d.s&&l.t===d.t;},n.vertLeq=function(l,d){return l.s0?g0?(d.t-u.t)*g+(d.t-l.t)*M:0;},n.transEval=function(l,d,u){i(n.transLeq(l,d)&&n.transLeq(d,u));var g=d.t-l.t,M=u.t-d.t;return g+M>0?g0?(d.s-u.s)*g+(d.s-l.s)*M:0;},n.vertCCW=function(l,d,u){return l.s*(d.t-u.t)+d.s*(u.t-l.t)+u.s*(l.t-d.t)>=0;},n.interpolate=function(l,d,u,g){return l=l<0?0:l,u=u<0?0:u,l<=u?u===0?(d+g)/2:d+(g-d)*(l/(l+u)):g+(d-g)*(u/(l+u));},n.intersect=function(l,d,u,g,M){var A,R,b;n.vertLeq(l,d)||(b=l,l=d,d=b),n.vertLeq(u,g)||(b=u,u=g,g=b),n.vertLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.vertLeq(u,d)?n.vertLeq(d,g)?(A=n.edgeEval(l,u,d),R=n.edgeEval(u,d,g),A+R<0&&(A=-A,R=-R),M.s=n.interpolate(A,u.s,R,d.s)):(A=n.edgeSign(l,u,d),R=-n.edgeSign(l,g,d),A+R<0&&(A=-A,R=-R),M.s=n.interpolate(A,u.s,R,g.s)):M.s=(u.s+d.s)/2,n.transLeq(l,d)||(b=l,l=d,d=b),n.transLeq(u,g)||(b=u,u=g,g=b),n.transLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.transLeq(u,d)?n.transLeq(d,g)?(A=n.transEval(l,u,d),R=n.transEval(u,d,g),A+R<0&&(A=-A,R=-R),M.t=n.interpolate(A,u.t,R,d.t)):(A=n.transSign(l,u,d),R=-n.transSign(l,g,d),A+R<0&&(A=-A,R=-R),M.t=n.interpolate(A,u.t,R,g.t)):M.t=(u.t+d.t)/2;};function p(){this.key=null,this.next=null,this.prev=null;}function c(l,d){this.head=new p(),this.head.next=this.head,this.head.prev=this.head,this.frame=l,this.leq=d;}c.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(l){return this.insertBefore(this.head,l);},search:function search(l){var d=this.head;do d=d.next;while(d.key!==null&&!this.leq(this.frame,l,d.key));return d;},insertBefore:function insertBefore(l,d){do l=l.prev;while(l.key!==null&&!this.leq(this.frame,l.key,d));var u=new p();return u.key=d,u.next=l.next,l.next.prev=u,u.prev=l,l.next=u,u;},"delete":function _delete(l){l.next.prev=l.prev,l.prev.next=l.next;}};function v(){this.handle=null;}function S(){this.key=null,this.node=null;}function O(l,d){this.size=0,this.max=l,this.nodes=[],this.nodes.length=l+1;var u;for(u=0;uthis.size||this.leq(u[g].key,u[M].key)){d[l].handle=g,u[g].node=l;break;}d[l].handle=M,u[M].node=l,l=A;}},floatUp_:function floatUp_(l){var d=this.nodes,u=this.handles,g,M,A;for(g=d[l].handle;;){if(A=l>>1,M=d[A].handle,A===0||this.leq(u[M].key,u[g].key)){d[l].handle=g,u[g].node=l;break;}d[l].handle=M,u[M].node=l,l=A;}},init:function init(){for(var l=this.size;l>=1;--l)this.floatDown_(l);this.initialized=!0;},min:function min(){return this.handles[this.nodes[1].handle].key;},/* really pqHeapInsert */ /* returns INV_HANDLE iff out of memory */ //PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )\ninsert:function insert(l){var d,u;if(d=++this.size,d*2>this.max){this.max*=2;var g,M;for(M=this.nodes.length,this.nodes.length=this.max+1,g=M;g0&&(l[1].handle=l[this.size].handle,d[l[1].handle].node=1,d[u].key=null,d[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),g;},"delete":function _delete(l){var d=this.nodes,u=this.handles,g;i(l>=1&&l<=this.max&&u[l].key!==null),g=u[l].node,d[g].handle=d[this.size].handle,u[d[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(u[d[g>>1].handle].key,u[d[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),u[l].key=null,u[l].node=this.freeList,this.freeList=l;}};function x(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var m={};m.regionBelow=function(l){return l.nodeUp.prev.key;},m.regionAbove=function(l){return l.nodeUp.next.key;},m.debugEvent=function(l){},m.addWinding=function(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},m.edgeLeq=function(l,d,u){var g=l.event,R,b,M=d.eUp,A=u.eUp;if(M.Dst===g)return A.Dst===g?n.vertLeq(M.Org,A.Org)?n.edgeSign(A.Dst,M.Org,A.Org)<=0:n.edgeSign(M.Dst,A.Org,M.Org)>=0:n.edgeSign(A.Dst,g,A.Org)<=0;if(A.Dst===g)return n.edgeSign(M.Dst,g,M.Org)>=0;var R=n.edgeEval(M.Dst,g,M.Org),b=n.edgeEval(A.Dst,g,A.Org);return R>=b;},m.deleteRegion=function(l,d){d.fixUpperEdge&&i(d.eUp.winding===0),d.eUp.activeRegion=null,l.dict["delete"](d.nodeUp);},m.fixUpperEdge=function(l,d,u){i(d.fixUpperEdge),l.mesh["delete"](d.eUp),d.fixUpperEdge=!1,d.eUp=u,u.activeRegion=d;},m.topLeftRegion=function(l,d){var u=d.eUp.Org,g;do d=m.regionAbove(d);while(d.eUp.Org===u);if(d.fixUpperEdge){if(g=l.mesh.connect(m.regionBelow(d).eUp.Sym,d.eUp.Lnext),g===null)return null;m.fixUpperEdge(l,d,g),d=m.regionAbove(d);}return d;},m.topRightRegion=function(l){var d=l.eUp.Dst;do l=m.regionAbove(l);while(l.eUp.Dst===d);return l;},m.addRegionBelow=function(l,d,u){var g=new x();return g.eUp=u,g.nodeUp=l.dict.insertBefore(d.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,u.activeRegion=g,g;},m.isWindingInside=function(l,d){switch(l.windingRule){case e.WINDING_ODD:return(d&1)!==0;case e.WINDING_NONZERO:return d!==0;case e.WINDING_POSITIVE:return d>0;case e.WINDING_NEGATIVE:return d<0;case e.WINDING_ABS_GEQ_TWO:return d>=2||d<=-2;}return i(!1),!1;},m.computeWinding=function(l,d){d.windingNumber=m.regionAbove(d).windingNumber+d.eUp.winding,d.inside=m.isWindingInside(l,d.windingNumber);},m.finishRegion=function(l,d){var u=d.eUp,g=u.Lface;g.inside=d.inside,g.anEdge=u,m.deleteRegion(l,d);},m.finishLeftRegions=function(l,d,u){for(var g,R,M=null,A=d,R=d.eUp;A!==u;){if(A.fixUpperEdge=!1,M=m.regionBelow(A),g=M.eUp,g.Org!=R.Org){if(!M.fixUpperEdge){m.finishRegion(l,A);break;}g=l.mesh.connect(R.Lprev,g.Sym),m.fixUpperEdge(l,M,g);}R.Onext!==g&&(l.mesh.splice(g.Oprev,g),l.mesh.splice(R,g)),m.finishRegion(l,A),R=M.eUp,A=M;}return R;},m.addRightEdges=function(l,d,u,g,M,A){var R,b,E,L,D=!0;E=u;do i(n.vertLeq(E.Org,E.Dst)),m.addRegionBelow(l,d,E.Sym),E=E.Onext;while(E!==g);for(M===null&&(M=m.regionBelow(d).eUp.Rprev),b=d,L=M;R=m.regionBelow(b),E=R.eUp.Sym,E.Org===L.Org;)E.Onext!==L&&(l.mesh.splice(E.Oprev,E),l.mesh.splice(L.Oprev,E)),R.windingNumber=b.windingNumber-E.winding,R.inside=m.isWindingInside(l,R.windingNumber),b.dirty=!0,!D&&m.checkForRightSplice(l,b)&&(m.addWinding(E,L),m.deleteRegion(l,b),l.mesh["delete"](L)),D=!1,b=R,L=E;b.dirty=!0,i(b.windingNumber-E.winding===R.windingNumber),A&&m.walkDirtyRegions(l,b);},m.spliceMergeVertices=function(l,d,u){l.mesh.splice(d,u);},m.vertexWeights=function(l,d,u){var g=n.vertL1dist(d,l),M=n.vertL1dist(u,l),A=0.5*M/(g+M),R=0.5*g/(g+M);l.coords[0]+=A*d.coords[0]+R*u.coords[0],l.coords[1]+=A*d.coords[1]+R*u.coords[1],l.coords[2]+=A*d.coords[2]+R*u.coords[2];},m.getIntersectData=function(l,d,u,g,M,A){d.coords[0]=d.coords[1]=d.coords[2]=0,d.idx=-1,m.vertexWeights(d,u,g),m.vertexWeights(d,M,A);},m.checkForRightSplice=function(l,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp;if(n.vertLeq(g.Org,M.Org)){if(n.edgeSign(M.Dst,g.Org,M.Org)>0)return!1;n.vertEq(g.Org,M.Org)?g.Org!==M.Org&&(l.pq["delete"](g.Org.pqHandle),m.spliceMergeVertices(l,M.Oprev,g)):(l.mesh.splitEdge(M.Sym),l.mesh.splice(g,M.Oprev),d.dirty=u.dirty=!0);}else{if(n.edgeSign(g.Dst,M.Org,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),l.mesh.splice(M.Oprev,g);}return!0;},m.checkForLeftSplice=function(l,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp,A;if(i(!n.vertEq(g.Dst,M.Dst)),n.vertLeq(g.Dst,M.Dst)){if(n.edgeSign(g.Dst,M.Dst,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,A=l.mesh.splitEdge(g),l.mesh.splice(M.Sym,A),A.Lface.inside=d.inside;}else{if(n.edgeSign(M.Dst,g.Dst,M.Org)>0)return!1;d.dirty=u.dirty=!0,A=l.mesh.splitEdge(M),l.mesh.splice(g.Lnext,M.Sym),A.Rface.inside=d.inside;}return!0;},m.checkForIntersect=function(l,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp,A=g.Org,R=M.Org,b=g.Dst,E=M.Dst,L,D,I=new a(),C,W;if(i(!n.vertEq(E,b)),i(n.edgeSign(b,l.event,A)<=0),i(n.edgeSign(E,l.event,R)>=0),i(A!==l.event&&R!==l.event),i(!d.fixUpperEdge&&!u.fixUpperEdge),A===R||(L=Math.min(A.t,b.t),D=Math.max(R.t,E.t),L>D))return!1;if(n.vertLeq(A,R)){if(n.edgeSign(E,A,R)>0)return!1;}else if(n.edgeSign(b,R,A)<0)return!1;return m.debugEvent(l),n.intersect(b,A,E,R,I),i(Math.min(A.t,b.t)<=I.t),i(I.t<=Math.max(R.t,E.t)),i(Math.min(E.s,b.s)<=I.s),i(I.s<=Math.max(R.s,A.s)),n.vertLeq(I,l.event)&&(I.s=l.event.s,I.t=l.event.t),C=n.vertLeq(A,R)?A:R,n.vertLeq(C,I)&&(I.s=C.s,I.t=C.t),n.vertEq(I,A)||n.vertEq(I,R)?(m.checkForRightSplice(l,d),!1):!n.vertEq(b,l.event)&&n.edgeSign(b,l.event,I)>=0||!n.vertEq(E,l.event)&&n.edgeSign(E,l.event,I)<=0?E===l.event?(l.mesh.splitEdge(g.Sym),l.mesh.splice(M.Sym,g),d=m.topLeftRegion(l,d),g=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),u),m.addRightEdges(l,d,g.Oprev,g,g,!0),!0):b===l.event?(l.mesh.splitEdge(M.Sym),l.mesh.splice(g.Lnext,M.Oprev),u=d,d=m.topRightRegion(d),W=m.regionBelow(d).eUp.Rprev,u.eUp=M.Oprev,M=m.finishLeftRegions(l,u,null),m.addRightEdges(l,d,M.Onext,g.Rprev,W,!0),!0):(n.edgeSign(b,l.event,I)>=0&&(m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),g.Org.s=l.event.s,g.Org.t=l.event.t),n.edgeSign(E,l.event,I)<=0&&(d.dirty=u.dirty=!0,l.mesh.splitEdge(M.Sym),M.Org.s=l.event.s,M.Org.t=l.event.t),!1):(l.mesh.splitEdge(g.Sym),l.mesh.splitEdge(M.Sym),l.mesh.splice(M.Oprev,g),g.Org.s=I.s,g.Org.t=I.t,g.Org.pqHandle=l.pq.insert(g.Org),m.getIntersectData(l,g.Org,A,b,R,E),m.regionAbove(d).dirty=d.dirty=u.dirty=!0,!1);},m.walkDirtyRegions=function(l,d){for(var u=m.regionBelow(d),g,M;;){for(;u.dirty;)d=u,u=m.regionBelow(u);if(!d.dirty&&(u=d,d=m.regionAbove(d),d===null||!d.dirty))return;if(d.dirty=!1,g=d.eUp,M=u.eUp,g.Dst!==M.Dst&&m.checkForLeftSplice(l,d)&&(u.fixUpperEdge?(m.deleteRegion(l,u),l.mesh["delete"](M),u=m.regionBelow(d),M=u.eUp):d.fixUpperEdge&&(m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(u),g=d.eUp)),g.Org!==M.Org)if(g.Dst!==M.Dst&&!d.fixUpperEdge&&!u.fixUpperEdge&&(g.Dst===l.event||M.Dst===l.event)){if(m.checkForIntersect(l,d))return;}else m.checkForRightSplice(l,d);g.Org===M.Org&&g.Dst===M.Dst&&(m.addWinding(M,g),m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(u));}},m.connectRightVertex=function(l,d,u){var g,M=u.Onext,A=m.regionBelow(d),R=d.eUp,b=A.eUp,E=!1;if(R.Dst!==b.Dst&&m.checkForIntersect(l,d),n.vertEq(R.Org,l.event)&&(l.mesh.splice(M.Oprev,R),d=m.topLeftRegion(l,d),M=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),A),E=!0),n.vertEq(b.Org,l.event)&&(l.mesh.splice(u,b.Oprev),u=m.finishLeftRegions(l,A,null),E=!0),E){m.addRightEdges(l,d,u.Onext,M,M,!0);return;}n.vertLeq(b.Org,R.Org)?g=b.Oprev:g=R,g=l.mesh.connect(u.Lprev,g),m.addRightEdges(l,d,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,m.walkDirtyRegions(l,d);},m.connectLeftDegenerate=function(l,d,u){var g,M,A,R,b;if(g=d.eUp,n.vertEq(g.Org,u)){i(!1/*TOLERANCE_NONZERO*/),m.spliceMergeVertices(l,g,u.anEdge);return;}if(!n.vertEq(g.Dst,u)){l.mesh.splitEdge(g.Sym),d.fixUpperEdge&&(l.mesh["delete"](g.Onext),d.fixUpperEdge=!1),l.mesh.splice(u.anEdge,g),m.sweepEvent(l,u);return;}i(!1/*TOLERANCE_NONZERO*/),d=m.topRightRegion(d),b=m.regionBelow(d),A=b.eUp.Sym,M=R=A.Onext,b.fixUpperEdge&&(i(M!==A),m.deleteRegion(l,b),l.mesh["delete"](A),A=M.Oprev),l.mesh.splice(u.anEdge,A),n.edgeGoesLeft(M)||(M=null),m.addRightEdges(l,d,A.Onext,R,M,!0);},m.connectLeftVertex=function(l,d){var u,g,M,A,R,b,E=new x();if(E.eUp=d.anEdge.Sym,u=l.dict.search(E).key,g=m.regionBelow(u),!!g){if(A=u.eUp,R=g.eUp,n.edgeSign(A.Dst,d,A.Org)===0){m.connectLeftDegenerate(l,u,d);return;}if(M=n.vertLeq(R.Dst,A.Dst)?u:g,u.inside||M.fixUpperEdge){if(M===u)b=l.mesh.connect(d.anEdge.Sym,A.Lnext);else{var L=l.mesh.connect(R.Dnext,d.anEdge);b=L.Sym;}M.fixUpperEdge?m.fixUpperEdge(l,M,b):m.computeWinding(l,m.addRegionBelow(l,u,b)),m.sweepEvent(l,d);}else m.addRightEdges(l,u,d.anEdge,d.anEdge,null,!0);}},m.sweepEvent=function(l,d){l.event=d,m.debugEvent(l);for(var u=d.anEdge;u.activeRegion===null;)if(u=u.Onext,u===d.anEdge){m.connectLeftVertex(l,d);return;}var g=m.topLeftRegion(l,u.activeRegion);i(g!==null);var M=m.regionBelow(g),A=M.eUp,R=m.finishLeftRegions(l,M,null);R.Onext===A?m.connectRightVertex(l,g,R):m.addRightEdges(l,g,R.Onext,A,A,!0);},m.addSentinel=function(l,d,u,g){var M=new x(),A=l.mesh.makeEdge();A.Org.s=u,A.Org.t=g,A.Dst.s=d,A.Dst.t=g,l.event=A.Dst,M.eUp=A,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=l.dict.insert(M);},m.initEdgeDict=function(l){l.dict=new c(l,m.edgeLeq);var d=l.bmax[0]-l.bmin[0],u=l.bmax[1]-l.bmin[1],g=l.bmin[0]-d,M=l.bmax[0]+d,A=l.bmin[1]-u,R=l.bmax[1]+u;m.addSentinel(l,g,M,A),m.addSentinel(l,g,M,R);},m.doneEdgeDict=function(l){for(var d,u=0;(d=l.dict.min().key)!==null;)d.sentinel||(i(d.fixUpperEdge),i(++u===1)),i(d.windingNumber===0),m.deleteRegion(l,d);},m.removeDegenerateEdges=function(l){var d,u,g,M=l.mesh.eHead;for(d=M.next;d!==M;d=u)u=d.next,g=d.Lnext,n.vertEq(d.Org,d.Dst)&&d.Lnext.Lnext!==d&&(m.spliceMergeVertices(l,g,d),l.mesh["delete"](d),d=g,g=d.Lnext),g.Lnext===d&&(g!==d&&((g===u||g===u.Sym)&&(u=u.next),l.mesh["delete"](g)),(d===u||d===u.Sym)&&(u=u.next),l.mesh["delete"](d));},m.initPriorityQ=function(l){var d,u,g,M=0;for(g=l.mesh.vHead,u=g.next;u!==g;u=u.next)M++;for(M+=8,d=l.pq=new O(M,n.vertLeq),g=l.mesh.vHead,u=g.next;u!==g;u=u.next)u.pqHandle=d.insert(u);return u!==g?!1:(d.init(),!0);},m.donePriorityQ=function(l){l.pq=null;},m.removeDegenerateFaces=function(l,d){var u,g,M;for(u=d.fHead.next;u!==d.fHead;u=g)g=u.next,M=u.anEdge,i(M.Lnext!==M),M.Lnext.Lnext===M&&(m.addWinding(M.Onext,M),l.mesh["delete"](M));return!0;},m.computeInterior=function(l){var d,u;if(m.removeDegenerateEdges(l),!m.initPriorityQ(l))return!1;for(m.initEdgeDict(l);(d=l.pq.extractMin())!==null;){for(;u=l.pq.min(),!(u===null||!n.vertEq(u,d));)u=l.pq.extractMin(),m.spliceMergeVertices(l,d.anEdge,u.anEdge);m.sweepEvent(l,d);}return l.event=l.dict.min().key.eUp.Org,m.debugEvent(l),m.doneEdgeDict(l),m.donePriorityQ(l),m.removeDegenerateFaces(l,l.mesh)?(l.mesh.check(),!0):!1;};function T(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=e.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0;}T.prototype={dot_:function dot_(l,d){return l[0]*d[0]+l[1]*d[1]+l[2]*d[2];},normalize_:function normalize_(l){var d=l[0]*l[0]+l[1]*l[1]+l[2]*l[2];i(d>0),d=Math.sqrt(d),l[0]/=d,l[1]/=d,l[2]/=d;},longAxis_:function longAxis_(l){var d=0;return Math.abs(l[1])>Math.abs(l[0])&&(d=1),Math.abs(l[2])>Math.abs(l[d])&&(d=2),d;},computeNormal_:function computeNormal_(l){var d,u,g,M,A,R,b=[0,0,0],E=[0,0,0],L=[0,0,0],D=[0,0,0],I=[0,0,0],C=[null,null,null],W=[null,null,null],G=this.mesh.vHead,K;for(d=G.next,K=0;K<3;++K)M=d.coords[K],E[K]=M,W[K]=d,b[K]=M,C[K]=d;for(d=G.next;d!==G;d=d.next)for(K=0;K<3;++K)M=d.coords[K],Mb[K]&&(b[K]=M,C[K]=d);if(K=0,b[1]-E[1]>b[0]-E[0]&&(K=1),b[2]-E[2]>b[K]-E[K]&&(K=2),E[K]>=b[K]){l[0]=0,l[1]=0,l[2]=1;return;}for(R=0,u=W[K],g=C[K],L[0]=u.coords[0]-g.coords[0],L[1]=u.coords[1]-g.coords[1],L[2]=u.coords[2]-g.coords[2],d=G.next;d!==G;d=d.next)D[0]=d.coords[0]-g.coords[0],D[1]=d.coords[1]-g.coords[1],D[2]=d.coords[2]-g.coords[2],I[0]=L[1]*D[2]-L[2]*D[1],I[1]=L[2]*D[0]-L[0]*D[2],I[2]=L[0]*D[1]-L[1]*D[0],A=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],A>R&&(R=A,l[0]=I[0],l[1]=I[1],l[2]=I[2]);R<=0&&(l[0]=l[1]=l[2]=0,l[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var l,d,u=this.mesh.fHead,g,M=this.mesh.vHead,A;for(l=0,d=u.next;d!==u;d=d.next)if(A=d.anEdge,!(A.winding<=0))do l+=(A.Org.s-A.Dst.s)*(A.Org.t+A.Dst.t),A=A.Lnext;while(A!==d.anEdge);if(l<0){for(g=M.next;g!==M;g=g.next)g.t=-g.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/*\t#ifdef FOR_TRITE_TEST_PROGRAM\n #include \n extern int RandomSweep;\n #define S_UNIT_X\t(RandomSweep ? (2*drand48()-1) : 1.0)\n #define S_UNIT_Y\t(RandomSweep ? (2*drand48()-1) : 0.0)\n #else\n #if defined(SLANTED_SWEEP) */ /* The "feature merging" is not intended to be complete. There are\n * special cases where edges are nearly parallel to the sweep line\n * which are not implemented. The algorithm should still behave\n * robustly (ie. produce a reasonable tesselation) in the presence\n * of such edges, however it may miss features which could have been\n * merged. We could minimize this effect by choosing the sweep line\n * direction to be something unusual (ie. not parallel to one of the\n * coordinate axes).\n */ /*\t#define S_UNIT_X\t(TESSreal)0.50941539564955385\t// Pre-normalized\n #define S_UNIT_Y\t(TESSreal)0.86052074622010633\n #else\n #define S_UNIT_X\t(TESSreal)1.0\n #define S_UNIT_Y\t(TESSreal)0.0\n #endif\n #endif*/ /* Determine the polygon normal and project vertices onto the plane\n * of the polygon.\n */projectPolygon_:function projectPolygon_(){var l,d=this.mesh.vHead,u=[0,0,0],g,M,A,R,b=!1;for(u[0]=this.normal[0],u[1]=this.normal[1],u[2]=this.normal[2],u[0]===0&&u[1]===0&&u[2]===0&&(this.computeNormal_(u),b=!0),g=this.sUnit,M=this.tUnit,A=this.longAxis_(u),g[A]=0,g[(A+1)%3]=1,g[(A+2)%3]=0,M[A]=0,M[(A+1)%3]=0,M[(A+2)%3]=u[A]>0?1:-1,l=d.next;l!==d;l=l.next)l.s=this.dot_(l.coords,g),l.t=this.dot_(l.coords,M);for(b&&this.checkOrientation_(),R=!0,l=d.next;l!==d;l=l.next)R?(this.bmin[0]=this.bmax[0]=l.s,this.bmin[1]=this.bmax[1]=l.t,R=!1):(l.sthis.bmax[0]&&(this.bmax[0]=l.s),l.tthis.bmax[1]&&(this.bmax[1]=l.t));},addWinding_:function addWinding_(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region\n * (what else would it do??) The region must consist of a single\n * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this\n * case means that any vertical line intersects the interior of the\n * region in a single interval. \n *\n * Tessellation consists of adding interior edges (actually pairs of\n * half-edges), to split the region into non-overlapping triangles.\n *\n * The basic idea is explained in Preparata and Shamos (which I don\'\'t\n * have handy right now), although their implementation is more\n * complicated than this one. The are two edge chains, an upper chain\n * and a lower chain. We process all vertices from both chains in order,\n * from right to left.\n *\n * The algorithm ensures that the following invariant holds after each\n * vertex is processed: the untessellated region consists of two\n * chains, where one chain (say the upper) is a single edge, and\n * the other chain is concave. The left vertex of the single edge\n * is always to the left of all vertices in the concave chain.\n *\n * Each step consists of adding the rightmost unprocessed vertex to one\n * of the two chains, and forming a fan of triangles from the rightmost\n * of two chain endpoints. Determining whether we can add each triangle\n * to the fan is a simple orientation test. By making the fan as large\n * as possible, we restore the invariant (check it yourself).\n */ //\tint tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )\ntessellateMonoRegion_:function tessellateMonoRegion_(l,d){var u,g;for(u=d.anEdge,i(u.Lnext!==u&&u.Lnext.Lnext!==u);n.vertLeq(u.Dst,u.Org);u=u.Lprev);for(;n.vertLeq(u.Org,u.Dst);u=u.Lnext);for(g=u.Lprev;u.Lnext!==g;)if(n.vertLeq(u.Dst,g.Org)){for(;g.Lnext!==u&&(n.edgeGoesLeft(g.Lnext)||n.edgeSign(g.Org,g.Dst,g.Lnext.Dst)<=0);){var M=l.connect(g.Lnext,g);g=M.Sym;}g=g.Lprev;}else{for(;g.Lnext!==u&&(n.edgeGoesRight(u.Lprev)||n.edgeSign(u.Dst,u.Org,u.Lprev.Org)>=0);){var M=l.connect(u,u.Lprev);u=M.Sym;}u=u.Lnext;}for(i(g.Lnext!==u);g.Lnext.Lnext!==u;){var M=l.connect(g.Lnext,g);g=M.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of\n * the mesh which is marked "inside" the polygon. Each such region\n * must be monotone.\n */ //int tessMeshTessellateInterior( TESSmesh *mesh )\ntessellateInterior_:function tessellateInterior_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)if(u=d.next,d.inside&&!this.tessellateMonoRegion_(l,d))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces\n * which are not marked "inside" the polygon. Since further mesh operations\n * on NULL faces are not allowed, the main purpose is to clean up the\n * mesh so that exterior loops are not represented in the data structure.\n */ //void tessMeshDiscardExterior( TESSmesh *mesh )\ndiscardExterior_:function discardExterior_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)u=d.next,d.inside||l.zapFace(d);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the\n * winding numbers on all edges so that regions marked "inside" the\n * polygon have a winding number of "value", and regions outside\n * have a winding number of 0.\n *\n * If keepOnlyBoundary is TRUE, it also deletes all edges which do not\n * separate an interior region from an exterior one.\n */ //\tint tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )\nsetWindingNumber_:function setWindingNumber_(l,d,u){var g,M;for(g=l.eHead.next;g!==l.eHead;g=M)M=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?d:-d:u?l["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(l){return!l.Rface||!l.Rface.inside?-1:l.Rface.n;},outputPolymesh_:function outputPolymesh_(l,d,u,g){var M,A,R,b=0,E=0,L,D;for(u>3&&l.mergeConvexFaces(u),M=l.vHead.next;M!==l.vHead;M=M.next)M.n=-1;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.n=-1,!!A.inside){R=A.anEdge,L=0;do M=R.Org,M.n===-1&&(M.n=E,E++),L++,R=R.Lnext;while(R!==A.anEdge);i(L<=u),A.n=b,++b;}for(this.elementCount=b,d===e.CONNECTED_POLYGONS&&(b*=2),this.elements=[],this.elements.length=b*u,this.vertexCount=E,this.vertices=[],this.vertices.length=E*g,this.vertexIndices=[],this.vertexIndices.length=E,M=l.vHead.next;M!==l.vHead;M=M.next)if(M.n!==-1){var I=M.n*g;this.vertices[I+0]=M.coords[0],this.vertices[I+1]=M.coords[1],g>2&&(this.vertices[I+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx;}var C=0;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.inside){R=A.anEdge,L=0;do M=R.Org,this.elements[C++]=M.n,L++,R=R.Lnext;while(R!==A.anEdge);for(D=L;D2&&(this.vertices[b++]=g.Org.coords[2]),this.vertexIndices[E++]=g.Org.idx,R++,g=g.Lnext;while(g!==M);this.elements[L++]=A,this.elements[L++]=R,A+=R;}},addContour:function addContour(l,d){var u,g;for(this.mesh===null&&(this.mesh=new f()),l<2&&(l=2),l>3&&(l=3),u=null,g=0;g2?u.Org.coords[2]=d[g+2]:u.Org.coords[2]=0,u.Org.idx=this.vertexIndexCounter++,u.winding=1,u.Sym.winding=-1;},//\tint tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )\ntesselate:function tesselate(l,d,u,g,M){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,M&&(this.normal[0]=M[0],this.normal[1]=M[1],this.normal[2]=M[2]),this.windingRule=l,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),m.computeInterior(this);var A=this.mesh;return d===e.BOUNDARY_CONTOURS?this.setWindingNumber_(A,1,!0):this.tessellateInterior_(A),A.check(),d===e.BOUNDARY_CONTOURS?this.outputContours_(A,g):this.outputPolymesh_(A,d,u,g),!0;}};},/* 62 */ /***/function(h,r){h.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,O=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,x=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,m=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,T=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var l=O|x<<1|m<<2|T<<3;var d=S[o][l];Array.isArray(d)&&(d=S.createProgram.apply(S,_toConsumableArray(d)),S[o][l]=d),S.program!==d&&S.useProgram(d,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var p=[];function c(S){for(var O=0;O<64;O++){var x=[],m=!!(O&1),_T17=!!(O&2),_l13=!!(O&4),d=!!(O&8),u=!!(O&16),g=!!(O&32);m&&x.push("#define TEXTURE 1"),_T17&&x.push("#define FILTER 1"),_l13&&x.push("#define GRADIENT 1"),d&&x.push("#define CLOUDCOLOR 1"),u&&x.push("#define CLOUDFILTER 1"),g&&x.push("#define CLIPPATH 1");var M="".concat(x.join("\\n"),"\\n"),A=[];if(m){A.push("uniform sampler2D u_texSampler;");for(var R=0;R<12;R++)A.push("uniform sampler2D u_texFrame".concat(R,";"));}g&&A.push("uniform sampler2D u_clipSampler;"),p[O]=[M+A.join("\\n")+a["default"],M+i["default"]];}}function v(S){var _ref96=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref96$hasTexture=_ref96.hasTexture,O=_ref96$hasTexture===void 0?!1:_ref96$hasTexture,_ref96$hasFilter=_ref96.hasFilter,x=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,m=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,T=_ref96$hasCloudColor===void 0?!1:_ref96$hasCloudColor,_ref96$hasCloudFilter=_ref96.hasCloudFilter,l=_ref96$hasCloudFilter===void 0?!1:_ref96$hasCloudFilter,_ref96$hasClipPath=_ref96.hasClipPath,d=_ref96$hasClipPath===void 0?!1:_ref96$hasClipPath;var u=O|x<<1|m<<2|T<<3|l<<4|d<<5;var g=p[u];Array.isArray(g)&&(g=S.createProgram.apply(S,_toConsumableArray(g)),p[u]=g),S.program!==g&&S.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});}},/* 64 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\\nattribute vec4 a_color;\\nvarying vec4 vColor;\\nvarying float flagBackground;\\nuniform vec2 u_resolution;\\nuniform mat3 viewMatrix;\\nuniform mat3 projectionMatrix;\\n\\n#ifdef TEXTURE\\nattribute vec3 a_vertexTextureCoord;\\nvarying vec3 vTextureCoord;\\nattribute vec4 a_sourceRect;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nattribute vec2 a_clipUV;\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef GRADIENT\\nuniform float u_radialGradientVector[6];\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\n#endif\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n\\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\\n gl_Position = vec4(pos.xy, 1.0, 1.0);\\n\\n#ifdef GRADIENT\\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\\n float h = u_resolution.y;\\n vg1.y = h - vg1.y;\\n vg2.y = h - vg2.y;\\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\\n#endif\\n \\n flagBackground = a_vertexPosition.z;\\n vColor = a_color;\\n\\n#ifdef TEXTURE\\n vTextureCoord = a_vertexTextureCoord;\\n vSourceRect = a_sourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\n vClipUV = a_clipUV;\\n#endif\\n}";},/* 65 */ /***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\\n\\nvarying vec4 vColor;\\nvarying float flagBackground;\\n\\n#ifdef TEXTURE\\nvarying vec3 vTextureCoord;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef FILTER\\nuniform int u_filterFlag;\\nuniform float u_colorMatrix[20];\\n#endif\\n\\n#ifdef GRADIENT\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\nuniform float u_colorSteps[40];\\nuniform int u_gradientType;\\n// uniform float u_radialGradientVector[6];\\n\\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\\n float t;\\n // center circle radius\\n float cr = gv1.z;\\n // focal circle radius\\n float fr = gv2.z;\\n\\n if(cr > 0.0 || fr > 0.0) {\\n // radial gradient\\n vec2 center = gv1.xy;\\n vec2 focal = gv2.xy;\\n float x = focal.x - gl_FragCoord.x;\\n float y = focal.y - gl_FragCoord.y;\\n float dx = focal.x - center.x;\\n float dy = focal.y - center.y;\\n float dr = cr - fr;\\n float a = dx * dx + dy * dy - dr * dr;\\n float b = -2.0 * (y * dy + x * dx + fr * dr);\\n float c = x * x + y * y - fr * fr;\\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\\n } else {\\n // linear gradient\\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\\n vec2 v2 = gv2.xy - gv1.xy;\\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\\n }\\n\\n vec4 colors[8];\\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\\n \\n float steps[8];\\n steps[0] = colorSteps[0];\\n steps[1] = colorSteps[5];\\n steps[2] = colorSteps[10];\\n steps[3] = colorSteps[15];\\n steps[4] = colorSteps[20];\\n steps[5] = colorSteps[25];\\n steps[6] = colorSteps[30];\\n steps[7] = colorSteps[35];\\n\\n color = colors[0];\\n for (int i = 1; i < 8; i++) {\\n if (steps[i] < 0.0 || steps[i] > 1.0) {\\n break;\\n }\\n if(steps[i] == steps[i - 1]) {\\n color = colors[i];\\n } else {\\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\\n }\\n if (steps[i] >= t) {\\n break;\\n }\\n }\\n}\\n#endif\\n\\n#ifdef FILTER\\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\\n float r = color.r, g = color.g, b = color.b, a = color.a;\\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\\n}\\n#endif\\n\\nvoid main() {\\n vec4 color = vColor;\\n float opacity = abs(flagBackground);\\n\\n#ifdef GRADIENT\\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\\n }\\n#endif\\n\\n if(opacity < 1.0) {\\n color.a *= opacity;\\n }\\n\\n#ifdef TEXTURE\\n if(flagBackground > 0.0) {\\n vec3 texCoord = vTextureCoord;\\n\\n if(texCoord.z == 1.0) {\\n texCoord = fract(texCoord);\\n }\\n\\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\\n if(vSourceRect.z > 0.0) {\\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\\n }\\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\\n float alpha = texColor.a;\\n if(opacity < 1.0) {\\n texColor.a *= opacity;\\n alpha *= mix(0.465, 1.0, opacity);\\n }\\n // color = mix(color, texColor, texColor.a);\\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\\n }\\n }\\n#endif\\n\\n#ifdef FILTER\\n if(u_filterFlag > 0) {\\n transformColor(color, u_colorMatrix);\\n }\\n#endif\\n\\n#ifdef CLIPPATH\\n float clip = texture2D(u_clipSampler, vClipUV).r;\\n color *= clip;\\n#endif\\n\\n gl_FragColor = color;\\n}";},/* 66 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\\nattribute vec4 a_color;\\nvarying vec4 vColor;\\nvarying float flagBackground;\\nattribute vec3 a_transform0;\\nattribute vec3 a_transform1;\\nuniform vec2 u_resolution;\\nuniform mat3 viewMatrix;\\nuniform mat3 projectionMatrix;\\n\\n#ifdef TEXTURE\\nattribute vec3 a_vertexTextureCoord;\\nvarying vec3 vTextureCoord;\\nattribute float a_frameIndex;\\nvarying float frameIndex;\\nattribute vec4 a_sourceRect;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nattribute vec2 a_clipUV;\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef CLOUDFILTER\\nattribute vec4 a_colorCloud0;\\nattribute vec4 a_colorCloud1;\\nattribute vec4 a_colorCloud2;\\nattribute vec4 a_colorCloud3;\\nattribute vec4 a_colorCloud4;\\nvarying vec4 colorCloud0;\\nvarying vec4 colorCloud1;\\nvarying vec4 colorCloud2;\\nvarying vec4 colorCloud3;\\nvarying vec4 colorCloud4;\\n#endif\\n\\n#ifdef CLOUDCOLOR\\nattribute vec4 a_fillCloudColor;\\nattribute vec4 a_strokeCloudColor;\\n#endif\\n\\n#ifdef GRADIENT\\nuniform float u_radialGradientVector[6];\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\n#endif\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n\\n mat3 modelMatrix = mat3(\\n a_transform0.x, a_transform1.x, 0, \\n a_transform0.y, a_transform1.y, 0,\\n a_transform0.z, a_transform1.z, 1\\n );\\n\\n vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(a_vertexPosition.xy, 1.0);\\n gl_Position = vec4(pos.xy, 1.0, 1.0);\\n\\n#ifdef GRADIENT\\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\\n float h = u_resolution.y;\\n vg1.y = h - vg1.y;\\n vg2.y = h - vg2.y;\\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\\n#endif\\n \\n flagBackground = a_vertexPosition.z;\\n\\n#ifdef CLOUDCOLOR\\n if(flagBackground > 0.0) {\\n vColor = mix(a_color, a_fillCloudColor, a_fillCloudColor.a);\\n } else {\\n vColor = mix(a_color, a_strokeCloudColor, a_strokeCloudColor.a);\\n }\\n#else\\n vColor = a_color;\\n#endif\\n\\n#ifdef TEXTURE\\n vTextureCoord = a_vertexTextureCoord;\\n frameIndex = a_frameIndex;\\n vSourceRect = a_sourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\n vClipUV = a_clipUV;\\n#endif\\n\\n#ifdef CLOUDFILTER\\n colorCloud0 = a_colorCloud0;\\n colorCloud1 = a_colorCloud1;\\n colorCloud2 = a_colorCloud2;\\n colorCloud3 = a_colorCloud3;\\n colorCloud4 = a_colorCloud4;\\n#endif\\n}";},/* 67 */ /***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\\n\\nvarying vec4 vColor;\\nvarying float flagBackground;\\n\\n#ifdef TEXTURE\\nvarying float frameIndex;\\nvarying vec3 vTextureCoord;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef FILTER\\nuniform int u_filterFlag;\\nuniform float u_colorMatrix[20];\\n#endif\\n\\n#ifdef CLOUDFILTER\\nvarying vec4 colorCloud0;\\nvarying vec4 colorCloud1;\\nvarying vec4 colorCloud2;\\nvarying vec4 colorCloud3;\\nvarying vec4 colorCloud4;\\n#endif\\n\\n#ifdef GRADIENT\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\nuniform float u_colorSteps[40];\\nuniform int u_gradientType;\\n\\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\\n float t;\\n // center circle radius\\n float cr = gv1.z;\\n // focal circle radius\\n float fr = gv2.z;\\n\\n if(cr > 0.0 || fr > 0.0) {\\n // radial gradient\\n vec2 center = gv1.xy;\\n vec2 focal = gv2.xy;\\n float x = focal.x - gl_FragCoord.x;\\n float y = focal.y - gl_FragCoord.y;\\n float dx = focal.x - center.x;\\n float dy = focal.y - center.y;\\n float dr = cr - fr;\\n float a = dx * dx + dy * dy - dr * dr;\\n float b = -2.0 * (y * dy + x * dx + fr * dr);\\n float c = x * x + y * y - fr * fr;\\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\\n } else {\\n // linear gradient\\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\\n vec2 v2 = gv2.xy - gv1.xy;\\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\\n }\\n\\n vec4 colors[8];\\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\\n \\n float steps[8];\\n steps[0] = colorSteps[0];\\n steps[1] = colorSteps[5];\\n steps[2] = colorSteps[10];\\n steps[3] = colorSteps[15];\\n steps[4] = colorSteps[20];\\n steps[5] = colorSteps[25];\\n steps[6] = colorSteps[30];\\n steps[7] = colorSteps[35];\\n\\n color = colors[0];\\n for (int i = 1; i < 8; i++) {\\n if (steps[i] < 0.0 || steps[i] > 1.0) {\\n break;\\n }\\n if(steps[i] == steps[i - 1]) {\\n color = colors[i];\\n } else {\\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\\n }\\n if (steps[i] >= t) {\\n break;\\n }\\n }\\n}\\n#endif\\n\\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\\n float r = color.r, g = color.g, b = color.b, a = color.a;\\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\\n}\\n\\n#ifdef CLOUDFILTER\\nvoid buildCloudColor(inout float colorCloudMatrix[20]) {\\n colorCloudMatrix[0] = colorCloud0[0];\\n colorCloudMatrix[1] = colorCloud1[0];\\n colorCloudMatrix[2] = colorCloud2[0];\\n colorCloudMatrix[3] = colorCloud3[0];\\n colorCloudMatrix[4] = colorCloud4[0];\\n\\n colorCloudMatrix[5] = colorCloud0[1];\\n colorCloudMatrix[6] = colorCloud1[1];\\n colorCloudMatrix[7] = colorCloud2[1];\\n colorCloudMatrix[8] = colorCloud3[1];\\n colorCloudMatrix[9] = colorCloud4[1];\\n\\n colorCloudMatrix[10] = colorCloud0[2];\\n colorCloudMatrix[11] = colorCloud1[2];\\n colorCloudMatrix[12] = colorCloud2[2];\\n colorCloudMatrix[13] = colorCloud3[2];\\n colorCloudMatrix[14] = colorCloud4[2];\\n\\n colorCloudMatrix[15] = colorCloud0[3];\\n colorCloudMatrix[16] = colorCloud1[3];\\n colorCloudMatrix[17] = colorCloud2[3];\\n colorCloudMatrix[18] = colorCloud3[3];\\n colorCloudMatrix[19] = colorCloud4[3];\\n}\\n#endif\\n\\nvoid main() {\\n vec4 color = vColor;\\n float opacity = abs(flagBackground);\\n\\n#ifdef GRADIENT\\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\\n }\\n#endif\\n\\n if(opacity < 1.0) {\\n color.a *= opacity;\\n }\\n\\n#ifdef TEXTURE\\n if(flagBackground > 0.0) {\\n vec3 texCoord = vTextureCoord;\\n\\n if(texCoord.z == 1.0) {\\n texCoord = fract(texCoord);\\n }\\n\\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\\n if(vSourceRect.z > 0.0) {\\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\\n }\\n if(frameIndex < 0.0) {\\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\\n color = mix(color, texColor, texColor.a);\\n } else {\\n int index = int(floor(clamp(0.0, 11.0, frameIndex)));\\n vec4 texColor;\\n if(index == 0) texColor = texture2D(u_texFrame0, texCoord.xy);\\n else if(index == 1) texColor = texture2D(u_texFrame1, texCoord.xy);\\n else if(index == 2) texColor = texture2D(u_texFrame2, texCoord.xy);\\n else if(index == 3) texColor = texture2D(u_texFrame3, texCoord.xy);\\n else if(index == 4) texColor = texture2D(u_texFrame4, texCoord.xy);\\n else if(index == 5) texColor = texture2D(u_texFrame5, texCoord.xy);\\n else if(index == 6) texColor = texture2D(u_texFrame6, texCoord.xy);\\n else if(index == 7) texColor = texture2D(u_texFrame7, texCoord.xy);\\n else if(index == 8) texColor = texture2D(u_texFrame8, texCoord.xy);\\n else if(index == 9) texColor = texture2D(u_texFrame9, texCoord.xy);\\n else if(index == 10) texColor = texture2D(u_texFrame10, texCoord.xy);\\n else texColor = texture2D(u_texFrame11, texCoord.xy);\\n float alpha = texColor.a;\\n if(opacity < 1.0) {\\n texColor.a *= opacity;\\n alpha *= mix(0.465, 1.0, opacity);\\n }\\n // color = mix(color, texColor, texColor.a);\\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\\n }\\n }\\n }\\n#endif\\n\\n#ifdef FILTER\\n if(u_filterFlag > 0) {\\n transformColor(color, u_colorMatrix);\\n }\\n#endif\\n\\n#ifdef CLOUDFILTER\\n float colorCloudMatrix[20];\\n buildCloudColor(colorCloudMatrix);\\n transformColor(color, colorCloudMatrix);\\n#endif\\n\\n#ifdef CLIPPATH\\n float clip = texture2D(u_clipSampler, vClipUV).r;\\n color *= clip;\\n#endif\\n\\n gl_FragColor = color;\\n}";},/* 68 */ /***/function(h,r,t){t.r(r),function(e,n){t.d(r,"requestAnimationFrame",function(){return a;}),t.d(r,"cancelAnimationFrame",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(e)<"u"&&e.hrtime){var _e$hrtime=e.hrtime(),_e$hrtime2=_slicedToArray(_e$hrtime,2),s=_e$hrtime2[0],f=_e$hrtime2[1];return s*1e3+f*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var a,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,o=n.cancelAnimationFrame):(a=function a(s){return setTimeout(function(){s(i());},16);},o=function o(s){return clearTimeout(s);});}.call(this,t(69),t(22));},/* 69 */ /***/function(h,r){var t=h.exports={},e,n;function i(){throw new Error("setTimeout has not been defined");}function a(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i;}catch(_unused9){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused10){n=a;}})();function o(T){if(e===setTimeout)return setTimeout(T,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(T,0);try{return e(T,0);}catch(_unused11){try{return e.call(null,T,0);}catch(_unused12){return e.call(this,T,0);}}}function s(T){if(n===clearTimeout)return clearTimeout(T);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{return n(T);}catch(_unused13){try{return n.call(null,T);}catch(_unused14){return n.call(this,T);}}}var f=[],p=!1,c,v=-1;function S(){!p||!c||(p=!1,c.length?f=c.concat(f):v=-1,f.length&&O());}function O(){if(!p){var T=o(S);p=!0;for(var l=f.length;l;){for(c=f,f=[];++v1)for(var d=1;d0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,R);this.attributes=new this.constructor.Attr(this),this[x]={width:300,height:150},Object.assign(this.attributes,E),this[m]=/* @__PURE__ */new Set(),this[T]={},this[l]={};}return _createClass(R,[{key:"ancestors",get:function get(){var E=this.parent;var L=[];for(;E;)L.push(E),E=E.parent;return L;}},{key:"animations",get:function get(){return this[m];}},{key:"filters",get:function get(){return this[d]||this.parent&&this.parent.filters;}},{key:"isVisible",get:function get(){return!1;}},{key:"layer",get:function get(){return this.parent?this.parent.layer:null;}},{key:"localMatrix",get:function get(){var E=this.transformMatrix,_this$attributes=this.attributes,L=_this$attributes.x,D=_this$attributes.y;return E[4]+=L,E[5]+=D,E;}},{key:"opacity",get:function get(){var E=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(E*=this.parent.opacity),E;}},{key:"parentNode",get:function get(){return this.parent;}},{key:"nextSibling",get:function get(){return this.getNodeNearBy(1);}},{key:"previousSibling",get:function get(){return this.getNodeNearBy(-1);}},{key:"program",get:function get(){return this[g];}/* get parent defined by connect method */},{key:"renderer",get:function get(){return this.parent?this.parent.renderer:null;}},{key:"renderMatrix",get:function get(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;var E=this.localMatrix;var L=this.parent;if(L){var D=L.__cacheRenderMatrix||L.renderMatrix;D&&(E=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,E));}return E;}},{key:"worldScaling",get:function get(){var E=this.renderMatrix;return[Math.hypot(E[0],E[1]),Math.hypot(E[2],E[3])];}},{key:"worldRotation",get:function get(){var E=this.renderMatrix;return Math.atan2(E[1],E[3]);}},{key:"worldPosition",get:function get(){var E=this.renderMatrix;return[E[4],E[5]];}},{key:"uniforms",get:function get(){return this[A];}/* get zOrder defined by connect method */ /* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(E){this.attributes.className=E;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(E){this.attributes.id=E;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(E){this.attributes.name=E;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(E){this.attributes.zIndex=E;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[M]||{};}},{key:"activateAnimations",value:function activateAnimations(){var E=this.layer;if(E){var L=this[m];L.forEach(function(I){I.baseTimeline=E.timeline,I.play(),I.finished.then(function(){L["delete"](I);});});var D=this.children;D&&D.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};E==="mousewheel"&&(E="wheel"),typeof D=="boolean"&&(D={capture:D});var _D8=D,I=_D8.capture,C=_D8.once,W=I?l:T;return this[W][E]=this[W][E]||[],this[W][E].push({listener:L,once:C}),this;}},{key:"animate",value:function animate(E,L){var _this10=this;var D=new i["default"](this,E,L);return this.effects&&D.applyEffects(this.effects),this.layer&&(D.baseTimeline=this.layer.timeline,D.play(),D.finished.then(function(){_this10[m]["delete"](D);})),this[m].add(D),D;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,E=new Array(_len7),_key7=0;_key7<_len7;_key7++){E[_key7]=arguments[_key7];}if(E.length===0)return this.attributes[O];if(E.length>1){var L=E[0],D=E[1];return typeof D=="function"&&(D=D(this.attr(L))),this.setAttribute(L,D),this;}return typeof E[0]=="string"?this.getAttribute(E[0]):(Object.assign(this.attributes,E[0]),this);}},{key:"cloneNode",value:function cloneNode(){var E=new this.constructor(),L=this.attributes[S];return E.attr(L),E;}},{key:"connect",value:function connect(E,L){Object.defineProperty(this,"parent",{value:E,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:L,writable:!1,configurable:!0}),E.timeline&&this.activateAnimations(),this.setResolution(E.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:E,zOrder:L}});}},{key:"contains",value:function contains(E){for(;E&&this!==E;)E=E.parent;return!!E;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[m].forEach(function(L){return L.cancel();});var E=this.children;E&&E.forEach(function(L){L.deactivateAnimations&&L.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var E=this.parent,L=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:E,zOrder:L}}),E&&E.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(E){var _this11=this;E instanceof o["default"]||(E=new o["default"](E)),E.target=this;var L=E.type;L==="mousewheel"&&(L="wheel");var D=[this];var I=this.parent;for(;E.bubbles&&I;)D.push(I),I=I.parent;for(var C=D.length-1;C>=0;C--){var W=D[C],G=W[l]&&W[l][L];if(G&&G.length&&(E.currentTarget=W,G.forEach(function(_ref97){var K=_ref97.listener,J=_ref97.once;K.call(_this11,E),J&&D.removeEventListener(K);}),delete E.currentTarget),!E.bubbles&&E.cancelBubble)break;}if(!E.cancelBubble)for(var _C4=0;_C40&&arguments[0]!==undefined?arguments[0]:[];var L=this.mesh;if(L){if(Object(s.applyFilters)(L,this.filters),E.push(L),this[g]){L.setProgram(this[g]);var D=this[M];D&&Object.entries(D).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),C=_ref100[0],W=_ref100[1];L.setAttribute(C,W);});var I=this[A];if(this[A]){var C={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],G=_ref102[1];typeof G=="function"&&(G=G(_this12,W)),C[W]=G;}),L.setUniforms(C);}}Object(f["default"])(this,L);}return E;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(E){return this.attributes[E];}},{key:"getListeners",value:function getListeners(E){var _ref103=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref103$capture=_ref103.capture,L=_ref103$capture===void 0?!1:_ref103$capture;return _toConsumableArray(this[L?l:T][E]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(E===0)return this;var L=this.parent.children,D=L.indexOf(this);return L[D+E];}},{key:"getWorldPosition",value:function getWorldPosition(E,L){var D=this.renderMatrix,I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getOffsetPosition",value:function getOffsetPosition(E,L){var D=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getResolution",value:function getResolution(){return c({},this[x]);}},{key:"isPointCollision",value:function isPointCollision(E,L){if(!this.mesh)return!1;var D=this.attributes.pointerEvents;if(D==="none"||D!=="all"&&!this.isVisible)return!1;var I="both";return D==="visibleFill"&&(I="fill"),D==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(E,L,I);}},{key:"onPropertyChange",value:function onPropertyChange(E,L,D){E!=="id"&&E!=="name"&&E!=="className"&&E!=="pointerEvents"&&E!=="passEvents"&&this.forceUpdate(),E==="filter"&&(this[d]=Object(s.parseFilterString)(L)),E==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(E,L){E==="attrs"&&this.attr(L),this.attributes[E]=L;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)\n},{key:"setProgram",value:function setProgram(E){this[g]=E,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(E,L){this[M]=this[M]||{},this[M][E]=L,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(E){this[A]=this[A]||{},Object.assign(this[A],E),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref104){var E=_ref104.width,L=_ref104.height;var _this$x3=this[x],D=_this$x3.width,I=_this$x3.height;(D!==E||I!==L)&&(this[x]={width:E,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:E,height:L}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[u]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[u]=this.attributes.display,this.attributes.display="none");}},{key:"releaseMouseCapture",value:function releaseMouseCapture(){this.layer&&this.layer.__mouseCapturedTarget===this&&(this.layer.__mouseCapturedTarget=null);}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"removeAllListeners",value:function removeAllListeners(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof L=="boolean"&&(L={capture:L});var I=L.capture?l:T;return this[I][E]&&(this[I][E]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(E){this.setAttribute(E,null);}},{key:"removeEventListener",value:function removeEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof D=="boolean"&&(D={capture:D});var C=D.capture?l:T;if(this[C][E]){var W=this[C][E];if(W)for(var G=0;G1&&arguments[1]!==undefined?arguments[1]:"linear";var D=this,I=Symbol("animation");L=L||"linear";var C=0;return _typeof(E)=="object"&&(C=E.delay||0,E=E.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var G=this[I];G&&G.cancel(W);}),"end",function end(){var W=this[I];W&&(W.playState==="running"||W.playState==="pending")&&W.finish();}),"reverse",function reverse(){var W=this[I];if(W)if(W.playState==="running"||W.playState==="pending")W.playbackRate=-W.playbackRate;else{var G=W.timing.direction;W.timing.direction=G==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,G){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,G)),Object.entries(W).forEach(function(_ref105){var _ref106=_slicedToArray(_ref105,2),K=_ref106[0],J=_ref106[1];typeof J=="function"&&(W[K]=J(D.attr(K)));}),this[I]=D.animate([W],{duration:E*1e3,delay:C*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();v(R,"Attr",n["default"]),a["default"].registerNode(R,"node");},/* 71 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),s=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_attributes"),c=Symbol["for"]("spritejs_changedAttrs"),v=Symbol("subject"),S=Symbol("attr"),O=Symbol("default"),x=Symbol("alias");function m(b,_ref108){var _ref109=_slicedToArray(_ref108,2),E=_ref109[0],L=_ref109[1];var D=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(b).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),I=_ref111[0],C=_ref111[1];if((E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,L])),I==="matrix")D=e.mat2d.multiply(D,D,C);else if(I==="offsetTranslate")D[4]+=C[0],D[5]+=C[1];else if(I==="offsetRotate")D=e.mat2d.rotate(Array.of(0,0,0,0,0,0),D,C);else if(I==="skew"){var _C5=_slicedToArray(C,2),W=_C5[0],G=_C5[1];D=e.mat2d.multiply(D,D,e.mat2d.fromValues(1,Math.tan(G),Math.tan(W),1,0,0));}else e.mat2d[I](D,D,C);(E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-E,-L]));}),D;}var T=Symbol("transformMatrix"),l=Symbol("transforms"),d=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function M(b,E,L){var D=b[S][E];if(b[s](E,L,!1)||b[u]!==E){var C=b[l];C.has(E)&&C["delete"](E),L&&(E==="rotate"&&(L=Math.PI*L/180),E==="scale"&&(L=L.map(function(W){return Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5;})),C.set(E,L)),b[T]=null,b[v].onPropertyChange(E,L,D,b);}}function A(b){var E=b[g],L=b.offsetDistance*E.getTotalLength(),D=E.getPointAtLength(L);if(D){var I=b[l];var C=b.offsetRotate;C==="auto"?C=D.angle:C==="reverse"?C=Math.PI+D.angle:C=Math.PI*C/180,I.set("offsetRotate",C),I.set("offsetTranslate",[D.x,D.y]),b[T]=null;}}var R=/*#__PURE__*/function(){function R(E){var _this13=this;_classCallCheck(this,R);this[v]=E,this[S]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[l]=/* @__PURE__ */new Map(),this[O]={},this[x]=[],Object.defineProperty(E,"transformMatrix",{get:function get(){return _this13[T]||(_this13[T]=m(_this13[l],_this13.transformOrigin)),_toConsumableArray(_this13[T]);}}),this[a]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",// none | visible | visibleFill | visibleStroke | all\nfilter:"none",display:""}),this[o]("class","pos"),this[d]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(R,[{key:c,get:function get(){var _this14=this;var E={};return _toConsumableArray(this[d]).forEach(function(L){E[L]=_this14[S][L];}),E;}},{key:p,get:function get(){var E=Object.assign({},this[S]);for(var L=0;L2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[S][E],C=this[v];return L==null&&(L=this[O][E]),Object(i.compareValue)(I,L)?!1:(this[S][E]=L,this[d].has(E)&&this[d]["delete"](E),this[d].add(E),this[u]=E,D&&C.onPropertyChange(E,L,I,this),!0);}},{key:f,value:function value(E){return this[S][E];}},{key:"id",set:function set(E){this[s]("id",E);}},{key:"id",get:function get(){return this[f]("id");}},{key:"name",set:function set(E){this[s]("name",E);}},{key:"name",get:function get(){return this[f]("name");}},{key:"className",set:function set(E){this[s]("className",E);}},{key:"className",get:function get(){return this[f]("className");}},{key:"class",set:function set(E){this.className=E;}},{key:"class",get:function get(){return this.className;}},{key:"x",get:function get(){return this[f]("x");}},{key:"x",set:function set(E){this[s]("x",Object(i.toNumber)(E));}},{key:"y",get:function get(){return this[f]("y");}},{key:"y",set:function set(E){this[s]("y",Object(i.toNumber)(E));}},{key:"pos",get:function get(){return[this.x,this.y];}},{key:"pos",set:function set(E){E=Object(i.toArray)(E),Array.isArray(E)||(E=[E,E]),this.x=E[0],this.y=E[1];}},{key:"transform",get:function get(){return this[f]("transform");}},{key:"transform",set:function set(E){var L=null;if(Array.isArray(E)&&(L=E,E="matrix(".concat(E.map(i.toNumber).join(),")")),typeof E=="string")E=E.replace(/\\s*,\\s*/g,",");else if(E!=null)throw new TypeError("Invalid transform value.");var D=this[S].transform;if(this[s]("transform",E,!1)){var I=this[l];if(I.has("matrix")&&I["delete"]("matrix"),L)I.set("matrix",L);else if(E){var C=E.match(/(matrix|translate|rotate|scale|skew)\\([^()]+\\)/g);if(C){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var G=0;G1?_len8-1:0),_key8=1;_key8<_len8;_key8++){L[_key8-1]=arguments[_key8];}return E[a].apply(E,L);}},{key:"declareAlias",value:function declareAlias(E){for(var _len9=arguments.length,L=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){L[_key9-1]=arguments[_key9];}return E[o].apply(E,L);}},{key:"setAttribute",value:function setAttribute(E){for(var _len10=arguments.length,L=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){L[_key10-1]=arguments[_key10];}return E[s].apply(E,L);}},{key:"getAttribute",value:function getAttribute(E){for(var _len11=arguments.length,L=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){L[_key11-1]=arguments[_key11];}return E[f].apply(E,L);}},{key:"getAttributes",value:function getAttributes(E){return E[p];}},{key:"getChangedAttributes",value:function getChangedAttributes(E){return E[c];}}]);}();},/* 72 */ /***/function(h,r,t){t.r(r),t.d(r,"sizeToPixel",function(){return e;}),t.d(r,"toString",function(){return n;}),t.d(r,"toNumber",function(){return i;}),t.d(r,"toArray",function(){return a;}),t.d(r,"compareValue",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function e(s,f){var p=s.trim().match(/^([\\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);p?s={size:parseFloat(p[1]),unit:p[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,c=_s3.size,v=_s3.unit;if(v==="pt")c/=0.75;else if(v==="pc")c*=16;else if(v==="in")c*=96;else if(v==="cm")c*=96/2.54;else if(v==="mm")c*=96/25.4;else if(v==="em"||v==="rem"||v==="ex"){if(!f&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var S=getComputedStyle(document.documentElement).fontSize;S?f=e(S,16):f=16;}c*=f,v==="ex"&&(c/=2);}else if(v==="q")c*=96/25.4/4;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S3=v==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;c*=_S3/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S4=window.innerWidth||document.documentElement.clientWidth,O=window.innerHeight||document.documentElement.clientHeight;v==="vmax"?c*=Math.max(_S4,O)/100:c*=Math.min(_S4,O)/100;}return c;}function n(s){return s==null?s:String(s);}function i(s){if(s==null)return s;if(typeof s=="string"&&(s=e(s)),!Number.isFinite(s))throw new TypeError("Invalid value");return s;}function a(s){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\\s,]+/g)),Array.isArray(s)&&(f&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,f){if(Array.isArray(s)&&Array.isArray(f)){if(s.length!==f.length)return!1;for(var p=0;pT-x?O:S;},e.Effects.fillColor=p,e.Effects.strokeColor=p,e.Effects.bgcolor=p,e.Effects.borderColor=p,e.Effects.text=c;var v=/*#__PURE__*/function(_e$Animator){function v(O,x,m){var _this15;_classCallCheck(this,v);var T=O.attr();Object.entries(T).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),l=_ref113[0],d=_ref113[1];T[l]=e.Effects[l]?d:f(d);}),x=x.map(function(l){var d=s({},l);var u={};return Object.entries(d).forEach(function(_ref114){var _ref115=_slicedToArray(_ref114,2),g=_ref115[0],M=_ref115[1];u[g]=e.Effects[g]?M:f(M);}),u;}),_this15=_callSuper(this,v,[T,x,m]),_this15.target=O,_this15.setter=function(l,d){d.attr(l);};return _this15;}_inherits(v,_e$Animator);return _createClass(v,[{key:"playState",get:function get(){return this.target.parent?_get(_getPrototypeOf(v.prototype),"playState",this):"idle";}},{key:"finished",get:function get(){var _this16=this;return _get(_getPrototypeOf(v.prototype),"finished",this).then(function(){var O=_this16;return new Promise(function(x){function m(){O.setter(O.frame,O.target);var T=O.playState;T==="finished"||T==="idle"?(Object(a.cancelAnimationFrame)(O.requestId),x()):Object(a.requestAnimationFrame)(m);}m();});});}},{key:"finish",value:function finish(){_get(_getPrototypeOf(v.prototype),"finish",this).call(this),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_get(_getPrototypeOf(v.prototype),"play",this).call(this),this.setter(this.frame,this.target);var O=this;this.ready.then(function(){O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(function x(){var m=O.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&m.layer&&m.layer.canvas&&!document.documentElement.contains(m.layer.canvas)){O.cancel();return;}var T=O.playState;O.setter(O.frame,O.target),T!=="idle"&&(T==="running"?O.requestId=Object(a.requestAnimationFrame)(x):(T==="paused"||T==="pending"&&O.timeline.currentTime<0)&&O.ready.then(function(){O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(x);}));});});}},{key:"cancel",value:function cancel(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),O?(this.setter(this.frame,this.target),_get(_getPrototypeOf(v.prototype),"cancel",this).call(this)):(_get(_getPrototypeOf(v.prototype),"cancel",this).call(this),this.setter(this.frame,this.target));}}]);}(e.Animator);},/* 74 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=p(e),i=t(187),a=p(i),o=t(188),s=t(190),f=p(s);function p(c){return c&&c.__esModule?c:{"default":c};}r.Animator=f["default"],r.Easings=o.Easings,r.Effects=a["default"],r.Timeline=n["default"];},/* 75 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=l(e),i=t(133),a=l(i),o=t(141),s=l(o),f=t(164),p=l(f),c=t(170),v=l(c),S=t(171),O=l(S),x=t(175),m=l(x),T=t(186);function l(D){return D&&D.__esModule?D:{"default":D};}var d=(0,T.createNowTime)(),u={originTime:0,playbackRate:1},g=(0,m["default"])("timeMark"),M=(0,m["default"])("playbackRate"),A=(0,m["default"])("timers"),R=(0,m["default"])("originTime"),b=(0,m["default"])("setTimer"),E=(0,m["default"])("parent"),L=function(){function D(I,C){(0,v["default"])(this,D),I instanceof D&&(C=I,I={}),I=(0,p["default"])({},u,I),C&&(this[E]=C);var W=I.nowtime||d;if(C)Object.defineProperty(this,"globalTime",{get:function get(){return C.currentTime;}});else{var G=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-G;}});}this[g]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[E]&&(this[g][0].globalEntropy=this[E].entropy),this[R]=I.originTime,this[M]=I.playbackRate,this[A]=new s["default"]();}return(0,O["default"])(D,[{key:"markTime",value:function value(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=C.time,G=W===void 0?this.currentTime:W,K=C.entropy,J=K===void 0?this.entropy:K,Z=C.playbackRate,B=Z===void 0?this.playbackRate:Z,$={globalTime:this.globalTime,localTime:G,entropy:J,playbackRate:B,globalEntropy:this.globalEntropy};this[g].push($);}},{key:"fork",value:function value(C){return new D(C,this);}},{key:"seekGlobalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.entropy,J=G.playbackRate,Z=G.globalTime;return Z+(C-K)/Math.abs(J);}},{key:"seekLocalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.localTime,J=G.entropy,Z=G.playbackRate;return Z>0?K+(C-J):K-(C-J);}},{key:"seekTimeMark",value:function value(C){var W=this[g],G=0,K=W.length-1;if(C<=W[G].entropy)return G;if(C>=W[K].entropy)return K;for(var J=Math.floor((G+K)/2);J>G&&JW[J].entropy&&(G=J),J=Math.floor((G+K)/2);}return G;}},{key:"updateTimers",value:function value(){var C=this,W=[].concat((0,a["default"])(this[A]));W.forEach(function(G){var K=(0,n["default"])(G,2),J=K[0],Z=K[1];C[b](Z.handler,Z.time,J);});}},{key:"clearTimeout",value:function(I){function C(W){return I.apply(this,arguments);}return C.toString=function(){return I.toString();},C;}(function(I){var C=this[A].get(I);C&&C.timerID!=null&&(this[E]?this[E].clearTimeout(C.timerID):clearTimeout(C.timerID)),this[A]["delete"](I);})},{key:"clearInterval",value:function value(C){return this.clearTimeout(C);}},{key:"clear",value:function value(){var C=this,W=this[A];[].concat((0,a["default"])(W.keys())).forEach(function(G){C.clearTimeout(G);});}/*\n setTimeout(func, {delay: 100, isEntropy: true})\n setTimeout(func, {entropy: 100})\n setTimeout(func, 100})\n */},{key:"setTimeout",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](C,W);}},{key:"setInterval",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},G=this,K=this[b](function J(){G[b](J,W,K),C();},W);return K;}},{key:b,value:function value(C,W){var G=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,m["default"])("timerID");W=(0,T.formatDelay)(W);var J=this[A].get(K),Z=void 0,B=null,$=void 0,Q=void 0;J?(this.clearTimeout(K),W.isEntropy?Z=(W.delay-(this.entropy-J.startEntropy))/Math.abs(this.playbackRate):Z=(W.delay-(this.currentTime-J.startTime))/this.playbackRate,$=J.startTime,Q=J.startEntropy):(Z=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),$=this.currentTime,Q=this.entropy);var et=this[E],tt=et?et.setTimeout.bind(et):setTimeout,ot=W.heading;return!et&&ot===!1&&Z<0&&(Z=1/0),(isFinite(Z)||et)&&(Z=Math.ceil(Z),tt!==setTimeout&&(Z={delay:Z,heading:ot}),B=tt(function(){G[A]["delete"](K),C();},Z)),this[A].set(K,{timerID:B,handler:C,time:W,startTime:$,startEntropy:Q}),K;}},{key:"parent",get:function get(){return this[E];}},{key:"lastTimeMark",get:function get(){return this[g][this[g].length-1];}},{key:"currentTime",get:function get(){var C=this.lastTimeMark,W=C.localTime,G=C.globalTime;return W+(this.globalTime-G)*this.playbackRate;},set:function set(C){var W=this,G=this.currentTime,K=C,J=this[A];this.markTime({time:C}),[].concat((0,a["default"])(J)).forEach(function(Z){var B=(0,n["default"])(Z,2),$=B[0],Q=B[1];if(J.has($)){var et=Q.time,tt=et.isEntropy,ot=et.delay,q=et.heading,gt=Q.handler,dt=Q.startTime;if(tt)ot===0&&(gt(),W.clearTimeout($));else{var F=dt+ot;(ot===0||q!==!1&&(K-G)*ot<=0||G<=F&&F<=K||G>=F&&F>=K)&&(gt(),W.clearTimeout($));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.\n// If current playbackRate is negative, the currentTime should go backwards\n// while the entropy remain to go forwards.\n// Both of the initial values is set to -originTime\n},{key:"entropy",get:function get(){var C=this.lastTimeMark,W=C.entropy,G=C.globalEntropy;return W+Math.abs((this.globalEntropy-G)*this.playbackRate);},// get globalTime() {\n// if(this[_parent]) {\n// return this[_parent].currentTime;\n// }\n// return nowtime();\n// }\n// change entropy will NOT cause currentTime changing but may influence the pass\n// and the future of the timeline. (It may change the result of seek***Time)\n// While entropy is set, all the marks behind will be droped\nset:function set(C){if(this.entropy>C){var W=this.seekTimeMark(C);this[g].length=W+1;}this.markTime({entropy:C}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[E]?this[E].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[M];},set:function set(C){C!==this.playbackRate&&(this.markTime({playbackRate:C}),this[M]=C,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var C=this.parent;C;){if(C.playbackRate===0)return!0;C=C.parent;}return!1;}}]),D;}();r["default"]=L;},/* 76 */ /***/function(h,r,t){r.__esModule=!0;var e=t(77),n=o(e),i=t(129),a=o(i);function o(s){return s&&s.__esModule?s:{"default":s};}r["default"]=/* @__PURE__ */function(){function s(f,p){var c=[],v=!0,S=!1,O=void 0;try{for(var x=(0,a["default"])(f),m;!(v=(m=x.next()).done)&&(c.push(m.value),!(p&&c.length===p));v=!0);}catch(T){S=!0,O=T;}finally{try{!v&&x["return"]&&x["return"]();}finally{if(S)throw O;}}return c;}return function(f,p){if(Array.isArray(f))return f;if((0,n["default"])(Object(f)))return s(f,p);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 */ /***/function(h,r,t){h.exports={"default":t(78),__esModule:!0};},/* 78 */ /***/function(h,r,t){t(79),t(125),h.exports=t(127);},/* 79 */ /***/function(h,r,t){t(80);for(var e=t(91),n=t(95),i=t(83),a=t(122)("toStringTag"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,f):s=="values"?n(0,o[f]):n(0,[f,o[f]]);},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries");},/* 81 */ /***/function(h,r){h.exports=function(){};},/* 82 */ /***/function(h,r){h.exports=function(t,e){return{value:e,done:!!t};};},/* 83 */ /***/function(h,r){h.exports={};},/* 84 */ /***/function(h,r,t){var e=t(85),n=t(87);h.exports=function(i){return e(n(i));};},/* 85 */ /***/function(h,r,t){var e=t(86);h.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n);};},/* 86 */ /***/function(h,r){var t={}.toString;h.exports=function(e){return t.call(e).slice(8,-1);};},/* 87 */ /***/function(h,r){h.exports=function(t){if(t==null)throw TypeError("Can\'t call method on "+t);return t;};},/* 88 */ /***/function(h,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),o=t(83),s=t(107),f=t(121),p=t(123),c=t(122)("iterator"),v=!([].keys&&"next"in[].keys()),S="@@iterator",O="keys",x="values",m=function m(){return this;};h.exports=function(T,l,d,u,g,M,A){s(d,l,u);var R=function R(B){if(!v&&B in D)return D[B];switch(B){case O:return function(){return new d(this,B);};case x:return function(){return new d(this,B);};}return function(){return new d(this,B);};},b=l+" Iterator",E=g==x,L=!1,D=T.prototype,I=D[c]||D[S]||g&&D[g],C=I||R(g),W=g?E?R("entries"):C:void 0,G=l=="Array"&&D.entries||I,K,J,Z;if(G&&(Z=p(G.call(new T())),Z!==Object.prototype&&Z.next&&(f(Z,b,!0),!e&&typeof Z[c]!="function"&&a(Z,c,m))),E&&I&&I.name!==x&&(L=!0,C=function C(){return I.call(this);}),(!e||A)&&(v||L||!D[c])&&a(D,c,C),o[l]=C,o[b]=m,g)if(K={values:E?C:R(x),keys:M?C:R(O),entries:W},A)for(J in K)J in D||i(D,J,K[J]);else n(n.P+n.F*(v||L),l,K);return K;};},/* 89 */ /***/function(h,r){h.exports=!0;},/* 90 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),o=t(105),s="prototype",f=function f(p,c,v){var S=p&f.F,O=p&f.G,x=p&f.S,m=p&f.P,T=p&f.B,l=p&f.W,d=O?n:n[c]||(n[c]={}),u=d[s],g=O?e:x?e[c]:(e[c]||{})[s],M,A,R;O&&(v=c);for(M in v)A=!S&&g&&g[M]!==void 0,!(A&&o(d,M))&&(R=A?g[M]:v[M],d[M]=O&&typeof g[M]!="function"?v[M]:T&&A?i(R,e):l&&g[M]==R?function(b){var E=function E(L,D,I){if(this instanceof b){switch(arguments.length){case 0:return new b();case 1:return new b(L);case 2:return new b(L,D);}return new b(L,D,I);}return b.apply(this,arguments);};return E[s]=b[s],E;}(R):m&&typeof R=="function"?i(Function.call,R):R,m&&((d.virtual||(d.virtual={}))[M]=R,p&f.R&&u&&!u[M]&&a(u,M,R)));};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,h.exports=f;},/* 91 */ /***/function(h,r){var t=h.exports=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window.Math==Math?window:(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t);},/* 92 */ /***/function(h,r){var t=h.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 */ /***/function(h,r,t){var e=t(94);h.exports=function(n,i,a){if(e(n),i===void 0)return n;switch(a){case 1:return function(o){return n.call(i,o);};case 2:return function(o,s){return n.call(i,o,s);};case 3:return function(o,s,f){return n.call(i,o,s,f);};}return function(){return n.apply(i,arguments);};};},/* 94 */ /***/function(h,r){h.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=t(100)?function(i,a,o){return e.f(i,a,n(1,o));}:function(i,a,o){return i[a]=o,i;};},/* 96 */ /***/function(h,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(s,f,p){if(e(s),f=i(f,!0),e(p),n)try{return a(s,f,p);}catch(_unused15){}if("get"in p||"set"in p)throw TypeError("Accessors not supported!");return"value"in p&&(s[f]=p.value),s;};},/* 97 */ /***/function(h,r,t){var e=t(98);h.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n;};},/* 98 */ /***/function(h,r){h.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 */ /***/function(h,r,t){h.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 */ /***/function(h,r,t){h.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 */ /***/function(h,r){h.exports=function(t){try{return!!t();}catch(_unused16){return!0;}};},/* 102 */ /***/function(h,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);h.exports=function(a){return i?n.createElement(a):{};};},/* 103 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n))return n;var a,o;if(i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(o=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n)))return o;throw TypeError("Can\'t convert object to primitive value");};},/* 104 */ /***/function(h,r){h.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e};};},/* 105 */ /***/function(h,r){var t={}.hasOwnProperty;h.exports=function(e,n){return t.call(e,n);};},/* 106 */ /***/function(h,r,t){h.exports=t(95);},/* 107 */ /***/function(h,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this;}),h.exports=function(o,s,f){o.prototype=e(a,{next:n(1,f)}),i(o,s+" Iterator");};},/* 108 */ /***/function(h,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),o=function o(){},s="prototype",_f2=function f(){var p=t(102)("iframe"),c=i.length,v="<",S=">",O;for(p.style.display="none",t(120).appendChild(p),p.src="javascript:",O=p.contentWindow.document,O.open(),O.write(v+"script"+S+"document.F=Object"+v+"/script"+S),O.close(),_f2=O.F;c--;)delete _f2[s][i[c]];return _f2();};h.exports=Object.create||function(c,v){var S;return c!==null?(o[s]=e(c),S=new o(),o[s]=null,S[a]=c):S=_f2(),v===void 0?S:n(S,v);};},/* 109 */ /***/function(h,r,t){var e=t(96),n=t(97),i=t(110);h.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var f=i(s),p=f.length,c=0,v;p>c;)e.f(o,v=f[c++],s[v]);return o;};},/* 110 */ /***/function(h,r,t){var e=t(111),n=t(119);h.exports=Object.keys||function(a){return e(a,n);};},/* 111 */ /***/function(h,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");h.exports=function(o,s){var f=n(o),p=0,c=[],v;for(v in f)v!=a&&e(f,v)&&c.push(v);for(;s.length>p;)e(f,v=s[p++])&&(~i(c,v)||c.push(v));return c;};},/* 112 */ /***/function(h,r,t){var e=t(84),n=t(113),i=t(115);h.exports=function(a){return function(o,s,f){var p=e(o),c=n(p.length),v=i(f,c),S;if(a&&s!=s){for(;c>v;)if(S=p[v++],S!=S)return!0;}else for(;c>v;v++)if((a||v in p)&&p[v]===s)return a||v||0;return!a&&-1;};};},/* 113 */ /***/function(h,r,t){var e=t(114),n=Math.min;h.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 */ /***/function(h,r){var t=Math.ceil,e=Math.floor;h.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 */ /***/function(h,r,t){var e=t(114),n=Math.max,i=Math.min;h.exports=function(a,o){return a=e(a),a<0?n(a+o,0):i(a,o);};},/* 116 */ /***/function(h,r,t){var e=t(117)("keys"),n=t(118);h.exports=function(i){return e[i]||(e[i]=n(i));};},/* 117 */ /***/function(h,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(h.exports=function(o,s){return a[o]||(a[o]=s!==void 0?s:{});})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 */ /***/function(h,r){var t=0,e=Math.random();h.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36));};},/* 119 */ /***/function(h,r){h.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 */ /***/function(h,r,t){var e=t(91).document;h.exports=e&&e.documentElement;},/* 121 */ /***/function(h,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");h.exports=function(a,o,s){a&&!n(a=s?a:a.prototype,i)&&e(a,i,{configurable:!0,value:o});};},/* 122 */ /***/function(h,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",o=h.exports=function(s){return e[s]||(e[s]=a&&i[s]||(a?i:n)("Symbol."+s));};o.store=e;},/* 123 */ /***/function(h,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;h.exports=Object.getPrototypeOf||function(o){return o=n(o),e(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?a:null;};},/* 124 */ /***/function(h,r,t){var e=t(87);h.exports=function(n){return Object(e(n));};},/* 125 */ /***/function(h,r,t){var e=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,i=this._i,a;return i>=n.length?{value:void 0,done:!0}:(a=e(n,i),this._i+=a.length,{value:a,done:!1});});},/* 126 */ /***/function(h,r,t){var e=t(114),n=t(87);h.exports=function(i){return function(a,o){var s=String(n(a)),f=e(o),p=s.length,c,v;return f<0||f>=p?i?"":void 0:(c=s.charCodeAt(f),c<55296||c>56319||f+1===p||(v=s.charCodeAt(f+1))<56320||v>57343?i?s.charAt(f):c:i?s.slice(f,f+2):(c-55296<<10)+(v-56320)+65536);};};},/* 127 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).isIterable=function(a){var o=Object(a);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(e(o));};},/* 128 */ /***/function(h,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(/* @__PURE__ */function(){return arguments;}())=="Arguments",a=function a(o,s){try{return o[s];}catch(_unused17){}};h.exports=function(o){var s,f,p;return o===void 0?"Undefined":o===null?"Null":typeof(f=a(s=Object(o),n))=="string"?f:i?e(s):(p=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":p;};},/* 129 */ /***/function(h,r,t){h.exports={"default":t(130),__esModule:!0};},/* 130 */ /***/function(h,r,t){t(79),t(125),h.exports=t(131);},/* 131 */ /***/function(h,r,t){var e=t(97),n=t(132);h.exports=t(92).getIterator=function(i){var a=n(i);if(typeof a!="function")throw TypeError(i+" is not iterable!");return e(a.call(i));};},/* 132 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)];};},/* 133 */ /***/function(h,r,t){r.__esModule=!0;var e=t(134),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=function(a){if(Array.isArray(a)){for(var o=0,s=Array(a.length);o1?arguments[1]:void 0,T=m!==void 0,l=0,d=p(S),u,g,M,A;if(T&&(m=e(m,x>2?arguments[2]:void 0,2)),d!=null&&!(O==Array&&o(d)))for(A=d.call(S),g=new O();!(M=A.next()).done;l++)f(g,l,T?a(A,m,[M.value,l],!0):M.value);else for(u=s(S.length),g=new O(u);u>l;l++)f(g,l,T?m(S[l],l):S[l]);return g.length=l,g;}});},/* 137 */ /***/function(h,r,t){var e=t(97);h.exports=function(n,i,a,o){try{return o?i(e(a)[0],a[1]):i(a);}catch(f){var s=n["return"];throw s!==void 0&&e(s.call(n)),f;}};},/* 138 */ /***/function(h,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;h.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a);};},/* 139 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=function(i,a,o){a in i?e.f(i,a,n(0,o)):i[a]=o;};},/* 140 */ /***/function(h,r,t){var e=t(122)("iterator"),n=!1;try{var i=[7][e]();i["return"]=function(){n=!0;},Array.from(i,function(){throw 2;});}catch(_unused18){}h.exports=function(a,o){if(!o&&!n)return!1;var s=!1;try{var f=[7],p=f[e]();p.next=function(){return{done:s=!0};},f[e]=function(){return p;},a(f);}catch(_unused19){}return s;};},/* 141 */ /***/function(h,r,t){h.exports={"default":t(142),__esModule:!0};},/* 142 */ /***/function(h,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),h.exports=t(92).Map;},/* 143 */ /***/function(h,r){},/* 144 */ /***/function(h,r,t){var e=t(145),n=t(151),i="Map";h.exports=t(152)(i,function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)\nget:function get(o){var s=e.getEntry(n(this,i),o);return s&&s.v;},// 23.1.3.9 Map.prototype.set(key, value)\nset:function set(o,s){return e.def(n(this,i),o===0?0:o,s);}},e,!0);},/* 145 */ /***/function(h,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),o=t(147),s=t(148),f=t(88),p=t(82),c=t(149),v=t(100),S=t(150).fastKey,O=t(151),x=v?"_s":"size",m=function m(T,l){var d=S(l),u;if(d!=="F")return T._i[d];for(u=T._f;u;u=u.n)if(u.k==l)return u;};h.exports={getConstructor:function getConstructor(T,l,d,u){var g=T(function(M,A){o(M,g,l,"_i"),M._t=l,M._i=n(null),M._f=void 0,M._l=void 0,M[x]=0,A!=null&&s(A,d,M[u],M);});return i(g.prototype,{// 23.1.3.1 Map.prototype.clear()\n// 23.2.3.2 Set.prototype.clear()\nclear:function clear(){for(var A=O(this,l),R=A._i,b=A._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete R[b.i];A._f=A._l=void 0,A[x]=0;},// 23.1.3.3 Map.prototype.delete(key)\n// 23.2.3.4 Set.prototype.delete(value)\n"delete":function _delete(M){var A=O(this,l),R=m(A,M);if(R){var b=R.n,E=R.p;delete A._i[R.i],R.r=!0,E&&(E.n=b),b&&(b.p=E),A._f==R&&(A._f=b),A._l==R&&(A._l=E),A[x]--;}return!!R;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\nforEach:function forEach(A){O(this,l);for(var R=a(A,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(R(b.v,b.k,this);b&&b.r;)b=b.p;},// 23.1.3.7 Map.prototype.has(key)\n// 23.2.3.7 Set.prototype.has(value)\nhas:function has(A){return!!m(O(this,l),A);}}),v&&e(g.prototype,"size",{get:function get(){return O(this,l)[x];}}),g;},def:function def(T,l,d){var u=m(T,l),g,M;return u?u.v=d:(T._l=u={i:M=S(l,!0),// <- index\nk:l,// <- key\nv:d,// <- value\np:g=T._l,// <- previous entry\nn:void 0,// <- next entry\nr:!1// <- removed\n},T._f||(T._f=u),g&&(g.n=u),T[x]++,M!=="F"&&(T._i[M]=u)),T;},getEntry:m,setStrong:function setStrong(T,l,d){f(T,l,function(u,g){this._t=O(u,l),this._k=g,this._l=void 0;},function(){for(var u=this,g=u._k,M=u._l;M&&M.r;)M=M.p;return!u._t||!(u._l=M=M?M.n:u._t._f)?(u._t=void 0,p(1)):g=="keys"?p(0,M.k):g=="values"?p(0,M.v):p(0,[M.k,M.v]);},d?"entries":"values",!d,!0),c(l);}};},/* 146 */ /***/function(h,r,t){var e=t(95);h.exports=function(n,i,a){for(var o in i)a&&n[o]?n[o]=i[o]:e(n,o,i[o]);return n;};},/* 147 */ /***/function(h,r){h.exports=function(t,e,n,i){if(!(t instanceof e)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 */ /***/function(h,c,t){var e=t(93),n=t(137),i=t(138),a=t(97),o=t(113),s=t(132),f={},p={},c=h.exports=function(v,S,O,x,m){var T=m?function(){return v;}:s(v),l=e(O,x,S?2:1),d=0,u,g,M,A;if(typeof T!="function")throw TypeError(v+" is not iterable!");if(i(T)){for(u=o(v.length);u>d;d++)if(A=S?l(a(g=v[d])[0],g[1]):l(v[d]),A===f||A===p)return A;}else for(M=T.call(v);!(g=M.next()).done;)if(A=n(M,l,g.value,S),A===f||A===p)return A;};c.BREAK=f,c.RETURN=p;},/* 149 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),o=t(122)("species");h.exports=function(s){var f=typeof n[s]=="function"?n[s]:e[s];a&&f&&!f[o]&&i.f(f,o,{configurable:!0,get:function get(){return this;}});};},/* 150 */ /***/function(h,r,t){var e=t(118)("meta"),n=t(98),i=t(105),a=t(96).f,o=0,s=Object.isExtensible||function(){return!0;},f=!t(101)(function(){return s(Object.preventExtensions({}));}),p=function p(x){a(x,e,{value:{i:"O"+ ++o,// object ID\nw:{}// weak collections IDs\n}});},c=function c(x,m){if(!n(x))return _typeof(x)=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!i(x,e)){if(!s(x))return"F";if(!m)return"E";p(x);}return x[e].i;},v=function v(x,m){if(!i(x,e)){if(!s(x))return!0;if(!m)return!1;p(x);}return x[e].w;},S=function S(x){return f&&O.NEED&&s(x)&&!i(x,e)&&p(x),x;},O=h.exports={KEY:e,NEED:!1,fastKey:c,getWeak:v,onFreeze:S};},/* 151 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 */ /***/function(h,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),o=t(95),s=t(146),f=t(148),p=t(147),c=t(98),v=t(121),S=t(96).f,O=t(153)(0),x=t(100);h.exports=function(m,T,l,d,u,g){var M=e[m],A=M,R=u?"set":"add",b=A&&A.prototype,E={};return!x||typeof A!="function"||!(g||b.forEach&&!a(function(){new A().entries().next();}))?(A=d.getConstructor(T,m,u,R),s(A.prototype,l),i.NEED=!0):(A=T(function(L,D){p(L,A,m,"_c"),L._c=new M(),D!=null&&f(D,u,L[R],L);}),O("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var D=L=="add"||L=="set";L in b&&!(g&&L=="clear")&&o(A.prototype,L,function(I,C){if(p(this,A,L),!D&&g&&!c(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,C);return D?this:W;});}),g||S(A.prototype,"size",{get:function get(){return this._c.size;}})),v(A,m),E[m]=A,n(n.G+n.W+n.F,E),g||d.setStrong(A,m,u),A;};},/* 153 */ /***/function(h,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),o=t(154);h.exports=function(s,f){var p=s==1,c=s==2,v=s==3,S=s==4,O=s==6,x=s==5||O,m=f||o;return function(T,l,d){for(var u=i(T),g=n(u),M=e(l,d,3),A=a(g.length),R=0,b=p?m(T,A):c?m(T,0):void 0,E,L;A>R;R++)if((x||R in g)&&(E=g[R],L=M(E,R,u),s)){if(p)b[R]=L;else if(L)switch(s){case 3:return!0;case 5:return E;case 6:return R;case 2:b.push(E);}else if(S)return!1;}return O?-1:v||S?S:b;};};},/* 154 */ /***/function(h,r,t){var e=t(155);h.exports=function(n,i){return new(e(n))(i);};},/* 155 */ /***/function(h,r,t){var e=t(98),n=t(156),i=t(122)("species");h.exports=function(a){var o;return n(a)&&(o=a.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),e(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 */ /***/function(h,r,t){var e=t(86);h.exports=Array.isArray||function(i){return e(i)=="Array";};},/* 157 */ /***/function(h,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")});},/* 158 */ /***/function(h,r,t){var e=t(128),n=t(159);h.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn\'t generic");return n(this);};};},/* 159 */ /***/function(h,r,t){var e=t(148);h.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a;};},/* 160 */ /***/function(h,r,t){t(161)("Map");},/* 161 */ /***/function(h,r,t){var e=t(90);h.exports=function(n){e(e.S,n,{of:function of(){for(var a=arguments.length,o=new Array(a);a--;)o[a]=arguments[a];return new this(o);}});};},/* 162 */ /***/function(h,r,t){t(163)("Map");},/* 163 */ /***/function(h,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);h.exports=function(o){e(e.S,o,{from:function from(f){var p=arguments[1],c,v,S,O;return n(this),c=p!==void 0,c&&n(p),f==null?new this():(v=[],c?(S=0,O=i(p,arguments[2],2),a(f,!1,function(x){v.push(O(x,S++));})):a(f,!1,v.push,v),new this(v));}});};},/* 164 */ /***/function(h,r,t){h.exports={"default":t(165),__esModule:!0};},/* 165 */ /***/function(h,r,t){t(166),h.exports=t(92).Object.assign;},/* 166 */ /***/function(h,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),o=t(124),s=t(85),f=Object.assign;h.exports=!f||t(101)(function(){var p={},c={},v=Symbol(),S="abcdefghijklmnopqrst";return p[v]=7,S.split("").forEach(function(O){c[O]=O;}),f({},p)[v]!=7||Object.keys(f({},c)).join("")!=S;})?function(c,v){for(var S=o(c),O=arguments.length,x=1,m=i.f,T=a.f;O>x;)for(var l=s(arguments[x++]),d=m?n(l).concat(m(l)):n(l),u=d.length,g=0,M;u>g;)M=d[g++],(!e||T.call(l,M))&&(S[M]=l[M]);return S;}:f;},/* 168 */ /***/function(h,r){r.f=Object.getOwnPropertySymbols;},/* 169 */ /***/function(h,r){r.f={}.propertyIsEnumerable;},/* 170 */ /***/function(h,r,t){r.__esModule=!0,r["default"]=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 */ /***/function(h,r,t){r.__esModule=!0;var e=t(172),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=/* @__PURE__ */function(){function a(o,s){for(var f=0;fmt;)z(st,St=vt[mt++],ft[St]);return st;},P=function P(st,ft){return ft===void 0?R(st):y(R(st),ft);},w=function w(st){var ft=et.call(this,st=M(st,!0));return this===gt&&n(ot,st)&&!n(q,st)?!1:ft||!n(this,st)||!n(ot,st)||n(this,$)&&this[$][st]?ft:!0;},U=function U(st,ft){if(st=g(st),ft=M(ft,!0),!(st===gt&&n(ot,ft)&&!n(q,ft))){var vt=C(st,ft);return vt&&n(ot,ft)&&!(n(st,$)&&st[$][ft])&&(vt.enumerable=!0),vt;}},H=function H(st){for(var ft=G(g(st)),vt=[],mt=0,pt;ft.length>mt;)!n(ot,pt=ft[mt++])&&pt!=$&&pt!=s&&vt.push(pt);return vt;},Y=function Y(st){for(var ft=st===gt,vt=G(ft?q:g(st)),mt=[],pt=0,St;vt.length>pt;)n(ot,St=vt[pt++])&&(!ft||n(gt,St))&&mt.push(ot[St]);return mt;};dt||(_K2=function K(){if(this instanceof _K2)throw TypeError("Symbol is not a constructor!");var st=v(arguments.length>0?arguments[0]:void 0),ft=function ft(vt){this===gt&&ft.call(q,vt),n(this,$)&&n(this[$],st)&&(this[$][st]=!1),V(this,st,A(1,vt));};return i&&j&&V(gt,st,{configurable:!0,set:ft}),X(st);},o(_K2[B],"toString",function(){return this._k;}),E.f=U,D.f=z,t(182).f=b.f=H,t(169).f=w,L.f=Y,i&&!t(89)&&o(gt,"propertyIsEnumerable",w,!0),O.f=function(at){return X(S(at));}),a(a.G+a.W+a.F*!dt,{Symbol:_K2});for(var k=// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;k.length>rt;)S(k[rt++]);for(var it=I(S.store),lt=0;it.length>lt;)x(it[lt++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)\n"for":function _for(at){return n(tt,at+="")?tt[at]:tt[at]=_K2(at);},// 19.4.2.5 Symbol.keyFor(sym)\nkeyFor:function keyFor(st){if(!N(st))throw TypeError(st+" is not a symbol!");for(var ft in tt)if(tt[ft]===st)return ft;},useSetter:function useSetter(){j=!0;},useSimple:function useSimple(){j=!1;}}),a(a.S+a.F*!dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])\ncreate:P,// 19.1.2.4 Object.defineProperty(O, P, Attributes)\ndefineProperty:z,// 19.1.2.3 Object.defineProperties(O, Properties)\ndefineProperties:y,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\ngetOwnPropertyDescriptor:U,// 19.1.2.7 Object.getOwnPropertyNames(O)\ngetOwnPropertyNames:H,// 19.1.2.8 Object.getOwnPropertySymbols(O)\ngetOwnPropertySymbols:Y});var ut=f(function(){L.f(1);});a(a.S+a.F*ut,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(st){return L.f(u(st));}}),J&&a(a.S+a.F*(!dt||f(function(){var at=_K2();return Z([at])!="[null]"||Z({a:at})!="{}"||Z(Object(at))!="{}";})),"JSON",{stringify:function stringify(st){for(var ft=[st],vt=1,mt,pt;arguments.length>vt;)ft.push(arguments[vt++]);if(pt=mt=ft[1],!(!d(mt)&&st===void 0||N(st)))return T(mt)||(mt=function mt(St,It){if(typeof pt=="function"&&(It=pt.call(this,St,It)),!N(It))return It;}),ft[1]=mt,Z.apply(J,ft);}}),_K2[B][Q]||t(95)(_K2[B],Q,_K2[B].valueOf),c(_K2,"Symbol"),c(Math,"Math",!0),c(e.JSON,"JSON",!0);},/* 178 */ /***/function(h,r,t){r.f=t(122);},/* 179 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),o=t(96).f;h.exports=function(s){var f=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in f)&&o(f,s,{value:a.f(s)});};},/* 180 */ /***/function(h,r,t){var e=t(110),n=t(168),i=t(169);h.exports=function(a){var o=e(a),s=n.f;if(s)for(var f=s(a),p=i.f,c=0,v;f.length>c;)p.call(a,v=f[c++])&&o.push(v);return o;};},/* 181 */ /***/function(h,r,t){var e=t(84),n=t(182).f,i={}.toString,a=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(s){try{return n(s);}catch(_unused20){return a.slice();}};h.exports.f=function(f){return a&&i.call(f)=="[object Window]"?o(f):n(e(f));};},/* 182 */ /***/function(h,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n);};},/* 183 */ /***/function(h,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),o=t(105),s=t(99),f=Object.getOwnPropertyDescriptor;r.f=t(100)?f:function(c,v){if(c=i(c),v=a(v,!0),s)try{return f(c,v);}catch(_unused21){}if(o(c,v))return n(!e.f.call(c,v),c[v]);};},/* 184 */ /***/function(h,r,t){t(179)("asyncIterator");},/* 185 */ /***/function(h,r,t){t(179)("observable");},/* 186 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.createNowTime=e,r.formatDelay=n;function e(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame\n"default":function _default(n,i,a,o,s){return typeof n=="number"&&typeof i=="number"?n+(a-o)/(s-o)*(i-n):a-o>s-a?i:n;}};},/* 188 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.parseEasing=r.Easings=void 0;var e=t(76),n=f(e),i=t(133),a=f(i),o=t(141),s=f(o);function f(T){return T&&T.__esModule?T:{"default":T};}var p=t(189),c=new s["default"]();function v(){for(var T=arguments.length,l=Array(T),d=0;d1&&arguments[1]!==void 0?arguments[1]:"end";return function(d,u){for(var g=1;g0?d=A:l=A;while(Math.abs(M)>n&&++R=e?x(b,C,l,u):W===0?C:O(b,E,E+o,l,u);}return function(E){return E===0?0:E===1?1:v(R(E),d,g);};};},/* 190 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=d(e),i=t(204),a=d(i),o=t(164),s=d(o),f=t(170),p=d(f),c=t(171),v=d(c),S=t(175),O=d(S),x=t(75),m=d(x),T=t(208),l=t(188);function d(W){return W&&W.__esModule?W:{"default":W};}var u=(0,O["default"])("timing"),g=(0,O["default"])("keyframes"),M=(0,O["default"])("initState"),A=(0,O["default"])("readyDefer"),R=(0,O["default"])("finishedDefer"),b=(0,O["default"])("effects"),E=(0,O["default"])("activeReadyTimer"),L=(0,O["default"])("activeFinishTimer"),D=(0,O["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},C=function(){function W(G,K,J){var Z=this;if((0,p["default"])(this,W),Array.isArray(G)){var B=[G[0],G,K];G=B[0],K=B[1],J=B[2];}typeof J=="number"&&(J={duration:J}),this[u]=(0,s["default"])({},I,J),this[u].easing=(0,l.parseEasing)(this[u].easing),this[g]=(0,T.calculateFramesOffset)(K);var $=this[g][this[g].length-1];this[M]={},(0,a["default"])($).forEach(function(Q){Object.prototype.hasOwnProperty.call(G,Q)&&Q!=="easing"&&Q!=="offset"&&(Z[M][Q]=G[Q]);}),this[g]=this[g].map(function(Q){return(0,s["default"])({},Z[M],Q);}),this[g][0].offset!==0&&this[g].unshift((0,s["default"])({},this[M],{offset:0})),$.offset<1&&this[g].push((0,s["default"])({},$,{offset:1})),this[b]={},this.timeline=null;}return(0,v["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:E,value:function value(){var K=this;this[A]&&!this[A].timerID&&(this.timeline.currentTime<0?this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:-this.timeline.currentTime,heading:!1}):this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var K=this,J=this[u],Z=J.duration,B=J.iterations,$=J.endDelay,Q=Math.ceil(Z*B+$-this.timeline.currentTime)+1;this[R]&&!this[R].timerID&&(this[R].timerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](R);},{delay:Q,heading:!1}),this[R].reverseTimerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](R),K.timeline=null;},{delay:-this[u].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var K=this[u],J=K.delay,Z=K.playbackRate,B=K.timeline;this.timeline=new m["default"]({originTime:J,playbackRate:Z},B),this[E](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[E]());}},{key:D,value:function value(K){var J=this[K],Z=this.timeline;J&&Z&&(Z.clearTimeout(J.timerID),J.reverseTimerID&&Z.clearTimeout(J.reverseTimerID)),delete this[K];}},{key:"cancel",value:function value(){this[D](A),this[D](R),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[D](A),this[D](R);}},{key:"applyEffects",value:function value(K){return(0,s["default"])(this[b],K);}},{key:"playbackRate",get:function get(){return this[u].playbackRate;},set:function set(K){this.timeline&&(this.timeline.playbackRate=K),this[u].playbackRate=K;}},{key:"playState",get:function get(){var K=this.timeline,J=this[u],Z=J.iterations,B=J.duration,$=J.endDelay,Q="running";if(K==null)Q="idle";else if(K.paused)Q="paused";else if(K.currentTime<0)Q="pending";else{var et=K.currentTime-Z*B;et>0&&et<$?Q="pending":et>=$&&(Q="finished");}return Q;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var K=this[u],J=K.duration,Z=K.iterations,B=this.timeline,$=this.playState,Q=void 0;if($==="idle")Q=0;else if($==="paused"&&B.currentTime<0)Q=0;else if($==="pending"){if(B.currentTime<0)Q=0;else{var et=B.seekLocalTime(Z*J);Q=(0,T.periodicity)(et,J)[1]/J;}}else($==="running"||$==="paused")&&(Q=(0,T.periodicity)(B.currentTime,J)[1]/J);return $==="finished"&&(Q=(0,T.periodicity)(Z,1)[1]),Q;}},{key:"frame",get:function get(){var K=this.playState,J=this[M],Z=this[u].fill;if(K==="idle")return J;var B=this.timeline.currentTime,$=this[g].slice(0),Q=(0,T.getProgress)(this.timeline,this[u],this.progress),et=Q.p,tt=Q.inverted,ot=J;return B<0&&K==="pending"?(Z==="backwards"||Z==="both")&&(ot=tt?$[$.length-1]:$[0]):(K!=="pending"&&K!=="finished"||Z==="forwards"||Z==="both")&&(ot=(0,T.getCurrentFrame)(this[u],$,this[b],et)),ot;}},{key:"timing",get:function get(){return this[u];}},{key:"effects",get:function get(){return this[b];}},{key:"baseTimeline",set:function set(K){this[u].timeline=K;},get:function get(){return this[u].timeline;}},{key:"ready",get:function get(){return this[A]?this[A].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[A]=(0,T.defer)(),this.timeline&&this[E](),this[A]?this[A].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[R]||(this[R]=(0,T.defer)(),this.timeline&&this[L]()),this[R].promise);}}]),W;}();r["default"]=C;},/* 191 */ /***/function(h,r,t){h.exports={"default":t(192),__esModule:!0};},/* 192 */ /***/function(h,r,t){t(143),t(125),t(79),t(193),t(202),t(203),h.exports=t(92).Promise;},/* 193 */ /***/function(h,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),o=t(90),s=t(98),f=t(94),p=t(147),c=t(148),v=t(194),S=t(195).set,O=t(197)(),x=t(198),m=t(199),T=t(200),l=t(201),d="Promise",u=n.TypeError,g=n.process,M=g&&g.versions,A=M&&M.v8||"",_R=n[d],b=a(g)=="process",E=function E(){},L,D,I,C,W=D=x.f,G=!!function(){try{var tt=_R.resolve(1),ot=(tt.constructor={})[t(122)("species")]=function(q){q(E,E);};return(b||typeof PromiseRejectionEvent=="function")&&tt.then(E)instanceof ot&&A.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused22){}}(),K=function K(tt){var ot;return s(tt)&&typeof(ot=tt.then)=="function"?ot:!1;},J=function J(tt,ot){if(!tt._n){tt._n=!0;var q=tt._c;O(function(){for(var gt=tt._v,dt=tt._s==1,F=0,j=function j(V){var X=dt?V.ok:V.fail,N=V.resolve,z=V.reject,y=V.domain,P,w,U;try{X?(dt||(tt._h==2&&$(tt),tt._h=1),X===!0?P=gt:(y&&y.enter(),P=X(gt),y&&(y.exit(),U=!0)),P===V.promise?z(u("Promise-chain cycle")):(w=K(P))?w.call(P,N,z):N(P)):z(gt);}catch(H){y&&!U&&y.exit(),z(H);}};q.length>F;)j(q[F++]);tt._c=[],tt._n=!1,ot&&!tt._h&&Z(tt);});}},Z=function Z(tt){S.call(n,function(){var ot=tt._v,q=B(tt),gt,dt,F;if(q&&(gt=m(function(){b?g.emit("unhandledRejection",ot,tt):(dt=n.onunhandledrejection)?dt({promise:tt,reason:ot}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",ot);}),tt._h=b||B(tt)?2:1),tt._a=void 0,q&>.e)throw gt.v;});},B=function B(tt){return tt._h!==1&&(tt._a||tt._c).length===0;},$=function $(tt){S.call(n,function(){var ot;b?g.emit("rejectionHandled",tt):(ot=n.onrejectionhandled)&&ot({promise:tt,reason:tt._v});});},Q=function Q(tt){var ot=this;ot._d||(ot._d=!0,ot=ot._w||ot,ot._v=tt,ot._s=2,ot._a||(ot._a=ot._c.slice()),J(ot,!0));},et=function et(tt){var ot=this,q;if(!ot._d){ot._d=!0,ot=ot._w||ot;try{if(ot===tt)throw u("Promise can\'t be resolved itself");(q=K(tt))?O(function(){var gt={_w:ot,_d:!1};try{q.call(tt,i(et,gt,1),i(Q,gt,1));}catch(dt){Q.call(gt,dt);}}):(ot._v=tt,ot._s=1,J(ot,!1));}catch(gt){Q.call({_w:ot,_d:!1},gt);}}};G||(_R=function R(ot){p(this,_R,d,"_h"),f(ot),L.call(this);try{ot(i(et,this,1),i(Q,this,1));}catch(q){Q.call(this,q);}},L=function L(ot){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},L.prototype=t(146)(_R.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\nthen:function then(ot,q){var gt=W(v(this,_R));return gt.ok=typeof ot=="function"?ot:!0,gt.fail=typeof q=="function"&&q,gt.domain=b?g.domain:void 0,this._c.push(gt),this._a&&this._a.push(gt),this._s&&J(this,!1),gt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)\n"catch":function _catch(tt){return this.then(void 0,tt);}}),I=function I(){var tt=new L();this.promise=tt,this.resolve=i(et,tt,1),this.reject=i(Q,tt,1);},x.f=W=function W(tt){return tt===_R||tt===C?new I(tt):D(tt);}),o(o.G+o.W+o.F*!G,{Promise:_R}),t(121)(_R,d),t(149)(d),C=t(92)[d],o(o.S+o.F*!G,d,{// 25.4.4.5 Promise.reject(r)\nreject:function reject(ot){var q=W(this),gt=q.reject;return gt(ot),q.promise;}}),o(o.S+o.F*(e||!G),d,{// 25.4.4.6 Promise.resolve(x)\nresolve:function resolve(ot){return l(e&&this===C?_R:this,ot);}}),o(o.S+o.F*!(G&&t(140)(function(tt){_R.all(tt)["catch"](E);})),d,{// 25.4.4.1 Promise.all(iterable)\nall:function all(ot){var q=this,gt=W(q),dt=gt.resolve,F=gt.reject,j=m(function(){var V=[],X=0,N=1;c(ot,!1,function(z){var y=X++,P=!1;V.push(void 0),N++,q.resolve(z).then(function(w){P||(P=!0,V[y]=w,--N||dt(V));},F);}),--N||dt(V);});return j.e&&F(j.v),gt.promise;},// 25.4.4.4 Promise.race(iterable)\nrace:function race(ot){var q=this,gt=W(q),dt=gt.reject,F=m(function(){c(ot,!1,function(j){q.resolve(j).then(gt.resolve,dt);});});return F.e&&dt(F.v),gt.promise;}});},/* 194 */ /***/function(h,r,t){var e=t(97),n=t(94),i=t(122)("species");h.exports=function(a,o){var s=e(a).constructor,f;return s===void 0||(f=e(s)[i])==null?o:n(f);};},/* 195 */ /***/function(h,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,f=o.setImmediate,p=o.clearImmediate,c=o.MessageChannel,v=o.Dispatch,S=0,O={},x="onreadystatechange",m,T,l,d=function d(){var g=+this;if(O.hasOwnProperty(g)){var M=O[g];delete O[g],M();}},u=function u(g){d.call(g.data);};(!f||!p)&&(f=function f(M){for(var A=[],R=1;arguments.length>R;)A.push(arguments[R++]);return O[++S]=function(){n(typeof M=="function"?M:Function(M),A);},m(S),S;},p=function p(M){delete O[M];},t(86)(s)=="process"?m=function m(g){s.nextTick(e(d,g,1));}:v&&v.now?m=function m(g){v.now(e(d,g,1));}:c?(T=new c(),l=T.port2,T.port1.onmessage=u,m=e(l.postMessage,l,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(m=function m(g){o.postMessage(g+"","*");},o.addEventListener("message",u,!1)):x in a("script")?m=function m(g){i.appendChild(a("script"))[x]=function(){i.removeChild(this),d.call(g);};}:m=function m(g){setTimeout(e(d,g,1),0);}),h.exports={set:f,clear:p};},/* 196 */ /***/function(h,r){h.exports=function(t,e,n){var i=n===void 0;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3]);}return t.apply(n,e);};},/* 197 */ /***/function(h,r,t){var e=t(91),n=t(195).set,i=e.MutationObserver||e.WebKitMutationObserver,a=e.process,o=e.Promise,s=t(86)(a)=="process";h.exports=function(){var f,p,c,v=function v(){var m,T;for(s&&(m=a.domain)&&m.exit();f;){T=f.fn,f=f.next;try{T();}catch(l){throw f?c():p=void 0,l;}}p=void 0,m&&m.enter();};if(s)c=function c(){a.nextTick(v);};else if(i&&!(e.navigator&&e.navigator.standalone)){var S=!0,O=document.createTextNode("");new i(v).observe(O,{characterData:!0}),c=function c(){O.data=S=!S;};}else if(o&&o.resolve){var x=o.resolve(void 0);c=function c(){x.then(v);};}else c=function c(){n.call(e,v);};return function(m){var T={fn:m,next:void 0};p&&(p.next=T),f||(f=T,c()),p=T;};};},/* 198 */ /***/function(h,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,f){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=f;}),this.resolve=e(a),this.reject=e(o);}h.exports.f=function(i){return new n(i);};},/* 199 */ /***/function(h,r){h.exports=function(t){try{return{e:!1,v:t()};}catch(e){return{e:!0,v:e};}};},/* 200 */ /***/function(h,r,t){var e=t(91),n=e.navigator;h.exports=n&&n.userAgent||"";},/* 201 */ /***/function(h,r,t){var e=t(97),n=t(98),i=t(198);h.exports=function(a,o){if(e(a),n(o)&&o.constructor===a)return o;var s=i.f(a),f=s.resolve;return f(o),s.promise;};},/* 202 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),o=t(201);e(e.P+e.R,"Promise",{"finally":function _finally(s){var f=a(this,n.Promise||i.Promise),p=typeof s=="function";return this.then(p?function(c){return o(f,s()).then(function(){return c;});}:s,p?function(c){return o(f,s()).then(function(){throw c;});}:s);}});},/* 203 */ /***/function(h,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{"try":function _try(a){var o=n.f(this),s=i(a);return(s.e?o.reject:o.resolve)(s.v),o.promise;}});},/* 204 */ /***/function(h,r,t){h.exports={"default":t(205),__esModule:!0};},/* 205 */ /***/function(h,r,t){t(206),h.exports=t(92).Object.keys;},/* 206 */ /***/function(h,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a));};});},/* 207 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(101);h.exports=function(a,o){var s=(n.Object||{})[a]||Object[a],f={};f[a]=o(s),e(e.S+e.F*i(function(){s(1);}),"Object",f);};},/* 208 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=O(e),i=t(209),a=O(i),o=t(164),s=O(o),f=t(191),p=O(f);r.defer=x,r.periodicity=m,r.calculateFramesOffset=T,r.getProgress=l,r.getCurrentFrame=u;var c=t(188),v=t(187),S=O(v);function O(g){return g&&g.__esModule?g:{"default":g};}function x(){var g={};return g.promise=new p["default"](function(M,A){g.resolve=M,g.reject=A;}),g;}function m(g,M){var A=Math.floor(g/M),R=g-A*M;return R===0&&A>0&&(R=M,A--),[A,R];}function T(g){g=g.slice(0);var M=g[0],A=g[g.length-1];A.offset=A.offset||1,M.offset=M.offset||0;for(var R=0,b=-1,E=0;E1)for(var I=(L.offset-R)/D,C=0;C0){var W=g[E].easing!=null;g[E]=(0,s["default"])({},g[E-1],g[E]),W||delete g[E].easing;}}return g;}function l(g,M,A){var R=g.currentTime,b=M.direction,E=M.duration,L=!1;if(b==="reverse")A=1-A,L=!0;else if(b==="alternate"||b==="alternate-reverse"){var D=Math.floor(R/E);A===1&&D--,D%2^b==="alternate-reverse"&&(A=1-A,L=!0);}return{p:A,inverted:L};}function d(g,M,A,R){var b={};return(0,a["default"])(M).forEach(function(E){var L=(0,n["default"])(E,2),D=L[0],I=L[1];if(D!=="offset"&&D!=="easing"){var C=A[D]||A["default"],W=C(g[D],I,R,g.offset,M.offset);W!=null&&(b[D]=W);}}),b;}function u(g,M,A,R){var b=g.easing,E=g.effect;E||(A=(0,s["default"])({},S["default"],A));var L={};R=b(R,M);for(var D=1;D=R||D===M.length-1){var W=M[D-1],G=W.offset,K=W.easing,J=R;if(K){var Z=C-G;J=K((R-G)/Z)*Z+G;}E?L=E(W,I,J,G,C):L=d(W,I,A,J);break;}}return L;}},/* 209 */ /***/function(h,r,t){h.exports={"default":t(210),__esModule:!0};},/* 210 */ /***/function(h,r,t){t(211),h.exports=t(92).Object.entries;},/* 211 */ /***/function(h,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function entries(a){return n(a);}});},/* 212 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;h.exports=function(o){return function(s){for(var f=i(s),p=n(f),c=p.length,v=0,S=[],O;c>v;)O=p[v++],(!e||a.call(f,O))&&S.push(o?[O,f[O]]:f[O]);return S;};};},/* 213 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);var e=/* @__PURE__ */new Map();function n(a){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];a=a.toLowerCase();var f=e.get(a);if(!f)throw new TypeError("Invalid node: ".concat(a));var p=new f(o);return s.forEach(function(c){p.appendChild(c);}),p;}var i={registerNode:function registerNode(a,o){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),e.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));e.set(o,a),Object.defineProperties(a.prototype,{nodeType:{value:s},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(a,o){return n(o);},isSpriteNode:function isSpriteNode(a){return e.has(a.toLowerCase());}};r["default"]=i;},/* 214 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");var o=/*#__PURE__*/function(){function o(f){var _ref116=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref116$bubbles=_ref116.bubbles,p=_ref116$bubbles===void 0?null:_ref116$bubbles;_classCallCheck(this,o);if(typeof f=="string"?(this[e]=f,this[n]=!!p):(this[e]=f.type,this[i]=f,this[n]=p!=null?!!p:!!f.bubbles,f.detail&&(this[a]=f.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(f){this[i]=f;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[e];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[a];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 */ /***/function(h,r,t){t.r(r),t.d(r,"parseFilterString",function(){return n;}),t.d(r,"applyFilters",function(){return i;});var e=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a=a.trim(),!a||a==="none")return null;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(([^()]*(?:\\(.*\\))*[^()]*)\\))+$/i,s=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(([^()]*(?:\\(.*\\))*[^()]*)\\))+?/ig),f=[];return s&&s.forEach(function(p){var c=p.match(o);if(!c)throw new TypeError("Invalid fitler string.");var _c3=_slicedToArray(c,3),v=_c3[1],S=_c3[2];v=v.toLowerCase(),S=S.trim().match(/([^( )]+|([^( )]+\\(.*\\)))(?=\\s|$)/g).map(function(O,x){var m;return v==="url"||v==="drop-shadow"&&x===3?m=O:m=Object(e.toNumber)(O),/%$/.test(O)&&(m/=100),m;}),f.push({type:v,args:S});}),f;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref117){var s=_ref117.type,f=_ref117.args;var p=s;p==="drop-shadow"?p="dropShadow":p==="hue-rotate"&&(p="hueRotate"),a[p].apply(a,_toConsumableArray(f));});}},/* 216 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i){if(!i)return;var a=n.getListeners("beforerender"),o=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=function(s){n.dispatchEvent({type:"beforerender",detail:{context:s}});}:a.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(s){n.dispatchEvent({type:"afterrender",detail:{context:s}});}:o.length||(i.afterRender=null);}},/* 217 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(12),n=t(218),i=t(70),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("amount"),s=Symbol("meshCloud");var f=/*#__PURE__*/function(_i$default){function f(c){var _this17;var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,f);_this17=_callSuper(this,f),_this17.meshNode=c,c.connect(_assertThisInitialized(_this17)),_this17[o]=v,_this17[s]=null;return _this17;}_inherits(f,_i$default);return _createClass(f,[{key:"meshCloud",get:function get(){var c=this.meshNode,v=this[o];return!this[s]&&c.mesh&&(this[s]=new e.MeshCloud(c.mesh,v)),this[s];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(c){this[o]=c,this[s]&&(this[s].amount=c);}},{key:"brightness",value:function brightness(c,v){this.meshCloud&&(this.meshCloud.brightness(c,v),this.forceUpdate());}},{key:"contrast",value:function contrast(c,v){this.meshCloud&&(this.meshCloud.contrast(c,v),this.forceUpdate());}},{key:"delete",value:function _delete(c){this.meshCloud&&(this.meshCloud["delete"](c),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this18=this;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_get(_getPrototypeOf(f.prototype),"draw",this).call(this,c),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var v=this.shaderAttrs;v&&Object.entries(v).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),O=_ref119[0],x=_ref119[1];_this18.meshCloud.mesh.setAttribute(O,x);});var S=this.uniforms;if(this.uniforms){var O={};Object.entries(S).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),x=_ref121[0],m=_ref121[1];typeof m=="function"&&(m=m(_this18,x)),O[x]=m;}),this.meshCloud.mesh.setUniforms(O);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),c.push(this.meshCloud);}return c;}},{key:"getTransform",value:function getTransform(c){if(this.meshCloud)return this.meshCloud.getTransform(c);}},{key:"grayscale",value:function grayscale(c,v){this.meshCloud&&(this.meshCloud.grayscale(c,v),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(c,v){this.meshCloud&&(this.meshCloud.hueRotate(c,v),this.forceUpdate());}},{key:"invert",value:function invert(c,v){this.meshCloud&&(this.meshCloud.invert(c,v),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(c,v){if(!this.meshCloud)return!1;var S=this.attributes.pointerEvents;if(S==="none"||S!=="all"&&!this.isVisible)return!1;var O="both";S==="visibleFill"&&(O="fill"),S==="visibleStroke"&&(O="stroke");for(var x=0;x2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),S=_ref123[0],O=_ref123[1];var x=Math.PI*v/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,m=_this$meshNode$attrib.x,_T18=_this$meshNode$attrib.y;this.meshCloud.rotate(c,x,[S+m,O+_T18]),this.forceUpdate();}}},{key:"saturate",value:function saturate(c,v){this.meshCloud&&(this.meshCloud.saturate(c,v),this.forceUpdate());}},{key:"scale",value:function scale(c,_ref124){var _ref125=_slicedToArray(_ref124,2),v=_ref125[0],_ref125$=_ref125[1],S=_ref125$===void 0?v:_ref125$;var _ref126=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref127=_slicedToArray(_ref126,2),O=_ref127[0],x=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,m=_this$meshNode$attrib2.x,_T19=_this$meshNode$attrib2.y,_l14=1e-5;Math.abs(v)<_l14&&(v=1/v>0?_l14:-_l14),Math.abs(S)<_l14&&(S=1/S>0?_l14:-_l14),this.meshCloud.scale(c,[v,S],[O+m,x+_T19]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(c,v){this.meshCloud&&(this.meshCloud.setColorTransform(c,v),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(c,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setFillColor(c,v),this.forceUpdate());}},{key:"sepia",value:function sepia(c,v){this.meshCloud&&(this.meshCloud.sepia(c,v),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref128){var c=_ref128.width,v=_ref128.height;_get(_getPrototypeOf(f.prototype),"setResolution",this).call(this,{width:c,height:v}),this.meshNode.setResolution({width:c,height:v});}},{key:"setStrokeColor",value:function setStrokeColor(c,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setStrokeColor(c,v),this.forceUpdate());}},{key:"setTransform",value:function setTransform(c,v){this.meshCloud&&(this.meshCloud.setTransform(c,v),this.forceUpdate());}},{key:"skew",value:function skew(c,_ref129){var _ref130=_slicedToArray(_ref129,2),v=_ref130[0],_ref130$=_ref130[1],S=_ref130$===void 0?v:_ref130$;var _ref131=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref132=_slicedToArray(_ref131,2),O=_ref132[0],x=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,m=_this$meshNode$attrib3.x,_T20=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[v,S],[O+m,x+_T20]),this.forceUpdate();}}},{key:"transform",value:function transform(c,v){this.meshCloud&&(this.meshCloud.transform(c,v),this.forceUpdate());}},{key:"transformColor",value:function transformColor(c,v){this.meshCloud&&(this.meshCloud.transformColor(c,v),this.forceUpdate());}},{key:"translate",value:function translate(c,_ref133){var _ref134=_slicedToArray(_ref133,2),v=_ref134[0],S=_ref134[1];this.meshCloud&&(this.meshCloud.translate(c,[v,S]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(f,"cloud");},/* 218 */ /***/function(h,r,t){t.r(r),t.d(r,"loadTexture",function(){return a;}),t.d(r,"applyTexture",function(){return o;}),t.d(r,"createTexture",function(){return f;}),t.d(r,"deleteTexture",function(){return p;}),t.d(r,"drawTexture",function(){return v;}),t.d(r,"loadFrames",function(){return S;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(O,x){if(i[O])return i[O];var m=e.ENV.loadImage(O,{alias:x,useImageBitmap:!1});return m!==null&&m!==void 0?m:O;}function o(_x11,_x12,_x13){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(O,x,m){var T,_O$attributes,_l15,d,u,g;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:T=x;typeof x=="string"&&(T=a(x));_context9.t0=T&&typeof T.then=="function";if(!_context9.t0){_context9.next=7;break;}_context9.next=6;return T;case 6:T=_context9.sent;case 7:if(!(x===O.attributes.texture)){_context9.next=11;break;}T&&T.image&&(T.sourceRect&&(O.attributes.sourceRect=T.sourceRect),O.textureImageRotated=!!T.rotated,T=T.image);_O$attributes=O.attributes,_l15=_O$attributes.width,d=_O$attributes.height,u=_O$attributes.textureRect,g=O.textureImage;O.textureImage=T,m&&g!==T&&!u&&(_l15==null||d==null)&&O.updateContours(),O.forceUpdate();case 11:return _context9.abrupt("return",T);case 12:case"end":return _context9.stop();}},_callee9);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function f(O,x){if(x[s]=x[s]||/* @__PURE__ */new Map(),x[s].has(O))return x[s].get(O);var m=x.createTexture(O);return!/^blob:/.test(O.src)&&typeof O.getContext!="function"&&x[s].set(O,m),m;}function p(O,x){if(x[s]&&x[s].has(O)){var m=x[s].get(O);return x.deleteTexture(m),x[s]["delete"](O),!0;}return!1;}var c=Symbol("textureContext");function v(O,x){var m=O.textureImage instanceof String?String(O.textureImage):O.textureImage,T=O.textureImageRotated,l=x.texture,d=O.renderer;if(m){var u=O.originalContentRect;var g=O.attributes.textureRect;var M=O.attributes.textureRepeat,A=O.attributes.sourceRect;if(!l||O[c]&&O[c]!==d||l.image!==m||l.options.repeat!==M||!Object(n.compareValue)(l.options.rect,g)||!Object(n.compareValue)(l.options.srcRect,A)){var R=f(m,d);g?(g[0]+=u[0],g[1]+=u[1]):g=u;var b=null;l&&!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(b=x.uniforms.u_texSampler),x.setTexture(R,{rect:g,repeat:M,srcRect:A,rotated:T}),b&&b["delete"]&&b["delete"](),O[c]=d;}}else if(l){var _u8=null;!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(_u8=x.uniforms.u_texSampler),x.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function S(_x14,_x15){return _S5.apply(this,arguments);}function _S5(){_S5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(O,x){var m,T;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.t0=typeof x=="string";if(!_context10.t0){_context10.next=7;break;}_context10.next=4;return fetch(x,{method:"GET",mode:"cors",cache:"default"});case 4:_context10.next=6;return _context10.sent.json();case 6:x=_context10.sent;case 7:_context10.next=9;return a(O);case 9:m=_context10.sent;T=x.frames;return _context10.abrupt("return",(Object.entries(T).forEach(function(_ref135){var _ref136=_slicedToArray(_ref135,2),l=_ref136[0],d=_ref136[1];var _d$frame=d.frame,u=_d$frame.x,g=_d$frame.y,M=_d$frame.w,A=_d$frame.h;var R=[u,g,M,A];var b=d.rotated;b&&(R=[R[0],R[1],R[3],R[2]]),i[l]={image:m,sourceRect:R,rotated:b};}),m));case 12:case"end":return _context10.stop();}},_callee10);}));return _S5.apply(this,arguments);}},/* 219 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;});var e=t(1),n=t(12),i=t(70),a=t(220),o=t(221),s=t(222),f=t(213),p=t(223);t(1).glMatrix.setMatrixArrayType(Array);function c(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var v=Symbol("mesh");var S=/*#__PURE__*/function(_i$default2){function S(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);return _callSuper(this,S,[x]);}_inherits(S,_i$default2);return _createClass(S,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,x=_this$attributes2.paddingTop,m=_this$attributes2.paddingRight,T=_this$attributes2.paddingBottom,l=_this$attributes2.paddingLeft,d=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],g=_this$contentSize[1];return[l+u+m+d,x+g+T+d];}// content + padding\n},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,x=_this$attributes3.paddingTop,m=_this$attributes3.paddingRight,T=_this$attributes3.paddingBottom,l=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),d=_this$contentSize2[0],u=_this$contentSize2[1];return[l+d+m,x+u+T];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,x=_this$attributes4.width,m=_this$attributes4.height,T=_this$attributes4.boxSizing,l=_this$attributes4.paddingTop,d=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,g=_this$attributes4.paddingLeft;if(x=x||0,m=m||0,T==="border-box"){var M=2*this.attributes.borderWidth;x-=M+d+g,m-=M+l+u,x=Math.max(0,x),m=Math.max(0,m);}return[x,m];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),x=_this$borderSize[0],m=_this$borderSize[1];return x>0&&m>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var x=this.clientBox;if(x){var _m5;var m=this[v];if(m)m.box!==x&&(m.contours=x.contours,m.box=x);else{m=new n.Mesh2D(x),m.box=x;var _l16=this.attributes.bgcolor;if(Object(o.setFillColor)(m,{color:_l16}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,M=_this$attributes5.borderDash,A=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(m,{color:u,lineWidth:g,lineDash:M,lineDashOffset:A});}this[v]=m;var d=this.attributes.clipPath;d&&this[v].setClipPath(d);}var _T21=this.opacity;return m.getOpacity()!==_T21&&m.setOpacity(_T21),(_m5=m).setTransform.apply(_m5,_toConsumableArray(this.renderMatrix)),m;}return null;}// content + padding + border\n},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,x=_this$attributes6.paddingTop,m=_this$attributes6.paddingRight,T=_this$attributes6.paddingBottom,l=_this$attributes6.paddingLeft,d=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),u=_this$contentSize3[0],g=_this$contentSize3[1],M=2*d;return[l+u+m+M,x+g+T+M];}},{key:"originalClientRect",get:function get(){if(this.mesh){var x=this.mesh.boundingBox;return[x[0][0],x[0][1],x[1][0]-x[0][0],x[1][1]-x[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),x=_this$originalClientR[0],m=_this$originalClientR[1],T=_this$originalClientR[2],l=_this$originalClientR[3],d=this.attributes.padding;return[x+d[0],m+d[1],T-d[0]-d[2],l-d[1]-d[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var x=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(x=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,x));var m=null;if(this.mesh){m=_toConsumableArray(this.mesh.boundingBox);var _T22=this.attributes.borderWidth;_T22&&(m[0]=[m[0][0]-_T22,m[0][1]-_T22],m[1]=[m[1][0]+_T22,m[1][1]+_T22]);}return Object(p["default"])(m,x);}// transformPoint(x, y) {\n// const m = mat2d.invert(this.renderMatrix);\n// const newX = x * m[0] + y * m[2] + m[4];\n// const newY = x * m[1] + y * m[3] + m[5];\n// return [newX, newY];\n// }\n/* override */},{key:"onPropertyChange",value:function onPropertyChange(x,m,T){if(_get(_getPrototypeOf(S.prototype),"onPropertyChange",this).call(this,x,m,T),(x==="anchorX"||x==="anchorY"||x==="boxSizing"||x==="width"||x==="height"||x==="borderWidth"||x==="paddingLeft"||x==="paddingRight"||x==="paddingTop"||x==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(x))&&this.updateContours(),this[v]&&x==="clipPath"&&this[v].setClipPath(m),this[v]&&x==="bgcolor"&&Object(o.setFillColor)(this[v],{color:m}),this[v]&&(x==="borderColor"||x==="borderWidth"||x==="borderDash"||x==="borderDashOffset")){var _this$attributes7=this.attributes,_l17=_this$attributes7.borderColor,d=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[v],{color:_l17,lineWidth:d,lineDash:d?u:0,lineDashOffset:g});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,x=_this$attributes8.anchorX,m=_this$attributes8.anchorY,T=_this$attributes8.borderWidth,l=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),d=_this$borderSize2[0],u=_this$borderSize2[1],g=this.offsetSize,M=0.5*T,A=-x*g[0]+M,R=-m*g[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[A,R,d,u],l);}}]);}(i["default"]);c(S,"Attr",a["default"]),f["default"].registerNode(S,"block");},/* 220 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_declareAlias");var p=/*#__PURE__*/function(_e$default){function p(v){var _this19;_classCallCheck(this,p);_this19=_callSuper(this,p,[v]),_this19[s]({anchorX:0,anchorY:0,/* anchor */width:void 0,height:void 0,/* size */borderWidth:0,borderColor:"rgba(0,0,0,1)",/* border */borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],/* borderRadius */bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,/* padding */boxSizing:"content-box",clipPath:void 0}),_this19[f]("anchor","size","border","borderRadius","padding");return _this19;}_inherits(p,_e$default);return _createClass(p,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(v){this[a]("anchorX",Object(n.toNumber)(v));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(v){this[a]("anchorY",Object(n.toNumber)(v));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.anchorX=v[0],this.anchorY=v[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(v){this[a]("width",Object(n.toNumber)(v));}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){this[a]("height",Object(n.toNumber)(v));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(v){this[a]("borderWidth",Object(n.toNumber)(v));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(v){this[a]("borderColor",Object(i.parseColor)(v));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v]),this.borderWidth=v[0],v[1]!=null&&(this.borderColor=v[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(v){v=Object(n.toArray)(v,!0),v!=null&&!Array.isArray(v)&&(v=[v]),this[a]("borderDash",v?v.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(v){this[a]("borderDashOffset",Object(n.toNumber)(v));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopLeftRadius",v.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopRightRadius",v.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomRightRadius",v.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomLeftRadius",v.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(v){if(v=Object(n.toArray)(v),!Array.isArray(v))v=Array(8).fill(v);else if(v.length===2)v=[v[0],v[1],v[0],v[1],v[0],v[1],v[0],v[1]];else if(v.length===4)v=[v[0],v[1],v[2],v[3],v[0],v[1],v[2],v[3]];else if(v.length===6)v=[v[0],v[1],v[2],v[3],v[4],v[5],v[2],v[3]];else if(v.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[v[0],v[1]],this.borderTopRightRadius=[v[2],v[3]],this.borderBottomRightRadius=[v[4],v[5]],this.borderBottomLeftRadius=[v[6],v[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(v){this[a]("bgcolor",Object(i.parseColor)(v));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(v){this[a]("paddingTop",Object(n.toNumber)(v));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(v){this[a]("paddingRight",Object(n.toNumber)(v));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(v){this[a]("paddingBottom",Object(n.toNumber)(v));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(v){this[a]("paddingLeft",Object(n.toNumber)(v));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)?v.length===2?v=[v[0],v[1],v[0],v[1]]:v.length===3&&(v=[v[0],v[1],v[2],v[1]]):v=[v,v,v,v],this.paddingTop=v[0],this.paddingRight=v[1],this.paddingBottom=v[2],this.paddingLeft=v[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(v){this[a]("clipPath",v);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(v){if(v!=null&&v!=="border-box"&&v!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",v);}}]);}(e["default"]);},/* 221 */ /***/function(h,r,t){t.r(r),t.d(r,"Gradient",function(){return i;}),t.d(r,"isTransparent",function(){return a;}),t.d(r,"parseColor",function(){return o;}),t.d(r,"setFillColor",function(){return f;}),t.d(r,"setStrokeColor",function(){return p;}),t.d(r,"Color",function(){return c;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref137){var S=_ref137.vector,O=_ref137.colors;_classCallCheck(this,i);if(!Array.isArray(S)||S.length!==4&&S.length!==6&&S.length!==3)throw new TypeError("Invalid gradient");this.vector=S,this.colors=O.map(function(_ref138){var x=_ref138.offset,m=_ref138.color;return{offset:x,color:o(m)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(v){return v instanceof i?!1:v==null?!0:n()(v)[3]===0;}function o(v){if(v==null||(v||(v="transparent"),v instanceof i))return v;var S=n()(v);if(!S||!S.length)throw new TypeError("Invalid color value.");return"rgba(".concat(S.join(),")");}function s(v,S,O){var x=v.boundingBox[0];if(O.vector){var m=O.vector,_T23=O.colors;m.length===4?(m=[m[0]+x[0],m[1]+x[1],m[2]+x[0],m[3]+x[1]],v.setLinearGradient({vector:m,colors:_T23,type:S})):m.length===3?(m=[m[0]+x[0],m[1]+x[1],m[2]],v.setCircularGradient({vector:m,colors:_T23,type:S})):(m=[m[0]+x[0],m[1]+x[1],m[2],m[3]+x[0],m[4]+x[1],m[5]],v.setRadialGradient({vector:m,colors:_T23,type:S}));}else v.gradient&&v.gradient[S]&&(delete v.gradient[S],delete v.uniforms.u_radialGradientVector);}function f(v,_ref139){var S=_ref139.color,_ref139$rule=_ref139.rule,O=_ref139$rule===void 0?"nonzero":_ref139$rule;return s(v,"fill",S),S.vector||v.setFill({color:S,rule:O}),v;}function p(v,_ref140){var S=_ref140.color,O=_ref140.lineWidth,x=_ref140.lineCap,m=_ref140.lineJoin,T=_ref140.lineDash,l=_ref140.lineDashOffset,d=_ref140.miterLimit,u=_ref140.roundSegments;s(v,"stroke",S),S.vector&&(S=[0,0,0,1]),v.setStroke({color:S,thickness:O,cap:x,join:m,miterLimit:d,lineDash:T,lineDashOffset:l,roundSegments:u});}var c=/*#__PURE__*/function(_Array){function c(){var _S6,_S7,_n2,_n3;var _this20;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var m=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,c);return _possibleConstructorReturn(_this20,(Array.isArray(S)&&(_S6=S,_S7=_slicedToArray(_S6,4),S=_S7[0],O=_S7[1],x=_S7[2],m=_S7[3],_S6),typeof S=="string"&&((_n2=n()(S),_n3=_slicedToArray(_n2,4),S=_n3[0],O=_n3[1],x=_n3[2],m=_n3[3]),S/=255,O/=255,x/=255),_this20=_callSuper(this,c,[S,O,x,m]),_assertThisInitialized(_this20)));}_inherits(c,_Array);return _createClass(c,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(S){this[0]=S/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(S){this[1]=S/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(S){this[2]=S/255;}},{key:"a",get:function get(){return this[3];},set:function set(S){this[3]=S;}},{key:"hex",get:function get(){var S="0".concat(this.r.toString(16)).slice(-2),O="0".concat(this.g.toString(16)).slice(-2),x="0".concat(this.b.toString(16)).slice(-2);var m;return this.a<1&&(m=Math.round(this[3]*255),m="0".concat(m.toString(16)).slice(-2)),"#".concat(S).concat(O).concat(x).concat(m||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(S){return typeof S=="string"&&(S=n()(S),S[0]/=255,S[1]/=255,S[2]/=255),this[0]=S[0],this[1]=S[1],this[2]=S[2],this[3]=S[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 */ /***/function(h,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,f){var p=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var c=0.5522848,v=s/2*c,S=f/2*c,O=a+s,x=o+f,m=a+s/2,T=o+f/2;p==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-S,m-v,o,m,o)):p==="rightTop"?i.bezierCurveTo(m+v,o,O,T-S,O,T):p==="rightBottom"?i.bezierCurveTo(O,T+S,m+v,x,m,x):p==="leftBottom"&&i.bezierCurveTo(m-v,x,a,T+S,a,T);}function n(i,_ref141,p){var _ref142=_slicedToArray(_ref141,4),a=_ref142[0],o=_ref142[1],s=_ref142[2],f=_ref142[3];if(!p||Array.isArray(p)&&p.every(function(c){return c===0;}))i.beginPath(),i.rect(a,o,s,f);else{typeof p=="number"&&(p=Array(8).fill(p));var _p$map=p.map(function(d,u){return u%2?Math.min(d,f/2):Math.min(d,s/2);}),_p$map2=_slicedToArray(_p$map,8),c=_p$map2[0],v=_p$map2[1],S=_p$map2[2],O=_p$map2[3],x=_p$map2[4],m=_p$map2[5],_T24=_p$map2[6],_l18=_p$map2[7];i.beginPath(),i.moveTo(a,o+v),e(i,a,o,c*2,v*2,"leftTop"),i.lineTo(a+s-S,o),e(i,a+s-S*2,o,S*2,O*2,"rightTop"),i.lineTo(a+s,o+f-m),e(i,a+s-x*2,o+f-m*2,x*2,m*2,"rightBottom"),i.lineTo(a+_T24,o+f),e(i,a,o+f-_l18*2,_T24*2,_l18*2,"leftBottom"),i.closePath();}return i;}},/* 223 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array),r["default"]=function(e,n){if(!e)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _e3=_slicedToArray(e,2),_e3$=_slicedToArray(_e3[0],2),i=_e3$[0],a=_e3$[1],_e3$2=_slicedToArray(_e3[1],2),o=_e3$2[0],s=_e3$2[1],f=i*n[0]+a*n[2]+n[4],p=i*n[1]+a*n[3]+n[5],c=o*n[0]+a*n[2]+n[4],v=o*n[1]+a*n[3]+n[5],S=o*n[0]+s*n[2]+n[4],O=o*n[1]+s*n[3]+n[5],x=i*n[0]+s*n[2]+n[4],m=i*n[1]+s*n[3]+n[5],T=Math.min(f,c,S,x),l=Math.min(p,v,O,m),d=Math.max(f,c,S,x),u=Math.max(p,v,O,m);return{x:T,y:l,width:d-T,height:u-l,left:T,top:l,right:d,bottom:u};};},/* 224 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(p,c,v){return c in p?Object.defineProperty(p,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[c]=v,p;}var s=Symbol("textureTask");var f=/*#__PURE__*/function(_n$default){function f(){var _this21;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,f);typeof c=="string"&&(c={texture:c}),_this21=_callSuper(this,f,[c]);return _this21;}/* override */_inherits(f,_n$default);return _createClass(f,[{key:"contentSize",get:function get(){var _get2=_get(_getPrototypeOf(f.prototype),"contentSize",this),_get3=_slicedToArray(_get2,2),c=_get3[0],v=_get3[1];var _this$attributes9=this.attributes,S=_this$attributes9.width,O=_this$attributes9.height;if(S==null||O==null){var x=this.textureImage,m=this.attributes.textureRect,_T25=this.attributes.sourceRect;if(m)S==null&&(c=m[0]+m[2]),O==null&&(v=m[1]+m[3]);else if(_T25){var _l19=this.layer?this.layer.displayRatio:1;S==null&&(c=_T25[2]/_l19),O==null&&(v=_T25[3]/_l19);}else if(x){var _l20=this.layer?this.layer.displayRatio:1;S==null&&(c=x.width/_l20),O==null&&(v=x.height/_l20);}}return[c,v];}},{key:"textureImageReady",get:function get(){return this[s]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(f.prototype),"draw",this).call(this,c);var v=this.mesh;return v&&Object(e.drawTexture)(this,v),c;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(c,v,S){if(_get(_getPrototypeOf(f.prototype),"onPropertyChange",this).call(this,c,v,S),c==="texture"&&(this[s]=Object(e.applyTexture)(this,v,!0)),c==="textureRect"){var _this$attributes10=this.attributes,O=_this$attributes10.width,x=_this$attributes10.height;(O==null||x==null)&&this.updateContours();}}}]);}(n["default"]);o(f,"Attr",i["default"]),a["default"].registerNode(f,"sprite");},/* 225 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_e$default2){function o(f){var _this22;_classCallCheck(this,o);_this22=_callSuper(this,o,[f]),_this22[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this22;}_inherits(o,_e$default2);return _createClass(o,[{key:"texture",get:function get(){return this[a]("texture");},set:function set(f){this[i]("texture",f);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(f){this[i]("textureRect",f);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(f){this[i]("sourceRect",f);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(f){this[i]("textureRepeat",!!f);}}]);}(e["default"]);},/* 226 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return O;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),o=t(228),s=t(221),f=t(218),p=t(213),c=t(223);t(1).glMatrix.setMatrixArrayType(Array);function v(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x;}var S=Symbol("mesh");var O=/*#__PURE__*/function(_a$default){function O(){var _this23;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof m=="string"&&(m={d:m}),_this23=_callSuper(this,O,[m]),_this23.effects={d:function d(T,l,_d5,u,g){var _i$a;var M=(_d5-u)/(g-u);if(M<=0)return T;if(M>=1)return l;var A=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(l)),R=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(A).concat([M]))[0];return R.reduce(function(E,L){return"".concat(E).concat(L.slice(2).join(" ")," ");},"M".concat(R[0][0]," ").concat(R[0][1],"C")).trim();}};return _this23;}/* override */_inherits(O,_a$default);return _createClass(O,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var m=this.path;if(m){var _T27;var _T26=this[S];if(_T26)_T26.path!==m&&(_T26.contours=m.contours,_T26.path=m);else{_T26=new e.Mesh2D(this.path),_T26.path=m;var d=this.attributes.fillColor,u=this.attributes.fillRule;d&&Object(s.setFillColor)(_T26,{color:d,rule:u});var g=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&g>0){var _this$attributes11=this.attributes,R=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,E=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,D=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_T26,{color:M,lineWidth:g,lineCap:R,lineJoin:b,miterLimit:E,lineDash:L,lineDashOffset:D,roundSegments:I});}this[S]=_T26;var A=this.attributes.clipPath;A&&this[S].setClipPath(A);}var _l21=this.opacity;return _T26.getOpacity()!==_l21&&_T26.setOpacity(_l21),(_T27=_T26).setTransform.apply(_T27,_toConsumableArray(this.renderMatrix)),_T26;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var m=this.path.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var m=this.mesh.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[0][1]];}return[0,0,0,0];}},{key:"originalClientCenter",get:function get(){return this.mesh?this.mesh.boundingCenter:[0,0];}},{key:"d",get:function get(){return this.attributes.d;}/* override */,set:function set(m){this.attributes.d=m;}},{key:"draw",value:function draw(){var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(O.prototype),"draw",this).call(this,m);var T=this.mesh;return T&&Object(f.drawTexture)(this,T),m;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var m=null;return this.mesh&&(m=this.mesh.boundingBox),Object(c["default"])(m,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(m){if(this.mesh){var _T28=this.mesh.getPointAtLength(m);if(_T28)return[_T28.x,_T28.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,l){if(_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,l),(m==="d"||m==="normalize")&&this.updateContours(),this[S]&&(m==="fillColor"||m==="fillRule")){var _this$attributes12=this.attributes,d=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(s.setFillColor)(this[S],{color:d,rule:u});}if(this[S]&&(m==="strokeColor"||m==="lineWidth"||m==="lineCap"||m==="lineJoin"||m==="lineDash"||m==="lineDashOffset"||m==="roundSegments")){var _this$attributes13=this.attributes,_d6=_this$attributes13.strokeColor,_u9=_this$attributes13.lineWidth;if(_d6&&_u9>0){var _this$attributes14=this.attributes,g=_this$attributes14.lineCap,M=_this$attributes14.lineJoin,A=_this$attributes14.lineDash,R=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,E=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[S],{color:_d6,lineCap:g,lineJoin:M,lineWidth:_u9,lineDash:A,lineDashOffset:R,miterLimit:b,roundSegments:E});}}this[S]&&m==="clipPath"&&this[S].setClipPath(T),m==="texture"&&Object(f.applyTexture)(this,T);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);v(O,"Attr",o["default"]),p["default"].registerNode(O,"path");},/* 227 */ /***/function(h,r,t){(function(e,n){h.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(D,I){var C=[],W=!0,G=!1,K=void 0;try{for(var J=D[Symbol.iterator](),Z;!(W=(Z=J.next()).done)&&(C.push(Z.value),!(I&&C.length===I));W=!0);}catch(B){G=!0,K=B;}finally{try{!W&&J["return"]&&J["return"]();}finally{if(G)throw K;}}return C;}return function(D,I){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return L(D,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(D,I,C,W,G,K,J){var Z=D.x,B=D.y;Z*=I,B*=C;var $=W*Z-G*B,Q=G*Z+W*B;return{x:$+K,y:Q+J};},a=function a(D,I){var C=1.3333333333333333*Math.tan(I/4),W=Math.cos(D),G=Math.sin(D),K=Math.cos(D+I),J=Math.sin(D+I);return[{x:W-G*C,y:G+W*C},{x:K+J*C,y:J-K*C},{x:K,y:J}];},o=function o(D,I,C,W){var G=D*W-I*C<0?-1:1,K=Math.sqrt(D*D+I*I),J=Math.sqrt(D*D+I*I),Z=D*C+I*W,B=Z/(K*J);return B>1&&(B=1),B<-1&&(B=-1),G*Math.acos(B);},s=function s(D,I,C,W,G,K,J,Z,B,$,Q,et){var tt=Math.pow(G,2),ot=Math.pow(K,2),q=Math.pow(Q,2),gt=Math.pow(et,2),dt=tt*ot-tt*gt-ot*q;dt<0&&(dt=0),dt/=tt*gt+ot*q,dt=Math.sqrt(dt)*(J===Z?-1:1);var F=dt*G/K*et,j=dt*-K/G*Q,V=$*F-B*j+(D+C)/2,X=B*F+$*j+(I+W)/2,N=(Q-F)/G,z=(et-j)/K,y=(-Q-F)/G,P=(-et-j)/K,w=o(1,0,N,z),U=o(N,z,y,P);return Z===0&&U>0&&(U-=n),Z===1&&U<0&&(U+=n),[V,X,w,U];},f=function f(D){var I=D.px,C=D.py,W=D.cx,G=D.cy,K=D.rx,J=D.ry,Z=D.xAxisRotation,B=Z===void 0?0:Z,$=D.largeArcFlag,Q=$===void 0?0:$,et=D.sweepFlag,tt=et===void 0?0:et,ot=[];if(K===0||J===0)return[];var q=Math.sin(B*n/360),gt=Math.cos(B*n/360),dt=gt*(I-W)/2+q*(C-G)/2,F=-q*(I-W)/2+gt*(C-G)/2;if(dt===0&&F===0)return[];K=Math.abs(K),J=Math.abs(J);var j=Math.pow(dt,2)/Math.pow(K,2)+Math.pow(F,2)/Math.pow(J,2);j>1&&(K*=Math.sqrt(j),J*=Math.sqrt(j));var V=s(I,C,W,G,K,J,Q,tt,q,gt,dt,F),X=e(V,4),N=X[0],z=X[1],y=X[2],P=X[3],w=Math.max(Math.ceil(Math.abs(P)/(n/4)),1);P/=w;for(var U=0;U2&&(D.push([C].concat(W.splice(0,2))),G="l",C=C=="m"?"l":"L");;){if(W.length==p[G])return W.unshift(C),D.push(W);if(W.lengthL-1&&(G-=L),C[G]=W;}D.push(C);}return D;}function g(L){for(var D=[],I=0;IW-1&&(C-=W);};function R(L,D,I,C,W,G,K,J,Z){return{left:b(L,D,I,C,W,G,K,J,Z),right:b(K,J,W,G,I,C,L,D,1-Z,!0)};}function b(L,D,I,C,W,G,K,J,Z,B){var $=(I-L)*Z+L,Q=(C-D)*Z+D,et=(W-I)*Z+I,tt=(G-C)*Z+C,ot=(K-W)*Z+W,q=(J-G)*Z+G,gt=(et-$)*Z+$,dt=(tt-Q)*Z+Q,F=(ot-et)*Z+et,j=(q-tt)*Z+tt,V=(F-gt)*Z+gt,X=(j-dt)*Z+dt;return B?[V,X,gt,dt,$,Q,L,D]:[L,D,$,Q,gt,dt,V,X];}A._splitCurves=function(L,D){for(var I=0,C=0;I=L.length-1&&(C=0);}};function E(L,D){for(var I=function I(G){var K=L[L.length-1],J=[];K.forEach(function(Z){J.push(Z.slice(0));}),L.push(J);},C=0;CC?E(G,I-C):IB?Z=Q){$=I,K($,1),G($),cancelAnimationFrame(B);return;}var q=Z(ot/Q);$=A._lerp(C[0],C[1],q),K($,q),B=requestAnimationFrame(tt);};et();},A;});},/* 228 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");var f=/*#__PURE__*/function(_e$default3){function f(c){var _this24;_classCallCheck(this,f);_this24=_callSuper(this,f,[c]),_this24[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// \'miter\' or \'bevel\' or \'round\'\nlineCap:"butt",// \'butt\' or \'square\' or \'round\'\nroundSegments:20,// default roundSegment if lineJoin or lineCap is round\nlineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this24;}_inherits(f,_e$default3);return _createClass(f,[{key:"d",get:function get(){return this[s]("d");},set:function set(c){this[o]("d",c);}},{key:"normalize",get:function get(){return this[s]("normalize");},set:function set(c){this[o]("normalize",!!c);}},{key:"fillColor",get:function get(){return this[s]("fillColor");},set:function set(c){this[o]("fillColor",Object(n.parseColor)(c));}},{key:"fillRule",get:function get(){return this[s]("fillRule");},set:function set(c){if(c!=null&&c!=="nonzero"&&c!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",c);}},{key:"strokeColor",get:function get(){return this[s]("strokeColor");},set:function set(c){this[o]("strokeColor",Object(n.parseColor)(c));}},{key:"lineWidth",get:function get(){return this[s]("lineWidth");},set:function set(c){this[o]("lineWidth",Object(i.toNumber)(c));}},{key:"lineJoin",get:function get(){return this[s]("lineJoin");},set:function set(c){if(c!=null&&c!=="miter"&&c!=="bevel"&&c!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",c);}},{key:"lineCap",get:function get(){return this[s]("lineCap");},set:function set(c){if(c!=null&&c!=="butt"&&c!=="square"&&c!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",c);}},{key:"lineDash",get:function get(){return this[s]("lineDash");},set:function set(c){c=Object(i.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c]),this[o]("lineDash",c?c.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[s]("lineDashOffset");},set:function set(c){this[o]("lineDashOffset",Object(i.toNumber)(c));}},{key:"miterLimit",get:function get(){return this[s]("miterLimit");},set:function set(c){this[o]("miterLimit",Object(i.toNumber)(c));}},{key:"roundSegments",get:function get(){return this[s]("roundSegments");},set:function set(c){this[o]("roundSegments",c);}},{key:"texture",get:function get(){return this[s]("texture");},set:function set(c){this[o]("texture",c);}},{key:"textureRect",get:function get(){return this[s]("textureRect");},set:function set(c){this[o]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[s]("sourceRect");},set:function set(c){this[o]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[s]("textureRepeat");},set:function set(c){this[o]("textureRepeat",!!c);}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(c){this[o]("clipPath",c);}}]);}(e["default"]);},/* 229 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,f=_this$attributes15.width,p=_this$attributes15.height;return f>0&&p>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_declareAlias");function f(c){var v=c.width,S=c.height;return"M0 0L".concat(v," 0L").concat(v," ").concat(S,"L0 ").concat(S,"Z");}var p=/*#__PURE__*/function(_e$default5){function p(v){var _this25;_classCallCheck(this,p);_this25=_callSuper(this,p,[v]),_this25[i]({width:0,height:0/* size */}),_this25[s]("size");return _this25;}// readonly\n_inherits(p,_e$default5);return _createClass(p,[{key:"d",get:function get(){return this[o]("d");},set:function set(v){}// eslint-disable-line no-empty-function\n},{key:"width",get:function get(){return this[o]("width");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("width",v)){var S=f(this);this[a]("d",S);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("height",v)){var S=f(this);this[a]("d",S);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}}]);}(e["default"]);},/* 231 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default6);return _createClass(o,[{key:"isVisible",get:function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.points;return f.length>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var S=v.points,O=v.smooth,x=v.smoothRange,m=v.close,T=[];for(var d=0;d1&&arguments[1]!==undefined?arguments[1]:[0];function a(f){var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var v,S,O,x;if((n[f].x===n[f+1].x||n[f].y===n[f+1].y)&&(p=0,c=0),f<1?(v=n[0].x+(n[1].x-n[0].x)*p,S=n[0].y+(n[1].y-n[0].y)*p):(v=n[f].x+(n[f+1].x-n[f-1].x)*p,S=n[f].y+(n[f+1].y-n[f-1].y)*p),f>n.length-3){var m=n.length-1;O=n[m].x-(n[m].x-n[m-1].x)*c,x=n[m].y-(n[m].y-n[m-1].y)*c;}else O=n[f+1].x-(n[f+2].x-n[f].x)*c,x=n[f+1].y-(n[f+2].y-n[f].y)*c;return[{x:v,y:S},{x:O,y:x}];}n=n.map(function(_ref143){var _ref144=_slicedToArray(_ref143,2),f=_ref144[0],p=_ref144[1];return{x:f,y:p};});var o="",s=0;return n.forEach(function(f,p){if(p===0)o+="M".concat(f.x," ").concat(f.y);else{for(;p>i[s];)s++;if(s%2){var _a3=a(p-1),_a4=_slicedToArray(_a3,2),c=_a4[0],v=_a4[1];o+="C".concat([c.x,c.y,v.x,v.y,f.x,f.y].join(" "));}else o+="L".concat(f.x," ").concat(f.y);}}),o;}},/* 235 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides=_slicedToArray(p.sides,2),c=_p$sides[0],v=_p$sides[1];var S=p.angle%360;return S<0&&(S+=360),S=Math.PI*S/180,[0,0,c,0,v*Math.cos(S),v*Math.sin(S)];}var f=/*#__PURE__*/function(_e$default9){function f(c){var _this27;_classCallCheck(this,f);_this27=_callSuper(this,f,[c]),_this27[i]({sides:[0,0],angle:60,closeType:"normal"});return _this27;}// readonly\n_inherits(f,_e$default9);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(c){}// eslint-disable-line no-empty-function\n},{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 236 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides2=_slicedToArray(p.sides,2),c=_p$sides2[0],v=_p$sides2[1];var S=p.angle%360;S<0&&(S+=360),S=Math.PI*S/180;var O=v*Math.cos(S),x=v*Math.sin(S);return[0,0,c,0,O+c,x,O,x];}var f=/*#__PURE__*/function(_e$default11){function f(c){var _this28;_classCallCheck(this,f);_this28=_callSuper(this,f,[c]),_this28[i]({sides:[0,0],angle:90,closeType:"normal"});return _this28;}// readonly\n_inherits(f,_e$default11);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(c){}// eslint-disable-line no-empty-function\n},{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 238 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default12);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"regular");},/* 239 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var c=p.edges,v=p.radius,S=p.offsetAngle,O=Math.PI*S/180-0.5*Math.PI;if(c<3||v<=0)return[];var x=[];for(var m=0;m0&&p>0&&c!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var S=v.radiusX,O=v.radiusY,x=v.startAngle,m=v.endAngle,T=v.direction,l=v.closeType,d=T==="anitclockwise",u=new e.Figure2D();return l==="sector"&&u.moveTo(0,0),u.ellipse(0,0,S,O,0,Math.PI*x/180,Math.PI*m/180,d),l!=="none"&&u.closePath(),u.path.reduce(function(A,R){return A+R.join(" ");},"");}var c=/*#__PURE__*/function(_n$default2){function c(S){var _this31;_classCallCheck(this,c);_this31=_callSuper(this,c,[S]),_this31[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise\ncloseType:"none"// none | sector | normal\n}),_this31[f]("radius","angle");return _this31;}// readonly\n_inherits(c,_n$default2);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function\n},{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusX",S)){var O=p(this);this[o]("d",O);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusY",S)){var O=p(this);this[o]("d",O);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.radiusX=S[0],this.radiusY=S[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}},{key:"direction",get:function get(){return this[s]("direction");},set:function set(S){if(S!=null&&S!=="clockwise"&&S!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",S);}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(S){if(S!=null&&S!=="none"&&S!=="sector"&&S!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",S)){var O=p(this);this[o]("d",O);}}}]);}(n["default"]);},/* 244 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default17);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"arc");},/* 245 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_e$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_e$default18);return _createClass(i,[{key:"radius",get:function get(){return _get(_getPrototypeOf(i.prototype),"radiusX",this);},set:function set(o){o=Object(n.toNumber)(o),_set(_getPrototypeOf(i.prototype),"radiusX",o,this,true),_set(_getPrototypeOf(i.prototype),"radiusY",o,this,true);}}]);}(e["default"]);},/* 246 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,f=_this$attributes17.innerRadius,p=_this$attributes17.outerRadius,c=_this$attributes17.startAngle,v=_this$attributes17.endAngle;return(f>0||p>0)&&c!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var _ref145;var S=v.innerRadius,O=v.outerRadius,x=v.startAngle,m=v.endAngle;var T=new e.Figure2D();if(x=Math.PI*x/180,m=Math.PI*m/180,S>O&&(_ref145=[O,S],S=_ref145[0],O=_ref145[1],_ref145),S<=0&&T.moveTo(0,0),T.arc(0,0,O,x,m,!1),S>0){var u=Math.PI*2;m=u&&(m=x+u-1e-6),T.arc(0,0,S,m,x,!0);}return T.closePath(),T.path.reduce(function(u,g){return u+g.join(" ");},"");}var c=/*#__PURE__*/function(_n$default3){function c(S){var _this32;_classCallCheck(this,c);_this32=_callSuper(this,c,[S]),_this32[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this32[f]("radius","angle");return _this32;}// readonly\n_inherits(c,_n$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function\n},{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("innerRadius",S)){var O=p(this);this[o]("d",O);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("outerRadius",S)){var O=p(this);this[o]("d",O);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.innerRadius=S[0],this.outerRadius=S[1];}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}}]);}(n["default"]);},/* 248 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return O;});var e=t(12),n=t(218),i=t(219),a=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x;}var f=Symbol("textImage"),p=Symbol("textImageTask"),c=Symbol("textureContext"),v=Symbol("updateTextureRect"),S=Symbol("textCanvas");var O=/*#__PURE__*/function(_i$default3){function O(){var _this33;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof m=="string"&&(m={text:m}),_this33=_callSuper(this,O,[m]);return _this33;}/* override */_inherits(O,_i$default3);return _createClass(O,[{key:"contentSize",get:function get(){var _get4=_get(_getPrototypeOf(O.prototype),"contentSize",this),_get5=_slicedToArray(_get4,2),m=_get5[0],T=_get5[1];var _this$attributes18=this.attributes,l=_this$attributes18.width,d=_this$attributes18.height;if(l==null||d==null){var u=this[f];u&&(l==null&&(m=u.rect[2]),d==null&&(T=u.rect[3]));}return[m,T];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textImage",get:function get(){return this[f]||{};}},{key:"textImageReady",get:function get(){return this[p]||Promise.resolve();}/* override */},{key:"draw",value:function draw(m){_get(_getPrototypeOf(O.prototype),"draw",this).call(this,m);var T=this.mesh;if(T){var _l24=this[f];if(_l24){var d=T.texture;if(!d||this[c]&&this[c]!==this.renderer||_l24.needsUpdate?(_l24.needsUpdate=!1,Object(n.deleteTexture)(_l24.image,this.renderer),d=Object(n.createTexture)(_l24.image,this.renderer),this[v]=!0):d=T.uniforms.u_texSampler,this[v]){var _l24$rect$slice=_l24.rect.slice(2),_l24$rect$slice2=_slicedToArray(_l24$rect$slice,2),u=_l24$rect$slice2[0],g=_l24$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),M=_this$contentSize4[0],A=_this$contentSize4[1],R=this.attributes.textAlign,b=this.attributes.verticalAlign;var E=0;R==="center"?E=(M-u)/2:(R==="right"||R==="end")&&(E=M-u);var L=this.attributes.fontSize,D=this.attributes.lineHeight;var I=0;b==="top"?I=(L-D)/2:b==="bottom"&&(I=(D-L)/2);var _this$attributes19=this.attributes,C=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,G=this.attributes.borderWidth;E+=C+G,I+=W+G;var _this$attributes20=this.attributes,K=_this$attributes20.anchorX,J=_this$attributes20.anchorY;E-=this.offsetSize[0]*K,I-=this.offsetSize[1]*J,T.setTexture(d,{rect:[E,I,u,g]}),this[v]=!1,this[c]=this.renderer;}}}return m;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,l){m==="text"||m==="fontSize"||m==="fontFamily"||m==="fontStyle"||m==="fontVariant"||m==="fontWeight"||m==="fontStretch"||m==="lineHeight"||m==="strokeColor"||m==="fillColor"||m==="strokeWidth"?this.updateText():((m==="textAlign"||m==="verticalAlign")&&(this[v]=!0),_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,l));}/* override */},{key:"updateContours",value:function updateContours(){_get(_getPrototypeOf(O.prototype),"updateContours",this).call(this),this[v]=!0;}},{key:"updateText",value:function updateText(){var _this34=this;this[p]||(this[p]=Promise.resolve().then(function(){_this34[p]=null;var _this34$attributes=_this34.attributes,m=_this34$attributes.text,T=_this34$attributes.font,l=_this34$attributes.fillColor,d=_this34$attributes.strokeColor,u=_this34$attributes.strokeWidth,g=_this34.layer?_this34.layer.displayRatio:1;return _this34[S]=_this34[S]||e.ENV.createCanvas(1,1),_this34[f]=e.ENV.createText(m,{font:T,fillColor:l,strokeColor:d,strokeWidth:u,parseFont:e.parseFont,ratio:g,textCanvas:_this34[S]}),_this34[f].needsUpdate=!0,_this34.updateContours(),_this34.forceUpdate(),_this34[f];}));}}]);}(i["default"]);s(O,"Attr",a["default"]),o["default"].registerNode(O,"label");},/* 249 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_declareAlias");var c=/*#__PURE__*/function(_a$default2){function c(S){var _this35;_classCallCheck(this,c);_this35=_callSuper(this,c,[S]),_this35[o]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this35[p]("font");return _this35;}_inherits(c,_a$default2);return _createClass(c,[{key:"text",get:function get(){return this[f]("text")||" ";},set:function set(S){this[s]("text",S);}},{key:"fontSize",get:function get(){return this[f]("fontSize");},set:function set(S){this[s]("fontSize",Object(n.toNumber)(S));}},{key:"fontFamily",get:function get(){return this[f]("fontFamily");},set:function set(S){this[s]("fontFamily",S);}},{key:"fontStyle",get:function get(){return this[f]("fontStyle");},set:function set(S){this[s]("fontStyle",S);}},{key:"fontVariant",get:function get(){return this[f]("fontVariant");},set:function set(S){this[s]("fontVariant",S);}},{key:"fontWeight",get:function get(){return this[f]("fontWeight");},set:function set(S){this[s]("fontWeight",S);}},{key:"fontStretch",get:function get(){return this[f]("fontStretch");},set:function set(S){this[s]("fontStretch",S);}},{key:"lineHeight",get:function get(){return this[f]("lineHeight")||this.fontSize;},set:function set(S){this[s]("lineHeight",Object(n.toNumber)(S));}},{key:"textAlign",get:function get(){return this[f]("textAlign");},set:function set(S){this[s]("textAlign",S);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(S){this[s]("strokeColor",Object(i.parseColor)(S));}},{key:"strokeWidth",get:function get(){return this[f]("strokeWidth");},set:function set(S){this[s]("strokeWidth",Object(n.toNumber)(S));}},{key:"verticalAlign",get:function get(){return this[f]("verticalAlign");},set:function set(S){this[s]("verticalAlign",S);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(S){this[s]("fillColor",Object(i.parseColor)(S));}},{key:"font",get:function get(){var S=this.fontStyle,O=this.fontVariant,x=this.fontWeight,m=this.fontStretch,T=this.fontSize,l=this.lineHeight,d=this.fontFamily;return"".concat(S," ").concat(O," ").concat(x," ").concat(m," ").concat(T,"px/").concat(l,"px ").concat(d);},set:function set(S){if(S==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var O=Object(e.parseFont)(S);this.fontStyle=O.style,this.fontVariant=O.variant,this.fontWeight=O.weight,this.fontStretch=O.stretch,this.fontSize=Object(n.toNumber)("".concat(O.size).concat(O.unit)),O.lineHeight&&(this.lineHeight=O.pxLineHeight),this.fontFamily=O.family;}}}]);}(a["default"]);},/* 250 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;});var e=t(12),n=t(219),i=t(251),a=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function s(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var f=Symbol("zOrder"),p=Symbol("ordered"),c=Symbol("children"),v=Symbol("sealed");var S=/*#__PURE__*/function(_n$default4){function S(){var _this36;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);_this36=_callSuper(this,S,[x]),_this36[c]=[],_this36[p]=null,_this36[f]=0;return _this36;}_inherits(S,_n$default4);return _createClass(S,[{key:"childNodes",get:function get(){return this[c];}},{key:"children",get:function get(){return this[c];}},{key:"orderedChildren",get:function get(){return this[p]||(this[p]=_toConsumableArray(this[c]),this[p].sort(function(x,m){return x.zIndex-m.zIndex||x.zOrder-m.zOrder;})),this[p];}},{key:"append",value:function append(){var _this37=this;for(var _len12=arguments.length,x=new Array(_len12),_key12=0;_key12<_len12;_key12++){x[_key12]=arguments[_key12];}return x.map(function(m){return _this37.appendChild(m);});}},{key:"appendChild",value:function appendChild(x){return x.remove(),this[c].push(x),x.connect(this,this[f]++),this[p]&&(this[p].length&&x.zIndex 0 && this[_children].length > 0;\n// }\n/* override */},{key:"cloneNode",value:function cloneNode(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var m=_get(_getPrototypeOf(S.prototype),"cloneNode",this).call(this);return x&&this[c].forEach(function(T){var l=T.cloneNode(x);m.appendChild(l);}),m;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(x){var m=this.orderedChildren;for(var _T31=m.length-1;_T31>=0;_T31--)if(m[_T31].dispatchPointerEvent(x))return!0;return _get(_getPrototypeOf(S.prototype),"dispatchPointerEvent",this).call(this,x);}/* override */},{key:"draw",value:function draw(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_get(_getPrototypeOf(S.prototype),"draw",this).call(this,x),!this[v]&&this.attributes.display!=="none"){var m=this.orderedChildren;for(var _T32=0;_T32=0;m--)x[m].remove();}},{key:"removeChild",value:function removeChild(x){var m=this[c].indexOf(x);if(m>=0){if(this[c].splice(m,1),this[p]){var _T33=this[p].indexOf(x);this[p].splice(_T33,1);}return x.disconnect(this),x;}return null;}},{key:"reorder",value:function reorder(){this[p]=null;}},{key:"seal",value:function seal(){function x(d,u){var g=[];for(var M=0;M-1;){for(l=d=m[T],m[T]=null,u=!0;d;){if(m.indexOf(d)>-1){u=!1,m.splice(T,1);break;}d=s(d);}u&&(m[T]=l);}return m;}var p={isTag:a,existsOne:function existsOne(m,T){return T.some(function(l){return a(l)?m(l)||p.existsOne(m,o(l)):!1;});},getSiblings:function getSiblings(m){var T=s(m);return T&&o(T);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(m,T){if(m.nodeType===1&&T==="class"||T==="id")return m[T];if(this.hasAttrib(m,T)){var _l26=m.attributes[T];return Array.isArray(_l26)&&(_l26="[".concat(_l26.join(),"]")),String(_l26);}},hasAttrib:function hasAttrib(m,T){return m.attributes[T]!=null;},removeSubsets:f,getName:function getName(m){return m.tagName?m.tagName.toLowerCase():null;},findOne:function m(T,l){var d=null;for(var u=0,g=l.length;u0&&(d=m(T,M));}return d;},findAll:function m(T,l){var d=[];for(var u=0,g=l.length;u\nComment:"comment",//\x3c!-- ... --\x3e\nScript:"script",//