From 8a72a9707874b0e3d524f8926638a532742e2a9a Mon Sep 17 00:00:00 2001 From: Damiano Clementel Date: Sun, 3 Dec 2023 18:56:38 +0100 Subject: [PATCH] Reverts angular builder to previous version, in order to mantain GitHub pages compatibility --- angular.json | 4 +- docs/3rdpartylicenses.txt | 340 +++++++++++++++++ docs/assets/ngx-structure-viewer.png | Bin 0 -> 31816 bytes docs/assets/ngx-structure-viewer.svg | 155 ++++++++ docs/favicon.ico | Bin 0 -> 15086 bytes docs/index.html | 13 + docs/main.92c15af9ae60dcc2.js | 1 + docs/polyfills.b35b25cceb7c4251.js | 1 + docs/runtime.9d86f2421e75c000.js | 1 + docs/styles.ef46db3751d8e999.css | 0 package-lock.json | 545 ++++++++++++++++++++++++++- package.json | 1 + 12 files changed, 1047 insertions(+), 14 deletions(-) create mode 100644 docs/3rdpartylicenses.txt create mode 100644 docs/assets/ngx-structure-viewer.png create mode 100644 docs/assets/ngx-structure-viewer.svg create mode 100644 docs/favicon.ico create mode 100644 docs/index.html create mode 100644 docs/main.92c15af9ae60dcc2.js create mode 100644 docs/polyfills.b35b25cceb7c4251.js create mode 100644 docs/runtime.9d86f2421e75c000.js create mode 100644 docs/styles.ef46db3751d8e999.css diff --git a/angular.json b/angular.json index 6ef4946..a66c94b 100644 --- a/angular.json +++ b/angular.json @@ -57,11 +57,11 @@ "prefix": "app", "architect": { "build": { - "builder": "@angular-devkit/build-angular:application", + "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/demo-showcase", "index": "projects/demo-showcase/src/index.html", - "browser": "projects/demo-showcase/src/main.ts", + "main": "projects/demo-showcase/src/main.ts", "polyfills": [ "zone.js" ], diff --git a/docs/3rdpartylicenses.txt b/docs/3rdpartylicenses.txt new file mode 100644 index 0000000..21920a8 --- /dev/null +++ b/docs/3rdpartylicenses.txt @@ -0,0 +1,340 @@ +@angular/common +MIT + +@angular/core +MIT + +@angular/platform-browser +MIT + +@angular/router +MIT + +immer +MIT +MIT License + +Copyright (c) 2017 Michel Weststrate + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +immutable +MIT +MIT License + +Copyright (c) 2014-present, Lee Byron and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +molstar +MIT +The MIT License + + Copyright (c) 2017 - now, Mol* contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +ngx-structure-viewer + +rxjs +Apache-2.0 + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +xhr2 +MIT +Copyright (c) 2013 Victor Costan + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +zone.js +MIT +The MIT License + +Copyright (c) 2010-2023 Google LLC. https://angular.io/license + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/docs/assets/ngx-structure-viewer.png b/docs/assets/ngx-structure-viewer.png new file mode 100644 index 0000000000000000000000000000000000000000..af623ac21a09171e2897ac2307c814bf7633592c GIT binary patch literal 31816 zcmdSB^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PtXiXKF zaf4iu7r1>@ej|wa*ElG*RKcdQQIxl_AfZ#zd}EYzx4c=r#8rN_&FIW=vBv!D zX7j>LQe(qf64hj;EBW(928cD7*Mfo`0PvlS!fH%r<~b7J|Kn(*C?mXCluj^^xDX~3 z!(u>lFg`+Qty?h@5#WV`7WYl-F;maQcSVCoE%Jv_K;DE)>reNJ*(#`|k4F~0ylz0i zs>SB$KS(*Yt)dK~k=(!?y_TN;xS|M~5QJ46th!z>K=)eQezVBsP%1>dKi&vNc3FcJ zW3!u>R5)0dD>AnWLMj)IME*A*ke%M7`IcAhx(NGbKTFnV5QHoMvAAoF)nq|-I&Q!i z>cGfb?jAjMg*gAmpEjjS%uBxpZb+Vkl(amrVR(u>J6aCX@!d;mAcWk4UXR%vE8=%V zPHmP`v9mS;+qj>I{1Im7P&;LRnyETK1#99+snO~c$g{ZU;w!u~kcVsm0IaJmJ){yd%;7$XD`Z5&@D*zBkWo3xh}JP+%Rc0(&Gf2 zm~tcx!3j-Ke>9S^6BXBi1RyK#bMF}}gfo#}M&agvy{et&IveXE*jjw%2#)^JRVT|V zSU84J>E@~g0fcdr=XGu`*>67oO@hfnI2$Pq1}3BmSqXajDaCi+&;O>-{1XEKQVH86 zQ|bBBnAy_`X;wA#yolgV-amv~xdiF@kFT%PU`^cg!9w%&hJwaR;Ey_^k+DDs_zwPp z__E4x<;w}Kr`ut3QP@)dfu}A!u}BxNixg}i0f1e|LE6wYP;ZN0Z=+x5R!Dl>_gdom z + + + + + + +* diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..57614f9c967596fad0a3989bec2b1deff33034f6 GIT binary patch literal 15086 zcmd^G33O9Omi+`8$@{|M-I6TH3wzF-p5CV8o}7f~KxR60LK+ApEFB<$bcciv%@SmA zV{n>g85YMFFeU*Uvl=i4v)C*qgnb;$GQ=3XTe9{Y%c`mO%su)noNCCQ*@t1WXn|B(hQ7i~ zrUK8|pUkD6#lNo!bt$6)jR!&C?`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hT z2;1+e)`TvbNb3-0z&DD_)Jomsg-7p_Uh`wjGnU1urmv1_oVqRg#=C?e?!7DgtqojU zWoAB($&53;TsXu^@2;8M`#z{=rPy?JqgYM0CDf4v@z=ZD|ItJ&8%_7A#K?S{wjxgd z?xA6JdJojrWpB7fr2p_MSsU4(R7=XGS0+Eg#xR=j>`H@R9{XjwBmqAiOxOL` zt?XK-iTEOWV}f>Pz3H-s*>W z4~8C&Xq25UQ^xH6H9kY_RM1$ch+%YLF72AA7^b{~VNTG}Tj#qZltz5Q=qxR`&oIlW Nr__JTFzvMr^FKp4S3v*( literal 0 HcmV?d00001 diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..bf33c03 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,13 @@ + + + + + DemoShowcase + + + + + + + + diff --git a/docs/main.92c15af9ae60dcc2.js b/docs/main.92c15af9ae60dcc2.js new file mode 100644 index 0000000..8d2b09a --- /dev/null +++ b/docs/main.92c15af9ae60dcc2.js @@ -0,0 +1 @@ +(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[179],{269:($y,_5,Or)=>{"use strict";var Jy={};Or.r(Jy),Or.d(Jy,{Download:()=>xY,DownloadBlob:()=>_Y,ImportJson:()=>ZEe,ImportString:()=>KEe,LazyVolume:()=>$Ee,ParseBlob:()=>UEe,ParseCcp4:()=>WEe,ParseCif:()=>VEe,ParseCube:()=>GEe,ParseDsn6:()=>YEe,ParseDx:()=>XEe,ParseJson:()=>QEe,ParsePly:()=>qEe,ParsePrmtop:()=>HEe,ParsePsf:()=>zEe,ParseTop:()=>jEe,RawData:()=>wY,ReadFile:()=>AY});var cE={};Or.r(cE),Or.d(cE,{CreateGroup:()=>JEe});var lE={};Or.r(lE),Or.d(lE,{atomicHet:()=>Nke,atomicSequence:()=>Fke,bundleElementImpl:()=>$Z,bundleGenerator:()=>JZ,defaultBondTest:()=>U4,spheres:()=>kke,water:()=>Bke});var dE={};Or.r(dE),Or.d(dE,{all:()=>rQ,atoms:()=>z4,bondedAtomicPairs:()=>Yke,chains:()=>Vke,none:()=>G4,querySelection:()=>Wke,residues:()=>Uke,rings:()=>qke});var fE={};Or.r(fE),Or.d(fE,{exceptBy:()=>KLe,expandProperty:()=>QLe,includeConnected:()=>$Le,includeSurroundings:()=>WLe,intersectBy:()=>XLe,querySelection:()=>YLe,surroundingLigands:()=>e5e,union:()=>ZLe,wholeResidues:()=>HLe});var pE={};Or.r(pE),Or.d(pE,{areIntersectedBy:()=>f5e,first:()=>c5e,getCurrentStructureProperties:()=>KA,isConnectedTo:()=>y5e,pick:()=>u5e,withSameAtomProperties:()=>d5e,within:()=>p5e});var mE={};Or.r(mE),Or.d(mE,{intersect:()=>S5e,merge:()=>b5e});var hE={};Or.r(hE),Or.d(hE,{atomCount:()=>C5e,countQuery:()=>x5e,propertySet:()=>_5e});var vE={};Or.r(vE),Or.d(vE,{CoordinatesFromDcd:()=>cze,CoordinatesFromNctraj:()=>fze,CoordinatesFromTrr:()=>dze,CoordinatesFromXtc:()=>lze,CustomModelProperties:()=>K$,CustomStructureProperties:()=>Q$,ModelFromTrajectory:()=>j$,MultiStructureSelectionFromExpression:()=>Oze,ShapeFromPly:()=>Uze,StructureComplexElement:()=>kze,StructureComplexElementTypes:()=>X$,StructureComponent:()=>Lze,StructureFromModel:()=>Pze,StructureFromTrajectory:()=>Ize,StructureSelectionFromBundle:()=>Bze,StructureSelectionFromExpression:()=>Rze,StructureSelectionFromScript:()=>Fze,TopologyFromPrmtop:()=>mze,TopologyFromPsf:()=>pze,TopologyFromTop:()=>hze,TrajectoryFromBlob:()=>gze,TrajectoryFromCifCore:()=>Tze,TrajectoryFromCube:()=>Aze,TrajectoryFromGRO:()=>Sze,TrajectoryFromMOL:()=>xze,TrajectoryFromMOL2:()=>wze,TrajectoryFromMmCif:()=>yze,TrajectoryFromModelAndCoordinates:()=>LB,TrajectoryFromPDB:()=>bze,TrajectoryFromSDF:()=>_ze,TrajectoryFromXYZ:()=>Cze,TransformStructureConformation:()=>Mze});var gE={};Or.r(gE),Or.d(gE,{AssignColorVolume:()=>$ze,VolumeFromCcp4:()=>Wze,VolumeFromCube:()=>Xze,VolumeFromDensityServerCif:()=>Zze,VolumeFromDsn6:()=>Yze,VolumeFromDx:()=>Kze,VolumeFromSegmentationCif:()=>Qze});var yE={};Or.r(yE),Or.d(yE,{BoxShape3D:()=>_qe,getBoxMesh:()=>TN});var bE={};Or.r(bE),Or.d(bE,{ClippingStructureRepresentation3DFromBundle:()=>Gqe,ClippingStructureRepresentation3DFromScript:()=>Vqe,ExplodeStructureRepresentation3D:()=>Rqe,ModelUnitcell3D:()=>qqe,OverpaintStructureRepresentation3DFromBundle:()=>Bqe,OverpaintStructureRepresentation3DFromScript:()=>Fqe,ShapeRepresentation3D:()=>jqe,SpinStructureRepresentation3D:()=>Oqe,StructureBoundingBox3D:()=>Wqe,StructureRepresentation3D:()=>BT,StructureSelectionsAngle3D:()=>Xqe,StructureSelectionsDihedral3D:()=>Kqe,StructureSelectionsDistance3D:()=>Yqe,StructureSelectionsLabel3D:()=>Zqe,StructureSelectionsOrientation3D:()=>Qqe,StructureSelectionsPlane3D:()=>$qe,SubstanceStructureRepresentation3DFromBundle:()=>Uqe,SubstanceStructureRepresentation3DFromScript:()=>Lqe,ThemeStrengthRepresentation3D:()=>zqe,TransparencyStructureRepresentation3DFromBundle:()=>kqe,TransparencyStructureRepresentation3DFromScript:()=>Nqe,UnwindStructureAssemblyRepresentation3D:()=>Mqe,VolumeRepresentation3D:()=>Hqe,VolumeRepresentation3DHelpers:()=>Bd});var SE={};Or.r(SE),Or.d(SE,{ApplyAction:()=>Ute,ClearHighlights:()=>jte,Highlight:()=>Hte,RemoveObject:()=>Vte,SetCurrentObject:()=>kte,Snapshots:()=>qte,SyncBehaviors:()=>Nte,ToggleExpanded:()=>Gte,ToggleVisibility:()=>zte,Update:()=>Lte,registerDefault:()=>pWe,setSubtreeVisibility:()=>Cy});var CE={};Or.r(CE),Or.d(CE,{SyncRepresentationToCanvas:()=>Wte,SyncStructureRepresentation3DState:()=>Yte,UpdateRepresentationVisibility:()=>Xte,registerDefault:()=>hWe});var xE={};Or.r(xE),Or.d(xE,{Focus:()=>Qte,OrientAxes:()=>$te,Reset:()=>Kte,ResetAxes:()=>Jte,SetSnapshot:()=>Zte,registerDefault:()=>vWe});var _E={};Or.r(_E),Or.d(_E,{Canvas3DSetSettings:()=>kre,registerDefault:()=>jXe});var wE={};Or.r(wE),Or.d(wE,{DefaultFocusLociBindings:()=>Ure,DefaultLociLabelProvider:()=>ZXe,DefaultSelectLociBindings:()=>Lre,FocusLoci:()=>$Xe,HighlightLoci:()=>YXe,SelectLoci:()=>KXe});var AE={};Or.r(AE),Or.d(AE,{CameraAxisHelper:()=>tKe,CameraControls:()=>nKe,DefaultClickResetCameraOnEmpty:()=>KN,DefaultClickResetCameraOnEmptySelectMode:()=>ZN,DefaultFocusLociBindings:()=>Vre,FocusLoci:()=>eKe});var TE={};Or.r(TE),Or.d(TE,{AccessibleSurfaceArea:()=>pKe,BestDatabaseSequenceMapping:()=>A$e,CrossLinkRestraint:()=>G$e,Interactions:()=>S$e,SecondaryStructure:()=>C$e,StructureInfo:()=>aKe,ValenceModel:()=>x$e});var DE={};Or.r(DE),Or.d(DE,{AddTrajectory:()=>wJe,DownloadStructure:()=>gJe,EnableModelCustomProps:()=>xJe,EnableStructureCustomProps:()=>_Je,LoadTrajectory:()=>AJe,PdbDownloadProvider:()=>yae,UpdateTrajectory:()=>CJe});var EE={};Or.r(EE),Or.d(EE,{AssignColorVolume:()=>bae,DownloadDensity:()=>TJe});var IE={};Or.r(IE),Or.d(IE,{DownloadFile:()=>DJe,OpenFiles:()=>Sae});let oo=null,bC=1;function li(e){const t=oo;return oo=e,t}function w5(e){if((!tb(e)||e.dirty)&&(e.dirty||e.lastCleanEpoch!==bC)){if(!e.producerMustRecompute(e)&&!RE(e))return e.dirty=!1,void(e.lastCleanEpoch=bC);e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=bC}}function RE(e){Xv(e);for(let t=0;t0}function Xv(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}let R5=null;function Fa(e){return"function"==typeof e}function BE(e){const r=e(n=>{Error.call(n),n.stack=(new Error).stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}const NE=BE(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:\n${r.map((n,a)=>`${a+1}) ${n.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=r});function xC(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class Xs{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(const i of r)i.remove(this);else r.remove(this);const{initialTeardown:n}=this;if(Fa(n))try{n()}catch(i){t=i instanceof NE?i.errors:[i]}const{_finalizers:a}=this;if(a){this._finalizers=null;for(const i of a)try{k5(i)}catch(o){t=t??[],o instanceof NE?t=[...t,...o.errors]:t.push(o)}}if(t)throw new NE(t)}}add(t){var r;if(t&&t!==this)if(this.closed)k5(t);else{if(t instanceof Xs){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}}_hasParent(t){const{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){const{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){const{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&xC(r,t)}remove(t){const{_finalizers:r}=this;r&&xC(r,t),t instanceof Xs&&t._removeParent(this)}}Xs.EMPTY=(()=>{const e=new Xs;return e.closed=!0,e})();const B5=Xs.EMPTY;function N5(e){return e instanceof Xs||e&&"closed"in e&&Fa(e.remove)&&Fa(e.add)&&Fa(e.unsubscribe)}function k5(e){Fa(e)?e():e.unsubscribe()}const eh={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},_C={setTimeout(e,t,...r){const{delegate:n}=_C;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=_C;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function L5(e){_C.setTimeout(()=>{const{onUnhandledError:t}=eh;if(!t)throw e;t(e)})}function kE(){}const due=LE("C",void 0,void 0);function LE(e,t,r){return{kind:e,value:t,error:r}}let th=null;function wC(e){if(eh.useDeprecatedSynchronousErrorHandling){const t=!th;if(t&&(th={errorThrown:!1,error:null}),e(),t){const{errorThrown:r,error:n}=th;if(th=null,r)throw n}}else e()}class UE extends Xs{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,N5(t)&&t.add(this)):this.destination=yue}static create(t,r,n){return new rb(t,r,n)}next(t){this.isStopped?GE(function pue(e){return LE("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?GE(function fue(e){return LE("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?GE(due,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const hue=Function.prototype.bind;function VE(e,t){return hue.call(e,t)}class vue{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){AC(n)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){AC(n)}else AC(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){AC(r)}}}class rb extends UE{constructor(t,r,n){let a;if(super(),Fa(t)||!t)a={next:t??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&eh.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),a={next:t.next&&VE(t.next,i),error:t.error&&VE(t.error,i),complete:t.complete&&VE(t.complete,i)}):a=t}this.destination=new vue(a)}}function AC(e){eh.useDeprecatedSynchronousErrorHandling?function mue(e){eh.useDeprecatedSynchronousErrorHandling&&th&&(th.errorThrown=!0,th.error=e)}(e):L5(e)}function GE(e,t){const{onStoppedNotification:r}=eh;r&&_C.setTimeout(()=>r(e,t))}const yue={closed:!0,next:kE,error:function gue(e){throw e},complete:kE},zE="function"==typeof Symbol&&Symbol.observable||"@@observable";function _p(e){return e}function U5(...e){return V5(e)}function V5(e){return 0===e.length?_p:1===e.length?e[0]:function(r){return e.reduce((n,a)=>a(n),r)}}let zi=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){const n=new e;return n.source=this,n.operator=r,n}subscribe(r,n,a){const i=function Sue(e){return e&&e instanceof UE||function bue(e){return e&&Fa(e.next)&&Fa(e.error)&&Fa(e.complete)}(e)&&N5(e)}(r)?r:new rb(r,n,a);return wC(()=>{const{operator:o,source:s}=this;i.add(o?o.call(i,s):s?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return new(n=G5(n))((a,i)=>{const o=new rb({next:s=>{try{r(s)}catch(u){i(u),o.unsubscribe()}},error:i,complete:a});this.subscribe(o)})}_subscribe(r){var n;return null===(n=this.source)||void 0===n?void 0:n.subscribe(r)}[zE](){return this}pipe(...r){return V5(r)(this)}toPromise(r){return new(r=G5(r))((n,a)=>{let i;this.subscribe(o=>i=o,o=>a(o),()=>n(i))})}}return e.create=t=>new e(t),e})();function G5(e){var t;return null!==(t=e??eh.Promise)&&void 0!==t?t:Promise}const Cue=BE(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let bn=(()=>{class e extends zi{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const n=new z5(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new Cue}next(r){wC(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const n of this.currentObservers)n.next(r)}})}error(r){wC(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;const{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){wC(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return(null===(r=this.observers)||void 0===r?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){const{hasError:n,isStopped:a,observers:i}=this;return n||a?B5:(this.currentObservers=null,i.push(r),new Xs(()=>{this.currentObservers=null,xC(i,r)}))}_checkFinalizedStatuses(r){const{hasError:n,thrownError:a,isStopped:i}=this;n?r.error(a):i&&r.complete()}asObservable(){const r=new zi;return r.source=this,r}}return e.create=(t,r)=>new z5(t,r),e})();class z5 extends bn{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,n;null===(n=null===(r=this.destination)||void 0===r?void 0:r.next)||void 0===n||n.call(r,t)}error(t){var r,n;null===(n=null===(r=this.destination)||void 0===r?void 0:r.error)||void 0===n||n.call(r,t)}complete(){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===r||r.call(t)}_subscribe(t){var r,n;return null!==(n=null===(r=this.source)||void 0===r?void 0:r.subscribe(t))&&void 0!==n?n:B5}}function H5(e){return Fa(e?.lift)}function di(e){return t=>{if(H5(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function fi(e,t,r,n,a){return new xue(e,t,r,n,a)}class xue extends UE{constructor(t,r,n,a,i,o){super(t),this.onFinalize=i,this.shouldUnsubscribe=o,this._next=r?function(s){try{r(s)}catch(u){t.error(u)}}:super._next,this._error=a?function(s){try{a(s)}catch(u){t.error(u)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(s){t.error(s)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:r}=this;super.unsubscribe(),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function $n(e,t){return di((r,n)=>{let a=0;r.subscribe(fi(n,i=>{n.next(e.call(t,i,a++))}))})}var HE=function(e,t){return(HE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])})(e,t)};function jt(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}HE(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var R=function(){return R=Object.assign||function(t){for(var r,n=1,a=arguments.length;n0&&i[i.length-1])&&(6===c[0]||2===c[0])){r=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(o){return new Promise(function(s,u){!function a(i,o,s,u){Promise.resolve(u).then(function(c){i({value:c,done:s})},o)}(s,u,(o=e[i](o)).done,o.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const Y5=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function X5(e){return Fa(e?.then)}function K5(e){return Fa(e[zE])}function Z5(e){return Symbol.asyncIterator&&Fa(e?.[Symbol.asyncIterator])}function Q5(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const $5=function Gue(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function J5(e){return Fa(e?.[$5])}function eU(e){return function q5(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a,n=r.apply(e,t||[]),i=[];return a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a;function o(f){n[f]&&(a[f]=function(p){return new Promise(function(m,h){i.push([f,p,m,h])>1||s(f,p)})})}function s(f,p){try{!function u(f){f.value instanceof wp?Promise.resolve(f.value.v).then(c,l):d(i[0][2],f)}(n[f](p))}catch(m){d(i[0][3],m)}}function c(f){s("next",f)}function l(f){s("throw",f)}function d(f,p){f(p),i.shift(),i.length&&s(i[0][0],i[0][1])}}(this,arguments,function*(){const r=e.getReader();try{for(;;){const{value:n,done:a}=yield wp(r.read());if(a)return yield wp(void 0);yield yield wp(n)}}finally{r.releaseLock()}})}function tU(e){return Fa(e?.getReader)}function _u(e){if(e instanceof zi)return e;if(null!=e){if(K5(e))return function zue(e){return new zi(t=>{const r=e[zE]();if(Fa(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(Y5(e))return function Hue(e){return new zi(t=>{for(let r=0;r{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,L5)})}(e);if(Z5(e))return rU(e);if(J5(e))return function que(e){return new zi(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(tU(e))return function Wue(e){return rU(eU(e))}(e)}throw Q5(e)}function rU(e){return new zi(t=>{(function Yue(e,t){var r,n,a,i;return ue(this,void 0,void 0,function*(){try{for(r=W5(e);!(n=yield r.next()).done;)if(t.next(n.value),t.closed)return}catch(o){a={error:o}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(a)throw a.error}}t.complete()})})(e,t).catch(r=>t.error(r))})}function Xd(e,t,r,n=0,a=!1){const i=t.schedule(function(){r(),a?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!a)return i}function bs(e,t,r=1/0){return Fa(t)?bs((n,a)=>$n((i,o)=>t(n,i,a,o))(_u(e(n,a))),r):("number"==typeof t&&(r=t),di((n,a)=>function Xue(e,t,r,n,a,i,o,s){const u=[];let c=0,l=0,d=!1;const f=()=>{d&&!u.length&&!c&&t.complete()},p=h=>c{i&&t.next(h),c++;let v=!1;_u(r(h,l++)).subscribe(fi(t,g=>{a?.(g),i?p(g):t.next(g)},()=>{v=!0},void 0,()=>{if(v)try{for(c--;u.length&&cm(g)):m(g)}f()}catch(g){t.error(g)}}))};return e.subscribe(fi(t,p,()=>{d=!0,f()})),()=>{s?.()}}(n,a,e,r)))}function TC(e=1/0){return bs(_p,e)}const kl=new zi(e=>e.complete());function nU(e){return e&&Fa(e.schedule)}function WE(e){return e[e.length-1]}function aU(e){return Fa(WE(e))?e.pop():void 0}function nb(e){return nU(WE(e))?e.pop():void 0}function iU(e,t=0){return di((r,n)=>{r.subscribe(fi(n,a=>Xd(n,e,()=>n.next(a),t),()=>Xd(n,e,()=>n.complete(),t),a=>Xd(n,e,()=>n.error(a),t)))})}function oU(e,t=0){return di((r,n)=>{n.add(e.schedule(()=>r.subscribe(n),t))})}function sU(e,t){if(!e)throw new Error("Iterable cannot be null");return new zi(r=>{Xd(r,t,()=>{const n=e[Symbol.asyncIterator]();Xd(r,t,()=>{n.next().then(a=>{a.done?r.complete():r.next(a.value)})},0,!0)})})}function So(e,t){return t?function rce(e,t){if(null!=e){if(K5(e))return function Que(e,t){return _u(e).pipe(oU(t),iU(t))}(e,t);if(Y5(e))return function Jue(e,t){return new zi(r=>{let n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}(e,t);if(X5(e))return function $ue(e,t){return _u(e).pipe(oU(t),iU(t))}(e,t);if(Z5(e))return sU(e,t);if(J5(e))return function ece(e,t){return new zi(r=>{let n;return Xd(r,t,()=>{n=e[$5](),Xd(r,t,()=>{let a,i;try{({value:a,done:i}=n.next())}catch(o){return void r.error(o)}i?r.complete():r.next(a)},0,!0)}),()=>Fa(n?.return)&&n.return()})}(e,t);if(tU(e))return function tce(e,t){return sU(eU(e),t)}(e,t)}throw Q5(e)}(e,t):_u(e)}function Ll(...e){const t=nb(e),r=function Zue(e,t){return"number"==typeof WE(e)?e.pop():t}(e,1/0),n=e;return n.length?1===n.length?_u(n[0]):TC(r)(So(n,t)):kl}class Ai extends bn{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){const{hasError:t,thrownError:r,_value:n}=this;if(t)throw r;return this._throwIfClosed(),n}next(t){super.next(this._value=t)}}function Hr(...e){return So(e,nb(e))}function YE(e={}){const{connector:t=(()=>new bn),resetOnError:r=!0,resetOnComplete:n=!0,resetOnRefCountZero:a=!0}=e;return i=>{let o,s,u,c=0,l=!1,d=!1;const f=()=>{s?.unsubscribe(),s=void 0},p=()=>{f(),o=u=void 0,l=d=!1},m=()=>{const h=o;p(),h?.unsubscribe()};return di((h,v)=>{c++,!d&&!l&&f();const g=u=u??t();v.add(()=>{c--,0===c&&!d&&!l&&(s=XE(m,a))}),g.subscribe(v),!o&&c>0&&(o=new rb({next:y=>g.next(y),error:y=>{d=!0,f(),s=XE(p,r,y),g.error(y)},complete:()=>{l=!0,f(),s=XE(p,n),g.complete()}}),_u(h).subscribe(o))})(i)}}function XE(e,t,...r){if(!0===t)return void e();if(!1===t)return;const n=new rb({next:()=>{n.unsubscribe(),e()}});return _u(t(...r)).subscribe(n)}function nc(e,t){return di((r,n)=>{let a=null,i=0,o=!1;const s=()=>o&&!a&&n.complete();r.subscribe(fi(n,u=>{a?.unsubscribe();let c=0;const l=i++;_u(e(u,l)).subscribe(a=fi(n,d=>n.next(t?t(u,d,l,c++):d),()=>{a=null,s()}))},()=>{o=!0,s()}))})}function uU(e,t=_p){return e=e??nce,di((r,n)=>{let a,i=!0;r.subscribe(fi(n,o=>{const s=t(o);(i||!e(a,s))&&(i=!1,a=s,n.next(o))}))})}function nce(e,t){return e===t}function aa(e){for(let t in e)if(e[t]===aa)return t;throw Error("Could not find renamed property on target object.")}function Hi(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Hi).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function KE(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const ace=aa({__forward_ref__:aa});function ZE(e){return e.__forward_ref__=ZE,e.toString=function(){return Hi(this())},e}function Er(e){return EC(e)?e():e}function EC(e){return"function"==typeof e&&e.hasOwnProperty(ace)&&e.__forward_ref__===ZE}function QE(e){return e&&!!e.\u0275providers}class Ot extends Error{constructor(t,r){super(function Kv(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,r)),this.code=t}}const ab=aa({\u0275cmp:aa}),$E=aa({\u0275dir:aa}),JE=aa({\u0275pipe:aa}),lU=aa({\u0275mod:aa}),Kd=aa({\u0275fac:aa}),ib=aa({__NG_ELEMENT_ID__:aa}),dU=aa({__NG_ENV_ID__:aa});function kr(e){return"string"==typeof e?e:null==e?"":String(e)}function eI(e,t){throw new Ot(-201,!1)}function Ks(e,t){null==e&&function Ir(e,t,r,n){throw new Error(`ASSERTION ERROR: ${e}`+(null==n?"":` [Expected=> ${r} ${n} ${t} <=Actual]`))}(t,e,null,"!=")}function Ar(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function IC(e){return{providers:e.providers||[],imports:e.imports||[]}}function PC(e){return fU(e,RC)||fU(e,pU)}function fU(e,t){return e.hasOwnProperty(t)?e[t]:null}function MC(e){return e&&(e.hasOwnProperty(tI)||e.hasOwnProperty(pce))?e[tI]:null}const RC=aa({\u0275prov:aa}),tI=aa({\u0275inj:aa}),pU=aa({ngInjectableDef:aa}),pce=aa({ngInjectorDef:aa});var pn=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(pn||{});let rI;function Zs(e){const t=rI;return rI=e,t}function hU(e,t,r){const n=PC(e);return n&&"root"==n.providedIn?void 0===n.value?n.value=n.factory():n.value:r&pn.Optional?null:void 0!==t?t:void eI(Hi(e))}const _a=globalThis;class sr{constructor(t,r){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof r?this.__NG_ELEMENT_ID__=r:void 0!==r&&(this.\u0275prov=Ar({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}const ob={},sI="__NG_DI_FLAG__",OC="ngTempTokenPath",vce=/\n/gm,gU="__source";let Zv;function Tp(e){const t=Zv;return Zv=e,t}function bce(e,t=pn.Default){if(void 0===Zv)throw new Ot(-203,!1);return null===Zv?hU(e,void 0,t):Zv.get(e,t&pn.Optional?null:void 0,t)}function an(e,t=pn.Default){return(function mU(){return rI}()||bce)(Er(e),t)}function Yt(e,t=pn.Default){return an(e,FC(t))}function FC(e){return typeof e>"u"||"number"==typeof e?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function uI(e){const t=[];for(let r=0;rt){o=i-1;break}}}for(;ii?"":a[d+1].toLowerCase();const p=8&n?f:null;if(p&&-1!==bU(p,c,0)||2&n&&c!==f){if(Jc(n))return!1;o=!0}}}}else{if(!o&&!Jc(n)&&!Jc(u))return!1;if(o&&Jc(u))continue;o=!1,n=u|1&n}}return Jc(n)||o}function Jc(e){return 0==(1&e)}function Tce(e,t,r,n){if(null===t)return-1;let a=0;if(n||!r){let i=!1;for(;a-1)for(r++;r0?'="'+s+'"':"")+"]"}else 8&n?a+="."+o:4&n&&(a+=" "+o);else""!==a&&!Jc(o)&&(t+=TU(i,a),a=""),n=o,i=i||!Jc(n);r++}return""!==a&&(t+=TU(i,a)),t}function NC(e){return Zd(()=>{const t=EU(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===BC.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||$c.Emulated,styles:e.styles||Nn,_:null,schemas:e.schemas||null,tView:null,id:""};IU(r);const n=e.dependencies;return r.directiveDefs=kC(n,!1),r.pipeDefs=kC(n,!0),r.id=function kce(e){let t=0;const r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const a of r)t=Math.imul(31,t)+a.charCodeAt(0)<<0;return t+=2147483648,"c"+t}(r),r})}function Fce(e){return cn(e)||so(e)}function Bce(e){return null!==e}function lI(e){return Zd(()=>({type:e.type,bootstrap:e.bootstrap||Nn,declarations:e.declarations||Nn,imports:e.imports||Nn,exports:e.exports||Nn,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function DU(e,t){if(null==e)return Ul;const r={};for(const n in e)if(e.hasOwnProperty(n)){let a=e[n],i=a;Array.isArray(a)&&(i=a[1],a=a[0]),r[a]=n,t&&(t[a]=i)}return r}function Ss(e){return Zd(()=>{const t=EU(e);return IU(t),t})}function cn(e){return e[ab]||null}function so(e){return e[$E]||null}function ko(e){return e[JE]||null}function Xo(e,t){const r=e[lU]||null;if(!r&&!0===t)throw new Error(`Type ${Hi(e)} does not have '\u0275mod' property.`);return r}function EU(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Ul,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||Nn,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:DU(e.inputs,t),outputs:DU(e.outputs),debugInfo:null}}function IU(e){e.features?.forEach(t=>t(e))}function kC(e,t){if(!e)return null;const r=t?ko:Fce;return()=>("function"==typeof e?e():e).map(n=>r(n)).filter(Bce)}const pi=0,Ft=1,br=2,qa=3,el=4,Ko=5,Vl=6,Qv=7,va=8,Cs=9,$v=10,Lr=11,cb=12,PU=13,Jv=14,ni=15,lb=16,eg=17,Gl=18,db=19,MU=20,Ep=21,LC=22,rh=23,Ur=25,dI=1,zl=7,tg=9,Ti=10;var rg=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e[e.HasChildViewsToRefresh=4]="HasChildViewsToRefresh",e}(rg||{});function Lo(e){return Array.isArray(e)&&"object"==typeof e[dI]}function Co(e){return Array.isArray(e)&&!0===e[dI]}function fI(e){return 0!=(4&e.flags)}function nh(e){return e.componentOffset>-1}function tl(e){return!!e.template}function pI(e){return 0!=(512&e[br])}function ah(e,t){return e.hasOwnProperty(Kd)?e[Kd]:null}class Gce{constructor(t,r,n){this.previousValue=t,this.currentValue=r,this.firstChange=n}isFirstChange(){return this.firstChange}}function ih(){return BU}function BU(e){return e.type.prototype.ngOnChanges&&(e.setInput=Hce),zce}function zce(){const e=kU(this),t=e?.current;if(t){const r=e.previous;if(r===Ul)e.previous=t;else for(let n in t)r[n]=t[n];e.current=null,this.ngOnChanges(t)}}function Hce(e,t,r,n){const a=this.declaredInputs[r],i=kU(e)||function jce(e,t){return e[NU]=t}(e,{previous:Ul,current:null}),o=i.current||(i.current={}),s=i.previous,u=s[a];o[a]=new Gce(u&&u.currentValue,t,s===Ul),e[n]=t}ih.ngInherit=!0;const NU="__ngSimpleChanges__";function kU(e){return e[NU]||null}const Hl=function(e,t,r){};function wa(e){for(;Array.isArray(e);)e=e[pi];return e}function xs(e,t){return wa(t[e.index])}function mb(e,t){return e.data[t]}function Au(e,t){const r=t[e];return Lo(r)?r:r[pi]}function yI(e){return 128==(128&e[br])}function jl(e,t){return null==t?null:e[t]}function VU(e){e[eg]=0}function Kce(e){1024&e[br]||(e[br]|=1024,yI(e)&&GC(e))}function zU(e){return 9216&e[br]||e[rh]?.dirty}function HU(e){zU(e)&&GC(e)}function GC(e){let t=e[qa];for(;null!==t&&!(Co(t)&&t[br]&rg.HasChildViewsToRefresh||Lo(t)&&8192&t[br]);){if(Co(t))t[br]|=rg.HasChildViewsToRefresh;else if(t[br]|=8192,!yI(t))break;t=t[qa]}}const Mr={lFrame:JU(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function qU(){return Mr.bindingsEnabled}function ct(){return Mr.lFrame.lView}function wn(){return Mr.lFrame.tView}function la(){let e=WU();for(;null!==e&&64===e.type;)e=e.parent;return e}function WU(){return Mr.lFrame.currentTNode}function ql(e,t){const r=Mr.lFrame;r.currentTNode=e,r.isParent=t}function SI(){return Mr.lFrame.isParent}function Wl(){return Mr.lFrame.bindingIndex++}function ule(e,t){const r=Mr.lFrame;r.bindingIndex=r.bindingRootIndex=e,xI(t)}function xI(e){Mr.lFrame.currentDirectiveIndex=e}function ZU(){return Mr.lFrame.currentQueryIndex}function wI(e){Mr.lFrame.currentQueryIndex=e}function lle(e){const t=e[Ft];return 2===t.type?t.declTNode:1===t.type?e[Ko]:null}function QU(e,t,r){if(r&pn.SkipSelf){let a=t,i=e;for(;!(a=a.parent,null!==a||r&pn.Host||(a=lle(i),null===a||(i=i[Jv],10&a.type))););if(null===a)return!1;t=a,e=i}const n=Mr.lFrame=$U();return n.currentTNode=t,n.lView=e,!0}function AI(e){const t=$U(),r=e[Ft];Mr.lFrame=t,t.currentTNode=r.firstChild,t.lView=e,t.tView=r,t.contextLView=e,t.bindingIndex=r.bindingStartIndex,t.inI18n=!1}function $U(){const e=Mr.lFrame,t=null===e?null:e.child;return null===t?JU(e):t}function JU(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function e6(){const e=Mr.lFrame;return Mr.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const t6=e6;function TI(){const e=e6();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Zo(){return Mr.lFrame.selectedIndex}function oh(e){Mr.lFrame.selectedIndex=e}let n6=!0;function HC(){return n6}function Ip(e){n6=e}function jC(e,t){for(let r=t.directiveStart,n=t.directiveEnd;r=n)break}else t[u]<0&&(e[eg]+=65536),(s>14>16&&(3&e[br])===t&&(e[br]+=16384,i6(s,i)):i6(s,i)}const ig=-1;class vb{constructor(t,r,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=n}}function II(e){return e!==ig}function gb(e){return 32767&e}function yb(e,t){let r=function xle(e){return e>>16}(e),n=t;for(;r>0;)n=n[Jv],r--;return n}let PI=!0;function YC(e){const t=PI;return PI=e,t}const o6=255,s6=5;let _le=0;const Yl={};function XC(e,t){const r=u6(e,t);if(-1!==r)return r;const n=t[Ft];n.firstCreatePass&&(e.injectorIndex=t.length,MI(n.data,e),MI(t,null),MI(n.blueprint,null));const a=KC(e,t),i=e.injectorIndex;if(II(a)){const o=gb(a),s=yb(a,t),u=s[Ft].data;for(let c=0;c<8;c++)t[i+c]=s[o+c]|u[o+c]}return t[i+8]=a,i}function MI(e,t){e.push(0,0,0,0,0,0,0,0,t)}function u6(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function KC(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let r=0,n=null,a=t;for(;null!==a;){if(n=h6(a),null===n)return ig;if(r++,a=a[Jv],-1!==n.injectorIndex)return n.injectorIndex|r<<16}return ig}function RI(e,t,r){!function wle(e,t,r){let n;"string"==typeof r?n=r.charCodeAt(0)||0:r.hasOwnProperty(ib)&&(n=r[ib]),null==n&&(n=r[ib]=_le++);const a=n&o6;t.data[e+(a>>s6)]|=1<=0?t&o6:Ele:t}(r);if("function"==typeof i){if(!QU(t,e,n))return n&pn.Host?c6(a,0,n):l6(t,r,n,a);try{let o;if(o=i(n),null!=o||n&pn.Optional)return o;eI()}finally{t6()}}else if("number"==typeof i){let o=null,s=u6(e,t),u=ig,c=n&pn.Host?t[ni][Ko]:null;for((-1===s||n&pn.SkipSelf)&&(u=-1===s?KC(e,t):t[s+8],u!==ig&&m6(n,!1)?(o=t[Ft],s=gb(u),t=yb(u,t)):s=-1);-1!==s;){const l=t[Ft];if(p6(i,s,l.data)){const d=Tle(s,t,r,o,n,c);if(d!==Yl)return d}u=t[s+8],u!==ig&&m6(n,t[Ft].data[s+8]===c)&&p6(i,s,t)?(o=l,s=gb(u),t=yb(u,t)):s=-1}}return a}function Tle(e,t,r,n,a,i){const o=t[Ft],s=o.data[e+8],l=ZC(s,o,r,null==n?nh(s)&&PI:n!=o&&0!=(3&s.type),a&pn.Host&&i===s);return null!==l?sh(t,o,l,s):Yl}function ZC(e,t,r,n,a){const i=e.providerIndexes,o=t.data,s=1048575&i,u=e.directiveStart,l=i>>20,f=a?s+l:e.directiveEnd;for(let p=n?s:s+l;p=u&&m.type===r)return p}if(a){const p=o[u];if(p&&tl(p)&&p.type===r)return u}return null}function sh(e,t,r,n){let a=e[r];const i=t.data;if(function yle(e){return e instanceof vb}(a)){const o=a;o.resolving&&function oce(e,t){const r=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new Ot(-200,`Circular dependency in DI detected for ${e}${r}`)}(function jn(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():kr(e)}(i[r]));const s=YC(o.canSeeViewProviders);o.resolving=!0;const c=o.injectImpl?Zs(o.injectImpl):null;QU(e,n,pn.Default);try{a=e[r]=o.factory(void 0,i,e,n),t.firstCreatePass&&r>=n.directiveStart&&function vle(e,t,r){const{ngOnChanges:n,ngOnInit:a,ngDoCheck:i}=t.type.prototype;if(n){const o=BU(t);(r.preOrderHooks??=[]).push(e,o),(r.preOrderCheckHooks??=[]).push(e,o)}a&&(r.preOrderHooks??=[]).push(0-e,a),i&&((r.preOrderHooks??=[]).push(e,i),(r.preOrderCheckHooks??=[]).push(e,i))}(r,i[r],t)}finally{null!==c&&Zs(c),YC(s),o.resolving=!1,t6()}}return a}function p6(e,t,r){return!!(r[t+(e>>s6)]&1<{const t=e.prototype.constructor,r=t[Kd]||FI(t),n=Object.prototype;let a=Object.getPrototypeOf(e.prototype).constructor;for(;a&&a!==n;){const i=a[Kd]||FI(a);if(i&&i!==r)return i;a=Object.getPrototypeOf(a)}return i=>new i})}function FI(e){return EC(e)?()=>{const t=FI(Er(e));return t&&t()}:ah(e)}function h6(e){const t=e[Ft],r=t.type;return 2===r?t.declTNode:1===r?e[Ko]:null}function pg(e,t){e.forEach(r=>Array.isArray(r)?pg(r,t):t(r))}function g6(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function $C(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}const vg=new sr("ENVIRONMENT_INITIALIZER"),_6=new sr("INJECTOR",-1),zI=new sr("INJECTOR_DEF_TYPES");class tx{get(t,r=ob){if(r===ob){const n=new Error(`NullInjectorError: No provider for ${Hi(t)}!`);throw n.name="NullInjectorError",n}return r}}function HI(e){return{\u0275providers:e}}function Qle(...e){return{\u0275providers:w6(0,e),\u0275fromNgModule:!0}}function w6(e,...t){const r=[],n=new Set;let a;const i=o=>{r.push(o)};return pg(t,o=>{const s=o;rx(s,i,[],n)&&(a||=[],a.push(s))}),void 0!==a&&A6(a,i),r}function A6(e,t){for(let r=0;r{t(i,n)})}}function rx(e,t,r,n){if(!(e=Er(e)))return!1;let a=null,i=MC(e);const o=!i&&cn(e);if(i||o){if(o&&!o.standalone)return!1;a=e}else{const u=e.ngModule;if(i=MC(u),!i)return!1;a=u}const s=n.has(a);if(o){if(s)return!1;if(n.add(a),o.dependencies){const u="function"==typeof o.dependencies?o.dependencies():o.dependencies;for(const c of u)rx(c,t,r,n)}}else{if(!i)return!1;{if(null!=i.imports&&!s){let c;n.add(a);try{pg(i.imports,l=>{rx(l,t,r,n)&&(c||=[],c.push(l))})}finally{}void 0!==c&&A6(c,t)}if(!s){const c=ah(a)||(()=>new a);t({provide:a,useFactory:c,deps:Nn},a),t({provide:zI,useValue:a,multi:!0},a),t({provide:vg,useValue:()=>an(a),multi:!0},a)}const u=i.providers;if(null!=u&&!s){const c=e;jI(u,l=>{t(l,c)})}}}return a!==e&&void 0!==e.providers}function jI(e,t){for(let r of e)QE(r)&&(r=r.\u0275providers),Array.isArray(r)?jI(r,t):t(r)}const $le=aa({provide:String,useValue:aa});function qI(e){return null!==e&&"object"==typeof e&&$le in e}function uh(e){return"function"==typeof e}const WI=new sr("Set Injector scope."),nx={},ede={};let YI;function ax(){return void 0===YI&&(YI=new tx),YI}class rl{}class gg extends rl{get destroyed(){return this._destroyed}constructor(t,r,n,a){super(),this.parent=r,this.source=n,this.scopes=a,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,KI(t,o=>this.processProvider(o)),this.records.set(_6,yg(void 0,this)),a.has("environment")&&this.records.set(rl,yg(void 0,this));const i=this.records.get(WI);null!=i&&"string"==typeof i.value&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(zI,Nn,pn.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const t=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear()}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const r=Tp(this),n=Zs(void 0);try{return t()}finally{Tp(r),Zs(n)}}get(t,r=ob,n=pn.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(dU))return t[dU](this);n=FC(n);const i=Tp(this),o=Zs(void 0);try{if(!(n&pn.SkipSelf)){let u=this.records.get(t);if(void 0===u){const c=function ide(e){return"function"==typeof e||"object"==typeof e&&e instanceof sr}(t)&&PC(t);u=c&&this.injectableDefInScope(c)?yg(XI(t),nx):null,this.records.set(t,u)}if(null!=u)return this.hydrate(t,u)}return(n&pn.Self?ax():this.parent).get(t,r=n&pn.Optional&&r===ob?null:r)}catch(s){if("NullInjectorError"===s.name){if((s[OC]=s[OC]||[]).unshift(Hi(t)),i)throw s;return function Cce(e,t,r,n){const a=e[OC];throw t[gU]&&a.unshift(t[gU]),e.message=function xce(e,t,r,n=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let a=Hi(t);if(Array.isArray(t))a=t.map(Hi).join(" -> ");else if("object"==typeof t){let i=[];for(let o in t)if(t.hasOwnProperty(o)){let s=t[o];i.push(o+":"+("string"==typeof s?JSON.stringify(s):Hi(s)))}a=`{${i.join(", ")}}`}return`${r}${n?"("+n+")":""}[${a}]: ${e.replace(vce,"\n ")}`}("\n"+e.message,a,r,n),e.ngTokenPath=a,e[OC]=null,e}(s,t,"R3InjectorError",this.source)}throw s}finally{Zs(o),Tp(i)}}resolveInjectorInitializers(){const t=Tp(this),r=Zs(void 0);try{const a=this.get(vg,Nn,pn.Self);for(const i of a)i()}finally{Tp(t),Zs(r)}}toString(){const t=[],r=this.records;for(const n of r.keys())t.push(Hi(n));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Ot(205,!1)}processProvider(t){let r=uh(t=Er(t))?t:Er(t&&t.provide);const n=function rde(e){return qI(e)?yg(void 0,e.useValue):yg(function E6(e,t,r){let n;if(uh(e)){const a=Er(e);return ah(a)||XI(a)}if(qI(e))n=()=>Er(e.useValue);else if(function D6(e){return!(!e||!e.useFactory)}(e))n=()=>e.useFactory(...uI(e.deps||[]));else if(function T6(e){return!(!e||!e.useExisting)}(e))n=()=>an(Er(e.useExisting));else{const a=Er(e&&(e.useClass||e.provide));if(!function nde(e){return!!e.deps}(e))return ah(a)||XI(a);n=()=>new a(...uI(e.deps))}return n}(e),nx)}(t);if(uh(t)||!0!==t.multi)this.records.get(r);else{let a=this.records.get(r);a||(a=yg(void 0,nx,!0),a.factory=()=>uI(a.multi),this.records.set(r,a)),r=t,a.multi.push(t)}this.records.set(r,n)}hydrate(t,r){return r.value===nx&&(r.value=ede,r.value=r.factory()),"object"==typeof r.value&&r.value&&function ade(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}injectableDefInScope(t){if(!t.providedIn)return!1;const r=Er(t.providedIn);return"string"==typeof r?"any"===r||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(t){const r=this._onDestroyHooks.indexOf(t);-1!==r&&this._onDestroyHooks.splice(r,1)}}function XI(e){const t=PC(e),r=null!==t?t.factory:ah(e);if(null!==r)return r;if(e instanceof sr)throw new Ot(204,!1);if(e instanceof Function)return function tde(e){const t=e.length;if(t>0)throw function Sb(e,t){const r=[];for(let n=0;nr.factory(e):()=>new e}(e);throw new Ot(204,!1)}function yg(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function KI(e,t){for(const r of e)Array.isArray(r)?KI(r,t):r&&QE(r)?KI(r.\u0275providers,t):t(r)}function bg(e,t){e instanceof gg&&e.assertNotDestroyed();const n=Tp(e),a=Zs(void 0);try{return t()}finally{Tp(n),Zs(a)}}function R6(e,t=null,r=null,n){const a=O6(e,t,r,n);return a.resolveInjectorInitializers(),a}function O6(e,t=null,r=null,n,a=new Set){const i=[r||Nn,Qle(e)];return n=n||("object"==typeof e?void 0:Hi(e)),new gg(i,t||ax(),n||null,a)}let $I,ac=(()=>{class e{static#e=this.THROW_IF_NOT_FOUND=ob;static#t=this.NULL=new tx;static create(r,n){if(Array.isArray(r))return R6({name:""},n,r,"");{const a=r.name??"";return R6({name:a},r.parent,r.providers,a)}}static#r=this.\u0275prov=Ar({token:e,providedIn:"any",factory:()=>an(_6)});static#n=this.__NG_ELEMENT_ID__=-1}return e})();const JI=new sr("AppId",{providedIn:"root",factory:()=>mde}),mde="ng",B6=new sr("Platform Initializer"),Sg=new sr("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),N6=new sr("CSP nonce",{providedIn:"root",factory:()=>function Mp(){if(void 0!==$I)return $I;if(typeof document<"u")return document;throw new Ot(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});function Du(e){return e instanceof Function?e():e}function cx(e){return 128==(128&e.flags)}var Fp=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Fp||{});const a3=new Map;let Dde=0;const o3="__ngContext__";function Qo(e,t){Lo(t)?(e[o3]=t[db],function Ide(e){a3.set(e[db],e)}(t)):e[o3]=t}let s3;function u3(e,t){return s3(e,t)}function Tb(e){const t=e[qa];return Co(t)?t[qa]:t}function e8(e){return r8(e[cb])}function t8(e){return r8(e[el])}function r8(e){for(;null!==e&&!Co(e);)e=e[el];return e}function xg(e,t,r,n,a){if(null!=n){let i,o=!1;Co(n)?i=n:Lo(n)&&(o=!0,n=n[pi]);const s=wa(n);0===e&&null!==r?null==a?o8(t,r,s):ch(t,r,s,a||null,!0):1===e&&null!==r?ch(t,r,s,a||null,!0):2===e?function vx(e,t,r){const n=mx(e,t);n&&function Xde(e,t,r,n){e.removeChild(t,r,n)}(e,n,t,r)}(t,s,o):3===e&&t.destroyNode(s),null!=i&&function Qde(e,t,r,n,a){const i=r[zl];i!==wa(r)&&xg(t,e,n,i,a);for(let s=Ti;s0&&(e[r-1][el]=n[el]);const i=$C(e,Ti+t);!function Vde(e,t){Ib(e,t,t[Lr],2,null,null),t[pi]=null,t[Ko]=null}(n[Ft],n);const o=i[Gl];null!==o&&o.detachView(i[Ft]),n[qa]=null,n[el]=null,n[br]&=-129}return n}function px(e,t){if(!(256&t[br])){const r=t[Lr];t[rh]&&function I5(e){if(Xv(e),tb(e))for(let t=0;t=0?n[o]():n[-o].unsubscribe(),i+=2}else r[i].call(n[r[i+1]]);null!==n&&(t[Qv]=null);const a=t[Ep];if(null!==a){t[Ep]=null;for(let i=0;i-1){const{encapsulation:i}=e.data[n.directiveStart+a];if(i===$c.None||i===$c.Emulated)return null}return xs(n,r)}}(e,t.parent,r)}function ch(e,t,r,n,a){e.insertBefore(t,r,n,a)}function o8(e,t,r){e.appendChild(t,r)}function s8(e,t,r,n,a){null!==n?ch(e,t,r,n,a):o8(e,t,r)}function mx(e,t){return e.parentNode(t)}let f3,l8=function c8(e,t,r){return 40&e.type?xs(e,r):null};function hx(e,t,r,n){const a=d3(e,n,t),i=t[Lr],s=function u8(e,t,r){return l8(e,t,r)}(n.parent||t[Ko],n,t);if(null!=a)if(Array.isArray(r))for(let u=0;unull;function E3(e,t,r=!1){return P8(e,t,r)}class Ofe{}class O8{}class Bfe{resolveComponentFactory(t){throw function Ffe(e){const t=Error(`No component factory found for ${Hi(e)}.`);return t.ngComponent=e,t}(t)}}let Ax=(()=>{class e{static#e=this.NULL=new Bfe}return e})();function Nfe(){return Dg(la(),ct())}function Dg(e,t){return new Np(xs(e,t))}let Np=(()=>{class e{constructor(r){this.nativeElement=r}static#e=this.__NG_ELEMENT_ID__=Nfe}return e})();function kfe(e){return e instanceof Np?e.nativeElement:e}class B8{}let Ufe=(()=>{class e{static#e=this.\u0275prov=Ar({token:e,providedIn:"root",factory:()=>null})}return e})();class Dx{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Vfe=new Dx("17.0.5"),M3={};function Nb(e,t,r,n,a=!1){for(;null!==r;){const i=t[r.index];null!==i&&n.push(wa(i)),Co(i)&&H8(i,n);const o=r.type;if(8&o)Nb(e,t,r.child,n);else if(32&o){const s=u3(r,t);let u;for(;u=s();)n.push(u)}else if(16&o){const s=f8(t,r);if(Array.isArray(s))n.push(...s);else{const u=Tb(t[ni]);Nb(u[Ft],u,s,n,!0)}}r=a?r.projectionNext:r.next}return n}function H8(e,t){for(let r=Ti;r!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{},consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{GC(e.lView)},consumerOnSignalRead(){this.lView[rh]=this}};function O3(e){return e.ngOriginalError}class ef{constructor(){this._console=console}handleError(t){const r=this._findOriginalError(t);this._console.error("ERROR",t),r&&this._console.error("ORIGINAL ERROR",r)}_findOriginalError(t){let r=t&&O3(t);for(;r&&O3(r);)r=O3(r);return r||null}}const Y8=new sr("",{providedIn:"root",factory:()=>!1}),jr={};function F3(e){Q8(wn(),ct(),Zo()+e,!1)}function Q8(e,t,r,n){if(!n)if(3==(3&t[br])){const i=e.preOrderCheckHooks;null!==i&&qC(t,i,r)}else{const i=e.preOrderHooks;null!==i&&WC(t,i,0,r)}oh(r)}function Pr(e,t=pn.Default){const r=ct();return null===r?an(e,t):d6(la(),r,Er(e),t)}function Mx(e,t,r,n,a,i,o,s,u,c,l){const d=t.blueprint.slice();return d[pi]=a,d[br]=140|n,(null!==c||e&&2048&e[br])&&(d[br]|=2048),VU(d),d[qa]=d[Jv]=e,d[va]=r,d[$v]=o||e&&e[$v],d[Lr]=s||e&&e[Lr],d[Cs]=u||e&&e[Cs]||null,d[Ko]=i,d[db]=function Ede(){return Dde++}(),d[Vl]=l,d[MU]=c,d[ni]=2==t.type?e[ni]:d,d}function Eg(e,t,r,n,a){let i=e.data[t];if(null===i)i=function B3(e,t,r,n,a){const i=WU(),o=SI(),u=e.data[t]=function mpe(e,t,r,n,a,i){let o=t?t.injectorIndex:-1,s=0;return function ag(){return null!==Mr.skipHydrationRootTNode}()&&(s|=128),{type:r,index:n,insertBeforeIndex:null,injectorIndex:o,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:s,providerIndexes:0,value:a,attrs:i,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,o?i:i&&i.parent,r,t,n,a);return null===e.firstChild&&(e.firstChild=u),null!==i&&(o?null==i.child&&null!==u.parent&&(i.child=u):null===i.next&&(i.next=u,u.prev=i)),u}(e,t,r,n,a),function sle(){return Mr.lFrame.inI18n}()&&(i.flags|=32);else if(64&i.type){i.type=r,i.value=n,i.attrs=a;const o=function hb(){const e=Mr.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}();i.injectorIndex=null===o?-1:o.injectorIndex}return ql(i,!0),i}function kb(e,t,r,n){if(0===r)return-1;const a=t.length;for(let i=0;iUr&&Q8(e,t,Ur,!1),Hl(o?2:0,a),r(n,a)}finally{oh(i),Hl(o?3:1,a)}}function N3(e,t,r){if(fI(t)){const n=li(null);try{const i=t.directiveEnd;for(let o=t.directiveStart;onull;function tV(e,t,r,n){for(let a in e)if(e.hasOwnProperty(a)){r=null===r?{}:r;const i=e[a];null===n?rV(r,t,a,i):n.hasOwnProperty(a)&&rV(r,t,n[a],i)}return r}function rV(e,t,r,n){e.hasOwnProperty(r)?e[r].push(t,n):e[r]=[t,n]}function nV(e,t,r,n,a,i){for(let c=0;c0;){const r=e[--t];if("number"==typeof r&&r<0)return r}return 0})(o)!=s&&o.push(s),o.push(r,n,i)}}(e,t,n,kb(e,r,a.hostVars,jr),a)}function Ipe(e,t,r,n,a,i){const o=i[t];if(null!==o)for(let s=0;se.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}(s,o),function Jfe(e){e.lView[rh]!==e&&(e.lView=null,j8.push(e))}(s)),TI()}}function fV(e,t){for(let r=e8(e);null!==r;r=t8(r)){r[br]&=~rg.HasChildViewsToRefresh;for(let n=Ti;n-1&&(Db(t,n),$C(r,n))}this._attachedToViewContainer=!1}px(this._lView[Ft],this._lView)}onDestroy(t){!function zC(e,t){if(256==(256&e[br]))throw new Ot(911,!1);null===e[Ep]&&(e[Ep]=[]),e[Ep].push(t)}(this._lView,t)}markForCheck(){Lb(this._cdRefInjectingView||this._lView)}detach(){this._lView[br]&=-129}reattach(){HU(this._lView),this._lView[br]|=128}detectChanges(){q3(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ot(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function zde(e,t){Ib(e,t,t[Lr],2,null,null)}(this._lView[Ft],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Ot(902,!1);this._appRef=t}}let Fx=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=Npe}return e})();function Npe(e){return function kpe(e,t,r){if(nh(e)&&!r){const n=Au(e.index,t);return new Ub(n,n)}return 47&e.type?new Ub(t[ni],t):null}(la(),ct(),16==(16&e))}const vV=new Set;function Y3(e){return t=>{setTimeout(e,void 0,t)}}const Uo=class Ype extends bn{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,r,n){let a=t,i=r||(()=>null),o=n;if(t&&"object"==typeof t){const u=t;a=u.next?.bind(u),i=u.error?.bind(u),o=u.complete?.bind(u)}this.__isAsync&&(i=Y3(i),a&&(a=Y3(a)),o&&(o=Y3(o)));const s=super.subscribe({next:a,error:i,complete:o});return t instanceof Xs&&t.add(s),s}};function gV(...e){}class ga{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Uo(!1),this.onMicrotaskEmpty=new Uo(!1),this.onStable=new Uo(!1),this.onError=new Uo(!1),typeof Zone>"u")throw new Ot(908,!1);Zone.assertZonePatched();const a=this;a._nesting=0,a._outer=a._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(a._inner=a._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(a._inner=a._inner.fork(Zone.longStackTraceZoneSpec)),a.shouldCoalesceEventChangeDetection=!n&&r,a.shouldCoalesceRunChangeDetection=n,a.lastRequestAnimationFrameId=-1,a.nativeRequestAnimationFrame=function Xpe(){const e="function"==typeof _a.requestAnimationFrame;let t=_a[e?"requestAnimationFrame":"setTimeout"],r=_a[e?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&t&&r){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const a=r[Zone.__symbol__("OriginalDelegate")];a&&(r=a)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:r}}().nativeRequestAnimationFrame,function Qpe(e){const t=()=>{!function Zpe(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(_a,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,K3(e),e.isCheckStableRunning=!0,X3(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),K3(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(r,n,a,i,o,s)=>{if(function Jpe(e){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0].data?.__ignore_ng_zone__}(s))return r.invokeTask(a,i,o,s);try{return yV(e),r.invokeTask(a,i,o,s)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===i.type||e.shouldCoalesceRunChangeDetection)&&t(),bV(e)}},onInvoke:(r,n,a,i,o,s,u)=>{try{return yV(e),r.invoke(a,i,o,s,u)}finally{e.shouldCoalesceRunChangeDetection&&t(),bV(e)}},onHasTask:(r,n,a,i)=>{r.hasTask(a,i),n===a&&("microTask"==i.change?(e._hasPendingMicrotasks=i.microTask,K3(e),X3(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(r,n,a,i)=>(r.handleError(a,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}(a)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!ga.isInAngularZone())throw new Ot(909,!1)}static assertNotInAngularZone(){if(ga.isInAngularZone())throw new Ot(909,!1)}run(t,r,n){return this._inner.run(t,r,n)}runTask(t,r,n,a){const i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+a,t,Kpe,gV,gV);try{return i.runTask(o,r,n)}finally{i.cancelTask(o)}}runGuarded(t,r,n){return this._inner.runGuarded(t,r,n)}runOutsideAngular(t){return this._outer.run(t)}}const Kpe={};function X3(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function K3(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function yV(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function bV(e){e._nesting--,X3(e)}const SV=new sr("",{providedIn:"root",factory:CV});function CV(){const e=Yt(ga);let t=!0;return Ll(new zi(a=>{t=e.isStable&&!e.hasPendingMacrotasks&&!e.hasPendingMicrotasks,e.runOutsideAngular(()=>{a.next(t),a.complete()})}),new zi(a=>{let i;e.runOutsideAngular(()=>{i=e.onStable.subscribe(()=>{ga.assertNotInAngularZone(),queueMicrotask(()=>{!t&&!e.hasPendingMacrotasks&&!e.hasPendingMicrotasks&&(t=!0,a.next(!0))})})});const o=e.onUnstable.subscribe(()=>{ga.assertInAngularZone(),t&&(t=!1,e.runOutsideAngular(()=>{a.next(!1)}))});return()=>{i.unsubscribe(),o.unsubscribe()}}).pipe(YE()))}let Bx=(()=>{class e{constructor(){this.renderDepth=0,this.handler=null,this.internalCallbacks=[]}begin(){this.handler?.validateBegin(),this.renderDepth++}end(){if(this.renderDepth--,0===this.renderDepth){for(const r of this.internalCallbacks)r();this.internalCallbacks.length=0,this.handler?.execute()}}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}static#e=this.\u0275prov=Ar({token:e,providedIn:"root",factory:()=>new e})}return e})();function rme(e,t){const r=Au(t,e),n=r[Ft];!function nme(e,t){for(let r=t.length;r0&&h8(e,r,i.join(" "))}}(d,x,p,n),void 0!==r&&function pme(e,t,r){const n=e.projection=[];for(let a=0;a0&&(r[a-1][el]=t),n{class e{static#e=this.__NG_ELEMENT_ID__=Ahe}return e})();function Ahe(){return vG(la(),ct())}const The=il,mG=class extends The{constructor(t,r,n){super(),this._lContainer=t,this._hostTNode=r,this._hostLView=n}get element(){return Dg(this._hostTNode,this._hostLView)}get injector(){return new uo(this._hostTNode,this._hostLView)}get parentInjector(){const t=KC(this._hostTNode,this._hostLView);if(II(t)){const r=yb(t,this._hostLView),n=gb(t);return new uo(r[Ft].data[n+8],r)}return new uo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=hG(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-Ti}createEmbeddedView(t,r,n){let a,i;"number"==typeof n?a=n:null!=n&&(a=n.index,i=n.injector);const s=t.createEmbeddedViewImpl(r||{},i,null);return this.insertImpl(s,a,Vg(this._hostTNode,null)),s}createComponent(t,r,n,a,i){const o=t&&!function bb(e){return"function"==typeof e}(t);let s;if(o)s=r;else{const m=r||{};s=m.index,n=m.injector,a=m.projectableNodes,i=m.environmentInjector||m.ngModuleRef}const u=o?t:new Vb(cn(t)),c=n||this.parentInjector;if(!i&&null==u.ngModule){const h=(o?c:this.parentInjector).get(rl,null);h&&(i=h)}cn(u.componentType??{});const p=u.create(c,a,null,i);return this.insertImpl(p.hostView,s,Vg(this._hostTNode,null)),p}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,n){const a=t._lView;if(function Xce(e){return Co(e[qa])}(a)){const s=this.indexOf(t);if(-1!==s)this.detach(s);else{const u=a[qa],c=new mG(u,u[Ko],u[qa]);c.detach(c.indexOf(t))}}const i=this._adjustIndex(r),o=this._lContainer;return Yb(o,a,i,n),t.attachToViewContainerRef(),g6(fP(o),i,t),t}move(t,r){return this.insert(t,r)}indexOf(t){const r=hG(this._lContainer);return null!==r?r.indexOf(t):-1}remove(t){const r=this._adjustIndex(t,-1),n=Db(this._lContainer,r);n&&($C(fP(this._lContainer),r),px(n[Ft],n))}detach(t){const r=this._adjustIndex(t,-1),n=Db(this._lContainer,r);return n&&null!=$C(fP(this._lContainer),r)?new Ub(n):null}_adjustIndex(t,r=0){return t??this.length+r}};function hG(e){return e[8]}function fP(e){return e[8]||(e[8]=[])}function vG(e,t){let r;const n=t[e.index];return Co(n)?r=n:(r=function oV(e,t,r,n){return[e,!0,0,t,null,n,null,r,null,null]}(n,t,null,e),t[e.index]=r,Rx(t,r)),gG(r,t,e,n),new mG(r,e,t)}let gG=function bG(e,t,r,n){if(e[zl])return;let a;a=8&r.type?wa(n):function Dhe(e,t){const r=e[Lr],n=r.createComment(""),a=xs(t,e);return ch(r,mx(r,a),n,function Kde(e,t){return e.nextSibling(t)}(r,a),!1),n}(t,r),e[zl]=a};function Yg(e,t,r,n){const a=ct(),i=wn(),o=Ur+e,s=a[Lr],u=i.firstCreatePass?function Sve(e,t,r,n,a,i){const o=t.consts,u=Eg(t,e,2,n,jl(o,a));return function V3(e,t,r,n){if(qU()){const a=null===n?null:{"":-1},i=function _pe(e,t){const r=e.directiveRegistry;let n=null,a=null;if(r)for(let i=0;i(Ip(!0),fx(n,a,function r6(){return Mr.lFrame.currentNamespace}()));const Zg="en-US";let QG=Zg;function e_(e){return!!e&&"function"==typeof e.then}function xz(e){return!!e&&"function"==typeof e.subscribe}let Wz=(e,t,r,n,a)=>(Ip(!0),function dx(e,t){return e.createText(t)}(t[Lr],n));function PP(e){return MP("",e,""),PP}function MP(e,t,r){const n=ct(),a=function Pg(e,t,r,n){return ji(e,Wl(),r)?t+kr(r)+n:jr}(n,e,t,r);return a!==jr&&tf(n,Zo(),a),MP}class vh{}class rH{}class NP extends vh{constructor(t,r,n){super(),this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new TV(this);const a=Xo(t);this._bootstrapComponents=Du(a.bootstrap),this._r3Injector=O6(t,r,[{provide:vh,useValue:this},{provide:Ax,useValue:this.componentFactoryResolver},...n],Hi(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class kP extends rH{constructor(t){super(),this.moduleType=t}create(t){return new NP(this.moduleType,t,[])}}class nH extends vh{constructor(t){super(),this.componentFactoryResolver=new TV(this),this.instance=null;const r=new gg([...t.providers,{provide:vh,useValue:this},{provide:Ax,useValue:this.componentFactoryResolver}],t.parent||ax(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function aH(e,t,r=null){return new nH({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}let Xge=(()=>{class e{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){const n=w6(0,r.type),a=n.length>0?aH([n],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,a)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(const r of this.cachedInjectors.values())null!==r&&r.destroy()}finally{this.cachedInjectors.clear()}}static#e=this.\u0275prov=Ar({token:e,providedIn:"environment",factory:()=>new e(an(rl))})}return e})();function t_(e){(function lh(e){vV.has(e)||(vV.add(e),performance?.mark?.("mark_use_counter",{detail:{feature:e}}))})("NgStandalone"),e.getStandaloneInjector=t=>t.get(Xge).getOrCreateStandaloneInjector(e)}function x0e(){return this._results[Symbol.iterator]()}class UP{static#e=Symbol.iterator;get changes(){return this._changes||(this._changes=new Uo)}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const r=UP.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=x0e)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,r){return this._results.reduce(t,r)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,r){this.dirty=!1;const n=function $s(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function Fle(e,t,r){if(e.length!==t.length)return!1;for(let n=0;n{class e{static#e=this.__NG_ELEMENT_ID__=A0e}return e})();const _0e=rf,w0e=class extends _0e{constructor(t,r,n){super(),this._declarationLView=t,this._declarationTContainer=r,this.elementRef=n}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,n){const a=function Wb(e,t,r,n){const a=t.tView,s=Mx(e,a,r,4096&e[br]?4096:16,null,t,null,null,null,n?.injector??null,n?.dehydratedView??null);s[lb]=e[t.index];const c=e[Gl];return null!==c&&(s[Gl]=c.createEmbeddedView(a)),Z3(a,s,r),s}(this._declarationLView,this._declarationTContainer,t,{injector:r,dehydratedView:n});return new Ub(a)}};function A0e(){return a_(la(),ct())}function a_(e,t){return 4&e.type?new w0e(t,e,Dg(e,t)):null}class VP{constructor(t){this.queryList=t,this.matches=null}clone(){return new VP(this.queryList)}setDirty(){this.queryList.setDirty()}}class GP{constructor(t=[]){this.queries=t}createEmbeddedView(t){const r=t.queries;if(null!==r){const n=null!==t.contentQueries?t.contentQueries[0]:r.length,a=[];for(let i=0;i0)n.push(o[s/2]);else{const c=i[s+1],l=t[-u];for(let d=Ti;d{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,n)=>{this.resolve=r,this.reject=n}),this.appInits=Yt(eye,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const r=[];for(const a of this.appInits){const i=a();if(e_(i))r.push(i);else if(xz(i)){const o=new Promise((s,u)=>{i.subscribe({complete:s,error:u})});r.push(o)}}const n=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{n()}).catch(a=>{this.reject(a)}),0===r.length&&n(),this.initialized=!0}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),LH=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const nf=new sr("LocaleId",{providedIn:"root",factory:()=>Yt(nf,pn.Optional|pn.SkipSelf)||function tye(){return typeof $localize<"u"&&$localize.locale||Zg}()});let VH=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Ai(!1)}add(){this.hasPendingTasks.next(!0);const r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),0===this.pendingTasks.size&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks.next(!1)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class sye{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let uye=(()=>{class e{compileModuleSync(r){return new kP(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const n=this.compileModuleSync(r),i=Du(Xo(r).declarations).reduce((o,s)=>{const u=cn(s);return u&&o.push(new Vb(u)),o},[]);return new sye(n,i)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const qH=new sr("");let Up=null;const tM=new sr("PlatformDestroyListeners"),rM=new sr("appBootstrapListener");function Lye(e){try{const{rootComponent:t,appProviders:r,platformProviders:n}=e,a=function kye(e=[]){if(Up)return Up;const t=function KH(e=[],t){return ac.create({name:t,providers:[{provide:WI,useValue:"platform"},{provide:tM,useValue:new Set([()=>Up=null])},...e]})}(e);return Up=t,function YH(){!function sue(e){R5=e}(()=>{throw new Ot(600,!1)})}(),function XH(e){e.get(B6,null)?.forEach(r=>r())}(t),t}(n),i=[Hye(),...r||[]],s=new nH({providers:i,parent:a,debugName:"",runEnvironmentInitializers:!1}).injector,u=s.get(ga);return u.run(()=>{s.resolveInjectorInitializers();const c=s.get(ef,null);let l;u.runOutsideAngular(()=>{l=u.onError.subscribe({next:p=>{c.handleError(p)}})});const d=()=>s.destroy(),f=a.get(tM);return f.add(d),s.onDestroy(()=>{l.unsubscribe(),f.delete(d)}),function $H(e,t,r){try{const n=r();return e_(n)?n.catch(a=>{throw t.runOutsideAngular(()=>e.handleError(a)),a}):n}catch(n){throw t.runOutsideAngular(()=>e.handleError(n)),n}}(c,u,()=>{const p=s.get(ZP);return p.runInitializers(),p.donePromise.then(()=>{!function $G(e){Ks(e,"Expected localeId to be defined"),"string"==typeof e&&(QG=e.toLowerCase().replace(/_/g,"-"))}(s.get(nf,Zg)||Zg);const h=s.get(Jg);return void 0!==t&&h.bootstrap(t),h})})})}catch(t){return Promise.reject(t)}}let Jg=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=Yt(t7),this.zoneIsStable=Yt(SV),this.componentTypes=[],this.components=[],this.isStable=Yt(VH).hasPendingTasks.pipe(nc(r=>r?Hr(!1):this.zoneIsStable),uU(),YE()),this._injector=Yt(rl)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(r,n){const a=r instanceof O8;if(!this._injector.get(ZP).done)throw!a&&function Dp(e){const t=cn(e)||so(e)||ko(e);return null!==t&&t.standalone}(r),new Ot(405,!1);let o;o=a?r:this._injector.get(Ax).resolveComponentFactory(r),this.componentTypes.push(o.componentType);const s=function Bye(e){return e.isBoundToModule}(o)?void 0:this._injector.get(vh),c=o.create(ac.NULL,[],n||o.selector,s),l=c.location.nativeElement,d=c.injector.get(qH,null);return d?.registerApplication(l),c.onDestroy(()=>{this.detachView(c.hostView),l_(this.components,c),d?.unregisterApplication(l)}),this._loadComponent(c),c}tick(){if(this._runningTick)throw new Ot(101,!1);try{this._runningTick=!0;for(let r of this._views)r.detectChanges()}catch(r){this.internalErrorHandler(r)}finally{this._runningTick=!1}}attachView(r){const n=r;this._views.push(n),n.attachToAppRef(this)}detachView(r){const n=r;l_(this._views,n),n.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const n=this._injector.get(rM,[]);[...this._bootstrapListeners,...n].forEach(a=>a(r))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(r=>r()),this._views.slice().forEach(r=>r.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(r){return this._destroyListeners.push(r),()=>l_(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new Ot(406,!1);const r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function l_(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const t7=new sr("",{providedIn:"root",factory:()=>Yt(ef).handleError.bind(void 0)});function Gye(){const e=Yt(ga),t=Yt(ef);return r=>e.runOutsideAngular(()=>t.handleError(r))}let zye=(()=>{class e{constructor(){this.zone=Yt(ga),this.applicationRef=Yt(Jg)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function r7(e){return[{provide:ga,useFactory:e},{provide:vg,multi:!0,useFactory:()=>{const t=Yt(zye,{optional:!0});return()=>t.initialize()}},{provide:t7,useFactory:Gye},{provide:SV,useFactory:CV}]}function Hye(e){return HI([[],r7(()=>new ga(function QH(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}(e)))])}let mM=null;function t0(){return mM}class gbe{}const ol=new sr("DocumentToken");let A7=(()=>{class e{historyGo(r){throw new Error("Not implemented")}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>Yt(ybe),providedIn:"platform"})}return e})(),ybe=(()=>{class e extends A7{constructor(){super(),this._doc=Yt(ol),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return t0().getBaseHref(this._doc)}onPopState(r){const n=t0().getGlobalEventTarget(this._doc,"window");return n.addEventListener("popstate",r,!1),()=>n.removeEventListener("popstate",r)}onHashChange(r){const n=t0().getGlobalEventTarget(this._doc,"window");return n.addEventListener("hashchange",r,!1),()=>n.removeEventListener("hashchange",r)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(r){this._location.pathname=r}pushState(r,n,a){this._history.pushState(r,n,a)}replaceState(r,n,a){this._history.replaceState(r,n,a)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>new e,providedIn:"platform"})}return e})();function T7(e,t){if(0==e.length)return t;if(0==t.length)return e;let r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t}function D7(e){const t=e.match(/#|\?|$/),r=t&&t.index||e.length;return e.slice(0,r-("/"===e[r-1]?1:0))+e.slice(r)}function yh(e){return e&&"?"!==e[0]?"?"+e:e}let y_=(()=>{class e{historyGo(r){throw new Error("Not implemented")}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>Yt(Sbe),providedIn:"root"})}return e})();const bbe=new sr("appBaseHref");let Sbe=(()=>{class e extends y_{constructor(r,n){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=n??this._platformLocation.getBaseHrefFromDOM()??Yt(ol).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}prepareExternalUrl(r){return T7(this._baseHref,r)}path(r=!1){const n=this._platformLocation.pathname+yh(this._platformLocation.search),a=this._platformLocation.hash;return a&&r?`${n}${a}`:n}pushState(r,n,a,i){const o=this.prepareExternalUrl(a+yh(i));this._platformLocation.pushState(r,n,o)}replaceState(r,n,a,i){const o=this.prepareExternalUrl(a+yh(i));this._platformLocation.replaceState(r,n,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static#e=this.\u0275fac=function(n){return new(n||e)(an(A7),an(bbe,8))};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),l1=(()=>{class e{constructor(r){this._subject=new Uo,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;const n=this._locationStrategy.getBaseHref();this._basePath=function _be(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(D7(E7(n))),this._locationStrategy.onPopState(a=>{this._subject.emit({url:this.path(!0),pop:!0,state:a.state,type:a.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,n=""){return this.path()==this.normalize(r+yh(n))}normalize(r){return e.stripTrailingSlash(function xbe(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,E7(r)))}prepareExternalUrl(r){return r&&"/"!==r[0]&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,n="",a=null){this._locationStrategy.pushState(a,"",r,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+yh(n)),a)}replaceState(r,n="",a=null){this._locationStrategy.replaceState(a,"",r,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+yh(n)),a)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(r=0){this._locationStrategy.historyGo?.(r)}onUrlChange(r){return this._urlChangeListeners.push(r),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(n=>{this._notifyUrlChangeListeners(n.url,n.state)})),()=>{const n=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(n,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",n){this._urlChangeListeners.forEach(a=>a(r,n))}subscribe(r,n,a){return this._subject.subscribe({next:r,error:n,complete:a})}static#e=this.normalizeQueryParams=yh;static#t=this.joinWithSlash=T7;static#r=this.stripTrailingSlash=D7;static#n=this.\u0275fac=function(n){return new(n||e)(an(y_))};static#a=this.\u0275prov=Ar({token:e,factory:()=>function Cbe(){return new l1(an(y_))}(),providedIn:"root"})}return e})();function E7(e){return e.replace(/\/index.html$/,"")}let U1e=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275mod=lI({type:e});static#r=this.\u0275inj=IC({})}return e})();function j7(e){return"server"===e}class pSe extends gbe{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class MM extends pSe{static makeCurrent(){!function vbe(e){mM||(mM=e)}(new MM)}onAndCancel(t,r,n){return t.addEventListener(r,n),()=>{t.removeEventListener(r,n)}}dispatchEvent(t,r){t.dispatchEvent(r)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,r){return(r=r||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,r){return"window"===r?window:"document"===r?t:"body"===r?t.body:null}getBaseHref(t){const r=function mSe(){return m1=m1||document.querySelector("base"),m1?m1.getAttribute("href"):null}();return null==r?null:function hSe(e){return new URL(e,"http://a").pathname}(r)}resetBaseElement(){m1=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function s1e(e,t){t=encodeURIComponent(t);for(const r of e.split(";")){const n=r.indexOf("="),[a,i]=-1==n?[r,""]:[r.slice(0,n),r.slice(n+1)];if(a.trim()===t)return decodeURIComponent(i)}return null}(document.cookie,t)}}let m1=null,gSe=(()=>{class e{build(){return new XMLHttpRequest}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac})}return e})();const RM=new sr("EventManagerPlugins");let X7=(()=>{class e{constructor(r,n){this._zone=n,this._eventNameToPlugin=new Map,r.forEach(a=>{a.manager=this}),this._plugins=r.slice().reverse()}addEventListener(r,n,a){return this._findPluginFor(n).addEventListener(r,n,a)}getZone(){return this._zone}_findPluginFor(r){let n=this._eventNameToPlugin.get(r);if(n)return n;if(n=this._plugins.find(i=>i.supports(r)),!n)throw new Ot(5101,!1);return this._eventNameToPlugin.set(r,n),n}static#e=this.\u0275fac=function(n){return new(n||e)(an(RM),an(ga))};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac})}return e})();class K7{constructor(t){this._doc=t}}const OM="ng-app-id";let Z7=(()=>{class e{constructor(r,n,a,i={}){this.doc=r,this.appId=n,this.nonce=a,this.platformId=i,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=j7(i),this.resetHostNodes()}addStyles(r){for(const n of r)1===this.changeUsageCount(n,1)&&this.onStyleAdded(n)}removeStyles(r){for(const n of r)this.changeUsageCount(n,-1)<=0&&this.onStyleRemoved(n)}ngOnDestroy(){const r=this.styleNodesInDOM;r&&(r.forEach(n=>n.remove()),r.clear());for(const n of this.getAllStyles())this.onStyleRemoved(n);this.resetHostNodes()}addHost(r){this.hostNodes.add(r);for(const n of this.getAllStyles())this.addStyleToHost(r,n)}removeHost(r){this.hostNodes.delete(r)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(r){for(const n of this.hostNodes)this.addStyleToHost(n,r)}onStyleRemoved(r){const n=this.styleRef;n.get(r)?.elements?.forEach(a=>a.remove()),n.delete(r)}collectServerRenderedStyles(){const r=this.doc.head?.querySelectorAll(`style[${OM}="${this.appId}"]`);if(r?.length){const n=new Map;return r.forEach(a=>{null!=a.textContent&&n.set(a.textContent,a)}),n}return null}changeUsageCount(r,n){const a=this.styleRef;if(a.has(r)){const i=a.get(r);return i.usage+=n,i.usage}return a.set(r,{usage:n,elements:[]}),n}getStyleElement(r,n){const a=this.styleNodesInDOM,i=a?.get(n);if(i?.parentNode===r)return a.delete(n),i.removeAttribute(OM),i;{const o=this.doc.createElement("style");return this.nonce&&o.setAttribute("nonce",this.nonce),o.textContent=n,this.platformIsServer&&o.setAttribute(OM,this.appId),r.appendChild(o),o}}addStyleToHost(r,n){const a=this.getStyleElement(r,n),i=this.styleRef,o=i.get(n)?.elements;o?o.push(a):i.set(n,{elements:[a],usage:1})}resetHostNodes(){const r=this.hostNodes;r.clear(),r.add(this.doc.head)}static#e=this.\u0275fac=function(n){return new(n||e)(an(ol),an(JI),an(N6,8),an(Sg))};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac})}return e})();const FM={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},BM=/%COMP%/g,CSe=new sr("RemoveStylesOnCompDestroy",{providedIn:"root",factory:()=>!0});function $7(e,t){return t.map(r=>r.replace(BM,e))}let J7=(()=>{class e{constructor(r,n,a,i,o,s,u,c=null){this.eventManager=r,this.sharedStylesHost=n,this.appId=a,this.removeStylesOnCompDestroy=i,this.doc=o,this.platformId=s,this.ngZone=u,this.nonce=c,this.rendererByCompId=new Map,this.platformIsServer=j7(s),this.defaultRenderer=new NM(r,o,u,this.platformIsServer)}createRenderer(r,n){if(!r||!n)return this.defaultRenderer;this.platformIsServer&&n.encapsulation===$c.ShadowDom&&(n={...n,encapsulation:$c.Emulated});const a=this.getOrCreateRenderer(r,n);return a instanceof t9?a.applyToHost(r):a instanceof kM&&a.applyStyles(),a}getOrCreateRenderer(r,n){const a=this.rendererByCompId;let i=a.get(n.id);if(!i){const o=this.doc,s=this.ngZone,u=this.eventManager,c=this.sharedStylesHost,l=this.removeStylesOnCompDestroy,d=this.platformIsServer;switch(n.encapsulation){case $c.Emulated:i=new t9(u,c,n,this.appId,l,o,s,d);break;case $c.ShadowDom:return new ASe(u,c,r,n,o,s,this.nonce,d);default:i=new kM(u,c,n,l,o,s,d)}a.set(n.id,i)}return i}ngOnDestroy(){this.rendererByCompId.clear()}static#e=this.\u0275fac=function(n){return new(n||e)(an(X7),an(Z7),an(JI),an(CSe),an(ol),an(Sg),an(ga),an(N6))};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac})}return e})();class NM{constructor(t,r,n,a){this.eventManager=t,this.doc=r,this.ngZone=n,this.platformIsServer=a,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(t,r){return r?this.doc.createElementNS(FM[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(e9(t)?t.content:t).appendChild(r)}insertBefore(t,r,n){t&&(e9(t)?t.content:t).insertBefore(r,n)}removeChild(t,r){t&&t.removeChild(r)}selectRootElement(t,r){let n="string"==typeof t?this.doc.querySelector(t):t;if(!n)throw new Ot(-5104,!1);return r||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,r,n,a){if(a){r=a+":"+r;const i=FM[a];i?t.setAttributeNS(i,r,n):t.setAttribute(r,n)}else t.setAttribute(r,n)}removeAttribute(t,r,n){if(n){const a=FM[n];a?t.removeAttributeNS(a,r):t.removeAttribute(`${n}:${r}`)}else t.removeAttribute(r)}addClass(t,r){t.classList.add(r)}removeClass(t,r){t.classList.remove(r)}setStyle(t,r,n,a){a&(Fp.DashCase|Fp.Important)?t.style.setProperty(r,n,a&Fp.Important?"important":""):t.style[r]=n}removeStyle(t,r,n){n&Fp.DashCase?t.style.removeProperty(r):t.style[r]=""}setProperty(t,r,n){null!=t&&(t[r]=n)}setValue(t,r){t.nodeValue=r}listen(t,r,n){if("string"==typeof t&&!(t=t0().getGlobalEventTarget(this.doc,t)))throw new Error(`Unsupported event target ${t} for event ${r}`);return this.eventManager.addEventListener(t,r,this.decoratePreventDefault(n))}decoratePreventDefault(t){return r=>{if("__ngUnwrap__"===r)return t;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>t(r)):t(r))&&r.preventDefault()}}}function e9(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class ASe extends NM{constructor(t,r,n,a,i,o,s,u){super(t,i,o,u),this.sharedStylesHost=r,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const c=$7(a.id,a.styles);for(const l of c){const d=document.createElement("style");s&&d.setAttribute("nonce",s),d.textContent=l,this.shadowRoot.appendChild(d)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,r){return super.appendChild(this.nodeOrShadowRoot(t),r)}insertBefore(t,r,n){return super.insertBefore(this.nodeOrShadowRoot(t),r,n)}removeChild(t,r){return super.removeChild(this.nodeOrShadowRoot(t),r)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class kM extends NM{constructor(t,r,n,a,i,o,s,u){super(t,i,o,s),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=a,this.styles=u?$7(u,n.styles):n.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class t9 extends kM{constructor(t,r,n,a,i,o,s,u){const c=a+"-"+n.id;super(t,r,n,i,o,s,u,c),this.contentAttr=function xSe(e){return"_ngcontent-%COMP%".replace(BM,e)}(c),this.hostAttr=function _Se(e){return"_nghost-%COMP%".replace(BM,e)}(c)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,r){const n=super.createElement(t,r);return super.setAttribute(n,this.contentAttr,""),n}}let TSe=(()=>{class e extends K7{constructor(r){super(r)}supports(r){return!0}addEventListener(r,n,a){return r.addEventListener(n,a,!1),()=>this.removeEventListener(r,n,a)}removeEventListener(r,n,a){return r.removeEventListener(n,a)}static#e=this.\u0275fac=function(n){return new(n||e)(an(ol))};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac})}return e})();const r9=["alt","control","meta","shift"],DSe={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},ESe={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let ISe=(()=>{class e extends K7{constructor(r){super(r)}supports(r){return null!=e.parseEventName(r)}addEventListener(r,n,a){const i=e.parseEventName(n),o=e.eventCallback(i.fullKey,a,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>t0().onAndCancel(r,i.domEventName,o))}static parseEventName(r){const n=r.toLowerCase().split("."),a=n.shift();if(0===n.length||"keydown"!==a&&"keyup"!==a)return null;const i=e._normalizeKey(n.pop());let o="",s=n.indexOf("code");if(s>-1&&(n.splice(s,1),o="code."),r9.forEach(c=>{const l=n.indexOf(c);l>-1&&(n.splice(l,1),o+=c+".")}),o+=i,0!=n.length||0===i.length)return null;const u={};return u.domEventName=a,u.fullKey=o,u}static matchEventFullKeyCode(r,n){let a=DSe[r.key]||r.key,i="";return n.indexOf("code.")>-1&&(a=r.code,i="code."),!(null==a||!a)&&(a=a.toLowerCase()," "===a?a="space":"."===a&&(a="dot"),r9.forEach(o=>{o!==a&&(0,ESe[o])(r)&&(i+=o+".")}),i+=a,i===n)}static eventCallback(r,n,a){return i=>{e.matchEventFullKeyCode(i,r)&&a.runGuarded(()=>n(i))}}static _normalizeKey(r){return"esc"===r?"escape":r}static#e=this.\u0275fac=function(n){return new(n||e)(an(ol))};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac})}return e})();function n9(e){return{appProviders:[...NSe,...e?.providers??[]],platformProviders:FSe}}const FSe=[{provide:Sg,useValue:"browser"},{provide:B6,useValue:function MSe(){MM.makeCurrent()},multi:!0},{provide:ol,useFactory:function OSe(){return function pde(e){$I=e}(document),document},deps:[]}],NSe=[{provide:WI,useValue:"root"},{provide:ef,useFactory:function RSe(){return new ef},deps:[]},{provide:RM,useClass:TSe,multi:!0,deps:[ol,ga,Sg]},{provide:RM,useClass:ISe,multi:!0,deps:[ol]},J7,Z7,X7,{provide:B8,useExisting:J7},{provide:class j1e{},useClass:gSe,deps:[]},[]];let a9=(()=>{class e{constructor(r){this._doc=r}getTitle(){return this._doc.title}setTitle(r){this._doc.title=r||""}static#e=this.\u0275fac=function(n){return new(n||e)(an(ol))};static#t=this.\u0275prov=Ar({token:e,factory:function(n){let a=null;return a=n?new n:function LSe(){return new a9(an(ol))}(),a},providedIn:"root"})}return e})();typeof window<"u"&&window;const M_=BE(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:jSe}=Array,{getPrototypeOf:qSe,prototype:WSe,keys:YSe}=Object;const{isArray:ZSe}=Array;function u9(e){return $n(t=>function QSe(e,t){return ZSe(t)?e(...t):e(t)}(e,t))}function c9(...e){const t=nb(e),r=aU(e),{args:n,keys:a}=function XSe(e){if(1===e.length){const t=e[0];if(jSe(t))return{args:t,keys:null};if(function KSe(e){return e&&"object"==typeof e&&qSe(e)===WSe}(t)){const r=YSe(t);return{args:r.map(n=>t[n]),keys:r}}}return{args:e,keys:null}}(e);if(0===n.length)return So([],t);const i=new zi(l9(n,t,a?o=>function $Se(e,t){return e.reduce((r,n,a)=>(r[n]=t[a],r),{})}(a,o):_p));return r?i.pipe(u9(r)):i}function l9(e,t,r=_p){return n=>{d9(t,()=>{const{length:a}=e,i=new Array(a);let o=a,s=a;for(let u=0;u{const c=So(e[u],t);let l=!1;c.subscribe(fi(n,d=>{i[u]=d,l||(l=!0,s--),s||n.next(r(i.slice()))},()=>{--o||n.complete()}))},n)},n)}}function d9(e,t,r){e?Xd(r,e,t):t()}function UM(...e){return function JSe(){return TC(1)}()(So(e,nb(e)))}function f9(e){return new zi(t=>{_u(e()).subscribe(t)})}function R_(e,t){const r=Fa(e)?e:()=>e,n=a=>a.error(r());return new zi(t?a=>t.schedule(n,0,a):n)}function VM(){return di((e,t)=>{let r=null;e._refCount++;const n=fi(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(r=null);const a=e._connection,i=r;r=null,a&&(!i||a===i)&&a.unsubscribe(),t.unsubscribe()});e.subscribe(n),n.closed||(r=e.connect())})}class p9 extends zi{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,H5(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new Xs;const r=this.getSubject();t.add(this.source.subscribe(fi(r,void 0,()=>{this._teardown(),r.complete()},n=>{this._teardown(),r.error(n)},()=>this._teardown()))),t.closed&&(this._connection=null,t=Xs.EMPTY)}return t}refCount(){return VM()(this)}}function bh(e){return e<=0?()=>kl:di((t,r)=>{let n=0;t.subscribe(fi(r,a=>{++n<=e&&(r.next(a),e<=n&&r.complete())}))})}function uf(e,t){return di((r,n)=>{let a=0;r.subscribe(fi(n,i=>e.call(t,i,a++)&&n.next(i)))})}function O_(e){return di((t,r)=>{let n=!1;t.subscribe(fi(r,a=>{n=!0,r.next(a)},()=>{n||r.next(e),r.complete()}))})}function m9(e=t2e){return di((t,r)=>{let n=!1;t.subscribe(fi(r,a=>{n=!0,r.next(a)},()=>n?r.complete():r.error(e())))})}function t2e(){return new M_}function Sh(e,t){const r=arguments.length>=2;return n=>n.pipe(e?uf((a,i)=>e(a,i,n)):_p,bh(1),r?O_(t):m9(()=>new M_))}function F_(e,t){return Fa(t)?bs(e,t,1):bs(e,1)}function $o(e,t,r){const n=Fa(e)||t||r?{next:e,error:t,complete:r}:e;return n?di((a,i)=>{var o;null===(o=n.subscribe)||void 0===o||o.call(n);let s=!0;a.subscribe(fi(i,u=>{var c;null===(c=n.next)||void 0===c||c.call(n,u),i.next(u)},()=>{var u;s=!1,null===(u=n.complete)||void 0===u||u.call(n),i.complete()},u=>{var c;s=!1,null===(c=n.error)||void 0===c||c.call(n,u),i.error(u)},()=>{var u,c;s&&(null===(u=n.unsubscribe)||void 0===u||u.call(n)),null===(c=n.finalize)||void 0===c||c.call(n)}))}):_p}function n0(e){return di((t,r)=>{let i,n=null,a=!1;n=t.subscribe(fi(r,void 0,void 0,o=>{i=_u(e(o,n0(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):a=!0})),a&&(n.unsubscribe(),n=null,i.subscribe(r))})}function GM(e){return e<=0?()=>kl:di((t,r)=>{let n=[];t.subscribe(fi(r,a=>{n.push(a),e{for(const a of n)r.next(a);r.complete()},void 0,()=>{n=null}))})}function zM(e){return di((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}const en="primary",h1=Symbol("RouteTitle");class s2e{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r[0]:r}return null}getAll(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r:[r]}return[]}get keys(){return Object.keys(this.params)}}function a0(e){return new s2e(e)}function u2e(e,t,r){const n=r.path.split("/");if(n.length>e.length||"full"===r.pathMatch&&(t.hasChildren()||n.lengthn[i]===a)}return e===t}function v9(e){return e.length>0?e[e.length-1]:null}function Gp(e){return function HSe(e){return!!e&&(e instanceof zi||Fa(e.lift)&&Fa(e.subscribe))}(e)?e:e_(e)?So(Promise.resolve(e)):Hr(e)}const l2e={exact:function b9(e,t,r){if(!Ch(e.segments,t.segments)||!B_(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const n in t.children)if(!e.children[n]||!b9(e.children[n],t.children[n],r))return!1;return!0},subset:S9},g9={exact:function d2e(e,t){return $l(e,t)},subset:function f2e(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>h9(e[r],t[r]))},ignored:()=>!0};function y9(e,t,r){return l2e[r.paths](e.root,t.root,r.matrixParams)&&g9[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function S9(e,t,r){return C9(e,t,t.segments,r)}function C9(e,t,r,n){if(e.segments.length>r.length){const a=e.segments.slice(0,r.length);return!(!Ch(a,r)||t.hasChildren()||!B_(a,r,n))}if(e.segments.length===r.length){if(!Ch(e.segments,r)||!B_(e.segments,r,n))return!1;for(const a in t.children)if(!e.children[a]||!S9(e.children[a],t.children[a],n))return!1;return!0}{const a=r.slice(0,e.segments.length),i=r.slice(e.segments.length);return!!(Ch(e.segments,a)&&B_(e.segments,a,n)&&e.children[en])&&C9(e.children[en],t,i,n)}}function B_(e,t,r){return t.every((n,a)=>g9[r](e[a].parameters,n.parameters))}class o0{constructor(t=new da([],{}),r={},n=null){this.root=t,this.queryParams=r,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=a0(this.queryParams)),this._queryParamMap}toString(){return h2e.serialize(this)}}class da{constructor(t,r){this.segments=t,this.children=r,this.parent=null,Object.values(r).forEach(n=>n.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return N_(this)}}class v1{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap||(this._parameterMap=a0(this.parameters)),this._parameterMap}toString(){return w9(this)}}function Ch(e,t){return e.length===t.length&&e.every((r,n)=>r.path===t[n].path)}let s0=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>new jM,providedIn:"root"})}return e})();class jM{parse(t){const r=new T2e(t);return new o0(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${g1(t.root,!0)}`,n=function y2e(e){const t=Object.keys(e).map(r=>{const n=e[r];return Array.isArray(n)?n.map(a=>`${k_(r)}=${k_(a)}`).join("&"):`${k_(r)}=${k_(n)}`}).filter(r=>!!r);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${r}${n}${"string"==typeof t.fragment?`#${function v2e(e){return encodeURI(e)}(t.fragment)}`:""}`}}const h2e=new jM;function N_(e){return e.segments.map(t=>w9(t)).join("/")}function g1(e,t){if(!e.hasChildren())return N_(e);if(t){const r=e.children[en]?g1(e.children[en],!1):"",n=[];return Object.entries(e.children).forEach(([a,i])=>{a!==en&&n.push(`${a}:${g1(i,!1)}`)}),n.length>0?`${r}(${n.join("//")})`:r}{const r=function m2e(e,t){let r=[];return Object.entries(e.children).forEach(([n,a])=>{n===en&&(r=r.concat(t(a,n)))}),Object.entries(e.children).forEach(([n,a])=>{n!==en&&(r=r.concat(t(a,n)))}),r}(e,(n,a)=>a===en?[g1(e.children[en],!1)]:[`${a}:${g1(n,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[en]?`${N_(e)}/${r[0]}`:`${N_(e)}/(${r.join("//")})`}}function x9(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function k_(e){return x9(e).replace(/%3B/gi,";")}function qM(e){return x9(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function L_(e){return decodeURIComponent(e)}function _9(e){return L_(e.replace(/\+/g,"%20"))}function w9(e){return`${qM(e.path)}${function g2e(e){return Object.keys(e).map(t=>`;${qM(t)}=${qM(e[t])}`).join("")}(e.parameters)}`}const b2e=/^[^\/()?;#]+/;function WM(e){const t=e.match(b2e);return t?t[0]:""}const S2e=/^[^\/()?;=#]+/,x2e=/^[^=?&#]+/,w2e=/^[^&#]+/;class T2e{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new da([],{}):new da([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let r={};this.peekStartsWith("/(")&&(this.capture("/"),r=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(r).length>0)&&(n[en]=new da(t,r)),n}parseSegment(){const t=WM(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Ot(4009,!1);return this.capture(t),new v1(L_(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function C2e(e){const t=e.match(S2e);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let n="";if(this.consumeOptional("=")){const a=WM(this.remaining);a&&(n=a,this.capture(n))}t[L_(r)]=L_(n)}parseQueryParam(t){const r=function _2e(e){const t=e.match(x2e);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let n="";if(this.consumeOptional("=")){const o=function A2e(e){const t=e.match(w2e);return t?t[0]:""}(this.remaining);o&&(n=o,this.capture(n))}const a=_9(r),i=_9(n);if(t.hasOwnProperty(a)){let o=t[a];Array.isArray(o)||(o=[o],t[a]=o),o.push(i)}else t[a]=i}parseParens(t){const r={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=WM(this.remaining),a=this.remaining[n.length];if("/"!==a&&")"!==a&&";"!==a)throw new Ot(4010,!1);let i;n.indexOf(":")>-1?(i=n.slice(0,n.indexOf(":")),this.capture(i),this.capture(":")):t&&(i=en);const o=this.parseChildren();r[i]=1===Object.keys(o).length?o[en]:new da([],o),this.consumeOptional("//")}return r}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Ot(4011,!1)}}function A9(e){return e.segments.length>0?new da([],{[en]:e}):e}function T9(e){const t={};for(const n of Object.keys(e.children)){const i=T9(e.children[n]);if(n===en&&0===i.segments.length&&i.hasChildren())for(const[o,s]of Object.entries(i.children))t[o]=s;else(i.segments.length>0||i.hasChildren())&&(t[n]=i)}return function D2e(e){if(1===e.numberOfChildren&&e.children[en]){const t=e.children[en];return new da(e.segments.concat(t.segments),t.children)}return e}(new da(e.segments,t))}function xh(e){return e instanceof o0}function D9(e){let t;const n=function r(i){const o={};for(const u of i.children){const c=r(u);o[u.outlet]=c}const s=new da(i.url,o);return i===e&&(t=s),s}(e.root),a=A9(n);return t??a}function E9(e,t,r,n){let a=e;for(;a.parent;)a=a.parent;if(0===t.length)return YM(a,a,a,r,n);const i=function I2e(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new P9(!0,0,e);let t=0,r=!1;const n=e.reduce((a,i,o)=>{if("object"==typeof i&&null!=i){if(i.outlets){const s={};return Object.entries(i.outlets).forEach(([u,c])=>{s[u]="string"==typeof c?c.split("/"):c}),[...a,{outlets:s}]}if(i.segmentPath)return[...a,i.segmentPath]}return"string"!=typeof i?[...a,i]:0===o?(i.split("/").forEach((s,u)=>{0==u&&"."===s||(0==u&&""===s?r=!0:".."===s?t++:""!=s&&a.push(s))}),a):[...a,i]},[]);return new P9(r,t,n)}(t);if(i.toRoot())return YM(a,a,new da([],{}),r,n);const o=function P2e(e,t,r){if(e.isAbsolute)return new V_(t,!0,0);if(!r)return new V_(t,!1,NaN);if(null===r.parent)return new V_(r,!0,0);const n=U_(e.commands[0])?0:1;return function M2e(e,t,r){let n=e,a=t,i=r;for(;i>a;){if(i-=a,n=n.parent,!n)throw new Ot(4005,!1);a=n.segments.length}return new V_(n,!1,a-i)}(r,r.segments.length-1+n,e.numberOfDoubleDots)}(i,a,e),s=o.processChildren?b1(o.segmentGroup,o.index,i.commands):M9(o.segmentGroup,o.index,i.commands);return YM(a,o.segmentGroup,s,r,n)}function U_(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function y1(e){return"object"==typeof e&&null!=e&&e.outlets}function YM(e,t,r,n,a){let o,i={};n&&Object.entries(n).forEach(([u,c])=>{i[u]=Array.isArray(c)?c.map(l=>`${l}`):`${c}`}),o=e===t?r:I9(e,t,r);const s=A9(T9(o));return new o0(s,i,a)}function I9(e,t,r){const n={};return Object.entries(e.children).forEach(([a,i])=>{n[a]=i===t?r:I9(i,t,r)}),new da(e.segments,n)}class P9{constructor(t,r,n){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=n,t&&n.length>0&&U_(n[0]))throw new Ot(4003,!1);const a=n.find(y1);if(a&&a!==v9(n))throw new Ot(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class V_{constructor(t,r,n){this.segmentGroup=t,this.processChildren=r,this.index=n}}function M9(e,t,r){if(e||(e=new da([],{})),0===e.segments.length&&e.hasChildren())return b1(e,t,r);const n=function O2e(e,t,r){let n=0,a=t;const i={match:!1,pathIndex:0,commandIndex:0};for(;a=r.length)return i;const o=e.segments[a],s=r[n];if(y1(s))break;const u=`${s}`,c=n0&&void 0===u)break;if(u&&c&&"object"==typeof c&&void 0===c.outlets){if(!O9(u,c,o))return i;n+=2}else{if(!O9(u,{},o))return i;n++}a++}return{match:!0,pathIndex:a,commandIndex:n}}(e,t,r),a=r.slice(n.commandIndex);if(n.match&&n.pathIndexi!==en)&&e.children[en]&&1===e.numberOfChildren&&0===e.children[en].segments.length){const i=b1(e.children[en],t,r);return new da(e.segments,i.children)}return Object.entries(n).forEach(([i,o])=>{"string"==typeof o&&(o=[o]),null!==o&&(a[i]=M9(e.children[i],t,o))}),Object.entries(e.children).forEach(([i,o])=>{void 0===n[i]&&(a[i]=o)}),new da(e.segments,a)}}function XM(e,t,r){const n=e.segments.slice(0,t);let a=0;for(;a{"string"==typeof n&&(n=[n]),null!==n&&(t[r]=XM(new da([],{}),0,n))}),t}function R9(e){const t={};return Object.entries(e).forEach(([r,n])=>t[r]=`${n}`),t}function O9(e,t,r){return e==r.path&&$l(t,r.parameters)}const S1="imperative";class Jl{constructor(t,r){this.id=t,this.url=r}}class KM extends Jl{constructor(t,r,n="imperative",a=null){super(t,r),this.type=0,this.navigationTrigger=n,this.restoredState=a}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class _h extends Jl{constructor(t,r,n){super(t,r),this.urlAfterRedirects=n,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class u0 extends Jl{constructor(t,r,n,a){super(t,r),this.reason=n,this.code=a,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class C1 extends Jl{constructor(t,r,n,a){super(t,r),this.reason=n,this.code=a,this.type=16}}class G_ extends Jl{constructor(t,r,n,a){super(t,r),this.error=n,this.target=a,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class F9 extends Jl{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class B2e extends Jl{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class N2e extends Jl{constructor(t,r,n,a,i){super(t,r),this.urlAfterRedirects=n,this.state=a,this.shouldActivate=i,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class k2e extends Jl{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class L2e extends Jl{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class U2e{constructor(t){this.route=t,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class V2e{constructor(t){this.route=t,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class G2e{constructor(t){this.snapshot=t,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class z2e{constructor(t){this.snapshot=t,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class H2e{constructor(t){this.snapshot=t,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class j2e{constructor(t){this.snapshot=t,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class ZM{}class QM{constructor(t){this.url=t}}class q2e{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new x1,this.attachRef=null}}let x1=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(r,n){const a=this.getOrCreateContext(r);a.outlet=n,this.contexts.set(r,a)}onChildOutletDestroyed(r){const n=this.getContext(r);n&&(n.outlet=null,n.attachRef=null)}onOutletDeactivated(){const r=this.contexts;return this.contexts=new Map,r}onOutletReAttached(r){this.contexts=r}getOrCreateContext(r){let n=this.getContext(r);return n||(n=new q2e,this.contexts.set(r,n)),n}getContext(r){return this.contexts.get(r)||null}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class B9{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const r=this.pathFromRoot(t);return r.length>1?r[r.length-2]:null}children(t){const r=$M(t,this._root);return r?r.children.map(n=>n.value):[]}firstChild(t){const r=$M(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=JM(t,this._root);return r.length<2?[]:r[r.length-2].children.map(a=>a.value).filter(a=>a!==t)}pathFromRoot(t){return JM(t,this._root).map(r=>r.value)}}function $M(e,t){if(e===t.value)return t;for(const r of t.children){const n=$M(e,r);if(n)return n}return null}function JM(e,t){if(e===t.value)return[t];for(const r of t.children){const n=JM(e,r);if(n.length)return n.unshift(t),n}return[]}class cl{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function c0(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class N9 extends B9{constructor(t,r){super(t),this.snapshot=r,rR(this,t)}toString(){return this.snapshot.toString()}}function k9(e,t){const r=function W2e(e,t){const o=new tR([],{},{},"",{},en,t,null,{});return new L9("",new cl(o,[]))}(0,t),n=new Ai([new v1("",{})]),a=new Ai({}),i=new Ai({}),o=new Ai({}),s=new Ai(""),u=new l0(n,a,o,s,i,en,t,r.root);return u.snapshot=r.root,new N9(new cl(u,[]),r)}class l0{constructor(t,r,n,a,i,o,s,u){this.urlSubject=t,this.paramsSubject=r,this.queryParamsSubject=n,this.fragmentSubject=a,this.dataSubject=i,this.outlet=o,this.component=s,this._futureSnapshot=u,this.title=this.dataSubject?.pipe($n(c=>c[h1]))??Hr(void 0),this.url=t,this.params=r,this.queryParams=n,this.fragment=a,this.data=i}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe($n(t=>a0(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe($n(t=>a0(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function eR(e,t,r="emptyOnly"){let n;const{routeConfig:a}=e;return n=null===t||"always"!==r&&""!==a?.path&&(t.component||t.routeConfig?.loadComponent)?{params:e.params,data:e.data,resolve:{...e.data,...e._resolvedData??{}}}:{params:{...t.params,...e.params},data:{...t.data,...e.data},resolve:{...e.data,...t.data,...a?.data,...e._resolvedData}},a&&V9(a)&&(n.resolve[h1]=a.title),n}class tR{get title(){return this.data?.[h1]}constructor(t,r,n,a,i,o,s,u,c){this.url=t,this.params=r,this.queryParams=n,this.fragment=a,this.data=i,this.outlet=o,this.component=s,this.routeConfig=u,this._resolve=c}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=a0(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=a0(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(n=>n.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class L9 extends B9{constructor(t,r){super(r),this.url=t,rR(this,r)}toString(){return U9(this._root)}}function rR(e,t){t.value._routerState=e,t.children.forEach(r=>rR(e,r))}function U9(e){const t=e.children.length>0?` { ${e.children.map(U9).join(", ")} } `:"";return`${e.value}${t}`}function nR(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,$l(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),$l(t.params,r.params)||e.paramsSubject.next(r.params),function c2e(e,t){if(e.length!==t.length)return!1;for(let r=0;r$l(r.parameters,t[n].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||aR(e.parent,t.parent))}function V9(e){return"string"==typeof e.title||null===e.title}let G9=(()=>{class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=en,this.activateEvents=new Uo,this.deactivateEvents=new Uo,this.attachEvents=new Uo,this.detachEvents=new Uo,this.parentContexts=Yt(x1),this.location=Yt(il),this.changeDetector=Yt(Fx),this.environmentInjector=Yt(rl),this.inputBinder=Yt(z_,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(r){if(r.name){const{firstChange:n,previousValue:a}=r.name;if(n)return;this.isTrackedInParentContexts(a)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(a)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(r){return this.parentContexts.getContext(r)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const r=this.parentContexts.getContext(this.name);r?.route&&(r.attachRef?this.attach(r.attachRef,r.route):this.activateWith(r.route,r.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Ot(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Ot(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Ot(4012,!1);this.location.detach();const r=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(r.instance),r}attach(r,n){this.activated=r,this._activatedRoute=n,this.location.insert(r.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(r.instance)}deactivate(){if(this.activated){const r=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(r)}}activateWith(r,n){if(this.isActivated)throw new Ot(4013,!1);this._activatedRoute=r;const a=this.location,o=r.snapshot.component,s=this.parentContexts.getOrCreateContext(this.name).children,u=new Y2e(r,s,a.injector);this.activated=a.createComponent(o,{index:a.length,injector:u,environmentInjector:n??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275dir=Ss({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[ih]})}return e})();class Y2e{constructor(t,r,n){this.route=t,this.childContexts=r,this.parent=n}get(t,r){return t===l0?this.route:t===x1?this.childContexts:this.parent.get(t,r)}}const z_=new sr("");function _1(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const n=r.value;n._futureSnapshot=t.value;const a=function K2e(e,t,r){return t.children.map(n=>{for(const a of r.children)if(e.shouldReuseRoute(n.value,a.value.snapshot))return _1(e,n,a);return _1(e,n)})}(e,t,r);return new cl(n,a)}{if(e.shouldAttach(t.value)){const i=e.retrieve(t.value);if(null!==i){const o=i.route;return o.value._futureSnapshot=t.value,o.children=t.children.map(s=>_1(e,s)),o}}const n=function Z2e(e){return new l0(new Ai(e.url),new Ai(e.params),new Ai(e.queryParams),new Ai(e.fragment),new Ai(e.data),e.outlet,e.component,e)}(t.value),a=t.children.map(i=>_1(e,i));return new cl(n,a)}}const iR="ngNavigationCancelingError";function H9(e,t){const{redirectTo:r,navigationBehaviorOptions:n}=xh(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,a=j9(!1,0,t);return a.url=r,a.navigationBehaviorOptions=n,a}function j9(e,t,r){const n=new Error("NavigationCancelingError: "+(e||""));return n[iR]=!0,n.cancellationCode=t,r&&(n.url=r),n}function q9(e){return e&&e[iR]}let W9=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=NC({type:e,selectors:[["ng-component"]],standalone:!0,features:[t_],decls:1,vars:0,template:function(n,a){1&n&&$b(0,"router-outlet")},dependencies:[G9],encapsulation:2})}return e})();function oR(e){const t=e.children&&e.children.map(oR),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==en&&(r.component=W9),r}function ed(e){return e.outlet||en}function w1(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const r=t.routeConfig;if(r?._loadedInjector)return r._loadedInjector;if(r?._injector)return r._injector}return null}class aCe{constructor(t,r,n,a,i){this.routeReuseStrategy=t,this.futureState=r,this.currState=n,this.forwardEvent=a,this.inputBindingEnabled=i}activate(t){const r=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(r,n,t),nR(this.futureState.root),this.activateChildRoutes(r,n,t)}deactivateChildRoutes(t,r,n){const a=c0(r);t.children.forEach(i=>{const o=i.value.outlet;this.deactivateRoutes(i,a[o],n),delete a[o]}),Object.values(a).forEach(i=>{this.deactivateRouteAndItsChildren(i,n)})}deactivateRoutes(t,r,n){const a=t.value,i=r?r.value:null;if(a===i)if(a.component){const o=n.getContext(a.outlet);o&&this.deactivateChildRoutes(t,r,o.children)}else this.deactivateChildRoutes(t,r,n);else i&&this.deactivateRouteAndItsChildren(r,n)}deactivateRouteAndItsChildren(t,r){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,r):this.deactivateRouteAndOutlet(t,r)}detachAndStoreRouteSubtree(t,r){const n=r.getContext(t.value.outlet),a=n&&t.value.component?n.children:r,i=c0(t);for(const o of Object.keys(i))this.deactivateRouteAndItsChildren(i[o],a);if(n&&n.outlet){const o=n.outlet.detach(),s=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:o,route:t,contexts:s})}}deactivateRouteAndOutlet(t,r){const n=r.getContext(t.value.outlet),a=n&&t.value.component?n.children:r,i=c0(t);for(const o of Object.keys(i))this.deactivateRouteAndItsChildren(i[o],a);n&&(n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated()),n.attachRef=null,n.route=null)}activateChildRoutes(t,r,n){const a=c0(r);t.children.forEach(i=>{this.activateRoutes(i,a[i.value.outlet],n),this.forwardEvent(new j2e(i.value.snapshot))}),t.children.length&&this.forwardEvent(new z2e(t.value.snapshot))}activateRoutes(t,r,n){const a=t.value,i=r?r.value:null;if(nR(a),a===i)if(a.component){const o=n.getOrCreateContext(a.outlet);this.activateChildRoutes(t,r,o.children)}else this.activateChildRoutes(t,r,n);else if(a.component){const o=n.getOrCreateContext(a.outlet);if(this.routeReuseStrategy.shouldAttach(a.snapshot)){const s=this.routeReuseStrategy.retrieve(a.snapshot);this.routeReuseStrategy.store(a.snapshot,null),o.children.onOutletReAttached(s.contexts),o.attachRef=s.componentRef,o.route=s.route.value,o.outlet&&o.outlet.attach(s.componentRef,s.route.value),nR(s.route.value),this.activateChildRoutes(t,null,o.children)}else{const s=w1(a.snapshot);o.attachRef=null,o.route=a,o.injector=s,o.outlet&&o.outlet.activateWith(a,o.injector),this.activateChildRoutes(t,null,o.children)}}else this.activateChildRoutes(t,null,n)}}class Y9{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class H_{constructor(t,r){this.component=t,this.route=r}}function iCe(e,t,r){const n=e._root;return A1(n,t?t._root:null,r,[n.value])}function d0(e,t){const r=Symbol(),n=t.get(e,r);return n===r?"function"!=typeof e||function dce(e){return null!==PC(e)}(e)?t.get(e):e:n}function A1(e,t,r,n,a={canDeactivateChecks:[],canActivateChecks:[]}){const i=c0(t);return e.children.forEach(o=>{(function sCe(e,t,r,n,a={canDeactivateChecks:[],canActivateChecks:[]}){const i=e.value,o=t?t.value:null,s=r?r.getContext(e.value.outlet):null;if(o&&i.routeConfig===o.routeConfig){const u=function uCe(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!Ch(e.url,t.url);case"pathParamsOrQueryParamsChange":return!Ch(e.url,t.url)||!$l(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!aR(e,t)||!$l(e.queryParams,t.queryParams);default:return!aR(e,t)}}(o,i,i.routeConfig.runGuardsAndResolvers);u?a.canActivateChecks.push(new Y9(n)):(i.data=o.data,i._resolvedData=o._resolvedData),A1(e,t,i.component?s?s.children:null:r,n,a),u&&s&&s.outlet&&s.outlet.isActivated&&a.canDeactivateChecks.push(new H_(s.outlet.component,o))}else o&&T1(t,s,a),a.canActivateChecks.push(new Y9(n)),A1(e,null,i.component?s?s.children:null:r,n,a)})(o,i[o.value.outlet],r,n.concat([o.value]),a),delete i[o.value.outlet]}),Object.entries(i).forEach(([o,s])=>T1(s,r.getContext(o),a)),a}function T1(e,t,r){const n=c0(e),a=e.value;Object.entries(n).forEach(([i,o])=>{T1(o,a.component?t?t.children.getContext(i):null:t,r)}),r.canDeactivateChecks.push(new H_(a.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,a))}function D1(e){return"function"==typeof e}function X9(e){return e instanceof M_||"EmptyError"===e?.name}const j_=Symbol("INITIAL_VALUE");function f0(){return nc(e=>c9(e.map(t=>t.pipe(bh(1),function e2e(...e){const t=nb(e);return di((r,n)=>{(t?UM(e,r,t):UM(e,r)).subscribe(n)})}(j_)))).pipe($n(t=>{for(const r of t)if(!0!==r){if(r===j_)return j_;if(!1===r||r instanceof o0)return r}return!0}),uf(t=>t!==j_),bh(1)))}function K9(e){return U5($o(t=>{if(xh(t))throw H9(0,t)}),$n(t=>!0===t))}class sR{constructor(t){this.segmentGroup=t||null}}class uR extends Error{constructor(t){super(),this.urlTree=t}}function p0(e){return R_(new sR(e))}class ECe{constructor(t,r){this.urlSerializer=t,this.urlTree=r}noMatchError(t){return new Ot(4002,!1)}lineralizeSegments(t,r){let n=[],a=r.root;for(;;){if(n=n.concat(a.segments),0===a.numberOfChildren)return Hr(n);if(a.numberOfChildren>1||!a.children[en])return R_(new Ot(4e3,!1));a=a.children[en]}}applyRedirectCommands(t,r,n){const a=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,n);if(r.startsWith("/"))throw new uR(a);return a}applyRedirectCreateUrlTree(t,r,n,a){const i=this.createSegmentGroup(t,r.root,n,a);return new o0(i,this.createQueryParams(r.queryParams,this.urlTree.queryParams),r.fragment)}createQueryParams(t,r){const n={};return Object.entries(t).forEach(([a,i])=>{if("string"==typeof i&&i.startsWith(":")){const s=i.substring(1);n[a]=r[s]}else n[a]=i}),n}createSegmentGroup(t,r,n,a){const i=this.createSegments(t,r.segments,n,a);let o={};return Object.entries(r.children).forEach(([s,u])=>{o[s]=this.createSegmentGroup(t,u,n,a)}),new da(i,o)}createSegments(t,r,n,a){return r.map(i=>i.path.startsWith(":")?this.findPosParam(t,i,a):this.findOrReturn(i,n))}findPosParam(t,r,n){const a=n[r.path.substring(1)];if(!a)throw new Ot(4001,!1);return a}findOrReturn(t,r){let n=0;for(const a of r){if(a.path===t.path)return r.splice(n),a;n++}return t}}const cR={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function ICe(e,t,r,n,a){const i=lR(e,t,r);return i.matched?(n=function $2e(e,t){return e.providers&&!e._injector&&(e._injector=aH(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,n),function ACe(e,t,r,n){const a=t.canMatch;return a&&0!==a.length?Hr(a.map(o=>{const s=d0(o,e);return Gp(function mCe(e){return e&&D1(e.canMatch)}(s)?s.canMatch(t,r):bg(e,()=>s(t,r)))})).pipe(f0(),K9()):Hr(!0)}(n,t,r).pipe($n(o=>!0===o?i:{...cR}))):Hr(i)}function lR(e,t,r){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...cR}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const a=(t.matcher||u2e)(r,e,t);if(!a)return{...cR};const i={};Object.entries(a.posParams??{}).forEach(([s,u])=>{i[s]=u.path});const o=a.consumed.length>0?{...i,...a.consumed[a.consumed.length-1].parameters}:i;return{matched:!0,consumedSegments:a.consumed,remainingSegments:r.slice(a.consumed.length),parameters:o,positionalParamSegments:a.posParams??{}}}function Z9(e,t,r,n){return r.length>0&&function RCe(e,t,r){return r.some(n=>q_(e,t,n)&&ed(n)!==en)}(e,r,n)?{segmentGroup:new da(t,MCe(n,new da(r,e.children))),slicedSegments:[]}:0===r.length&&function OCe(e,t,r){return r.some(n=>q_(e,t,n))}(e,r,n)?{segmentGroup:new da(e.segments,PCe(e,0,r,n,e.children)),slicedSegments:r}:{segmentGroup:new da(e.segments,e.children),slicedSegments:r}}function PCe(e,t,r,n,a){const i={};for(const o of n)if(q_(e,r,o)&&!a[ed(o)]){const s=new da([],{});i[ed(o)]=s}return{...a,...i}}function MCe(e,t){const r={};r[en]=t;for(const n of e)if(""===n.path&&ed(n)!==en){const a=new da([],{});r[ed(n)]=a}return r}function q_(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class NCe{}class UCe{constructor(t,r,n,a,i,o,s){this.injector=t,this.configLoader=r,this.rootComponentType=n,this.config=a,this.urlTree=i,this.paramsInheritanceStrategy=o,this.urlSerializer=s,this.applyRedirects=new ECe(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new Ot(4002,!1)}recognize(){const t=Z9(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe($n(r=>{const n=new tR([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},en,this.rootComponentType,null,{}),a=new cl(n,r),i=new L9("",a),o=function E2e(e,t,r=null,n=null){return E9(D9(e),t,r,n)}(n,[],this.urlTree.queryParams,this.urlTree.fragment);return o.queryParams=this.urlTree.queryParams,i.url=this.urlSerializer.serialize(o),this.inheritParamsAndData(i._root,null),{state:i,tree:o}}))}match(t){return this.processSegmentGroup(this.injector,this.config,t,en).pipe(n0(n=>{if(n instanceof uR)return this.urlTree=n.urlTree,this.match(n.urlTree.root);throw n instanceof sR?this.noMatchError(n):n}))}inheritParamsAndData(t,r){const n=t.value,a=eR(n,r,this.paramsInheritanceStrategy);n.params=Object.freeze(a.params),n.data=Object.freeze(a.data),t.children.forEach(i=>this.inheritParamsAndData(i,n))}processSegmentGroup(t,r,n,a){return 0===n.segments.length&&n.hasChildren()?this.processChildren(t,r,n):this.processSegment(t,r,n,n.segments,a,!0).pipe($n(i=>i instanceof cl?[i]:[]))}processChildren(t,r,n){const a=[];for(const i of Object.keys(n.children))"primary"===i?a.unshift(i):a.push(i);return So(a).pipe(F_(i=>{const o=n.children[i],s=function rCe(e,t){const r=e.filter(n=>ed(n)===t);return r.push(...e.filter(n=>ed(n)!==t)),r}(r,i);return this.processSegmentGroup(t,s,o,i)}),function n2e(e,t){return di(function r2e(e,t,r,n,a){return(i,o)=>{let s=r,u=t,c=0;i.subscribe(fi(o,l=>{const d=c++;u=s?e(u,l,d):(s=!0,l),n&&o.next(u)},a&&(()=>{s&&o.next(u),o.complete()})))}}(e,t,arguments.length>=2,!0))}((i,o)=>(i.push(...o),i)),O_(null),function a2e(e,t){const r=arguments.length>=2;return n=>n.pipe(e?uf((a,i)=>e(a,i,n)):_p,GM(1),r?O_(t):m9(()=>new M_))}(),bs(i=>{if(null===i)return p0(n);const o=Q9(i);return function VCe(e){e.sort((t,r)=>t.value.outlet===en?-1:r.value.outlet===en?1:t.value.outlet.localeCompare(r.value.outlet))}(o),Hr(o)}))}processSegment(t,r,n,a,i,o){return So(r).pipe(F_(s=>this.processSegmentAgainstRoute(s._injector??t,r,s,n,a,i,o).pipe(n0(u=>{if(u instanceof sR)return Hr(null);throw u}))),Sh(s=>!!s),n0(s=>{if(X9(s))return function BCe(e,t,r){return 0===t.length&&!e.children[r]}(n,a,i)?Hr(new NCe):p0(n);throw s}))}processSegmentAgainstRoute(t,r,n,a,i,o,s){return function FCe(e,t,r,n){return!!(ed(e)===n||n!==en&&q_(t,r,e))&&("**"===e.path||lR(t,e,r).matched)}(n,a,i,o)?void 0===n.redirectTo?this.matchSegmentAgainstRoute(t,a,n,i,o):this.allowRedirects&&s?this.expandSegmentAgainstRouteUsingRedirect(t,a,r,n,i,o):p0(a):p0(a)}expandSegmentAgainstRouteUsingRedirect(t,r,n,a,i,o){const{matched:s,consumedSegments:u,positionalParamSegments:c,remainingSegments:l}="**"===a.path?$9(i):lR(r,a,i);if(!s)return p0(r);a.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const d=this.applyRedirects.applyRedirectCommands(u,a.redirectTo,c);return this.applyRedirects.lineralizeSegments(a,d).pipe(bs(f=>this.processSegment(t,n,r,f.concat(l),o,!1)))}matchSegmentAgainstRoute(t,r,n,a,i){let o;return"**"===n.path?(o=Hr($9(a)),r.children={}):o=ICe(r,n,a,t),o.pipe(nc(s=>s.matched?this.getChildConfig(t=n._injector??t,n,a).pipe(nc(({routes:u})=>{const c=n._loadedInjector??t,{consumedSegments:l,remainingSegments:d,parameters:f}=s,p=new tR(l,f,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,function zCe(e){return e.data||{}}(n),ed(n),n.component??n._loadedComponent??null,n,function HCe(e){return e.resolve||{}}(n)),{segmentGroup:m,slicedSegments:h}=Z9(r,l,d,u);if(0===h.length&&m.hasChildren())return this.processChildren(c,u,m).pipe($n(g=>null===g?null:new cl(p,g)));if(0===u.length&&0===h.length)return Hr(new cl(p,[]));const v=ed(n)===i;return this.processSegment(c,u,m,h,v?en:i,!0).pipe($n(g=>new cl(p,g instanceof cl?[g]:[])))})):p0(r)))}getChildConfig(t,r,n){return r.children?Hr({routes:r.children,injector:t}):r.loadChildren?void 0!==r._loadedRoutes?Hr({routes:r._loadedRoutes,injector:r._loadedInjector}):function wCe(e,t,r,n){const a=t.canLoad;return void 0===a||0===a.length?Hr(!0):Hr(a.map(o=>{const s=d0(o,e);return Gp(function lCe(e){return e&&D1(e.canLoad)}(s)?s.canLoad(t,r):bg(e,()=>s(t,r)))})).pipe(f0(),K9())}(t,r,n).pipe(bs(a=>a?this.configLoader.loadChildren(t,r).pipe($o(i=>{r._loadedRoutes=i.routes,r._loadedInjector=i.injector})):function DCe(e){return R_(j9(!1,3))}())):Hr({routes:[],injector:t})}}function GCe(e){const t=e.value.routeConfig;return t&&""===t.path}function Q9(e){const t=[],r=new Set;for(const n of e){if(!GCe(n)){t.push(n);continue}const a=t.find(i=>n.value.routeConfig===i.value.routeConfig);void 0!==a?(a.children.push(...n.children),r.add(a)):t.push(n)}for(const n of r){const a=Q9(n.children);t.push(new cl(n.value,a))}return t.filter(n=>!r.has(n))}function $9(e){return{matched:!0,parameters:e.length>0?v9(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}function J9(e){const t=e.children.map(r=>J9(r)).flat();return[e,...t]}function dR(e){return nc(t=>{const r=e(t);return r?So(r).pipe($n(()=>t)):Hr(t)})}let ej=(()=>{class e{buildTitle(r){let n,a=r.root;for(;void 0!==a;)n=this.getResolvedTitleForRoute(a)??n,a=a.children.find(i=>i.outlet===en);return n}getResolvedTitleForRoute(r){return r.data[h1]}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>Yt(KCe),providedIn:"root"})}return e})(),KCe=(()=>{class e extends ej{constructor(r){super(),this.title=r}updateTitle(r){const n=this.buildTitle(r);void 0!==n&&this.title.setTitle(n)}static#e=this.\u0275fac=function(n){return new(n||e)(an(a9))};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const E1=new sr("",{providedIn:"root",factory:()=>({})}),W_=new sr("ROUTES");let tj=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=Yt(uye)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return Hr(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);const n=Gp(r.loadComponent()).pipe($n(rj),$o(i=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=i}),zM(()=>{this.componentLoaders.delete(r)})),a=new p9(n,()=>new bn).pipe(VM());return this.componentLoaders.set(r,a),a}loadChildren(r,n){if(this.childrenLoaders.get(n))return this.childrenLoaders.get(n);if(n._loadedRoutes)return Hr({routes:n._loadedRoutes,injector:n._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(n);const i=function ZCe(e,t,r,n){return Gp(e.loadChildren()).pipe($n(rj),bs(a=>a instanceof rH||Array.isArray(a)?Hr(a):So(t.compileModuleAsync(a))),$n(a=>{n&&n(e);let i,o,s=!1;return Array.isArray(a)?(o=a,!0):(i=a.create(r).injector,o=i.get(W_,[],{optional:!0,self:!0}).flat()),{routes:o.map(oR),injector:i}}))}(n,this.compiler,r,this.onLoadEndListener).pipe(zM(()=>{this.childrenLoaders.delete(n)})),o=new p9(i,()=>new bn).pipe(VM());return this.childrenLoaders.set(n,o),o}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function rj(e){return function QCe(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let fR=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>Yt($Ce),providedIn:"root"})}return e})(),$Ce=(()=>{class e{shouldProcessUrl(r){return!0}extract(r){return r}merge(r,n){return r}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const nj=new sr("");let Y_=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new bn,this.transitionAbortSubject=new bn,this.configLoader=Yt(tj),this.environmentInjector=Yt(rl),this.urlSerializer=Yt(s0),this.rootContexts=Yt(x1),this.location=Yt(l1),this.inputBindingEnabled=null!==Yt(z_,{optional:!0}),this.titleStrategy=Yt(ej),this.options=Yt(E1,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=Yt(fR),this.createViewTransition=Yt(nj,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>Hr(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=a=>this.events.next(new V2e(a)),this.configLoader.onLoadStartListener=a=>this.events.next(new U2e(a))}complete(){this.transitions?.complete()}handleNavigationRequest(r){const n=++this.navigationId;this.transitions?.next({...this.transitions.value,...r,id:n})}setupNavigations(r,n,a){return this.transitions=new Ai({id:0,currentUrlTree:n,currentRawUrl:n,extractedUrl:this.urlHandlingStrategy.extract(n),urlAfterRedirects:this.urlHandlingStrategy.extract(n),rawUrl:n,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:S1,restoredState:null,currentSnapshot:a.snapshot,targetSnapshot:null,currentRouterState:a,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(uf(i=>0!==i.id),$n(i=>({...i,extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),nc(i=>{this.currentTransition=i;let o=!1,s=!1;return Hr(i).pipe($o(u=>{this.currentNavigation={id:u.id,initialUrl:u.rawUrl,extractedUrl:u.extractedUrl,trigger:u.source,extras:u.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),nc(u=>{const c=!r.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!c&&"reload"!==(u.extras.onSameUrlNavigation??r.onSameUrlNavigation)){const d="";return this.events.next(new C1(u.id,this.urlSerializer.serialize(u.rawUrl),d,0)),u.resolve(null),kl}if(this.urlHandlingStrategy.shouldProcessUrl(u.rawUrl))return Hr(u).pipe(nc(d=>{const f=this.transitions?.getValue();return this.events.next(new KM(d.id,this.urlSerializer.serialize(d.extractedUrl),d.source,d.restoredState)),f!==this.transitions?.getValue()?kl:Promise.resolve(d)}),function jCe(e,t,r,n,a,i){return bs(o=>function kCe(e,t,r,n,a,i,o="emptyOnly"){return new UCe(e,t,r,n,a,o,i).recognize()}(e,t,r,n,o.extractedUrl,a,i).pipe($n(({state:s,tree:u})=>({...o,targetSnapshot:s,urlAfterRedirects:u}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),$o(d=>{i.targetSnapshot=d.targetSnapshot,i.urlAfterRedirects=d.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:d.urlAfterRedirects};const f=new F9(d.id,this.urlSerializer.serialize(d.extractedUrl),this.urlSerializer.serialize(d.urlAfterRedirects),d.targetSnapshot);this.events.next(f)}));if(c&&this.urlHandlingStrategy.shouldProcessUrl(u.currentRawUrl)){const{id:d,extractedUrl:f,source:p,restoredState:m,extras:h}=u,v=new KM(d,this.urlSerializer.serialize(f),p,m);this.events.next(v);const g=k9(0,this.rootComponentType).snapshot;return this.currentTransition=i={...u,targetSnapshot:g,urlAfterRedirects:f,extras:{...h,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=f,Hr(i)}{const d="";return this.events.next(new C1(u.id,this.urlSerializer.serialize(u.extractedUrl),d,1)),u.resolve(null),kl}}),$o(u=>{const c=new B2e(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(c)}),$n(u=>(this.currentTransition=i={...u,guards:iCe(u.targetSnapshot,u.currentSnapshot,this.rootContexts)},i)),function vCe(e,t){return bs(r=>{const{targetSnapshot:n,currentSnapshot:a,guards:{canActivateChecks:i,canDeactivateChecks:o}}=r;return 0===o.length&&0===i.length?Hr({...r,guardsResult:!0}):function gCe(e,t,r,n){return So(e).pipe(bs(a=>function _Ce(e,t,r,n,a){const i=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return i&&0!==i.length?Hr(i.map(s=>{const u=w1(t)??a,c=d0(s,u);return Gp(function pCe(e){return e&&D1(e.canDeactivate)}(c)?c.canDeactivate(e,t,r,n):bg(u,()=>c(e,t,r,n))).pipe(Sh())})).pipe(f0()):Hr(!0)}(a.component,a.route,r,t,n)),Sh(a=>!0!==a,!0))}(o,n,a,e).pipe(bs(s=>s&&function cCe(e){return"boolean"==typeof e}(s)?function yCe(e,t,r,n){return So(t).pipe(F_(a=>UM(function SCe(e,t){return null!==e&&t&&t(new G2e(e)),Hr(!0)}(a.route.parent,n),function bCe(e,t){return null!==e&&t&&t(new H2e(e)),Hr(!0)}(a.route,n),function xCe(e,t,r){const n=t[t.length-1],i=t.slice(0,t.length-1).reverse().map(o=>function oCe(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(o)).filter(o=>null!==o).map(o=>f9(()=>Hr(o.guards.map(u=>{const c=w1(o.node)??r,l=d0(u,c);return Gp(function fCe(e){return e&&D1(e.canActivateChild)}(l)?l.canActivateChild(n,e):bg(c,()=>l(n,e))).pipe(Sh())})).pipe(f0())));return Hr(i).pipe(f0())}(e,a.path,r),function CCe(e,t,r){const n=t.routeConfig?t.routeConfig.canActivate:null;if(!n||0===n.length)return Hr(!0);const a=n.map(i=>f9(()=>{const o=w1(t)??r,s=d0(i,o);return Gp(function dCe(e){return e&&D1(e.canActivate)}(s)?s.canActivate(t,e):bg(o,()=>s(t,e))).pipe(Sh())}));return Hr(a).pipe(f0())}(e,a.route,r))),Sh(a=>!0!==a,!0))}(n,i,e,t):Hr(s)),$n(s=>({...r,guardsResult:s})))})}(this.environmentInjector,u=>this.events.next(u)),$o(u=>{if(i.guardsResult=u.guardsResult,xh(u.guardsResult))throw H9(0,u.guardsResult);const c=new N2e(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot,!!u.guardsResult);this.events.next(c)}),uf(u=>!!u.guardsResult||(this.cancelNavigationTransition(u,"",3),!1)),dR(u=>{if(u.guards.canActivateChecks.length)return Hr(u).pipe($o(c=>{const l=new k2e(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(l)}),nc(c=>{let l=!1;return Hr(c).pipe(function qCe(e,t){return bs(r=>{const{targetSnapshot:n,guards:{canActivateChecks:a}}=r;if(!a.length)return Hr(r);const i=new Set(a.map(u=>u.route)),o=new Set;for(const u of i)if(!o.has(u))for(const c of J9(u))o.add(c);let s=0;return So(o).pipe(F_(u=>i.has(u)?function WCe(e,t,r,n){const a=e.routeConfig,i=e._resolve;return void 0!==a?.title&&!V9(a)&&(i[h1]=a.title),function YCe(e,t,r,n){const a=HM(e);if(0===a.length)return Hr({});const i={};return So(a).pipe(bs(o=>function XCe(e,t,r,n){const a=w1(t)??n,i=d0(e,a);return Gp(i.resolve?i.resolve(t,r):bg(a,()=>i(t,r)))}(e[o],t,r,n).pipe(Sh(),$o(s=>{i[o]=s}))),GM(1),function i2e(e){return $n(()=>e)}(i),n0(o=>X9(o)?kl:R_(o)))}(i,e,t,n).pipe($n(o=>(e._resolvedData=o,e.data=eR(e,e.parent,r).resolve,null)))}(u,n,e,t):(u.data=eR(u,u.parent,e).resolve,Hr(void 0))),$o(()=>s++),GM(1),bs(u=>s===o.size?Hr(r):kl))})}(this.paramsInheritanceStrategy,this.environmentInjector),$o({next:()=>l=!0,complete:()=>{l||this.cancelNavigationTransition(c,"",2)}}))}),$o(c=>{const l=new L2e(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(l)}))}),dR(u=>{const c=l=>{const d=[];l.routeConfig?.loadComponent&&!l.routeConfig._loadedComponent&&d.push(this.configLoader.loadComponent(l.routeConfig).pipe($o(f=>{l.component=f}),$n(()=>{})));for(const f of l.children)d.push(...c(f));return d};return c9(c(u.targetSnapshot.root)).pipe(O_(),bh(1))}),dR(()=>this.afterPreactivation()),nc(()=>{const{currentSnapshot:u,targetSnapshot:c}=i,l=this.createViewTransition?.(this.environmentInjector,u.root,c.root);return l?So(l).pipe($n(()=>i)):Hr(i)}),$n(u=>{const c=function X2e(e,t,r){const n=_1(e,t._root,r?r._root:void 0);return new N9(n,t)}(r.routeReuseStrategy,u.targetSnapshot,u.currentRouterState);return this.currentTransition=i={...u,targetRouterState:c},this.currentNavigation.targetRouterState=c,i}),$o(()=>{this.events.next(new ZM)}),((e,t,r,n)=>$n(a=>(new aCe(t,a.targetRouterState,a.currentRouterState,r,n).activate(e),a)))(this.rootContexts,r.routeReuseStrategy,u=>this.events.next(u),this.inputBindingEnabled),bh(1),$o({next:u=>{o=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new _h(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects))),this.titleStrategy?.updateTitle(u.targetRouterState.snapshot),u.resolve(!0)},complete:()=>{o=!0}}),function o2e(e){return di((t,r)=>{_u(e).subscribe(fi(r,()=>r.complete(),kE)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe($o(u=>{throw u}))),zM(()=>{o||s||this.cancelNavigationTransition(i,"",1),this.currentNavigation?.id===i.id&&(this.currentNavigation=null)}),n0(u=>{if(s=!0,q9(u))this.events.next(new u0(i.id,this.urlSerializer.serialize(i.extractedUrl),u.message,u.cancellationCode)),function Q2e(e){return q9(e)&&xh(e.url)}(u)?this.events.next(new QM(u.url)):i.resolve(!1);else{this.events.next(new G_(i.id,this.urlSerializer.serialize(i.extractedUrl),u,i.targetSnapshot??void 0));try{i.resolve(r.errorHandler(u))}catch(c){i.reject(c)}}return kl}))}))}cancelNavigationTransition(r,n,a){const i=new u0(r.id,this.urlSerializer.serialize(r.extractedUrl),n,a);this.events.next(i),r.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function txe(e){return e!==S1}let rxe=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>Yt(axe),providedIn:"root"})}return e})();class nxe{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let axe=(()=>{class e extends nxe{static#e=this.\u0275fac=(()=>{let r;return function(a){return(r||(r=OI(e)))(a||e)}})();static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),ij=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:()=>Yt(ixe),providedIn:"root"})}return e})(),ixe=(()=>{class e extends ij{constructor(){super(...arguments),this.location=Yt(l1),this.urlSerializer=Yt(s0),this.options=Yt(E1,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=Yt(fR),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new o0,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=k9(0,null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(r){return this.location.subscribe(n=>{"popstate"===n.type&&r(n.url,n.state)})}handleRouterEvent(r,n){if(r instanceof KM)this.stateMemento=this.createStateMemento();else if(r instanceof C1)this.rawUrlTree=n.initialUrl;else if(r instanceof F9){if("eager"===this.urlUpdateStrategy&&!n.extras.skipLocationChange){const a=this.urlHandlingStrategy.merge(n.finalUrl,n.initialUrl);this.setBrowserUrl(a,n)}}else r instanceof ZM?(this.currentUrlTree=n.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(n.finalUrl,n.initialUrl),this.routerState=n.targetRouterState,"deferred"===this.urlUpdateStrategy&&(n.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,n))):r instanceof u0&&(3===r.code||2===r.code)?this.restoreHistory(n):r instanceof G_?this.restoreHistory(n,!0):r instanceof _h&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,n){const a=this.urlSerializer.serialize(r);if(this.location.isCurrentPathEqualTo(a)||n.extras.replaceUrl){const o={...n.extras.state,...this.generateNgRouterState(n.id,this.browserPageId)};this.location.replaceState(a,"",o)}else{const i={...n.extras.state,...this.generateNgRouterState(n.id,this.browserPageId+1)};this.location.go(a,"",i)}}restoreHistory(r,n=!1){if("computed"===this.canceledNavigationResolution){const i=this.currentPageId-this.browserPageId;0!==i?this.location.historyGo(i):this.currentUrlTree===r.finalUrl&&0===i&&(this.resetState(r),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(n&&this.resetState(r),this.resetUrlToCurrentUrlTree())}resetState(r){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(r,n){return"computed"===this.canceledNavigationResolution?{navigationId:r,\u0275routerPageId:n}:{navigationId:r}}static#e=this.\u0275fac=(()=>{let r;return function(a){return(r||(r=OI(e)))(a||e)}})();static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var I1=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(I1||{});function oxe(e){throw e}const sxe={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},uxe={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let cf=(()=>{class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=Yt(LH),this.stateManager=Yt(ij),this.options=Yt(E1,{optional:!0})||{},this.pendingTasks=Yt(VH),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=Yt(Y_),this.urlSerializer=Yt(s0),this.location=Yt(l1),this.urlHandlingStrategy=Yt(fR),this._events=new bn,this.errorHandler=this.options.errorHandler||oxe,this.navigated=!1,this.routeReuseStrategy=Yt(rxe),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=Yt(W_,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!Yt(z_,{optional:!0}),this.eventsSubscription=new Xs,this.isNgZoneEnabled=Yt(ga)instanceof ga&&ga.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:r=>{this.console.warn(r)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const r=this.navigationTransitions.events.subscribe(n=>{try{const a=this.navigationTransitions.currentTransition,i=this.navigationTransitions.currentNavigation;if(null!==a&&null!==i)if(this.stateManager.handleRouterEvent(n,i),n instanceof u0&&0!==n.code&&1!==n.code)this.navigated=!0;else if(n instanceof _h)this.navigated=!0;else if(n instanceof QM){const o=this.urlHandlingStrategy.merge(n.url,a.currentRawUrl),s={skipLocationChange:a.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||txe(a.source)};this.scheduleNavigation(o,S1,null,s,{resolve:a.resolve,reject:a.reject,promise:a.promise})}(function lxe(e){return!(e instanceof ZM||e instanceof QM)})(n)&&this._events.next(n)}catch(a){this.navigationTransitions.transitionAbortSubject.next(a)}});this.eventsSubscription.add(r)}resetRootComponentType(r){this.routerState.root.component=r,this.navigationTransitions.rootComponentType=r}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),S1,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription||(this.nonRouterCurrentEntryChangeSubscription=this.stateManager.registerNonRouterCurrentEntryChangeListener((r,n)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(r,"popstate",n)},0)}))}navigateToSyncWithBrowser(r,n,a){const i={replaceUrl:!0},o=a?.navigationId?a:null;if(a){const u={...a};delete u.navigationId,delete u.\u0275routerPageId,0!==Object.keys(u).length&&(i.state=u)}const s=this.parseUrl(r);this.scheduleNavigation(s,n,o,i)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(r){this.config=r.map(oR),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(r,n={}){const{relativeTo:a,queryParams:i,fragment:o,queryParamsHandling:s,preserveFragment:u}=n,c=u?this.currentUrlTree.fragment:o;let d,l=null;switch(s){case"merge":l={...this.currentUrlTree.queryParams,...i};break;case"preserve":l=this.currentUrlTree.queryParams;break;default:l=i||null}null!==l&&(l=this.removeEmptyProps(l));try{d=D9(a?a.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||!r[0].startsWith("/"))&&(r=[]),d=this.currentUrlTree.root}return E9(d,r,l,c??null)}navigateByUrl(r,n={skipLocationChange:!1}){const a=xh(r)?r:this.parseUrl(r),i=this.urlHandlingStrategy.merge(a,this.rawUrlTree);return this.scheduleNavigation(i,S1,null,n)}navigate(r,n={skipLocationChange:!1}){return function cxe(e){for(let t=0;t{const i=r[a];return null!=i&&(n[a]=i),n},{})}scheduleNavigation(r,n,a,i,o){if(this.disposed)return Promise.resolve(!1);let s,u,c;o?(s=o.resolve,u=o.reject,c=o.promise):c=new Promise((d,f)=>{s=d,u=f});const l=this.pendingTasks.add();return function oj(e,t){e.events.pipe(uf(r=>r instanceof _h||r instanceof u0||r instanceof G_||r instanceof C1),$n(r=>r instanceof _h||r instanceof C1?I1.COMPLETE:r instanceof u0&&(0===r.code||1===r.code)?I1.REDIRECTING:I1.FAILED),uf(r=>r!==I1.REDIRECTING),bh(1)).subscribe(()=>{t()})}(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(l))}),this.navigationTransitions.handleNavigationRequest({source:n,restoredState:a,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:r,extras:i,resolve:s,reject:u,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(d=>Promise.reject(d))}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=Ar({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const mR=new sr("");function uj(e){return e.routerState.root}function cj(){const e=Yt(ac);return t=>{const r=e.get(Jg);if(t!==r.components[0])return;const n=e.get(cf),a=e.get(lj);1===e.get(hR)&&n.initialNavigation(),e.get(dj,null,pn.Optional)?.setUpPreloading(),e.get(mR,null,pn.Optional)?.init(),n.resetRootComponentType(r.componentTypes[0]),a.closed||(a.next(),a.complete(),a.unsubscribe())}}const lj=new sr("",{factory:()=>new bn}),hR=new sr("",{providedIn:"root",factory:()=>1}),dj=new sr(""),bxe={providers:[function hxe(e,...t){return HI([{provide:W_,multi:!0,useValue:e},[],{provide:l0,useFactory:uj,deps:[cf]},{provide:rM,multi:!0,useFactory:cj},t.map(r=>r.\u0275providers)])}([])]};function pj(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,a)}function mj(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(u){pj(i,n,a,o,s,"next",u)}function s(u){pj(i,n,a,o,s,"throw",u)}o(void 0)})}}const vR={now:()=>(vR.delegate||Date).now(),delegate:void 0};class P1 extends bn{constructor(t=1/0,r=1/0,n=vR){super(),this._bufferSize=t,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,r)}next(t){const{isStopped:r,_buffer:n,_infiniteTimeWindow:a,_timestampProvider:i,_windowTime:o}=this;r||(n.push(t),!a&&n.push(i.now()+o)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();const r=this._innerSubscribe(t),{_infiniteTimeWindow:n,_buffer:a}=this,i=a.slice();for(let o=0;o{l9([r,...xxe(e)])(n)})}function vj(...e){return hj(...e)}var lf,e,Vo,tn;(e=lf||(lf={})).create=function t(n){return n},e.getDuration=function r(n,a){var i,o;if(a.customDurationMs)return a.customDurationMs;var s=null===(o=(i=a.definition).getDuration)||void 0===o?void 0:o.call(i,a.params,n);return"fixed"===s?.kind?s.durationMs:void 0},function(e){e.create=function t(a){return a},e.has=function r(a,i){return 0!=(a&i)},e.hasAll=function n(a,i){return!!i&&(a&i)===i}}(Vo||(Vo={})),function(e){e.create=function t(C){return void 0===C&&(C=512),{current:[],offset:0,capacity:C,chunks:[]}},e.getString=function r(C){return C.chunks.length?(C.offset>0&&(C.chunks[C.chunks.length]=C.current.length===C.offset?C.current.join(""):C.current.slice(0,C.offset).join("")),C.chunks.join("")):C.current.length===C.offset?C.current.join(""):C.current.splice(0,C.offset).join("")},e.getSize=function n(C){for(var _=0,x=0,D=C.chunks;x0&&(C.chunks[C.chunks.length]=C.current.length===C.offset?C.current.join(""):C.current.slice(0,C.offset).join(""),C.offset=0),C.chunks};var i=[];function s(C,_){_>0&&l(C,i[_])}function l(C,_){C.offset===C.capacity&&(C.chunks[C.chunks.length]=C.current.join(""),C.offset=0),C.current[C.offset++]=_}!function(){for(var C="",_=0;_<512;_++)i[_]=C,C+=" "}(),e.newline=function o(C){l(C,"\n")},e.whitespace=s,e.whitespace1=function u(C){l(C," ")},e.write=function c(C,_){_&&(C.offset===C.capacity&&(C.chunks[C.chunks.length]=C.current.join(""),C.offset=0),C.current[C.offset++]=_)},e.writeSafe=l,e.writePadLeft=function d(C,_,x){_?(s(C,x-_.length),l(C,_)):s(C,x)},e.writePadRight=function f(C,_,x){if(_){var D=x-_.length;l(C,_),s(C,D)}else s(C,x)},e.writeInteger=function p(C,_){l(C,""+_)},e.writeIntegerAndSpace=function m(C,_){l(C,_+" ")},e.writeIntegerPadLeft=function h(C,_,x){var D=""+_;s(C,x-D.length),l(C,D)},e.writeIntegerPadRight=function v(C,_,x){var D=""+_,w=x-D.length;l(C,D),s(C,w)},e.writeFloat=function g(C,_,x){l(C,""+Math.round(x*_)/x)},e.writeFloatPadLeft=function y(C,_,x,D){var w=""+Math.round(x*_)/x;s(C,D-w.length),l(C,w)},e.writeFloatPadRight=function S(C,_,x,D){var w=""+Math.round(x*_)/x,A=D-w.length;l(C,w),s(C,A)}}(tn||(tn={}));var kn,gj,M1,ia=function(){if(typeof window<"u"&&window.performance){var e=window.performance;return function(){return e.now()}}return typeof process<"u"&&"undefined"!==process.hrtime&&"function"==typeof process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:Date.now?function(){return Date.now()}:function(){return+new Date}}();function gR(e,t){if(void 0===t&&(t=!0),isNaN(e))return"n/a";for(var r=Math.floor(e/36e5),n=Math.floor(e/6e4%60),a=Math.floor(e/1e3%60),i=Math.floor(e%1e3).toString();i.length<3;)i="0"+i;for(;!t&&i.length>1&&"0"===i[i.length-1];)i=i.substr(0,i.length-1);return r>0?"".concat(r,"h").concat(n,"m").concat(a,".").concat(i,"s"):n>0?"".concat(n,"m").concat(a,".").concat(i,"s"):a>0?"".concat(a,".").concat(i,"s"):"".concat(e.toFixed(0),"ms")}function _xe(e,t){return e-t}function Jo(e,t){void 0===e&&(e=0),void 0===t&&(t=Number.MAX_SAFE_INTEGER);var r=e;return function(){var n=r;return r=(r+1)%t,n}}!function(e){var t=typeof btoa<"u"?btoa:function(o){return Buffer.from(o).toString("base64")},r=[];e.create22=function n(){for(var o=+new Date+ia(),s=0;s<16;s++)r[s]=String.fromCharCode((o+255*Math.random())%255|0),o=Math.floor(o/255);return t(r.join("")).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22)},e.createv4=function a(){var o=+new Date+ia();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(u){var c=(o+16*Math.random())%16|0;return o=Math.floor(o/16),("x"===u?c:3&c|8).toString(16)})},e.is=function i(o){return"string"==typeof o}}(kn||(kn={})),function(e){var t=function(){function p(){this.size=0}return p.prototype.has=function(m){return!1},p.prototype.forEach=function(m,h){return h},p}(),r=function(){function p(m){this.idx=m,this.size=1}return p.prototype.has=function(m){return m===this.idx},p.prototype.forEach=function(m,h){return m(this.idx,h),h},p}(),n=function(){function p(m,h){this.mask=m,this.size=h,this.length=m.length}return p.prototype.has=function(m){return mh&&(h=y);if(m===h)return new a(m);if(m/h<1/12){for(var C=new Set,_=0,x=p;_v&&(v=S))}),h/v<1/12){var g=new Set;return m.forEach(function(S){p.has(S)||g.add(S)}),s(g)}var y=new Uint8Array(v+1);return m.forEach(function(S){p.has(S)||(y[S]=1)}),l(y,h)}}(gj||(gj={})),function(e){e.create=function t(n){return{ref:n}},e.set=function r(n,a){return n.ref=a,n}}(M1||(M1={}));var zp,O,Axe=Jo(0,2147483647);!function(e){e.create=function t(n,a){return{id:Axe(),version:0,value:n,metadata:a}},e.withValue=function r(n,a){return{id:n.id,version:n.version+1,value:a,metadata:n.metadata}}}(zp||(zp={})),function(e){function r(i,o){return M1.set(i,zp.withValue(i.ref,o))}e.create=function t(i,o){return M1.create(zp.create(i,o))},e.update=r,e.set=function n(i,o){return M1.set(i,o)},e.updateIfChanged=function a(i,o){return i.ref.value!==o?r(i,o):i}}(O||(O={}));var m0=function(){};function Es(e,t){var r=e.length;if(r!==t.length)return!1;for(var n=0;n>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?h0(e)+t:t}function Cj(){return!0}function B1(e,t,r){return(0===e&&!_j(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function v0(e,t){return xj(e,t,0)}function N1(e,t){return xj(e,t,t)}function xj(e,t,r){return void 0===e?r:_j(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function _j(e){return e<0||0===e&&1/e==-1/0}var wj="@@__IMMUTABLE_ITERABLE__@@";function Ps(e){return!(!e||!e[wj])}var Aj="@@__IMMUTABLE_KEYED__@@";function Da(e){return!(!e||!e[Aj])}var Tj="@@__IMMUTABLE_INDEXED__@@";function es(e){return!(!e||!e[Tj])}function k1(e){return Da(e)||es(e)}var ai=function(t){return Ps(t)?t:Rs(t)},dc=function(e){function t(r){return Da(r)?r:jp(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(ai),wh=function(e){function t(r){return es(r)?r:hc(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(ai),g0=function(e){function t(r){return Ps(r)&&!k1(r)?r:S0(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(ai);ai.Keyed=dc,ai.Indexed=wh,ai.Set=g0;var Dj="@@__IMMUTABLE_SEQ__@@";function Z_(e){return!(!e||!e[Dj])}var Ej="@@__IMMUTABLE_RECORD__@@";function Ah(e){return!(!e||!e[Ej])}function fc(e){return Ps(e)||Ah(e)}var y0="@@__IMMUTABLE_ORDERED__@@";function pc(e){return!(!e||!e[y0])}var L1=0,ll=1,mc=2,SR="function"==typeof Symbol&&Symbol.iterator,Ij="@@iterator",Q_=SR||Ij,Ln=function(t){this.next=t};function ka(e,t,r,n){var a=0===e?t:1===e?r:[t,r];return n?n.value=a:n={value:a,done:!1},n}function Ms(){return{value:void 0,done:!0}}function CR(e){return!!Array.isArray(e)||!!$_(e)}function Pj(e){return e&&"function"==typeof e.next}function xR(e){var t=$_(e);return t&&t.call(e)}function $_(e){var t=e&&(SR&&e[SR]||e[Ij]);if("function"==typeof t)return t}Ln.prototype.toString=function(){return"[Iterator]"},Ln.KEYS=L1,Ln.VALUES=ll,Ln.ENTRIES=mc,Ln.prototype.inspect=Ln.prototype.toSource=function(){return this.toString()},Ln.prototype[Q_]=function(){return this};var b0=Object.prototype.hasOwnProperty;function _R(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var Rs=function(e){function t(r){return null==r?AR():fc(r)?r.toSeq():function Fxe(e){var t=DR(e);if(t)return function Mxe(e){var t=$_(e);return t&&t===e.entries}(e)?t.fromEntrySeq():function Rxe(e){var t=$_(e);return t&&t===e.keys}(e)?t.toSetSeq():t;if("object"==typeof e)return new wR(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,a){var i=this._cache;if(i){for(var o=i.length,s=0;s!==o;){var u=i[a?o-++s:s++];if(!1===n(u[1],u[0],this))break}return s}return this.__iterateUncached(n,a)},t.prototype.__iterator=function(n,a){var i=this._cache;if(i){var o=i.length,s=0;return new Ln(function(){if(s===o)return{value:void 0,done:!0};var u=i[a?o-++s:s++];return ka(n,u[0],u[1])})}return this.__iteratorUncached(n,a)},t}(ai),jp=function(e){function t(r){return null==r?AR().toKeyedSeq():Ps(r)?Da(r)?r.toSeq():r.fromEntrySeq():Ah(r)?r.toSeq():TR(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(Rs),hc=function(e){function t(r){return null==r?AR():Ps(r)?Da(r)?r.entrySeq():r.toIndexedSeq():Ah(r)?r.toSeq().entrySeq():Rj(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(Rs),S0=function(e){function t(r){return(Ps(r)&&!k1(r)?r:hc(r)).toSetSeq()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(Rs);Rs.isSeq=Z_,Rs.Keyed=jp,Rs.Set=S0,Rs.Indexed=hc,Rs.prototype[Dj]=!0;var Th=function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(n,a){return this.has(n)?this._array[Hp(this,n)]:a},t.prototype.__iterate=function(n,a){for(var i=this._array,o=i.length,s=0;s!==o;){var u=a?o-++s:s++;if(!1===n(i[u],u,this))break}return s},t.prototype.__iterator=function(n,a){var i=this._array,o=i.length,s=0;return new Ln(function(){if(s===o)return{value:void 0,done:!0};var u=a?o-++s:s++;return ka(n,u,i[u])})},t}(hc),wR=function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(n,a){return void 0===a||this.has(n)?this._object[n]:a},t.prototype.has=function(n){return b0.call(this._object,n)},t.prototype.__iterate=function(n,a){for(var i=this._object,o=this._keys,s=o.length,u=0;u!==s;){var c=o[a?s-++u:u++];if(!1===n(i[c],c,this))break}return u},t.prototype.__iterator=function(n,a){var i=this._object,o=this._keys,s=o.length,u=0;return new Ln(function(){if(u===s)return{value:void 0,done:!0};var c=o[a?s-++u:u++];return ka(n,c,i[c])})},t}(jp);wR.prototype[y0]=!0;var Mj,Oxe=function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.__iterateUncached=function(n,a){if(a)return this.cacheResult().__iterate(n,a);var o=xR(this._collection),s=0;if(Pj(o))for(var u;!(u=o.next()).done&&!1!==n(u.value,s++,this););return s},t.prototype.__iteratorUncached=function(n,a){if(a)return this.cacheResult().__iterator(n,a);var o=xR(this._collection);if(!Pj(o))return new Ln(Ms);var s=0;return new Ln(function(){var u=o.next();return u.done?u:ka(n,s++,u.value)})},t}(hc);function AR(){return Mj||(Mj=new Th([]))}function TR(e){var t=DR(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new wR(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function Rj(e){var t=DR(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function DR(e){return _R(e)?new Th(e):CR(e)?new Oxe(e):void 0}var Oj="@@__IMMUTABLE_MAP__@@";function J_(e){return!(!e||!e[Oj])}function ER(e){return J_(e)&&pc(e)}function IR(e){return!(!e||"function"!=typeof e.equals||"function"!=typeof e.hashCode)}function xo(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(IR(e)&&IR(t)&&e.equals(t))}var U1="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,r){var n=65535&(t|=0),a=65535&(r|=0);return n*a+((t>>>16)*a+n*(r>>>16)<<16>>>0)|0};function ew(e){return e>>>1&1073741824|3221225471&e}var Bxe=Object.prototype.valueOf;function tu(e){if(null==e)return Fj(e);if("function"==typeof e.hashCode)return ew(e.hashCode(e));var t=function Gxe(e){return e.valueOf!==Bxe&&"function"==typeof e.valueOf?e.valueOf(e):e}(e);if(null==t)return Fj(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return function Nxe(e){if(e!=e||e===1/0)return 0;var t=0|e;for(t!==e&&(t^=4294967295*e);e>4294967295;)t^=e/=4294967295;return ew(t)}(t);case"string":return t.length>zxe?function kxe(e){var t=BR[e];return void 0===t&&(t=PR(e),FR===Hxe&&(FR=0,BR={}),FR++,BR[e]=t),t}(t):PR(t);case"object":case"function":return function Uxe(e){var t;if(MR&&void 0!==(t=RR.get(e))||void 0!==(t=e[Dh])||!Nj&&(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Dh])||(t=function Vxe(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e),void 0!==t)))return t;if(t=kj(),MR)RR.set(e,t);else{if(void 0!==Bj&&!1===Bj(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Nj)Object.defineProperty(e,Dh,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Dh]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Dh]=t}}return t}(t);case"symbol":return function Lxe(e){var t=Lj[e];return void 0!==t||(t=kj(),Lj[e]=t),t}(t);default:if("function"==typeof t.toString)return PR(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function Fj(e){return null===e?1108378658:1108378659}function PR(e){for(var t=0,r=0;r=0&&(c.get=function(l,d){return(l=Hp(this,l))>=0&&lu)return{value:void 0,done:!0};var h=f.next();return n||l===ll||h.done?h:ka(l,m-1,l===L1?void 0:h.value[1],h)})},c}function qj(e,t,r,n){var a=nd(e);return a.__iterateUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterate(i,o);var u=!0,c=0;return e.__iterate(function(l,d,f){if(!u||!(u=t.call(r,l,d,f)))return c++,i(l,n?d:c-1,s)}),c},a.__iteratorUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterator(i,o);var u=e.__iterator(mc,o),c=!0,l=0;return new Ln(function(){var d,f,p;do{if((d=u.next()).done)return n||i===ll?d:ka(i,l++,i===L1?void 0:d.value[1],d);var m=d.value;f=m[0],p=m[1],c&&(c=t.call(r,p,f,s))}while(c);return i===mc?d:ka(i,f,p,d)})},a}function Wj(e,t,r){var n=nd(e);return n.__iterateUncached=function(a,i){if(i)return this.cacheResult().__iterate(a,i);var o=0,s=!1;return function u(c,l){c.__iterate(function(d,f){return(!t||l0}function nw(e,t,r,n){var a=nd(e),i=new Th(r).map(function(o){return o.size});return a.size=n?i.max():i.min(),a.__iterate=function(o,s){for(var c,u=this.__iterator(ll,s),l=0;!(c=u.next()).done&&!1!==o(c.value,l++,this););return l},a.__iteratorUncached=function(o,s){var u=r.map(function(d){return d=ai(d),xR(s?d.reverse():d)}),c=0,l=!1;return new Ln(function(){var d;return l||(d=u.map(function(f){return f.next()}),l=n?d.every(function(f){return f.done}):d.some(function(f){return f.done})),l?{value:void 0,done:!0}:ka(o,c++,t.apply(null,d.map(function(f){return f.value})))})},a}function ba(e,t){return e===t?e:Z_(e)?t:e.constructor(t)}function Xj(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function LR(e){return Da(e)?dc:es(e)?wh:g0}function nd(e){return Object.create((Da(e)?jp:es(e)?hc:S0).prototype)}function UR(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Rs.prototype.cacheResult.call(this)}function Kj(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return iq(this,t,e)}function iq(e,t,r){for(var n=[],a=0;a0;)t[r]=arguments[r+1];return G1(this,t,e)}function XR(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Eh(this,e,dl(),function(n){return z1(n,t)})}function KR(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Eh(this,e,dl(),function(n){return G1(n,t)})}function H1(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function j1(){return this.__ownerID?this:this.__ensureOwner(new bR)}function q1(){return this.__ensureOwner()}function ZR(){return this.__altered}var Mu=function(e){function t(r){return null==r?dl():J_(r)&&!pc(r)?r:dl().withMutations(function(n){var a=e(r);Pu(a.size),a.forEach(function(i,o){return n.set(o,i)})})}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return dl().withMutations(function(i){for(var o=0;o=n.length)throw new Error("Missing value for key: "+n[o]);i.set(n[o],n[o+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,a){return this._root?this._root.get(0,void 0,n,a):a},t.prototype.set=function(n,a){return lq(this,n,a)},t.prototype.remove=function(n){return lq(this,n,An)},t.prototype.deleteAll=function(n){var a=ai(n);return 0===a.size?this:this.withMutations(function(i){a.forEach(function(o){return i.remove(o)})})},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):dl()},t.prototype.sort=function(n){return vc(C0(this,n))},t.prototype.sortBy=function(n,a){return vc(C0(this,a,n))},t.prototype.map=function(n,a){var i=this;return this.withMutations(function(o){o.forEach(function(s,u){o.set(u,n.call(a,s,u,i))})})},t.prototype.__iterator=function(n,a){return new a_e(this,n,a)},t.prototype.__iterate=function(n,a){var i=this,o=0;return this._root&&this._root.iterate(function(s){return o++,n(s[1],s[0],i)},a),o},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?$R(this.size,this._root,n,this.__hash):0===this.size?dl():(this.__ownerID=n,this.__altered=!1,this)},t}(dc);Mu.isMap=J_;var La=Mu.prototype;La[Oj]=!0,La[F1]=La.remove,La.removeAll=La.deleteAll,La.setIn=HR,La.removeIn=La.deleteIn=jR,La.update=WR,La.updateIn=YR,La.merge=La.concat=nq,La.mergeWith=aq,La.mergeDeep=oq,La.mergeDeepWith=sq,La.mergeIn=XR,La.mergeDeepIn=KR,La.withMutations=H1,La.wasAltered=ZR,La.asImmutable=q1,La["@@transducer/init"]=La.asMutable=j1,La["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},La["@@transducer/result"]=function(e){return e.asImmutable()};var W1=function(t,r){this.ownerID=t,this.entries=r};W1.prototype.get=function(t,r,n,a){for(var i=this.entries,o=0,s=i.length;o=l_e)return function i_e(e,t,r,n){e||(e=new bR);for(var a=new df(e,tu(r),[r,n]),i=0;i>>t)&Is),o=this.bitmap;return o&i?this.nodes[fq(o&i-1)].get(t+Na,r,n,a):a},x0.prototype.update=function(t,r,n,a,i,o,s){void 0===n&&(n=tu(a));var u=(0===r?n:n>>>r)&Is,c=1<=d_e)return function s_e(e,t,r,n,a){for(var i=0,o=new Array(cc),s=0;0!==r;s++,r>>>=1)o[s]=1&r?t[i++]:void 0;return o[n]=a,new Y1(e,i+1,o)}(t,p,l,u,h);if(d&&!h&&2===p.length&&dq(p[1^f]))return p[1^f];if(d&&h&&1===p.length&&dq(h))return h;var v=t&&t===this.ownerID,g=d?h?l:l^c:l|c,y=d?h?pq(p,f,h,v):function c_e(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var a=new Array(n),i=0,o=0;o>>t)&Is];return o?o.get(t+Na,r,n,a):a},Y1.prototype.update=function(t,r,n,a,i,o,s){void 0===n&&(n=tu(a));var u=(0===r?n:n>>>r)&Is,l=this.nodes,d=l[u];if(i===An&&!d)return this;var f=JR(d,t,r+Na,n,a,i,o,s);if(f===d)return this;var p=this.count;if(d){if(!f&&--p>>r)&Is,o=(0===r?n:n>>>r)&Is,u=i===o?[eO(e,t,r+Na,n,a)]:(s=new df(t,n,a),i>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function pq(e,t,r,n){var a=n?e:ad(e);return a[t]=r,a}var l_e=cc/4,d_e=cc/2,f_e=cc/4,mq="@@__IMMUTABLE_LIST__@@";function tO(e){return!(!e||!e[mq])}var ff=function(e){function t(r){var n=iw();if(null==r)return n;if(tO(r))return r;var a=e(r),i=a.size;return 0===i?n:(Pu(i),i>0&&i=0&&n=e.size||t<0)return e.withMutations(function(o){t<0?Yp(o,t).set(0,r):Yp(o,0,t+1).set(t,r)});var n=e._tail,a=e._root,i={value:!1};return(t+=e._origin)>=Z1(e._capacity)?n=rO(n,e.__ownerID,0,t,r,i):a=rO(a,e.__ownerID,e._level,t,r,i),i.value?e.__ownerID?(e._root=a,e._tail=n,e.__hash=void 0,e.__altered=!0,e):K1(e._origin,e._capacity,e._level,a,n):e}(this,n,a)},t.prototype.remove=function(n){return this.has(n)?0===n?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,a){return this.splice(n,0,a)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Na,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):iw()},t.prototype.push=function(){var n=arguments,a=this.size;return this.withMutations(function(i){Yp(i,0,a+n.length);for(var o=0;o>>r&Is;if(a>=this.array.length)return new Wp([],t);var o,i=0===a;if(r>0){var s=this.array[a];if((o=s&&s.removeBefore(t,r-Na,n))===s&&i)return this}if(i&&!o)return this;var u=w0(this,t);if(!i)for(var c=0;c>>r&Is;if(a>=this.array.length)return this;if(r>0){var o=this.array[a];if((i=o&&o.removeAfter(t,r-Na,n))===o&&a===this.array.length-1)return this}var s=w0(this,t);return s.array.splice(a+1),i&&(s.array[a]=i),s};var vq,X1={};function hq(e,t){var r=e._origin,n=e._capacity,a=Z1(n),i=e._tail;return function o(c,l,d){return 0===l?function s(c,l){var d=l===a?i&&i.array:c&&c.array,f=l>r?0:r-l,p=n-l;return p>cc&&(p=cc),function(){if(f===p)return X1;var m=t?--p:f++;return d&&d[m]}}(c,d):function u(c,l,d){var f,p=c&&c.array,m=d>r?0:r-d>>l,h=1+(n-d>>l);return h>cc&&(h=cc),function(){for(;;){if(f){var v=f();if(v!==X1)return v;f=null}if(m===h)return X1;var g=t?--h:m++;f=o(p&&p[g],l-Na,d+(g<>>r&Is,s=e&&o0){var c=e&&e.array[o],l=rO(c,t,r-Na,n,a,i);return l===c?e:((u=w0(e,t)).array[o]=l,u)}return s&&e.array[o]===a?e:(i&&lc(i),u=w0(e,t),void 0===a&&o===u.array.length-1?u.array.pop():u.array[o]=a,u)}function w0(e,t){return t&&e&&t===e.ownerID?e:new Wp(e?e.array.slice():[],t)}function gq(e,t){if(t>=Z1(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&Is],n-=Na;return r}}function Yp(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new bR,a=e._origin,i=e._capacity,o=a+t,s=void 0===r?i:r<0?i+r:a+r;if(o===a&&s===i)return e;if(o>=s)return e.clear();for(var u=e._level,c=e._root,l=0;o+l<0;)c=new Wp(c&&c.array.length?[void 0,c]:[],n),l+=1<<(u+=Na);l&&(o+=l,a+=l,s+=l,i+=l);for(var d=Z1(i),f=Z1(s);f>=1<d?new Wp([],n):p;if(p&&f>d&&oNa;v-=Na){var g=d>>>v&Is;h=h.array[g]=w0(h.array[g],n)}h.array[d>>>Na&Is]=p}if(s=f)o-=f,s-=f,u=Na,c=null,m=m&&m.removeBefore(n,0,o);else if(o>a||f>>u&Is;if(y!==f>>>u&Is)break;y&&(l+=(1<a&&(c=c.removeBefore(n,u,o-l)),c&&f>>Na<=cc&&a.size>=2*n.size?(s=(u=a.filter(function(c,l){return void 0!==c&&i!==l})).toKeyedSeq().map(function(c){return c[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=u.__ownerID=e.__ownerID)):(s=n.remove(t),u=i===a.size-1?a.pop():a.set(i,void 0))}else if(o){if(r===a.get(i)[1])return e;s=n,u=a.set(i,[t,r])}else s=n.set(t,a.size),u=a.set(a.size,[t,r]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=u,e.__hash=void 0,e.__altered=!0,e):nO(s,u)}vc.isOrderedMap=ER,vc.prototype[y0]=!0,vc.prototype[F1]=vc.prototype.remove;var Sq="@@__IMMUTABLE_STACK__@@";function ow(e){return!(!e||!e[Sq])}var sw=function(e){function t(r){return null==r?uw():ow(r)?r:uw().pushAll(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,a){var i=this._head;for(n=Hp(this,n);i&&n--;)i=i.next;return i?i.value:a},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(0===arguments.length)return this;for(var a=this.size+arguments.length,i=this._head,o=arguments.length-1;o>=0;o--)i={value:n[o],next:i};return this.__ownerID?(this.size=a,this._head=i,this.__hash=void 0,this.__altered=!0,this):$1(a,i)},t.prototype.pushAll=function(n){if(0===(n=e(n)).size)return this;if(0===this.size&&ow(n))return n;Pu(n.size);var a=this.size,i=this._head;return n.__iterate(function(o){a++,i={value:o,next:i}},!0),this.__ownerID?(this.size=a,this._head=i,this.__hash=void 0,this.__altered=!0,this):$1(a,i)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):uw()},t.prototype.slice=function(n,a){if(B1(n,a,this.size))return this;var i=v0(n,this.size);if(N1(a,this.size)!==this.size)return e.prototype.slice.call(this,n,a);for(var s=this.size-i,u=this._head;i--;)u=u.next;return this.__ownerID?(this.size=s,this._head=u,this.__hash=void 0,this.__altered=!0,this):$1(s,u)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?$1(this.size,this._head,n,this.__hash):0===this.size?uw():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,a){var i=this;if(a)return new Th(this.toArray()).__iterate(function(u,c){return n(u,c,i)},a);for(var o=0,s=this._head;s&&!1!==n(s.value,o++,this);)s=s.next;return o},t.prototype.__iterator=function(n,a){if(a)return new Th(this.toArray()).__iterator(n,a);var i=0,o=this._head;return new Ln(function(){if(o){var s=o.value;return o=o.next,ka(n,i++,s)}return{value:void 0,done:!0}})},t}(wh);sw.isStack=ow;var Cq,Os=sw.prototype;function $1(e,t,r,n){var a=Object.create(Os);return a.size=e,a._head=t,a.__ownerID=r,a.__hash=n,a.__altered=!1,a}function uw(){return Cq||(Cq=$1(0))}Os[Sq]=!0,Os.shift=Os.pop,Os.unshift=Os.push,Os.unshiftAll=Os.pushAll,Os.withMutations=H1,Os.wasAltered=ZR,Os.asImmutable=q1,Os["@@transducer/init"]=Os.asMutable=j1,Os["@@transducer/step"]=function(e,t){return e.unshift(t)},Os["@@transducer/result"]=function(e){return e.asImmutable()};var xq="@@__IMMUTABLE_SET__@@";function cw(e){return!(!e||!e[xq])}function aO(e){return cw(e)&&pc(e)}function iO(e,t){if(e===t)return!0;if(!Ps(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||Da(e)!==Da(t)||es(e)!==es(t)||pc(e)!==pc(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!k1(e);if(pc(e)){var n=e.entries();return t.every(function(u,c){var l=n.next().value;return l&&xo(l[1],u)&&(r||xo(l[0],c))})&&n.next().done}var a=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{a=!0;var i=e;e=t,t=i}var o=!0,s=t.__iterate(function(u,c){if(r?!e.has(u):a?!xo(u,e.get(c,An)):!xo(e.get(c,An),u))return o=!1,!1});return o&&e.size===s}function Ih(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function lw(e){if(!e||"object"!=typeof e)return e;if(!Ps(e)){if(!qp(e))return e;e=Rs(e)}if(Da(e)){var t={};return e.__iterate(function(n,a){t[a]=lw(n)}),t}var r=[];return e.__iterate(function(n){r.push(lw(n))}),r}var J1=function(e){function t(r){return null==r?eS():cw(r)&&!pc(r)?r:eS().withMutations(function(n){var a=e(r);Pu(a.size),a.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(dc(n).keySeq())},t.intersect=function(n){return(n=ai(n).toArray()).length?Go.intersect.apply(t(n.pop()),n):eS()},t.union=function(n){return(n=ai(n).toArray()).length?Go.union.apply(t(n.pop()),n):eS()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return dw(this,this._map.set(n,n))},t.prototype.remove=function(n){return dw(this,this._map.remove(n))},t.prototype.clear=function(){return dw(this,this._map.clear())},t.prototype.map=function(n,a){var i=this,o=!1,s=dw(this,this._map.mapEntries(function(u){var c=u[1],l=n.call(a,c,c,i);return l!==c&&(o=!0),[l,l]},a));return o?s:this},t.prototype.union=function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return 0===(n=n.filter(function(i){return 0!==i.size})).length?this:0!==this.size||this.__ownerID||1!==n.length?this.withMutations(function(i){for(var o=0;o=0&&a=0&&i>>-15,461845907),t=U1(t<<13|t>>>-13,5),t=U1((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ew((t=U1(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(i,o){n=31*n+Oq(tu(i),tu(o))|0}:function(i,o){n=n+Oq(tu(i),tu(o))|0}:t?function(i){n=31*n+tu(i)|0}:function(i){n=n+tu(i)|0}),n)}(this))}});var ts=ai.prototype;ts[wj]=!0,ts[Q_]=ts.values,ts.toJSON=ts.toArray,ts.__toStringMapper=V1,ts.inspect=ts.toSource=function(){return this.toString()},ts.chain=ts.flatMap,ts.contains=ts.includes,Ih(dc,{flip:function(){return ba(this,zj(this))},mapEntries:function(t,r){var n=this,a=0;return ba(this,this.toSeq().map(function(i,o){return t.call(r,[o,i],a++,n)}).fromEntrySeq())},mapKeys:function(t,r){var n=this;return ba(this,this.toSeq().flip().map(function(a,i){return t.call(r,a,i,n)}).flip())}});var tS=dc.prototype;tS[Aj]=!0,tS[Q_]=ts.entries,tS.toJSON=Eq,tS.__toStringMapper=function(e,t){return V1(t)+": "+V1(e)},Ih(wh,{toKeyedSeq:function(){return new tw(this,!1)},filter:function(t,r){return ba(this,jj(this,t,r,!1))},findIndex:function(t,r){var n=this.findEntry(t,r);return n?n[0]:-1},indexOf:function(t){var r=this.keyOf(t);return void 0===r?-1:r},lastIndexOf:function(t){var r=this.lastKeyOf(t);return void 0===r?-1:r},reverse:function(){return ba(this,NR(this,!1))},slice:function(t,r){return ba(this,kR(this,t,r,!1))},splice:function(t,r){var n=arguments.length;if(r=Math.max(r||0,0),0===n||2===n&&!r)return this;t=v0(t,t<0?this.count():this.size);var a=this.slice(0,t);return ba(this,1===n?a:a.concat(ad(arguments,2),this.slice(t+r)))},findLastIndex:function(t,r){var n=this.findLastEntry(t,r);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return ba(this,Wj(this,t,!1))},get:function(t,r){return(t=Hp(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?r:this.find(function(n,a){return a===t},void 0,r)},has:function(t){return(t=Hp(this,t))>=0&&(void 0!==this.size?this.size===1/0||tt?-1:0}function Oq(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}T0.has=ts.includes,T0.contains=T0.includes,T0.keys=T0.values,Ih(jp,tS),Ih(hc,A0),Ih(S0,T0);var gc=function(e){function t(r){return null==r?cO():aO(r)?r:cO().withMutations(function(n){var a=g0(r);Pu(a.size),a.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(dc(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(J1);gc.isOrderedSet=aO;var Bq,Ph=gc.prototype;function Fq(e,t){var r=Object.create(Ph);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function cO(){return Bq||(Bq=Fq(Q1()))}Ph[y0]=!0,Ph.zip=A0.zip,Ph.zipWith=A0.zipWith,Ph.zipAll=A0.zipAll,Ph.__empty=cO,Ph.__make=Fq;var ho=function(t,r){var n;!function S_e(e){if(Ah(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(fc(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var a=function(s){var u=this;if(s instanceof a)return s;if(!(this instanceof a))return new a(s);if(!n){n=!0;var c=Object.keys(t),l=i._indices={};i._name=r,i._keys=c,i._defaultValues=t;for(var d=0;d0&&(At=1/Math.sqrt(At),oe[0]=be[0]*At,oe[1]=be[1]*At,oe[2]=be[2]*At),oe}function ne(oe,be){return oe[0]*be[0]+oe[1]*be[1]+oe[2]*be[2]}function Y(oe,be,Ce){var Qe=be[0],Et=be[1],At=be[2],Zt=Ce[0],Dr=Ce[1],tr=Ce[2];return oe[0]=Et*tr-At*Dr,oe[1]=At*Zt-Qe*tr,oe[2]=Qe*Dr-Et*Zt,oe}e.zero=t,e.clone=function r(oe){var be=t();return be[0]=oe[0],be[1]=oe[1],be[2]=oe[2],be},e.isFinite=function n(oe){return vO(oe[0])&&vO(oe[1])&&vO(oe[2])},e.hasNaN=function a(oe){return isNaN(oe[0])||isNaN(oe[1])||isNaN(oe[2])},e.setNaN=function i(oe){return oe[0]=NaN,oe[1]=NaN,oe[2]=NaN,oe},e.fromObj=function o(oe){return l(oe.x,oe.y,oe.z)},e.toObj=function s(oe){return{x:oe[0],y:oe[1],z:oe[2]}},e.fromArray=function u(oe,be,Ce){return oe[0]=be[Ce+0],oe[1]=be[Ce+1],oe[2]=be[Ce+2],oe},e.toArray=function c(oe,be,Ce){return be[Ce+0]=oe[0],be[Ce+1]=oe[1],be[Ce+2]=oe[2],be},e.create=l,e.ofArray=function d(oe){var be=t();return be[0]=oe[0],be[1]=oe[1],be[2]=oe[2],be},e.set=function f(oe,be,Ce,Qe){return oe[0]=be,oe[1]=Ce,oe[2]=Qe,oe},e.copy=p,e.add=m,e.sub=h,e.mul=function v(oe,be,Ce){return oe[0]=be[0]*Ce[0],oe[1]=be[1]*Ce[1],oe[2]=be[2]*Ce[2],oe},e.div=function g(oe,be,Ce){return oe[0]=be[0]/Ce[0],oe[1]=be[1]/Ce[1],oe[2]=be[2]/Ce[2],oe},e.scale=y,e.scaleAndAdd=S,e.scaleAndSub=function C(oe,be,Ce,Qe){return oe[0]=be[0]-Ce[0]*Qe,oe[1]=be[1]-Ce[1]*Qe,oe[2]=be[2]-Ce[2]*Qe,oe},e.addScalar=function _(oe,be,Ce){return oe[0]=be[0]+Ce,oe[1]=be[1]+Ce,oe[2]=be[2]+Ce,oe},e.subScalar=function x(oe,be,Ce){return oe[0]=be[0]-Ce,oe[1]=be[1]-Ce,oe[2]=be[2]-Ce,oe},e.round=function D(oe,be){return oe[0]=Math.round(be[0]),oe[1]=Math.round(be[1]),oe[2]=Math.round(be[2]),oe},e.ceil=function w(oe,be){return oe[0]=Math.ceil(be[0]),oe[1]=Math.ceil(be[1]),oe[2]=Math.ceil(be[2]),oe},e.floor=function A(oe,be){return oe[0]=Math.floor(be[0]),oe[1]=Math.floor(be[1]),oe[2]=Math.floor(be[2]),oe},e.trunc=function E(oe,be){return oe[0]=Math.trunc(be[0]),oe[1]=Math.trunc(be[1]),oe[2]=Math.trunc(be[2]),oe},e.abs=function I(oe,be){return oe[0]=Math.abs(be[0]),oe[1]=Math.abs(be[1]),oe[2]=Math.abs(be[2]),oe},e.min=function M(oe,be,Ce){return oe[0]=Math.min(be[0],Ce[0]),oe[1]=Math.min(be[1],Ce[1]),oe[2]=Math.min(be[2],Ce[2]),oe},e.max=function F(oe,be,Ce){return oe[0]=Math.max(be[0],Ce[0]),oe[1]=Math.max(be[1],Ce[1]),oe[2]=Math.max(be[2],Ce[2]),oe},e.clamp=function N(oe,be,Ce,Qe){return oe[0]=Math.max(Ce[0],Math.min(Qe[0],be[0])),oe[1]=Math.max(Ce[1],Math.min(Qe[1],be[1])),oe[2]=Math.max(Ce[2],Math.min(Qe[2],be[2])),oe},e.distance=function j(oe,be){var Ce=be[0]-oe[0],Qe=be[1]-oe[1],Et=be[2]-oe[2];return Math.sqrt(Ce*Ce+Qe*Qe+Et*Et)},e.squaredDistance=function U(oe,be){var Ce=be[0]-oe[0],Qe=be[1]-oe[1],Et=be[2]-oe[2];return Ce*Ce+Qe*Qe+Et*Et},e.magnitude=function H(oe){var be=oe[0],Ce=oe[1],Qe=oe[2];return Math.sqrt(be*be+Ce*Ce+Qe*Qe)},e.squaredMagnitude=z,e.setMagnitude=function G(oe,be,Ce){return y(oe,Z(oe,be),Ce)},e.negate=J,e.inverse=function X(oe,be){return oe[0]=1/be[0],oe[1]=1/be[1],oe[2]=1/be[2],oe},e.normalize=Z,e.dot=ne,e.cross=Y,e.lerp=function k(oe,be,Ce,Qe){var Et=be[0],At=be[1],Zt=be[2];return oe[0]=Et+Qe*(Ce[0]-Et),oe[1]=At+Qe*(Ce[1]-At),oe[2]=Zt+Qe*(Ce[2]-Zt),oe};var W=t();function le(oe,be){var Ce=Math.sqrt(z(oe)*z(be));if(0===Ce)return Math.PI/2;var Qe=ne(oe,be)/Ce;return Math.acos(Xi(Qe,-1,1))}e.slerp=function $(oe,be,Ce,Qe){var Et=Xi(ne(be,Ce),-1,1),At=Math.acos(Et)*Qe;return S(W,Ce,be,-Et),Z(W,W),m(oe,y(oe,be,Math.cos(At)),y(W,W,Math.sin(At)))},e.hermite=function K(oe,be,Ce,Qe,Et,At){var Zt=At*At,Dr=Zt*(2*At-3)+1,tr=Zt*(At-2)+At,fn=Zt*(At-1),Qn=Zt*(3-2*At);return oe[0]=be[0]*Dr+Ce[0]*tr+Qe[0]*fn+Et[0]*Qn,oe[1]=be[1]*Dr+Ce[1]*tr+Qe[1]*fn+Et[1]*Qn,oe[2]=be[2]*Dr+Ce[2]*tr+Qe[2]*fn+Et[2]*Qn,oe},e.bezier=function q(oe,be,Ce,Qe,Et,At){var Zt=1-At,Dr=Zt*Zt,tr=At*At,fn=Dr*Zt,Qn=3*At*Dr,ao=3*tr*Zt,ja=tr*At;return oe[0]=be[0]*fn+Ce[0]*Qn+Qe[0]*ao+Et[0]*ja,oe[1]=be[1]*fn+Ce[1]*Qn+Qe[1]*ao+Et[1]*ja,oe[2]=be[2]*fn+Ce[2]*Qn+Qe[2]*ao+Et[2]*ja,oe},e.quadraticBezier=function V(oe,be,Ce,Qe,Et){return oe[0]=hO(be[0],Ce[0],Qe[0],Et),oe[1]=hO(be[1],Ce[1],Qe[1],Et),oe[2]=hO(be[2],Ce[2],Qe[2],Et),oe},e.spline=function ee(oe,be,Ce,Qe,Et,At,Zt){return oe[0]=fw(be[0],Ce[0],Qe[0],Et[0],At,Zt),oe[1]=fw(be[1],Ce[1],Qe[1],Et[1],At,Zt),oe[2]=fw(be[2],Ce[2],Qe[2],Et[2],At,Zt),oe},e.random=function ae(oe,be){var Ce=2*Math.random()*Math.PI,Qe=2*Math.random()-1,Et=Math.sqrt(1-Qe*Qe)*be;return oe[0]=Math.cos(Ce)*Et,oe[1]=Math.sin(Ce)*Et,oe[2]=Qe*be,oe},e.transformMat4=function pe(oe,be,Ce){var Qe=be[0],Et=be[1],At=be[2],Zt=1/(Ce[3]*Qe+Ce[7]*Et+Ce[11]*At+Ce[15]||1);return oe[0]=(Ce[0]*Qe+Ce[4]*Et+Ce[8]*At+Ce[12])*Zt,oe[1]=(Ce[1]*Qe+Ce[5]*Et+Ce[9]*At+Ce[13])*Zt,oe[2]=(Ce[2]*Qe+Ce[6]*Et+Ce[10]*At+Ce[14])*Zt,oe},e.transformDirection=function me(oe,be,Ce){var Qe=be[0],Et=be[1],At=be[2];return oe[0]=Ce[0]*Qe+Ce[4]*Et+Ce[8]*At,oe[1]=Ce[1]*Qe+Ce[5]*Et+Ce[9]*At,oe[2]=Ce[2]*Qe+Ce[6]*Et+Ce[10]*At,Z(oe,oe)},e.transformMat4Offset=function de(oe,be,Ce,Qe,Et,At){var Zt=be[0+Et],Dr=be[1+Et],tr=be[2+Et],fn=1/(Ce[3+At]*Zt+Ce[7+At]*Dr+Ce[11+At]*tr+Ce[15+At]||1);return oe[0+Qe]=(Ce[0+At]*Zt+Ce[4+At]*Dr+Ce[8+At]*tr+Ce[12+At])*fn,oe[1+Qe]=(Ce[1+At]*Zt+Ce[5+At]*Dr+Ce[9+At]*tr+Ce[13+At])*fn,oe[2+Qe]=(Ce[2+At]*Zt+Ce[6+At]*Dr+Ce[10+At]*tr+Ce[14+At])*fn,oe},e.transformMat3=function re(oe,be,Ce){var Qe=be[0],Et=be[1],At=be[2];return oe[0]=Qe*Ce[0]+Et*Ce[3]+At*Ce[6],oe[1]=Qe*Ce[1]+Et*Ce[4]+At*Ce[7],oe[2]=Qe*Ce[2]+Et*Ce[5]+At*Ce[8],oe},e.transformQuat=function te(oe,be,Ce){var Qe=be[0],Et=be[1],At=be[2],Zt=Ce[0],Dr=Ce[1],tr=Ce[2],fn=Ce[3],Qn=fn*Qe+Dr*At-tr*Et,ao=fn*Et+tr*Qe-Zt*At,ja=fn*At+Zt*Et-Dr*Qe,Gi=-Zt*Qe-Dr*Et-tr*At;return oe[0]=Qn*fn+Gi*-Zt+ao*-tr-ja*-Dr,oe[1]=ao*fn+Gi*-Dr+ja*-Zt-Qn*-tr,oe[2]=ja*fn+Gi*-tr+Qn*-Dr-ao*-Zt,oe},e.angle=le;var ge=t(),xe=t(),Ge=t(),je=t(),L=t(),Q=t(),ye=t();e.dihedralAngle=function we(oe,be,Ce,Qe){h(ge,oe,be),h(xe,Ce,be),h(Ge,be,Ce),h(je,Qe,Ce),Y(L,ge,xe),Y(Q,Ge,je);var Et=le(L,Q);return Y(ye,L,Q),ne(xe,ye)>0?Et:-Et},e.directionFromSpherical=function De(oe,be,Ce,Qe){return e.set(oe,Qe*Math.cos(Ce)*Math.sin(be),Qe*Math.sin(Ce)*Math.sin(be),Qe*Math.cos(be))},e.exactEquals=function Oe(oe,be){return oe[0]===be[0]&&oe[1]===be[1]&&oe[2]===be[2]},e.equals=function Ne(oe,be){var Ce=oe[0],Qe=oe[1],Et=oe[2],At=be[0],Zt=be[1],Dr=be[2];return Math.abs(Ce-At)<=mn*Math.max(1,Math.abs(Ce),Math.abs(At))&&Math.abs(Qe-Zt)<=mn*Math.max(1,Math.abs(Qe),Math.abs(Zt))&&Math.abs(Et-Dr)<=mn*Math.max(1,Math.abs(Et),Math.abs(Dr))};var Ue=t();e.makeRotation=function $e(oe,be,Ce){var Qe=le(be,Ce);if(Math.abs(Qe)<1e-4)return he.setIdentity(oe);if(Math.abs(Qe-Math.PI)0?p(oe,be):J(oe,p(oe,be)),oe};var Ct=t(),bt=t();e.triangleNormal=function Mt(oe,be,Ce,Qe){return h(Ct,Ce,be),h(bt,Qe,be),Z(oe,Y(oe,Ct,bt))},e.toString=function Rt(oe,be){return"[".concat(oe[0].toPrecision(be)," ").concat(oe[1].toPrecision(be)," ").concat(oe[2].toPrecision(be),"]")},e.origin=l(0,0,0),e.unit=l(1,1,1),e.negUnit=l(-1,-1,-1),e.unitX=l(1,0,0),e.unitY=l(0,1,0),e.unitZ=l(0,0,1),e.negUnitX=l(-1,0,0),e.negUnitY=l(0,-1,0),e.negUnitZ=l(0,0,-1)}(b||(b={}));var Sr,rS=Math.PI/2,Lq=Math.PI/180;function Yr(e){return e*Lq}function Ru(e){return e/Lq}function nS(e){return 0!==e&&0==(e&e-1)}function Uq(e,t){return e*t}function he(){return he.zero()}function Qt(){return Qt.zero()}function Be(){return Be.zero()}function dr(){return dr.zero()}function pw(e){return Object.keys(e)}function Sn(e){throw new Error("unreachable")}function mw(e){return"function"==typeof e?.then}function hn(){return hn.zero()}!function(e){function t(){var L=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];return L[0]=0,L}function r(){var L=t();return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}function n(L){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}function a(L){for(var Q=0;Q<16;Q++)L[Q]=0;return L}e.zero=t,e.identity=r,e.setIdentity=n,e.setZero=a,e.ofRows=function i(L){for(var Q=t(),ye=0;ye<4;ye++)for(var we=L[ye],De=0;De<4;De++)Q[4*De+ye]=we[De];return Q};var o=r();function c(L,Q,ye){for(var we=0;we<16;we++)if(Math.abs(L[we]-Q[we])>ye)return!1;return!0}function l(L,Q,ye,we){L[4*ye+Q]=we}function h(L,Q){return L[0]=Q[0],L[1]=Q[1],L[2]=Q[2],L[3]=Q[3],L[4]=Q[4],L[5]=Q[5],L[6]=Q[6],L[7]=Q[7],L[8]=Q[8],L[9]=Q[9],L[10]=Q[10],L[11]=Q[11],L[12]=Q[12],L[13]=Q[13],L[14]=Q[14],L[15]=Q[15],L}function S(L,Q){var ye=Q[0]+Q[5]+Q[10],we=0;return ye>0?(we=2*Math.sqrt(ye+1),L[3]=.25*we,L[0]=(Q[6]-Q[9])/we,L[1]=(Q[8]-Q[2])/we,L[2]=(Q[1]-Q[4])/we):Q[0]>Q[5]&&Q[0]>Q[10]?(we=2*Math.sqrt(1+Q[0]-Q[5]-Q[10]),L[3]=(Q[6]-Q[9])/we,L[0]=.25*we,L[1]=(Q[1]+Q[4])/we,L[2]=(Q[8]+Q[2])/we):Q[5]>Q[10]?(we=2*Math.sqrt(1+Q[5]-Q[0]-Q[10]),L[3]=(Q[8]-Q[2])/we,L[0]=(Q[1]+Q[4])/we,L[1]=.25*we,L[2]=(Q[6]+Q[9])/we):(we=2*Math.sqrt(1+Q[10]-Q[0]-Q[5]),L[3]=(Q[1]-Q[4])/we,L[0]=(Q[8]+Q[2])/we,L[1]=(Q[6]+Q[9])/we,L[2]=.25*we),L}function x(L,Q){var ye=Q[0],we=Q[1],De=Q[2],Oe=Q[3],Ne=Q[4],Ue=Q[5],$e=Q[6],Ie=Q[7],He=Q[8],Je=Q[9],mt=Q[10],ut=Q[11],St=Q[12],wt=Q[13],Le=Q[14],it=Q[15],Ct=ye*Ue-we*Ne,bt=ye*$e-De*Ne,Mt=ye*Ie-Oe*Ne,Rt=we*$e-De*Ue,oe=we*Ie-Oe*Ue,be=De*Ie-Oe*$e,Ce=He*wt-Je*St,Qe=He*Le-mt*St,Et=He*it-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,L[8]=(bt=ye[8])*we+(Mt=ye[9])*Ue+(Rt=ye[10])*Je+(oe=ye[11])*wt,L[9]=bt*De+Mt*$e+Rt*mt+oe*Le,L[10]=bt*Oe+Mt*Ie+Rt*ut+oe*it,L[11]=bt*Ne+Mt*He+Rt*St+oe*Ct,L[12]=(bt=ye[12])*we+(Mt=ye[13])*Ue+(Rt=ye[14])*Je+(oe=ye[15])*wt,L[13]=bt*De+Mt*$e+Rt*mt+oe*Le,L[14]=bt*Oe+Mt*Ie+Rt*ut+oe*it,L[15]=bt*Ne+Mt*He+Rt*St+oe*Ct,L}function U(L,Q,ye){var we=ye[0],De=ye[1],Oe=ye[2],Ne=Math.sqrt(we*we+De*De+Oe*Oe);if(Math.abs(Ne)"u"?mn:Q)},e.hasNaN=function u(L){for(var Q=0;Q<16;Q++)if(isNaN(L[Q]))return!0;return!1},e.areEqual=c,e.setValue=l,e.getValue=function d(L,Q,ye){return L[4*ye+Q]},e.toArray=function f(L,Q,ye){return Q[ye+0]=L[0],Q[ye+1]=L[1],Q[ye+2]=L[2],Q[ye+3]=L[3],Q[ye+4]=L[4],Q[ye+5]=L[5],Q[ye+6]=L[6],Q[ye+7]=L[7],Q[ye+8]=L[8],Q[ye+9]=L[9],Q[ye+10]=L[10],Q[ye+11]=L[11],Q[ye+12]=L[12],Q[ye+13]=L[13],Q[ye+14]=L[14],Q[ye+15]=L[15],Q},e.fromArray=function p(L,Q,ye){return L[0]=Q[ye+0],L[1]=Q[ye+1],L[2]=Q[ye+2],L[3]=Q[ye+3],L[4]=Q[ye+4],L[5]=Q[ye+5],L[6]=Q[ye+6],L[7]=Q[ye+7],L[8]=Q[ye+8],L[9]=Q[ye+9],L[10]=Q[ye+10],L[11]=Q[ye+11],L[12]=Q[ye+12],L[13]=Q[ye+13],L[14]=Q[ye+14],L[15]=Q[ye+15],L},e.fromBasis=function m(L,Q,ye,we){return a(L),l(L,0,0,Q[0]),l(L,1,0,Q[1]),l(L,2,0,Q[2]),l(L,0,1,ye[0]),l(L,1,1,ye[1]),l(L,2,1,ye[2]),l(L,0,2,we[0]),l(L,1,2,we[1]),l(L,2,2,we[2]),l(L,3,3,1),L},e.copy=h,e.clone=function v(L){return h(t(),L)},e.getTranslation=function g(L,Q){return L[0]=Q[12],L[1]=Q[13],L[2]=Q[14],L},e.getScaling=function y(L,Q){var ye=Q[0],we=Q[1],De=Q[2],Oe=Q[4],Ne=Q[5],Ue=Q[6],$e=Q[8],Ie=Q[9],He=Q[10];return L[0]=Math.sqrt(ye*ye+we*we+De*De),L[1]=Math.sqrt(Oe*Oe+Ne*Ne+Ue*Ue),L[2]=Math.sqrt($e*$e+Ie*Ie+He*He),L},e.getRotation=S,e.extractRotation=function C(L,Q){var ye=1/Math.sqrt(Q[0]*Q[0]+Q[1]*Q[1]+Q[2]*Q[2]),we=1/Math.sqrt(Q[4]*Q[4]+Q[5]*Q[5]+Q[6]*Q[6]),De=1/Math.sqrt(Q[8]*Q[8]+Q[9]*Q[9]+Q[10]*Q[10]);return L[0]=Q[0]*ye,L[1]=Q[1]*ye,L[2]=Q[2]*ye,L[3]=0,L[4]=Q[4]*we,L[5]=Q[5]*we,L[6]=Q[6]*we,L[7]=0,L[8]=Q[8]*De,L[9]=Q[9]*De,L[10]=Q[10]*De,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L},e.transpose=function _(L,Q){if(L===Q){var ye=Q[1],we=Q[2],De=Q[3],Oe=Q[6],Ne=Q[7],Ue=Q[11];L[1]=Q[4],L[2]=Q[8],L[3]=Q[12],L[4]=ye,L[6]=Q[9],L[7]=Q[13],L[8]=we,L[9]=Oe,L[11]=Q[14],L[12]=De,L[13]=Ne,L[14]=Ue}else L[0]=Q[0],L[1]=Q[4],L[2]=Q[8],L[3]=Q[12],L[4]=Q[1],L[5]=Q[5],L[6]=Q[9],L[7]=Q[13],L[8]=Q[2],L[9]=Q[6],L[10]=Q[10],L[11]=Q[14],L[12]=Q[3],L[13]=Q[7],L[14]=Q[11],L[15]=Q[15];return L},e.tryInvert=x,e.invert=function D(L,Q){return x(L,Q)||console.warn("non-invertible matrix.",Q),L},e.mul=w,e.mulOffset=function A(L,Q,ye,we,De,Oe){var Ne=Q[0+De],Ue=Q[1+De],$e=Q[2+De],Ie=Q[3+De],He=Q[4+De],Je=Q[5+De],mt=Q[6+De],ut=Q[7+De],St=Q[8+De],wt=Q[9+De],Le=Q[10+De],it=Q[11+De],Ct=Q[12+De],bt=Q[13+De],Mt=Q[14+De],Rt=Q[15+De],oe=ye[0+Oe],be=ye[1+Oe],Ce=ye[2+Oe],Qe=ye[3+Oe];return L[0+we]=oe*Ne+be*He+Ce*St+Qe*Ct,L[1+we]=oe*Ue+be*Je+Ce*wt+Qe*bt,L[2+we]=oe*$e+be*mt+Ce*Le+Qe*Mt,L[3+we]=oe*Ie+be*ut+Ce*it+Qe*Rt,L[4+we]=(oe=ye[4+Oe])*Ne+(be=ye[5+Oe])*He+(Ce=ye[6+Oe])*St+(Qe=ye[7+Oe])*Ct,L[5+we]=oe*Ue+be*Je+Ce*wt+Qe*bt,L[6+we]=oe*$e+be*mt+Ce*Le+Qe*Mt,L[7+we]=oe*Ie+be*ut+Ce*it+Qe*Rt,L[8+we]=(oe=ye[8+Oe])*Ne+(be=ye[9+Oe])*He+(Ce=ye[10+Oe])*St+(Qe=ye[11+Oe])*Ct,L[9+we]=oe*Ue+be*Je+Ce*wt+Qe*bt,L[10+we]=oe*$e+be*mt+Ce*Le+Qe*Mt,L[11+we]=oe*Ie+be*ut+Ce*it+Qe*Rt,L[12+we]=(oe=ye[12+Oe])*Ne+(be=ye[13+Oe])*He+(Ce=ye[14+Oe])*St+(Qe=ye[15+Oe])*Ct,L[13+we]=oe*Ue+be*Je+Ce*wt+Qe*bt,L[14+we]=oe*$e+be*mt+Ce*Le+Qe*Mt,L[15+we]=oe*Ie+be*ut+Ce*it+Qe*Rt,L},e.mul3=function E(L,Q,ye,we){return w(L,w(L,Q,ye),we)},e.translate=function I(L,Q,ye){var Ne,Ue,$e,Ie,He,Je,mt,ut,St,wt,Le,it,we=ye[0],De=ye[1],Oe=ye[2];return Q===L?(L[12]=Q[0]*we+Q[4]*De+Q[8]*Oe+Q[12],L[13]=Q[1]*we+Q[5]*De+Q[9]*Oe+Q[13],L[14]=Q[2]*we+Q[6]*De+Q[10]*Oe+Q[14],L[15]=Q[3]*we+Q[7]*De+Q[11]*Oe+Q[15]):(Ue=Q[1],$e=Q[2],Ie=Q[3],He=Q[4],Je=Q[5],mt=Q[6],ut=Q[7],St=Q[8],wt=Q[9],Le=Q[10],it=Q[11],L[0]=Ne=Q[0],L[1]=Ue,L[2]=$e,L[3]=Ie,L[4]=He,L[5]=Je,L[6]=mt,L[7]=ut,L[8]=St,L[9]=wt,L[10]=Le,L[11]=it,L[12]=Ne*we+He*De+St*Oe+Q[12],L[13]=Ue*we+Je*De+wt*Oe+Q[13],L[14]=$e*we+mt*De+Le*Oe+Q[14],L[15]=Ie*we+ut*De+it*Oe+Q[15]),L},e.fromTranslation=function M(L,Q){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=Q[0],L[13]=Q[1],L[14]=Q[2],L[15]=1,L},e.setTranslation=function F(L,Q){return L[12]=Q[0],L[13]=Q[1],L[14]=Q[2],L},e.setAxes=function N(L,Q,ye,we){return L[0]=ye[0],L[4]=ye[1],L[8]=ye[2],L[1]=we[0],L[5]=we[1],L[9]=we[2],L[2]=Q[0],L[6]=Q[1],L[10]=Q[2],L},e.rotate=function j(L,Q,ye,we){var De=we[0],Oe=we[1],Ne=we[2],Ue=Math.sqrt(De*De+Oe*Oe+Ne*Ne);if(Math.abs(Ue)0&&(He*=ut=1/Math.sqrt(ut),Je*=ut,mt*=ut);var St=$e*mt-Ie*Je,wt=Ie*He-Ue*mt,Le=Ue*Je-$e*He;return(ut=St*St+wt*wt+Le*Le)>0&&(St*=ut=1/Math.sqrt(ut),wt*=ut,Le*=ut),L[0]=St,L[1]=wt,L[2]=Le,L[3]=0,L[4]=Je*Le-mt*wt,L[5]=mt*St-He*Le,L[6]=He*wt-Je*St,L[7]=0,L[8]=He,L[9]=Je,L[10]=mt,L[11]=0,L[12]=De,L[13]=Oe,L[14]=Ne,L[15]=1,L},e.fromPermutation=function le(L,Q){a(L);for(var ye=0;ye<4;ye++)l(L,ye,Q[ye],1);return L},e.getMaxScaleOnAxis=function ge(L){return Math.sqrt(Math.max(L[0]*L[0]+L[1]*L[1]+L[2]*L[2],L[4]*L[4]+L[5]*L[5]+L[6]*L[6],L[8]*L[8]+L[9]*L[9]+L[10]*L[10]))};var xe=[1,0,0],Ge=[0,1,0],je=[0,0,1];e.rotX90=U(t(),Yr(90),xe),e.rotX180=U(t(),Yr(180),xe),e.rotY90=U(t(),Yr(90),Ge),e.rotY180=U(t(),Yr(180),Ge),e.rotY270=U(t(),Yr(270),Ge),e.rotZ90=U(t(),Yr(90),je),e.rotZ180=U(t(),Yr(180),je),e.rotXY90=w(t(),e.rotX90,e.rotY90),e.rotZY90=w(t(),e.rotZ90,e.rotY90),e.rotZYZ90=w(t(),e.rotZY90,e.rotZ90),e.rotZ90X180=w(t(),e.rotZ90,e.rotX180),e.rotY90Z180=w(t(),e.rotY90,e.rotZ180),e.id=r()}(he||(he={})),function(e){function t(){var k=[.1,0,0,0,0,0,0,0,0];return k[0]=0,k}function r(){var k=t();return k[0]=1,k[1]=0,k[2]=0,k[3]=0,k[4]=1,k[5]=0,k[6]=0,k[7]=0,k[8]=1,k}function s(k,W){return k[0]=W[0],k[1]=W[1],k[2]=W[2],k[3]=W[4],k[4]=W[5],k[5]=W[6],k[6]=W[8],k[7]=W[9],k[8]=W[10],k}e.zero=t,e.identity=r,e.setIdentity=function n(k){return k[0]=1,k[1]=0,k[2]=0,k[3]=0,k[4]=1,k[5]=0,k[6]=0,k[7]=0,k[8]=1,k},e.toArray=function a(k,W,$){return W[$+0]=k[0],W[$+1]=k[1],W[$+2]=k[2],W[$+3]=k[3],W[$+4]=k[4],W[$+5]=k[5],W[$+6]=k[6],W[$+7]=k[7],W[$+8]=k[8],W},e.fromArray=function i(k,W,$){return k[0]=W[$+0],k[1]=W[$+1],k[2]=W[$+2],k[3]=W[$+3],k[4]=W[$+4],k[5]=W[$+5],k[6]=W[$+6],k[7]=W[$+7],k[8]=W[$+8],k},e.fromColumns=function o(k,W,$,K){return k[0]=W[0],k[1]=W[1],k[2]=W[2],k[3]=$[0],k[4]=$[1],k[5]=$[2],k[6]=K[0],k[7]=K[1],k[8]=K[2],k},e.fromMat4=s,e.create=function u(k,W,$,K,q,V,ee,ae,pe){var me=t();return me[0]=k,me[1]=W,me[2]=$,me[3]=K,me[4]=q,me[5]=V,me[6]=ee,me[7]=ae,me[8]=pe,me};var c=r();function p(k,W,$){for(var K=0;K<9;K++)if(Math.abs(k[K]-W[K])>$)return!1;return!0}function v(k,W){return k[0]=W[0],k[1]=W[1],k[2]=W[2],k[3]=W[3],k[4]=W[4],k[5]=W[5],k[6]=W[6],k[7]=W[7],k[8]=W[8],k}function g(k,W){if(k===W){var $=W[1],K=W[2],q=W[5];k[1]=W[3],k[2]=W[6],k[3]=$,k[5]=W[7],k[6]=K,k[7]=q}else k[0]=W[0],k[1]=W[3],k[2]=W[6],k[3]=W[1],k[4]=W[4],k[5]=W[7],k[6]=W[2],k[7]=W[5],k[8]=W[8];return k}function y(k,W){var $=W[0],K=W[1],q=W[2],V=W[3],ee=W[4],ae=W[5],pe=W[6],me=W[7],de=W[8],re=de*ee-ae*me,te=-de*V+ae*pe,le=me*V-ee*pe,ge=$*re+K*te+q*le;return ge?(k[0]=re*(ge=1/ge),k[1]=(-de*K+q*me)*ge,k[2]=(ae*K-q*ee)*ge,k[3]=te*ge,k[4]=(de*$-q*pe)*ge,k[5]=(-ae*$+q*V)*ge,k[6]=le*ge,k[7]=(-me*$+K*pe)*ge,k[8]=(ee*$-K*V)*ge,k):(console.warn("non-invertible matrix.",W),k)}function _(k){var q=k[3],V=k[4],ee=k[5],ae=k[6],pe=k[7],me=k[8];return k[0]*(me*V-ee*pe)+k[1]*(-me*q+ee*ae)+k[2]*(pe*q-V*ae)}function x(k){return k[0]+k[4]+k[8]}function D(k,W,$){return k[0]=W[0]-$[0],k[1]=W[1]-$[1],k[2]=W[2]-$[2],k[3]=W[3]-$[3],k[4]=W[4]-$[4],k[5]=W[5]-$[5],k[6]=W[6]-$[6],k[7]=W[7]-$[7],k[8]=W[8]-$[8],k}function M(k,W,$){return k[0]=W[0]*$,k[1]=W[1]*$,k[2]=W[2]*$,k[3]=W[3]*$,k[4]=W[4]*$,k[5]=W[5]*$,k[6]=W[6]*$,k[7]=W[7]*$,k[8]=W[8]*$,k}e.isIdentity=function l(k,W){return p(k,c,typeof W>"u"?mn:W)},e.hasNaN=function d(k){for(var W=0;W<9;W++)if(isNaN(k[W]))return!0;return!1},e.clone=function f(k){return v(t(),k)},e.areEqual=p,e.setValue=function m(k,W,$,K){k[3*$+W]=K},e.getValue=function h(k,W,$){return k[3*$+W]},e.copy=v,e.transpose=g,e.invert=y,e.symmtricFromUpper=function S(k,W){return k===W?(k[3]=W[1],k[6]=W[2],k[7]=W[5]):(k[0]=W[0],k[1]=W[1],k[2]=W[2],k[3]=W[1],k[4]=W[4],k[5]=W[5],k[6]=W[2],k[7]=W[5],k[8]=W[8]),k},e.symmtricFromLower=function C(k,W){return k===W?(k[1]=W[3],k[2]=W[6],k[5]=W[7]):(k[0]=W[0],k[1]=W[3],k[2]=W[6],k[3]=W[3],k[4]=W[4],k[5]=W[7],k[6]=W[6],k[7]=W[7],k[8]=W[8]),k},e.determinant=_,e.trace=x,e.sub=D,e.add=function w(k,W,$){return k[0]=W[0]+$[0],k[1]=W[1]+$[1],k[2]=W[2]+$[2],k[3]=W[3]+$[3],k[4]=W[4]+$[4],k[5]=W[5]+$[5],k[6]=W[6]+$[6],k[7]=W[7]+$[7],k[8]=W[8]+$[8],k},e.mul=function A(k,W,$){var K=W[0],q=W[1],V=W[2],ee=W[3],ae=W[4],pe=W[5],me=W[6],de=W[7],re=W[8],te=$[0],le=$[1],ge=$[2],xe=$[3],Ge=$[4],je=$[5],L=$[6],Q=$[7],ye=$[8];return k[0]=te*K+le*ee+ge*me,k[1]=te*q+le*ae+ge*de,k[2]=te*V+le*pe+ge*re,k[3]=xe*K+Ge*ee+je*me,k[4]=xe*q+Ge*ae+je*de,k[5]=xe*V+Ge*pe+je*re,k[6]=L*K+Q*ee+ye*me,k[7]=L*q+Q*ae+ye*de,k[8]=L*V+Q*pe+ye*re,k},e.subScalar=function E(k,W,$){return k[0]=W[0]-$,k[1]=W[1]-$,k[2]=W[2]-$,k[3]=W[3]-$,k[4]=W[4]-$,k[5]=W[5]-$,k[6]=W[6]-$,k[7]=W[7]-$,k[8]=W[8]-$,k},e.addScalar=function I(k,W,$){return k[0]=W[0]+$,k[1]=W[1]+$,k[2]=W[2]+$,k[3]=W[3]+$,k[4]=W[4]+$,k[5]=W[5]+$,k[6]=W[6]+$,k[7]=W[7]+$,k[8]=W[8]+$,k},e.mulScalar=M;var F=Math.PI/3,N=t();e.symmetricEigenvalues=function j(k,W){var $=W[1]*W[1]+W[2]*W[2]+W[5]*W[5];if(0===$)k[0]=W[0],k[1]=W[4],k[2]=W[8];else{var K=x(W)/3,q=W[0]-K,V=W[4]-K,ee=W[8]-K,pe=Math.sqrt((q*q+V*V+ee*ee+2*$)/6);M(N,e.Identity,K),D(N,W,N),M(N,N,1/pe);var me=_(N)/2,de=me<=-1?F:me>=1?0:Math.acos(me)/3;k[0]=K+2*pe*Math.cos(de),k[2]=K+2*pe*Math.cos(de+2*F),k[1]=3*K-k[0]-k[2]}return k};var U=[.1,0,0],H=[.1,0,0],z=[.1,0,0],G=[.1,0,0],J=[.1,0,0],X=[.1,0,0];e.eigenvector=function Z(k,W,$){b.set(U,W[0]-$,W[1],W[2]),b.set(H,W[1],W[4]-$,W[5]),b.set(z,W[2],W[5],W[8]-$),b.cross(G,U,H),b.cross(J,U,z),b.cross(X,H,z);var K=b.dot(G,G),q=b.dot(J,J),V=b.dot(X,X),ee=K,ae=0;return q>ee&&(ee=q,ae=1),V>ee&&(ae=2),0===ae?b.scale(k,G,1/Math.sqrt(K)):1===ae?b.scale(k,J,1/Math.sqrt(q)):b.scale(k,X,1/Math.sqrt(V)),k},e.directionTransform=function ne(k,W){return s(k,W),y(k,k),g(k,k),k},e.Identity=r(),e.innerProduct=function Y(k,W){return k[0]*W[0]+k[1]*W[1]+k[2]*W[2]+k[3]*W[3]+k[4]*W[4]+k[5]*W[5]+k[6]*W[6]+k[7]*W[7]+k[8]*W[8]}}(Qt||(Qt={})),function(e){function t(){var w=[.1,0];return w[0]=0,w}e.zero=t,e.clone=function r(w){var A=t();return A[0]=w[0],A[1]=w[1],A},e.create=function n(w,A){var E=t();return E[0]=w,E[1]=A,E},e.hasNaN=function a(w){return isNaN(w[0])||isNaN(w[1])},e.toArray=function i(w,A,E){return A[E+0]=w[0],A[E+1]=w[1],A},e.fromArray=function o(w,A,E){return w[0]=A[E+0],w[1]=A[E+1],w},e.copy=function s(w,A){return w[0]=A[0],w[1]=A[1],w},e.set=function u(w,A,E){return w[0]=A,w[1]=E,w},e.add=function c(w,A,E){return w[0]=A[0]+E[0],w[1]=A[1]+E[1],w},e.sub=function l(w,A,E){return w[0]=A[0]-E[0],w[1]=A[1]-E[1],w},e.mul=function d(w,A,E){return w[0]=A[0]*E[0],w[1]=A[1]*E[1],w},e.div=function f(w,A,E){return w[0]=A[0]/E[0],w[1]=A[1]/E[1],w},e.scale=function p(w,A,E){return w[0]=A[0]*E,w[1]=A[1]*E,w},e.round=function m(w,A){return w[0]=Math.round(A[0]),w[1]=Math.round(A[1]),w},e.ceil=function h(w,A){return w[0]=Math.ceil(A[0]),w[1]=Math.ceil(A[1]),w},e.floor=function v(w,A){return w[0]=Math.floor(A[0]),w[1]=Math.floor(A[1]),w},e.distance=function g(w,A){var E=A[0]-w[0],I=A[1]-w[1];return Math.sqrt(E*E+I*I)},e.squaredDistance=function y(w,A){var E=A[0]-w[0],I=A[1]-w[1];return E*E+I*I},e.magnitude=function S(w){var A=w[0],E=w[1];return Math.sqrt(A*A+E*E)},e.squaredMagnitude=function C(w){var A=w[0],E=w[1];return A*A+E*E},e.inverse=function _(w,A){return w[0]=1/A[0],w[1]=1/A[1],w},e.areEqual=function x(w,A){return w[0]===A[0]&&w[1]===A[1]},e.toString=function D(w,A){return"[".concat(w[0].toPrecision(A)," ").concat(w[1].toPrecision(A),"}]")}}(Be||(Be={})),function(e){function t(){var M=[.1,0,0,0];return M[0]=0,M}function a(M,F){return M[0]=F.center[0],M[1]=F.center[1],M[2]=F.center[2],M[3]=F.radius,M}e.zero=t,e.clone=function r(M){var F=t();return F[0]=M[0],F[1]=M[1],F[2]=M[2],F[3]=M[3],F},e.create=function n(M,F,N,j){var U=t();return U[0]=M,U[1]=F,U[2]=N,U[3]=j,U},e.fromSphere=a,e.ofSphere=function i(M){return a(t(),M)},e.hasNaN=function o(M){return isNaN(M[0])||isNaN(M[1])||isNaN(M[2])||isNaN(M[3])},e.toArray=function s(M,F,N){return F[N+0]=M[0],F[N+1]=M[1],F[N+2]=M[2],F[N+3]=M[3],F},e.fromArray=function u(M,F,N){return M[0]=F[N+0],M[1]=F[N+1],M[2]=F[N+2],M[3]=F[N+3],M},e.toVec3Array=function c(M,F,N){F[N+0]=M[0],F[N+1]=M[1],F[N+2]=M[2]},e.fromVec3Array=function l(M,F,N){return M[0]=F[N+0],M[1]=F[N+1],M[2]=F[N+2],M[3]=0,M},e.copy=function d(M,F){return M[0]=F[0],M[1]=F[1],M[2]=F[2],M[3]=F[3],M},e.set=function f(M,F,N,j,U){return M[0]=F,M[1]=N,M[2]=j,M[3]=U,M},e.add=function p(M,F,N){return M[0]=F[0]+N[0],M[1]=F[1]+N[1],M[2]=F[2]+N[2],M[3]=F[3]+N[3],M},e.distance=function m(M,F){var N=F[0]-M[0],j=F[1]-M[1],U=F[2]-M[2],H=F[3]-M[3];return Math.sqrt(N*N+j*j+U*U+H*H)},e.scale=function h(M,F,N){return M[0]=F[0]*N,M[1]=F[1]*N,M[2]=F[2]*N,M[4]=F[4]*N,M},e.round=function v(M,F){return M[0]=Math.round(F[0]),M[1]=Math.round(F[1]),M[2]=Math.round(F[2]),M[3]=Math.round(F[3]),M},e.ceil=function g(M,F){return M[0]=Math.ceil(F[0]),M[1]=Math.ceil(F[1]),M[2]=Math.ceil(F[2]),M[3]=Math.ceil(F[3]),M},e.floor=function y(M,F){return M[0]=Math.floor(F[0]),M[1]=Math.floor(F[1]),M[2]=Math.floor(F[2]),M[3]=Math.floor(F[3]),M},e.squaredDistance=function S(M,F){var N=F[0]-M[0],j=F[1]-M[1],U=F[2]-M[2],H=F[3]-M[3];return N*N+j*j+U*U+H*H},e.norm=function C(M){var F=M[0],N=M[1],j=M[2],U=M[3];return Math.sqrt(F*F+N*N+j*j+U*U)},e.squaredNorm=function _(M){var F=M[0],N=M[1],j=M[2],U=M[3];return F*F+N*N+j*j+U*U},e.transformMat4=function x(M,F,N){var j=F[0],U=F[1],H=F[2],z=F[3];return M[0]=N[0]*j+N[4]*U+N[8]*H+N[12]*z,M[1]=N[1]*j+N[5]*U+N[9]*H+N[13]*z,M[2]=N[2]*j+N[6]*U+N[10]*H+N[14]*z,M[3]=N[3]*j+N[7]*U+N[11]*H+N[15]*z,M},e.dot=function D(M,F){return M[0]*F[0]+M[1]*F[1]+M[2]*F[2]+M[3]*F[3]},e.inverse=function w(M,F){return M[0]=1/F[0],M[1]=1/F[1],M[2]=1/F[2],M[3]=1/F[3],M},e.exactEquals=function A(M,F){return M[0]===F[0]&&M[1]===F[1]&&M[2]===F[2]&&M[3]===F[3]},e.equals=function E(M,F){var N=M[0],j=M[1],U=M[2],H=M[3],z=F[0],G=F[1],J=F[2],X=F[3];return Math.abs(N-z)<=mn*Math.max(1,Math.abs(N),Math.abs(z))&&Math.abs(j-G)<=mn*Math.max(1,Math.abs(j),Math.abs(G))&&Math.abs(U-J)<=mn*Math.max(1,Math.abs(U),Math.abs(J))&&Math.abs(H-X)<=mn*Math.max(1,Math.abs(H),Math.abs(X))},e.toString=function I(M,F){return"[".concat(M[0].toPrecision(F)," ").concat(M[1].toPrecision(F)," ").concat(M[2].toPrecision(F)," ").concat(M[3].toPrecision(F),"]")}}(dr||(dr={})),function(e){function t(){var Y=[.1,0,0,0];return Y[0]=0,Y}function r(){var Y=t();return Y[3]=1,Y}function o(Y,k,W){W*=.5;var $=Math.sin(W);return Y[0]=$*k[0],Y[1]=$*k[1],Y[2]=$*k[2],Y[3]=Math.cos(W),Y}function p(Y,k,W,$){var re,te,le,ge,xe,K=k[0],q=k[1],V=k[2],ee=k[3],ae=W[0],pe=W[1],me=W[2],de=W[3];return(te=K*ae+q*pe+V*me+ee*de)<0&&(te=-te,ae=-ae,pe=-pe,me=-me,de=-de),1-te>1e-6?(re=Math.acos(te),le=Math.sin(re),ge=Math.sin((1-$)*re)/le,xe=Math.sin($*re)/le):(ge=1-$,xe=$),Y[0]=ge*K+xe*ae,Y[1]=ge*q+xe*pe,Y[2]=ge*V+xe*me,Y[3]=ge*ee+xe*de,Y}function g(Y,k){var $,W=k[0]+k[4]+k[8];if(W>0)$=Math.sqrt(W+1),Y[3]=.5*$,Y[0]=(k[5]-k[7])*($=.5/$),Y[1]=(k[6]-k[2])*$,Y[2]=(k[1]-k[3])*$;else{var K=0;k[4]>k[0]&&(K=1),k[8]>k[3*K+K]&&(K=2);var q=(K+1)%3,V=(K+2)%3;$=Math.sqrt(k[3*K+K]-k[3*q+q]-k[3*V+V]+1),Y[K]=.5*$,Y[3]=(k[3*q+V]-k[3*V+q])*($=.5/$),Y[q]=(k[3*q+K]+k[3*K+q])*$,Y[V]=(k[3*V+K]+k[3*K+V])*$}return Y}e.zero=t,e.identity=r,e.setIdentity=function n(Y){Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=1},e.hasNaN=function a(Y){return isNaN(Y[0])||isNaN(Y[1])||isNaN(Y[2])||isNaN(Y[3])},e.create=function i(Y,k,W,$){var K=r();return K[0]=Y,K[1]=k,K[2]=W,K[3]=$,K},e.setAxisAngle=o,e.getAxisAngle=function s(Y,k){var W=2*Math.acos(k[3]),$=Math.sin(W/2);return 0!==$?(Y[0]=k[0]/$,Y[1]=k[1]/$,Y[2]=k[2]/$):(Y[0]=1,Y[1]=0,Y[2]=0),W},e.multiply=function u(Y,k,W){var $=k[0],K=k[1],q=k[2],V=k[3],ee=W[0],ae=W[1],pe=W[2],me=W[3];return Y[0]=$*me+V*ee+K*pe-q*ae,Y[1]=K*me+V*ae+q*ee-$*pe,Y[2]=q*me+V*pe+$*ae-K*ee,Y[3]=V*me-$*ee-K*ae-q*pe,Y},e.rotateX=function c(Y,k,W){W*=.5;var $=k[0],K=k[1],q=k[2],V=k[3],ee=Math.sin(W),ae=Math.cos(W);return Y[0]=$*ae+V*ee,Y[1]=K*ae+q*ee,Y[2]=q*ae-K*ee,Y[3]=V*ae-$*ee,Y},e.rotateY=function l(Y,k,W){W*=.5;var $=k[0],K=k[1],q=k[2],V=k[3],ee=Math.sin(W),ae=Math.cos(W);return Y[0]=$*ae-q*ee,Y[1]=K*ae+V*ee,Y[2]=q*ae+$*ee,Y[3]=V*ae-K*ee,Y},e.rotateZ=function d(Y,k,W){W*=.5;var $=k[0],K=k[1],q=k[2],V=k[3],ee=Math.sin(W),ae=Math.cos(W);return Y[0]=$*ae+K*ee,Y[1]=K*ae-$*ee,Y[2]=q*ae+V*ee,Y[3]=V*ae-q*ee,Y},e.calculateW=function f(Y,k){var W=k[0],$=k[1],K=k[2];return Y[0]=W,Y[1]=$,Y[2]=K,Y[3]=Math.sqrt(Math.abs(1-W*W-$*$-K*K)),Y},e.slerp=p,e.invert=function m(Y,k){var W=k[0],$=k[1],K=k[2],q=k[3],V=W*W+$*$+K*K+q*q,ee=V?1/V:0;return Y[0]=-W*ee,Y[1]=-$*ee,Y[2]=-K*ee,Y[3]=q*ee,Y},e.conjugate=function h(Y,k){return Y[0]=-k[0],Y[1]=-k[1],Y[2]=-k[2],Y[3]=k[3],Y},e.dot=function v(Y,k){return Y[0]*k[0]+Y[1]*k[1]+Y[2]*k[2]+Y[3]*k[3]},e.fromMat3=g,e.fromEuler=function y(Y,k,W){var $=k[0],K=k[1],q=k[2],V=Math.cos($/2),ee=Math.cos(K/2),ae=Math.cos(q/2),pe=Math.sin($/2),me=Math.sin(K/2),de=Math.sin(q/2);switch(W){case"XYZ":Y[0]=pe*ee*ae+V*me*de,Y[1]=V*me*ae-pe*ee*de,Y[2]=V*ee*de+pe*me*ae,Y[3]=V*ee*ae-pe*me*de;break;case"YXZ":Y[0]=pe*ee*ae+V*me*de,Y[1]=V*me*ae-pe*ee*de,Y[2]=V*ee*de-pe*me*ae,Y[3]=V*ee*ae+pe*me*de;break;case"ZXY":Y[0]=pe*ee*ae-V*me*de,Y[1]=V*me*ae+pe*ee*de,Y[2]=V*ee*de+pe*me*ae,Y[3]=V*ee*ae-pe*me*de;break;case"ZYX":Y[0]=pe*ee*ae-V*me*de,Y[1]=V*me*ae+pe*ee*de,Y[2]=V*ee*de-pe*me*ae,Y[3]=V*ee*ae+pe*me*de;break;case"YZX":Y[0]=pe*ee*ae+V*me*de,Y[1]=V*me*ae+pe*ee*de,Y[2]=V*ee*de-pe*me*ae,Y[3]=V*ee*ae-pe*me*de;break;case"XZY":Y[0]=pe*ee*ae-V*me*de,Y[1]=V*me*ae-pe*ee*de,Y[2]=V*ee*de+pe*me*ae,Y[3]=V*ee*ae+pe*me*de;break;default:Sn()}return Y};var S=[0,0,0];function F(Y,k){var W=k[0],$=k[1],K=k[2],q=k[3],V=W*W+$*$+K*K+q*q;return V>0&&(V=1/Math.sqrt(V),Y[0]=W*V,Y[1]=$*V,Y[2]=K*V,Y[3]=q*V),Y}e.fromUnitVec3=function C(Y,k,W){var $=b.dot(k,W)+1;return $Math.abs(k[2])?b.set(S,-k[1],k[0],0):b.set(S,0,-k[2],k[1])):b.cross(S,k,W),Y[0]=S[0],Y[1]=S[1],Y[2]=S[2],Y[3]=$,F(Y,Y),Y},e.clone=function _(Y){var k=t();return k[0]=Y[0],k[1]=Y[1],k[2]=Y[2],k[3]=Y[3],k},e.toArray=function x(Y,k,W){return k[W+0]=Y[0],k[W+1]=Y[1],k[W+2]=Y[2],k[W+3]=Y[3],k},e.fromArray=function D(Y,k,W){return Y[0]=k[W+0],Y[1]=k[W+1],Y[2]=k[W+2],Y[3]=k[W+3],Y},e.copy=function w(Y,k){return Y[0]=k[0],Y[1]=k[1],Y[2]=k[2],Y[3]=k[3],Y},e.set=function A(Y,k,W,$,K){return Y[0]=k,Y[1]=W,Y[2]=$,Y[3]=K,Y},e.exactEquals=function E(Y,k){return Y[0]===k[0]&&Y[1]===k[1]&&Y[2]===k[2]&&Y[3]===k[3]},e.equals=function I(Y,k){var W=Y[0],$=Y[1],K=Y[2],q=Y[3],V=k[0],ee=k[1],ae=k[2],pe=k[3];return Math.abs(W-V)<=mn*Math.max(1,Math.abs(W),Math.abs(V))&&Math.abs($-ee)<=mn*Math.max(1,Math.abs($),Math.abs(ee))&&Math.abs(K-ae)<=mn*Math.max(1,Math.abs(K),Math.abs(ae))&&Math.abs(q-pe)<=mn*Math.max(1,Math.abs(q),Math.abs(pe))},e.add=function M(Y,k,W){return Y[0]=k[0]+W[0],Y[1]=k[1]+W[1],Y[2]=k[2]+W[2],Y[3]=k[3]+W[3],Y},e.normalize=F;var N=[0,0,0],j=[1,0,0],U=[0,1,0];e.rotationTo=function H(Y,k,W){var $=b.dot(k,W);return $<-.999999?(b.cross(N,j,k),b.magnitude(N)<1e-6&&b.cross(N,U,k),b.normalize(N,N),o(Y,N,Math.PI),Y):$>.999999?(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=1,Y):(b.cross(N,k,W),Y[0]=N[0],Y[1]=N[1],Y[2]=N[2],Y[3]=1+$,F(Y,Y))};var z=t(),G=t();e.sqlerp=function J(Y,k,W,$,K,q){return p(z,k,K,q),p(G,W,$,q),p(Y,z,G,2*q*(1-q)),Y};var X=[0,0,0,0,0,0,0,0,0];e.setAxes=function Z(Y,k,W,$){return X[0]=W[0],X[3]=W[1],X[6]=W[2],X[1]=$[0],X[4]=$[1],X[7]=$[2],X[2]=-k[0],X[5]=-k[1],X[8]=-k[2],F(Y,g(Y,X))},e.toString=function ne(Y,k){return"[".concat(Y[0].toPrecision(k)," ").concat(Y[1].toPrecision(k)," ").concat(Y[2].toPrecision(k)," ").concat(Y[3].toPrecision(k),"]")},e.Identity=r()}(hn||(hn={})),function(e){function n(_,x,D){var w=function t(_,x,D){for(var w=[],A=0;A=0;I--)E=(E+x[w[I]])*D[I];return E}function y(_,x){for(var D=[],w=0;w<_.length;w++)D[w]=_[x[w]];return D}e.create=function r(_,x){return{space:_,data:x}},e.Space=n,e.Data1=function a(_){return _},e.Vector=function i(_,x){return n([_],[0],x)},e.ColumnMajorMatrix=function o(_,x,D){return n([_,x],[1,0],D)},e.RowMajorMatrix=function s(_,x,D){return n([_,x],[0,1],D)},e.toMat4=function u(_,x,D){if(2!==x.rank)throw new Error("Invalid tensor rank");for(var w=Math.min(4,x.dimensions[0]),A=Math.min(4,x.dimensions[1]),E=0;Er-t)return!1;for(var i=0;i]+>/g,"")}function aS(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ii(){return Ii.zero()}function pl(){return pl.zero()}function dt(e){return e}function Vr(e,t,r,n){return{label:e,description:r,list:n,type:t}}function vw(e,t,r){var n={};for(var a in e){var i=e[a];i=dt.saturate(i,t),i=dt.darken(i,-r),n[a]=i}return n}!function(e){function t(){var M=[.1,0,0];return M[0]=0,M}function u(M,F){var N=F[0],j=F[1],U=F[2],H=Math.sqrt(j*j+U*U),z=(Ru(Math.atan2(U,j))+360)%360;return 0===Math.round(1e4*H)&&(z=Number.NaN),M[0]=z,M[1]=H,M[2]=N,M}function l(M,F,N){return M[0]=F[0]-h*N,M[1]=F[1],M[2]=F[2],M}e.zero=t,e.create=function r(M,F,N){var j=t();return j[0]=M,j[1]=F,j[2]=N,j},e.set=function n(M,F,N,j){return M[0]=F,M[1]=N,M[2]=j,M},e.distance=function a(M,F){var N=F[0]-M[0],j=F[1]-M[1],U=F[2]-M[2];return Math.sqrt(N*N+j*j+U*U)},e.fromColor=function i(M,F){var N=dt.toRgb(F),z=function I(M,F,N){return[E((.4124564*(M=A(M))+.3575761*(F=A(F))+.1804375*(N=A(N)))/v),E((.2126729*M+.7151522*F+.072175*N)/g),E((.0193339*M+.119192*F+.9503041*N)/y)]}(N[0],N[1],N[2]),G=z[0],J=z[1],X=z[2],Z=116*J-16;return M[0]=Z<0?0:Z,M[1]=500*(G-J),M[2]=200*(J-X),M},e.fromHcl=function o(M,F){return pl.toLab(M,F)},e.toColor=function s(M){var F=(M[0]+16)/116,N=isNaN(M[1])?F:F+M[1]/500,j=isNaN(M[2])?F:F-M[2]/200;F=g*w(F);var U=D(3.2404542*(N=v*w(N))-1.5371385*F-.4985314*(j=y*w(j))),H=D(-.969266*N+1.8760108*F+.041556*j),z=D(.0556434*N-.2040259*F+1.0572252*j);return dt.fromRgb(Math.round(Xi(U,0,255)),Math.round(Xi(H,0,255)),Math.round(Xi(z,0,255)))},e.toHcl=u,e.copy=function c(M,F){return M[0]=F[0],M[1]=F[1],M[2]=F[2],M},e.darken=l,e.lighten=function d(M,F,N){return l(M,F,-N)};var f=[0,0,0];function p(M,F,N){return u(f,F),pl.toLab(M,pl.saturate(f,f,N))}e.saturate=p,e.desaturate=function m(M,F,N){return p(M,F,-N)};var h=18,v=.95047,g=1,y=1.08883,S=.137931034,C=.206896552,_=.12841855,x=.008856452;function D(M){return 255*(M<=.00304?12.92*M:1.055*Math.pow(M,1/2.4)-.055)}function w(M){return M>C?M*M*M:_*(M-S)}function A(M){return(M/=255)<=.04045?M/12.92:Math.pow((M+.055)/1.055,2.4)}function E(M){return M>x?Math.pow(M,1/3):M/_+S}}(Ii||(Ii={})),function(e){function t(){var y=[.1,0,0];return y[0]=0,y}e.zero=t,e.create=function r(y,S,C){var _=t();return _[0]=y,_[1]=S,_[2]=C,_},e.set=function n(y,S,C,_){return y[0]=S,y[1]=C,y[2]=_,y},e.hasHue=function a(y){return!isNaN(y[0])};var i=[0,0,0];e.fromColor=function o(y,S){return Ii.toHcl(y,Ii.fromColor(i,S))},e.fromLab=function s(y,S){return Ii.toHcl(y,S)};var u=[0,0,0];function l(y,S){var C=S[0],_=S[1],x=S[2];return isNaN(C)&&(C=0),C=Yr(C),y[0]=x,y[1]=Math.cos(C)*_,y[2]=Math.sin(C)*_,y}function f(y,S,C){return y[0]=S[0],y[1]=Math.max(0,S[1]+g*C),y[2]=S[2],y}e.toColor=function c(y){return Ii.toColor(l(u,y))},e.toLab=l,e.copy=function d(y,S){return y[0]=S[0],y[1]=S[1],y[2]=S[2],y},e.saturate=f,e.desaturate=function p(y,S,C){return f(y,S,-C)};var m=[0,0,0];function h(y,S,C){return l(m,S),Ii.toHcl(y,Ii.darken(m,m,C))}e.darken=h,e.lighten=function v(y,S,C){return h(y,S,-C)};var g=18}(pl||(pl={})),function(e){function c(U,H,z){return U<<16|H<<8|z}function l(U,H,z){return 255*U<<16|255*H<<8|255*z}function y(U){var H=U>>16&255;return H!==(U>>8&255)||H!==(255&U)}e.toStyle=function t(U){return"rgb(".concat(U>>16&255,", ").concat(U>>8&255,", ").concat(255&U,")")},e.toHexStyle=function r(U){return"#"+("000000"+U.toString(16)).slice(-6)},e.toHexString=function n(U){return"0x"+("000000"+U.toString(16)).slice(-6)},e.toRgbString=function a(U){return"RGB: ".concat(e.toRgb(U).join(", "))},e.toRgb=function i(U){return[U>>16&255,U>>8&255,255&U]},e.toRgbNormalized=function o(U){return[(U>>16&255)/255,(U>>8&255)/255,(255&U)/255]},e.fromHexStyle=function s(U){return parseInt(U.replace("#","0x"))},e.fromHexString=function u(U){return parseInt(U)},e.fromRgb=c,e.fromNormalizedRgb=l,e.fromArray=function d(U,H){return c(U[H],U[H+1],U[H+2])},e.fromNormalizedArray=function f(U,H){return l(U[H],U[H+1],U[H+2])},e.toArray=function p(U,H,z){return H[z]=U>>16&255,H[z+1]=U>>8&255,H[z+2]=255&U,H},e.toArrayNormalized=function m(U,H,z){return H[z]=(U>>16&255)/255,H[z+1]=(U>>8&255)/255,H[z+2]=(255&U)/255,H},e.toVec3=function h(U,H){return U[0]=H>>16&255,U[1]=H>>8&255,U[2]=255&H,U},e.toVec3Normalized=function v(U,H){return U[0]=(H>>16&255)/255,U[1]=(H>>8&255)/255,U[2]=(255&H)/255,U},e.interpolate=function g(U,H,z){var G=U>>16&255,J=U>>8&255,X=255&U;return G+((H>>16&255)-G)*z<<16|J+((H>>8&255)-J)*z<<8|X+((255&H)-X)*z},e.hasHue=y;var S=[0,0,0];function C(U,H){return y(U)?(pl.fromColor(S,U),pl.toColor(pl.saturate(S,S,H))):U}e.saturate=C,e.desaturate=function _(U,H){return C(U,-H)};var x=[0,0,0];function D(U,H){return Ii.fromColor(x,U),Ii.toColor(Ii.darken(x,x,H))}function A(U){return U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4)}function E(U){return.2126*A((U>>16&255)/255)+.7152*A((U>>8&255)/255)+.0722*A((255&U)/255)}function M(U){return U<.04045?.0773993808*U:Math.pow(.9478672986*U+.0521327014,2.4)}function N(U){return U<.0031308?12.92*U:1.055*Math.pow(U,.41666)-.055}e.darken=D,e.lighten=function w(U,H){return D(U,-H)},e.luminance=E,e.contrast=function I(U,H){var z=E(U),G=E(H);return z>G?(z+.05)/(G+.05):(G+.05)/(z+.05)},e.sRGBToLinear=function F(U){return l(M((U>>16&255)/255),M((U>>8&255)/255),M((255&U)/255))},e.linearToSRGB=function j(U){return l(N((U>>16&255)/255),N((U>>8&255)/255),N((255&U)/255))}}(dt||(dt={}));var qe,ru={"orange-red":Vr("Orange-Red","sequential","Orange-Red, sequential color scheme from ColorBrewer 2.0",[16775148,16705736,16635038,16628612,16551257,15689032,14102559,11730944,8323072]),"purple-blue":Vr("Purple-Blue","sequential","Purple-Blue, sequential color scheme from ColorBrewer 2.0",[16775163,15525874,13685222,10927579,7645647,3576e3,356528,285325,145496]),"blue-purple":Vr("Blue-Purple","sequential","Blue-Purple, sequential color scheme from ColorBrewer 2.0",[16252157,14740724,12571622,10403034,9213638,9202609,8929693,8458108,5046347]),oranges:Vr("Oranges","sequential","",[16774635,16705230,16634018,16625259,16616764,15821075,14239745,10892803,8333060]),"blue-green":Vr("Blue-Green","sequential","",[16252157,15070713,13429990,10082505,6734500,4304502,2329413,27948,17435]),"yellow-orange-brown":Vr("Yellow-Orange-Brown","sequential","",[16777189,16775100,16704401,16696399,16685353,15495188,13388802,10040324,6694150]),"yellow-green":Vr("Yellow-Green","sequential","",[16777189,16252089,14282915,11394446,7915129,4303709,2327619,26679,17705]),reds:Vr("Reds","sequential","",[16774640,16703698,16563105,16552562,16476746,15678252,13309981,10817301,6750221]),"red-purple":Vr("Red-Purple","sequential","",[16775155,16638173,16565696,16424885,16214177,14496919,11403646,7995767,4784234]),greens:Vr("Greens","sequential","",[16252149,15070688,13101504,10607003,7652470,4303709,2329413,27948,17435]),"yellow-green-blue":Vr("Yellow-Green-Blue","sequential","",[16777177,15595697,13101492,8375739,4306628,1937856,2252456,2438292,531800]),purples:Vr("Purples","sequential","",[16579581,15724021,14342891,12369372,10394312,8420794,6967715,5515151,4128893]),"green-blue":Vr("Green-Blue","sequential","",[16252144,14742491,13429701,11066805,8113348,5157843,2854078,551084,540801]),greys:Vr("Greys","sequential","",[16777215,15790320,14277081,12434877,9868950,7566195,5395026,2434341,0]),"yellow-orange-red":Vr("Yellow-Orange-Red","sequential","",[16777164,16772512,16701814,16691788,16616764,16535082,14883356,12386342,8388646]),"purple-red":Vr("Purple-Red","sequential","",[16250105,15196655,13941210,13210823,14640560,15149450,13505110,9961539,6750239]),blues:Vr("Blues","sequential","",[16251903,14609399,13032431,10406625,7057110,4362950,2191797,545180,536683]),"purple-blue-green":Vr("Purple-Blue-Green","sequential","",[16775163,15524592,13685222,10927579,6793679,3576e3,164234,93273,83510]),spectral:Vr("Spectral","diverging","",[10355010,13975119,16018755,16625249,16703627,16777151,15136152,11263396,6734501,3311805,6180770]),"red-yellow-green":Vr("Red-Yellow-Green","diverging","",[10813478,14102567,16018755,16625249,16703627,16777151,14282635,10934634,6733155,1742928,26679]),"red-blue":Vr("Red-Blue","diverging","",[6750239,11671595,14049357,16033154,16636871,16250871,13755888,9618910,4428739,2188972,340065]),"pink-yellow-green":Vr("Pink-Yellow-Green","diverging","",[9306450,12917629,14579630,15840986,16638191,16250871,15136208,12116358,8371265,5083681,2581529]),"purple-green":Vr("Purple-Green","diverging","",[4194379,7744131,10055851,12756431,15193320,16250871,14282963,10935200,5942881,1800247,17435]),"red-yellow-blue":Vr("Red-Yellow-Blue","diverging","Red-Yellow-Blue, diverging color scheme from ColorBrewer 2.0",[10813478,14102567,16018755,16625249,16703632,16777151,14742520,11262441,7646673,4552116,3225237]),"brown-white-green":Vr("Brown-White-Green","diverging","",[5517317,9195786,12550445,14664317,16181443,16119285,13101797,8441281,3512207,91742,15408]),"red-grey":Vr("Red-Grey","diverging","",[6750239,11671595,14049357,16033154,16636871,16777215,14737632,12237498,8882055,5066061,1710618]),"orange-purple":Vr("Orange-Purple","diverging","",[8338184,11753478,14713364,16627811,16703670,16250871,14211819,11709394,8418220,5515144,2949195]),"set-2":Vr("Set-2","qualitative","",[6734501,16551266,9281739,15174339,10934356,16767279,15058068,11776947]),accent:Vr("Accent","qualitative","",[8374655,12496596,16629894,16777113,3697840,15729279,12540695,6710886]),"set-1":Vr("Set-1","qualitative","",[14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607,10066329]),"set-3":Vr("Set-3","qualitative","",[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081,12353725,13429701,16772463]),"dark-2":Vr("Dark-2","qualitative","",[1810039,14245634,7696563,15149450,6727198,15117058,10909213,6710886]),paired:Vr("Paired","qualitative","",[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054,6962586,16777113,11622696]),"pastel-2":Vr("Pastel-2","qualitative","",[11789005,16633260,13358568,16042724,15136201,16773806,15852236,13421772]),"pastel-1":Vr("Pastel-1","qualitative","",[16495790,11783651,13429701,14601188,16701862,16777164,15063229,16636652,15921906]),"many-distinct":Vr("Many-Distinct","qualitative","",[1810039,14245634,7696563,15149450,6727198,15117058,10909213,6710886,14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607,10066329,6734501,16551266,9281739,15174339,10934356,16767279,15058068,11776947]),magma:Vr("Magma","sequential","Perceptually uniform shades of black-red-white",[4329332,4853881,5378684,5903742,6363263,6888576,7413633,7938689,8463745,8988801,9513600,10038655,10563454,11088508,11613562,12138360,12728949,13254258,13714030,14239338,14699366,15094114,15489119,15753309,16017499,16216411,16350045,16483424,16551523,16619368,16621934,16689780,16692091,16694402,16696969,16633746,16636058,16638371,16575148,16577461,16514239]),inferno:Vr("Inferno","sequential","Perceptually uniform shades of black-red-yellow",[4721514,5246316,5771373,6296430,6821486,7346542,7871597,8396651,8921450,9446504,9971557,10496610,10956127,11481435,12006486,12466258,12926285,13386056,13780802,14241085,14570295,14965297,15229227,15558693,15757342,15956248,16154897,16288267,16421638,16489734,16492043,16494612,16496926,16368426,16305463,16111429,15982678,15853928,15856253,16119953,16580260]),plasma:Vr("Plasma","sequential","Perceptually uniform shades of blue-red-yellow",[1771148,2426257,3081365,3671193,4195228,4784799,5308834,5833124,6357158,6815911,7340200,7864744,8324007,8783782,9309348,9769377,10164126,10624154,11018902,11413393,11808141,12137352,12466307,12795519,13124730,13453685,13717361,14046573,14309992,14573668,14837344,15035483,15299159,15497299,15695438,15893834,16091974,16224833,16357693,16425017,16557877,16625457,16627245,16629289,16631334,16567845,16438820,16310052,16115494,15921190,15726625]),viridis:Vr("Viridis","sequential","Perceptually uniform shades of blue-green-yellow",[4524123,4656994,4658793,4726127,4727668,4663929,4599933,4535937,4406404,4276870,4081800,3952010,3822475,3627148,3497356,3302029,3172237,3042446,2912654,2782862,2652814,2523022,2393229,2328973,2198924,2069132,2004874,2005897,2007175,2139525,2337154,2666111,3060348,3520376,4045684,4570991,5227369,5883748,6605661,7392854,8180303,8967495,9819967,10672695,11525166,12443174,13295646,14148121,15000344,15852828,16639780]),cividis:Vr("Cividis","sequential","Perceptually uniform shades of blue-green-yellow, should look effectively identical to colorblind and non-colorblind users",[11367,12400,537456,1455727,2046574,2571629,3031404,3425388,3754092,4148075,4476779,4805227,5133932,5396844,5725549,5988462,6317166,6580079,6843249,7171698,7434867,7697781,7960951,8289656,8618104,8881272,9209976,9538679,9867127,10195830,10524533,10853235,11181938,11510640,11839343,12168045,12497002,12891240,13219941,13548642,13943134,14271834,14666326,14995025,15389516,15718470,16112703,16507190,16639799]),twilight:Vr("Twilight","sequential","Perceptually uniform shades of white-blue-black-red-white, cyclic",[14670305,14211037,13554648,12766675,11847630,10993866,10139847,9351365,8628419,8036290,7509952,7048895,6718653,6519739,6386105,6252470,6184114,6181293,6112935,6044831,5976470,5777291,5447293,5052270,4592479,4067665,3674181,3281211,3150646,3543352,4067644,4657728,5379141,6166345,6953549,7741007,8463184,9120336,9777743,10304079,10830671,11291984,11687762,12083541,12348505,12613471,12878439,13077872,13211771,13411209,13545111,13809830,14074293,14338756,14537169,14735067,14801121]),turbo:Vr("Turbo","sequential","Improved (smooth) rainbow colormap for visualization",[4866485,4872413,4354034,3770361,3120629,2667241,2475736,2611140,3073454,3928216,5109892,6487408,8126047,9829201,11531332,13167162,14605618,15780908,16693543,16753699,16748063,16741916,16146200,15026195,13644558,12198408,10818563,9833728]),rainbow:Vr("Rainbow","sequential","",[3367393,3516485,16383744,15501073,12526114]),"red-white-blue":Vr("Red-White-Blue","diverging","",[12526114,16777215,3367393])},jq=Object.keys(ru).map(function(e){return[e,ru[e].label,Mh(ru[e].type)]});function pf(e){return e in ru?ru[e]:(console.warn("unknown color list named '".concat(e,"'")),ru["red-yellow-blue"])}function gw(e,t,r){return e[t]-e[r]}function Rh(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function qq(e,t,r,n){var a=r+n>>1;return t(e,r,n)>0?t(e,r,a)>0?t(e,a,n)>0?a:n:r:t(e,n,a)>0?t(e,a,r)>0?a:r:n}function k_e(e,t,r){var n=e.cmp,a=e.swap,i=e.data,o=e.parts,s=t+1,u=r;for(a(i,t,qq(i,n,t,r));n(i,u,t)>0;)--u;for(var c=t+1;c<=u;c++){var l=n(i,c,t);if(l>0){for(a(i,c,u),--u;n(i,u,t)>0;)--u;c--}else 0===l&&(a(i,c,s),s++)}for(c=t;c=t&&a(n,s,s+1)>0;)i(n,s,s+1),s-=1}function yw(e,t,r){for(var n=e.parts;to;)--i;for(var s=r+1;s<=i;s++){var u=e[s];if(u>o){for(Rh(e,s,i),--i;e[i]>o;)--i;s--}else u===o&&(Rh(e,s,a),++a)}for(s=r;s=t&&e[i]>a;)e[i+1]=e[i],i-=1;e[i+1]=a}}function bO(e,t,r,n){for(;ro[c].key){p=!1;break}}if(u&&p){for(c=0;c=f.currentSize)C.set(A,_);else for(D=0,w=A.length;D=f.currentSize&&r(f);var g=f.currentChunk,y=f.currentIndex;return g[y]=p,g[y+1]=m,g[y+2]=h,g[y+3]=v,f.currentIndex+=4,f.elementCount++},e.add3=function a(f,p,m,h){f.currentIndex>=f.currentSize&&r(f);var v=f.currentChunk,g=f.currentIndex;return v[g]=p,v[g+1]=m,v[g+2]=h,f.currentIndex+=3,f.elementCount++},e.add2=function i(f,p,m){f.currentIndex>=f.currentSize&&r(f);var h=f.currentChunk,v=f.currentIndex;return h[v]=p,h[v+1]=m,f.currentIndex+=2,f.elementCount++},e.add=function o(f,p){return f.currentIndex>=f.currentSize&&r(f),f.currentChunk[f.currentIndex]=p,f.currentIndex+=1,f.elementCount++},e.addRepeat=function s(f,p,m){for(var h=0;h=f.currentSize&&r(f),f.currentChunk[f.currentIndex++]=m,f.elementCount++;return f.elementCount},e.addMany=function u(f,p){for(var m=f.elementSize,h=0,v=p.length;h=f.currentSize&&r(f);for(var g=f.currentChunk,y=0;y"u")return v;if("number"==typeof h)return v.currentChunk=new f(h*p),v.allocatedSize=h*p,v.currentSize=v.currentChunk.length,v.chunks[0]=v.currentChunk,v;var g=h;if(g.length%p!=0)throw new Error("initialChunk length must be a multiple of the element size.");return v.currentChunk=g,v.allocatedSize=g.length,v.currentSize=g.length,v.chunks[0]=g,v}}(qe||(qe={}));var ie,Xr,_O,j_e=function(){function e(t,r){this.getHash=t,this.areEqual=r,this.id=0,this.byHash=new Map,this.groups=[]}return e.prototype.createGroup=function(t,r){var n=this.id++,a=[t];return this.groups[n]=a,{id:n,keys:a,value:r}},e.prototype.add=function(t,r){var n=this.getHash(r);if(this.byHash.has(n)){for(var a=this.byHash.get(n),i=0,o=a.length;i>4;return(t=(3735928559^t)+(t<<5))^t>>11}function Oh(e,t){var r=23;return r=31*(r=31*r+e|0)+t|0,(r=(3735928559^(r^=r>>4))+(r<<5))^r>>11}function CO(e){for(var t=0,r=0,n=e.length;r>>0}function E0(e,t){return{start:t&&typeof t.start<"u"?Math.max(Math.min(t.start,e-1),0):0,end:t&&typeof t.end<"u"?Math.min(t.end,e):e}}function oS(e,t){var r=t&&typeof t.array<"u"?t.array:Array,n=E0(e,t),a=n.start,i=n.end;return{array:new r(i-a),start:a,end:i}}function _o(e,t,r){var n=oS(e,r);return function X_e(e,t,r){for(var n=0,a=t.length;n9||o<0)return i*a|0;a=10*a+o|0}return i*a}function Kq(e,t,r,n){return 43===t.charCodeAt(r)&&r++,e*Math.pow(10,Xp(t,r,n))}function mf(e,t,r){var n=t,a=1,i=0,o=0,s=1;for(45===e.charCodeAt(n)?(a=-1,++n):43===e.charCodeAt(n)&&++n;n=0&&u<10)){if(-2===u){for(++n;n=0&&u<10))return 53===u||21===u?Kq(a*(i+o/s),e,n+1,r):a*(i+o/s);o=10*o+u,s*=10,++n}return a*(i+o/s)}if(53===u||21===u)return Kq(a*i,e,n+1,r);break}i=10*i+u,++n}return a*i}function Qq(e,t,r,n){return{schema:r,__array:void 0,isDefined:0===n,rowCount:t,value:function(i){return e},valueKind:function(i){return n},toArray:function(i){for(var o=oS(t,i).array,s=0,u=o.length;s>>0&127|0;else if(i<2048)e[t++]=i>>>6&31|192,e[t++]=i>>>0&63|128;else if(i<65536)e[t++]=i>>>12&15|224,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128;else{if(!(i<1114112))throw new Error("bad codepoint "+i);e[t++]=i>>>18&7|240,e[t++]=i>>>12&63|128,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128}}}!function(e){var t;function n(E,I){return Qq(I.T,E,I,1)}function i(E){return Sw(E)}!function(E){function N(G,J){return void 0===J&&(J=E.float),{"@type":"tensor",T:G.create(),space:G,valueType:"tensor",baseType:J}}E.str={"@type":"str",T:"",valueType:"str"},E.ustr={"@type":"str",T:"",valueType:"str",transform:"uppercase"},E.lstr={"@type":"str",T:"",valueType:"str",transform:"lowercase"},E.int={"@type":"int",T:0,valueType:"int"},E.coord={"@type":"coord",T:0,valueType:"float"},E.float={"@type":"float",T:0,valueType:"float"},E.Str=function I(G){var J;return{"@type":"str",T:null!==(J=G?.defaultValue)&&void 0!==J?J:"",transform:G?.transform,valueType:"str"}},E.Int=function M(G){return void 0===G&&(G=0),{"@type":"int",T:G,valueType:"int"}},E.Float=function F(G){return void 0===G&&(G=0),{"@type":"float",T:G,valueType:"float"}},E.Tensor=N,E.Vector=function j(G,J){return void 0===J&&(J=E.float),N(Sr.Vector(G,"int"===J["@type"]?Int32Array:Float64Array),J)},E.Matrix=function U(G,J,X){return void 0===X&&(X=E.float),N(Sr.ColumnMajorMatrix(G,J,"int"===X["@type"]?Int32Array:Float64Array),X)},E.Aliased=function H(G){return G},E.List=function z(G,J,X){return void 0===X&&(X=[]),{"@type":"list",T:X,separator:G,itemParse:J,valueType:"list"}}}(t=e.Schema||(e.Schema={})),e.is=function r(E){return!!E&&!!E.schema&&!!E.value},e.ValueKind={Present:0,NotPresent:1,Unknown:2},e.Undefined=n,e.ofConst=function a(E,I,M){return Qq(E,I,M,0)},e.ofLambda=i,e.range=function o(E,I){return i({value:function(M){return M+E},rowCount:Math.max(I-E+1,0),schema:t.int})},e.ofArray=function s(E){return hf(E)},e.ofIntArray=function u(E){return hf({array:E,schema:t.int})},e.ofFloatArray=function c(E){return hf({array:E,schema:t.float})},e.ofStringArray=function l(E){return hf({array:E,schema:t.str})},e.ofStringAliasArray=function d(E){return hf({array:E,schema:t.Aliased(t.str)})},e.ofStringListArray=function f(E,I){return void 0===I&&(I=","),hf({array:E,schema:t.List(I,function(M){return M})})},e.ofIntTokens=function p(E){var M=E.data,F=E.indices;return Sw({value:function(N){return Xp(M,F[2*N],F[2*N+1])||0},rowCount:E.count,schema:t.int})},e.ofFloatTokens=function m(E){var M=E.data,F=E.indices;return Sw({value:function(N){return mf(M,F[2*N],F[2*N+1])||0},rowCount:E.count,schema:t.float})},e.ofStringTokens=function h(E){var M=E.data,F=E.indices;return Sw({value:function(N){var j=M.substring(F[2*N],F[2*N+1]);return"."===j||"?"===j?"":j},rowCount:E.count,schema:t.str})},e.window=function v(E,I,M){return function J_e(e,t,r){return e.isDefined?0===t&&r===e.rowCount?e:e.__array&&xO(e.__array)?function ewe(e,t,r){var n=bw(e.__array,{start:t,end:r}),a=e.valueKind;return hf({array:n,schema:e.schema,valueKind:function(i){return a(t+i)}})}(e,t,r):function twe(e,t,r){var n=e.value,a=e.valueKind,i=e.areValuesEqual,o=0===t?n:function(u){return n(u+t)},s=r-t;return{schema:e.schema,__array:void 0,isDefined:e.isDefined,rowCount:s,value:o,valueKind:0===t?a:function(u){return a(u+t)},toArray:function(u){for(var c=oS(s,u).array,l=0,d=c.length;l"u"?1:0}})},E=0,I=w;E0&&(a[a.length]=o.slice(0,i).join("")),a.join("")):o.slice(0,i).join("")}(e,t,r)}function xw(e){for(var t=0,r=0,n=e.length;r0?[4,new Promise(function(i){t.onChildrenFinished=i})]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:e.onAbort&&e.onAbort(),a.label=6;case 6:throw n;case 7:return[2]}})})}function iW(e){throw e.abortToken.treeAborted||(e.abortToken.treeAborted=!0,oW(e.root),sW(e,ia())),Ve.Aborted(e.abortToken.reason)}function oW(e){var t=e.progress;t.isIndeterminate=!0,t.canAbort=!1,t.message="Aborting...";for(var r=0,n=e.children;rthis.info.updateRateMs},enumerable:!1,configurable:!0}),e.prototype.updateProgress=function(t){if(this.checkAborted(),t){var r=this.node.progress;"string"==typeof t?(r.message=t,r.isIndeterminate=!0):(typeof t.canAbort<"u"&&(r.canAbort=t.canAbort),typeof t.message<"u"&&(r.message=t.message),typeof t.current<"u"&&(r.current=t.current),typeof t.max<"u"&&(r.max=t.max),r.isIndeterminate=typeof r.current>"u"||typeof r.max>"u",typeof t.isIndeterminate<"u"&&(r.isIndeterminate=t.isIndeterminate))}},e.prototype.update=function(t,r){if(this.lastUpdatedTime=ia(),this.updateProgress(t),!r)return sW(this.info,this.lastUpdatedTime),this.checkAborted(),sS.immediatePromise()},e.prototype.runChild=function(t,r){return ue(this,void 0,void 0,function(){var n,a,i,o,s,u,c;return ce(this,function(l){switch(l.label){case 0:this.updateProgress(r),n={progress:tW(t),children:[]},(a=this.node.children).push(n),i=new e(this.info,n),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,IO(t,i)];case 2:return[2,l.sent()];case 3:if(o=l.sent(),Ve.isAbort(o)&&this.isAborted)return[2,void 0];throw o;case 4:if((s=a.indexOf(n))>=0){for(u=s,c=a.length-1;u0?(o+=c,d=ia()-u,l+=d,s+=d,e.shouldUpdate?[4,a(e,r,o)]:[3,3]):[3,4];case 2:f.sent(),i=Math.round(l*o/s)+1,u=ia(),l=0,f.label=3;case 3:return[3,1];case 4:return e.shouldUpdate?[4,a(e,r,o)]:[3,6];case 5:f.sent(),f.label=6;case 6:return[2,r]}})})}!function(e){var t=function(){function d(f,p,m){this.name=f,this.f=p,this.onAbort=m,this.id=l()}return d.prototype.run=function(f,p){return void 0===p&&(p=250),f?function xwe(e,t,r){void 0===r&&(r=250);var n=rW(e,t,r);return IO(e,new uW(n,n.root))}(this,f,p):this.f(_w)},d.prototype.runAsChild=function(f,p){return f.isSynchronous?this.f(_w):function wwe(e,t,r){return e.runChild(t,r)}(f,this,p)},d.prototype.runInContext=function(f){return f.isSynchronous?this.f(_w):eW(f,this)},d}();function r(d){return!!d&&"number"==typeof d.id&&"string"==typeof d.name&&!!d.run}function i(d,f,p){return new t(d,f,p)}e.is=r,e.isAbort=function n(d){return!!d&&!!d.isAborted},e.Aborted=function a(d){return{isAborted:!0,reason:d,toString:function(){return"Aborted".concat(d?": "+d:"")}}},e.create=i,e.constant=function o(d,f){var p=this;return i(d,function(m){return ue(p,void 0,void 0,function(){return ce(this,function(h){return[2,f]})})})},e.empty=function s(){var d=this;return i("",function(f){return ue(d,void 0,void 0,function(){return ce(this,function(p){return[2]})})})},e.fail=function u(d,f){var p=this;return i(d,function(m){return ue(p,void 0,void 0,function(){return ce(this,function(h){throw new Error(f)})})})},e.resolveInContext=function c(d,f){return r(d)?f?d.runInContext(f):d.run():d};var l=Jo(0,1073741823)}(Ve||(Ve={})),function(e){function t(n,a){void 0===a&&(a="");var i=n.progress;if(!n.children.length)return i.isIndeterminate?"".concat(a).concat(i.taskName,": ").concat(i.message):"".concat(a).concat(i.taskName,": [").concat(i.current,"/").concat(i.max,"] ").concat(i.message);var o=a+" |_ ",s=n.children.map(function(u){return t(u,o)});return i.isIndeterminate?"".concat(a).concat(i.taskName,": ").concat(i.message,"\n").concat(s.join("\n")):"".concat(a).concat(i.taskName,": [").concat(i.current,"/").concat(i.max,"] ").concat(i.message,"\n").concat(s.join("\n"))}e.format=function r(n){return t(n.root)}}(cW||(cW={}));var P0=typeof process<"u"&&null!=process.versions&&null!=process.versions.node,dS=function Iwe(){return typeof XMLHttpRequest>"u"||P0?Or(744):XMLHttpRequest}(),PO=function Pwe(){return typeof File>"u"||P0?function(){function t(r,n,a){var i;this.blob=new Blob(r,a),this.size=this.blob.size,this.type=this.blob.type,this.name=n,this.lastModified=null!==(i=a?.lastModified)&&void 0!==i?i:0,this.webkitRelativePath=""}return t.prototype.arrayBuffer=function(){return this.blob.arrayBuffer()},t.prototype.slice=function(r,n,a){return this.blob.slice(r,n,a)},t.prototype.stream=function(){return this.blob.stream()},t.prototype.text=function(){return this.blob.text()},t}():File}();function Kp(e,t){return e[t]|e[t+1]<<8}function Bh(e,t,r){e[t]=255&r,e[t+1]=r>>8&255}function Nh(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])}function gf(e,t,r){e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255}function Owe(e){return e.length<2?"0"+e:e}function lW(e){for(var t=e.length,r=0,n=0;n>>1:r>>>=1;e[t]=r}return e}();function dW(e,t,r){return 4294967295^function kwe(e,t,r,n){for(var a=0;a>>8;return e}(4294967295,e,t,r)}var vt=function(){var e=Uint16Array,t=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}}();function fS(e,t,r){for(var n=e.length,a=vt.rev15,i=0;i>1<<4|s,c=t-s,l=e[i]<>>15-t]=u,l++}function Zp(e,t){for(var r=e.length,n=vt.bl_count,a=0;a<=t;a++)n[a]=0;for(a=1;a>>n}function Vwe(e,t,r){return ue(this,void 0,void 0,function(){var n;return ce(this,function(a){switch(a.label){case 0:if(3===t[0]&&0===t[1])return[2,r||new Uint8Array(0)];n=function Lwe(e,t){var r=void 0===t;return void 0===t&&(t=new Uint8Array(e.length>>>2<<3)),{data:e,buf:t,noBuf:r,BFINAL:0,off:0,pos:0}}(t,r),a.label=1;case 1:return 0!==n.BFINAL?[3,4]:e.shouldUpdate?[4,e.update({message:"Inflating blocks...",current:n.pos,max:t.length})]:[3,3];case 2:a.sent(),a.label=3;case 3:return function Uwe(e,t){for(var r=e.data,n=e.noBuf,a=e.buf,i=e.BFINAL,o=e.off,s=e.pos,u=0;0===i&&uC&&(C=_)}s+=3*y,Zp(vt.itree,C),fS(vt.itree,C,vt.imap),c=vt.lmap,l=vt.dmap,s=Gwe(vt.imap,(1<>>4;if(A>>>8){if(256===A)break;var E=o+A-254;if(A>264){var I=vt.ldef[A-257];E=o+(I>>>3)+Qp(r,s,7&I),s+=7&I}var M=l[OO(r,s)&f],N=vt.ddef[M>>>4],j=(N>>>4)+RO(r,s+=15&M,15&N);for(s+=15&N,n&&(a=MO(a,o+(1<<17)));o>>3),h=r[m-4]|r[m-3]<<8;n&&(a=MO(a,o+h)),a.set(new Uint8Array(r.buffer,r.byteOffset+m,h),o),s=m+h<<3,o+=h}}e.buf=a,e.BFINAL=i,e.off=o,e.pos=s}(n,100),[3,1];case 4:return[2,n.buf.length===n.off?n.buf:n.buf.slice(0,n.off)]}})})}function MO(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n}function Gwe(e,t,r,n,a,i){for(var o=0;o>>4;if(u<=15)i[o]=u,o++;else{var c=0,l=0;16===u?(l=3+Qp(n,a,2),a+=2,c=i[o-1]):17===u?(l=3+Qp(n,a,3),a+=3):18===u&&(l=11+Qp(n,a,7),a+=7);for(var d=o+l;o>>1;ia&&(a=s),i++}for(;i>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)}function FO(e,t,r){for(var n=[],a=e.length,i=t.length,o=0;or&&(function zwe(e,t,r){var n=0,a=0,i=1<t;n++){var o=e[n].d;e[n].d=t,a+=i-(1<>>=r-t;a>0;)(o=e[n].d)=0;n--)e[n].d===t&&a<0&&(e[n].d--,a++);0!==a&&console.log("debt left")}(u,r,v),v=r),o=0;o>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8)>>>16|r<<16)>>>17}function n(a,i,o){for(;0!=i--;)a.push(0,o)}for(t=0;t<32;t++)vt.ldef[t]=vt.of0[t]<<3|vt.exb[t],vt.ddef[t]=vt.df0[t]<<4|vt.dxb[t];n(vt.fltree,144,8),n(vt.fltree,112,9),n(vt.fltree,24,7),n(vt.fltree,8,8),Zp(vt.fltree,9),fS(vt.fltree,9,vt.flmap),pS(vt.fltree,9),n(vt.fdtree,32,5),Zp(vt.fdtree,5),fS(vt.fdtree,5,vt.fdmap),pS(vt.fdtree,5),n(vt.itree,19,0),n(vt.ltree,286,0),n(vt.dtree,30,0),n(vt.ttree,320,0)}();var qwe=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]];function Wwe(e,t,r,n,a){return ue(this,void 0,void 0,function(){var i,o,s,u,c,l,d,f,p,m,h,v;return ce(this,function(g){switch(g.label){case 0:if(i=function Hwe(e,t,r,n){return{data:e,out:t,opt:qwe[n],i:0,pos:r<<3,cvrd:0,dlen:e.length,li:0,lc:0,bs:0,ebits:0,c:0,nc:0,lits:vt.lits,strt:vt.strt,prev:vt.prev}}(t,r,n,a),o=i.dlen,0===a){for(s=i.i,u=i.pos;s>>3]}o>2&&(i.nc=NO(t,0),i.strt[i.nc]=0),g.label=1;case 1:return i.i14e3||l>26697)&&n-o>100&&(u>>16,x=65535&C,D=gW(_,vt.of0);vt.lhst[257+D]++;var w=gW(x,vt.df0);vt.dhst[w]++,f+=vt.exb[D]+vt.dxb[w],h[c]=_<<23|o-u,h[c+1]=x<<16|D<<8|w,c+=2,u=o+_}else vt.lhst[r[o]]++;l++}}e.i=o,e.pos=s,e.cvrd=u,e.li=c,e.lc=l,e.bs=d,e.ebits=f,e.c=p,e.nc=m}(i,1048576),[3,1];case 4:for(l=i.li,d=i.cvrd,f=i.pos,m=i.lits,v=i.ebits,((h=i.bs)!==(p=i.i)||0===t.length)&&(d>>3]}})})}function Ywe(e,t,r,n,a,i){var o=32767&t,s=r[o],u=o-s+32768&32767;if(s===o||n!==NO(e,t-u))return 0;for(var c=0,l=0,d=Math.min(32767,t);u<=d&&0!=--i&&s!==o;){if(0===c||e[t+c]===e[t+c-u]){var f=Xwe(e,t,u);if(f>c){if(l=u,(c=f)>=a)break;u+2p&&(p=g,s=h)}}}u+=(o=s)-(s=r[o])+32768&32767}return c<<16|l}function Xwe(e,t,r){if(e[t]!==e[t-r]||e[t+1]!==e[t+1-r]||e[t+2]!==e[t+2-r])return 0;var n=t,a=Math.min(e.length,t+258);for(t+=3;t4&&0===vt.itree[1+(vt.ordr[u-1]<<1)];)u--;return[e,t,s,n,i,u,r,a]}(),l=c[0],d=c[1],f=c[2],p=c[3],m=c[4],h=c[5],v=c[6],g=c[7],y=32+(u+3&7?8-(u+3&7):0)+(o<<3),S=n+mS(vt.fltree,vt.lhst)+mS(vt.fdtree,vt.dhst),C=n+mS(vt.ltree,vt.lhst)+mS(vt.dtree,vt.dhst);C+=14+3*h+mS(vt.itree,vt.ihst)+(2*vt.ihst[16]+3*vt.ihst[17]+7*vt.ihst[18]);for(var _=0;_<286;_++)vt.lhst[_]=0;for(_=0;_<30;_++)vt.dhst[_]=0;for(_=0;_<19;_++)vt.ihst[_]=0;var x=y>>23,N=E+(8388607&M);E>16,H=j>>8&255,z=255&j;kh(s,u=hS(257+H,D,s,u),F-vt.of0[H]),ww(s,u=hS(z,w,s,u+=vt.exb[H]),U-vt.df0[z]),u+=vt.dxb[z],E+=F}}u=hS(256,D,s,u)}return u}function mW(e,t,r,n,a){var i=a>>>3;return n[i]=r,n[i+1]=r>>>8,n[i+2]=255-n[i],n[i+3]=255-n[i+1],i+=4,n.set(new Uint8Array(e.buffer,t,r),i),a+(r+4<<3)}function mS(e,t){for(var r=0,n=0;n15&&(kh(r,n,o),n+=s)}return n}function vW(e,t){for(var r=e.length;2!==r&&0===e[r-1];)r-=2;for(var n=0;n>>1,138))<11?t.push(17,c-3):t.push(18,c-11),n+=2*c-2}else if(a===s&&i===a&&o===a){for(u=n+5;u+2>>1,6);t.push(16,c-3),n+=2*c-2}else t.push(a,0)}return r>>>1}function gW(e,t){var r=0;return t[16|r]<=e&&(r|=16),t[8|r]<=e&&(r|=8),t[4|r]<=e&&(r|=4),t[2|r]<=e&&(r|=2),t[1|r]<=e&&(r|=1),r}function hS(e,t,r,n){return ww(r,n,t[e<<1]),n+t[1+(e<<1)]}function kh(e,t,r){var n=t>>>3;e[n]|=r<<=7&t,e[n+1]|=r>>>8}function ww(e,t,r){var n=t>>>3;e[n]|=r<<=7&t,e[n+1]|=r>>>8,e[n+2]|=r>>>16}function vS(e,t,r){return void 0===r&&(r=!1),ue(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d,f,p,m,h;return ce(this,function(v){switch(v.label){case 0:for(n=Object.create(null),a=new Uint8Array(t),i=a.length-4;101010256!==Nh(a,i);)i--;o=i,o+=4,s=Kp(a,o+=4),o+=2,o+=2,u=Nh(a,o+=4),o+=4,o=u,c=0,v.label=1;case 1:return c>0}(Nh(t,t.length-8)),u=Nh(t,t.length-4),void 0===r&&(r=new Uint8Array(u)),c=new Uint8Array(t.buffer,t.byteOffset+a,t.length-a-8),[4,kO(e,c,r)];case 1:return l=f.sent(),d=dW(l,0,l.length),s!==d&&console.error("ungzip: checksums don't match"),[2,l]}})})}function $we(e,t,r){return ue(this,void 0,void 0,function(){var n,a;return ce(this,function(i){switch(i.label){case 0:return void 0===r&&(r={level:6}),n=new Uint8Array(50+Math.floor(1.1*t.length)),[4,Wwe(e,t,n,0,r.level)];case 1:return a=i.sent(),[2,new Uint8Array(n.buffer,0,a)]}})})}function Jwe(e,t){return void 0===t&&(t=!1),Ve.create("Zip",function(r){return function eAe(e,t,r){return void 0===r&&(r=!1),ue(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d,f,p,m,h,v,g,y,S,C,_,x,D;return ce(this,function(w){switch(w.label){case 0:for(s in n=0,a={},o=[],i=t)o.push(s);u=0,w.label=1;case 1:return u>18,e[t+a+1]=128|o>>12&63,e[t+a+2]=128|o>>6&63,e[t+a+3]=128|o>>0&63,a+=4}else e[t+a]=224|o>>12,e[t+a+1]=128|o>>6&63,e[t+a+2]=128|o>>0&63,a+=3;else e[t+a]=192|o>>6,e[t+a+1]=128|o>>0&63,a+=2;else e[t+a]=o,a++}return a}(e,t,r);return t+=s,0===a&&(e.set(o,t),t+=o.length),t}var Sc=function(e){return e[e.None=0]="None",e[e.Gzip=1]="Gzip",e[e.Zip=2]="Zip",e}(Sc||{});function yf(e,t){return function UO(e,t){var r=this;if(P0)return function iAe(e,t){var r=this;return Ve.create("Read File",function(n){return ue(r,void 0,void 0,function(){var a,i;return ce(this,function(o){switch(o.label){case 0:return a="zip"===t?Sc.None:CW(e.name),[4,n.update({message:"Opening file...",canAbort:!1})];case 1:return o.sent(),"binary"===t||"zip"===t||a!==Sc.None?[4,e.arrayBuffer()]:[3,3];case 2:return i=o.sent(),[3,5];case 3:return[4,e.text()];case 4:i=o.sent(),o.label=5;case 5:return[4,n.update({message:"Processing file...",canAbort:!1})];case 6:return o.sent(),[4,xW(n,i,t,a)];case 7:return[2,o.sent()]}})})})}(e,t);var n=void 0;return Ve.create("Read File",function(a){return ue(r,void 0,void 0,function(){var i,o;return ce(this,function(s){switch(s.label){case 0:return s.trys.push([0,,5,6]),n=new FileReader,i="zip"===t?Sc.None:CW(e.name),"binary"===t||"zip"===t||i!==Sc.None?n.readAsArrayBuffer(e):n.readAsText(e),[4,a.update({message:"Opening file...",canAbort:!0})];case 1:return s.sent(),[4,SW(a,"Reading...",n)];case 2:return o=s.sent(),[4,a.update({message:"Processing file...",canAbort:!1})];case 3:return s.sent(),[4,xW(a,o.result,t,i)];case 4:return[2,s.sent()];case 5:return n=void 0,[7];case 6:return[2]}})})},function(){n&&n.abort()})}(e,t)}function LO(e){return"string"==typeof e?_W(e,e,"string"):_W(e.title,e.url,e.type||"string",e.body,e.headers)}function bW(e){return e?"Failed to download data. Possible reasons: Resource is not available, or CORS is not allowed on the server.":"Failed to open file."}function SW(e,t,r){return new Promise(function(n,a){if(function rAe(e){if(!P0&&e instanceof FileReader)return e.readyState===FileReader.DONE;if(e instanceof dS)return e.readyState===dS.DONE;throw new Error("unknown data type")}(r)){var i=r.error;null!=i?a(i??bW(r instanceof dS)):n(r)}else{var o=!1;r.onerror=function(s){o||a(s.target.error??bW(r instanceof dS))},r.onprogress=function(s){if(e.shouldUpdate&&!o)try{e.update(s.lengthComputable?{message:t,isIndeterminate:!1,current:s.loaded,max:s.total}:{message:"".concat(t," ").concat((s.loaded/1024/1024).toFixed(2)," MB"),isIndeterminate:!0})}catch(u){o=!0,a(u)}},r.onload=function(s){n(r)}}})}function CW(e){return/\.gz$/i.test(e)?Sc.Gzip:/\.zip$/i.test(e)?Sc.Zip:Sc.None}var nAe=/^(__MACOSX|.DS_Store)/;function aAe(e,t,r){return ue(this,void 0,void 0,function(){var a,i;return ce(this,function(o){switch(o.label){case 0:switch(r){case Sc.None:return[3,1];case Sc.Gzip:return[3,2];case Sc.Zip:return[3,3]}return[3,5];case 1:return[2,t];case 2:return[2,Qwe(e,t)];case 3:return[4,vS(e,t.buffer)];case 4:if(a=o.sent(),1!==(i=Object.keys(a).filter(function(s){return!nAe.test(s)})).length)throw new Error("can only decompress zip files with a single entry");return[2,a[i[0]]];case 5:return[2]}})})}function xW(e,t,r,n){return ue(this,void 0,void 0,function(){var a,i;return ce(this,function(s){switch(s.label){case 0:if(null===(a=t instanceof ArrayBuffer?new Uint8Array(t):t))throw new Error("no data given");if(n===Sc.None)return[3,4];if(!(a instanceof Uint8Array))throw new Error("need Uint8Array for decompression");return[4,aAe(e,a,n)];case 1:return i=s.sent(),"string"!==r?[3,3]:[4,e.update({message:"Decoding text..."})];case 2:return s.sent(),a=TO(i,0,i.length),[3,4];case 3:a=i,s.label=4;case 4:return"binary"===r&&a instanceof Uint8Array?[2,a]:[3,5];case 5:return"zip"===r&&a instanceof Uint8Array?[4,vS(e,a.buffer)]:[3,7];case 6:return[2,s.sent()];case 7:if("string"===r&&"string"==typeof a)return[2,a];if("xml"===r&&"string"==typeof a)return[2,(new DOMParser).parseFromString(a,"application/xml")];if("json"===r&&"string"==typeof a)return[2,JSON.parse(a)];s.label=8;case 8:throw new Error("could not get requested response data '".concat(r,"'"))}})})}var VO=function(){function e(){}return e.get=function(){return this.pool.length?this.pool.pop():new dS},e.emptyFunc=function(){},e.deposit=function(t){this.pool.length=200&&e.status<400){var r=e.response;if(VO.deposit(e),("binary"===t||"zip"===t)&&r instanceof ArrayBuffer)return new Uint8Array(r);if("string"===t&&"string"==typeof r)return r;if("xml"===t&&r instanceof XMLDocument)return r;if("json"===t&&"object"==typeof r)return r;throw new Error("could not get requested response data '".concat(t,"'"))}throw VO.deposit(e),new Error("Download failed with status code ".concat(e.status))}(p,r),[2,m]}})})},function(){o&&(o.abort(),o=void 0)})}var dn,GO=void 0;function lAe(e,t,r,n){return ue(this,void 0,void 0,function(){var a,i,o,s,u,c,l,d,f,p,m,h;return ce(this,function(v){switch(v.label){case 0:return a=r.length,i=new Array(r.length),[4,e.update({message:"Downloading...",current:0,max:a})];case 1:for(v.sent(),o=[],s=[],u=0,c=Math.min(a,n);u0?[4,Promise.race(o)]:[3,6];case 3:if(d=v.sent(),f=r[d.index],p=s.indexOf(d.index),l++,"error"===d.kind&&!f.canFail)throw new Error("".concat(f.url,": ").concat(d.error));return e.shouldUpdate?[4,e.update({message:"Downloading...",current:l,max:a})]:[3,5];case 4:v.sent(),v.label=5;case 5:return i[d.index]=d,o=o.filter(wW,p),s=s.filter(wW,p),ut&&(t=e[r]);return t}function Aw(e){for(var t=1/0,r=0,n=e.length;rr&&(r=e[n]);return[t,r]}function TW(e,t,r){void 0===t&&(t=1),void 0===r&&(r=0);for(var n=e.length,a=0,i=r;i=0||(e.push(t),0))}function Lh(e,t){var r=e.indexOf(t);if(r<0)return!1;for(var n=r,a=e.length-1;n"u"?le?re.defaultValue:void 0:q(re.select,Q.name)?(L=re.map(Q.name),{name:Q.name,params:V(L,Q.params,le)}):re.defaultValue}return"select"===re.type?q(re,te)?te:re.defaultValue:"multi-select"===re.type?Array.isArray(te)?(ge=te.filter(function(we){return q(this,we)},re),te.length>0&&0===ge.length?re.defaultValue:ge):re.defaultValue:"object-list"===re.type?Array.isArray(te)?te.map(function(ye){return ee(re.element,ye,le?"all":"skip")}):re.defaultValue:te}function ee(re,te,le){if("object"!=typeof te||null===te)return le?U(re):te;for(var ge=Object.create(null),xe=0,Ge=Object.keys(re);xe0?te[0][0]:void 0}e.Essential={isEssential:!0},e.Optional=function r(re){var te=R({},re);return te.isOptional=!0,te},e.Value=function n(re,te){return t({type:"value",defaultValue:re},te)},e.Select=a,e.MultiSelect=function i(re,te,le){var ge=t({type:"multi-select",defaultValue:re,options:te},le);return le?.emptyValue&&(ge.emptyValue=le.emptyValue),ge},e.Boolean=function o(re,te){return t({type:"boolean",defaultValue:re},te)},e.Text=function s(re,te){return void 0===re&&(re=""),t({type:"text",defaultValue:re},te)},e.Color=function u(re,te){var le=t({type:"color",defaultValue:re},te);return te?.isExpanded&&(le.isExpanded=te.isExpanded),le},e.ColorList=function c(re,te){var le;if("string"==typeof re){var ge=pf(re);le={kind:"qualitative"!==ge.type?"interpolate":"set",colors:ge.list}}else le=re;return t({type:"color-list",presetKind:te?.presetKind||"all",defaultValue:le,offsets:!!te?.offsets},te)},e.Vec3=function l(re,te,le){return t(h({type:"vec3",defaultValue:re},te),le)},e.Mat4=function d(re,te){return t({type:"mat4",defaultValue:re},te)},e.Url=function f(re,te){return t({type:"url",defaultValue:"string"==typeof re?dn.Url(re):dn.Url(re.url,{body:re.body})},te)},e.File=function p(re){var te=t({type:"file",defaultValue:null},re);return re?.accept&&(te.accept=re.accept),te},e.FileList=function m(re){var te=t({type:"file-list",defaultValue:null},re);return re?.accept&&(te.accept=re.accept),te},e.Numeric=function v(re,te,le){var ge=t(h({type:"number",defaultValue:re},te),le);return le?.immediateUpdate&&(ge.immediateUpdate=!0),ge},e.Interval=function g(re,te,le){return t(h({type:"interval",defaultValue:re},te),le)},e.LineGraph=function y(re,te){var le=t({type:"line-graph",defaultValue:re},te);return te?.getVolume&&(le.getVolume=te.getVolume),le},e.Group=S,e.EmptyGroup=function C(re){return S({},re)},e.Mapped=function _(re,te,le,ge){var xe=de(re,te);return t({type:"mapped",defaultValue:{name:xe,params:le(xe).defaultValue},select:a(xe,te,ge),map:le},ge)},e.MappedStatic=function x(re,te,le){var ge=le?.options?le.options:Object.keys(te).map(function(Ge){return[Ge,te[Ge].label||yc(Ge)]}),xe=de(re,ge);return t({type:"mapped",defaultValue:{name:xe,params:te[xe].defaultValue},select:a(xe,ge,le),map:function(Ge){return te[Ge]}},le)},e.ObjectList=function D(re,te,le){return t({type:"object-list",element:re,getLabel:te,ctor:w,defaultValue:le?.defaultValue||[]},le)},e.ValueRef=function E(re,te,le){var ge;return t({type:"value-ref",defaultValue:{ref:null!==(ge=le?.defaultRef)&&void 0!==ge?ge:"",getValue:A},getOptions:re,resolveRef:te},le)},e.DataRef=function I(re){var te;return t({type:"data-ref",defaultValue:{ref:null!==(te=re?.defaultRef)&&void 0!==te?te:"",getValue:A}},re)},e.Converted=function M(re,te,le){return t({type:"converted",defaultValue:te(le.defaultValue),converted:le,fromValue:re,toValue:te},le)},e.Conditioned=function F(re,te,le,ge,xe){var Ge=Object.keys(te).map(function(je){return[je,je]});return t({type:"conditioned",select:a(le(re),Ge,xe),defaultValue:re,conditionParams:te,conditionForValue:le,conditionedValue:ge},xe)},e.Script=function N(re,te){return t({type:"script",defaultValue:re},te)},e.For=function j(re){return 0},e.getDefaultValues=U,e.resolveRefs=X,e.setDefaultValues=function Z(re,te){for(var le=0,ge=Object.keys(re);le=0}function p(v){return v}e.RootRef="-=root=-",e.areStatesEqual=function t(v,g){return!!v.isHidden!=!!g.isHidden||!!v.isCollapsed!=!!g.isCollapsed||!!v.isGhost!=!!g.isGhost||!!v.isLocked!=!!g.isLocked},e.isStateChange=function r(v,g){return!!g&&(typeof g.isCollapsed<"u"&&v.isCollapsed!==g.isCollapsed||typeof g.isHidden<"u"&&v.isHidden!==g.isHidden||typeof g.isGhost<"u"&&v.isGhost!==g.isGhost||typeof g.isLocked<"u"&&v.isLocked!==g.isLocked)},e.assignState=function n(v,g){if(!g)return!1;for(var y=!1,S=0,C=Object.keys(g);S=0})}function g(k){return l(k,function(W,$){var K=[];return ii.doPreOrder($.tree,$.tree.transforms.get(W.transform.ref),K,function(q,V,ee){ee.push(q.ref)}),K.map(function(q){return $.cells.get(q)})})}function y(k){return l(k,function(W,$){var K=[];return $.tree.children.get(W.transform.ref).forEach(function(q){return K.push($.cells.get(q))}),K})}function S(k,W){return m(k,function($){return!!$.obj&&$.obj.type===W.type})}function C(k,W){return f(d(k,function($,K){return M(K.tree,K.cells,$.transform.ref,W)}))}function _(k,W){return f(d(k,function($,K){return j(K.tree,K.cells,$.transform.ref,W)}))}function x(k,W){return f(d(k,function($,K){return N(K.tree,K.cells,$.transform.ref,W)}))}function D(k,W){return m(k,function($){return $.transform.transformer===W})}function w(k,W){return f(d(k,function($,K){return F(K.tree,K.cells,$.transform.ref,W)}))}function A(k,W){return f(d(k,function($,K){return U(K.tree,K.cells,$.transform.ref,W)}))}function E(k){return f(d(k,function(W,$){return $.cells.get($.tree.transforms.get(W.transform.ref).parent)}))}function I(k,W,$,K,q){for(var V=k.transforms.get($),ee=void 0;;){V=k.transforms.get(V.parent);var ae=W.get(V.ref);if(ae.obj&&K(ae)&&(ee=ae,q)||V.ref===on.RootRef)return ee}}function M(k,W,$,K){return I(k,W,$,K,!0)}function F(k,W,$,K){return I(k,W,$,K,!1)}function N(k,W,$,K){return M(k,W,$,Array.isArray(K)?function(q){return K.indexOf(q.transform.transformer)>=0}:function(q){return q.transform.transformer===K})}function j(k,W,$,K){return M(k,W,$,H(K))}function U(k,W,$,K){return F(k,W,$,H(K))}function H(k){return Array.isArray(k)?function(W){for(var $=0,K=k;$=0&&($.ref=k.ref,1))}function ne(k,W,$){if(k.tags){for(var K=$.tags.size,q=0,V=0,ee=k.tags;V1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:Rw(e)?2:Ow(e)?3:0}function Jp(e,t){return 2===$p(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function EW(e,t,r){var n=$p(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function Rw(e){return DAe&&e instanceof Map}function Ow(e){return EAe&&e instanceof Set}function go(e){return e.o||e.t}function zO(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=NW(e);delete t[Kr];for(var r=M0(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=CAe),Object.freeze(e),t&&Cf(e,function(r,n){return HO(n,!0)},!0)),e}function CAe(){vo(2)}function jO(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function sd(e){var t=JO[e];return t||vo(18,e),t}function bS(){return CS}function WO(e,t){t&&(sd("Patches"),e.u=[],e.s=[],e.v=t)}function Fw(e){YO(e),e.p.forEach(xAe),e.p=null}function YO(e){e===CS&&(CS=e.l)}function PW(e){return CS={p:[],l:CS,h:e,m:!0,_:0}}function xAe(e){var t=e[Kr];0===t.i||1===t.i?t.j():t.g=!0}function XO(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.O||sd("ES5").S(t,e,n),n?(r[Kr].P&&(Fw(t),vo(4)),od(e)&&(e=Bw(t,e),t.l||Nw(t,e)),t.u&&sd("Patches").M(r[Kr].t,e,t.u,t.s)):e=Bw(t,r,[]),Fw(t),t.u&&t.v(t.u,t.s),e!==$O?e:void 0}function Bw(e,t,r){if(jO(t))return t;var n=t[Kr];if(!n)return Cf(t,function(s,u){return MW(e,n,t,s,u,r)},!0),t;if(n.A!==e)return t;if(!n.P)return Nw(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=4===n.i||5===n.i?n.o=zO(n.k):n.o,i=a,o=!1;3===n.i&&(i=new Set(a),a.clear(),o=!0),Cf(i,function(s,u){return MW(e,n,a,s,u,r,o)}),Nw(e,a,!1),r&&e.u&&sd("Patches").N(n,r,e.u,e.s)}return n.o}function MW(e,t,r,n,a,i,o){if(Sf(a)){var s=Bw(e,a,i&&t&&3!==t.i&&!Jp(t.R,n)?i.concat(n):void 0);if(EW(r,n,s),!Sf(s))return;e.m=!1}else o&&r.add(a);if(od(a)&&!jO(a)){if(!e.h.D&&e._<1)return;Bw(e,a),t&&t.A.l||Nw(e,a)}}function Nw(e,t,r){void 0===r&&(r=!1),!e.l&&e.h.D&&e.m&&HO(t,r)}function KO(e,t){var r=e[Kr];return(r?go(r):e)[t]}function RW(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function nu(e){e.P||(e.P=!0,e.l&&nu(e.l))}function ZO(e){e.o||(e.o=zO(e.t))}function SS(e,t,r){var n=Rw(t)?sd("MapSet").F(t,r):Ow(t)?sd("MapSet").T(t,r):e.O?function(a,i){var o=Array.isArray(a),s={i:o?1:0,A:i?i.A:bS(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},u=s,c=_S;o&&(u=[s],c=wS);var l=Proxy.revocable(u,c),d=l.revoke,f=l.proxy;return s.k=f,s.j=d,f}(t,r):sd("ES5").J(t,r);return(r?r.A:bS()).p.push(n),n}function OW(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return zO(e)}var FW,CS,QO=typeof Symbol<"u"&&"symbol"==typeof Symbol("x"),DAe=typeof Map<"u",EAe=typeof Set<"u",BW=typeof Proxy<"u"&&void 0!==Proxy.revocable&&typeof Reflect<"u",$O=QO?Symbol.for("immer-nothing"):((FW={})["immer-nothing"]=!0,FW),xS=QO?Symbol.for("immer-draftable"):"__$immer_draftable",Kr=QO?Symbol.for("immer-state"):"__$immer_state",IAe=(typeof Symbol<"u"&&Symbol,""+Object.prototype.constructor),M0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,NW=Object.getOwnPropertyDescriptors||function(e){var t={};return M0(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},JO={},_S={get:function(e,t){if(t===Kr)return e;var a,s,u,r=go(e);if(!Jp(r,t))return a=e,(u=RW(r,t))?"value"in u?u.value:null===(s=u.get)||void 0===s?void 0:s.call(a.k):void 0;var n=r[t];return e.I||!od(n)?n:n===KO(e.t,t)?(ZO(e),e.o[t]=SS(e.A.h,n,e)):n},has:function(e,t){return t in go(e)},ownKeys:function(e){return Reflect.ownKeys(go(e))},set:function(e,t,r){var n=RW(go(e),t);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var a=KO(go(e),t),i=a?.[Kr];if(i&&i.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(function IW(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,a)&&(void 0!==r||Jp(e.t,t)))return!0;ZO(e),nu(e)}return e.o[t]===r&&(void 0!==r||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==KO(e.t,t)||t in e.t?(e.R[t]=!1,ZO(e),nu(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=go(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty:function(){vo(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){vo(12)}},wS={};Cf(_S,function(e,t){wS[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),wS.deleteProperty=function(e,t){return wS.set.call(this,e,t,void 0)},wS.set=function(e,t,r){return _S.set.call(this,e[0],t,r,e[0])};var PAe=function(){function e(r){var n=this;this.O=BW,this.D=!0,this.produce=function(a,i,o){if("function"==typeof a&&"function"!=typeof i){var s=i;i=a;var u=n;return function(h){var v=this;void 0===h&&(h=s);for(var g=arguments.length,y=Array(g>1?g-1:0),S=1;S1?l-1:0),f=1;f=0;a--){var i=n[a];if(0===i.path.length&&"replace"===i.op){r=i.value;break}}a>-1&&(n=n.slice(a+1));var o=sd("Patches").$;return Sf(r)?o(r,n):this.produce(r,function(s){return o(s,n)})},e}(),Nu=new PAe,AS=Nu.produce,MAe=(Nu.produceWithPatches.bind(Nu),Nu.setAutoFreeze.bind(Nu));Nu.setUseProxies.bind(Nu),Nu.applyPatches.bind(Nu),Nu.createDraft.bind(Nu),Nu.finishDraft.bind(Nu);const eF=AS;var Uh;function kW(){for(var e=[],t=0;t0&&this.signal.next({v:this.queue[0],stillPresent:!0})},e.prototype.remove=function(t){var r=gS(this.queue,t);return r&&this.signal.next({v:t,stillPresent:!1}),r},e.prototype.waitFor=function(t){var r=this;return new Promise(function(n){var a=r.signal.subscribe(function(i){var s=i.stillPresent;i.v===t&&(a.unsubscribe(),n(s))})})},e}(),FAe=function(){function e(t,r){this.getHash=t,this.areEqual=r,this.size=0,this.byHash=new Map}return e.prototype.add=function(t){var r=this.getHash(t);if(this.byHash.has(r)){for(var n=this.byHash.get(r),a=0,i=n.length;athis.historyCapacity&&this.history.pop(),this.events.historyUpdated.next({state:this}))},e.prototype.clearHistory=function(){0!==this.history.length&&(this.history=[],this.events.historyUpdated.next({state:this}))},Object.defineProperty(e.prototype,"latestUndoLabel",{get:function(){return this.history.length>0?this.history[0][1]:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canUndo",{get:function(){return this.history.length>0},enumerable:!1,configurable:!0}),e.prototype.undo=function(){var t=this;return Ve.create("Undo",function(r){return ue(t,void 0,void 0,function(){var n;return ce(this,function(a){switch(a.label){case 0:if(!(n=this.history.shift()))return[2];this.events.historyUpdated.next({state:this}),this.undoingHistory=!0,a.label=1;case 1:return a.trys.push([1,,3,4]),[4,this.updateTree(n[0],{canUndo:!1}).runInContext(r)];case 2:return a.sent(),[3,4];case 3:return this.undoingHistory=!1,[7];case 4:return[2]}})})})},e.prototype.getSnapshot=function(){return{tree:ii.toJSON(this._tree)}},e.prototype.setSnapshot=function(t){var r=ii.fromJSON(t.tree);return this.updateTree(r)},e.prototype.setCurrent=function(t){this.behaviors.currentObject.next({state:this,ref:t})},e.prototype.updateCellState=function(t,r){var n=this.cells.get(t);if(n){var a="function"==typeof r?r(n.state):r;on.assignState(n.state,a)&&(n.transform=this._tree.assignState(n.transform.ref,a),this.events.cell.stateUpdated.next({state:this,ref:t,cell:n}))}},e.prototype.dispose=function(){this.ev.dispose(),this.actions.dispose()},e.prototype.select=function(t){return xr.select(t,this)},e.prototype.selectQ=function(t){return xr.select("string"==typeof t?t:t(xr.Generators),this)},e.prototype.applyAction=function(t,r,n){var a=this;return void 0===n&&(n=on.RootRef),Ve.create("Apply Action",function(i){var o=a.cells.get(n);if(!o)throw new Error("'".concat(n,"' does not exist."));if("ok"!==o.status)throw new Error("Action cannot be applied to a cell with status '".concat(o.status,"'"));return iF(t.definition.run({ref:n,cell:o,a:o.obj,params:r,state:a},a.globalContext),i)})},e.prototype.transaction=function(t,r){var n=this;return Ve.create("State Transaction",function(a){return ue(n,void 0,void 0,function(){var i,o,s,u;return ce(this,function(c){switch(c.label){case 0:i=this.inTransaction,o=this._tree.asImmutable(),s=!1,c.label=1;case 1:return c.trys.push([1,5,8,9]),i||this.behaviors.isUpdating.next(!0),this.inTransaction=!0,this.inTransactionError=!1,[4,t(a)];case 2:return c.sent(),this.inTransactionError?(s=!0,[4,this.updateTree(o).runInContext(a)]):[3,4];case 3:c.sent(),c.label=4;case 4:return[3,9];case 5:return u=c.sent(),s?[3,7]:(s=!0,[4,this.updateTree(o).runInContext(a)]);case 6:c.sent(),this.events.log.next(ud.error("Error during state transaction, reverting")),c.label=7;case 7:if(i)throw this.inTransactionError=!0,u;if(r?.rethrowErrors)throw u;return console.error(u),[3,9];case 8:return i||(this.inTransaction=!1,this.events.changed.next({state:this,inTransaction:!1}),this.behaviors.isUpdating.next(!1),s||(r?.canUndo?this.addHistory(o,"string"==typeof r.canUndo?r.canUndo:void 0):this.clearHistory())),[7];case 9:return[2]}})})})},Object.defineProperty(e.prototype,"inUpdate",{get:function(){return this._inUpdate},enumerable:!1,configurable:!0}),e.prototype.updateTree=function(t,r){var n=this,a={tree:t,options:r};return Ve.create("Update Tree",function(i){return ue(n,void 0,void 0,function(){var s,u,c,l;return ce(this,function(d){switch(d.label){case 0:return[4,this.updateQueue.enqueue(a)];case 1:if(!d.sent())return[2];this._inUpdate=!0,s=r?.canUndo?this._tree.asImmutable():void 0,u=!1,this.inTransaction||this.behaviors.isUpdating.next(!0),d.label=2;case 2:if(d.trys.push([2,,7,8]),Uh.is(t)){if(t.editInfo.applied)throw new Error("This builder has already been applied. Create a new builder for further state updates");t.editInfo.applied=!0}return this.reverted=!1,r&&(r.revertIfAborted||r.revertOnError)?[4,this._revertibleTreeUpdate(i,a,r)]:[3,4];case 3:return l=d.sent(),[3,6];case 4:return[4,this._updateTree(i,a)];case 5:l=d.sent(),d.label=6;case 6:return u=this.reverted,(c=l).ctx.hadError&&(this.inTransactionError=!0),c.cell?[2,new Sj(c.cell.transform.ref,this)]:[2];case 7:return this._inUpdate=!1,this.updateQueue.handled(a),this.inTransaction||(this.behaviors.isUpdating.next(!1),r?.canUndo?u||this.addHistory(s,"string"==typeof r.canUndo?r.canUndo:void 0):this.undoingHistory||this.clearHistory()),[7];case 8:return[2]}})})},function(){n.updateQueue.remove(a)})},e.prototype._revertibleTreeUpdate=function(t,r,n){return ue(this,void 0,void 0,function(){var a,i;return ce(this,function(s){switch(s.label){case 0:return a=this.tree,[4,this._updateTree(t,r)];case 1:return((i=s.sent()).ctx.hadError||i.ctx.wasAborted)&&n.revertOnError||i.ctx.wasAborted&&n.revertIfAborted?(this.reverted=!0,[4,this._updateTree(t,{tree:a,options:r.options})]):[3,3];case 2:return[2,s.sent()];case 3:return[2,i]}})})},e.prototype._updateTree=function(t,r){return ue(this,void 0,void 0,function(){var n,a,i;return ce(this,function(o){switch(o.label){case 0:n=!1,a=this.updateTreeAndCreateCtx(r.tree,t,r.options),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,kAe(a)];case 2:return n=o.sent(),Uh.isTo(r.tree)?(i=this.select(r.tree.ref)[0],[2,{ctx:a,cell:i}]):[2,{ctx:a}];case 3:return this.spine.current=void 0,n&&this.events.changed.next({state:this,inTransaction:this.inTransaction}),[7];case 4:return[2]}})})},e.prototype.updateTreeAndCreateCtx=function(t,r,n){var a=(Uh.is(t)?t.getTree():t).asTransient(),i=this._tree;this._tree=a;var o=this.cells,s={parent:this,editInfo:Uh.is(t)?t.editInfo:void 0,errorFree:this.errorFree,taskCtx:r,oldTree:i,tree:a,cells:this.cells,spine:this.spine,results:[],options:R(R({},NAe),n),changed:!1,hadError:!1,wasAborted:!1,newCurrent:void 0,getCellData:function(u){var c;return null===(c=o.get(u).obj)||void 0===c?void 0:c.data}};return this.errorFree=!0,s},e}();!function(e){e.create=function t(n,a){return new e(n,a)},(e.ObjectEvent||(e.ObjectEvent={})).isCell=function a(i,o){return!!o&&i.ref===o.transform.ref&&i.state===o.parent}}(Uw||(Uw={}));var NAe={doNotLogTiming:!1,doNotUpdateCurrent:!0,revertIfAborted:!1,revertOnError:!1,canUndo:!1};function kAe(e){return ue(this,void 0,void 0,function(){var r,n,a,i,o,s,u,c,l,d,f,p,m,h,v,g,y,S,C,_,x,w,A,E,I,F,N;return ce(this,function(j){switch(j.label){case 0:if(n=[],e.editInfo&&1===e.editInfo.count&&e.editInfo.lastUpdate&&e.editInfo.sourceTree===e.oldTree)r=[],a=[e.editInfo.lastUpdate];else{for(r=function GAe(e){var t={newTree:e.tree,cells:e.cells,deletes:[]};return ii.doPostOrder(e.oldTree,e.oldTree.root,t,VAe),t.deletes}(e),F=e.parent.current,i=!1,o=0,s=r;o=0;h--)(C=e.cells.get(r[h]))&&Gw(C.transform,C.obj,C?.transform.params,C.cache,e.parent.globalContext);for(c=0,l=r;c0||a.length>0||e.changed]}})})}function UAe(e,t,r){var n=r.cells.get(e.ref);return n&&n.transform.version===e.version?!("error"===n.status||n&&n.obj===Jn.Null):(r.roots.push(e.ref),!1)}function VAe(e,t,r){!r.newTree.transforms.has(e.ref)&&r.cells.has(e.ref)&&r.deletes.push(e.ref)}function zAe(e,t,r){var n=r.cells.get(e.ref);!n||!on.syncState(n.state,e.state)||r.parent.events.cell.stateUpdated.next({state:r.parent,ref:e.ref,cell:n})}function Vw(e,t,r,n){var a=e.cells.get(t),i=a.status!==r;a.status=r,a.errorText=n,i&&e.parent.events.cell.stateUpdated.next({state:e.parent,ref:t,cell:a})}function jAe(e,t,r){r.cells.get(e.ref).transform=e,Vw(r,e.ref,"pending")}function WAe(e){for(var t=0,r=e.dependencies.dependsOn;t"u"&&(e[a]=t[a])}return e}(t.params,o):o}return T.resolveRefs(i,t.params,e.getCellData),{definition:i,values:t.params}}(e,o,l,i),n.transforms.has(t)&&i.params?[3,2]:(i.params=d,[4,HW(e,i,o.transformer,l,d.values)]);case 1:return aF(f=x.sent(),o),i.obj=f,[2,{ref:t,action:"created",obj:f}];case 2:return p=i.params.values,m=i.cache,h=null===(r=i.obj)||void 0===r?void 0:r.data,v=d.values,i.params=d,i.obj&&i.obj!==Jn.Null?[4,JAe(e,i,o.transformer,l,i.obj,p,v)]:[3,4];case 3:return y=x.sent(),[3,5];case 4:y=rt.UpdateResult.Recreate,x.label=5;case 5:switch(y){case rt.UpdateResult.Recreate:return[3,6];case rt.UpdateResult.Updated:return[3,8];case rt.UpdateResult.Null:return[3,9]}return[3,10];case 6:return Gw(o,C=i.obj,p,m,e.parent.globalContext),[4,HW(e,i,o.transformer,l,v)];case 7:return aF(_=x.sent(),o),i.obj=_,[2,{ref:t,action:"replaced",oldObj:C,obj:_}];case 8:return aF(i.obj,o),[2,{ref:t,action:"updated",oldData:h,obj:i.obj}];case 9:return Gw(o,i.obj,p,m,e.parent.globalContext),i.obj=Jn.Null,[2,{ref:t,action:"updated",obj:i.obj}];case 10:return[2,{action:"none"}]}})})}function Gw(e,t,r,n,a){var i,o;null===(o=(i=e.transformer.definition).dispose)||void 0===o||o.call(i,{b:t!==Jn.Null?t:void 0,params:r,cache:n},a)}function aF(e,t){!e||e===Jn.Null||(e.tags=t.tags)}function iF(e,t){return"function"==typeof e.runInContext?e.runInContext(t):e}function zW(e){if(0!==e.dependencies.dependsOn.length){for(var t=Object.create(null),r=0,n=e.dependencies.dependsOn;r=0?"[Line ".concat(this.line,"] ").concat(this.message):this.message},i}();e.Error=n;var a=function i(o,s){this.result=o,this.warnings=s,this.isError=!1};e.Success=a}(In||(In={})),function(e){function t(s){var u=new DataView(s.buffer);return Object.assign(s.subarray(0),{readInt8:function(c){return u.getInt8(c)},readUInt8:function(c){return u.getUint8(c)},writeInt8:function(c,l){return u.setInt8(l,c)},writeUInt8:function(c,l){return u.setUint8(l,c)},readInt16LE:function(c){return u.getInt16(c,!0)},readInt32LE:function(c){return u.getInt32(c,!0)},readUInt16LE:function(c){return u.getUint16(c,!0)},readUInt32LE:function(c){return u.getUint32(c,!0)},readFloatLE:function(c){return u.getFloat32(c,!0)},readDoubleLE:function(c){return u.getFloat64(c,!0)},writeInt16LE:function(c,l){return u.setInt16(l,c,!0)},writeInt32LE:function(c,l){return u.setInt32(l,c,!0)},writeUInt16LE:function(c,l){return u.setUint16(l,c,!0)},writeUInt32LE:function(c,l){return u.setUint32(l,c,!0)},writeFloatLE:function(c,l){return u.setFloat32(l,c,!0)},writeDoubleLE:function(c,l){return u.setFloat64(l,c,!0)},readInt16BE:function(c){return u.getInt16(c,!1)},readInt32BE:function(c){return u.getInt32(c,!1)},readUInt16BE:function(c){return u.getUint16(c,!1)},readUInt32BE:function(c){return u.getUint32(c,!1)},readFloatBE:function(c){return u.getFloat32(c,!1)},readDoubleBE:function(c){return u.getFloat64(c,!1)},writeInt16BE:function(c,l){return u.setInt16(l,c,!1)},writeInt32BE:function(c,l){return u.setInt32(l,c,!1)},writeUInt16BE:function(c,l){return u.setUint16(l,c,!1)},writeUInt32BE:function(c,l){return u.setUint32(l,c,!1)},writeFloatBE:function(c,l){return u.setFloat32(l,c,!1)},writeDoubleBE:function(c,l){return u.setFloat64(l,c,!1)},copy:function(c,l,d,f){return l=po(l,0),d=po(d,0),f=po(f,s.length),c.set(s.subarray(d,f),l),f-d}})}function a(s,u,c,l,d){for(var f=0,p=c;f>8&255}},e.ensureLittleEndian=function o(s,u,c,l,d){e.IsNativeEndianLittle||!c||l<=1||a(s,u,c,l,d)}}(ml||(ml={})),function(e){e.fromBuffer=function t(r,n){return{name:n,readBuffer:function(a,i,o,s){var u,c;if("number"==typeof i){o=po(o,i);var l=a;u=(d=Math.min(r.length,l+o))-l,c=ml.fromUint8Array(new Uint8Array(r.buffer,l,d-l))}else{o=po(o,i.length),l=a;var d=Math.min(r.length,l+o);i.set(r.subarray(l,d),s),u=d-l,c=i}return o!==u&&console.warn("byteCount ".concat(o," and bytesRead ").concat(u," differ")),Promise.resolve({bytesRead:u,buffer:c})},writeBuffer:function(a,i,o){return o=po(o,i.length),console.error(".writeBuffer not implemented for FileHandle.fromBuffer"),Promise.resolve(0)},writeBufferSync:function(a,i,o){return o=po(o,i.length),console.error(".writeSync not implemented for FileHandle.fromBuffer"),0},close:m0}}}(zw||(zw={}));var pt,Xe,Zr,Ki=function(e){return e.Float32="float32",e.Int8="int8",e.Int16="int16",e.Uint16="uint16",e}(Ki||{});function jW(e){return e===Ki.Float32?4:e===Ki.Int16||e===Ki.Uint16?2:1}function eTe(e,t,r,n){return void 0===r&&(r=0),e===Ki.Float32?new Float32Array(t,r,n):e===Ki.Int16?new Int16Array(t,r,n):e===Ki.Uint16?new Uint16Array(t,r,n):new Int8Array(t,r,n)}function rTe(e,t,r,n,a,i){return ue(this,void 0,void 0,function(){return ce(this,function(o){switch(o.label){case 0:return[4,t.readBuffer(r,e.readBuffer,n,a)];case 1:return o.sent(),e.elementByteSize>1&&(void 0!==i&&i!==ml.IsNativeEndianLittle||!ml.IsNativeEndianLittle)&&ml.flipByteOrder(e.readBuffer,e.valuesBuffer,n,e.elementByteSize,a),[2,e.values]}})})}function nTe(e){return ue(this,void 0,void 0,function(){var r,n,a,i,s,u;return ce(this,function(l){switch(l.label){case 0:return[4,e.readBuffer(0,1024)];case 1:if(r=l.sent().buffer,"MAP "!==(n=String.fromCharCode(r.readUInt8(208),r.readUInt8(209),r.readUInt8(210),r.readUInt8(211))))throw new Error('ccp4 format error, missing "MAP " string');return a=[r.readUInt8(212),r.readUInt8(213)],i=!1,68===a[0]&&65===a[1]?i=!0:17===a[0]&&17===a[1]?i=!1:r.readInt32LE(12)<=16&&(i=!0),u=i?function(d){return r.readFloatLE(4*d)}:function(d){return r.readFloatBE(4*d)},[2,{header:{NC:(s=i?function(d){return r.readInt32LE(4*d)}:function(d){return r.readInt32BE(4*d)})(0),NR:s(1),NS:s(2),MODE:s(3),NCSTART:s(4),NRSTART:s(5),NSSTART:s(6),NX:s(7),NY:s(8),NZ:s(9),xLength:u(10),yLength:u(11),zLength:u(12),alpha:u(13),beta:u(14),gamma:u(15),MAPC:s(16),MAPR:s(17),MAPS:s(18),AMIN:u(19),AMAX:u(20),AMEAN:u(21),ISPG:s(22),NSYMBT:s(23),LSKFLG:s(24),SKWMAT:[],SKWTRN:[],userFlag1:s(39),userFlag2:s(40),originX:u(49),originY:u(50),originZ:u(51),MAP:n,MACHST:a,ARMS:u(54)},littleEndian:i}]}})})}function qW(e){switch(e){case 0:return Ki.Int8;case 1:return Ki.Int16;case 2:return Ki.Float32;case 3:throw new Error("mode 3 unsupported, complex 16-bit integers");case 4:throw new Error("mode 4 unsupported, complex 32-bit reals");case 6:case 16:throw new Error("mode 16 unsupported, unsigned char * 3 (for rgb data, non-standard)")}throw new Error("unknown mode '".concat(e,"'"))}function WW(e){return-128===e.userFlag1&&127===e.userFlag2}function YW(e){return WW(e)?Ki.Float32:qW(e.MODE)}function oTe(e,t,r){return ue(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d,f;return ce(this,function(m){switch(m.label){case 0:return[4,r.update({message:"Parsing CCP4/MRC/MAP file..."})];case 1:return m.sent(),[4,nTe(e)];case 2:return n=m.sent(),i=n.littleEndian,o=function iTe(e){return 1024+e.NSYMBT}(a=n.header),s=qW(a.MODE),u=YW(a),c=a.NC*a.NR*a.NS,l=jW(s),d=c*l,f=function tTe(e,t){var r=jW(t),n=new ArrayBuffer(r*e),a=ml.fromArrayBuffer(n),i=ml.IsNativeEndianLittle?n:new ArrayBuffer(r*e);return{type:t,elementByteSize:r,readBuffer:a,valuesBuffer:new Uint8Array(i),values:eTe(t,i)}}(c,u),function aTe(e,t,r,n,a,i){ue(this,void 0,void 0,function(){var o,s,u,c,l,d;return ce(this,function(f){switch(f.label){case 0:return WW(e)?[4,r.readBuffer(n,t.readBuffer,a,o=3*a)]:[3,2];case 1:for(f.sent(),s=new Int8Array(t.valuesBuffer.buffer,o),c=.5*(e.AMIN+e.AMAX+(u=(e.AMAX-e.AMIN)/255)),l=0,d=a;l=e.length)e.tokenType=6;else{e.tokenStart=e.position,e.tokenEnd=e.position,e.isEscaped=!1;var r=e.data.charCodeAt(e.position);switch(r){case 35:(function yTe(e){for(;e.position=5&&95===e.data.charCodeAt(e.tokenStart+4)?function STe(e){var t=e.data.charCodeAt(e.tokenStart);return!(68!==t&&100!==t||(t=e.data.charCodeAt(e.tokenStart+1),65!==t&&97!==t)||(t=e.data.charCodeAt(e.tokenStart+2),84!==t&&116!==t)||(t=e.data.charCodeAt(e.tokenStart+3),65!==t&&97!==t))}(e)?0:function CTe(e){var t=e.data.charCodeAt(e.tokenStart);return!(83!==t&&115!==t||(t=e.data.charCodeAt(e.tokenStart+1),65!==t&&97!==t)||(t=e.data.charCodeAt(e.tokenStart+2),86!==t&&118!==t)||(t=e.data.charCodeAt(e.tokenStart+3),69!==t&&101!==t))}(e)?1:function xTe(e){if(e.tokenEnd-e.tokenStart!=5)return!1;var t=e.data.charCodeAt(e.tokenStart);return!(76!==t&&108!==t||(t=e.data.charCodeAt(e.tokenStart+1),79!==t&&111!==t)||(t=e.data.charCodeAt(e.tokenStart+2),79!==t&&111!==t)||(t=e.data.charCodeAt(e.tokenStart+3),80!==t&&112!==t))}(e)?2:3:3}}}function em(e){for(eY(e);5===e.tokenType;)eY(e)}function Hw(){return{categoryNames:[],categoryData:Object.create(null)}}function cF(e,t){for(var r=Object.create(null),n=0,a=e;n0&&r.push(tY(i,a,o)),a=e.substring(n.tokenStart+5,n.tokenEnd),i=Hw(),o=[],em(n),[3,6]);case 2:if(1!==l)return[3,3];if(n.tokenEnd-n.tokenStart==5)s.categoryNames.length>0&&(o[o.length]=function DTe(e,t){return sF(e.categoryNames,cF(e.categoryNames,e.categoryData),t)}(s,c)),n.inSaveFrame=!1;else{if(n.inSaveFrame)return[2,R0(n.lineNumber,"Save frames cannot be nested.")];n.inSaveFrame=!0,c=e.substring(n.tokenStart+5,n.tokenEnd),s=Hw()}return em(n),[3,6];case 3:return 2!==l?[3,5]:[4,MTe(n,n.inSaveFrame?s:i)];case 4:return(d=f.sent()).hasError?[2,R0(d.errorLine,d.errorMessage)]:[3,6];case 5:if(4!==l)return console.log(n.tokenType,lt.getTokenString(n)),[2,R0(n.lineNumber,"Unexpected token. Expected data_, loop_, or data name.")];if(d=function ETe(e,t){for(var r=e.tokenStart,n=$W(e),a=JW(e,n),i=Object.create(null),o=[],s=!0;s;){if(4!==e.tokenType||!wTe(e,r,n)){s=!1;break}var u=uF(e).substring(a.length+1);if(em(e),3!==e.tokenType)return{hasError:!0,errorLine:e.lineNumber,errorMessage:"Expected value."};i[u]=pt.ofTokens({data:e.data,indices:[e.tokenStart,e.tokenEnd],count:1}),o[o.length]=u,em(e)}return lF(t,a.substr(1),1,o,i),{hasError:!1,errorLine:0,errorMessage:""}}(n,n.inSaveFrame?s:i),d.hasError)return[2,R0(d.errorLine,d.errorMessage)];f.label=6;case 6:return[3,1];case 7:return n.inSaveFrame?[2,R0(n.lineNumber,"Unfinished save frame (".concat(u.header,")."))]:((i.categoryNames.length>0||o.length>0)&&r.push(tY(i,a,o)),[2,RTe(KW(r))])}})})}function rY(e){var t=this;return Ve.create("Parse CIF",function(r){return ue(t,void 0,void 0,function(){return ce(this,function(n){switch(n.label){case 0:return[4,OTe(e,r)];case 1:return[2,n.sent()]}})})})}!function(e){function r(a,i){var o=Object.keys(i);return{rowCount:o.length>0?i[o[0]].rowCount:0,name:a,fieldNames:o,getField:function(s){return i[s]}}}e.empty=function t(a){return{rowCount:0,name:a,fieldNames:[],getField:function(i){}}},e.ofFields=r,e.ofTable=function n(a,i){for(var o={},s=0,u=i._columns;s1)return 0;if(0===h)return 1;var v=m.charCodeAt(0);return 46===v?1:63===v?2:0},areValuesEqual:function(p,m){return s[p]===s[m]},toStringArray:function(p){return p?_o(u,c,p):s},toIntArray:function(p){return _o(u,l,p)},toFloatArray:function(p){return _o(u,d,p)}}}function i(s){var f,p,m,u=s.rowCount,c=s.valueKind,l=s.areValuesEqual,d=s.isDefined;switch(s.schema.valueType){case"float":case"int":f=function(v){return""+s.value(v)},p=s.value,m=s.value;break;case"str":f=s.value,p=function(v){var g=s.value(v);return Xp(g,0,g.length)||0},m=function(v){var g=s.value(v);return mf(g,0,g.length)||0};break;case"list":var h=s.schema.separator;f=function(v){return s.value(v).join(h)},p=function(v){return NaN},m=function(v){return NaN};break;default:throw new Error("unsupported valueType '".concat(s.schema.valueType,"'"))}return{__array:void 0,binaryEncoding:void 0,isDefined:d,rowCount:u,str:f,int:p,float:m,valueKind:c,areValuesEqual:l,toStringArray:function(v){return _o(u,f,v)},toIntArray:function(v){return _o(u,p,v)},toFloatArray:function(v){return _o(u,m,v)}}}e.ofString=function t(s){return r([s])},e.ofStrings=r,e.ofNumbers=function n(s){var u=s.length,c=function(p){return""+s[p]},l=function(p){return s[p]},f=function(p){return!p||p.array&&s instanceof p.array?s:_o(u,l,p)};return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:u,str:c,int:l,float:l,valueKind:function(p){return 0},areValuesEqual:function(p,m){return s[p]===s[m]},toStringArray:function(p){return _o(u,c,p)},toIntArray:f,toFloatArray:f}},e.ofTokens=function a(s){var u=s.data,c=s.indices,l=s.count,d=function(h){var v=u.substring(c[2*h],c[2*h+1]);return"."===v||"?"===v?"":v},f=function(h){return Xp(u,c[2*h],c[2*h+1])||0},p=function(h){return mf(u,c[2*h],c[2*h+1])||0};return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:l,str:d,int:f,float:p,valueKind:function(h){var v=c[2*h],g=c[2*h+1]-v;if(g>1)return 0;if(0===g)return 1;var y=u.charCodeAt(v);return 46===y?1:63===y?2:0},areValuesEqual:XW(s),toStringArray:function(h){return _o(l,d,h)},toIntArray:function(h){return _o(l,f,h)},toFloatArray:function(h){return _o(l,p,h)}}},e.ofColumn=i,e.ofUndefined=function o(s,u){return i(ie.Undefined(s,u))}}(pt||(pt={})),function(e){function t(y){return y.data.substring(y.tokenStart,y.tokenEnd)}function n(y){for(var S=y.data;y.position=x;)w=_.charCodeAt(--D);return y.tokenStart=x,y.tokenEnd=D+1,y.position=C,y}e.getTokenString=t,e.reset=function r(y){y.position=0,y.lineNumber=1,y.tokenStart=0,y.tokenEnd=0},e.eatLine=n,e.markStart=function a(y){y.tokenStart=y.position},e.markLine=i,e.readLine=function o(y){return i(y),t(y)},e.readLineTrim=function s(y){i(y);var S=y.position;return g(y,y.tokenStart,y.tokenEnd),y.position=S,t(y)},e.markLines=function c(y,S){var C=Xe.create(y.data,2*S);return u(y,S,C),C},e.readLines=function l(y,S){for(var C=[],_=0;_c.indicesLenMinus2&&function t(o){var s=new Uint32Array(1.61*o.indices.length|0);s.set(o.indices),o.indices=s,o.indicesLenMinus2=s.length-2|0}(c),c.indices[c.offset++]=s,c.indices[c.offset++]=u,o.count++}e.add=r,e.addToken=function n(o,s){r(o,s.tokenStart,s.tokenEnd)},e.addUnchecked=function a(o,s,u){o.indices[o.offset++]=s,o.indices[o.offset++]=u,o.count++},e.create=function i(o,s){return{data:o,indicesLenMinus2:(s=Math.max(10,s))-2|0,count:0,offset:0,indices:new Uint32Array(s)}}}(Xe||(Xe={})),function(e){var i;(i=e.IntDataType||(e.IntDataType={}))[i.Int8=1]="Int8",i[i.Int16=2]="Int16",i[i.Int32=3]="Int32",i[i.Uint8=4]="Uint8",i[i.Uint16=5]="Uint16",i[i.Uint32=6]="Uint32",function(i){i[i.Float32=32]="Float32",i[i.Float64=33]="Float64"}(e.FloatDataType||(e.FloatDataType={})),e.getDataType=function n(i){return i instanceof Int8Array?e.IntDataType.Int8:i instanceof Int16Array?e.IntDataType.Int16:i instanceof Int32Array?e.IntDataType.Int32:i instanceof Uint8Array?e.IntDataType.Uint8:i instanceof Uint16Array?e.IntDataType.Uint16:i instanceof Uint32Array?e.IntDataType.Uint32:i instanceof Float32Array?e.FloatDataType.Float32:i instanceof Float64Array?e.FloatDataType.Float64:e.IntDataType.Int32},e.isSignedIntegerDataType=function a(i){if(i instanceof Int8Array||i instanceof Int16Array||i instanceof Int32Array)return!0;for(var o=0,s=i.length;o=0;r--)t=LTe(t,e.encoding[r]);return t}function LTe(e,t){switch(t.kind){case"ByteArray":switch(t.type){case Zr.IntDataType.Uint8:return e;case Zr.IntDataType.Int8:return function UTe(e){return new Int8Array(e.buffer,e.byteOffset)}(e);case Zr.IntDataType.Int16:return function VTe(e){return O0(e,2,Int16Array)}(e);case Zr.IntDataType.Uint16:return function GTe(e){return O0(e,2,Uint16Array)}(e);case Zr.IntDataType.Int32:return function zTe(e){return O0(e,4,Int32Array)}(e);case Zr.IntDataType.Uint32:return function HTe(e){return O0(e,4,Uint32Array)}(e);case Zr.FloatDataType.Float32:return function jTe(e){return O0(e,4,Float32Array)}(e);case Zr.FloatDataType.Float64:return function qTe(e){return O0(e,8,Float64Array)}(e);default:Sn()}case"FixedPoint":return function WTe(e,t){for(var r=e.length,n=aY(t.srcType,r),a=1/t.factor,i=0;i=0?Math.ceil((p+1)/m):Math.ceil((p+1)/(-m-1))}function a(p,m,h){var g=p.limit16;m.pack8+=t(h,p.limit8),m.pack16+=t(h,g),m.count+=1}function i(p,m){p.pack8+=t(m,127),p.pack16+=t(m,32767),p.count+=1}function o(p){return 4*p.count<2*p.pack16?{length:4*p.count,elem:4}:2*p.pack16=0){var s=eDe(e[i],t,r);s<0?n=-1:s>n&&(n=s)}var u=Math.abs(e[i]);if(u>r){var c=Math.floor(Math.log10(Math.abs(u)))+1;c>a&&(a=c)}}return{mantissaDigits:n,integerDigits:a}}(a,4,1e-6),s=o.mantissaDigits;if(s<0||s+o.integerDigits>10)return Fr.by(Fr.byteArray);if(0===s)return TS.classify(a);for(var c=function n(a){for(var i=1,o=0;ot[r])return!1;return!0}(n,a.version.match(/(\d)\.(\d)\.\d/).slice(1).map(function(s){return+s}))?(i=KW(a.dataBlocks.map(function(s){for(var u=Object.create(null),c=0,l=s.categories;c=0?M/D|0:M/w|0}return A+x.length}e.byteArray=u,e.fixedPoint=function l(x){return function(D){return function c(x,D){for(var w=Zr.getDataType(x),A=new Int32Array(x.length),E=0,I=x.length;E=w?A-1:0|Math.round((H-D)/F)}return{encodings:[{kind:"IntervalQuantization",min:D,max:w,numSteps:A,srcType:I}],data:N}}(E,x,D,w,A)}},e.runLength=function p(x){var D=Zr.getDataType(x);if(void 0===D&&(x=new Int32Array(x),D=Zr.IntDataType.Int32),!x.length)return{encodings:[{kind:"RunLength",srcType:D,srcSize:0}],data:new Int32Array(0)};for(var w=2,A=1,E=x.length;A=0)for(;N>=w;)I[M]=w,++M,N-=w;else for(;N<=A;)I[M]=A,++M,N-=A;I[M]=N,++M}var j=u(I);return{encodings:[{kind:"IntegerPacking",byteCount:D.bytesPerElement,isUnsigned:!D.isSigned,srcSize:E},j.encodings[0]],data:j.data}}(x,D)},e.stringArray=function _(x){var D=Object.create(null),w=[],A=new Int32Array(x.length),E=qe.create(Int32Array,1,Math.min(1024,x.length<32?x.length+1:Math.round(x.length/8)+1));qe.add(E,0);for(var I=0,M=0,F=0,N=x;F 3 or rank 0 are currently not supported.")}}(r,n.rank,a,o),u=t.getField(s(i,i,i))||ie.Undefined(t.rowCount,e),c=function(d){return function fTe(e,t,r,n){var a=t.create();if(1===t.rank)for(var i=t.dimensions[0],o=0;o 3 or rank 0 are currently not supported.");var l=t.dimensions[0],d=t.dimensions[1],f=t.dimensions[2];for(o=0;o=0){var _=r(2,4);0===_&&(_=1);for(var x=0;x<_;x++)C.push(x)}else for(var D=lt.readLine(e).trim().split(/\s+/g),w=(x=0,+D[0]);x1e5&&t.shouldUpdate?(i=r.position,[4,t.update({current:r.position,max:r.length})]):[3,3]:[3,4];case 2:l.sent(),l.label=3;case 3:if((o=Jw(n.tokenizer).trim()).startsWith("%VERSION"))a.version=o.substring(8).trim();else if(o.startsWith("%FLAG")){if(s=o.substring(5).trim(),!Jw(n.tokenizer).trim().startsWith("%FORMAT"))throw new Error("expected %FORMAT");if("TITLE"===s)a.title=function CEe(e){for(var t=e.tokenizer,r=[];t.tokenEnd1e5&&t.shouldUpdate?(o=n.position,[4,t.update({current:n.position,max:n.length})]):[3,3]:[3,4];case 2:f.sent(),f.label=3;case 3:if(!(c=_F(a.tokenizer).trim())||"*"===c[0]||";"===c[0])return[3,1];if(c.startsWith("#include"))throw new Error("#include statements not allowed");if(c.startsWith("[")){if(null===(l=c.match(PEe)))throw new Error("expected field name");if("moleculetype"===(d=l[1]))r(),u=function REe(e){for(var t=e.tokenizer,r=void 0;t.tokenEnd=t.length));){var a=t.data[t.position];if("["===a)break;if(";"!==a&&"*"!==a){for(var i=0;i<2;++i)switch(om(t),eA(t),wF(t),i){case 0:Xe.add(r,t.tokenStart,t.tokenEnd);break;case 1:Xe.add(n,t.tokenStart,t.tokenEnd)}EEe(t),eA(t)}else im(t)}return Xr.ofColumns(DEe,{compound:er(r)(ie.Schema.str),molCount:er(n)(ie.Schema.int)})}(a);else for(;n.tokenEnddF){for(var t=[],r=0;r0)throw new Error("dcd format with fixed atoms unsupported, aborting");var h=r.NATOM,v=4*h;for(u=0,s=r.NSET;u=d)return"";var f=l+r;return f>d&&(f=d),function pTe(e,t,r){for(var n=t,a=r-1,i=e.charCodeAt(n);(9===i||32===i)&&n<=a;)i=e.charCodeAt(++n);for(i=e.charCodeAt(a);(9===i||32===i)&&a>=n;)i=e.charCodeAt(--a);return e.substring(n,a+1)}(a,l,f)}:"int"===s?function(c){var l=i[2*c]+t;return l>i[2*c+1]?0:Fh(a,l,l+r)}:function(c){var l=i[2*c]+t;return l>i[2*c+1]?0:function K_e(e,t,r){for(;t=0?(r.timeInPs=parseFloat(n.substring(a+2)),r.title=n.substring(0,a).trim(),r.title&&","===r.title[r.title.length-1]&&(r.title=r.title.substring(0,r.title.length-1))):r.title=n}(a),function sIe(e){var t=e.tokenizer;lt.markLine(t);var r=lt.getTokenString(t);e.numberOfAtoms=parseInt(r)}(a),[4,uIe(a)]):[3,4];case 3:return i=s.sent(),function cIe(e){var r=lt.readLine(e.tokenizer).trim().split(/\s+/g);e.header.box=[+r[0],+r[1],+r[2]]}(a),n.push({header:a.header,atoms:i}),[3,2];case 4:return[2,In.success({structures:n})]}})})}function dIe(e){var t=this;return Ve.create("Parse GRO",function(r){return ue(t,void 0,void 0,function(){return ce(this,function(n){switch(n.label){case 0:return[4,lIe(e,r)];case 1:return[2,n.sent()]}})})})}function fIe(e,t,r){var n=this;return void 0===r&&(r=!1),Ve.create("Parse PDB",function(a){return ue(n,void 0,void 0,function(){var i,o,s;return ce(this,function(u){switch(u.label){case 0:return o=(i=In).success,s={},[4,lt.readAllLinesAsync(e,a)];case 1:return[2,o.apply(i,[(s.lines=u.sent(),s.id=t,s.isPdbqt=r,s)])]}})})})}function sm(e){return{kind:"table-legend",table:e}}!function(e){e.Zero=0;var v,g,t=(v=new ArrayBuffer(8),g=new ArrayBuffer(8),{_int32:new Int32Array(v),_float64:new Float64Array(v),_int32_1:new Int32Array(g),_float64_1:new Float64Array(g)}),r=t._int32,n=t._float64,a=t._int32_1,i=t._float64_1;e.is=function o(v){return"number"==typeof v},e.create=function s(v,g){return r[0]=v,r[1]=g,n[0]},e.diff=function u(v){return n[0]=v,r[1]-r[0]},e.fst=function c(v){return n[0]=v,r[0]},e.snd=function l(v){return n[0]=v,r[1]},e.areEqual=function d(v,g){return n[0]=v,i[0]=g,r[0]===a[0]&&r[1]===a[1]},e.compare=function f(v,g){n[0]=v,i[0]=g;var y=r[0]-a[0];return 0!==y?y:r[1]-a[1]},e.compareInArray=function p(v,g,y){n[0]=v[g],i[0]=v[y];var S=r[0]-a[0];return 0!==S?S:r[1]-a[1]},e.hashCode=function m(v){return n[0]=v,Oh(r[0],r[1])},e.toString=function h(v){return n[0]=v,"(".concat(r[0],", ").concat(r[1],")")}}(vi||(vi={}));var TY=vi.Zero;function DY(e,t){return vi.create(e,t=r&&t0&&n>0&&rA(e)>=tA(t)&&tA(e)<=rA(t)}function xIe(e,t){return zh(e)?!zh(t)||Af(e)<=Af(t)&&um(e)>=um(t):0===zh(t)}function TF(e,t){var r=Af(e);if(t<=r)return 0;var n=um(e);return t>=n?n-r:t-r}function _Ie(e,t,r){var n=Af(r),a=Af(e);if(t<=n+a)return n;var i=um(r);return t>=i+a?i:t-a}function IY(e,t,r){return AF(TF(e,t),TF(e,r+1))}function wIe(e,t){return EY(e,t)?AF(Math.max(Af(e),Af(t)),Math.min(um(e),um(t))):TY}function AIe(e,t){return zh(IY(e,tA(t),rA(t)))}!function(e){e.Empty=TY,e.ofSingleton=function(t){return DY(t,t)},e.ofRange=DY,e.ofBounds=AF,e.ofLength=mIe,e.is=hIe,e.has=yIe,e.indexOf=bIe,e.getAt=SIe,e.start=Af,e.end=um,e.min=tA,e.max=rA,e.size=zh,e.hashCode=vIe,e.toString=gIe,e.areEqual=CIe,e.areIntersecting=EY,e.isSubInterval=xIe,e.findPredecessorIndex=TF,e.findPredecessorIndexInInterval=_Ie,e.findRange=IY,e.intersectionSize=AIe,e.intersect=wIe}(_e||(_e={}));var PS=[];function TIe(e){return[e]}function DIe(e){return e}function EIe(e){return bc(e),e}function PY(e,t){if(t2?function Y_e(e,t,r,n){var a=23;return a=31*(a=31*(a=31*(a=31*a+e|0)+t|0)+r|0)+n|0,(a=(3735928559^(a^=a>>4))+(a<<5))^a>>11}(t,e[0],e[t-1],e[t>>1]):function W_e(e,t,r){var n=23;return n=31*(n=31*(n=31*n+e|0)+t|0)+r|0,(n=(3735928559^(n^=n>>4))+(n<<5))^n>>11}(t,e[0],e[t-1]):0}function OIe(e){var t=e.length;return t>5?"[".concat(e[0],", ").concat(e[1],", ..., ").concat(e[t-1],"], length ").concat(t):"[".concat(e.join(", "),"]")}function OY(e,t){var r=e.length;return 0===r?-1:e[0]<=t&&t<=e[r-1]?NY(e,t,0,r):-1}function FIe(e,t,r){return FY(e,t,_e.start(r),_e.end(r))}function FY(e,t,r,n){return 0===e.length||n<=r?-1:e[r]<=t&&t<=e[n-1]?NY(e,t,r,n):-1}function BIe(e,t){return OY(e,t)>=0}function BY(e,t){if(e===t)return!0;var r=e.length;if(r!==t.length||e[0]!==t[0]||e[r-1]!==t[r-1])return!1;if(MY(e))return!0;r--;for(var n=1;ne[r-1]?r:kY(e,t,0,r)}function NIe(e,t,r){var n=_e.start(r),a=_e.end(r),i=e[n];return t<=i?n:a>n&&t>e[a-1]?a:t-i<=11?function LIe(e,t,r,n){for(var a=r;ai){for(var o=a;o<=i;o++)if(t===e[o])return o;return-1}var s=a+i>>1,u=e[s];if(tu))return s;a=s+1}}return-1}function kY(e,t,r,n){for(var a=r,i=n-1;ai){for(var o=a;o<=i;o++)if(t<=e[o])return o;return i+1}var s=a+i>>1,u=e[s];if(tu))return s;a=s+1}}return a>i?i+1:e[a]>=t?a:a+1}function UIe(e,t){if(e===t)return!0;for(var r=jh(e,t),n=r.startI,a=r.startJ,i=r.endI,o=r.endJ;nu))return!0;a++}}return!1}function VIe(e,t){if(e===t)return!0;var r=t.length,n=jh(e,t),a=n.startI,i=n.startJ,o=n.endI,s=n.endJ;if(s-il?i++:(a++,i++,u++)}return u===r}function LY(e,t){if(e===t)return e;var r=e.length,n=t.length;if(0===r)return t;if(0===n)return e;if(e[0]>t[0])return LY(t,e);var a=jh(e,t),i=a.startI,s=a.endI,u=a.endJ,c=IF(e,t,i,a.startJ,s,u);if(c===r&&c===n||c===n)return e;if(c===r)return t;var l=new Int32Array(r+n-c),d=0,f=0,p=0;for(d=0;dt[f];)l[p++]=t[f++];for(;dh?(l[p++]=h,f++):(l[p++]=m,d++,f++)}for(;dl?s++:(o++,s++,u++)}return u}function zIe(e,t){if(e===t)return e;var r=jh(e,t),n=r.startI,a=r.startJ,i=r.endI,o=r.endJ,s=IF(e,t,n,a,i,o),u=e.length,c=t.length;if(!s)return PS;if(s===u&&s===c||s===c)return t;if(s===u)return e;for(var l=new Int32Array(s),d=0,f=n,p=a;fh||(l[d++]=m,f++),p++)}return l}function HIe(e,t){if(e===t)return PS;for(var r=e.length,n=jh(e,t),a=n.startI,i=n.startJ,o=n.endI,s=n.endJ,u=a,c=i,l=0;uf?c++:(u++,c++,l++);if(!l)return e;if(l>=r)return PS;for(var p=new Int32Array(r-l),m=0,h=0;hf||u++,c++)}for(;ud?u++:(s++,u++,c++);if(!c)return PS;if(c===e.length)return AO(0,e.length-1);var p=new Int32Array(c),m=0;for(s=n,u=a;sd||(p[m++]=s,s++),u++)}return p}var Ye,Tf={startI:0,startJ:0,endI:0,endJ:0};function jh(e,t){var r=e.length,n=t.length,a=r/n;return r>=128||n>=128||a<=.34||a>=2.99?(Tf.startI=Hh(e,DF(t)),Tf.startJ=Hh(t,DF(e)),Tf.endI=Hh(e,EF(t)),Tf.endJ=Hh(t,EF(e))):(Tf.startI=0,Tf.startJ=0,Tf.endI=r,Tf.endJ=n),Tf}!function(e){e.Empty=PS,e.ofUnsortedArray=EIe,e.ofSingleton=TIe,e.ofSortedArray=DIe,e.ofRange=PY,e.ofBounds=function(t,r){return PY(t,r-1)},e.is=IIe,e.isRange=MY,e.has=BIe,e.indexOf=OY,e.indexOfInInterval=FIe,e.indexOfInRange=FY,e.start=DF,e.end=EF,e.min=PIe,e.max=MIe,e.size=RY,e.hashCode=RIe,e.toString=OIe,e.areEqual=BY,e.areIntersecting=UIe,e.isSubset=VIe,e.union=LY,e.intersect=zIe,e.subtract=HIe,e.findPredecessorIndex=Hh,e.findPredecessorIndexInInterval=NIe,e.findRange=kIe,e.intersectionSize=GIe,e.deduplicate=jIe,e.indicesOf=qIe}(Ye||(Ye={}));var ke,fd=_e.Empty,WIe=_e.ofSingleton,YIe=_e.ofRange,XIe=_e.ofBounds;function vl(e){return e.length?Ye.isRange(e)?_e.ofRange(e[0],e[e.length-1]):e:fd}function qh(e){return _e.is(e)?_e.size(e):Ye.size(e)}function KIe(e,t){return _e.is(e)?_e.has(e,t):Ye.has(e,t)}function ZIe(e,t){return _e.is(e)?_e.indexOf(e,t):Ye.indexOf(e,t)}function PF(e,t){return _e.is(e)?_e.getAt(e,t):e[t]}function N0(e){return _e.is(e)?_e.min(e):Ye.min(e)}function k0(e){return _e.is(e)?_e.max(e):Ye.max(e)}function QIe(e){return _e.is(e)?_e.start(e):Ye.start(e)}function $Ie(e){return _e.is(e)?_e.end(e):Ye.end(e)}function JIe(e){return _e.is(e)?_e.hashCode(e):Ye.hashCode(e)}function t3e(e,t){return _e.is(e)?_e.is(t)?_e.areEqual(e,t):UY(e,t):_e.is(t)?UY(t,e):Ye.areEqual(e,t)}function r3e(e,t){return _e.is(e)?_e.is(t)?_e.areIntersecting(e,t):VY(t,e):_e.is(t)?VY(e,t):Ye.areIntersecting(e,t)}function n3e(e,t){return _e.is(e)?_e.is(t)?_e.isSubInterval(e,t):function f3e(e,t){var r=_e.min(e),n=_e.max(e);if(n-r+1==0)return!1;var a=Ye.min(t),i=Ye.max(t);return a>=r&&i<=n}(e,t):_e.is(t)?function d3e(e,t){var r=_e.min(t),n=_e.max(t);if(n-r+1==0)return!0;var a=Ye.min(e),i=Ye.max(e);if(ri)return!1;var o=Ye.findRange(e,r,n);return _e.size(o)===_e.size(t)}(e,t):Ye.isSubset(e,t)}function a3e(e,t){return _e.is(e)?_e.findPredecessorIndex(e,t):Ye.findPredecessorIndex(e,t)}function i3e(e,t,r){return _e.is(e)?_e.findPredecessorIndexInInterval(e,t,r):Ye.findPredecessorIndexInInterval(e,t,r)}function o3e(e,t,r){return _e.is(e)?_e.findRange(e,t,r):Ye.findRange(e,t,r)}function s3e(e,t){return _e.is(e)?_e.is(t)?_e.intersectionSize(e,t):zY(t,e):_e.is(t)?zY(e,t):Ye.intersectionSize(e,t)}function u3e(e,t){return _e.is(e)?_e.is(t)?function h3e(e,t){if(_e.areEqual(e,t))return e;var r=_e.size(e),n=_e.size(t);if(!n)return e;if(!r)return t;var o,s,u,c,a=_e.min(e),i=_e.min(t);if(function p3e(e,t){var r=qh(e),n=qh(t);return 0===r&&0===n||r>0&&n>0&&k0(e)>=N0(t)&&N0(e)<=k0(t)}(e,t))return _e.ofRange(Math.min(a,i),Math.max(_e.max(e),_e.max(t)));a=k0(t):0===qh(t)}(t,e))return t;for(var n=_e.min(t),a=_e.max(t),i=Ye.findRange(e,n,a),o=_e.start(i),s=_e.end(i),u=new Int32Array(o+(e.length-s)+r),c=0,l=0;lp||(u++,l++),d++);if(0===u)return fd;if(u===a&&u===i)return e;var m=new Int32Array(u);for(c=0,l=0,d=o;lp||(m[c++]=d,l++),d++)}return vl(m)}function jY(e){for(var t=Ye.ofSortedArray(e),r=Ye.max(t),n=new Int32Array(r),a=0,i=e.length-1;a=ke.max(n)?-1:ke.findPredecessorIndex(n,r-1);return ke.findRange(t,ke.getAt(n,i),ke.getAt(n,i+1)-1)}!function(e){e.Empty=fd,e.ofSingleton=WIe,e.ofRange=YIe,e.ofBounds=XIe,e.ofSortedArray=vl,e.has=KIe,e.indexOf=ZIe,e.getAt=PF,e.min=N0,e.max=k0,e.start=QIe,e.end=$Ie,e.size=qh,e.hashCode=JIe,e.areEqual=t3e,e.areIntersecting=r3e,e.isSubset=n3e,e.union=u3e,e.intersect=c3e,e.indexedIntersect=C3e,e.subtract=l3e,e.findPredecessorIndex=a3e,e.findPredecessorIndexInInterval=i3e,e.findRange=o3e,e.intersectionSize=s3e,e.forEach=function t(s,u,c){return function b3e(e,t,r){if(_e.is(e))for(var n=_e.min(e),a=n,i=_e.max(e);a<=i;a++)t(a,a-n,r);else for(a=0,i=e.length;a=this.segmentMin&&_e.size(this.setRange)>0;break}this.updateSegmentRange()}return this.value},e.prototype.updateValue=function(){var r=ke.findPredecessorIndexInInterval(this.set,this.segments[this.segmentMin+1],this.setRange);return this.value.start=_e.start(this.setRange),this.value.end=r,this.setRange=_e.ofBounds(r,_e.end(this.setRange)),r>this.value.start},e.prototype.updateSegmentRange=function(){var t=_e.min(this.setRange),r=_e.max(this.setRange);r=this.segmentMin)},e.prototype.setSegment=function(t){this.setRange=_e.ofBounds(t.start,t.end),this.updateSegmentRange()},e}();function D3e(e,t,r){var n=typeof r<"u"?_e.ofBounds(r.start,r.end):_e.ofBounds(0,ke.size(t));return new T3e(e.offsets,e.index,t,n)}!function(e){e.create=jY,e.ofOffsets=x3e,e.count=_3e,e.getSegment=w3e,e.projectValue=A3e,e.transientSegments=D3e}(pr||(pr={}));var xc,I3e=function(){function e(t){this.head=t>0?0:-1,this.prev=new Int32Array(t),this.next=new Int32Array(t);for(var r=0;r=0&&(a[i]=o,n[t]=-1),o>=0&&(n[o]=i,a[t]=-1),t===this.head&&(this.head=i<0?o:i)},e.prototype.has=function(t){return this.prev[t]>=0||this.next[t]>=0||this.head===t},e}();!function(e){function r(){return new Map}e.Empty=new Map,e.keyArray=function t(o){return Cw(o.keys())},e.Mutable=r,e.asImmutable=function n(o){return o},e.copy=function a(o){for(var s=r(),u=o.keys();;){var c=u.next(),d=c.value;if(c.done)break;s.set(d,o.get(d))}return s},e.addFrom=function i(o,s){for(var u=s.keys();;){var c=u.next(),d=c.value;if(c.done)break;o.set(d,s.get(d))}return o}}(xc||(xc={}));var nA,P3e=function(){function e(t){this.xs=[],this.index=-1,this.length=0,this.hasNext=!1,this.length=t.length,this.hasNext=t.length>0,this.xs=t,this.index=-1,this.lastValue=t.length>0?t[0]:void 0}return e.prototype.move=function(){return++this.index,this.lastValue=this.xs[this.index],this.hasNext=this.index=t}return e.prototype.move=function(){return++this.value,this.hasNext=this.value_)return S[_];var A=C[w-1],I=Xi((D-A)/(C[w]-A),0,1);return dt.interpolate(S[w-1],S[w],I)}}else v=function(x){var D=Math.min(u.length-1,Math.max(0,(x-d)/l*c)),w=Math.floor(D),A=u[w],E=u[Math.ceil(D)];return dt.interpolate(A,E,D-w)};return{color:v,colorToArray:function(x,D,w){dt.toArray(v(x),D,w)},normalizedColorToArray:function(x,D,w){dt.toArrayNormalized(v(x),D,w)},setDomain:p,get legend(){return function pIe(e,t,r){return{kind:"scale-legend",minLabel:e,maxLabel:t,colors:r}}(m,h,u)}}}}(_c||(_c={})),function(e){function t(v,g,y){var S=y||{},C=S.assembly,_=S.ncsId,x=S.hkl,D=S.spgrOp,w=S.key,A=x?b.clone(x):b();D=D??-1,w=w??-1,_=_||-1;var E=he.isIdentity(g),I=function n(v,g){if(!v)return"";if(v.assembly)return function r(v){return!!v&&!!v.matrix&&!!v.inverse&&"string"==typeof v.name}(v)?v.suffix:g?"":"_".concat(v.assembly.operId);if(typeof v.spgrOp<"u"&&typeof v.hkl<"u"&&-1!==v.spgrOp){var y=v.hkl,S=y[0],C=y[1],_=y[2];return"-".concat(v.spgrOp+1,"_").concat(5+S).concat(5+C).concat(5+_)}return-1!==v.ncsId?"_".concat(v.ncsId):""}(y,E);return E?{name:v,assembly:C,matrix:g,inverse:he.identity(),isIdentity:!0,hkl:A,spgrOp:D,ncsId:_,suffix:I,key:w}:(he.isRotationAndTranslation(g,e.RotationTranslationEpsilon)||console.warn("Symmetry operator (".concat(v,") should be a composition of rotation and translation.")),{name:v,assembly:C,matrix:g,inverse:he.invert(he(),g),isIdentity:!1,hkl:A,spgrOp:D,key:w,ncsId:_,suffix:I})}e.DefaultName="1_555",e.Default=t(e.DefaultName,he.identity()),e.RotationTranslationEpsilon=.005,e.create=t,e.checkIfRotationAndTranslation=function a(v,g){for(var y=he.identity(),S=0;S<3;S++)for(var C=0;C<3;C++)he.setValue(y,S,C,Qt.getValue(v,S,C));return he.setTranslation(y,g),he.isRotationAndTranslation(y,e.RotationTranslationEpsilon)},e.ofRotationAndOffset=function i(v,g,y,S){for(var C=he.identity(),_=0;_<3;_++)for(var x=0;x<3;x++)he.setValue(C,_,x,Qt.getValue(g,_,x));return he.setTranslation(C,y),t(v,C,{ncsId:S})};var o=hn.identity(),s=hn(),u=hn(),c=b();function h(v,g){return v.isIdentity?function V3e(e){var t=e.x,r=e.y,n=e.z;return function(i,o){return o[0]=t[i],o[1]=r[i],o[2]=n[i],o}}(g):function G3e(e,t){var r=e.matrix,n=t.x,a=t.y,i=t.z;return aA(r)?function(s,u){var c=n[s],l=a[s],d=i[s];return u[0]=r[0]*c+r[4]*l+r[8]*d+r[12],u[1]=r[1]*c+r[5]*l+r[9]*d+r[13],u[2]=r[2]*c+r[6]*l+r[10]*d+r[14],u}:function(s,u){return u[0]=n[s],u[1]=a[s],u[2]=i[s],b.transformMat4(u,u,r),u}}(v,g)}e.lerpFromIdentity=function l(v,g,y){var S=g.inverse;if(g.isIdentity)return he.copy(v,S);var C=1-y;he.getRotation(s,S),hn.slerp(s,o,s,C);var _=hn.getAxisAngle(c,s);return he.fromRotation(v,_,c),he.setValue(v,0,3,C*he.getValue(S,0,3)),he.setValue(v,1,3,C*he.getValue(S,1,3)),he.setValue(v,2,3,C*he.getValue(S,2,3)),v},e.slerp=function d(v,g,y,S){if(Math.abs(S)<=1e-5)return he.copy(v,g);if(Math.abs(S-1)<=1e-5)return he.copy(v,y);he.getRotation(s,g),he.getRotation(u,y),hn.slerp(u,s,u,S);var C=hn.getAxisAngle(c,u);return he.fromRotation(v,C,c),he.setValue(v,0,3,ta(he.getValue(g,0,3),he.getValue(y,0,3),S)),he.setValue(v,1,3,ta(he.getValue(g,1,3),he.getValue(y,1,3),S)),he.setValue(v,2,3,ta(he.getValue(g,2,3),he.getValue(y,2,3),S)),v},e.compose=function f(v,g){var y=he.mul(he(),g.matrix,v.matrix);return t(g.name,y,g)},e.createMapping=function m(v,g,y){return void 0===y&&(y=B3e),function p(v,g,y){var S=h(e.Default,g),C=v.isIdentity?S:h(v,g),_=function N3e(e,t){return e.isIdentity?{x:MF(t.x),y:MF(t.y),z:MF(t.z)}:{x:k3e(e,t),y:L3e(e,t),z:U3e(e,t)}}(v,g);return{operator:v,coordinates:g,invariantPosition:S,position:C,x:_.x,y:_.y,z:_.z,r:y}}(v,g,y)},e.createCoordinateMapper=h}(ra||(ra={}));var RF=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[-1,0,0,0],[0,-1,0,0],[0,0,-1,0],[0,1,0,.5],[1,0,0,.5],[-1,0,0,.5],[0,0,1,.5],[0,-1,0,.5],[0,0,-1,.5],[1,0,0,.25],[0,-1,0,.25],[0,0,1,.25],[-1,0,0,.25],[0,1,0,.25],[0,-1,0,.75],[0,0,1,.75],[0,1,0,.75],[1,0,0,.75],[-1,0,0,.75],[0,0,-1,.25],[0,0,-1,.75],[1,-1,0,0],[-1,1,0,0],[0,0,1,1/3],[0,0,1,2/3],[1,0,0,2/3],[0,1,0,1/3],[0,-1,0,2/3],[1,-1,0,1/3],[-1,1,0,2/3],[-1,0,0,1/3],[1,0,0,1/3],[0,1,0,2/3],[0,-1,0,1/3],[1,-1,0,2/3],[-1,1,0,1/3],[-1,0,0,2/3],[0,0,-1,1/3],[0,0,-1,2/3],[0,0,1,5/6],[0,0,1,1/6],[0,0,-1,5/6],[0,0,-1,1/6]],z3e=[[0,1,2],[3,4,5],[3,1,5],[3,6,5],[7,6,2],[8,6,5],[0,4,2],[0,4,9],[7,10,2],[7,10,9],[0,10,2],[8,10,5],[3,1,11],[3,6,11],[0,10,9],[8,6,11],[3,4,2],[0,4,5],[3,4,9],[7,10,5],[8,4,9],[8,10,9],[8,10,2],[0,6,9],[3,10,9],[0,10,11],[7,1,9],[8,1,11],[7,4,11],[7,6,9],[7,10,11],[3,10,2],[8,1,5],[0,4,11],[3,1,2],[3,1,9],[7,4,2],[8,1,2],[8,1,9],[3,6,9],[7,4,9],[8,6,2],[8,6,9],[3,6,2],[12,13,14],[15,16,14],[12,17,18],[15,19,18],[20,13,18],[21,16,18],[20,17,14],[21,19,14],[0,1,5],[8,10,11],[7,6,11],[7,6,5],[8,4,2],[7,4,5],[7,1,5],[7,1,11],[0,10,5],[0,1,11],[0,6,11],[0,6,5],[3,10,11],[8,4,11],[15,13,22],[12,16,22],[15,17,23],[12,19,23],[21,13,23],[20,16,23],[21,17,22],[20,19,22],[4,0,2],[1,3,2],[4,0,14],[1,3,18],[4,0,9],[1,3,9],[4,0,18],[1,3,14],[10,7,9],[6,8,9],[4,7,14],[6,3,18],[10,0,18],[1,8,14],[1,3,5],[4,0,5],[6,8,11],[10,7,11],[1,3,11],[4,0,11],[10,7,2],[6,8,2],[3,10,22],[7,1,23],[8,4,23],[0,6,22],[1,0,5],[4,3,5],[1,0,23],[4,3,22],[10,7,14],[6,8,18],[8,6,22],[7,10,23],[4,3,11],[1,0,11],[1,0,22],[4,3,23],[10,7,18],[6,8,14],[8,6,23],[7,10,22],[6,7,11],[10,8,11],[8,1,23],[0,10,22],[3,6,22],[7,4,23],[4,3,2],[1,0,2],[10,8,2],[6,7,2],[4,3,9],[1,0,9],[10,8,9],[6,7,9],[4,8,14],[6,0,18],[10,3,18],[1,7,14],[4,8,18],[6,0,14],[10,3,14],[1,7,18],[6,7,5],[10,8,5],[6,8,5],[10,7,5],[8,1,22],[0,10,23],[3,6,23],[7,4,22],[4,24,2],[25,3,2],[4,24,26],[25,3,27],[4,24,27],[25,3,26],[28,29,26],[30,31,26],[32,33,26],[34,35,27],[36,37,27],[38,39,27],[2,0,1],[1,2,0],[1,25,5],[24,0,5],[39,36,40],[35,38,40],[37,34,40],[33,30,41],[29,32,41],[31,28,41],[5,3,4],[4,5,3],[25,1,5],[0,24,5],[24,4,5],[3,25,5],[4,3,41],[25,1,40],[24,4,41],[3,25,40],[4,3,40],[25,1,41],[24,4,40],[3,25,41],[35,34,40],[37,36,40],[39,38,40],[29,28,41],[31,30,41],[33,32,41],[3,5,4],[5,4,3],[25,1,2],[0,24,2],[24,4,2],[3,25,2],[25,1,9],[0,24,9],[24,4,9],[3,25,9],[30,33,26],[32,29,26],[28,31,26],[36,39,27],[38,35,27],[34,37,27],[0,2,1],[2,1,0],[30,33,42],[32,29,42],[28,31,42],[36,39,43],[38,35,43],[34,37,43],[7,9,6],[9,6,7],[25,1,11],[0,24,11],[24,4,11],[3,25,11],[35,34,44],[37,36,44],[39,38,44],[29,28,45],[31,30,45],[33,32,45],[8,11,10],[11,10,8],[1,25,2],[24,0,2],[1,25,42],[24,0,43],[1,25,43],[24,0,42],[1,25,27],[24,0,26],[1,25,26],[24,0,27],[1,25,9],[24,0,9],[4,24,5],[25,3,5],[4,24,11],[25,3,11],[1,0,40],[4,3,44],[0,24,45],[1,0,41],[4,3,45],[0,24,44],[0,24,40],[0,24,41],[2,3,4],[5,3,1],[5,0,4],[4,2,3],[1,5,3],[4,5,0],[2,7,6],[2,8,10],[5,8,6],[5,7,10],[1,9,7],[4,9,8],[1,11,8],[4,11,7],[9,0,6],[9,3,10],[11,3,6],[11,0,10],[6,2,7],[10,2,8],[6,5,8],[10,5,7],[9,7,1],[9,8,4],[11,8,1],[11,7,4],[6,9,0],[10,9,3],[6,11,3],[10,11,0],[9,7,6],[9,8,10],[11,8,6],[11,7,10],[6,9,7],[10,9,8],[6,11,8],[10,11,7],[2,3,10],[5,8,1],[11,0,4],[10,2,3],[1,5,8],[4,11,0],[5,0,1],[2,0,4],[2,3,1],[1,5,0],[4,2,0],[1,2,3],[11,8,10],[11,7,6],[9,7,10],[9,8,6],[10,11,8],[6,11,7],[10,9,7],[6,9,8],[5,8,10],[5,7,6],[2,7,10],[2,8,6],[4,11,8],[1,11,7],[4,9,7],[1,9,8],[11,3,10],[11,0,6],[9,0,10],[9,3,6],[10,5,8],[6,5,7],[10,2,7],[6,2,8],[11,8,4],[11,7,1],[9,7,4],[9,8,1],[10,11,3],[6,11,0],[10,9,0],[6,9,3],[22,15,13],[22,12,16],[14,12,13],[14,15,16],[13,22,15],[16,22,12],[13,14,12],[16,14,15],[22,21,17],[22,20,19],[14,20,17],[14,21,19],[13,23,21],[16,23,20],[13,18,20],[16,18,21],[23,15,17],[23,12,19],[18,12,17],[18,15,19],[17,22,21],[19,22,20],[17,14,20],[19,14,21],[23,21,13],[23,20,16],[18,20,13],[18,21,16],[17,23,15],[19,23,12],[17,18,12],[19,18,15],[5,0,6],[2,7,4],[9,3,1],[6,5,0],[4,2,7],[1,9,3],[0,2,4],[3,2,1],[0,5,1],[2,1,3],[2,4,0],[5,1,0],[7,9,10],[8,9,6],[7,11,6],[9,6,8],[9,10,7],[11,6,7],[1,7,11],[4,8,11],[1,8,9],[4,7,9],[0,9,10],[3,9,6],[3,11,10],[0,11,6],[2,6,8],[2,10,7],[5,6,7],[5,10,8],[6,0,11],[10,3,11],[6,3,9],[10,0,9],[7,2,10],[8,2,6],[8,5,10],[7,5,6],[9,1,8],[9,4,7],[11,1,7],[11,4,8],[7,9,4],[8,9,1],[8,11,4],[7,11,1],[9,6,3],[9,10,0],[11,6,0],[11,10,3],[19,12,23],[13,15,22],[16,21,18],[17,20,14],[20,14,17],[21,18,16],[15,22,13],[12,23,19],[18,16,21],[14,17,20],[23,19,12],[22,13,15],[19,20,22],[13,21,23],[16,15,14],[17,12,18],[20,18,13],[21,14,19],[15,23,17],[12,22,16],[18,19,15],[14,13,12],[23,16,20],[22,17,21],[16,12,22],[17,15,23],[19,21,14],[13,20,18],[12,14,13],[15,18,19],[21,22,17],[20,23,16],[14,16,15],[18,17,12],[22,19,20],[23,13,21],[16,20,23],[17,21,22],[19,15,18],[13,12,14],[12,18,17],[15,14,16],[21,23,13],[20,22,19],[14,19,21],[18,13,20],[22,16,12],[23,17,15],[19,12,22],[17,21,23],[16,15,18],[13,20,14],[20,14,13],[15,18,16],[21,23,17],[12,22,19],[18,16,15],[14,13,20],[22,19,12],[23,17,21],[3,2,4],[3,5,1],[0,5,4],[2,4,3],[5,1,3],[5,4,0],[1,7,9],[4,8,9],[1,8,11],[4,7,11],[0,9,6],[3,9,10],[3,11,6],[0,11,10],[2,6,7],[2,10,8],[5,6,8],[5,10,7],[6,0,9],[10,3,9],[6,3,11],[10,0,11],[7,2,6],[8,2,10],[8,5,6],[7,5,10],[9,1,7],[9,4,8],[11,1,8],[11,4,7],[7,9,1],[8,9,4],[8,11,1],[7,11,4],[9,6,0],[9,10,3],[11,6,3],[11,10,0],[8,9,10],[8,11,6],[7,11,10],[9,10,8],[11,6,8],[11,10,7],[6,0,2],[10,3,2],[6,3,5],[10,0,5],[7,2,1],[8,2,4],[8,5,1],[7,5,4],[9,1,0],[9,4,3],[11,1,3],[11,4,0],[1,7,2],[4,8,2],[1,8,5],[4,7,5],[0,9,1],[3,9,4],[3,11,1],[0,11,4],[2,6,0],[2,10,3],[5,6,3],[5,10,0],[0,2,6],[3,2,10],[3,5,6],[0,5,10],[2,1,7],[2,4,8],[5,1,8],[5,4,7],[16,12,14],[13,21,18],[19,15,23],[17,20,22],[12,14,16],[21,18,13],[15,23,19],[20,22,17],[14,16,12],[18,13,21],[23,19,15],[22,17,20],[19,20,18],[17,15,14],[16,21,22],[13,12,23],[20,18,19],[15,14,17],[21,22,16],[12,23,13],[18,19,20],[14,17,15],[22,16,21],[23,13,12],[6,0,5],[10,3,5],[6,3,2],[10,0,2],[7,2,4],[8,2,1],[8,5,4],[7,5,1],[9,1,3],[9,4,0],[11,1,0],[11,4,3],[1,7,5],[4,8,5],[1,8,2],[4,7,2],[0,9,4],[3,9,1],[3,11,4],[0,11,1],[2,6,3],[2,10,0],[5,6,0],[5,10,3],[0,2,10],[3,2,6],[3,5,10],[0,5,6],[2,1,8],[2,4,7],[5,1,7],[5,4,8],[21,17,23],[20,16,22],[12,13,18],[15,19,14],[23,21,17],[22,20,16],[18,12,13],[14,15,19],[17,23,21],[16,22,20],[13,18,12],[19,14,15],[21,13,22],[20,19,23],[12,17,14],[15,16,18],[23,15,13],[22,12,19],[18,20,17],[14,21,16],[17,22,15],[16,23,12],[13,14,20],[19,18,21],[15,17,22],[12,16,23],[20,13,14],[21,19,18],[22,21,13],[23,20,19],[14,12,17],[18,15,16],[13,23,15],[19,22,12],[17,18,20],[16,14,21],[15,13,23],[12,19,22],[20,17,18],[21,16,14],[22,15,17],[23,12,16],[14,20,13],[18,21,19],[13,22,21],[19,23,20],[17,14,12],[16,18,15],[6,5,3],[4,9,3],[9,3,4],[5,7,4],[4,5,7],[5,3,6]],H3e=[[0],[0,1],[0,2],[0,3],[0,2,4,5],[0,6],[0,7],[0,6,4,8],[0,7,4,9],[0,6,2,1],[0,3,1,10],[0,6,2,1,4,8,5,11],[0,12,1,7],[0,1,13,14],[0,12,1,7,4,15,11,9],[0,16,2,17],[0,18,12,17],[0,16,5,19],[0,20,13,19],[0,18,12,17,4,21,15,19],[0,16,2,17,4,22,5,19],[0,16,2,17,23,24,13,25,26,20,27,28,4,22,5,19],[0,16,17,2,29,21,30,15],[0,20,13,19,29,31,32,33],[0,16,6,34],[0,18,7,34],[0,16,7,35],[0,16,36,37],[0,18,36,38],[0,16,14,39],[0,20,40,34],[0,16,8,41],[0,18,8,42],[0,16,9,42],[0,16,6,34,4,22,8,41],[0,18,7,34,4,21,9,41],[0,16,7,35,4,22,9,42],[0,16,6,34,23,24,14,39],[0,16,10,43,23,24,7,35],[0,16,36,37,23,24,9,42],[0,16,8,41,23,24,40,38],[0,16,6,34,23,24,14,39,26,20,40,38,4,22,8,41],[0,16,44,45,23,24,46,47,26,20,48,49,4,22,50,51],[0,16,6,34,29,21,9,42],[0,16,8,41,29,21,7,35],[0,16,36,37,29,21,14,39],[0,16,2,17,1,52,6,34],[0,16,2,17,53,54,9,42],[0,16,12,33,1,52,7,35],[0,16,2,17,11,55,8,41],[0,56,2,57,1,58,6,37],[0,56,15,25,1,58,9,39],[0,20,27,17,1,59,40,34],[0,56,12,28,1,58,7,38],[0,16,5,19,1,52,8,41],[0,22,13,28,1,55,14,38],[0,18,13,60,1,61,14,43],[0,16,15,30,1,52,9,42],[0,16,5,19,11,55,6,34],[0,21,12,19,1,54,7,41],[0,20,13,19,1,59,14,41],[0,20,3,30,1,59,10,42],[0,18,12,17,1,61,7,34,4,21,15,19,11,54,9,41],[0,24,13,17,1,62,14,34,4,20,27,19,11,59,40,41],[0,16,2,17,1,52,6,34,4,22,5,19,11,55,8,41],[0,16,12,33,1,52,7,35,4,22,15,30,11,55,9,42],[0,31,3,17,1,63,10,34,4,56,32,19,11,58,36,41],[0,22,2,19,64,59,14,38,4,16,5,17,65,62,40,39],[0,16,2,17,1,52,6,34,23,24,13,25,64,62,14,39,26,20,27,28,65,59,40,38,4,22,5,19,11,55,8,41],[0,16,2,17,66,67,44,45,23,24,13,25,68,69,46,47,26,20,27,28,70,71,48,49,4,22,5,19,72,73,50,51],[0,16,2,17,1,52,6,34,29,21,15,30,53,54,9,42],[0,16,5,19,1,52,8,41,29,21,12,33,53,54,7,35],[0,20,13,19,1,59,14,41,29,31,32,33,53,63,36,35],[0,31,3,17,1,63,10,34,29,20,27,30,53,59,40,42],[0,16,74,75],[0,18,76,77],[0,16,78,79],[0,18,80,81],[0,16,74,75,29,21,82,83],[0,21,84,85,29,16,86,87],[0,16,88,89],[0,16,88,89,29,21,90,91],[0,16,74,75,1,52,88,89],[0,16,78,79,1,52,92,93],[0,16,94,95,11,55,88,89],[0,16,82,83,53,54,88,89],[0,16,74,75,1,52,88,89,29,21,82,83,53,54,90,91],[0,21,84,85,96,97,88,91,29,16,86,87,98,99,90,89],[0,16,74,75,2,17,100,101],[0,16,94,95,5,19,100,101],[0,18,76,77,2,33,102,103],[0,18,104,105,106,107,100,108],[0,16,78,79,2,17,109,108],[0,16,82,83,15,30,100,101],[0,18,80,81,2,33,110,111],[0,18,112,113,114,115,100,108],[0,16,74,75,2,17,100,101,29,21,82,83,15,30,116,117],[0,21,84,85,118,119,116,101,29,16,86,87,120,121,100,117],[0,16,74,75,6,34,122,123],[0,16,74,75,8,41,124,125],[0,16,78,79,7,35,122,123],[0,16,82,83,9,42,122,123],[0,16,74,75,7,35,126,127],[0,16,74,75,9,42,128,129],[0,16,78,79,6,34,126,127],[0,16,78,79,8,41,128,129],[0,16,74,75,6,34,122,123,29,21,82,83,9,42,128,129],[0,16,74,75,7,35,126,127,29,21,82,83,8,41,124,125],[0,21,84,85,6,42,130,131,29,16,86,87,9,34,132,133],[0,21,84,85,7,41,134,135,29,16,86,87,8,35,136,137],[0,16,89,88,2,17,122,123],[0,16,89,88,12,33,126,127],[0,16,89,88,5,19,124,125],[0,16,89,88,15,30,128,129],[0,16,88,89,6,34,100,101],[0,16,89,88,7,35,109,108],[0,16,89,88,8,41,138,139],[0,16,89,88,9,42,116,117],[0,16,89,88,6,34,100,101,29,21,91,90,9,42,116,117],[0,16,89,88,7,35,109,108,29,21,91,90,8,41,138,139],[0,16,89,88,2,17,122,123,29,21,91,90,15,30,128,129],[0,16,89,88,118,121,132,131,29,21,91,90,120,119,130,133],[0,16,74,75,2,17,100,101,1,52,88,89,6,34,122,123],[0,16,74,75,12,33,109,108,1,52,88,89,7,35,126,127],[0,16,74,75,2,17,100,101,11,55,140,141,8,41,124,125],[0,16,74,75,2,17,100,101,53,54,90,91,9,42,128,129],[0,16,74,75,5,19,138,139,1,52,88,89,8,41,124,125],[0,16,74,75,15,30,116,117,1,52,88,89,9,42,128,129],[0,16,94,95,5,19,100,101,11,55,88,89,6,34,124,125],[0,16,94,95,15,30,109,108,11,55,88,89,7,35,128,129],[0,16,78,79,2,17,109,108,1,52,92,93,6,34,126,127],[0,16,78,79,12,33,100,101,1,52,92,93,7,35,122,123],[0,16,82,83,12,33,138,139,53,54,88,89,8,41,126,127],[0,16,82,83,2,17,116,117,53,54,88,89,9,42,122,123],[0,16,78,79,5,19,116,117,1,52,92,93,8,41,128,129],[0,16,82,83,15,30,100,101,1,52,90,91,9,42,122,123],[0,16,82,83,15,30,100,101,53,54,88,89,6,34,128,129],[0,16,82,83,5,19,109,108,53,54,88,89,7,35,124,125],[0,16,74,75,2,17,100,101,1,52,88,89,6,34,122,123,29,21,82,83,15,30,116,117,53,54,90,91,9,42,128,129],[0,16,74,75,12,33,109,108,1,52,88,89,7,35,126,127,29,21,82,83,5,19,138,139,53,54,90,91,8,41,124,125],[0,21,84,85,118,119,116,101,96,97,88,91,9,34,132,133,29,16,86,87,120,121,100,117,98,99,90,89,6,42,130,131],[0,21,84,85,142,143,138,108,96,97,88,91,8,35,136,137,29,16,86,87,144,145,109,139,98,99,90,89,7,41,134,135],[0,146,147],[0,148,149],[0,150,151],[0,146,147,152,153,154,155,156,157],[0,158,159],[0,146,147,1,160,161],[0,146,147,1,160,161,152,153,154,162,163,164,155,156,157,165,166,167],[0,158,159,1,168,169],[0,146,147,101,170,171],[0,146,147,100,172,173],[0,148,149,174,175,171],[0,148,149,100,176,177],[0,150,151,178,179,171],[0,150,151,100,180,181],[0,146,147,100,172,173,152,153,154,182,183,184,155,156,157,185,186,187],[0,158,159,101,188,189],[0,146,147,122,190,191],[0,146,147,123,192,193],[0,146,147,126,194,195],[0,146,147,127,196,197],[0,146,147,122,190,191,152,153,154,198,199,200,155,156,157,201,202,203],[0,158,159,123,204,205],[0,146,147,126,194,195,152,153,154,206,207,208,155,156,157,209,210,211],[0,158,159,129,212,213],[0,146,147,101,170,171,1,160,161,123,192,193],[0,146,147,108,214,215,1,160,161,127,196,197],[0,146,147,100,172,173,1,160,161,122,190,191],[0,146,147,109,216,217,1,160,161,126,194,195],[0,146,147,100,172,173,1,160,161,122,190,191,152,153,154,182,183,184,162,163,164,198,199,200,155,156,157,185,186,187,165,166,167,201,202,203],[0,158,159,101,188,189,1,168,169,123,204,205],[0,146,147,109,216,217,1,160,161,126,194,195,152,153,154,218,219,220,162,163,164,206,207,208,155,156,157,221,222,223,165,166,167,209,210,211],[0,158,159,117,224,225,1,168,169,129,212,213],[0,146,147,16,226,227],[0,148,149,18,228,229],[0,150,151,18,230,231],[0,150,151,16,232,233],[0,148,149,16,234,235],[0,146,147,18,236,237],[0,146,147,52,238,239],[0,146,147,16,226,227,1,160,161,52,238,239],[0,146,147,18,236,237,1,160,161,61,240,241],[0,146,147,16,226,227,100,172,173,101,170,171],[0,148,149,18,228,229,242,172,181,243,214,244],[0,150,151,18,230,231,245,172,177,246,214,247],[0,150,151,16,232,233,245,172,177,174,170,248],[0,148,149,16,234,235,242,172,181,178,170,249],[0,146,147,18,236,237,100,172,173,108,214,215],[0,146,147,16,226,227,122,190,191,123,192,193],[0,146,147,16,226,227,126,194,195,127,196,197],[0,146,147,18,236,237,126,194,195,123,192,193],[0,146,147,18,236,237,122,190,191,127,196,197],[0,146,147,52,238,239,122,190,191,101,170,171],[0,146,147,61,240,241,126,194,195,101,170,171],[0,146,147,52,238,239,100,172,173,123,192,193],[0,146,147,61,240,241,100,172,173,127,196,197],[0,146,147,16,226,227,100,172,173,101,170,171,1,160,161,52,239,238,122,190,191,123,192,193],[0,146,147,16,226,227,109,216,217,108,214,215,1,160,161,52,239,238,126,194,195,127,196,197],[0,146,147,18,236,237,109,216,217,101,170,171,1,160,161,61,241,240,126,194,195,123,192,193],[0,146,147,18,236,237,100,172,173,108,214,215,1,160,161,61,241,240,122,190,191,127,196,197],[0,16,2,17,158,250,251,252,159,253,254,255],[0,16,2,17,158,250,251,252,159,253,254,255,23,24,13,25,256,257,258,259,260,261,262,263,26,20,27,28,264,265,266,267,268,269,270,271,4,22,5,19,272,273,274,275,276,277,278,279],[0,16,2,17,158,250,251,252,159,253,254,255,29,21,15,30,280,281,282,283,284,285,286,287],[0,20,13,19,158,273,266,259,159,261,278,271],[0,20,13,19,158,273,266,259,159,261,278,271,29,31,32,33,280,288,289,290,284,291,292,293],[0,16,2,17,158,250,251,252,159,253,254,255,1,52,6,34,168,294,295,296,169,297,298,299],[0,16,2,17,158,250,251,252,159,253,254,255,53,54,9,42,300,301,302,303,304,305,306,307],[0,16,2,17,158,250,251,252,159,253,254,255,1,52,6,34,168,294,295,296,169,297,298,299,23,24,13,25,256,257,258,259,260,261,262,263,64,62,14,39,308,309,310,311,312,313,314,315,26,20,27,28,264,265,266,267,268,269,270,271,65,59,40,38,316,317,318,319,320,321,322,323,4,22,5,19,272,273,274,275,276,277,278,279,11,55,8,41,324,325,326,327,328,329,330,331],[0,16,2,17,158,250,251,252,159,253,254,255,66,67,44,45,332,333,334,335,336,337,338,339,23,24,13,25,256,257,258,259,260,261,262,263,68,69,46,47,340,341,342,343,344,345,346,347,26,20,27,28,264,265,266,267,268,269,270,271,70,71,48,49,348,349,350,351,352,353,354,355,4,22,5,19,272,273,274,275,276,277,278,279,72,73,50,51,356,357,358,359,360,361,362,363],[0,16,2,17,158,250,251,252,159,253,254,255,1,52,6,34,168,294,295,296,169,297,298,299,29,21,15,30,280,281,282,283,284,285,286,287,53,54,9,42,300,301,302,303,304,305,306,307],[0,20,13,19,158,273,266,259,159,261,278,271,1,59,14,41,168,325,318,311,169,313,330,323],[0,20,13,19,158,273,266,259,159,261,278,271,1,59,14,41,168,325,318,311,169,313,330,323,29,31,32,33,280,288,289,290,284,291,292,293,53,63,36,35,300,364,365,366,304,367,368,369],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,23,24,13,25,256,257,258,259,260,261,262,263,382,383,384,385,386,387,388,389,390,391,392,393,26,20,27,28,264,265,266,267,268,269,270,271,394,395,396,397,398,399,400,401,402,403,404,405,4,22,5,19,272,273,274,275,276,277,278,279,138,139,95,94,406,407,408,409,410,411,412,413],[0,24,5,28,158,265,258,275,159,277,270,263,414,415,416,417,418,419,420,421,422,423,424,425,23,16,27,19,256,273,251,267,260,269,278,255,426,427,428,429,430,431,432,433,434,435,436,437,26,22,13,17,264,250,274,259,268,261,254,279,438,439,440,441,442,443,444,445,446,447,448,449,4,20,2,25,272,257,266,252,276,253,262,271,450,451,452,453,454,455,456,457,458,459,460,461],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,29,21,15,30,280,281,282,283,284,285,286,287,116,117,83,82,376,377,224,378,379,380,381,225],[0,20,13,19,158,273,266,259,159,261,278,271,450,415,440,429,454,431,420,445,458,447,436,425],[0,20,13,19,158,273,266,259,159,261,278,271,462,463,464,465,466,467,468,469,470,471,472,473],[0,20,13,19,158,273,266,259,159,261,278,271,462,463,464,465,466,467,468,469,470,471,472,473,29,31,32,33,280,288,289,290,284,291,292,293,450,415,440,429,454,431,420,445,458,447,436,425],[0,16,2,17,158,250,251,252,159,253,254,255,123,122,88,89,204,474,475,476,205,477,478,479],[0,16,2,17,158,250,251,252,159,253,254,255,123,122,88,89,204,474,475,476,205,477,478,479,23,24,13,25,256,257,258,259,260,261,262,263,480,481,482,483,484,485,486,487,488,489,490,491,26,20,27,28,264,265,266,267,268,269,270,271,492,493,494,495,496,497,498,499,500,501,502,503,4,22,5,19,272,273,274,275,276,277,278,279,125,124,140,141,504,505,506,507,508,509,510,511],[0,16,2,17,158,250,251,252,159,253,254,255,123,122,88,89,204,474,475,476,205,477,478,479,29,21,15,30,280,281,282,283,284,285,286,287,129,128,90,91,212,512,513,514,213,515,516,517],[0,16,2,17,158,250,251,252,159,253,254,255,129,128,90,91,212,512,513,514,213,515,516,517],[0,16,2,17,158,250,251,252,159,253,254,255,129,128,90,91,212,512,513,514,213,515,516,517,23,24,13,25,256,257,258,259,260,261,262,263,518,519,520,521,522,523,524,525,526,527,528,529,26,20,27,28,264,265,266,267,268,269,270,271,530,531,532,533,534,535,536,537,538,539,540,541,4,22,5,19,272,273,274,275,276,277,278,279,127,126,92,93,542,543,544,545,546,547,548,549],[0,20,13,19,158,273,266,259,159,261,278,271,550,551,552,553,554,555,556,557,558,559,560,561,29,31,32,33,280,288,289,290,284,291,292,293,562,563,564,565,566,567,568,569,570,571,572,573],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,1,52,6,34,168,294,295,296,169,297,298,299,122,123,89,88,475,476,204,474,479,478,477,205],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,53,54,9,42,300,301,302,303,304,305,306,307,128,129,91,90,513,514,212,512,517,516,515,213],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225,1,52,6,34,168,294,295,296,169,297,298,299,128,129,91,90,513,514,212,512,517,516,515,213],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225,53,54,9,42,300,301,302,303,304,305,306,307,122,123,89,88,475,476,204,474,479,478,477,205],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,1,52,6,34,168,294,295,296,169,297,298,299,122,123,89,88,475,476,204,474,479,478,477,205,23,24,13,25,256,257,258,259,260,261,262,263,382,383,384,385,386,387,388,389,390,391,392,393,64,62,14,39,308,309,310,311,312,313,314,315,481,480,483,482,486,487,484,485,491,490,489,488,26,20,27,28,264,265,266,267,268,269,270,271,394,395,396,397,398,399,400,401,402,403,404,405,65,59,40,38,316,317,318,319,320,321,322,323,493,492,495,494,498,499,496,497,503,502,501,500,4,22,5,19,272,273,274,275,276,277,278,279,138,139,95,94,406,407,408,409,410,411,412,413,11,55,8,41,324,325,326,327,328,329,330,331,124,125,141,140,506,507,504,505,511,510,509,508],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225,1,52,6,34,168,294,295,296,169,297,298,299,128,129,91,90,513,514,212,512,517,516,515,213,23,24,13,25,256,257,258,259,260,261,262,263,574,575,576,577,578,579,580,581,582,583,584,585,64,62,14,39,308,309,310,311,312,313,314,315,519,518,521,520,524,525,522,523,529,528,527,526,26,20,27,28,264,265,266,267,268,269,270,271,586,587,588,589,590,591,592,593,594,595,596,597,65,59,40,38,316,317,318,319,320,321,322,323,531,530,533,532,536,537,534,535,541,540,539,538,4,22,5,19,272,273,274,275,276,277,278,279,109,108,79,78,598,599,600,601,602,603,604,605,11,55,8,41,324,325,326,327,328,329,330,331,126,127,93,92,544,545,542,543,549,548,547,546],[0,24,5,28,158,265,258,275,159,277,270,263,414,415,416,417,418,419,420,421,422,423,424,425,66,69,50,49,332,349,342,359,336,361,354,347,493,123,483,140,498,507,204,485,503,490,509,205,23,16,27,19,256,273,251,267,260,269,278,255,426,427,428,429,430,431,432,433,434,435,436,437,68,67,48,51,340,357,334,351,344,353,362,339,124,480,89,494,506,499,484,474,511,478,501,488,26,22,13,17,264,250,274,259,268,261,254,279,438,439,440,441,442,443,444,445,446,447,448,449,70,73,46,45,348,333,358,343,352,345,338,363,122,492,141,482,475,487,496,505,479,510,489,500,4,20,2,25,272,257,266,252,276,253,262,271,450,451,452,453,454,455,456,457,458,459,460,461,72,71,44,47,356,341,350,335,360,337,346,355,481,125,495,88,486,476,504,497,491,502,477,508],[0,24,5,28,158,265,258,275,159,277,270,263,414,415,416,417,418,419,420,421,422,423,424,425,606,607,608,609,610,611,612,613,614,615,616,617,531,129,521,92,536,545,212,523,541,528,547,213,23,16,27,19,256,273,251,267,260,269,278,255,426,427,428,429,430,431,432,433,434,435,436,437,618,619,620,621,622,623,624,625,626,627,628,629,126,518,91,532,544,537,522,512,549,516,539,526,26,22,13,17,264,250,274,259,268,261,254,279,438,439,440,441,442,443,444,445,446,447,448,449,630,631,632,633,634,635,636,637,638,639,640,641,128,530,93,520,513,525,534,543,517,548,527,538,4,20,2,25,272,257,266,252,276,253,262,271,450,451,452,453,454,455,456,457,458,459,460,461,642,643,644,645,646,647,648,649,650,651,652,653,519,127,533,90,524,514,542,535,529,540,515,546],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,1,52,6,34,168,294,295,296,169,297,298,299,122,123,89,88,475,476,204,474,479,478,477,205,29,21,15,30,280,281,282,283,284,285,286,287,116,117,83,82,376,377,224,378,379,380,381,225,53,54,9,42,300,301,302,303,304,305,306,307,128,129,91,90,513,514,212,512,517,516,515,213],[0,20,13,19,158,273,266,259,159,261,278,271,462,463,464,465,466,467,468,469,470,471,472,473,1,59,14,41,168,325,318,311,169,313,330,323,551,550,553,552,556,557,554,555,561,560,559,558,29,31,32,33,280,288,289,290,284,291,292,293,450,415,440,429,454,431,420,445,458,447,436,425,53,63,36,35,300,364,365,366,304,367,368,369,563,562,565,564,568,569,566,567,573,572,571,570],[0,16],[0,18],[0,16,26,20],[0,2,23,13],[0,3,4,32],[0,2,29,15],[0,3,29,27],[0,52],[0,63],[0,52,26,59],[0,63,26,54],[0,52,16,1],[0,18,1,61],[0,52,16,1,26,59,20,65],[0,31,1,63],[0,1,24,62],[0,15,1,9],[0,5,1,8],[0,31,1,63,26,21,65,54],[0,2,57,56],[0,60,3,16],[0,22,57,3],[0,2,28,20],[0,17,13,24],[0,20,19,13,4,24,17,27],[0,22,57,3,4,16,60,32],[0,22,57,3,23,20,30,12,26,24,33,15,4,16,60,32],[0,22,57,3,29,18,27,25],[0,22,3,57,1,55,10,37],[0,22,385,396,3,57,109,117],[0,22,57,3,159,279,654,655,158,274,656,657,29,18,25,27,284,658,262,269,280,659,257,267]],RS={"P 1":0,"P -1":1,"P 1 2 1":2,"P 1 21 1":3,"C 1 2 1":4,"P 1 m 1":5,"P 1 c 1":6,"C 1 m 1":7,"C 1 c 1":8,"P 1 2/m 1":9,"P 1 21/m 1":10,"C 1 2/m 1":11,"P 1 2/c 1":12,"P 1 21/c 1":13,"C 1 2/c 1":14,"P 2 2 2":15,"P 2 2 21":16,"P 21 21 2":17,"P 21 21 21":18,"C 2 2 21":19,"C 2 2 2":20,"F 2 2 2":21,"I 2 2 2":22,"I 21 21 21":23,"P m m 2":24,"P m c 21":25,"P c c 2":26,"P m a 2":27,"P c a 21":28,"P n c 2":29,"P m n 21":30,"P b a 2":31,"P n a 21":32,"P n n 2":33,"C m m 2":34,"C m c 21":35,"C c c 2":36,"A m m 2":37,"A b m 2":38,"A m a 2":39,"A b a 2":40,"F m m 2":41,"F d d 2":42,"I m m 2":43,"I b a 2":44,"I m a 2":45,"P 2/m 2/m 2/m":46,"P m m m":46,"P 2/n 2/n 2/n":47,"P n n n":47,"P 2/c 2/c 2/m":48,"P c c m":48,"P 2/b 2/a 2/n":49,"P b a n":49,"P 21/m 2/m 2/a":50,"P m m a":50,"P 2/n 21/n 2/a":51,"P n n a":51,"P 2/m 2/n 21/a":52,"P m n a":52,"P 21/c 2/c 2/a":53,"P c c a":53,"P 21/b 21/a 2/m":54,"P b a m":54,"P 21/c 21/c 2/n":55,"P c c n":55,"P 2/b 21/c 21/m":56,"P b c m":56,"P 21/n 21/n 2/m":57,"P n n m":57,"P 21/m 21/m 2/n":58,"P m m n":58,"P 21/b 2/c 21/n":59,"P b c n":59,"P 21/b 21/c 21/a":60,"P b c a":60,"P 21/n 21/m 21/a":61,"P n m a":61,"C 2/m 2/c 21/m":62,"C m c m":62,"C 2/m 2/c 21/a":63,"C m c a":63,"C 2/m 2/m 2/m":64,"C m m m":64,"C 2/c 2/c 2/m":65,"C c c m":65,"C 2/m 2/m 2/a":66,"C m m a":66,"C 2/c 2/c 2/a":67,"C c c a":67,"F 2/m 2/m 2/m":68,"F m m m":68,"F 2/d 2/d 2/d":69,"F d d d":69,"I 2/m 2/m 2/m":70,"I m m m":70,"I 2/b 2/a 2/m":71,"I b a m":71,"I 21/b 21/c 21/a":72,"I b c a":72,"I 21/m 21/m 21/a":73,"I m m a":73,"P 4":74,"P 41":75,"P 42":76,"P 43":77,"I 4":78,"I 41":79,"P -4":80,"I -4":81,"P 4/m":82,"P 42/m":83,"P 4/n":84,"P 42/n":85,"I 4/m":86,"I 41/a":87,"P 4 2 2":88,"P 4 21 2":89,"P 41 2 2":90,"P 41 21 2":91,"P 42 2 2":92,"P 42 21 2":93,"P 43 2 2":94,"P 43 21 2":95,"I 4 2 2":96,"I 41 2 2":97,"P 4 m m":98,"P 4 b m":99,"P 42 c m":100,"P 42 n m":101,"P 4 c c":102,"P 4 n c":103,"P 42 m c":104,"P 42 b c":105,"I 4 m m":106,"I 4 c m":107,"I 41 m d":108,"I 41 c d":109,"P -4 2 m":110,"P -4 2 c":111,"P -4 21 m":112,"P -4 21 c":113,"P -4 m 2":114,"P -4 c 2":115,"P -4 b 2":116,"P -4 n 2":117,"I -4 m 2":118,"I -4 c 2":119,"I -4 2 m":120,"I -4 2 d":121,"P 4/m 2/m 2/m":122,"P4/m m m":122,"P 4/m 2/c 2/c":123,"P4/m c c":123,"P 4/n 2/b 2/m":124,"P4/n b m":124,"P 4/n 2/n 2/c":125,"P4/n n c":125,"P 4/m 21/b 2/m":126,"P4/m b m":126,"P 4/m 21/n 2/c":127,"P4/m n c":127,"P 4/n 21/m 2/m":128,"P4/n m m":128,"P 4/n 2/c 2/c":129,"P4/n c c":129,"P 42/m 2/m 2/c":130,"P42/m m c":130,"P 42/m 2/c 2/m":131,"P42/m c m":131,"P 42/n 2/b 2/c":132,"P42/n b c":132,"P 42/n 2/n 2/m":133,"P42/n n m":133,"P 42/m 21/b 2/c":134,"P42/m b c":134,"P 42/m 21/n 2/m":135,"P42/m n m":135,"P 42/n 21/m 2/c":136,"P42/n m c":136,"P 42/n 21/c 2/m":137,"P42/n c m":137,"I 4/m 2/m 2/m":138,"I4/m m m":138,"I 4/m 2/c 2/m":139,"I4/m c m":139,"I 41/a 2/m 2/d":140,"I41/a m d":140,"I 41/a 2/c 2/d":141,"I41/a c d":141,"P 3":142,"P 31":143,"P 32":144,"H 3":145,"R 3":146,"P -3":147,"H -3":148,"R -3":149,"P 3 1 2":150,"P 3 2 1":151,"P 31 1 2":152,"P 31 2 1":153,"P 32 1 2":154,"P 32 2 1":155,"H 3 2":156,"R 3 2":157,"P 3 m 1":158,"P 3 1 m":159,"P 3 c 1":160,"P 3 1 c":161,"H 3 m":162,"R 3 m":163,"H 3 c":164,"R 3 c":165,"P -3 1 2/m":166,"P -3 1 m":166,"P -3 1 2/c":167,"P -3 1 c":167,"P -3 2/m 1":168,"P -3 m 1":168,"P -3 2/c 1":169,"P -3 c 1":169,"H -3 2/m":170,"H -3 m":170,"R -3 2/m":171,"R -3 m":171,"H -3 2/c":172,"H -3 c":172,"R -3 2/c":173,"R -3 c":173,"P 6":174,"P 61":175,"P 65":176,"P 62":177,"P 64":178,"P 63":179,"P -6":180,"P 6/m":181,"P 63/m":182,"P 6 2 2":183,"P 61 2 2":184,"P 65 2 2":185,"P 62 2 2":186,"P 64 2 2":187,"P 63 2 2":188,"P 6 m m":189,"P 6 c c":190,"P 63 c m":191,"P 63 m c":192,"P -6 m 2":193,"P -6 c 2":194,"P -6 2 m":195,"P -6 2 c":196,"P 6/m 2/m 2/m":197,"P 6/m m m":197,"P 6/m 2/c 2/c":198,"P 6/m c c":198,"P 63/m 2/c 2/m":199,"P 63/m c m":199,"P 63/m 2/m 2/c":200,"P 63/m m c":200,"P 2 3":201,"F 2 3":202,"I 2 3":203,"P 21 3":204,"I 21 3":205,"P 2/m -3":206,"P m -3":206,"P 2/n -3":207,"P n -3":207,"F 2/m -3":208,"F m -3":208,"F 2/d -3":209,"F d -3":209,"I 2/m -3":210,"I m -3":210,"P 21/a -3":211,"P a -3":211,"I 21/a -3":212,"I a -3":212,"P 4 3 2":213,"P 42 3 2":214,"F 4 3 2":215,"F 41 3 2":216,"I 4 3 2":217,"P 43 3 2":218,"P 41 3 2":219,"I 41 3 2":220,"P -4 3 m":221,"F -4 3 m":222,"I -4 3 m":223,"P -4 3 n":224,"F -4 3 c":225,"I -4 3 d":226,"P 4/m -3 2/m":227,"P m -3 m":227,"P 4/n -3 2/n":228,"P n -3 n":228,"P 42/m -3 2/n":229,"P m -3 n":229,"P 42/n -3 2/m":230,"P n -3 m":230,"F 4/m -3 2/m":231,"F m -3 m":231,"F 4/m -3 2/c":232,"F m -3 c":232,"F 41/d -3 2/m":233,"F d -3 m":233,"F 41/d -3 2/c":234,"F d -3 c":234,"I 4/m -3 2/m":235,"I m -3 m":235,"I 41/a -3 2/d":236,"I a -3 d":236,"P 1 1 2":237,"P 1 1 21":238,"B 1 1 2":239,"B 2":239,"A 1 2 1":240,"C 1 21 1":241,"I 1 2 1":242,"I 2":242,"I 1 21 1":243,"P 1 1 m":244,"P 1 1 b":245,"B 1 1 m":246,"B 1 1 b":247,"P 1 1 2/m":248,"P 1 1 21/m":249,"B 1 1 2/m":250,"P 1 1 2/b":251,"P 1 1 21/b":252,"P 1 21/n 1":253,"P 1 21/a 1":254,"B 1 1 2/b":255,"P 21 2 2":256,"P 2 21 2":257,"P 21 21 2 (a)":258,"P 21 2 21":259,"P 2 21 21":260,"C 2 2 21a)":261,"C 2 2 2a":262,"F 2 2 2a":263,"I 2 2 2a":264,"P 21/m 21/m 2/n a":265,"P 42 21 2a":266,"I 2 3a":267};function q3e(e){if(e<146)return e+1;if(146===e)return 1146;if(e<149)return e+1-1;if(149===e)return 1148;if(e<157)return e+1-2;if(157===e)return 1155;if(e<163)return e+1-3;if(163===e)return 1160;if(e<165)return e+1-4;if(165===e)return 1161;if(e<171)return e+1-5;if(171===e)return 1166;if(e<173)return e+1-6;if(173===e)return 1167;if(e<237)return e+1-7;if(237===e)return 1003;if(238===e)return 1004;if(239===e)return 1005;if(240===e)return 2005;if(241===e)return 3005;if(242===e)return 4005;if(243===e)return 5005;if(244===e)return 1006;if(245===e)return 1007;if(246===e)return 1008;if(247===e)return 1009;if(248===e)return 1010;if(249===e)return 1011;if(250===e)return 1012;if(251===e)return 1013;if(252===e)return 1014;if(253===e)return 2014;if(254===e)return 3014;if(255===e)return 1015;if(256===e)return 1017;if(257===e)return 2017;if(258===e)return 1018;if(259===e)return 2018;if(260===e)return 3018;if(261===e)return 1020;if(262===e)return 1021;if(263===e)return 1022;if(264===e)return 1023;if(265===e)return 1059;if(266===e)return 1094;if(267===e)return 1197;throw new Error("unknown spacegroup index '".concat(e,"'"))}var ns,au,wc,Pi,WY=function(){for(var e=Object.create(null),t=0,r=Object.keys(RS);t(t=Math.abs(t))?(t/=e,e*Math.sqrt(1+t*t)):t>0?(e/=t,t*Math.sqrt(1+e*e)):0}!function(e){function r(n,a,i){var o=function Y3e(e){var t="number"==typeof e?function j3e(e){switch(e){case 1146:return 146;case 1148:return 149;case 1155:return 157;case 1160:return 163;case 1161:return 165;case 1166:return 171;case 1167:return 173;case 1003:return 237;case 1004:return 238;case 1005:return 239;case 2005:return 240;case 3005:return 241;case 4005:return 242;case 5005:return 243;case 1006:return 244;case 1007:return 245;case 1008:return 246;case 1009:return 247;case 1010:return 248;case 1011:return 249;case 1012:return 250;case 1013:return 251;case 1014:return 252;case 2014:return 253;case 3014:return 254;case 1015:return 255;case 1017:return 256;case 2017:return 257;case 1018:return 258;case 2018:return 259;case 3018:return 260;case 1020:return 261;case 1021:return 262;case 1022:return 263;case 1023:return 264;case 1059:return 265;case 1094:return 266;case 1197:return 267}var t=0;return e>146&&++t,e>148&&++t,e>155&&++t,e>160&&++t,e>161&&++t,e>166&&++t,e>167&&++t,e-1+t}(e):RS[e];return typeof t>"u"||typeof WY[t]>"u"?-1:t}(n);if(o<0)return console.warn("Unknown spacegroup '".concat(n,"', returning a 'P 1' with cellsize [1, 1, 1]")),e.Zero;var s=a[0]*a[1]*a[2],u=i[0],c=i[1],l=i[2],d=a[0],f=a[1],p=a[2],m=Math.cos(c),h=(Math.cos(u)-Math.cos(c)*Math.cos(l))/Math.sin(l),v=Math.sqrt(1-m*m-h*h),g=[d,0,0],y=[Math.cos(l)*f,Math.sin(l)*f,0],S=[m*p,h*p,v*p],C=he.ofRows([[g[0],y[0],S[0],0],[0,y[1],S[1],0],[0,0,S[2],0],[0,0,0,1]]);return{index:o,size:a,volume:s,anglesInRadians:i,toFractional:he.invert(he.zero(),C),fromFractional:C}}e.Zero=r("P 1",b.create(1,1,1),b.create(Math.PI/2,Math.PI/2,Math.PI/2)),e.isZero=function t(n){return!n||0===n.index&&1===n.size[0]&&1===n.size[1]&&1===n.size[1]},e.create=r}(ns||(ns={})),function(e){function t(v){var g=H3e[v.index].map(function(C){return function d(v){return he.ofRows([RF[v[0]],RF[v[1]],RF[v[2]],[0,0,0,1]])}(z3e[C])});return{name:WY[v.index],num:W3e[v.index],cell:v,operators:g}}e.ZeroP1=t(ns.Zero),e.create=t;var r=b(),n=he();function a(v,g,y,S,C,_){return b.set(r,y,S,C),he.fromTranslation(n,r),he.mul(_,he.mul(_,he.mul(_,v.cell.fromFractional,n),v.operators[g]),v.cell.toFractional)}e.setOperatorMatrix=a,e.getSymmetryOperator=function i(v,g,y,S,C){var _=a(v,g,y,S,C,he.zero());return ra.create("".concat(g+1,"_").concat(5+y).concat(5+S).concat(5+C),_,{hkl:b.create(y,S,C),spgrOp:g})};var o=b(),s=b(),u=b(),c=b();function p(v,g,y){var S=[];if(v>0?S.push("+X"):v<0&&S.push("-X"),g>0?S.push("+Y"):g<0&&S.push("-Y"),y>0?S.push("+Z"):y<0&&S.push("-Z"),1===S.length)return"+"===S[0].charAt(0)?S[0].substr(1):S[0];if(2===S.length){var C=S[0].charAt(0),_=S[1].charAt(0);if("+"===C)return"".concat(S[0].substr(1)).concat(S[1]);if("+"===_)return"".concat(S[1].substr(1)).concat(S[0])}throw new Error("unknown rotation '".concat(S,"', ").concat(v," ").concat(g," ").concat(y))}function m(v){switch(v){case.5:return"1/2";case 1/4:return"1/4";case 3/4:return"3/4";case 1/3:return"1/3";case 2/3:return"2/3";case 1/6:return"1/6";case 5/6:return"5/6"}return""}function h(v,g){return""===g?v:v.length>2?"".concat(v,"+").concat(g):"-"===v.charAt(0)?"".concat(g).concat(v):"".concat(g,"+").concat(v)}e.getSymmetryOperatorRef=function l(v,g,y,S,C,_){var x=he.zero();b.set(r,y,S,C),b.floor(o,_),he.copy(x,v.operators[g]),b.floor(s,b.transformMat4(s,_,x)),he.getTranslation(c,x),b.sub(c,c,s),b.add(c,c,o),b.add(c,c,r),he.setTranslation(x,c),he.mul(x,v.cell.fromFractional,x),he.mul(x,x,v.cell.toFractional),b.sub(u,s,o);var D=y-u[0],w=S-u[1],A=C-u[2];return ra.create("".concat(g+1,"_").concat(5+D).concat(5+w).concat(5+A),x,{hkl:b.create(D,w,A),spgrOp:g})},e.getOperatorXyz=function f(v){return[h(p(v[0],v[4],v[8]),m(v[12])),h(p(v[1],v[5],v[9]),m(v[13])),h(p(v[2],v[6],v[10]),m(v[14]))].join(",")}}(au||(au={})),function(e){e.add=function t(i,o,s){i.squaredDistances[i.count]=s,i.indices[i.count++]=o},e.reset=function r(i){i.count=0},e.create=function n(){return{count:0,indices:[],squaredDistances:[]}},e.copy=function a(i,o){for(var s=0;s>16?z:-z;for(p=0;p<2;p++)for(d=0;d0?_>u&&(u=_):_>c&&(c=_),b.projectPointOnVector(m,b.fromArray(m,o,y),g.dirB,v);var x=b.dot(g.dirB,b.normalize(h,b.sub(h,m,v))),D=b.distance(m,v);x>0?D>l&&(l=D):D>d&&(d=D),b.projectPointOnVector(m,b.fromArray(m,o,y),g.dirC,v);var w=b.dot(g.dirC,b.normalize(h,b.sub(h,m,v))),A=b.distance(m,v);w>0?A>f&&(f=A):A>p&&(p=A)}var E=b.setMagnitude(b(),g.dirA,(u+c)/2),I=b.setMagnitude(b(),g.dirB,(l+d)/2),M=b.setMagnitude(b(),g.dirC,(f+p)/2),F=b.isFinite(E),N=b.isFinite(I),j=b.isFinite(M),U=b(),H=function(z,G,J){b.copy(a,v),F&&b.scaleAndAdd(a,a,g.dirA,z),N&&b.scaleAndAdd(a,a,g.dirB,G),j&&b.scaleAndAdd(a,a,g.dirC,J),b.add(U,U,a)};return H(u,l,f),H(u,l,-p),H(u,-d,-p),H(u,-d,f),H(-c,-d,-p),H(-c,-d,f),H(-c,l,f),H(-c,l,-p),b.scale(U,U,1/8),wo.create(U,E,I,M)}e.calculateBoxAxes=i}(gl||(gl={})),function(e){function t(M){return void 0!==M.extrema}function r(M,F){return{center:M,radius:F}}function s(M,F){var N;return void 0!==M.extrema?(M.extrema.length=0,(N=M.extrema).push.apply(N,F)):M.extrema=F,M}e.hasExtrema=t,e.create=r,e.zero=function n(){return{center:b(),radius:0}},e.clone=function a(M){var F=r(b.clone(M.center),M.radius);return t(M)&&(F.extrema=M.extrema.map(function(N){return b.clone(N)})),F},e.set=function i(M,F,N){return b.copy(M.center,F),M.radius=N,M},e.copy=function o(M,F){return b.copy(M.center,F.center),M.radius=F.radius,t(F)&&s(M,F.extrema.map(function(N){return b.clone(N)})),M},e.setExtrema=s,e.computeBounding=function u(M){for(var F=M.x,N=M.y,j=M.z,U=M.indices,H=0,z=0,G=0,J=0,X=ke.size(U),Z=0;Z0&&(H/=X,z/=X,G/=X),Z=0;ZJ&&(J=$)}return{center:b.create(H,z,G),radius:Math.sqrt(J)}},e.transform=function c(M,F,N){return b.transformMat4(M.center,F.center,N),M.radius=F.radius*he.getMaxScaleOnAxis(N),t(F)&&s(M,F.extrema.map(function(j){return b.transformMat4(b(),j,N)})),M},e.translate=function l(M,F,N){return b.add(M.center,F.center,N),t(F)&&s(M,F.extrema.map(function(j){return b.add(b(),j,N)})),M},e.toArray=function d(M,F,N){return b.toArray(M.center,F,N),F[N+3]=M.radius,F},e.fromArray=function f(M,F,N){return b.fromArray(M.center,F,N),M.radius=F[N+3],M},e.fromBox3D=function p(M,F){return b.scale(M.center,b.add(M.center,F.max,F.min),.5),M.radius=b.distance(M.center,F.max),e.setExtrema(M,[b.create(F.min[0],F.min[1],F.min[2]),b.create(F.max[0],F.max[1],F.max[2]),b.create(F.max[0],F.min[1],F.min[2]),b.create(F.min[0],F.max[1],F.max[2]),b.create(F.min[0],F.min[1],F.max[2]),b.create(F.max[0],F.min[1],F.max[2]),b.create(F.max[0],F.max[1],F.min[2]),b.create(F.min[0],F.max[1],F.min[2])]),M},e.fromAxes3D=function m(M,F){return b.copy(M.center,F.origin),M.radius=Math.max(b.magnitude(F.dirA),b.magnitude(F.dirB),b.magnitude(F.dirC)),M};var h=b();e.fromDimensionsAndTransform=function v(M,F,N){var j=F[0],U=F[1],H=F[2],z=b.create(0,0,0);b.transformMat4(z,z,N);var G=b.create(j,U,H);b.transformMat4(G,G,N);var J=b.create(j,0,0);b.transformMat4(J,J,N);var X=b.create(0,U,H);b.transformMat4(X,X,N);var Z=b.create(0,0,H);b.transformMat4(Z,Z,N);var ne=b.create(j,0,H);b.transformMat4(ne,ne,N);var Y=b.create(j,U,0);b.transformMat4(Y,Y,N);var k=b.create(0,U,0);b.transformMat4(k,k,N),b.add(h,z,G),b.scale(h,h,.5);var W=Math.max(b.distance(z,G),b.distance(J,X));return e.set(M,h,W/2),e.setExtrema(M,[z,G,J,X,Z,ne,Y,k]),M};var g=b();e.addVec3=function y(M,F,N){return b.distance(F.center,N)M.radius&&(F.extrema.length>=14&&b.normalize(C,b.sub(C,X,F.center)),b.scaleAndAdd(X,M.center,C,M.radius)),X}))}return M},e.exactEquals=function x(M,F){return M.radius===F.radius&&b.exactEquals(M.center,F.center)},e.equals=function D(M,F){var N=M.radius,j=F.radius;return Math.abs(N-j)<=mn*Math.max(1,Math.abs(N),Math.abs(j))&&b.equals(M.center,F.center)},e.includes=function w(M,F){if(t(F)){for(var N=0,j=F.extrema;NM.radius)return!1;return!0}return b.distance(M.center,F.center)+F.radius<=M.radius},e.overlaps=function A(M,F){return b.distance(M.center,F.center)<=M.radius+F.radius},e.distance=function E(M,F){return b.distance(M.center,F.center)-M.radius+F.radius},e.distanceToVec=function I(M,F){var j=M.radius;return b.distance(F,M.center)-j}}(Pe||(Pe={})),function(e){function r(){return{min:b(),max:b()}}function n(A,E){return b.copy(A.min,E.min),b.copy(A.max,E.max),A}e.create=function t(A,E){return{min:A,max:E}},e.zero=r,e.copy=n,e.clone=function a(A){return n(r(),A)};var i=b();function s(A,E){for(var I=0,M=E.length;I=14?u(A,E.extrema):(b.set(i,E.radius,E.radius,E.radius),b.sub(A.min,E.center,i),b.add(A.max,E.center,i),A)},e.addVec3Array=s,e.fromVec3Array=u,e.addSphere3D=function c(A,E){return Pe.hasExtrema(E)&&E.extrema.length>=14?s(A,E.extrema):(v(A,b.subScalar(i,E.center,E.radius)),v(A,b.addScalar(i,E.center,E.radius)),A)},e.intersectsSphere3D=function l(A,E){return b.clamp(i,E.center,A.min,A.max),b.squaredDistance(i,E.center)<=E.radius*E.radius},e.computeBounding=function d(A){for(var E=b.create(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),I=b.create(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),M=A.x,F=A.y,N=A.z,j=A.indices,U=0,H=ke.size(j);UA.max[0]||E[1]A.max[1]||E[2]A.max[2])},e.overlaps=function x(A,E){return!(A.max[0]E.max[0]||A.max[1]E.max[1]||A.max[2]E.max[2])},e.containsSphere3D=function D(A,E){var I=E.center,M=E.radius;return!(I[0]-MA.max[0]||I[1]-MA.max[1]||I[2]-MA.max[2])},e.nearestIntersectionWithRay=function w(A,E,I,M){var $,K,q,V,ee,ae,F=E.min,N=F[0],j=F[1],U=F[2],H=E.max,z=H[0],G=H[1],J=H[2],X=I[0],Z=I[1],ne=I[2],Y=1/M[0],k=1/M[1],W=1/M[2];return Y>=0?($=(N-X)*Y,K=(z-X)*Y):($=(z-X)*Y,K=(N-X)*Y),k>=0?(q=(j-Z)*k,V=(G-Z)*k):(q=(G-Z)*k,V=(j-Z)*k),W>=0?(ee=(U-ne)*W,ae=(J-ne)*W):(ee=(J-ne)*W,ae=(U-ne)*W),q>$&&($=q),V$&&($=ee),ae0)throw new Error("New key is larger than old key");t.key=r;var n=t.parent;n&&this._compare(t,n)<0&&(this._cut(t,n,this._minNode),this._cascadingCut(n,this._minNode)),this._compare(t,this._minNode)<0&&(this._minNode=t)},e.prototype.delete=function(t){var r=t.parent;r&&(this._cut(t,r,this._minNode),this._cascadingCut(r,this._minNode)),this._minNode=t,this.extractMinimum()},e.prototype.extractMinimum=function(){var t=this._minNode;if(t){if(t.child){var r=t.child;do{r.parent=null,r=r.next}while(r!==t.child)}var n=null;t.next!==t&&(n=t.next),this._removeNodeFromList(t),this._nodeCount--,this._minNode=this._mergeLists(n,t.child),this._minNode&&(this._minNode=this._consolidate(this._minNode))}return t},e.prototype.findMinimum=function(){return this._minNode},e.prototype.insert=function(t,r){var n=new J3e(t,r);return this._minNode=this._mergeLists(this._minNode,n),this._nodeCount++,n},e.prototype.isEmpty=function(){return null===this._minNode},e.prototype.size=function(){return null===this._minNode?0:this._getNodeListSize(this._minNode)},e.prototype.union=function(t){this._minNode=this._mergeLists(this._minNode,t._minNode),this._nodeCount+=t._nodeCount},e.prototype._defaultCompare=function(t,r){return t.key>r.key?1:t.key0){var i=n;n=a,a=i}this._linkHeaps(a,n),r[n.degree]=null,n.degree++,a=r[n.degree]}r[n.degree]=n}for(var o=null,s=0;s0){var d=Math.ceil(u/c),f=Math.pow(d/(i[0]*i[1]*i[2]),1/3);s=[Math.ceil(i[0]*f),Math.ceil(i[1]*f),Math.ceil(i[2]*f)],o=[i[0]/s[0],i[1]/s[1],i[2]/s[2]]}else o=i,s=[1,1,1];return function rPe(e){for(var r=e.size,a=r[1],i=r[2],o=e.data,s=o.x,u=o.y,c=o.z,l=o.radius,d=o.indices,f=e.elementCount,p=e.delta,m=r[0]*a*i,h=e.expandedBox.min,v=h[0],g=h[1],y=h[2],S=0,C=0,_=new Uint32Array(m),x=new Int32Array(f),D=0;DS&&(S=l[w]);for(var F=new Int32Array(C),N=(w=0,0);w0&&(_[w]=N+1,F[N]=j,N+=1)}var U=new Uint32Array(C);for(w=1;w0){var J=G-1;z[U[J]+H[J]]=w,H[J]+=1}}return{size:e.size,bucketArray:z,bucketCounts:F,bucketOffset:U,grid:_,delta:p,min:e.expandedBox.min,data:e.data,maxRadius:S,expandedBox:e.expandedBox,boundingBox:e.boundingBox,boundingSphere:e.boundingSphere}}({size:s,data:{x:e.x,y:e.y,z:e.z,indices:a,radius:e.radius},expandedBox:n,boundingBox:t.box,boundingSphere:t.sphere,elementCount:u,delta:o})}(t,r,n);this.ctx=function aPe(e){return{grid:e,x:.1,y:.1,z:.1,k:1,stopIf:void 0,radius:.1,isCheck:!1}}(a),this.boundary={box:a.boundingBox,sphere:a.boundingSphere},this.buckets={offset:a.bucketOffset,count:a.bucketCounts,array:a.bucketArray},this.result=wc.create()}return e.prototype.find=function(t,r,n,a,i){this.ctx.x=t,this.ctx.y=r,this.ctx.z=n,this.ctx.radius=a,this.ctx.isCheck=!1;var o=i??this.result;return XY(this.ctx,o),o},e.prototype.nearest=function(t,r,n,a,i,o){void 0===a&&(a=1),this.ctx.x=t,this.ctx.y=r,this.ctx.z=n,this.ctx.k=a,this.ctx.stopIf=i;var s=o??this.result;return function uPe(e,t){var r=e.grid,n=r.min,a=r.expandedBox,i=r.boundingSphere.center,o=r.size,s=o[0],u=o[1],c=o[2],l=r.bucketOffset,d=r.bucketCounts,f=r.bucketArray,p=r.grid,m=r.data,h=m.x,v=m.y,g=m.z,y=m.indices,S=m.radius,C=r.delta,_=r.maxRadius,x=e.x,D=e.y,w=e.z,A=e.k,E=e.stopIf,I=ke.size(y);if(wc.reset(t),0===I||A<=0)return!1;var M,F,N,ne,j=!1,U=1,H=!0,z=0,G=iPe,J=oPe,X=0,Z=!0,Y=!1,k=sPe,W=_*_;G.length=0,k.length=0,OS.clear(),U0.clear(),b.set(cm,x,D,w),Nt.containsVec3(a,cm)?(M=Math.floor((x-n[0])/C[0]),F=Math.floor((D-n[1])/C[1]),N=Math.floor((w-n[2])/C[2])):(Nt.nearestIntersectionWithRay(cm,a,cm,b.normalize(KY,b.sub(KY,i,cm))),M=Math.max(0,Math.min(s-1,Math.floor((cm[0]-n[0])/C[0]))),F=Math.max(0,Math.min(u-1,Math.floor((cm[1]-n[1])/C[1]))),N=Math.max(0,Math.min(c-1,Math.floor((cm[2]-n[2])/C[2]))));var $=0!==_?Math.max(1,Math.min(s-1,Math.ceil(_/C[0]))):1,K=0!==_?Math.max(1,Math.min(u-1,Math.ceil(_/C[1]))):1,q=0!==_?Math.max(1,Math.min(c-1,Math.ceil(_/C[2]))):1;for(G.push(M,F,N,(M*u+F)*c+N);t.count=p.length;var ae=p[ne];if(0!==ae){for(var pe=X,me=ae-1,de=l[me],te=de+d[me],le=de;leX&&(X=Q),U0.insert(Q,ge)}pe=s))for(var Oe=-K;Oe<=K;Oe++){var Ne=F+Oe;if(!(Ne<0||Ne>=u))for(var Ue=-q;Ue<=q;Ue++){var $e=N+Ue;if(!($e<0||$e>=c||(ne=(De*u+Ne)*c+$e,BF.has(ne)||(BF.add(ne),OS.has(ne))))){if(!H){var Ie=n[0]+De*C[0]-x,He=n[1]+Ne*C[1]-D,Je=n[2]+$e*C[2]-w;if(Ie*Ie+He*He+Je*Je-W>X){k.push(De,Ne,$e,ne);continue}}J.push(De,Ne,$e,ne),z++}}}}}if(H=!1,0===z){if(1===A){if(ut=U0.findMinimum())return wc.add(t,Le=ut.value,wt=ut.key),!0}else for(;!U0.isEmpty()&&(Y||U0.findMinimum().key<=X)&&t.count=A||j||t.count>=I)return t.count>0;if(H=!0,Z=!0,k.length>0){le=0;for(var it=k.length;leN||M>j||F>U)return!1;for(var H=I;H<=N;H++)for(var z=M;z<=j;z++)for(var G=F;G<=U;G++){var J=d[(H*o+z)*s+G];if(0!==J)for(var X=J-1,Z=u[X],Y=Z+c[X],k=Z;k0&&Math.sqrt(V)-g[W]>C)continue;if(_)return!0;wc.add(t,l[k],V)}}}return t.count>0}var KY=b(),cm=b(),OS=new Set,BF=new Set,iPe=[.1],oPe=[.1],sPe=[.1],U0=new YY;var iu=b();function Wh(e,t,r,n){for(var a=0,i=3*n;athis.radiusSq&&(this.radiusSq=r)},e.prototype.radiusSphereStep=function(t,r){var n=pPe(t,this.center)+r,a=n*n;a>this.radiusSq&&(this.radiusSq=a)},e.prototype.getSphere=function(t){return t||(t=Pe()),b.copy(t.center,this.center),t.radius=Math.sqrt(this.radiusSq),t},e.prototype.getCount=function(){return this.count},e}();!function(e){var t=new e,r=b(),n=b();e.fromArrays=function a(s,u){var c=s.x,l=s.y,d=s.z;t.reset();for(var f=c.length,p=0;pthis.maxDist[t]&&(this.maxDist[t]=n,JY(this.extrema[2*t+1],r))},e.prototype.computeSphereExtrema=function(t,r,n){var a=this.dir[t],i=$Y(a,r);i-nthis.maxDist[t]&&(this.maxDist[t]=i+n,hPe(this.extrema[2*t+1],r,a,n))},e.prototype.includeSphere=function(t){if(Pe.hasExtrema(t)&&t.extrema.length>1)for(var r=0,n=t.extrema;r1)for(var r=0,n=t.extrema;r0?Math.ceil(e/n):0;return{width:n,height:a,length:n*a*t}}(e,t),i=a.length,o=a.width,s=a.height;return{array:n=n&&n.length>=i?n:new r(i),width:o,height:s}}var Ac=b(),_Pe=new Lu("14"),wPe=new Lu("98");function nX(e){return e>1e5?_Pe:wPe}function Ef(e,t,r){var n=3*r,a=nX(t);a.reset();for(var i=0,o=3*t;i>2),n=t-4>>2,a=4*n,i=0;if(n<0)for(var o=0;o>16]}for(o=a;o=85}return!1}(e);return{instancedArrays:t,standardDerivatives:n,elementIndexUint:r,textureFloat:a,textureFloatLinear:i,textureHalfFloat:o,textureHalfFloatLinear:s,depthTexture:u,blendMinMax:c,vertexArrayObject:l,fragDepth:d,colorBufferFloat:f,colorBufferHalfFloat:p,drawBuffers:m,drawBuffersIndexed:h,shaderTextureLod:v,sRGB:g,disjointTimerQuery:y,parallelShaderCompile:S,fboRenderMipmap:C,provokingVertex:_,clipCullDistance:x,conservativeDepth:D,stencilTexturing:w,clipControl:A,noNonInstancedActiveAttribs:E}}!function(e){e.create=function t(a,i,o){return{array:a,width:i,height:o}},e.flipY=function r(a){for(var i=a.array,o=a.width,s=a.height,c=o*(i.length/(o*s)),l=0,d=s/2;l 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness;\n material.rgb -= 0.5 * uBumpAmplitude * bumpiness;\n }\n #endif\n\n gl_FragColor = material;\n#else\n #ifdef bumpEnabled\n if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);\n }\n #endif\n\n vec4 color = material;\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\n PhysicalMaterial physicalMaterial;\n physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);\n #ifdef enabledFragDepth\n physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0);\n #else\n vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal)));\n float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z);\n physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0);\n #endif\n physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);\n physicalMaterial.specularF90 = 1.0;\n\n GeometricContext geometry;\n geometry.position = -vViewPosition;\n geometry.normal = normal;\n geometry.viewDir = normalize(vViewPosition);\n\n IncidentLight directLight;\n #pragma unroll_loop_start\n for (int i = 0; i < dLightCount; ++i) {\n directLight.direction = uLightDirection[i];\n directLight.color = uLightColor[i] * PI; // * PI for punctual light\n RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);\n }\n #pragma unroll_loop_end\n\n vec3 irradiance = uAmbientColor * PI; // * PI for punctual light\n RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);\n\n // indirect specular only metals\n vec3 radiance = uAmbientColor * metalness;\n vec3 iblIrradiance = uAmbientColor * metalness;\n vec3 clearcoatRadiance = vec3(0.0);\n RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background\n\n gl_FragColor = vec4(outgoingLight, color.a);\n#endif\n\n#if defined(dXrayShaded_on)\n gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#elif defined(dXrayShaded_inverted)\n gl_FragColor.a *= pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#endif\n\ngl_FragColor.rgb *= uExposure;\n",apply_marker_color:"\n\n#if defined(dColorMarker)\n if (marker > 0.0) {\n if ((uMarkerPriority == 1 && marker != 2.0) || (uMarkerPriority != 1 && marker == 1.0)) {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, uHighlightColor, uHighlightStrength);\n gl_FragColor.a = max(gl_FragColor.a, uHighlightStrength * 0.002); // for direct-volume rendering\n } else {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, uSelectColor, uSelectStrength);\n gl_FragColor.a = max(gl_FragColor.a, uSelectStrength * 0.002); // for direct-volume rendering\n }\n } else if (uMarkerAverage > 0.0) {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, uDimColor, uDimStrength);\n gl_FragColor.a = max(gl_FragColor.a, uDimStrength * 0.002); // for direct-volume rendering\n }\n#endif\n",assign_clipping_varying:"\n#if dClipObjectCount != 0 && defined(dClipping)\n #if defined(dClippingType_instance)\n vClipping = readFromTexture(tClipping, aInstance, uClippingTexDim).a;\n #elif defined(dMarkerType_groupInstance)\n vClipping = readFromTexture(tClipping, aInstance * float(uGroupCount) + group, uClippingTexDim).a;\n #endif\n#endif\n",assign_color_varying:"\n#if defined(dRenderVariant_color)\n #if defined(dColorType_attribute)\n vColor.rgb = aColor;\n #elif defined(dColorType_instance)\n vColor.rgb = readFromTexture(tColor, aInstance, uColorTexDim).rgb;\n #elif defined(dColorType_group)\n vColor.rgb = readFromTexture(tColor, group, uColorTexDim).rgb;\n #elif defined(dColorType_groupInstance)\n vColor.rgb = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim).rgb;\n #elif defined(dColorType_vertex)\n vColor.rgb = readFromTexture(tColor, VertexID, uColorTexDim).rgb;\n #elif defined(dColorType_vertexInstance)\n vColor.rgb = readFromTexture(tColor, int(aInstance) * uVertexCount + VertexID, uColorTexDim).rgb;\n #elif defined(dColorType_volume)\n vec3 cgridPos = (uColorGridTransform.w * (position - uColorGridTransform.xyz)) / uColorGridDim;\n vColor.rgb = texture3dFrom2dLinear(tColorGrid, cgridPos, uColorGridDim, uColorTexDim).rgb;\n #elif defined(dColorType_volumeInstance)\n vec3 cgridPos = (uColorGridTransform.w * (vModelPosition - uColorGridTransform.xyz)) / uColorGridDim;\n vColor.rgb = texture3dFrom2dLinear(tColorGrid, cgridPos, uColorGridDim, uColorTexDim).rgb;\n #endif\n\n #ifdef dUsePalette\n vPaletteV = ((vColor.r * 256.0 * 256.0 * 255.0 + vColor.g * 256.0 * 255.0 + vColor.b * 255.0) - 1.0) / 16777215.0;\n #endif\n\n #ifdef dOverpaint\n #if defined(dOverpaintType_instance)\n vOverpaint = readFromTexture(tOverpaint, aInstance, uOverpaintTexDim);\n #elif defined(dOverpaintType_groupInstance)\n vOverpaint = readFromTexture(tOverpaint, aInstance * float(uGroupCount) + group, uOverpaintTexDim);\n #elif defined(dOverpaintType_vertexInstance)\n vOverpaint = readFromTexture(tOverpaint, int(aInstance) * uVertexCount + VertexID, uOverpaintTexDim);\n #elif defined(dOverpaintType_volumeInstance)\n vec3 ogridPos = (uOverpaintGridTransform.w * (vModelPosition - uOverpaintGridTransform.xyz)) / uOverpaintGridDim;\n vOverpaint = texture3dFrom2dLinear(tOverpaintGrid, ogridPos, uOverpaintGridDim, uOverpaintTexDim);\n #endif\n\n // pre-mix to avoid darkening due to empty overpaint\n #ifdef dColorType_uniform\n vOverpaint.rgb = mix(uColor.rgb, vOverpaint.rgb, vOverpaint.a);\n #else\n vOverpaint.rgb = mix(vColor.rgb, vOverpaint.rgb, vOverpaint.a);\n #endif\n vOverpaint *= uOverpaintStrength;\n #endif\n\n #ifdef dSubstance\n #if defined(dSubstanceType_instance)\n vSubstance = readFromTexture(tSubstance, aInstance, uSubstanceTexDim);\n #elif defined(dSubstanceType_groupInstance)\n vSubstance = readFromTexture(tSubstance, aInstance * float(uGroupCount) + group, uSubstanceTexDim);\n #elif defined(dSubstanceType_vertexInstance)\n vSubstance = readFromTexture(tSubstance, int(aInstance) * uVertexCount + VertexID, uSubstanceTexDim);\n #elif defined(dSubstanceType_volumeInstance)\n vec3 sgridPos = (uSubstanceGridTransform.w * (vModelPosition - uSubstanceGridTransform.xyz)) / uSubstanceGridDim;\n vSubstance = texture3dFrom2dLinear(tSubstanceGrid, sgridPos, uSubstanceGridDim, uSubstanceTexDim);\n #endif\n\n // pre-mix to avoid artifacts due to empty substance\n vSubstance.rgb = mix(vec3(uMetalness, uRoughness, uBumpiness), vSubstance.rgb, vSubstance.a);\n vSubstance *= uSubstanceStrength;\n #endif\n#elif defined(dRenderVariant_pick)\n #ifdef requiredDrawBuffers\n vObject = vec4(packIntToRGB(float(uObjectId)), 1.0);\n vInstance = vec4(packIntToRGB(aInstance), 1.0);\n vGroup = vec4(packIntToRGB(group), 1.0);\n #else\n if (uPickType == 1) {\n vColor = vec4(packIntToRGB(float(uObjectId)), 1.0);\n } else if (uPickType == 2) {\n vColor = vec4(packIntToRGB(aInstance), 1.0);\n } else {\n vColor = vec4(packIntToRGB(group), 1.0);\n }\n #endif\n#endif\n\n#ifdef dTransparency\n #if defined(dTransparencyType_instance)\n vTransparency = readFromTexture(tTransparency, aInstance, uTransparencyTexDim).a;\n #elif defined(dTransparencyType_groupInstance)\n vTransparency = readFromTexture(tTransparency, aInstance * float(uGroupCount) + group, uTransparencyTexDim).a;\n #elif defined(dTransparencyType_vertexInstance)\n vTransparency = readFromTexture(tTransparency, int(aInstance) * uVertexCount + VertexID, uTransparencyTexDim).a;\n #elif defined(dTransparencyType_volumeInstance)\n vec3 tgridPos = (uTransparencyGridTransform.w * (vModelPosition - uTransparencyGridTransform.xyz)) / uTransparencyGridDim;\n vTransparency = texture3dFrom2dLinear(tTransparencyGrid, tgridPos, uTransparencyGridDim, uTransparencyTexDim).a;\n #endif\n vTransparency *= uTransparencyStrength;\n#endif\n",assign_group:"\n#ifdef dGeometryType_textureMesh\n float group = unpackRGBToInt(readFromTexture(tGroup, VertexID, uGeoTexDim).rgb);\n#else\n float group = aGroup;\n#endif\n",assign_marker_varying:"\n#if defined(dNeedsMarker)\n #if defined(dMarkerType_instance)\n vMarker = readFromTexture(tMarker, aInstance, uMarkerTexDim).a;\n #elif defined(dMarkerType_groupInstance)\n vMarker = readFromTexture(tMarker, aInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n #endif\n#endif\n",assign_material_color:"\n#if defined(dNeedsMarker)\n float marker = uMarker;\n if (uMarker == -1.0) {\n marker = floor(vMarker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n#endif\n\n#if defined(dRenderVariant_color)\n #if defined(dUsePalette)\n vec4 material = vec4(texture2D(tPalette, vec2(vPaletteV, 0.5)).rgb, uAlpha);\n #elif defined(dColorType_uniform)\n vec4 material = vec4(uColor, uAlpha);\n #elif defined(dColorType_varying)\n vec4 material = vec4(vColor.rgb, uAlpha);\n #endif\n\n // mix material with overpaint\n #if defined(dOverpaint)\n material.rgb = mix(material.rgb, vOverpaint.rgb, vOverpaint.a);\n #endif\n\n float metalness = uMetalness;\n float roughness = uRoughness;\n float bumpiness = uBumpiness;\n #ifdef dSubstance\n metalness = mix(metalness, vSubstance.r, vSubstance.a);\n roughness = mix(roughness, vSubstance.g, vSubstance.a);\n bumpiness = mix(bumpiness, vSubstance.b, vSubstance.a);\n #endif\n#elif defined(dRenderVariant_depth)\n if (fragmentDepth > getDepth(gl_FragCoord.xy / uDrawingBufferSize)) {\n discard;\n }\n\n #ifndef dXrayShaded\n #if defined(dTransparency)\n float dta = 1.0 - vTransparency;\n if (vTransparency < 0.2) dta = 1.0; // hard cutoff looks better\n\n if (uRenderMask == MaskTransparent && uAlpha * dta == 1.0) {\n discard;\n } else if (uRenderMask == MaskOpaque && uAlpha * dta < 1.0) {\n discard;\n }\n #else\n if (uRenderMask == MaskTransparent && uAlpha == 1.0) {\n discard;\n } else if (uRenderMask == MaskOpaque && uAlpha < 1.0) {\n discard;\n }\n #endif\n #else\n if (uRenderMask == MaskOpaque) {\n discard;\n }\n #endif\n\n vec4 material = packDepthToRGBA(fragmentDepth);\n#elif defined(dRenderVariant_marking)\n vec4 material;\n if(uMarkingType == 1) {\n if (marker > 0.0)\n discard;\n #ifdef enabledFragDepth\n material = packDepthToRGBA(gl_FragDepthEXT);\n #else\n material = packDepthToRGBA(gl_FragCoord.z);\n #endif\n } else {\n if (marker == 0.0)\n discard;\n float depthTest = 1.0;\n if (uMarkingDepthTest) {\n depthTest = (fragmentDepth >= getDepthPacked(gl_FragCoord.xy / uDrawingBufferSize)) ? 1.0 : 0.0;\n }\n bool isHighlight = intMod(marker, 2.0) > 0.1;\n float viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar);\n float fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ));\n if (fogFactor == 1.0)\n discard;\n material = vec4(0.0, depthTest, isHighlight ? 1.0 : 0.0, 1.0 - fogFactor);\n }\n#endif\n\n// apply per-group transparency\n#if defined(dTransparency) && (defined(dRenderVariant_pick) || defined(dRenderVariant_color))\n float ta = 1.0 - vTransparency;\n if (vTransparency < 0.09) ta = 1.0; // hard cutoff looks better\n\n #if defined(dRenderVariant_pick)\n if (ta < uPickingAlphaThreshold)\n discard; // ignore so the element below can be picked\n #elif defined(dRenderVariant_color)\n material.a *= ta;\n\n #if defined(dRenderVariant_colorBlended)\n #if defined(dTransparentBackfaces_off)\n if ((uRenderMask == MaskOpaque && material.a < 1.0) ||\n (uRenderMask == MaskTransparent && material.a == 1.0) ||\n (interior && material.a < 1.0)\n ) {\n discard;\n }\n #elif defined(dTransparentBackfaces_on)\n if ((uRenderMask == MaskOpaque && material.a < 1.0) ||\n (uRenderMask == MaskTransparent && material.a == 1.0)\n ) {\n discard;\n }\n #elif defined(dTransparentBackfaces_opaque)\n if (interior) {\n material.a = 1.0;\n } else if (\n (uRenderMask == MaskOpaque && material.a < 1.0) ||\n (uRenderMask == MaskTransparent && material.a == 1.0)\n ) {\n discard;\n }\n #endif\n #endif\n #endif\n#endif\n",assign_position:"\nmat4 model = uModel * aTransform;\nmat4 modelView = uView * model;\n#ifdef dGeometryType_textureMesh\n vec3 position = readFromTexture(tPosition, VertexID, uGeoTexDim).xyz;\n#else\n vec3 position = aPosition;\n#endif\nvec4 position4 = vec4(position, 1.0);\n// for accessing tColorGrid in vert shader and for clipping in frag shader\nvModelPosition = (model * position4).xyz;\nvec4 mvPosition = modelView * position4;\nvViewPosition = mvPosition.xyz;\ngl_Position = uProjection * mvPosition;\n",assign_size:"\n#if defined(dSizeType_uniform)\n float size = uSize;\n#elif defined(dSizeType_attribute)\n float size = aSize;\n#elif defined(dSizeType_instance)\n float size = unpackRGBToInt(readFromTexture(tSize, aInstance, uSizeTexDim).rgb);\n#elif defined(dSizeType_group)\n float size = unpackRGBToInt(readFromTexture(tSize, group, uSizeTexDim).rgb);\n#elif defined(dSizeType_groupInstance)\n float size = unpackRGBToInt(readFromTexture(tSize, aInstance * float(uGroupCount) + group, uSizeTexDim).rgb);\n#endif\n\n#if defined(dSizeType_instance) || defined(dSizeType_group) || defined(dSizeType_groupInstance)\n size /= 100.0; // NOTE factor also set in TypeScript\n#endif\n\nsize *= uSizeFactor;\n",check_picking_alpha:"\nfloat viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar);\nfloat fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ));\nfloat alpha = (1.0 - fogFactor) * uAlpha;\n// if not opaque enough ignore so the element below can be picked\nif (uAlpha < uPickingAlphaThreshold || alpha < 0.1) {\n #ifdef dTransparentBackfaces_opaque\n if (!interior) discard;\n #else\n discard;\n #endif\n}\n",clip_instance:"\n#if defined(dClipVariant_instance) && dClipObjectCount != 0\n vec4 mCenter = uModel * aTransform * vec4(uInvariantBoundingSphere.xyz, 1.0);\n if (clipTest(vec4(mCenter.xyz, uInvariantBoundingSphere.w)))\n // move out of [ -w, +w ] to 'discard' in vert shader\n gl_Position.z = 2.0 * gl_Position.w;\n#endif\n",clip_pixel:"\n#if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(vModelPosition, 0.0)))\n discard;\n#endif\n",color_frag_params:"\nuniform float uMetalness;\nuniform float uRoughness;\nuniform float uBumpiness;\n#ifdef bumpEnabled\n uniform float uBumpFrequency;\n uniform float uBumpAmplitude;\n#endif\n\n#if defined(dRenderVariant_color)\n #if defined(dColorType_uniform)\n uniform vec3 uColor;\n #elif defined(dColorType_varying)\n varying vec4 vColor;\n #endif\n\n #ifdef dUsePalette\n uniform sampler2D tPalette;\n varying float vPaletteV;\n #endif\n\n #ifdef dOverpaint\n varying vec4 vOverpaint;\n #endif\n\n #ifdef dSubstance\n varying vec4 vSubstance;\n #endif\n#elif defined(dRenderVariant_pick)\n #if __VERSION__ == 100 || !defined(dVaryingGroup)\n #ifdef requiredDrawBuffers\n varying vec4 vObject;\n varying vec4 vInstance;\n varying vec4 vGroup;\n #else\n varying vec4 vColor;\n #endif\n #else\n #ifdef requiredDrawBuffers\n flat in vec4 vObject;\n flat in vec4 vInstance;\n flat in vec4 vGroup;\n #else\n flat in vec4 vColor;\n #endif\n #endif\n#endif\n\n#ifdef dTransparency\n varying float vTransparency;\n#endif\n",color_vert_params:"\nuniform float uMetalness;\nuniform float uRoughness;\nuniform float uBumpiness;\n\n#if defined(dRenderVariant_color)\n #if defined(dColorType_uniform)\n uniform vec3 uColor;\n #elif defined(dColorType_attribute)\n varying vec4 vColor;\n attribute vec3 aColor;\n #elif defined(dColorType_texture)\n varying vec4 vColor;\n uniform vec2 uColorTexDim;\n uniform sampler2D tColor;\n #elif defined(dColorType_grid)\n varying vec4 vColor;\n uniform vec2 uColorTexDim;\n uniform vec3 uColorGridDim;\n uniform vec4 uColorGridTransform;\n uniform sampler2D tColorGrid;\n #elif defined(dColorType_direct)\n varying vec4 vColor;\n #endif\n\n #ifdef dUsePalette\n varying float vPaletteV;\n #endif\n\n #ifdef dOverpaint\n #if defined(dOverpaintType_instance) || defined(dOverpaintType_groupInstance) || defined(dOverpaintType_vertexInstance)\n varying vec4 vOverpaint;\n uniform vec2 uOverpaintTexDim;\n uniform sampler2D tOverpaint;\n #elif defined(dOverpaintType_volumeInstance)\n varying vec4 vOverpaint;\n uniform vec2 uOverpaintTexDim;\n uniform vec3 uOverpaintGridDim;\n uniform vec4 uOverpaintGridTransform;\n uniform sampler2D tOverpaintGrid;\n #endif\n uniform float uOverpaintStrength;\n #endif\n\n #ifdef dSubstance\n #if defined(dSubstanceType_instance) || defined(dSubstanceType_groupInstance) || defined(dSubstanceType_vertexInstance)\n varying vec4 vSubstance;\n uniform vec2 uSubstanceTexDim;\n uniform sampler2D tSubstance;\n #elif defined(dSubstanceType_volumeInstance)\n varying vec4 vSubstance;\n uniform vec2 uSubstanceTexDim;\n uniform vec3 uSubstanceGridDim;\n uniform vec4 uSubstanceGridTransform;\n uniform sampler2D tSubstanceGrid;\n #endif\n uniform float uSubstanceStrength;\n #endif\n#elif defined(dRenderVariant_pick)\n #if __VERSION__ == 100 || !defined(dVaryingGroup)\n #ifdef requiredDrawBuffers\n varying vec4 vObject;\n varying vec4 vInstance;\n varying vec4 vGroup;\n #else\n varying vec4 vColor;\n #endif\n #else\n #ifdef requiredDrawBuffers\n flat out vec4 vObject;\n flat out vec4 vInstance;\n flat out vec4 vGroup;\n #else\n flat out vec4 vColor;\n #endif\n #endif\n#endif\n\n#ifdef dTransparency\n #if defined(dTransparencyType_instance) || defined(dTransparencyType_groupInstance) || defined(dTransparencyType_vertexInstance)\n varying float vTransparency;\n uniform vec2 uTransparencyTexDim;\n uniform sampler2D tTransparency;\n #elif defined(dTransparencyType_volumeInstance)\n varying float vTransparency;\n uniform vec2 uTransparencyTexDim;\n uniform vec3 uTransparencyGridDim;\n uniform vec4 uTransparencyGridTransform;\n uniform sampler2D tTransparencyGrid;\n #endif\n uniform float uTransparencyStrength;\n#endif\n",common_clip:"\n#if dClipObjectCount != 0\n vec3 quaternionTransform(const in vec4 q, const in vec3 v) {\n vec3 t = 2.0 * cross(q.xyz, v);\n return v + q.w * t + cross(q.xyz, t);\n }\n\n vec4 computePlane(const in vec3 normal, const in vec3 inPoint) {\n return vec4(normalize(normal), -dot(normal, inPoint));\n }\n\n float planeSD(const in vec4 plane, const in vec3 center) {\n return -dot(plane.xyz, center - plane.xyz * -plane.w);\n }\n\n float sphereSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n return (\n length(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position) / size) - 1.0\n ) * min(min(size.x, size.y), size.z);\n }\n\n float cubeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n vec3 d = abs(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position)) - size;\n return min(max(d.x, max(d.y, d.z)), 0.0) + length(max(d, 0.0));\n }\n\n float cylinderSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);\n\n vec2 d = abs(vec2(length(t.xz), t.y)) - size.xy;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n\n float infiniteConeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);\n\n float q = length(t.xy);\n return dot(size.xy, vec2(q, t.z));\n }\n\n float getSignedDistance(const in vec3 center, const in int type, const in vec3 position, const in vec4 rotation, const in vec3 scale) {\n if (type == 1) {\n vec3 normal = quaternionTransform(rotation, vec3(0.0, 1.0, 0.0));\n vec4 plane = computePlane(normal, position);\n return planeSD(plane, center);\n } else if (type == 2) {\n return sphereSD(position, rotation, scale * 0.5, center);\n } else if (type == 3) {\n return cubeSD(position, rotation, scale * 0.5, center);\n } else if (type == 4) {\n return cylinderSD(position, rotation, scale * 0.5, center);\n } else if (type == 5) {\n return infiniteConeSD(position, rotation, scale * 0.5, center);\n } else {\n return 0.1;\n }\n }\n\n #if __VERSION__ == 100\n // 8-bit\n int bitwiseAnd(in int a, in int b) {\n int d = 128;\n int result = 0;\n for (int i = 0; i < 8; ++i) {\n if (d <= 0) break;\n if (a >= d && b >= d) result += d;\n if (a >= d) a -= d;\n if (b >= d) b -= d;\n d /= 2;\n }\n return result;\n }\n\n bool hasBit(const in int mask, const in int bit) {\n return bitwiseAnd(mask, bit) == 0;\n }\n #else\n bool hasBit(const in int mask, const in int bit) {\n return (mask & bit) == 0;\n }\n #endif\n\n bool clipTest(const in vec4 sphere) {\n // flag is a bit-flag for clip-objects to ignore (note, object ids start at 1 not 0)\n #if defined(dClipping)\n int flag = int(floor(vClipping * 255.0 + 0.5));\n #else\n int flag = 0;\n #endif\n\n #pragma unroll_loop_start\n for (int i = 0; i < dClipObjectCount; ++i) {\n if (flag == 0 || hasBit(flag, UNROLLED_LOOP_INDEX + 1)) {\n // TODO take sphere radius into account?\n bool test = getSignedDistance(sphere.xyz, uClipObjectType[i], uClipObjectPosition[i], uClipObjectRotation[i], uClipObjectScale[i]) <= 0.0;\n if ((!uClipObjectInvert[i] && test) || (uClipObjectInvert[i] && !test)) {\n return true;\n }\n }\n }\n #pragma unroll_loop_end\n return false;\n }\n#endif\n",common_frag_params:'\nuniform int uObjectId;\nuniform int uInstanceCount;\nuniform int uGroupCount;\n\nuniform int uPickType;\nuniform int uMarkingType;\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n\n #if defined(dClipping)\n #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)\n varying float vClipping;\n #else\n flat in float vClipping;\n #endif\n #endif\n#endif\n\n#if defined(dColorMarker)\n uniform vec3 uHighlightColor;\n uniform vec3 uSelectColor;\n uniform vec3 uDimColor;\n uniform float uHighlightStrength;\n uniform float uSelectStrength;\n uniform float uDimStrength;\n uniform int uMarkerPriority;\n uniform float uMarkerAverage;\n#endif\n\n#if defined(dNeedsMarker)\n uniform float uMarker;\n #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)\n varying float vMarker;\n #else\n flat in float vMarker;\n #endif\n#endif\n\n#if defined(dRenderVariant_colorDpoit)\n #define MAX_DPOIT_DEPTH 99999.0 // NOTE constant also set in TypeScript\n uniform sampler2D tDpoitDepth;\n uniform sampler2D tDpoitFrontColor;\n#endif\n\nvarying vec3 vModelPosition;\nvarying vec3 vViewPosition;\n\nuniform vec2 uViewOffset;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uIsOrtho;\n\nuniform bool uFog;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\n\nuniform float uAlpha;\nuniform float uPickingAlphaThreshold;\nuniform bool uTransparentBackground;\n\nuniform bool uDoubleSided;\nuniform float uInteriorDarkening;\nuniform bool uInteriorColorFlag;\nuniform vec3 uInteriorColor;\nbool interior;\n\nuniform float uXrayEdgeFalloff;\nuniform float uExposure;\n\nuniform mat4 uProjection;\n\nuniform int uRenderMask;\nuniform bool uMarkingDepthTest;\n\nuniform sampler2D tDepth;\nuniform vec2 uDrawingBufferSize;\n\nfloat getDepthPacked(const in vec2 coords) {\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nfloat calcDepth(const in vec3 pos) {\n vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;\n return 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\n\n// "Bump Mapping Unparametrized Surfaces on the GPU" Morten S. Mikkelsen\n// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf\nvec3 perturbNormal(in vec3 position, in vec3 normal, in float height, in float scale) {\n vec3 sigmaS = dFdx(position);\n vec3 sigmaT = dFdy(position);\n\n vec3 r1 = cross(sigmaT, normal);\n vec3 r2 = cross(normal, sigmaS);\n float det = dot(sigmaS, r1);\n\n float bs = dFdx(height);\n float bt = dFdy(height);\n\n vec3 surfGrad = sign(det) * (bs * r1 + bt * r2);\n return normalize(abs(det) * normal - scale * surfGrad);\n}\n\nfloat hash(in float h) {\n return fract(sin(h) * 43758.5453123);\n}\n\nfloat noise(in vec3 x) {\n vec3 p = floor(x);\n vec3 f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n\n float n = p.x + p.y * 157.0 + 113.0 * p.z;\n return mix(\n mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),\n mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),\n mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),\n mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y), f.z);\n}\n\nfloat fbm(in vec3 p) {\n float f = 0.0;\n f += 0.5 * noise(p);\n p *= 2.01;\n f += 0.25 * noise(p);\n p *= 2.02;\n f += 0.125 * noise(p);\n\n return f;\n}\n',common_vert_params:"\nuniform mat4 uProjection, uModel, uView;\nuniform vec3 uCameraPosition;\n\nuniform int uObjectId;\nuniform int uVertexCount;\nuniform int uInstanceCount;\nuniform int uGroupCount;\nuniform vec4 uInvariantBoundingSphere;\n\nuniform bool uDoubleSided;\nuniform int uPickType;\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n\n #if defined(dClipping)\n uniform vec2 uClippingTexDim;\n uniform sampler2D tClipping;\n #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)\n varying float vClipping;\n #else\n flat out float vClipping;\n #endif\n #endif\n#endif\n\n#if defined(dNeedsMarker)\n uniform float uMarker;\n uniform vec2 uMarkerTexDim;\n uniform sampler2D tMarker;\n #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)\n varying float vMarker;\n #else\n flat out float vMarker;\n #endif\n#endif\n\nvarying vec3 vModelPosition;\nvarying vec3 vViewPosition;\n\n#if defined(noNonInstancedActiveAttribs)\n // int() is needed for some Safari versions\n // see https://bugs.webkit.org/show_bug.cgi?id=244152\n #define VertexID int(gl_VertexID)\n#else\n attribute float aVertex;\n #define VertexID int(aVertex)\n#endif\n",common:"\n// TODO find a better place for these convenience defines\n\n#if defined(dRenderVariant_colorBlended) || defined(dRenderVariant_colorWboit) || defined(dRenderVariant_colorDpoit)\n #define dRenderVariant_color\n#endif\n\n#if defined(dColorType_instance) || defined(dColorType_group) || defined(dColorType_groupInstance) || defined(dColorType_vertex) || defined(dColorType_vertexInstance)\n #define dColorType_texture\n#endif\n\n#if defined(dColorType_volume) || defined(dColorType_volumeInstance)\n #define dColorType_grid\n#endif\n\n#if defined(dColorType_attribute) || defined(dColorType_texture) || defined(dColorType_grid)\n #define dColorType_varying\n#endif\n\n#if (defined(dRenderVariant_color) && defined(dColorMarker)) || defined(dRenderVariant_marking)\n #define dNeedsMarker\n#endif\n\n#if defined(dXrayShaded_on) || defined(dXrayShaded_inverted)\n #define dXrayShaded\n#endif\n\n#define MaskAll 0\n#define MaskOpaque 1\n#define MaskTransparent 2\n\n//\n\n#define PI 3.14159265\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n\n#define saturate(a) clamp(a, 0.0, 1.0)\n\n#if __VERSION__ == 100\n #define round(x) floor((x) + 0.5)\n#endif\n\nfloat intDiv(const in float a, const in float b) { return float(int(a) / int(b)); }\nvec2 ivec2Div(const in vec2 a, const in vec2 b) { return vec2(ivec2(a) / ivec2(b)); }\nfloat intMod(const in float a, const in float b) { return a - b * float(int(a) / int(b)); }\nint imod(const in int a, const in int b) { return a - b * (a / b); }\n\nfloat pow2(const in float x) { return x * x; }\n\nvec3 packIntToRGB(in float value) {\n value = clamp(round(value), 0.0, 16777216.0 - 1.0) + 1.0;\n vec3 c = vec3(0.0);\n c.b = mod(value, 256.0);\n value = floor(value / 256.0);\n c.g = mod(value, 256.0);\n value = floor(value / 256.0);\n c.r = mod(value, 256.0);\n return c / 255.0;\n}\nfloat unpackRGBToInt(const in vec3 rgb) {\n return (floor(rgb.r * 255.0 + 0.5) * 256.0 * 256.0 + floor(rgb.g * 255.0 + 0.5) * 256.0 + floor(rgb.b * 255.0 + 0.5)) - 1.0;\n}\n\nvec2 packUnitIntervalToRG(const in float v) {\n vec2 enc;\n enc.xy = vec2(fract(v * 256.0), v);\n enc.y -= enc.x * (1.0 / 256.0);\n enc.xy *= 256.0 / 255.0;\n\n return enc;\n}\n\nfloat unpackRGToUnitInterval(const in vec2 enc) {\n return dot(enc, vec2(255.0 / (256.0 * 256.0), 255.0 / 256.0));\n}\n\nvec3 screenSpaceToViewSpace(const in vec3 ssPos, const in mat4 invProjection) {\n vec4 p = vec4(ssPos * 2.0 - 1.0, 1.0);\n p = invProjection * p;\n return p.xyz / p.w;\n}\n\nconst float PackUpscale = 256.0 / 255.0; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255.0 / 256.0; // 0..1 -> fraction (excluding 1)\nconst vec3 PackFactors = vec3(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0);\nconst vec4 UnpackFactors = UnpackDownscale / vec4(PackFactors, 1.0);\nconst float ShiftRight8 = 1.0 / 256.0;\n\nvec4 packDepthToRGBA(const in float v) {\n vec4 r = vec4(fract(v * PackFactors), v);\n r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n return r * PackUpscale;\n}\nfloat unpackRGBAToDepth(const in vec4 v) {\n return dot(v, UnpackFactors);\n}\n\nvec4 sRGBToLinear(const in vec4 c) {\n return vec4(mix(pow(c.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), c.rgb * 0.0773993808, vec3(lessThanEqual(c.rgb, vec3(0.04045)))), c.a);\n}\nvec4 linearTosRGB(const in vec4 c) {\n return vec4(mix(pow(c.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), c.rgb * 12.92, vec3(lessThanEqual(c.rgb, vec3(0.0031308)))), c.a);\n}\n\nfloat linearizeDepth(const in float depth, const in float near, const in float far) {\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\nfloat perspectiveDepthToViewZ(const in float invClipZ, const in float near, const in float far) {\n return (near * far) / ((far - near) * invClipZ - far);\n}\n\nfloat orthographicDepthToViewZ(const in float linearClipZ, const in float near, const in float far) {\n return linearClipZ * (near - far) - near;\n}\n\nfloat depthToViewZ(const in float isOrtho, const in float linearClipZ, const in float near, const in float far) {\n return isOrtho == 1.0 ? orthographicDepthToViewZ(linearClipZ, near, far) : perspectiveDepthToViewZ(linearClipZ, near, far);\n}\n\n#if __VERSION__ == 100\n // transpose\n\n float transpose(const in float m) {\n return m;\n }\n\n mat2 transpose2(const in mat2 m) {\n return mat2(\n m[0][0], m[1][0],\n m[0][1], m[1][1]\n );\n }\n\n mat3 transpose3(const in mat3 m) {\n return mat3(\n m[0][0], m[1][0], m[2][0],\n m[0][1], m[1][1], m[2][1],\n m[0][2], m[1][2], m[2][2]\n );\n }\n\n mat4 transpose4(const in mat4 m) {\n return mat4(\n m[0][0], m[1][0], m[2][0], m[3][0],\n m[0][1], m[1][1], m[2][1], m[3][1],\n m[0][2], m[1][2], m[2][2], m[3][2],\n m[0][3], m[1][3], m[2][3], m[3][3]\n );\n }\n\n // inverse\n\n float inverse(const in float m) {\n return 1.0 / m;\n }\n\n mat2 inverse2(const in mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n }\n\n mat3 inverse3(const in mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n }\n\n mat4 inverse4(const in mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n }\n\n #define isNaN(x) ((x) != (x))\n #define isInf(x) ((x) == (x) + 1.0)\n#else\n #define transpose2(m) transpose(m)\n #define transpose3(m) transpose(m)\n #define transpose4(m) transpose(m)\n\n #define inverse2(m) inverse(m)\n #define inverse3(m) inverse(m)\n #define inverse4(m) inverse(m)\n\n #define isNaN isnan\n #define isInf isinf\n#endif\n",float_to_rgba:"\n // floatToRgba adapted from https://github.com/equinor/glsl-float-to-rgba\n // MIT License, Copyright (c) 2020 Equinor\n\n float shiftRight (float v, float amt) {\n v = floor(v) + 0.5;\n return floor(v / exp2(amt));\n }\n float shiftLeft (float v, float amt) {\n return floor(v * exp2(amt) + 0.5);\n }\n float maskLast (float v, float bits) {\n return mod(v, shiftLeft(1.0, bits));\n }\n float extractBits (float num, float from, float to) {\n from = floor(from + 0.5); to = floor(to + 0.5);\n return maskLast(shiftRight(num, from), to - from);\n }\n\n vec4 floatToRgba(float texelFloat, bool littleEndian) {\n if (texelFloat == 0.0) return vec4(0.0, 0.0, 0.0, 0.0);\n float sign = texelFloat > 0.0 ? 0.0 : 1.0;\n texelFloat = abs(texelFloat);\n float exponent = floor(log2(texelFloat));\n float biased_exponent = exponent + 127.0;\n float fraction = ((texelFloat / exp2(exponent)) - 1.0) * 8388608.0;\n float t = biased_exponent / 2.0;\n float last_bit_of_biased_exponent = fract(t) * 2.0;\n float remaining_bits_of_biased_exponent = floor(t);\n float byte4 = extractBits(fraction, 0.0, 8.0) / 255.0;\n float byte3 = extractBits(fraction, 8.0, 16.0) / 255.0;\n float byte2 = (last_bit_of_biased_exponent * 128.0 + extractBits(fraction, 16.0, 23.0)) / 255.0;\n float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0;\n return (\n littleEndian\n ? vec4(byte4, byte3, byte2, byte1)\n : vec4(byte1, byte2, byte3, byte4)\n );\n }\n",light_frag_params:"\n#if dLightCount != 0\n uniform vec3 uLightDirection[dLightCount];\n uniform vec3 uLightColor[dLightCount];\n#endif\nuniform vec3 uAmbientColor;\n\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\n\nvec3 BRDF_Lambert(const in vec3 diffuseColor) {\n return RECIPROCAL_PI * diffuseColor;\n}\n\nvec3 F_Schlick(const in vec3 f0, const in float f90, const in float dotVH) {\n // Original approximation by Christophe Schlick '94\n // float fresnel = pow( 1.0 - dotVH, 5.0 );\n // Optimized variant (presented by Epic at SIGGRAPH '13)\n // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n float fresnel = exp2((-5.55473 * dotVH - 6.98316) * dotVH);\n return f0 * (1.0 - fresnel) + (f90 * fresnel);\n}\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat V_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) {\n float a2 = pow2(alpha);\n float gv = dotNL * sqrt(a2 + (1.0 - a2) * pow2(dotNV));\n float gl = dotNV * sqrt(a2 + (1.0 - a2) * pow2(dotNL));\n return 0.5 / max(gv + gl, EPSILON);\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is \"roughness squared\" in Disney\u2019s reparameterization\nfloat D_GGX(const in float alpha, const in float dotNH) {\n float a2 = pow2(alpha);\n float denom = pow2(dotNH) * (a2 - 1.0) + 1.0; // avoid alpha = 0 with dotNH = 1\n return RECIPROCAL_PI * a2 / pow2(denom);\n}\n\n// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility\nvec3 BRDF_GGX(const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness) {\n float alpha = pow2(roughness); // UE4's roughness\n vec3 halfDir = normalize( lightDir + viewDir);\n float dotNL = saturate(dot(normal, lightDir));\n float dotNV = saturate(dot(normal, viewDir));\n float dotNH = saturate(dot(normal, halfDir));\n float dotVH = saturate(dot(viewDir, halfDir));\n vec3 F = F_Schlick(f0, f90, dotVH);\n float V = V_GGX_SmithCorrelated(alpha, dotNL, dotNV);\n float D = D_GGX(alpha, dotNH);\n return F * (V * D);\n}\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via 'environmentBRDF' from \"Physically Based Shading on Mobile\"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 DFGApprox(const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n float dotNV = saturate(dot(normal, viewDir));\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022);\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04);\n vec4 r = roughness * c0 + c1;\n float a004 = min(r.x * r.x, exp2(-9.28 * dotNV)) * r.x + r.y;\n vec2 fab = vec2(-1.04, 1.04) * a004 + r.zw;\n return fab;\n}\n\n// Fdez-Ag\xfcera's \"Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting\"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid computeMultiscattering(const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter) {\n vec2 fab = DFGApprox(normal, viewDir, roughness);\n vec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = specularColor + (1.0 - specularColor) * 0.047619; // 1/21\n vec3 Fms = FssEss * Favg / (1.0 - Ems * Favg);\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n\nvoid RE_Direct_Physical(const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n float dotNL = saturate(dot(geometry.normal, directLight.direction));\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directSpecular += irradiance * BRDF_GGX(directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness);\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert(material.diffuseColor);\n}\n\nvoid RE_IndirectDiffuse_Physical(const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert(material.diffuseColor);\n}\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 // Both indirect specular and indirect diffuse light accumulate here\n vec3 singleScattering = vec3(0.0);\n vec3 multiScattering = vec3(0.0);\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n computeMultiscattering(geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering);\n vec3 diffuse = material.diffuseColor * (1.0 - ( singleScattering + multiScattering));\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n",matrix_scale:"\nfloat matrixScale(in mat4 m){\n vec4 r = m[0];\n return sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);\n}\n",normal_frag_params:"\nvarying vec3 vNormal;\n",read_from_texture:"\nvec4 readFromTexture(const in sampler2D tex, const in float i, const in vec2 dim) {\n float x = intMod(i, dim.x);\n float y = floor(intDiv(i, dim.x));\n vec2 uv = (vec2(x, y) + 0.5) / dim;\n return texture2D(tex, uv);\n}\n\nvec4 readFromTexture(const in sampler2D tex, const in int i, const in vec2 dim) {\n int x = imod(i, int(dim.x));\n int y = i / int(dim.x);\n vec2 uv = (vec2(x, y) + 0.5) / dim;\n return texture2D(tex, uv);\n}\n",rgba_to_float:'\n // rgbaToFloat adapted from https://github.com/ihmeuw/glsl-rgba-to-float\n // BSD 3-Clause License\n //\n // Copyright (c) 2019, Institute for Health Metrics and Evaluation All rights reserved.\n // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n // - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n // - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n // - Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n //\n // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n // OF THE POSSIBILITY OF SUCH DAMAGE.\n\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n\n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n\n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n\n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n\n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n\n float rgbaToFloat(vec4 texelRGBA, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(texelRGBA, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n',size_vert_params:"\n#if defined(dSizeType_uniform)\n uniform float uSize;\n#elif defined(dSizeType_attribute)\n attribute float aSize;\n#elif defined(dSizeType_instance) || defined(dSizeType_group) || defined(dSizeType_groupInstance)\n uniform vec2 uSizeTexDim;\n uniform sampler2D tSize;\n#endif\n\nuniform float uSizeFactor;\n",texture3d_from_1d_trilinear:"\nvec4 texture3dFrom1dTrilinear(const in sampler2D tex, const in vec3 pos, const in vec3 gridDim, const in vec2 texDim, const in float offset) {\n float gdYZ = gridDim.z * gridDim.y;\n float gdZ = gridDim.z;\n vec3 p0 = floor(pos * gridDim);\n vec3 p1 = ceil(pos * gridDim);\n vec3 pd = (pos * gridDim - p0) / (p1 - p0);\n vec4 s000 = readFromTexture(tex, offset + p0.z + p0.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s100 = readFromTexture(tex, offset + p0.z + p0.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s001 = readFromTexture(tex, offset + p1.z + p0.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s101 = readFromTexture(tex, offset + p1.z + p0.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s010 = readFromTexture(tex, offset + p0.z + p1.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s110 = readFromTexture(tex, offset + p0.z + p1.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s011 = readFromTexture(tex, offset + p1.z + p1.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s111 = readFromTexture(tex, offset + p1.z + p1.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s00 = mix(s000, s100, pd.x);\n vec4 s01 = mix(s001, s101, pd.x);\n vec4 s10 = mix(s010, s110, pd.x);\n vec4 s11 = mix(s011, s111, pd.x);\n vec4 s0 = mix(s00, s10, pd.y);\n vec4 s1 = mix(s01, s11, pd.y);\n return mix(s0, s1, pd.z);\n}\n",texture3d_from_2d_linear:"\nvec4 texture3dFrom2dLinear(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) {\n float zSlice0 = floor(pos.z * gridDim.z);\n float column0 = intMod(zSlice0 * gridDim.x, texDim.x) / gridDim.x;\n float row0 = floor(intDiv(zSlice0 * gridDim.x, texDim.x));\n vec2 coord0 = (vec2(column0 * gridDim.x, row0 * gridDim.y) + (pos.xy * gridDim.xy)) / texDim;\n vec4 color0 = texture2D(tex, coord0);\n\n float zSlice1 = zSlice0 + 1.0;\n float column1 = intMod(zSlice1 * gridDim.x, texDim.x) / gridDim.x;\n float row1 = floor(intDiv(zSlice1 * gridDim.x, texDim.x));\n vec2 coord1 = (vec2(column1 * gridDim.x, row1 * gridDim.y) + (pos.xy * gridDim.xy)) / texDim;\n vec4 color1 = texture2D(tex, coord1);\n\n float delta0 = abs((pos.z * gridDim.z) - zSlice0);\n return mix(color0, color1, delta0);\n}\n",texture3d_from_2d_nearest:"\nvec4 texture3dFrom2dNearest(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) {\n float zSlice = floor(pos.z * gridDim.z + 0.5); // round to nearest z-slice\n float column = intMod(zSlice * gridDim.x, texDim.x) / gridDim.x;\n float row = floor(intDiv(zSlice * gridDim.x, texDim.x));\n vec2 coord = (vec2(column * gridDim.x, row * gridDim.y) + (pos.xy * gridDim.xy)) / texDim;\n return texture2D(tex, coord);\n}\n",wboit_write:"\n#if defined(dRenderVariant_colorWboit)\n if (uRenderMask == MaskOpaque) {\n if (preFogAlpha < 1.0) {\n discard;\n }\n } else if (uRenderMask == MaskTransparent) {\n if (preFogAlpha != 1.0 && fragmentDepth < getDepth(gl_FragCoord.xy / uDrawingBufferSize)) {\n #ifdef dTransparentBackfaces_off\n if (interior) discard;\n #endif\n float alpha = gl_FragColor.a;\n float wboitWeight = alpha * clamp(pow(1.0 - fragmentDepth, 2.0), 0.01, 1.0);\n gl_FragColor = vec4(gl_FragColor.rgb * alpha * wboitWeight, alpha);\n // extra alpha is to handle pre-multiplied alpha\n #ifndef dGeometryType_directVolume\n gl_FragData[1] = vec4((uTransparentBackground ? alpha : 1.0) * alpha * wboitWeight);\n #else\n gl_FragData[1] = vec4(alpha * alpha * wboitWeight);\n #endif\n } else {\n discard;\n }\n }\n#endif\n",dpoit_write:"\n#if defined(dRenderVariant_colorDpoit)\n if (uRenderMask == MaskOpaque) {\n if (preFogAlpha < 1.0) {\n discard;\n }\n } else if (uRenderMask == MaskTransparent) {\n vec2 coords = gl_FragCoord.xy / uDrawingBufferSize;\n if (preFogAlpha != 1.0 && fragmentDepth < getDepth(coords)) {\n #ifdef dTransparentBackfaces_off\n if (interior) discard;\n #endif\n\n // adapted from https://github.com/tsherif/webgl2examples\n // The MIT License, Copyright 2017 Tarek Sherif, Shuai Shao\n\n vec2 lastDepth = texture2D(tDpoitDepth, coords).rg;\n vec4 lastFrontColor = texture2D(tDpoitFrontColor, coords);\n\n vec4 fragColor = gl_FragColor;\n\n // depth value always increases\n // so we can use MAX blend equation\n gl_FragData[2].rg = vec2(-MAX_DPOIT_DEPTH);\n\n // front color always increases\n // so we can use MAX blend equation\n gl_FragColor = lastFrontColor;\n\n // back color is separately blend afterwards each pass\n gl_FragData[1] = vec4(0.0);\n\n float nearestDepth = -lastDepth.x;\n float furthestDepth = lastDepth.y;\n float alphaMultiplier = 1.0 - lastFrontColor.a;\n\n if (fragmentDepth < nearestDepth || fragmentDepth > furthestDepth) {\n // Skip this depth since it's been peeled.\n return;\n }\n\n if (fragmentDepth > nearestDepth && fragmentDepth < furthestDepth) {\n // This needs to be peeled.\n // The ones remaining after MAX blended for\n // all need-to-peel will be peeled next pass.\n gl_FragData[2].rg = vec2(-fragmentDepth, fragmentDepth);\n return;\n }\n\n // write to back and front color buffer\n if (fragmentDepth == nearestDepth) {\n gl_FragColor.rgb += fragColor.rgb * fragColor.a * alphaMultiplier;\n gl_FragColor.a = 1.0 - alphaMultiplier * (1.0 - fragColor.a);\n } else {\n gl_FragData[1] += fragColor;\n }\n\n } else {\n discard;\n }\n }\n#endif\n"},AMe=/^(?!\/\/)\s*#include\s+(\S+)/gm,TMe=/#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,DMe=/[ \t]*\/\/.*\n/g,EMe=/[ \t]*\/\*[\s\S]*?\*\//g,IMe=/\n{2,}/g;function dX(e){return e.replace(AMe,function(t,r){var n=wMe[r];if(!n)throw new Error("empty chunk, '".concat(r,"'"));return n}).trim().replace(DMe,"\n").replace(EMe,"\n").replace(IMe,"\n")}function MMe(e,t,r,n){for(var a="",i=parseInt(t);i radius) discard;\n #elif defined(dPointStyle_fuzzy)\n float dist = distance(gl_PointCoord, center);\n float fuzzyAlpha = 1.0 - smoothstep(0.0, radius, dist);\n if (fuzzyAlpha < 0.0001) discard;\n #endif\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n gl_FragColor = material;\n\n #if defined(dPointStyle_fuzzy)\n gl_FragColor.a *= fuzzyAlpha;\n #endif\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},dA),FMe=Fn("spheres","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform mat4 uModelView;\nuniform mat4 uInvProjection;\nuniform float uIsOrtho;\n\nuniform vec2 uTexDim;\nuniform sampler2D tPositionGroup;\n\nattribute mat4 aTransform;\nattribute float aInstance;\n\nvarying float vRadius;\nvarying vec3 vPoint;\nvarying vec3 vPointViewPosition;\n\n#include matrix_scale\n\n/**\n * Bounding rectangle of a clipped, perspective-projected 3D Sphere.\n * Michael Mara, Morgan McGuire. 2013\n *\n * Specialization by Arseny Kapoulkine, MIT License Copyright (c) 2018\n * https://github.com/zeux/niagara\n */\nvoid sphereProjection(const in vec3 p, const in float r, const in vec2 mapping) {\n vec3 pr = p * r;\n float pzr2 = p.z * p.z - r * r;\n\n float vx = sqrt(p.x * p.x + pzr2);\n float minx = ((vx * p.x - pr.z) / (vx * p.z + pr.x)) * uProjection[0][0];\n float maxx = ((vx * p.x + pr.z) / (vx * p.z - pr.x)) * uProjection[0][0];\n\n float vy = sqrt(p.y * p.y + pzr2);\n float miny = ((vy * p.y - pr.z) / (vy * p.z + pr.y)) * uProjection[1][1];\n float maxy = ((vy * p.y + pr.z) / (vy * p.z - pr.y)) * uProjection[1][1];\n\n gl_Position.xy = vec2(maxx + minx, maxy + miny) * -0.5;\n gl_Position.xy -= mapping * vec2(maxx - minx, maxy - miny) * 0.5;\n gl_Position.xy *= gl_Position.w;\n}\n\nvoid main(void){\n vec2 mapping = vec2(1.0, 1.0); // vertices 2 and 5\n #if __VERSION__ == 100\n int m = imod(VertexID, 6);\n #else\n int m = VertexID % 6;\n #endif\n if (m == 0) {\n mapping = vec2(-1.0, 1.0);\n } else if (m == 1 || m == 3) {\n mapping = vec2(-1.0, -1.0);\n } else if (m == 4) {\n mapping = vec2(1.0, -1.0);\n }\n\n vec4 positionGroup = readFromTexture(tPositionGroup, VertexID / 6, uTexDim);\n vec3 position = positionGroup.rgb;\n float group = positionGroup.a;\n\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n vRadius = size * matrixScale(uModelView);\n\n vec4 position4 = vec4(position, 1.0);\n vec4 mvPosition = uModelView * aTransform * position4;\n\n #ifdef dApproximate\n vec4 mvCorner = vec4(mvPosition.xyz, 1.0);\n mvCorner.xy += mapping * vRadius;\n gl_Position = uProjection * mvCorner;\n #else\n if (uIsOrtho == 1.0) {\n vec4 mvCorner = vec4(mvPosition.xyz, 1.0);\n mvCorner.xy += mapping * vRadius;\n gl_Position = uProjection * mvCorner;\n } else {\n gl_Position = uProjection * vec4(mvPosition.xyz, 1.0);\n sphereProjection(mvPosition.xyz, vRadius, mapping);\n }\n #endif\n\n vec4 vPoint4 = uInvProjection * gl_Position;\n vPoint = vPoint4.xyz / vPoint4.w;\n vPointViewPosition = -mvPosition.xyz / mvPosition.w;\n\n vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n if (gl_Position.z < -gl_Position.w) {\n mvPosition.z -= 2.0 * vRadius; // avoid clipping\n gl_Position.z = (uProjection * vec4(mvPosition.xyz, 1.0)).z;\n }\n\n #if defined(dClipPrimitive) && !defined(dClipVariant_instance) && dClipObjectCount != 0\n if (clipTest(vec4(vModelPosition.xyz, 0.0))) {\n // move out of [ -w, +w ] to 'discard' in vert shader\n gl_Position.z = 2.0 * gl_Position.w;\n }\n #else\n #include clip_instance\n #endif\n}\n","\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include common_clip\n\nuniform mat4 uInvView;\nuniform float uAlphaThickness;\n\nvarying float vRadius;\nvarying vec3 vPoint;\nvarying vec3 vPointViewPosition;\n\n#ifdef dSolidInterior\n const bool solidInterior = true;\n#else\n const bool solidInterior = false;\n#endif\n\nbool SphereImpostor(out vec3 modelPos, out vec3 cameraPos, out vec3 cameraNormal, out bool interior, out float fragmentDepth){\n vec3 cameraSpherePos = -vPointViewPosition;\n\n vec3 rayOrigin = mix(vec3(0.0, 0.0, 0.0), vPoint, uIsOrtho);\n vec3 rayDirection = mix(normalize(vPoint), vec3(0.0, 0.0, 1.0), uIsOrtho);\n vec3 cameraSphereDir = mix(cameraSpherePos, rayOrigin - cameraSpherePos, uIsOrtho);\n\n float B = dot(rayDirection, cameraSphereDir);\n float det = B * B + vRadius * vRadius - dot(cameraSphereDir, cameraSphereDir);\n\n if (det < 0.0) return false;\n\n float sqrtDet = sqrt(det);\n float posT = mix(B + sqrtDet, B - sqrtDet, uIsOrtho);\n float negT = mix(B - sqrtDet, B + sqrtDet, uIsOrtho);\n\n cameraPos = rayDirection * negT + rayOrigin;\n modelPos = (uInvView * vec4(cameraPos, 1.0)).xyz;\n fragmentDepth = calcDepth(cameraPos);\n\n bool objectClipped = false;\n\n #if !defined(dClipPrimitive) && defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPos, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n }\n #endif\n\n if (fragmentDepth > 0.0) {\n cameraNormal = normalize(cameraPos - cameraSpherePos);\n interior = false;\n return true;\n } else if (uDoubleSided || solidInterior) {\n cameraPos = rayDirection * posT + rayOrigin;\n modelPos = (uInvView * vec4(cameraPos, 1.0)).xyz;\n fragmentDepth = calcDepth(cameraPos);\n cameraNormal = -normalize(cameraPos - cameraSpherePos);\n interior = true;\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000001 / vRadius);\n cameraNormal = -mix(normalize(vPoint), vec3(0.0, 0.0, 1.0), uIsOrtho);\n }\n #endif\n return true;\n }\n }\n\n return false;\n}\n\nvoid main(void){\n vec3 cameraNormal;\n float fragmentDepth;\n\n #ifdef dApproximate\n vec3 pointDir = -vPointViewPosition - vPoint;\n if (dot(pointDir, pointDir) > vRadius * vRadius) discard;\n vec3 vViewPosition = -vPointViewPosition;\n fragmentDepth = gl_FragCoord.z;\n #if !defined(dIgnoreLight) || defined(dXrayShaded)\n pointDir.z -= cos(length(pointDir) / vRadius);\n cameraNormal = -normalize(pointDir / vRadius);\n #endif\n interior = false;\n #else\n vec3 modelPos;\n vec3 cameraPos;\n bool hit = SphereImpostor(modelPos, cameraPos, cameraNormal, interior, fragmentDepth);\n if (!hit) discard;\n\n if (fragmentDepth < 0.0) discard;\n if (fragmentDepth > 1.0) discard;\n\n gl_FragDepthEXT = fragmentDepth;\n\n vec3 vModelPosition = modelPos;\n vec3 vViewPosition = cameraPos;\n #endif\n\n #if !defined(dClipPrimitive) && defined(dClipVariant_pixel) && dClipObjectCount != 0\n #include clip_pixel\n #endif\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n vec3 normal = -cameraNormal;\n #include apply_light_color\n\n if (uRenderMask == MaskTransparent && uAlphaThickness > 0.0) {\n gl_FragColor.a *= min(1.0, vRadius / uAlphaThickness);\n }\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{fragDepth:"required",drawBuffers:"optional"},{},FS),BMe=Fn("cylinders","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform mat4 uModelView;\n\nattribute mat4 aTransform;\nattribute float aInstance;\nattribute float aGroup;\n\nattribute vec3 aMapping;\nattribute vec3 aStart;\nattribute vec3 aEnd;\nattribute float aScale;\nattribute float aCap;\n\nvarying mat4 vTransform;\nvarying vec3 vStart;\nvarying vec3 vEnd;\nvarying float vSize;\nvarying float vCap;\n\nuniform float uIsOrtho;\nuniform vec3 uCameraDir;\n\nvoid main() {\n #include assign_group\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n mat4 modelTransform = uModel * aTransform;\n\n vTransform = aTransform;\n vStart = (modelTransform * vec4(aStart, 1.0)).xyz;\n vEnd = (modelTransform * vec4(aEnd, 1.0)).xyz;\n vSize = size * aScale;\n vCap = aCap;\n\n vModelPosition = (vStart + vEnd) * 0.5;\n vec3 camDir = -mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho);\n vec3 dir = vEnd - vStart;\n // ensure cylinder 'dir' is pointing towards the camera\n if(dot(camDir, dir) < 0.0) {\n dir = -dir;\n }\n\n vec3 left = cross(camDir, dir);\n vec3 up = cross(left, dir);\n left = vSize * normalize(left);\n up = vSize * normalize(up);\n\n // move vertex in object-space from center to corner\n vModelPosition += aMapping.x * dir + aMapping.y * left + aMapping.z * up;\n\n vec4 mvPosition = uView * vec4(vModelPosition, 1.0);\n vViewPosition = mvPosition.xyz;\n gl_Position = uProjection * mvPosition;\n\n if (gl_Position.z < -gl_Position.w) {\n mvPosition.z -= 2.0 * (length(vEnd - vStart) + vSize); // avoid clipping\n gl_Position.z = (uProjection * mvPosition).z;\n }\n\n #include clip_instance\n}\n","\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\nuniform mat4 uView;\n\nvarying mat4 vTransform;\nvarying vec3 vStart;\nvarying vec3 vEnd;\nvarying float vSize;\nvarying float vCap;\n\nuniform vec3 uCameraDir;\nuniform vec3 uCameraPosition;\nuniform mat4 uInvView;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include common_clip\n\n#ifdef dSolidInterior\n const bool solidInterior = true;\n#else\n const bool solidInterior = false;\n#endif\n\n// adapted from https://www.shadertoy.com/view/4lcSRn\n// The MIT License, Copyright 2016 Inigo Quilez\nbool CylinderImpostor(\n in vec3 rayOrigin, in vec3 rayDir,\n in vec3 start, in vec3 end, in float radius,\n out vec3 cameraNormal, out bool interior,\n out vec3 modelPosition, out vec3 viewPosition, out float fragmentDepth\n){\n vec3 ba = end - start;\n vec3 oc = rayOrigin - start;\n\n float baba = dot(ba, ba);\n float bard = dot(ba, rayDir);\n float baoc = dot(ba, oc);\n\n float k2 = baba - bard * bard;\n float k1 = baba * dot(oc, rayDir) - baoc * bard;\n float k0 = baba * dot(oc, oc) - baoc * baoc - radius * radius * baba;\n\n float h = k1 * k1 - k2 * k0;\n if (h < 0.0) return false;\n\n bool topCap = (vCap > 0.9 && vCap < 1.1) || vCap >= 2.9;\n bool bottomCap = (vCap > 1.9 && vCap < 2.1) || vCap >= 2.9;\n\n #ifdef dSolidInterior\n bool topInterior = !topCap;\n bool bottomInterior = !bottomCap;\n topCap = true;\n bottomCap = true;\n #else\n bool topInterior = false;\n bool bottomInterior = false;\n #endif\n\n bool clipped = false;\n bool objectClipped = false;\n\n // body outside\n h = sqrt(h);\n float t = (-k1 - h) / k2;\n float y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = false;\n cameraNormal = (oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) return true;\n clipped = true;\n }\n\n if (!clipped) {\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = topInterior;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n return true;\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = bottomInterior;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n return true;\n }\n }\n }\n }\n\n if (uDoubleSided || solidInterior) {\n // body inside\n h = -h;\n t = (-k1 - h) / k2;\n y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = true;\n cameraNormal = -(oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n }\n }\n\n return false;\n}\n\nvoid main() {\n vec3 rayOrigin = vModelPosition;\n vec3 rayDir = mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho);\n\n vec3 cameraNormal;\n vec3 modelPosition;\n vec3 viewPosition;\n float fragmentDepth;\n bool hit = CylinderImpostor(rayOrigin, rayDir, vStart, vEnd, vSize, cameraNormal, interior, modelPosition, viewPosition, fragmentDepth);\n if (!hit) discard;\n\n if (fragmentDepth < 0.0) discard;\n if (fragmentDepth > 1.0) discard;\n\n gl_FragDepthEXT = fragmentDepth;\n\n vec3 vViewPosition = viewPosition;\n vec3 vModelPosition = modelPosition;\n\n #include clip_pixel\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n mat3 normalMatrix = transpose3(inverse3(mat3(uView)));\n vec3 normal = normalize(normalMatrix * -normalize(cameraNormal));\n #include apply_light_color\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{fragDepth:"required",drawBuffers:"optional"},{},FS),NMe=Fn("text","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform mat4 uModelView;\n\nattribute vec3 aPosition;\nattribute vec2 aMapping;\nattribute float aDepth;\nattribute vec2 aTexCoord;\nattribute mat4 aTransform;\nattribute float aInstance;\nattribute float aGroup;\n\nuniform float uOffsetX;\nuniform float uOffsetY;\nuniform float uOffsetZ;\n\nuniform float uIsOrtho;\nuniform float uPixelRatio;\nuniform vec4 uViewport;\n\nvarying vec2 vTexCoord;\n\n#include matrix_scale\n\nvoid main(void){\n #include assign_group\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n vTexCoord = aTexCoord;\n\n float scale = matrixScale(uModelView);\n\n float offsetX = uOffsetX * scale;\n float offsetY = uOffsetY * scale;\n float offsetZ = (uOffsetZ + aDepth * 0.95) * scale;\n\n vec4 position4 = vec4(aPosition, 1.0);\n vec4 mvPosition = uModelView * aTransform * position4;\n\n vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n // TODO\n // #ifdef FIXED_SIZE\n // if (ortho) {\n // scale /= pixelRatio * ((uViewport.w / 2.0) / -uCameraPosition.z) * 0.1;\n // } else {\n // scale /= pixelRatio * ((uViewport.w / 2.0) / -mvPosition.z) * 0.1;\n // }\n // #endif\n\n vec4 mvCorner = vec4(mvPosition.xyz, 1.0);\n\n if (vTexCoord.x == 10.0) { // indicates background plane\n // move a bit to the back, taking distance to camera into account to avoid z-fighting\n offsetZ -= 0.001 * distance(uCameraPosition, (uProjection * mvCorner).xyz);\n }\n\n mvCorner.xy += aMapping * size * scale;\n mvCorner.x += offsetX;\n mvCorner.y += offsetY;\n\n if (uIsOrtho == 1.0) {\n mvCorner.z += offsetZ;\n } else {\n mvCorner.xyz += normalize(-mvCorner.xyz) * offsetZ;\n }\n\n gl_Position = uProjection * mvCorner;\n\n vViewPosition = -mvCorner.xyz;\n\n #include clip_instance\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include common_clip\n\nuniform sampler2D tFont;\n\nuniform vec3 uBorderColor;\nuniform float uBorderWidth;\nuniform vec3 uBackgroundColor;\nuniform float uBackgroundOpacity;\n\nvarying vec2 vTexCoord;\n\nconst float smoothness = 32.0;\nconst float gamma = 2.2;\n\nvoid main2(){\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n\nvoid main(){\n #include clip_pixel\n\n float fragmentDepth = gl_FragCoord.z;\n #include assign_material_color\n\n if (vTexCoord.x > 1.0) {\n #if defined(dRenderVariant_color)\n material = vec4(uBackgroundColor, uBackgroundOpacity * material.a);\n #endif\n } else {\n // retrieve signed distance\n float sdf = texture2D(tFont, vTexCoord).a + uBorderWidth;\n\n // perform adaptive anti-aliasing of the edges\n float w = clamp(smoothness * (abs(dFdx(vTexCoord.x)) + abs(dFdy(vTexCoord.y))), 0.0, 0.5);\n float a = smoothstep(0.5 - w, 0.5 + w, sdf);\n\n // gamma correction for linear attenuation\n a = pow(a, 1.0 / gamma);\n\n if (a < 0.5) discard;\n\n #if defined(dRenderVariant_color)\n material.a *= a;\n\n // add border\n float t = 0.5 + uBorderWidth;\n if (uBorderWidth > 0.0 && sdf < t) {\n material.xyz = mix(uBorderColor, material.xyz, smoothstep(t - w, t, sdf));\n }\n #endif\n }\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n gl_FragColor = material;\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},dA),kMe=Fn("lines","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform float uPixelRatio;\nuniform vec4 uViewport;\n\nattribute mat4 aTransform;\nattribute float aInstance;\nattribute float aGroup;\n\nattribute vec2 aMapping;\nattribute vec3 aStart;\nattribute vec3 aEnd;\n\nvoid trimSegment(const in vec4 start, inout vec4 end) {\n // trim end segment so it terminates between the camera plane and the near plane\n // conservative estimate of the near plane\n float a = uProjection[2][2]; // 3rd entry in 3rd column\n float b = uProjection[3][2]; // 3rd entry in 4th column\n float nearEstimate = -0.5 * b / a;\n float alpha = (nearEstimate - start.z) / (end.z - start.z);\n end.xyz = mix(start.xyz, end.xyz, alpha);\n}\n\nvoid main(){\n float aspect = uViewport.z / uViewport.w;\n\n #include assign_group\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n mat4 modelView = uView * uModel * aTransform;\n\n // camera space\n vec4 start = modelView * vec4(aStart, 1.0);\n vec4 end = modelView * vec4(aEnd, 1.0);\n\n // assign position\n vec4 position4 = vec4((aMapping.y < 0.5) ? aStart : aEnd, 1.0);\n vec4 mvPosition = modelView * position4;\n vViewPosition = mvPosition.xyz;\n\n vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n // special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n // but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n // perhaps there is a more elegant solution -- WestLangley\n bool perspective = (uProjection[2][3] == -1.0); // 4th entry in the 3rd column\n if (perspective) {\n if (start.z < 0.0 && end.z >= 0.0) {\n trimSegment(start, end);\n } else if (end.z < 0.0 && start.z >= 0.0) {\n trimSegment(end, start);\n }\n }\n\n // clip space\n vec4 clipStart = uProjection * start;\n vec4 clipEnd = uProjection * end;\n\n // ndc space\n vec2 ndcStart = clipStart.xy / clipStart.w;\n vec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n // direction\n vec2 dir = ndcEnd - ndcStart;\n\n // account for clip-space aspect ratio\n dir.x *= aspect;\n dir = normalize(dir);\n\n // perpendicular to dir\n vec2 offset = vec2(dir.y, - dir.x);\n\n // undo aspect ratio adjustment\n dir.x /= aspect;\n offset.x /= aspect;\n\n // sign flip\n if (aMapping.x < 0.0) offset *= -1.0;\n\n // calculate linewidth\n float linewidth;\n #ifdef dLineSizeAttenuation\n linewidth = size * uPixelRatio * ((uViewport.w / 2.0) / -start.z) * 5.0;\n #else\n linewidth = size * uPixelRatio;\n #endif\n linewidth = max(1.0, linewidth);\n\n // adjust for linewidth\n offset *= linewidth;\n\n // adjust for clip-space to screen-space conversion\n offset /= uViewport.w;\n\n // select end\n vec4 clip = (aMapping.y < 0.5) ? clipStart : clipEnd;\n\n // back to clip space\n offset *= clip.w;\n clip.xy += offset;\n gl_Position = clip;\n\n #include clip_instance\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include common_clip\n\nvoid main(){\n #include clip_pixel\n\n float fragmentDepth = gl_FragCoord.z;\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n gl_FragColor = material;\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},dA),pX=Fn("mesh","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include common_clip\n#include texture3d_from_2d_linear\n\n#ifdef dGeometryType_textureMesh\n uniform vec2 uGeoTexDim;\n uniform sampler2D tPosition;\n uniform sampler2D tGroup;\n uniform sampler2D tNormal;\n#else\n attribute vec3 aPosition;\n attribute float aGroup;\n attribute vec3 aNormal;\n#endif\nattribute mat4 aTransform;\nattribute float aInstance;\n\nvarying vec3 vNormal;\n\nvoid main(){\n #include assign_group\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_position\n #include assign_color_varying\n #include clip_instance\n\n #ifdef dGeometryType_textureMesh\n vec3 normal = readFromTexture(tNormal, VertexID, uGeoTexDim).xyz;\n #else\n vec3 normal = aNormal;\n #endif\n mat3 normalMatrix = transpose3(inverse3(mat3(modelView)));\n vec3 transformedNormal = normalize(normalMatrix * normalize(normal));\n #if defined(dFlipSided)\n if (!uDoubleSided) { // TODO checking uDoubleSided should not be required, ASR\n transformedNormal = -transformedNormal;\n }\n #endif\n vNormal = transformedNormal;\n}\n","\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include normal_frag_params\n#include common_clip\n\nvoid main() {\n #include clip_pixel\n\n // Workaround for buggy gl_FrontFacing (e.g. on some integrated Intel GPUs)\n vec3 fdx = dFdx(vViewPosition);\n vec3 fdy = dFdy(vViewPosition);\n vec3 faceNormal = normalize(cross(fdx,fdy));\n bool frontFacing = dot(vNormal, faceNormal) > 0.0;\n\n #if defined(dFlipSided)\n interior = frontFacing;\n #else\n interior = !frontFacing;\n #endif\n\n float fragmentDepth = gl_FragCoord.z;\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n #if defined(dFlatShaded)\n vec3 normal = -faceNormal;\n #else\n vec3 normal = -normalize(vNormal);\n if (uDoubleSided) normal *= float(frontFacing) * 2.0 - 1.0;\n #endif\n #include apply_light_color\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},FS),LMe=Fn("direct-volume","\nprecision highp float;\n\nattribute vec3 aPosition;\nattribute mat4 aTransform;\nattribute float aInstance;\n\nuniform mat4 uModelView;\nuniform mat4 uProjection;\nuniform vec4 uInvariantBoundingSphere;\n\nvarying vec3 vOrigPos;\nvarying float vInstance;\nvarying vec4 vBoundingSphere;\nvarying mat4 vTransform;\n\nuniform vec3 uBboxSize;\nuniform vec3 uBboxMin;\nuniform vec3 uBboxMax;\nuniform vec3 uGridDim;\nuniform mat4 uTransform;\n\nuniform mat4 uUnitToCartn;\n\nvoid main() {\n vec4 unitCoord = vec4(aPosition + vec3(0.5), 1.0);\n vec4 mvPosition = uModelView * aTransform * uUnitToCartn * unitCoord;\n\n vOrigPos = (aTransform * uUnitToCartn * unitCoord).xyz;\n vInstance = aInstance;\n vBoundingSphere = vec4(\n (aTransform * vec4(uInvariantBoundingSphere.xyz, 1.0)).xyz,\n uInvariantBoundingSphere.w\n );\n vTransform = aTransform;\n\n gl_Position = uProjection * mvPosition;\n\n // move z position to near clip plane (but not too close to get precision issues)\n gl_Position.z = gl_Position.w - 0.01;\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include light_frag_params\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n#endif\n#include common_clip\n\n#include read_from_texture\n#include texture3d_from_1d_trilinear\n#include texture3d_from_2d_nearest\n#include texture3d_from_2d_linear\n\nuniform mat4 uProjection, uTransform, uModelView, uModel, uView;\nuniform vec3 uCameraDir;\n\nuniform sampler2D tDepth;\nuniform vec2 uDrawingBufferSize;\n\nvarying vec3 vOrigPos;\nvarying float vInstance;\nvarying vec4 vBoundingSphere;\nvarying mat4 vTransform;\n\nuniform mat4 uInvView;\nuniform vec3 uGridDim;\nuniform vec3 uBboxSize;\nuniform sampler2D tTransferTex;\nuniform float uTransferScale;\nuniform float uStepScale;\nuniform float uJumpLength;\n\nuniform int uObjectId;\nuniform int uVertexCount;\nuniform int uInstanceCount;\nuniform int uGroupCount;\n\n#if defined(dColorMarker)\n uniform vec3 uHighlightColor;\n uniform vec3 uSelectColor;\n uniform vec3 uDimColor;\n uniform float uHighlightStrength;\n uniform float uSelectStrength;\n uniform float uDimStrength;\n uniform int uMarkerPriority;\n uniform float uMarkerAverage;\n\n uniform float uMarker;\n uniform vec2 uMarkerTexDim;\n uniform sampler2D tMarker;\n#endif\n\nuniform float uMetalness;\nuniform float uRoughness;\n\nuniform bool uFog;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\n\nuniform float uAlpha;\nuniform bool uTransparentBackground;\nuniform float uXrayEdgeFalloff;\nuniform float uExposure;\n\nuniform int uRenderMask;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uIsOrtho;\n\nuniform vec3 uCellDim;\nuniform vec3 uCameraPosition;\nuniform mat4 uCartnToUnit;\n\n#if __VERSION__ != 100\n // for webgl1 this is given as a 'define'\n uniform int uMaxSteps;\n#endif\n\n#if defined(dGridTexType_2d)\n precision highp sampler2D;\n uniform sampler2D tGridTex;\n uniform vec3 uGridTexDim;\n#elif defined(dGridTexType_3d)\n precision highp sampler3D;\n uniform sampler3D tGridTex;\n#endif\n\n#if defined(dColorType_uniform)\n uniform vec3 uColor;\n#elif defined(dColorType_texture)\n uniform vec2 uColorTexDim;\n uniform sampler2D tColor;\n#endif\n\n#ifdef dOverpaint\n #if defined(dOverpaintType_groupInstance) || defined(dOverpaintType_vertexInstance)\n uniform vec2 uOverpaintTexDim;\n uniform sampler2D tOverpaint;\n #endif\n#endif\n\n#ifdef dUsePalette\n uniform sampler2D tPalette;\n#endif\n\n#if defined(dGridTexType_2d)\n vec4 textureVal(vec3 pos) {\n return texture3dFrom2dLinear(tGridTex, pos + (vec3(0.5, 0.5, 0.0) / uGridDim), uGridDim, uGridTexDim.xy);\n }\n vec4 textureGroup(vec3 pos) {\n return texture3dFrom2dNearest(tGridTex, pos + (vec3(0.5, 0.5, 0.0) / uGridDim), uGridDim, uGridTexDim.xy);\n }\n#elif defined(dGridTexType_3d)\n vec4 textureVal(vec3 pos) {\n return texture(tGridTex, pos + (vec3(0.5) / uGridDim));\n }\n vec4 textureGroup(vec3 pos) {\n return texelFetch(tGridTex, ivec3(pos * uGridDim), 0);\n }\n#endif\n\nfloat calcDepth(const in vec3 pos) {\n vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;\n return 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\n\nfloat transferFunction(float value) {\n return texture2D(tTransferTex, vec2(value, 0.0)).a;\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nconst float gradOffset = 0.5;\n\nvec3 v3m4(vec3 p, mat4 m) {\n return (m * vec4(p, 1.0)).xyz;\n}\n\nfloat preFogAlphaBlended = 0.0;\n\nvec4 raymarch(vec3 startLoc, vec3 step, vec3 rayDir) {\n mat3 normalMatrix = transpose3(inverse3(mat3(uModelView * vTransform)));\n mat4 cartnToUnit = uCartnToUnit * inverse4(vTransform);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n mat4 modelTransform = uModel * vTransform * uTransform;\n #endif\n mat4 modelViewTransform = uModelView * vTransform * uTransform;\n\n vec3 scaleVol = vec3(1.0) / uGridDim;\n vec3 pos = startLoc;\n vec4 cell;\n float prevValue = -1.0;\n float value = 0.0;\n vec4 src = vec4(0.0);\n vec4 dst = vec4(0.0);\n float fragmentDepth;\n\n vec3 posMin = vec3(0.0);\n vec3 posMax = vec3(1.0) - vec3(1.0) / uGridDim;\n\n vec3 unitPos;\n\n vec3 nextPos;\n float nextValue;\n\n vec4 material;\n vec4 overpaint;\n float metalness = uMetalness;\n float roughness = uRoughness;\n\n vec3 gradient = vec3(1.0);\n vec3 dx = vec3(gradOffset * scaleVol.x, 0.0, 0.0);\n vec3 dy = vec3(0.0, gradOffset * scaleVol.y, 0.0);\n vec3 dz = vec3(0.0, 0.0, gradOffset * scaleVol.z);\n\n float maxDist = min(vBoundingSphere.w * 2.0, uFar - uNear);\n float maxDistSq = maxDist * maxDist;\n\n for (int i = 0; i < uMaxSteps; ++i) {\n // break when beyond bounding-sphere or far-plane\n vec3 distVec = startLoc - pos;\n if (dot(distVec, distVec) > maxDistSq) break;\n\n unitPos = v3m4(pos, cartnToUnit);\n\n // continue when outside of grid\n if (unitPos.x > posMax.x || unitPos.y > posMax.y || unitPos.z > posMax.z ||\n unitPos.x < posMin.x || unitPos.y < posMin.y || unitPos.z < posMin.z\n ) {\n prevValue = value;\n pos += step;\n continue;\n }\n\n cell = textureVal(unitPos);\n value = cell.a; // current voxel value\n\n if (uJumpLength > 0.0 && value < 0.01) {\n nextPos = pos + rayDir * uJumpLength;\n nextValue = textureVal(v3m4(nextPos, cartnToUnit)).a;\n if (nextValue < 0.01) {\n prevValue = nextValue;\n pos = nextPos;\n continue;\n }\n }\n\n vec4 mvPosition = modelViewTransform * vec4(unitPos * uGridDim, 1.0);\n if (calcDepth(mvPosition.xyz) > getDepth(gl_FragCoord.xy / uDrawingBufferSize))\n break;\n\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n vec3 vModelPosition = v3m4(unitPos * uGridDim, modelTransform);\n if (clipTest(vec4(vModelPosition, 0.0))) {\n prevValue = value;\n pos += step;\n continue;\n }\n #endif\n\n vec3 vViewPosition = mvPosition.xyz;\n material.a = transferFunction(value);\n\n #ifdef dPackedGroup\n float group = unpackRGBToInt(textureGroup(floor(unitPos * uGridDim + 0.5) / uGridDim).rgb);\n #else\n vec3 g = floor(unitPos * uGridDim + 0.5);\n // note that we swap x and z because the texture is flipped around y\n #if defined(dAxisOrder_012)\n float group = g.z + g.y * uGridDim.z + g.x * uGridDim.z * uGridDim.y; // 210\n #elif defined(dAxisOrder_021)\n float group = g.y + g.z * uGridDim.y + g.x * uGridDim.y * uGridDim.z; // 120\n #elif defined(dAxisOrder_102)\n float group = g.z + g.x * uGridDim.z + g.y * uGridDim.z * uGridDim.x; // 201\n #elif defined(dAxisOrder_120)\n float group = g.x + g.z * uGridDim.x + g.y * uGridDim.x * uGridDim.z; // 021\n #elif defined(dAxisOrder_201)\n float group = g.y + g.x * uGridDim.y + g.z * uGridDim.y * uGridDim.x; // 102\n #elif defined(dAxisOrder_210)\n float group = g.x + g.y * uGridDim.x + g.z * uGridDim.x * uGridDim.y; // 012\n #endif\n #endif\n\n #if defined(dColorType_direct) && defined(dUsePalette)\n material.rgb = texture2D(tPalette, vec2(value, 0.0)).rgb;\n #elif defined(dColorType_uniform)\n material.rgb = uColor;\n #elif defined(dColorType_instance)\n material.rgb = readFromTexture(tColor, vInstance, uColorTexDim).rgb;\n #elif defined(dColorType_group)\n material.rgb = readFromTexture(tColor, group, uColorTexDim).rgb;\n #elif defined(dColorType_groupInstance)\n material.rgb = readFromTexture(tColor, vInstance * float(uGroupCount) + group, uColorTexDim).rgb;\n #elif defined(dColorType_vertex)\n material.rgb = texture3dFrom1dTrilinear(tColor, unitPos, uGridDim, uColorTexDim, 0.0).rgb;\n #elif defined(dColorType_vertexInstance)\n material.rgb = texture3dFrom1dTrilinear(tColor, unitPos, uGridDim, uColorTexDim, vInstance * float(uVertexCount)).rgb;\n #endif\n\n #ifdef dOverpaint\n #if defined(dOverpaintType_groupInstance)\n overpaint = readFromTexture(tOverpaint, vInstance * float(uGroupCount) + group, uOverpaintTexDim);\n #elif defined(dOverpaintType_vertexInstance)\n overpaint = texture3dFrom1dTrilinear(tOverpaint, unitPos, uGridDim, uOverpaintTexDim, vInstance * float(uVertexCount));\n #endif\n\n material.rgb = mix(material.rgb, overpaint.rgb, overpaint.a);\n #endif\n\n #ifdef dIgnoreLight\n gl_FragColor.rgb = material.rgb;\n #else\n if (material.a >= 0.01) {\n #ifdef dPackedGroup\n // compute gradient by central differences\n gradient.x = textureVal(unitPos - dx).a - textureVal(unitPos + dx).a;\n gradient.y = textureVal(unitPos - dy).a - textureVal(unitPos + dy).a;\n gradient.z = textureVal(unitPos - dz).a - textureVal(unitPos + dz).a;\n #else\n gradient = cell.xyz * 2.0 - 1.0;\n #endif\n vec3 normal = -normalize(normalMatrix * normalize(gradient));\n #include apply_light_color\n } else {\n gl_FragColor.rgb = material.rgb;\n }\n #endif\n\n gl_FragColor.a = material.a * uAlpha * uTransferScale;\n\n #if defined(dColorMarker)\n float marker = uMarker;\n if (uMarker == -1.0) {\n marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n #endif\n #include apply_marker_color\n\n preFogAlphaBlended = (1.0 - preFogAlphaBlended) * gl_FragColor.a + preFogAlphaBlended;\n fragmentDepth = calcDepth(mvPosition.xyz);\n #include apply_fog\n\n src = gl_FragColor;\n\n if (!uTransparentBackground) {\n // done in 'apply_fog' otherwise\n src.rgb *= src.a;\n }\n dst = (1.0 - dst.a) * src + dst; // standard blending\n\n // break if the color is opaque enough\n if (dst.a > 0.95)\n break;\n\n pos += step;\n }\n\n return dst;\n}\n\n// TODO: support float texture for higher precision values???\n// TODO: support clipping exclusion texture support\n\nvoid main() {\n if (gl_FrontFacing)\n discard;\n\n vec3 rayDir = mix(normalize(vOrigPos - uCameraPosition), uCameraDir, uIsOrtho);\n vec3 step = rayDir * uStepScale;\n\n float boundingSphereNear = distance(vBoundingSphere.xyz, uCameraPosition) - vBoundingSphere.w;\n float d = max(uNear, boundingSphereNear) - mix(0.0, distance(vOrigPos, uCameraPosition), uIsOrtho);\n vec3 start = mix(uCameraPosition, vOrigPos, uIsOrtho) + (d * rayDir);\n gl_FragColor = raymarch(start, step, rayDir);\n\n float fragmentDepth = calcDepth((uModelView * vec4(start, 1.0)).xyz);\n float preFogAlpha = clamp(preFogAlphaBlended, 0.0, 1.0);\n #include wboit_write\n}\n",{fragDepth:"optional",drawBuffers:"optional"},{},FS),UMe=Fn("image","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include common_vert_params\n\nattribute vec3 aPosition;\nattribute vec2 aUv;\nattribute mat4 aTransform;\nattribute float aInstance;\n\nvarying vec2 vUv;\nvarying float vInstance;\n\nvoid main() {\n #include assign_position\n\n vUv = aUv;\n vInstance = aInstance;\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_frag_params\n#include common_clip\n\nuniform vec2 uImageTexDim;\nuniform sampler2D tImageTex;\nuniform sampler2D tGroupTex;\n\nuniform vec2 uMarkerTexDim;\nuniform sampler2D tMarker;\n\nvarying vec2 vUv;\nvarying float vInstance;\n\n#if defined(dInterpolation_catmulrom) || defined(dInterpolation_mitchell) || defined(dInterpolation_bspline)\n #define dInterpolation_cubic\n#endif\n\n#if defined(dInterpolation_cubic)\n #if defined(dInterpolation_catmulrom) || defined(dInterpolation_mitchell)\n #if defined(dInterpolation_catmulrom)\n const float B = 0.0;\n const float C = 0.5;\n #elif defined(dInterpolation_mitchell)\n const float B = 0.333;\n const float C = 0.333;\n #endif\n\n float cubicFilter(float x){\n float f = x;\n if (f < 0.0) {\n f = -f;\n }\n if (f < 1.0) {\n return ((12.0 - 9.0 * B - 6.0 * C) * (f * f * f) +\n (-18.0 + 12.0 * B + 6.0 * C) * (f * f) +\n (6.0 - 2.0 * B)) / 6.0;\n }else if (f >= 1.0 && f < 2.0){\n return ((-B - 6.0 * C) * ( f * f * f)\n + (6.0 * B + 30.0 * C) * (f * f) +\n (-(12.0 * B) - 48.0 * C) * f +\n 8.0 * B + 24.0 * C) / 6.0;\n }else{\n return 0.0;\n }\n }\n #elif defined(dInterpolation_bspline)\n float cubicFilter(float x) {\n float f = x;\n if (f < 0.0) {\n f = -f;\n }\n if (f >= 0.0 && f <= 1.0){\n return (2.0 / 3.0) + (0.5) * (f * f * f) - (f * f);\n } else if (f > 1.0 && f <= 2.0) {\n return 1.0 / 6.0 * pow((2.0 - f), 3.0);\n }\n return 1.0;\n }\n #endif\n\n vec4 biCubic(sampler2D tex, vec2 texCoord) {\n vec2 texelSize = 1.0 / uImageTexDim;\n texCoord -= texelSize / 2.0;\n vec4 nSum = vec4(0.0);\n float nDenom = 0.0;\n vec2 cell = fract(texCoord * uImageTexDim);\n for (float m = -1.0; m <= 2.0; ++m) {\n for (float n = -1.0; n <= 2.0; ++n) {\n vec4 vecData = texture2D(tex, texCoord + texelSize * vec2(m, n));\n float c = cubicFilter(m - cell.x) * cubicFilter(-n + cell.y);\n nSum += vecData * c;\n nDenom += c;\n }\n }\n return nSum / nDenom;\n }\n#endif\n\nvoid main() {\n #include clip_pixel\n\n #if defined(dInterpolation_cubic)\n vec4 imageData = biCubic(tImageTex, vUv);\n #else\n vec4 imageData = texture2D(tImageTex, vUv);\n #endif\n imageData.a = clamp(imageData.a, 0.0, 1.0);\n if (imageData.a > 0.9) imageData.a = 1.0;\n\n float fragmentDepth = gl_FragCoord.z;\n\n #if defined(dRenderVariant_pick)\n if (imageData.a < 0.3)\n discard;\n #ifdef requiredDrawBuffers\n gl_FragColor = vec4(packIntToRGB(float(uObjectId)), 1.0);\n gl_FragData[1] = vec4(packIntToRGB(vInstance), 1.0);\n gl_FragData[2] = vec4(texture2D(tGroupTex, vUv).rgb, 1.0);\n gl_FragData[3] = packDepthToRGBA(gl_FragCoord.z);\n #else\n gl_FragColor = vColor;\n if (uPickType == 1) {\n gl_FragColor = vec4(packIntToRGB(float(uObjectId)), 1.0);\n } else if (uPickType == 2) {\n gl_FragColor = vec4(packIntToRGB(vInstance), 1.0);\n } else {\n gl_FragColor = vec4(texture2D(tGroupTex, vUv).rgb, 1.0);\n }\n #endif\n #elif defined(dRenderVariant_depth)\n if (imageData.a < 0.05)\n discard;\n gl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n #elif defined(dRenderVariant_marking)\n float marker = uMarker;\n if (uMarker == -1.0) {\n float group = unpackRGBToInt(texture2D(tGroupTex, vUv).rgb);\n marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n if (uMarkingType == 1) {\n if (marker > 0.0 || imageData.a < 0.05)\n discard;\n gl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n } else {\n if (marker == 0.0 || imageData.a < 0.05)\n discard;\n float depthTest = 1.0;\n if (uMarkingDepthTest) {\n depthTest = (fragmentDepth >= getDepthPacked(gl_FragCoord.xy / uDrawingBufferSize)) ? 1.0 : 0.0;\n }\n bool isHighlight = intMod(marker, 2.0) > 0.1;\n gl_FragColor = vec4(0.0, depthTest, isHighlight ? 1.0 : 0.0, 1.0);\n }\n #elif defined(dRenderVariant_color)\n if (imageData.a < 0.05)\n discard;\n gl_FragColor = imageData;\n gl_FragColor.a *= uAlpha;\n\n float marker = uMarker;\n if (uMarker == -1.0) {\n float group = unpackRGBToInt(texture2D(tGroupTex, vUv).rgb);\n marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},dA);function mX(e,t){var r;if(void 0===e)return"";var n=(null===(r=e.dRenderVariant)||void 0===r?void 0:r.ref.value)||"",a=[];for(var i in e)if(!t?.(i,n,e)){var s=e[i].ref.value;void 0!==s&&("string"==typeof s?a.push("#define ".concat(i,"_").concat(s)):"number"==typeof s?a.push("#define ".concat(i," ").concat(s)):"boolean"==typeof s?s&&a.push("#define ".concat(i)):Sn())}return a.join("\n")+"\n"}var zMe="\n#define attribute in\n#define varying out\n#define texture2D texture\n",HMe="\n#define varying in\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod\n\n#define gl_FragColor out_FragData0\n#define gl_FragDepthEXT gl_FragDepth\n\n#define depthTextureSupport\n";function XMe(e,t){switch(t){case"b":case"b[]":return e.BOOL;case"f":case"f[]":return e.FLOAT;case"i":case"i[]":return e.INT;case"v2":case"v2[]":return e.FLOAT_VEC2;case"v3":case"v3[]":return e.FLOAT_VEC3;case"v4":case"v4[]":return e.FLOAT_VEC4;case"iv2":case"iv2[]":return e.INT_VEC2;case"iv3":case"iv3[]":return e.INT_VEC3;case"iv4":case"iv4[]":return e.INT_VEC4;case"m3":case"m3[]":return e.FLOAT_MAT3;case"m4":case"m4[]":return e.FLOAT_MAT4;default:console.error("unknown uniform kind '".concat(t,"'"))}}function ZMe(e,t,r){e.uniform1f(t,r)}function QMe(e,t,r){e.uniform1fv(t,r)}function $Me(e,t,r){e.uniform1i(t,r)}function JMe(e,t,r){e.uniform1iv(t,r)}function eRe(e,t,r){e.uniform2fv(t,r)}function tRe(e,t,r){e.uniform3fv(t,r)}function rRe(e,t,r){e.uniform4fv(t,r)}function nRe(e,t,r){e.uniform2iv(t,r)}function aRe(e,t,r){e.uniform3iv(t,r)}function iRe(e,t,r){e.uniform4iv(t,r)}function oRe(e,t,r){e.uniformMatrix3fv(t,!1,r)}function sRe(e,t,r){e.uniformMatrix4fv(t,!1,r)}function hX(e){switch(e){case"f":return ZMe;case"f[]":return QMe;case"i":case"t":case"b":return $Me;case"i[]":case"t[]":case"b[]":return JMe;case"v2":case"v2[]":return eRe;case"v3":case"v3[]":return tRe;case"v4":case"v4[]":return rRe;case"iv2":case"iv2[]":return nRe;case"iv3":case"iv3[]":return aRe;case"iv4":case"iv4[]":return iRe;case"m3":case"m3[]":return oRe;case"m4":case"m4[]":return sRe}}var lRe=Jo();function vX(e){var t=e.createBuffer();if(null===t)throw new Error("Could not create WebGL buffer");return t}function gX(e,t,r,n){var a=vX(e),i=function dRe(e,t){switch(t){case"static":return e.STATIC_DRAW;case"dynamic":return e.DYNAMIC_DRAW;case"stream":return e.STREAM_DRAW}}(e,r),o=function pRe(e,t){switch(t){case"attribute":return e.ARRAY_BUFFER;case"elements":return e.ELEMENT_ARRAY_BUFFER;case"uniform":if($t(e))return e.UNIFORM_BUFFER;throw new Error("WebGL2 is required for uniform buffers")}}(e,n),s=function fRe(e,t){return t instanceof Uint8Array?e.UNSIGNED_BYTE:t instanceof Int8Array?e.BYTE:t instanceof Uint16Array?e.UNSIGNED_SHORT:t instanceof Int16Array?e.SHORT:t instanceof Uint32Array?e.UNSIGNED_INT:t instanceof Int32Array?e.INT:t instanceof Float32Array?e.FLOAT:void Sn()}(e,t),u=t.BYTES_PER_ELEMENT,c=t.length;function l(f){e.bindBuffer(o,a),e.bufferData(o,f,i)}l(t);var d=!1;return{id:lRe(),_usageHint:i,_bufferType:o,_dataType:s,_bpe:u,length:c,getBuffer:function(){return a},updateData:l,updateSubData:function(f,p,m){e.bindBuffer(o,a),m-p===f.length?e.bufferSubData(o,0,f):e.bufferSubData(o,p*u,f.subarray(p,p+m))},reset:function(){a=vX(e),l(t)},destroy:function(){d||(e.deleteBuffer(a),d=!0)}}}function mRe(e,t,r){if("float32"===t)switch(r){case 1:return e.FLOAT;case 2:return e.FLOAT_VEC2;case 3:return e.FLOAT_VEC3;case 4:return e.FLOAT_VEC4;case 16:return e.FLOAT_MAT4}Sn()}var yRe=Jo();function UF(e){var t=e.createProgram();if(null===t)throw new Error("Could not create WebGL program");return t}function _Re(e,t,r,n,a){var p,m,i=a.defineValues,o=a.shaderCode,s=a.schema,u=UF(e),c=yRe(),l=function YMe(e,t,r,n){var a=mX(r,n.ignoreDefine),i=mX(r,n.ignoreDefine),o=$t(e)?function jMe(e,t){var r=["#version 300 es"];if(t.drawBuffers&&e.drawBuffers&&r.push("#define requiredDrawBuffers"),t.clipCullDistance)if(e.clipCullDistance)r.push("#extension GL_ANGLE_clip_cull_distance : enable"),r.push("#define enabledClipCullDistance");else if("required"===t.clipCullDistance)throw new Error("required 'GL_ANGLE_clip_cull_distance' extension not available");if(t.conservativeDepth)if(e.conservativeDepth)r.push("#extension GL_EXT_conservative_depth : enable"),r.push("#define enabledConservativeDepth");else if("required"===t.conservativeDepth)throw new Error("required 'GL_EXT_conservative_depth' extension not available");return e.noNonInstancedActiveAttribs&&r.push("#define noNonInstancedActiveAttribs"),r.push(zMe),r.join("\n")+"\n"}(t,n.extensions):function VMe(e,t){var r=[];if(t.drawBuffers)if(e.drawBuffers)r.push("#define requiredDrawBuffers");else if("required"===t.drawBuffers)throw new Error("required 'GL_EXT_draw_buffers' extension not available");return r.join("\n")+"\n"}(t,n.extensions),s=$t(e)?function qMe(e,t,r,n){var a=["#version 300 es","layout(location = 0) out highp ".concat(n[0]||"vec4"," out_FragData0;")];if(r.fragDepth&&t.fragDepth&&a.push("#define enabledFragDepth"),r.drawBuffers&&t.drawBuffers){a.push("#define requiredDrawBuffers");for(var o=1,s=e.getParameter(e.MAX_DRAW_BUFFERS);o=16*t?r.transform.ref.value:new Float32Array(16*t);a.set(e),O.update(r.transform,a),O.updateIfChanged(r.uInstanceCount,t),O.updateIfChanged(r.instanceCount,t);var i=r.aTransform.ref.value.length>=16*t?r.aTransform.ref.value:new Float32Array(16*t);O.update(r.aTransform,i);var o=r.extraTransform.ref.value.length>=16*t?r.extraTransform.ref.value:new Float32Array(16*t);O.update(r.extraTransform,hA(o,t));var s=r.aInstance.ref.value.length>=t?r.aInstance.ref.value:new Float32Array(t);O.update(r.aInstance,Bu(s,t)),O.update(r.hasReflection,n)}else r={aTransform:O.create(new Float32Array(16*t)),matrix:O.create(he.identity()),transform:O.create(new Float32Array(e)),extraTransform:O.create(hA(new Float32Array(16*t),t)),uInstanceCount:O.create(t),instanceCount:O.create(t),aInstance:O.create(Bu(new Float32Array(t))),hasReflection:O.create(n)};return WX(r),r}var HF=new Float32Array(16);function jF(e){return zF(new Float32Array(HF),1,e)}function hA(e,t){for(var r=0;r1.2&&(n=2)),{resolution:r,stride:n}}}function ZX(e,t,r){return e.fill(0,4*t,4*r),!0}!function(e){e.MaterialCategory={category:"Material"},e.ShadingCategory={category:"Shading"},e.CustomQualityParamInfo={category:"Custom Quality",hideIf:function(o){return typeof o.quality<"u"&&"custom"!==o.quality}},e.Params={alpha:T.Numeric(1,{min:0,max:1,step:.01},{label:"Opacity",isEssential:!0,description:"How opaque/transparent the representation is rendered."}),quality:T.Select("auto",WF,{isEssential:!0,description:"Visual/rendering quality of the representation."}),material:as.getParam(),clip:T.Group(dm.Params),instanceGranularity:T.Boolean(!1,{description:"Use instance granularity for marker, transparency, clipping, overpaint, substance data to save memory."})},e.createSimple=function t(o,s,u){return void 0===o&&(o=vr.grey),void 0===s&&(s=1),u||(u=jF()),{transform:u,locationIterator:On(1,u.instanceCount.ref.value,1,function(){return Uu},!1,function(){return!1}),theme:{color:Kh(0,{value:o,lightness:0,saturation:0}),size:qF(0,{value:s})}}},e.createValues=function r(o,s){var u=dm.getClip(o.clip);return{alpha:O.create(o.alpha),uAlpha:O.create(o.alpha),uVertexCount:O.create(s.vertexCount),uGroupCount:O.create(s.groupCount),drawCount:O.create(s.drawCount),uMetalness:O.create(o.material.metalness),uRoughness:O.create(o.material.roughness),uBumpiness:O.create(o.material.bumpiness),dLightCount:O.create(1),dColorMarker:O.create(!0),dClipObjectCount:O.create(u.objects.count),dClipVariant:O.create(u.variant),uClipObjectType:O.create(u.objects.type),uClipObjectInvert:O.create(u.objects.invert),uClipObjectPosition:O.create(u.objects.position),uClipObjectRotation:O.create(u.objects.rotation),uClipObjectScale:O.create(u.objects.scale),instanceGranularity:O.create(o.instanceGranularity)}},e.updateValues=function n(o,s){O.updateIfChanged(o.alpha,s.alpha),O.updateIfChanged(o.uMetalness,s.material.metalness),O.updateIfChanged(o.uRoughness,s.material.roughness),O.updateIfChanged(o.uBumpiness,s.material.bumpiness);var u=dm.getClip(s.clip);O.updateIfChanged(o.dClipObjectCount,u.objects.count),O.updateIfChanged(o.dClipVariant,u.variant),O.update(o.uClipObjectType,u.objects.type),O.update(o.uClipObjectInvert,u.objects.invert),O.update(o.uClipObjectPosition,u.objects.position),O.update(o.uClipObjectRotation,u.objects.rotation),O.update(o.uClipObjectScale,u.objects.scale),O.updateIfChanged(o.instanceGranularity,s.instanceGranularity)},e.createRenderableState=function a(o){void 0===o&&(o={});var s=void 0===o.alpha||1===o.alpha;return{disposed:!1,visible:!0,alphaFactor:1,pickable:!0,colorOnly:!1,opaque:s,writeDepth:s}},e.updateRenderableState=function i(o,s){o.opaque=s.alpha*o.alphaFactor>=1,o.writeDepth=o.opaque}}(st||(st={}));var QX={array:new Uint8Array(4),width:1,height:1};function Pf(e){return e?(O.update(e.tOverpaint,QX),O.update(e.uOverpaintTexDim,Be.create(1,1)),e):{tOverpaint:O.create(QX),uOverpaintTexDim:O.create(Be.create(1,1)),dOverpaint:O.create(!1),tOverpaintGrid:O.create(Ao()),uOverpaintGridDim:O.create(b.create(1,1,1)),uOverpaintGridTransform:O.create(dr.create(0,0,0,1)),dOverpaintType:O.create("groupInstance"),uOverpaintStrength:O.create(1)}}function $X(e,t){if(0===t||e.length=3*M?I.normalBuffer.ref.value:new Float32Array(3*M);U===I.normalBuffer.ref.value&&U.fill(0,0,3*M),QY(N,j,U,M,F),O.update(I.normalBuffer,U)},e.checkForDuplicateVertices=function s(I,M){void 0===M&&(M=3);for(var F=I.vertexBuffer.ref.value,N=new Map,U=0,H=b(),z=0,G=I.vertexCount;zre)){var Q=F.get(je);if((!M[Q[0]].includes(Q[1])||null!==(j=F.get(Q[0]))&&void 0!==j&&j.includes(Q[1]))&&(b.fromArray(W,J,3*je),b.fromArray($,J,3*Q[0]),b.fromArray(K,J,3*Q[1]),b.sub(V,$,W),b.sub(ee,K,W),b.add(pe,V,ee),!(b.squaredDistance(W,$)>=N))){for(var ye=!1,we=0,De=M[je];we0?qe.add3(ne,je,Q[0],Q[1]):qe.add3(ne,Q[1],Q[0],je),te.add(je),te.add(Q[0]),te.add(Q[1]),Y+=1)}}}var Ne=qe.compact(ne);return I.triangleCount=Y,O.update(H,Ne),I}function C(I,M){var F=I.vertexCount,N=M.instanceCount.ref.value,j=lm(),U=j.position,H=I.vertexBuffer.ref.value,z=M.aTransform.ref.value;return On(F,N,1,function(J,X){return X<0?b.fromArray(U,H,3*J):b.transformMat4Offset(U,H,z,0,3*J,16*X),j})}function _(I,M,F,N,j){var U=F.instanceCount,H=F.groupCount,G=Vu(F,C(I,M),N.color),J=j.instanceGranularity?Ia(U,"instance"):Ia(U*H,"groupInstance"),X=Pf(),Z=Mf(),ne=Of(),Y=Rf(),k={drawCount:3*I.triangleCount,vertexCount:I.vertexCount,groupCount:H,instanceCount:U},W=Pe.clone(I.boundingSphere),$=Qi(W,M.aTransform.ref.value,U,0);return R(R(R(R(R(R(R(R(R({dGeometryType:O.create("mesh"),aPosition:I.vertexBuffer,aNormal:I.normalBuffer,aGroup:I.groupBuffer,elements:I.indexBuffer,dVaryingGroup:I.varyingGroup,boundingSphere:O.create($),invariantBoundingSphere:O.create(W),uInvariantBoundingSphere:O.create(dr.ofSphere(W))},G),J),X),Z),ne),Y),M),st.createValues(j,k)),{uDoubleSided:O.create(j.doubleSided),dFlatShaded:O.create(j.flatShaded),dFlipSided:O.create(j.flipSided),dIgnoreLight:O.create(j.ignoreLight),dXrayShaded:O.create("inverted"===j.xrayShaded?"inverted":!0===j.xrayShaded?"on":"off"),dTransparentBackfaces:O.create(j.transparentBackfaces),uBumpFrequency:O.create(j.bumpFrequency),uBumpAmplitude:O.create(j.bumpAmplitude),meta:O.create(I.meta)})}function E(I,M){st.updateRenderableState(I,M),I.opaque=I.opaque&&!M.xrayShaded,I.writeDepth=I.opaque}e.transform=function c(I,M){var F=I.vertexBuffer.ref.value;Wh(M,F,0,I.vertexCount),he.isTranslationAndUniformScaling(M)||function cPe(e,t,r,n){for(var a=0,i=3*n;a0&&y(!0),u&&n>0&&y(!1),{vertices:new Float32Array(f),normals:new Float32Array(p),indices:new Uint32Array(d)};function y(S){for(var C=!0===S?r:n,_=!0===S?1:-1,x=m,D=1;D<=i;++D)f.push(0,v*_,0),p.push(0,_,0),++m;var w=m;for(D=0;D<=i;++D){var E=D/i*l+c,I=Math.cos(E),M=Math.sin(E);f.push(C*M,v*_,C*I),p.push(0,_,0),++m}for(D=0;Da&&(this.currentX=0,this.currentY+=this.scratchH),this.currentY+this.scratchH>i)return console.warn("canvas to small"),this.placeholder;this.mapped[t]={x:this.currentX,y:this.currentY,w:this.scratchW,h:this.scratchH,nw:this.scratchW/this.lineHeight,nh:this.scratchH/this.lineHeight};for(var s=0;sa&&(a=c);var l=Math.abs(e[u+1]);l>a&&(a=l);var d=Math.abs(t[o]);d>i&&(i=d)}return Math.max(i,n+n*a)}!function(e){function t(p,m,h,v,g,y,S,C,_){return _?function i(p,m,h,v,g,y,S,C,_){return _.charCount=C,O.update(_.fontTexture,p),O.update(_.centerBuffer,m),O.update(_.mappingBuffer,h),O.update(_.depthBuffer,v),O.update(_.indexBuffer,g),O.update(_.groupBuffer,y),O.update(_.tcoordBuffer,S),_}(p,m,h,v,g,y,S,C,_):function a(p,m,h,v,g,y,S,C){var x,_=Pe(),D=-1,w=-1,A={kind:"text",charCount:C,fontTexture:O.create(p),centerBuffer:O.create(m),mappingBuffer:O.create(h),depthBuffer:O.create(v),indexBuffer:O.create(g),groupBuffer:O.create(y),tcoordBuffer:O.create(S),get boundingSphere(){var E=n(A);if(E!==D){var I=Ef(A.centerBuffer.ref.value,4*A.charCount,4);Pe.copy(_,I),D=E}return _},get groupMapping(){return A.groupBuffer.ref.version!==w&&(x=G0(A.groupBuffer.ref.value,A.charCount,4),w=A.groupBuffer.ref.version),x},setBoundingSphere:function(E){Pe.copy(_,E),D=n(A)}};return A}(p,m,h,v,g,y,S,C)}function r(p){return t(p?p.fontTexture.ref.value:gi(0,1,Uint8Array),p?p.centerBuffer.ref.value:new Float32Array(0),p?p.mappingBuffer.ref.value:new Float32Array(0),p?p.depthBuffer.ref.value:new Float32Array(0),p?p.indexBuffer.ref.value:new Uint32Array(0),p?p.groupBuffer.ref.value:new Float32Array(0),p?p.tcoordBuffer.ref.value:new Float32Array(0),0,p)}function n(p){return rs([p.charCount,p.fontTexture.ref.version,p.centerBuffer.ref.version,p.mappingBuffer.ref.version,p.depthBuffer.ref.version,p.indexBuffer.ref.version,p.groupBuffer.ref.version,p.tcoordBuffer.ref.version])}function o(p,m){var h=4*p.charCount,v=m.instanceCount.ref.value,g=lm(),y=g.position,S=p.centerBuffer.ref.value,C=m.aTransform.ref.value;return On(h,v,4,function(x,D){return D<0?b.fromArray(y,S,3*x):b.transformMat4Offset(y,S,C,0,3*x,16*D),g})}function s(p,m,h,v,g){var y=h.instanceCount,S=h.groupCount,_=Vu(h,o(p,m),v.color),x=Bf(h,v.size),D=g.instanceGranularity?Ia(y,"instance"):Ia(y*S,"groupInstance"),w=Pf(),A=Mf(),E=Of(),I=Rf(),M={drawCount:2*p.charCount*3,vertexCount:4*p.charCount,groupCount:S,instanceCount:y},F=DK(p.mappingBuffer.ref.value,p.depthBuffer.ref.value,p.charCount,zS(x)),N=Pe.expand(Pe(),p.boundingSphere,F),j=Qi(N,m.aTransform.ref.value,y,0);return R(R(R(R(R(R(R(R(R(R(R({dGeometryType:O.create("text"),aPosition:p.centerBuffer,aMapping:p.mappingBuffer,aDepth:p.depthBuffer,aGroup:p.groupBuffer,elements:p.indexBuffer,boundingSphere:O.create(j),invariantBoundingSphere:O.create(N),uInvariantBoundingSphere:O.create(dr.ofSphere(N))},_),x),D),w),A),E),I),m),{aTexCoord:p.tcoordBuffer,tFont:p.fontTexture,padding:O.create(F)}),st.createValues(g,M)),{uSizeFactor:O.create(g.sizeFactor),uBorderWidth:O.create(Xi(g.borderWidth,0,.5)),uBorderColor:O.create(dt.toArrayNormalized(g.borderColor,b.zero(),0)),uOffsetX:O.create(g.offsetX),uOffsetY:O.create(g.offsetY),uOffsetZ:O.create(g.offsetZ),uBackgroundColor:O.create(dt.toArrayNormalized(g.backgroundColor,b.zero(),0)),uBackgroundOpacity:O.create(g.backgroundOpacity)})}function f(p,m){st.updateRenderableState(p,m),p.pickable=!1,p.opaque=!1,p.writeDepth=!0}e.create=t,e.createEmpty=r,e.Params=R(R(R({},st.Params),TK),{sizeFactor:T.Numeric(1,{min:0,max:10,step:.1}),borderWidth:T.Numeric(0,{min:0,max:.5,step:.01}),borderColor:T.Color(vr.grey),offsetX:T.Numeric(0,{min:0,max:10,step:.1}),offsetY:T.Numeric(0,{min:0,max:10,step:.1}),offsetZ:T.Numeric(0,{min:0,max:10,step:.1}),background:T.Boolean(!1),backgroundMargin:T.Numeric(.2,{min:0,max:1,step:.01}),backgroundColor:T.Color(vr.grey),backgroundOpacity:T.Numeric(1,{min:0,max:1,step:.01}),tether:T.Boolean(!1),tetherLength:T.Numeric(1,{min:0,max:5,step:.1}),tetherBaseWidth:T.Numeric(.3,{min:0,max:1,step:.01}),attachment:T.Select("middle-center",[["bottom-left","bottom-left"],["bottom-center","bottom-center"],["bottom-right","bottom-right"],["middle-left","middle-left"],["middle-center","middle-center"],["middle-right","middle-right"],["top-left","top-left"],["top-center","top-center"],["top-right","top-right"]])}),e.Utils={Params:e.Params,createEmpty:r,createValues:s,createValuesSimple:function u(p,m,h,v,g){var y=st.createSimple(h,v,g),S=R(R({},T.getDefaultValues(e.Params)),m);return s(p,y.transform,y.locationIterator,y.theme,S)},updateValues:function c(p,m){st.updateValues(p,m),O.updateIfChanged(p.uSizeFactor,m.sizeFactor),O.updateIfChanged(p.uBorderWidth,m.borderWidth),dt.fromNormalizedArray(p.uBorderColor.ref.value,0)!==m.borderColor&&(dt.toArrayNormalized(m.borderColor,p.uBorderColor.ref.value,0),O.update(p.uBorderColor,p.uBorderColor.ref.value)),O.updateIfChanged(p.uOffsetX,m.offsetX),O.updateIfChanged(p.uOffsetY,m.offsetY),O.updateIfChanged(p.uOffsetZ,m.offsetZ),dt.fromNormalizedArray(p.uBackgroundColor.ref.value,0)!==m.backgroundColor&&(dt.toArrayNormalized(m.backgroundColor,p.uBackgroundColor.ref.value,0),O.update(p.uBackgroundColor,p.uBackgroundColor.ref.value)),O.updateIfChanged(p.uBackgroundOpacity,m.backgroundOpacity)},updateBoundingSphere:function l(p,m){var h=DK(p.aMapping.ref.value,p.aDepth.ref.value,m.charCount,zS(p)),v=Pe.expand(Pe(),m.boundingSphere,h),g=Qi(v,p.aTransform.ref.value,p.instanceCount.ref.value,0);Pe.equals(g,p.boundingSphere.ref.value)||O.update(p.boundingSphere,g),Pe.equals(v,p.invariantBoundingSphere.ref.value)||(O.update(p.invariantBoundingSphere,v),O.update(p.uInvariantBoundingSphere,dr.fromSphere(p.uInvariantBoundingSphere.ref.value,v))),O.update(p.padding,h)},createRenderableState:function d(p){var m=st.createRenderableState(p);return f(m,p),m},updateRenderableState:f,createPositionIterator:o}}(zu||(zu={}));var uu,na,ks=b(),bl=b(),HS=b(),EK=qe.add,_A=qe.add3;!function(e){e.create=function t(r,n,a){void 0===r&&(r=2048),void 0===n&&(n=1024);var i=qe.create(Float32Array,1,n,a?a.groupBuffer.ref.value:r),o=qe.create(Float32Array,3,n,a?a.startBuffer.ref.value:r),s=qe.create(Float32Array,3,n,a?a.endBuffer.ref.value:r),u=function(d,f,p,m,h,v,g){for(var y=0;y<4;++y)_A(o,d,f,p),_A(s,m,h,v),EK(i,g)},l=function(d,f,p,m){var h=b.distance(d,f),v=p%2!=0,g=Math.floor((p+1)/2),y=h/(p+.5);b.setMagnitude(HS,b.sub(HS,f,d),y),b.copy(ks,d);for(var S=0;Sa.lineCount)&&function jFe(e,t,r){for(var n=0;nS.lineCount&&(O.update(S.mappingBuffer,p),O.update(S.indexBuffer,m)),S.lineCount=y,O.update(S.groupBuffer,h),O.update(S.startBuffer,v),O.update(S.endBuffer,g),S}(p,m,h,v,g,y,S):function i(p,m,h,v,g,y){var C,S=Pe(),_=-1,x=-1,D={kind:"lines",lineCount:y,mappingBuffer:O.create(p),indexBuffer:O.create(m),groupBuffer:O.create(h),startBuffer:O.create(v),endBuffer:O.create(g),get boundingSphere(){var w=a(D);if(w!==_){var A=Ef(D.startBuffer.ref.value,4*D.lineCount,4),E=Ef(D.endBuffer.ref.value,4*D.lineCount,4);Pe.expandBySphere(S,A,E),_=w}return S},get groupMapping(){return D.groupBuffer.ref.version!==x&&(C=G0(D.groupBuffer.ref.value,D.lineCount,4),x=D.groupBuffer.ref.version),C},setBoundingSphere:function(w){Pe.copy(S,w),_=a(D)}};return D}(p,m,h,v,g,y)}function r(p){return t(p?p.mappingBuffer.ref.value:new Float32Array(0),p?p.indexBuffer.ref.value:new Uint32Array(0),p?p.groupBuffer.ref.value:new Float32Array(0),p?p.startBuffer.ref.value:new Float32Array(0),p?p.endBuffer.ref.value:new Float32Array(0),0,p)}function a(p){return rs([p.lineCount,p.mappingBuffer.ref.version,p.indexBuffer.ref.version,p.groupBuffer.ref.version,p.startBuffer.ref.version,p.endBuffer.ref.version])}function u(p,m){var h=4*p.lineCount,v=m.instanceCount.ref.value,g=lm(),y=g.position,S=p.startBuffer.ref.value,C=p.endBuffer.ref.value,_=m.aTransform.ref.value;return On(h,v,2,function(D,w){var A=D%4==0?S:C;return w<0?b.fromArray(y,A,3*D):b.transformMat4Offset(y,A,_,0,3*D,16*w),g})}function c(p,m,h,v,g){var y=h.instanceCount,S=h.groupCount,_=Vu(h,u(p,m),v.color),x=Bf(h,v.size),D=g.instanceGranularity?Ia(y,"instance"):Ia(y*S,"groupInstance"),w=Pf(),A=Mf(),E=Of(),I=Rf(),M={drawCount:2*p.lineCount*3,vertexCount:4*p.lineCount,groupCount:S,instanceCount:y},F=Pe.clone(p.boundingSphere),N=Qi(F,m.aTransform.ref.value,y,0);return R(R(R(R(R(R(R(R(R(R({dGeometryType:O.create("lines"),aMapping:p.mappingBuffer,aGroup:p.groupBuffer,aStart:p.startBuffer,aEnd:p.endBuffer,elements:p.indexBuffer,boundingSphere:O.create(N),invariantBoundingSphere:O.create(F),uInvariantBoundingSphere:O.create(dr.ofSphere(F))},_),x),D),w),A),E),I),m),st.createValues(g,M)),{uSizeFactor:O.create(g.sizeFactor),dLineSizeAttenuation:O.create(g.lineSizeAttenuation),uDoubleSided:O.create(!0),dFlipSided:O.create(!1)})}e.create=t,e.createEmpty=r,e.fromMesh=function n(p,m){for(var h=p.vertexBuffer.ref.value,v=p.indexBuffer.ref.value,g=p.groupBuffer.ref.value,y=uu.create(3*p.triangleCount,p.triangleCount/10,m),S=0,C=3*p.triangleCount;S=t?u=t-1:u<0&&(u=0),i[u]++}return{min:r,max:n,binWidth:a,counts:i}}function Hu(e){return e}!function(e){e.One={transform:{kind:"matrix",matrix:he.identity()},cells:Sr.create(Sr.Space([1,1,1],[0,1,2]),Sr.Data1([0])),stats:{min:0,max:0,mean:0,sigma:0}};var t=he.zero(),r=he.zero();e.getGridToCartesianTransform=function n(u){if("matrix"===u.transform.kind)return he.copy(he(),u.transform.matrix);if("spacegroup"===u.transform.kind){var c=u.cells.space,l=he.fromScaling(t,b.div(b.zero(),Nt.size(b.zero(),u.transform.fractionalBox),b.ofArray(c.dimensions))),d=he.fromTranslation(r,u.transform.fractionalBox.min);return he.mul3(he.zero(),u.transform.cell.fromFractional,d,l)}return he.identity()},e.areEquivalent=function a(u,c){return u===c},e.isEmpty=function i(u){return 0===u.cells.data.length},e.getBoundingSphere=function o(u,c){c||(c=Pe());var l=u.cells.space.dimensions,d=e.getGridToCartesianTransform(u);return Pe.fromDimensionsAndTransform(c,l,d)},e.getHistogram=function s(u,c){var l=u._historams;return l||(l=u._historams={}),l[c]||(l[c]=function WFe(e,t,r){if(r)return OK(e,t,r.min,r.max);var n=Fu(e);return OK(e,t,n[0],n[1])}(u.cells.data,c,{min:u.stats.min,max:u.stats.max})),l[c]}}(Ri||(Ri={})),function(e){e.getUUID=function t(r){return r.__key||(r.__key=kn.create22()),r.__key}}(Hu||(Hu={}));var wA,AA,nt,Sl=function(){function e(){this._list=[],this._set=new Set,this._refs=new Map,this._assets=new Map}return Object.defineProperty(e.prototype,"all",{get:function(){return this._list},enumerable:!1,configurable:!0}),e.prototype.add=function(t){this._set.has(t)||(this._list.push(t),this._set.add(t))},e.prototype.reference=function(t,r){var n=this._refs.get(t)||0;this._refs.set(t,Math.max(n+=r?1:-1,0))},e.prototype.hasReference=function(t){return(this._refs.get(t)||0)>0},e.prototype.has=function(t){return this._set.has(t)},e.prototype.assets=function(t,r){var n=this._assets.get(t);if(n)for(var a=0,i=n;a_&&(E=e.IsoValue.absolute(_)):g.relativeValueA&&(E=e.IsoValue.relative(A)),T.Conditioned(E,{absolute:T.Converted(function(I){return e.IsoValue.toAbsolute(I,Ri.One.stats).absoluteValue},function(I){return e.IsoValue.absolute(I)},T.Numeric(x,{min:C,max:_,step:iY(D/100,2)},{immediateUpdate:!0})),relative:T.Converted(function(I){return e.IsoValue.toRelative(I,Ri.One.stats).relativeValue},function(I){return e.IsoValue.relative(I)},T.Numeric(Math.min(1,A),{min:w,max:A,step:iY(Math.round((_-C)/D)/100,2)},{immediateUpdate:!0}))},function(I){return"absolute"===I.kind?"absolute":"relative"},function(I,M){return"absolute"===M?e.IsoValue.toAbsolute(I,S):e.IsoValue.toRelative(I,S)},{isEssential:!0})}e.createIsoValueParam=i,e.IsoValueParam=i(e.IsoValue.relative(2)),e.One={label:"",grid:Ri.One,sourceData:{kind:"",name:"",data:{}},customProperties:new Sl,_propertyData:Object.create(null)},e.areEquivalent=function o(g,y){return Ri.areEquivalent(g.grid,y.grid)},e.isEmpty=function s(g){return Ri.isEmpty(g.grid)},e.isOrbitals=function u(g){return!!wA.is(g.sourceData)&&g.sourceData.data.header.orbitals},e.Loci=function c(g){return{kind:"volume-loci",volume:g}},e.isLoci=function l(g){return!!g&&"volume-loci"===g.kind},e.areLociEqual=function d(g,y){return g.volume===y.volume},e.isLociEmpty=function f(g){return Ri.isEmpty(g.volume.grid)},e.getBoundingSphere=function p(g,y){return Ri.getBoundingSphere(g.grid,y)},function(g){g.Loci=function y(w,A){return{kind:"isosurface-loci",volume:w,isoValue:A}},g.isLoci=function S(w){return!!w&&"isosurface-loci"===w.kind},g.areLociEqual=function C(w,A){return w.volume===A.volume&&e.IsoValue.areSame(w.isoValue,A.isoValue,w.volume.grid.stats)},g.isLociEmpty=function _(w){return 0===w.volume.grid.cells.data.length};var x=Nt();g.getBoundingSphere=function D(w,A,E){for(var I=e.IsoValue.toAbsolute(A,w.grid.stats).absoluteValue,M=I<0,F=[0,0,0],N=w.grid.cells.space.getCoords,j=w.grid.cells.data,U=w.grid.cells.space.dimensions,J=U[0]-1,X=U[1]-1,Z=U[2]-1,ne=0,Y=0,k=0,W=0,$=j.length;W<$;++W)(M&&j[W]<=I||!M&&j[W]>=I)&&(N(W,F),F[0]ne&&(ne=F[0]),F[1]>Y&&(Y=F[1]),F[2]>k&&(k=F[2]));b.set(x.min,J-1,X-1,Z-1),b.set(x.max,ne+1,Y+1,k+1);var K=Ri.getGridToCartesianTransform(w.grid);return Nt.transform(x,x,K),Pe.fromBox3D(E||Pe(),x)}}(e.Isosurface||(e.Isosurface={})),function(g){g.Loci=function y(A,E){return{kind:"cell-loci",volume:A,indices:E}},g.isLoci=function S(A){return!!A&&"cell-loci"===A.kind},g.areLociEqual=function C(A,E){return A.volume===E.volume&&ke.areEqual(A.indices,E.indices)},g.isLociEmpty=function _(A){return 0===ke.size(A.indices)};var x=new Lu("98"),D=b();g.getBoundingSphere=function w(A,E,I){x.reset();for(var M=Ri.getGridToCartesianTransform(A.grid),F=A.grid.cells.space.getCoords,N=0,j=ke.size(E);N0?"3d":"2d"),uGridTexDim:x,tGridTex:_,uGridStats:D,uCellDim:v.cellDim,uCartnToUnit:v.cartnToUnit,uUnitToCartn:v.unitToCartn,dPackedGroup:v.packedGroup,dAxisOrder:O.create(v.axisOrder.ref.value.join("")),dIgnoreLight:O.create(C.ignoreLight),dXrayShaded:O.create("inverted"===C.xrayShaded?"inverted":!0===C.xrayShaded?"on":"off")})}e.create=t,e.createEmpty=i,e.Params=R(R({},st.Params),{ignoreLight:T.Boolean(!1,st.ShadingCategory),xrayShaded:T.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],st.ShadingCategory),controlPoints:T.LineGraph([Be.create(.19,0),Be.create(.2,.05),Be.create(.25,.05),Be.create(.26,0),Be.create(.79,0),Be.create(.8,.05),Be.create(.85,.05),Be.create(.86,0)],{isEssential:!0}),stepsPerCell:T.Numeric(3,{min:1,max:10,step:1}),jumpLength:T.Numeric(0,{min:0,max:20,step:.1})}),e.Utils={Params:e.Params,createEmpty:i,createValues:l,createValuesSimple:function d(v,g,y,S,C){var _=st.createSimple(y,S,C),x=R(R({},T.getDefaultValues(e.Params)),g);return l(v,_.transform,_.locationIterator,_.theme,x)},updateValues:function f(v,g){st.updateValues(v,g),O.updateIfChanged(v.dIgnoreLight,g.ignoreLight),O.updateIfChanged(v.dXrayShaded,"inverted"===g.xrayShaded?"inverted":!0===g.xrayShaded?"on":"off"),RK(MK(g.controlPoints),v.tTransferTex),O.updateIfChanged(v.uMaxSteps,s(v.uGridDim.ref.value,g.stepsPerCell)),O.updateIfChanged(v.uStepScale,u(v.uCellDim.ref.value,g.stepsPerCell)),O.updateIfChanged(v.uTransferScale,c(g.stepsPerCell)),O.updateIfChanged(v.uJumpLength,g.jumpLength)},updateBoundingSphere:function p(v,g){var y=Pe.clone(g.boundingSphere),S=Qi(y,v.aTransform.ref.value,v.instanceCount.ref.value,0);Pe.equals(S,v.boundingSphere.ref.value)||O.update(v.boundingSphere,S),Pe.equals(y,v.invariantBoundingSphere.ref.value)||(O.update(v.invariantBoundingSphere,y),O.update(v.uInvariantBoundingSphere,dr.fromSphere(v.uInvariantBoundingSphere.ref.value,y)))},createRenderableState:function m(v){var g=st.createRenderableState(v);return g.opaque=!1,g.writeDepth=!1,g},updateRenderableState:function h(v,g){st.updateRenderableState(v,g),v.opaque=!1,v.writeDepth=!1},createPositionIterator:function o(v,g){var y=v.transform.ref.value,S=v.gridDimension.ref.value,_=S[1],x=S[2],D=S[0]*_*x,w=g.instanceCount.ref.value,A=lm(),E=A.position,I=g.aTransform.ref.value;return On(D,w,1,function(F,N){var j=Math.floor(F/x);return E[0]=Math.floor(j/_),E[1]=j%_,E[2]=F%x,b.transformMat4(E,E,y),N>=0&&b.transformMat4Offset(E,E,I,0,0,16*N),A})}}}(ju||(ju={})),function(e){function t(m,h,v,g){return g?function i(m,h,v,g){return g.sphereCount=v,O.update(g.centerBuffer,m),O.update(g.groupBuffer,h),g.shaderData.update(),g}(m,h,v,g):function a(m,h,v){var y,g=Pe(),S=-1,C=-1,_=O.create(gi(1,4,Float32Array)),x=O.create(Be.create(0,0)),D={kind:"spheres",sphereCount:v,centerBuffer:O.create(m),groupBuffer:O.create(h),get boundingSphere(){var w=n(D);if(w!==S){var A=Ef(D.centerBuffer.ref.value,4*D.sphereCount,4);Pe.copy(g,A),S=w}return g},get groupMapping(){return D.groupBuffer.ref.version!==C&&(y=G0(D.groupBuffer.ref.value,D.sphereCount,4),C=D.groupBuffer.ref.version),y},setBoundingSphere:function(w){Pe.copy(g,w),S=n(D)},shaderData:{positionGroup:_,texDim:x,update:function(){var w=gi(D.sphereCount,4,Float32Array,_.ref.value.array);(function o(m,h,v,g){for(var y=m.array,S=0;S=re.ref.value.length)xe.updateSubData(re.ref.value,0,xe.length);else{xe.destroy();var Ge=n[de];J[ae][1]=l.attribute(re.ref.value,Ge.itemSize,Ge.divisor),K.attributes=!0}M[de]=re.ref.version}}if(X&&a.elements.ref.version!==M.elements&&(X.length>=a.elements.ref.value.length?X.updateSubData(a.elements.ref.value,0,X.length):(X.destroy(),X=l.elements(a.elements.ref.value),K.elements=!0),M.elements=a.elements.ref.version),K.attributes||K.defines||K.elements)for(var Q=0,ye=o;Qo&&(o=c)}var l=Pe.create(t,o);return Pe.setExtrema(l,r),l}(S.cornerBuffer.ref.value);Pe.copy(h,_),v=C}return h}};return S}(f,p,m)}function i(f){return t(gi(0,4,Uint8Array),f?f.cornerBuffer.ref.value:new Float32Array(24),gi(0,4,Uint8Array),f)}function o(f,p,m,h,v){var g=m.instanceCount,y=m.groupCount,C=Vu(m,e.Utils.createPositionIterator(f,p),h.color),_=v.instanceGranularity?Ia(g,"instance"):Ia(g*y,"groupInstance"),x=Pf(),D=Mf(),w=Of(),A=Rf(),E={drawCount:LK.length,vertexCount:v4.length/3,groupCount:y,instanceCount:g},I=Pe.clone(f.boundingSphere),M=Qi(I,p.aTransform.ref.value,g,0);return R(R(R(R(R(R(R(R(R({dGeometryType:O.create("image")},C),_),x),D),w),A),p),st.createValues(v,E)),{aPosition:f.cornerBuffer,aUv:O.create(v4e),elements:O.create(LK),aGroup:O.create(Bu(new Float32Array(4))),boundingSphere:O.create(M),invariantBoundingSphere:O.create(I),uInvariantBoundingSphere:O.create(dr.ofSphere(I)),dInterpolation:O.create(v.interpolation),uImageTexDim:f.imageTextureDim,tImageTex:f.imageTexture,tGroupTex:f.groupTexture})}e.create=t,e.createEmpty=i,e.Params=R(R({},st.Params),{interpolation:T.Select("bspline",T.objectToOptions(UK))}),e.Utils={Params:e.Params,createEmpty:i,createValues:o,createValuesSimple:function s(f,p,m,h,v){var g=st.createSimple(m,h,v),y=R(R({},T.getDefaultValues(e.Params)),p);return o(f,g.transform,g.locationIterator,g.theme,y)},updateValues:function u(f,p){st.updateValues(f,p),O.updateIfChanged(f.dInterpolation,p.interpolation)},updateBoundingSphere:function c(f,p){var m=Pe.clone(p.boundingSphere),h=Qi(m,f.aTransform.ref.value,f.instanceCount.ref.value,0);Pe.equals(h,f.boundingSphere.ref.value)||O.update(f.boundingSphere,h),Pe.equals(m,f.invariantBoundingSphere.ref.value)||(O.update(f.invariantBoundingSphere,m),O.update(f.uInvariantBoundingSphere,dr.fromSphere(f.uInvariantBoundingSphere.ref.value,m)))},createRenderableState:function l(f){var p=st.createRenderableState(f);return p.opaque=!1,p},updateRenderableState:function d(f,p){st.updateRenderableState(f,p),f.opaque=!1},createPositionIterator:function(){return On(1,1,1,function(){return Uu})}}}(qf||(qf={})),function(e){function t(m,h,v,g,y,S,C,_,x){return x?function i(m,h,v,g,y,S,C,_,x){return _>x.cylinderCount&&(O.update(x.mappingBuffer,m),O.update(x.indexBuffer,h)),x.cylinderCount=_,O.update(x.groupBuffer,v),O.update(x.startBuffer,g),O.update(x.endBuffer,y),O.update(x.scaleBuffer,S),O.update(x.capBuffer,C),x}(m,h,v,g,y,S,C,_,x):function a(m,h,v,g,y,S,C,_){var D,x=Pe(),w=-1,A=-1,E={kind:"cylinders",cylinderCount:_,mappingBuffer:O.create(m),indexBuffer:O.create(h),groupBuffer:O.create(v),startBuffer:O.create(g),endBuffer:O.create(y),scaleBuffer:O.create(S),capBuffer:O.create(C),get boundingSphere(){var I=n(E);if(I!==w){var M=Ef(E.startBuffer.ref.value,6*E.cylinderCount,6),F=Ef(E.endBuffer.ref.value,6*E.cylinderCount,6);Pe.expandBySphere(x,M,F),w=I}return x},get groupMapping(){return E.groupBuffer.ref.version!==A&&(D=G0(E.groupBuffer.ref.value,E.cylinderCount,6),A=E.groupBuffer.ref.version),D},setBoundingSphere:function(I){Pe.copy(x,I),w=n(E)}};return E}(m,h,v,g,y,S,C,_)}function r(m){return t(m?m.mappingBuffer.ref.value:new Float32Array(0),m?m.indexBuffer.ref.value:new Uint32Array(0),m?m.groupBuffer.ref.value:new Float32Array(0),m?m.startBuffer.ref.value:new Float32Array(0),m?m.endBuffer.ref.value:new Float32Array(0),m?m.scaleBuffer.ref.value:new Float32Array(0),m?m.capBuffer.ref.value:new Float32Array(0),0,m)}function n(m){return rs([m.cylinderCount,m.mappingBuffer.ref.version,m.indexBuffer.ref.version,m.groupBuffer.ref.version,m.startBuffer.ref.version,m.endBuffer.ref.version,m.scaleBuffer.ref.version,m.capBuffer.ref.version])}function s(m,h){var v=6*m.cylinderCount,g=h.instanceCount.ref.value,y=lm(),S=y.position,C=m.startBuffer.ref.value,_=m.endBuffer.ref.value,x=h.aTransform.ref.value;return On(v,g,2,function(w,A){var E=w%6==0?C:_;return A<0?b.fromArray(S,E,3*w):b.transformMat4Offset(S,E,x,0,3*w,16*A),y})}function u(m,h,v,g,y){var S=v.instanceCount,C=v.groupCount,x=Vu(v,s(m,h),g.color),D=Bf(v,g.size),w=y.instanceGranularity?Ia(S,"instance"):Ia(S*C,"groupInstance"),A=Pf(),E=Mf(),I=Of(),M=Rf(),F={drawCount:4*m.cylinderCount*3,vertexCount:6*m.cylinderCount,groupCount:C,instanceCount:S},N=zS(D)*y.sizeFactor,j=Pe.clone(m.boundingSphere),U=Qi(j,h.aTransform.ref.value,S,0);return R(R(R(R(R(R(R(R(R(R(R({dGeometryType:O.create("cylinders"),aMapping:m.mappingBuffer,aGroup:m.groupBuffer,aStart:m.startBuffer,aEnd:m.endBuffer,aScale:m.scaleBuffer,aCap:m.capBuffer,elements:m.indexBuffer,boundingSphere:O.create(U),invariantBoundingSphere:O.create(j),uInvariantBoundingSphere:O.create(dr.ofSphere(j))},x),D),w),A),E),I),M),h),{padding:O.create(N)}),st.createValues(y,F)),{uSizeFactor:O.create(y.sizeFactor*y.sizeAspectRatio),uDoubleSided:O.create(y.doubleSided),dIgnoreLight:O.create(y.ignoreLight),dXrayShaded:O.create("inverted"===y.xrayShaded?"inverted":!0===y.xrayShaded?"on":"off"),dTransparentBackfaces:O.create(y.transparentBackfaces),dSolidInterior:O.create(y.solidInterior),uBumpFrequency:O.create(y.bumpFrequency),uBumpAmplitude:O.create(y.bumpAmplitude)})}function p(m,h){st.updateRenderableState(m,h),m.opaque=m.opaque&&!h.xrayShaded,m.writeDepth=m.opaque}e.create=t,e.createEmpty=r,e.transform=function o(m,h){var v=m.startBuffer.ref.value;Wh(h,v,0,6*m.cylinderCount),O.update(m.startBuffer,v);var g=m.endBuffer.ref.value;Wh(h,g,0,6*m.cylinderCount),O.update(m.endBuffer,g)},e.Params=R(R({},st.Params),{sizeFactor:T.Numeric(1,{min:0,max:10,step:.1}),sizeAspectRatio:T.Numeric(1,{min:0,max:3,step:.01}),doubleSided:T.Boolean(!1,st.CustomQualityParamInfo),ignoreLight:T.Boolean(!1,st.ShadingCategory),xrayShaded:T.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],st.ShadingCategory),transparentBackfaces:T.Select("off",T.arrayToOptions(["off","on","opaque"]),st.ShadingCategory),solidInterior:T.Boolean(!0,st.ShadingCategory),bumpFrequency:T.Numeric(0,{min:0,max:10,step:.1},st.ShadingCategory),bumpAmplitude:T.Numeric(1,{min:0,max:5,step:.1},st.ShadingCategory)}),e.Utils={Params:e.Params,createEmpty:r,createValues:u,createValuesSimple:function c(m,h,v,g,y){var S=st.createSimple(v,g,y),C=R(R({},T.getDefaultValues(e.Params)),h);return u(m,S.transform,S.locationIterator,S.theme,C)},updateValues:function l(m,h){st.updateValues(m,h),O.updateIfChanged(m.uSizeFactor,h.sizeFactor*h.sizeAspectRatio),O.updateIfChanged(m.uDoubleSided,h.doubleSided),O.updateIfChanged(m.dIgnoreLight,h.ignoreLight),O.updateIfChanged(m.dXrayShaded,"inverted"===h.xrayShaded?"inverted":!0===h.xrayShaded?"on":"off"),O.updateIfChanged(m.dTransparentBackfaces,h.transparentBackfaces),O.updateIfChanged(m.dSolidInterior,h.solidInterior),O.updateIfChanged(m.uBumpFrequency,h.bumpFrequency),O.updateIfChanged(m.uBumpAmplitude,h.bumpAmplitude)},updateBoundingSphere:function d(m,h){var v=Pe.clone(h.boundingSphere),g=Qi(v,m.aTransform.ref.value,m.instanceCount.ref.value,0);Pe.equals(g,m.boundingSphere.ref.value)||O.update(m.boundingSphere,g),Pe.equals(v,m.invariantBoundingSphere.ref.value)||(O.update(m.invariantBoundingSphere,v),O.update(m.uInvariantBoundingSphere,dr.fromSphere(m.uInvariantBoundingSphere.ref.value,v)))},createRenderableState:function f(m){var h=st.createRenderableState(m);return p(h,m),h},updateRenderableState:p,createPositionIterator:s}}(qu||(qu={})),function(e){function t(o){switch(o.kind){case"mesh":return 3*o.triangleCount;case"points":return o.pointCount;case"spheres":return 2*o.sphereCount*3;case"cylinders":return 4*o.cylinderCount*3;case"text":return 2*o.charCount*3;case"lines":return 2*o.lineCount*3;case"direct-volume":return 36;case"image":return 6;case"texture-mesh":return o.vertexCount}}e.getDrawCount=t,e.getVertexCount=function r(o){switch(o.kind){case"mesh":case"texture-mesh":return o.vertexCount;case"points":return o.pointCount;case"spheres":return 6*o.sphereCount;case"cylinders":return 6*o.cylinderCount;case"text":return 4*o.charCount;case"lines":return 4*o.lineCount;case"direct-volume":var s=o.gridDimension.ref.value;return s[0]*s[1]*s[2];case"image":return 4}},e.getGroupCount=function n(o){switch(o.kind){case"mesh":case"points":case"spheres":case"cylinders":case"text":case"lines":return 0===t(o)?0:id(o.groupBuffer.ref.value)+1;case"direct-volume":return 1;case"image":return id(o.groupTexture.ref.value.array)+1;case"texture-mesh":return o.groupCount}},e.getUtils=function a(o){switch(o.kind){case"mesh":return Vt.Utils;case"points":return fm.Utils;case"spheres":return Cd.Utils;case"cylinders":return qu.Utils;case"text":return zu.Utils;case"lines":return na.Utils;case"direct-volume":return ju.Utils;case"image":return qf.Utils;case"texture-mesh":return is.Utils}},e.getGranularity=function i(o,s){return"instance"===s&&o.nonInstanceable?"group":s}}(Oi||(Oi={}));var VK={};function b4(e,t){return{factory:b4,granularity:"groupInstance",size:function(r){return Ho.isLocation(r)?r.shape.getSize(r.group,r.instance):1},props:t,description:"Assigns sizes as defined by the shape object."}}var x4e={name:"shape-group",label:"Shape Group",category:"",factory:b4,getParams:function C4e(e){return VK},defaultValues:T.getDefaultValues(VK),isApplicable:function(e){return!!e.shape}},_4e=dt(13421772),GK={};function S4(e,t){return{factory:S4,granularity:"groupInstance",color:function(r){return Ho.isLocation(r)?r.shape.getColor(r.group,r.instance):_4e},props:t,description:"Assigns colors as defined by the shape object."}}var qr,Ho,T4e={name:"shape-group",label:"Shape Group",category:Xn.Misc,factory:S4,getParams:function A4e(e){return GK},defaultValues:T.getDefaultValues(GK),isApplicable:function(e){return!!e.shape}},D4e=R(R({},zf),{aPosition:Tn("float32",3,0),elements:X0("uint32"),uBboxMin:Ae("v3"),uBboxMax:Ae("v3"),uBboxSize:Ae("v3"),uMaxSteps:Ae("i"),uStepScale:Ae("f"),uJumpLength:Ae("f"),uTransform:Ae("m4"),uGridDim:Ae("v3"),tTransferTex:Xt("image-uint8","alpha","ubyte","linear"),uTransferScale:Ae("f","material"),dGridTexType:Lt("string",["2d","3d"]),uGridTexDim:Ae("v3"),tGridTex:Xt("texture","rgba","ubyte","linear"),uGridStats:Ae("v4"),uCellDim:Ae("v3"),uCartnToUnit:Ae("m4"),uUnitToCartn:Ae("m4"),dPackedGroup:Lt("boolean"),dAxisOrder:Lt("string",["012","021","102","120","201","210"]),dIgnoreLight:Lt("boolean"),dXrayShaded:Lt("string",["off","on","inverted"])}),I4e=R(R({},zf),{aGroup:Tn("float32",1,0),aPosition:Tn("float32",3,0),aNormal:Tn("float32",3,0),elements:X0("uint32"),dVaryingGroup:Lt("boolean"),dFlatShaded:Lt("boolean"),uDoubleSided:Ae("b","material"),dFlipSided:Lt("boolean"),dIgnoreLight:Lt("boolean"),dXrayShaded:Lt("string",["off","on","inverted"]),dTransparentBackfaces:Lt("string",["off","on","opaque"]),uBumpFrequency:Ae("f","material"),uBumpAmplitude:Ae("f","material"),meta:oa("unknown")}),M4e=R(R(R({},zf),jS),{aGroup:Tn("float32",1,0),aPosition:Tn("float32",3,0),dPointSizeAttenuation:Lt("boolean"),dPointStyle:Lt("string",["square","circle","fuzzy"])}),O4e=R(R(R({},zf),jS),{aGroup:Tn("float32",1,0),aMapping:Tn("float32",2,0),aStart:Tn("float32",3,0),aEnd:Tn("float32",3,0),elements:X0("uint32"),dLineSizeAttenuation:Lt("boolean"),uDoubleSided:Ae("b","material"),dFlipSided:Lt("boolean")}),B4e=R(R(R({},zf),jS),{uTexDim:Ae("v2"),tPositionGroup:Xt("image-float32","rgba","float","nearest"),padding:oa("number"),uDoubleSided:Ae("b","material"),dIgnoreLight:Lt("boolean"),dXrayShaded:Lt("string",["off","on","inverted"]),dTransparentBackfaces:Lt("string",["off","on","opaque"]),dSolidInterior:Lt("boolean"),dClipPrimitive:Lt("boolean"),dApproximate:Lt("boolean"),uAlphaThickness:Ae("f"),uBumpFrequency:Ae("f","material"),uBumpAmplitude:Ae("f","material"),centerBuffer:oa("float32"),groupBuffer:oa("float32")}),k4e=R(R(R({},zf),jS),{aGroup:Tn("float32",1,0),aPosition:Tn("float32",3,0),aMapping:Tn("float32",2,0),aDepth:Tn("float32",1,0),elements:X0("uint32"),aTexCoord:Tn("float32",2,0),tFont:Xt("image-uint8","alpha","ubyte","linear"),padding:oa("number"),uBorderWidth:Ae("f","material"),uBorderColor:Ae("v3","material"),uOffsetX:Ae("f","material"),uOffsetY:Ae("f","material"),uOffsetZ:Ae("f","material"),uBackgroundColor:Ae("v3","material"),uBackgroundOpacity:Ae("f","material")}),U4e=R(R({},zf),{uGeoTexDim:Ae("v2","buffered"),tPosition:Xt("texture","rgb","float","nearest"),tGroup:Xt("texture","alpha","float","nearest"),tNormal:Xt("texture","rgb","float","nearest"),dVaryingGroup:Lt("boolean"),dFlatShaded:Lt("boolean"),uDoubleSided:Ae("b","material"),dFlipSided:Lt("boolean"),dIgnoreLight:Lt("boolean"),dXrayShaded:Lt("string",["off","on","inverted"]),dTransparentBackfaces:Lt("string",["off","on","opaque"]),uBumpFrequency:Ae("f","material"),uBumpAmplitude:Ae("f","material"),meta:oa("unknown")}),G4e=R(R({},zf),{aGroup:Tn("float32",1,0),aPosition:Tn("float32",3,0),aUv:Tn("float32",2,0),elements:X0("uint32"),uImageTexDim:Ae("v2"),tImageTex:Xt("image-uint8","rgba","ubyte","nearest"),tGroupTex:Xt("image-uint8","rgba","ubyte","nearest"),dInterpolation:Lt("string",g4e)}),H4e=R(R(R({},zf),jS),{aGroup:Tn("float32",1,0),aStart:Tn("float32",3,0),aEnd:Tn("float32",3,0),aMapping:Tn("float32",3,0),aScale:Tn("float32",1,0),aCap:Tn("float32",1,0),elements:X0("uint32"),padding:oa("number"),uDoubleSided:Ae("b","material"),dIgnoreLight:Lt("boolean"),dXrayShaded:Lt("string",["off","on","inverted"]),dTransparentBackfaces:Lt("string",["off","on","opaque"]),dSolidInterior:Lt("boolean"),uBumpFrequency:Ae("f","material"),uBumpAmplitude:Ae("f","material")}),q4e=Jo(0,2147483647),Wf=Jo(0,2147483647);function Q0(e,t,r,n){return{id:q4e(),type:e,values:t,state:r,materialId:n}}function zK(e){var t=e&&e.getElement("vertex"),r=e&&e.getElement("material"),n={group:"",vRed:"",vGreen:"",vBlue:"",mRed:"",mGreen:"",mBlue:""},a=[["",""]],i=[["",""]];if(t){for(var o=0,s=t.propertyNames.length;o=16*l.length?d.aTransform.ref.value:new Float32Array(16*l.length),p=0,m=l.length;p=1?(n.ISTART-1)*a.value:0,a.unit),o=[],s=0,u=e.frames.length;s=-1&&d[1]<=1&&d[3]>=-1&&d[3]<=1&&d[4]>=-1&&d[4]<=1?Xf.create(b.create(d[0],d[2],d[5]),b.create(Yr(90-90*Math.asin(d[1])/rS),Yr(90-90*Math.asin(d[3])/rS),Yr(90-90*Math.asin(d[4])/rS))):d[0]<0||d[1]<0||d[2]<0||d[3]<0||d[4]<0||d[5]<0||d[3]>180||d[4]>180||d[5]>180?Xf.fromBasis(b.create(d[0],d[1],d[3]),b.create(d[1],d[2],d[4]),b.create(d[3],d[4],d[5])):Xf.create(b.create(d[0],d[2],d[5]),b.create(Yr(ea(d[1],0,mn)?90:d[1]),Yr(ea(d[3],0,mn)?90:d[3]),Yr(ea(d[4],0,mn)?90:d[4])))),o.push(l);return[2,Qh.create(o,a,i)]}})})})}function EA(e,t,r,n){for(var a=r,i=n-1,o=t.charCodeAt(a);(32===o||o>=48&&o<=57)&&a<=i;)o=t.charCodeAt(++a);for(o=t.charCodeAt(i);(32===o||o>=48&&o<=57)&&i>=a;)o=t.charCodeAt(--i);if(a===++i||a+1===i)return Xe.add(e,a,i);if(o=t.charCodeAt(a),a+2===i){var s=t.charCodeAt(a+1);if(!((78!==o&&110!==o||65!==s&&97!==s)&&(67!==o&&99!==o||76!==s&&108!==s)&&(70!==o&&102!==o||69!==s&&101!==s)&&(83!==o&&115!==o||73!==s&&105!==s)&&(66!==o&&98!==o||82!==s&&114!==s)&&(65!==o&&97!==o||83!==s&&115!==s)))return Xe.add(e,a,a+2)}if(67===o||99===o||72===o||104===o||78===o||110===o||79===o||111===o||80===o||112===o||83===o||115===o)return Xe.add(e,a,a+1);Xe.add(e,a,a)}!function(e){e.create=function t(u,c,l){var d=!!u[0].cell,f=!!u[0].velocities,p=!!u[0].forces;return{id:kn.create22(),frames:u,hasCell:d,hasVelocities:f,hasForces:p,deltaTime:c,timeOffset:l}},e.getAtomicConformation=function r(u,c,l){var d,f,p=u.x,m=u.y,h=u.z;return u.xyzOrdering.frozen?l?u.xyzOrdering.isIdentity?(p=o(p,l),m=o(m,l),h=o(h,l)):Es(u.xyzOrdering.index,l)||(p=i(p,u.xyzOrdering.index,l),m=i(m,u.xyzOrdering.index,l),h=i(h,u.xyzOrdering.index,l)):u.xyzOrdering.isIdentity||(p=s(p,u.xyzOrdering.index),m=s(m,u.xyzOrdering.index),h=s(h,u.xyzOrdering.index)):l&&(u.xyzOrdering.isIdentity?(u.xyzOrdering.isIdentity=!1,u.xyzOrdering.index=l,a(p,l),a(m,l),a(h,l)):Es(u.xyzOrdering.index,l)||(p=i(p,u.xyzOrdering.index,l),m=i(m,u.xyzOrdering.index,l),h=i(h,u.xyzOrdering.index,l))),u.xyzOrdering.frozen=!0,{id:kn.create22(),atomId:c.atomId,occupancy:null!==(d=c.occupancy)&&void 0!==d?d:ie.ofConst(1,u.elementCount,ie.Schema.int),B_iso_or_equiv:null!==(f=c.B_iso_or_equiv)&&void 0!==f?f:ie.ofConst(0,u.elementCount,ie.Schema.float),xyzDefined:!0,x:p,y:m,z:h}};var n=[.123];function a(u,c){for(var l=n,d=0,f=u.length;d=Math.PI||d>=Math.PI||f>=Math.PI?r():t(b.create(s,u,c),b.create(l,d,f))}}(Xf||(Xf={}));var tBe=new Set(["NA","CL","FE","SI","BR","AS","LI"]),rBe=new Set(["C","H","N","O","P","S","F","B"]),nBe=/^[\s\d]+|[\s\d]+$/g;function $0(e,t){var r=(e=e.replace(nBe,"").toUpperCase()).length;if(0===r||1===r||tBe.has(e))return e;if(3===r&&t===e){if("SOD"===e)return"NA";if("POT"===e)return"K";if("CES"===e)return"CS";if("CAL"===e)return"CA";if("CLA"===e)return"CL"}return rBe.has(e[0])?e[0]:""}var lu,du,WK=new Set(["145","147","149","289","291","293","445","475","491","510","604","045","05L","07E","07Y","08U","09X","0AT","0BD","0H0","0HX","0LP","0MK","0NZ","0TS","0UB","0V4","0WK","0XY","0YT","10M","12E","14T","15L","16F","16G","16O","17T","18D","18O","18T","1AR","1BW","1CF","1FT","1GL","1GN","1JB","1LL","1NA","1S3","1S4","1SD","1X4","20S","20X","22O","22S","23V","24S","25E","26M","26O","26Q","26R","26V","26W","26Y","27C","2DG","2DR","2F8","2FG","2FL","2FP","2GL","2GS","2H5","2HA","2M4","2M5","2M8","2OS","2SI","2WP","2WS","32O","34V","38J","3BU","3CM","3DO","3DY","3FM","3GR","3HD","3J3","3J4","3LJ","3LR","3MF","3MG","3MK","3R3","3S6","3SA","3YW","40J","42D","44S","46D","46M","46Z","48Z","49A","49S","49T","49V","4AM","4CQ","4GC","4GL","4GP","4JA","4N2","4NN","4QY","4R1","4RS","4SG","4U0","4U1","4U2","4UZ","4V5","50A","51N","56N","57S","5DI","5GF","5GO","5II","5KQ","5KS","5KT","5KV","5L2","5L3","5LS","5LT","5MM","5N6","5QP","5RP","5SA","5SP","5TH","5TJ","5TK","5TM","61J","62I","64K","66O","6BG","6C2","6DM","6GB","6GP","6GR","6K3","6KH","6KL","6KS","6KU","6KW","6LA","6LS","6LW","6MJ","6MN","6PG","6PY","6PZ","6S2","6SA","6UD","6Y6","6YR","6ZC","73E","79J","7CV","7D1","7GP","7JZ","7K2","7K3","7NU","7SA","83Y","89Y","8B7","8B9","8EX","8GA","8GG","8GP","8I4","8LM","8LR","8OQ","8PK","8S0","8YV","95Z","96O","98U","9AM","9C1","9CD","9GP","9KJ","9MR","9OK","9PG","9QG","9QZ","9S7","9SG","9SJ","9SM","9SP","9T1","9T7","9VP","9WJ","9WN","9WZ","9YW","A0K","A1Q","A2G","A5C","A6P","AAL","AAO","ABC","ABD","ABE","ABF","ABL","AC1","ACG","ACR","ACX","ADA","ADG","ADR","AF1","AFD","AFL","AFO","AFP","AFR","AGC","AGH","AGL","AGR","AH2","AH8","AHG","AHM","AHR","AIG","ALL","ALX","AMG","AMN","AMU","AMV","ANA","AOG","AOS","AQA","ARA","ARB","ARE","ARI","ARW","ASC","ASG","ASO","AXP","AXR","AY9","AZC","B0D","B16","B1H","B1N","B2G","B4G","B6D","B7G","B8D","B9D","BBK","BBV","BCD","BCW","BDF","BDG","BDP","BDR","BDZ","BEM","BFN","BFP","BG6","BG8","BGC","BGL","BGN","BGP","BGS","BHG","BM3","BM7","BMA","BMX","BND","BNG","BNX","BO1","BOG","BQY","BRI","BS7","BTG","BTU","BW3","BWG","BXF","BXP","BXX","BXY","BZD","C3B","C3G","C3X","C4B","C4W","C4X","C5X","CAP","CBF","CBI","CBK","CDR","CE5","CE6","CE8","CEG","CEX","CEY","CEZ","CGF","CJB","CKB","CKP","CNP","CR1","CR6","CRA","CT3","CTO","CTR","CTT","D0N","D1M","D5E","D6G","DAF","DAG","DAN","DDA","DDB","DDL","DEG","DEL","DFR","DFX","DG0","DGC","DGD","DGM","DGO","DGS","DGU","DIG","DJB","DJE","DK4","DKX","DKZ","DL6","DLD","DLF","DLG","DMU","DNO","DO8","DOM","DP5","DPC","DQQ","DQR","DR2","DR3","DR4","DR5","DRI","DSR","DT6","DVC","DYM","E3M","E4P","E5G","EAG","EBG","EBQ","EEN","EEQ","EGA","EJT","EMP","EMZ","EPG","EQP","EQV","ERE","ERI","ETT","EUS","F1P","F1X","F55","F58","F6P","F8X","FBP","FCA","FCB","FCT","FDP","FDQ","FFC","FFX","FIF","FIX","FK9","FKD","FMF","FMO","FNG","FNY","FRU","FSA","FSI","FSM","FSR","FSW","FU4","FUB","FUC","FUD","FUF","FUL","FUY","FVQ","FX1","FYJ","G0S","G16","G1P","G20","G28","G2F","G3F","G3I","G4D","G4S","G6D","G6P","G6S","G7P","G8Z","GAA","GAC","GAD","GAF","GAL","GAT","GBH","GC1","GC4","GC9","GCB","GCD","GCN","GCO","GCS","GCT","GCU","GCV","GCW","GDA","GDL","GE1","GE3","GFP","GIV","GL0","GL1","GL2","GL4","GL5","GL6","GL7","GL9","GLA","GLB","GLC","GLD","GLF","GLG","GLO","GLP","GLS","GLT","GLW","GM0","GMB","GMH","GMT","GMZ","GN1","GN4","GNS","GNX","GP0","GP1","GP4","GPH","GPK","GPM","GPO","GPQ","GPU","GPV","GPW","GQ1","GRF","GRX","GS1","GS4","GS9","GSA","GSD","GTE","GTH","GTK","GTM","GTR","GU0","GU1","GU2","GU3","GU4","GU5","GU6","GU8","GU9","GUF","GUL","GUP","GUZ","GXL","GXV","GYE","GYG","GYP","GYU","GYV","GZL","H1M","H1S","H2P","H3S","H53","H6Q","H6Z","HBZ","HD4","HDL","HMS","HNV","HNW","HSG","HSH","HSJ","HSQ","HSR","HSU","HSX","HSY","HSZ","HTG","HTM","HVC","I57","IAB","IDC","IDF","IDG","IDR","IDS","IDT","IDU","IDX","IDY","IEM","IN1","IPT","ISD","ISL","ISX","IVG","IXD","J5B","JFZ","JHM","JLT","JRV","JS2","JSV","JV4","JVA","JVS","JZR","K5B","K99","KBA","KBG","KD5","KDA","KDB","KDD","KDE","KDF","KDM","KDN","KDO","KDR","KFN","KG1","KGM","KHP","KME","KO1","KO2","KOT","KQC","KTU","L1L","L6N","L6S","L6T","LAG","LAH","LAI","LAK","LAO","LAT","LB2","LBS","LBT","LCN","LDY","LEC","LER","LFC","LFR","LGC","LGU","LKA","LKS","LM2","LMO","LMT","LMU","LNV","LOG","LOX","LPK","LRH","LSM","LTG","LTM","LVO","LVZ","LXB","LXC","LXZ","LZ0","M1F","M1P","M2F","M3M","M3N","M55","M6D","M6P","M7B","M7P","M8C","MA1","MA2","MA3","MA8","MAB","MAF","MAG","MAL","MAN","MAT","MAV","MAW","MBE","MBF","MBG","MCU","MDA","MDP","MFA","MFB","MFU","MG5","MGA","MGC","MGL","MGS","MJJ","MLB","MLR","MMA","MMN","MN0","MNA","MQG","MQT","MRH","MRP","MSX","MTT","MUB","MUG","MUR","MVP","MXY","MXZ","MYG","N1L","N3U","N9S","NA1","NAA","NAG","NBG","NBX","NBY","NDG","NED","NFG","NG1","NG6","NGA","NGB","NGC","NGE","NGF","NGK","NGL","NGR","NGS","NGY","NGZ","NHF","NLC","NM6","NM9","NNG","NPF","NSQ","NT1","NTF","NTO","NTP","NXD","NYT","O1G","OAK","OEL","OI7","OPM","ORP","OSU","OTG","OTN","OTU","OX2","P53","P6P","P8E","PA1","PA5","PAV","PDX","PH5","PKM","PNA","PNG","PNJ","PNW","PPC","PRP","PSG","PSJ","PSV","PTQ","PUF","PZU","QDK","QIF","QKH","QPS","QV4","R1P","R1X","R2B","R2G","R5P","RAA","RAE","RAF","RAM","RAO","RAT","RB5","RBL","RCD","RDP","REL","RER","RF5","RG1","RGG","RHA","RHC","RI2","RIB","RIP","RM4","RNS","RNT","ROB","ROR","RP3","RP5","RP6","RPA","RR7","RRJ","RRY","RST","RTG","RTV","RUB","RUG","RUU","RV7","RVG","RVM","RWI","RY7","RZM","S6P","S7P","S81","SA0","SCG","SCR","SDD","SDY","SEJ","SF6","SF9","SFJ","SFU","SG4","SG5","SG6","SG7","SGA","SGC","SGD","SGN","SGS","SHB","SHD","SHG","SI3","SIA","SID","SIO","SIZ","SLB","SLM","SLT","SMD","SN5","SNG","SOE","SOG","SOL","SOR","SR1","SSG","SSH","STW","STZ","SUC","SUP","SUS","SWE","SZZ","T68","T6D","T6P","T6T","TA6","TAG","TCB","TCG","TDG","TEU","TF0","TFU","TGA","TGK","TGR","TGY","TH1","TM5","TM6","TM9","TMR","TMX","TNX","TOA","TOC","TQY","TRE","TRV","TS8","TT7","TTV","TTZ","TU4","TUG","TUJ","TUP","TUR","TVD","TVG","TVM","TVS","TVV","TVY","TW7","TWA","TWD","TWG","TWJ","TWY","TXB","TY6","TYV","U1Y","U2A","U2D","U63","U8V","U97","U9A","U9D","U9G","U9J","U9M","UAP","UBH","UBO","UCD","UDC","UEA","V3M","V3P","V71","VG1","VJ1","VJ4","VKN","VTB","W9T","WIA","WOO","WUN","WZ1","WZ2","WZ4","X0X","X1P","X1X","X2F","X2Y","X34","X4S","X5S","X6X","X6Y","XBP","XDP","XDX","XGP","XIL","XKJ","XLF","XLS","XMM","XS2","XUL","XXM","XXR","XXX","XY6","XY9","XYB","XYF","XYL","XYP","XYS","XYT","XYZ","YDR","YIO","YJM","YKR","YO5","YX0","YX1","YYB","YYD","YYH","YYJ","YYK","YYM","YYQ","YYR","YZ0","YZT","Z0F","Z15","Z16","Z2D","Z2T","Z3K","Z3L","Z3Q","Z3U","Z4K","Z4R","Z4S","Z4U","Z4V","Z4W","Z4Y","Z57","Z5J","Z5L","Z61","Z6G","Z6H","Z6J","Z6W","Z8H","Z8T","Z9D","Z9E","Z9H","Z9K","Z9L","Z9M","Z9N","Z9W","ZB0","ZB1","ZB2","ZB3","ZCD","ZCZ","ZD0","ZDC","ZDM","ZDO","ZEE","ZEL","ZGE","ZMR","UMQ","SQD"]),Pn=function(e){return e[e.FilledSphere=0]="FilledSphere",e[e.FilledCube=1]="FilledCube",e[e.CrossedCube=2]="CrossedCube",e[e.DividedDiamond=3]="DividedDiamond",e[e.FilledCone=4]="FilledCone",e[e.DevidedCone=5]="DevidedCone",e[e.FlatBox=6]="FlatBox",e[e.FilledStar=7]="FilledStar",e[e.FilledDiamond=8]="FilledDiamond",e[e.FlatDiamond=9]="FlatDiamond",e[e.FlatHexagon=10]="FlatHexagon",e[e.Pentagon=11]="Pentagon",e[e.DiamondPrism=12]="DiamondPrism",e[e.PentagonalPrism=13]="PentagonalPrism",e[e.HexagonalPrism=14]="HexagonalPrism",e[e.HeptagonalPrism=15]="HeptagonalPrism",e}(Pn||{}),_t=function(e){return e[e.Hexose=0]="Hexose",e[e.HexNAc=1]="HexNAc",e[e.Hexosamine=2]="Hexosamine",e[e.Hexuronate=3]="Hexuronate",e[e.Deoxyhexose=4]="Deoxyhexose",e[e.DeoxyhexNAc=5]="DeoxyhexNAc",e[e.DiDeoxyhexose=6]="DiDeoxyhexose",e[e.Pentose=7]="Pentose",e[e.Deoxynonulosonate=8]="Deoxynonulosonate",e[e.DiDeoxynonulosonate=9]="DiDeoxynonulosonate",e[e.Unknown=10]="Unknown",e[e.Assigned=11]="Assigned",e}(_t||{});(lu={})[_t.Hexose]="Hexose",lu[_t.HexNAc]="HexNAc",lu[_t.Hexosamine]="Hexosamine",lu[_t.Hexuronate]="Hexuronate",lu[_t.Deoxyhexose]="Deoxyhexose",lu[_t.DeoxyhexNAc]="DeoxyhexNAc",lu[_t.DiDeoxyhexose]="Di-deoxyhexose",lu[_t.Pentose]="Pentose",lu[_t.Deoxynonulosonate]="Deoxynonulosonate",lu[_t.DiDeoxynonulosonate]="Di-deoxynonulosonate",lu[_t.Unknown]="Unknown",lu[_t.Assigned]="Assigned";var iBe=((du={})[_t.Hexose]=Pn.FilledSphere,du[_t.HexNAc]=Pn.FilledCube,du[_t.Hexosamine]=Pn.CrossedCube,du[_t.Hexuronate]=Pn.DividedDiamond,du[_t.Deoxyhexose]=Pn.FilledCone,du[_t.DeoxyhexNAc]=Pn.DevidedCone,du[_t.DiDeoxyhexose]=Pn.FlatBox,du[_t.Pentose]=Pn.FilledStar,du[_t.Deoxynonulosonate]=Pn.FilledDiamond,du[_t.DiDeoxynonulosonate]=Pn.FlatDiamond,du[_t.Unknown]=Pn.FlatHexagon,du[_t.Assigned]=Pn.Pentagon,du);function oBe(e,t){return e===_t.Unknown?4===t?Pn.DiamondPrism:5===t?Pn.PentagonalPrism:6===t?Pn.HexagonalPrism:7===t?Pn.HeptagonalPrism:Pn.FlatHexagon:iBe[e]}var sa,C4={abbr:"Unk",name:"Unknown",color:15854817,type:_t.Unknown},J0=[{abbr:"Glc",name:"Glucose",color:37052,type:_t.Hexose},{abbr:"Man",name:"Mannose",color:42577,type:_t.Hexose},{abbr:"Gal",name:"Galactose",color:16765952,type:_t.Hexose},{abbr:"Gul",name:"Gulose",color:16021792,type:_t.Hexose},{abbr:"Alt",name:"Altrose",color:16162465,type:_t.Hexose},{abbr:"All",name:"Allose",color:10830745,type:_t.Hexose},{abbr:"Tal",name:"Talose",color:9424105,type:_t.Hexose},{abbr:"Ido",name:"Idose",color:10582605,type:_t.Hexose},{abbr:"GlcNAc",name:"N-Acetyl Glucosamine",color:37052,type:_t.HexNAc},{abbr:"ManNAc",name:"N-Acetyl Mannosamine",color:42577,type:_t.HexNAc},{abbr:"GalNAc",name:"N-Acetyl Galactosamine",color:16765952,type:_t.HexNAc},{abbr:"GulNAc",name:"N-Acetyl Gulosamine",color:16021792,type:_t.HexNAc},{abbr:"AltNAc",name:"N-Acetyl Altrosamine",color:16162465,type:_t.HexNAc},{abbr:"AllNAc",name:"N-Acetyl Allosamine",color:10830745,type:_t.HexNAc},{abbr:"TalNAc",name:"N-Acetyl Talosamine",color:9424105,type:_t.HexNAc},{abbr:"IdoNAc",name:"N-Acetyl Idosamine",color:10582605,type:_t.HexNAc},{abbr:"GlcN",name:"Glucosamine",color:37052,type:_t.Hexosamine},{abbr:"ManN",name:"Mannosamine",color:42577,type:_t.Hexosamine},{abbr:"GalN",name:"Galactosamine",color:16765952,type:_t.Hexosamine},{abbr:"GulN",name:"Gulosamine",color:16021792,type:_t.Hexosamine},{abbr:"AltN",name:"Altrosamine",color:16162465,type:_t.Hexosamine},{abbr:"AllN",name:"Allosamine",color:10830745,type:_t.Hexosamine},{abbr:"TalN",name:"Talosamine",color:9424105,type:_t.Hexosamine},{abbr:"IdoN",name:"Idosamine",color:10582605,type:_t.Hexosamine},{abbr:"GlcA",name:"Glucuronic Acid",color:37052,type:_t.Hexuronate},{abbr:"ManA",name:"Mannuronic Acid",color:42577,type:_t.Hexuronate},{abbr:"GalA",name:"Galacturonic Acid",color:16765952,type:_t.Hexuronate},{abbr:"GulA",name:"Guluronic Acid",color:16021792,type:_t.Hexuronate},{abbr:"AltA",name:"Altruronic Acid",color:16162465,type:_t.Hexuronate},{abbr:"AllA",name:"Alluronic Acid",color:10830745,type:_t.Hexuronate},{abbr:"TalA",name:"Taluronic Acid",color:9424105,type:_t.Hexuronate},{abbr:"IdoA",name:"Iduronic Acid",color:10582605,type:_t.Hexuronate},{abbr:"Qui",name:"Quinovose",color:37052,type:_t.Deoxyhexose},{abbr:"Rha",name:"Rhamnose",color:42577,type:_t.Deoxyhexose},{abbr:"6dGul",name:"6-Deoxy Gulose",color:16021792,type:_t.Deoxyhexose},{abbr:"6dAlt",name:"6-Deoxy Altrose",color:16162465,type:_t.Deoxyhexose},{abbr:"6dTal",name:"6-Deoxy Talose",color:9424105,type:_t.Deoxyhexose},{abbr:"Fuc",name:"Fucose",color:15539236,type:_t.Deoxyhexose},{abbr:"QuiNAc",name:"N-Acetyl Quinovosamine",color:37052,type:_t.DeoxyhexNAc},{abbr:"RhaNAc",name:"N-Acetyl Rhamnosamine",color:42577,type:_t.DeoxyhexNAc},{abbr:"6dAltNAc",name:"N-Acetyl 6-Deoxy Altrosamine",color:16162465,type:_t.DeoxyhexNAc},{abbr:"6dTalNAc",name:"N-Acetyl 6-Deoxy Talosamine",color:9424105,type:_t.DeoxyhexNAc},{abbr:"FucNAc",name:"N-Acetyl Fucosamine",color:15539236,type:_t.DeoxyhexNAc},{abbr:"Oli",name:"Olivose",color:37052,type:_t.DiDeoxyhexose},{abbr:"Tyv",name:"Tyvelose",color:42577,type:_t.DiDeoxyhexose},{abbr:"Abe",name:"Abequose",color:16021792,type:_t.DiDeoxyhexose},{abbr:"Par",name:"Paratose",color:16162465,type:_t.DiDeoxyhexose},{abbr:"Dig",name:"Digitoxose",color:10830745,type:_t.DiDeoxyhexose},{abbr:"Col",name:"Colitose",color:9424105,type:_t.DiDeoxyhexose},{abbr:"Ara",name:"Arabinose",color:42577,type:_t.Pentose},{abbr:"Lyx",name:"Lyxose",color:16765952,type:_t.Pentose},{abbr:"Xyl",name:"Xylose",color:16021792,type:_t.Pentose},{abbr:"Rib",name:"Ribose",color:16162465,type:_t.Pentose},{abbr:"Kdn",name:"Keto-Deoxy Nonulonic Acid",color:42577,type:_t.Deoxynonulosonate},{abbr:"Neu5Ac",name:"N-Acetyl Neuraminic Acid",color:10830745,type:_t.Deoxynonulosonate},{abbr:"Neu5Gc",name:"N-Glycolyl Neuraminic Acid",color:9424105,type:_t.Deoxynonulosonate},{abbr:"Neu",name:"Neuraminic Acid",color:10582605,type:_t.Deoxynonulosonate},{abbr:"Sia",name:"Sialic acid",color:15539236,type:_t.Deoxynonulosonate},{abbr:"Pse",name:"Pseudaminic Acid",color:42577,type:_t.DiDeoxynonulosonate},{abbr:"Leg",name:"Legionaminic Acid",color:16765952,type:_t.DiDeoxynonulosonate},{abbr:"Aci",name:"Acinetaminic Acid",color:16162465,type:_t.DiDeoxynonulosonate},{abbr:"4eLeg",name:"4-Epilegionaminic Acid",color:9424105,type:_t.DiDeoxynonulosonate},{abbr:"Bac",name:"Bacillosamine",color:37052,type:_t.Unknown},{abbr:"LDmanHep",name:"L-Glycero-D-Manno Heptose",color:42577,type:_t.Unknown},{abbr:"Kdo",name:"Keto-Deoxy Octulonic Acid",color:16765952,type:_t.Unknown},{abbr:"Dha",name:"3-Deoxy Lyxo-Heptulosaric Acid",color:16021792,type:_t.Unknown},{abbr:"DDmanHep",name:"D-Glycero-D-Manno-Heptose",color:16162465,type:_t.Unknown},{abbr:"MurNAc",name:"N-Acetyl Muramic Acid",color:10830745,type:_t.Unknown},{abbr:"MurNGc",name:"N-Glycolyl Muramic Acid",color:9424105,type:_t.Unknown},{abbr:"Mur",name:"Muramic Acid",color:10582605,type:_t.Unknown},{abbr:"Api",name:"Apicose",color:42577,type:_t.Assigned},{abbr:"Fru",name:"Fructose",color:42577,type:_t.Assigned},{abbr:"Tag",name:"Tagatose",color:16765952,type:_t.Assigned},{abbr:"Sor",name:"Sorbose",color:16021792,type:_t.Assigned},{abbr:"Psi",name:"Psicose",color:16162465,type:_t.Assigned}],sBe=function(){for(var e=new Map,t=0,r=J0.length;t=26;)r=Math.floor(r/26),a+=A4[r%26],n+=1;return n>=5&&console.warn("getChainId overflow"),a}),xl=function(){function e(){this.count=0,this.ids=[],this.types=[],this.descriptions=[],this.compoundsMap=new Map,this.namesMap=new Map,this.heteroMap=new Map,this.chainMap=new Map}return e.prototype.set=function(t,r){this.count+=1,this.ids.push("".concat(this.count)),this.types.push(t),this.descriptions.push([r])},e.prototype.getEntityId=function(t,r,n,a){return 2===r?(void 0===this.waterId&&(this.set("water",a?.customName||"Water"),this.waterId="".concat(this.count)),this.waterId):RA(r)?this.compoundsMap.has(n)?this.compoundsMap.get(n):(this.chainMap.has(n)||(this.set("polymer",a?.customName||"Polymer ".concat(this.chainMap.size+1)),this.chainMap.set(n,"".concat(this.count))),this.chainMap.get(n)):(this.heteroMap.has(t)||(this.set("non-polymer",a?.customName||this.namesMap.get(t)||t),this.heteroMap.set(t,"".concat(this.count))),this.heteroMap.get(t))},e.prototype.getEntityTable=function(){return Xr.ofPartialColumns(To.entity,{id:ie.ofStringArray(this.ids),type:ie.ofStringAliasArray(this.types),pdbx_description:ie.ofStringListArray(this.descriptions)},this.count)},e.prototype.setCompounds=function(t){for(var r=0,n=t.length;r1&&mZ(e,s,r,n-1,a)}!function(e){e.areEqual=function t(d,f){if(d===f)return!0;if(d.vertexCount!==f.vertexCount||d.edgeCount!==f.edgeCount)return!1;for(var p=d.a,m=d.b,h=d.offset,v=f.a,g=f.b,y=f.offset,S=0,C=d.a.length;Sp&&(m=p,h=f);var v=Ou(m,h);return!this.included.has(v)&&(this.included.add(v),this.xs[this.xs.length]=m,this.ys[this.ys.length]=h,!0)},d.prototype.getGraph=function(){return s(this.vertexCount,this.xs,this.ys)},d.prototype.getEdgeBuiler=function(){return new a(this.vertexCount,this.xs,this.ys)},d}();function s(d,f,p){var m=new e.EdgeBuilder(d,f,p);return m.addAllEdges(),m.createGraph({})}e.UniqueEdgeBuilder=o,e.fromVertexPairs=s,e.induceByVertices=function u(d,f,p){for(var m=d.b,h=d.offset,v=d.vertexCount,g=d.edgeProps,y=new Int32Array(v),S=0,C=f.length;SS&&0!==y[m[x]]&&_++;var w=new Int32Array(f.length+1),A=new Int32Array(2*_),E=new Int32Array(2*_),I=new Int32Array(2*_),M=0,F=0;for(S=0;S0;){for(var x=C.pop(),D=v[x],w=y[x],A=y[x+1];w=0&&(C.push(_.head),v[_.head]=++g,_.remove(_.head))}return{componentCount:f,componentIndex:v}},e.areVertexSetsConnected=function l(d,f,p,m){if(Ye.areIntersecting(f,p))return!0;if(m<1)return!1;for(var h=new Set,v=0,g=f.length;v".concat(o," #").concat(s)),v.push("".concat(l,"\xd7").concat(d,"\xd7").concat(f," \u212b")),v.push("\u03b1=".concat(p,"\xb0 \u03b2=").concat(m,"\xb0 \u03b3=").concat(h,"\xb0")),v.join(" | ")}}(KS||(KS={})),function(e){e.create=function t(r,n,a,i){return{id:kn.create22(),label:r,basic:n,sourceData:i,bonds:a}}}(ZS||(ZS={}));var QS,D4,at,Te,$i,Gt,zr,zBe={HIS:"H",ARG:"R",LYS:"K",ILE:"I",PHE:"F",LEU:"L",TRP:"W",ALA:"A",MET:"M",PRO:"P",CYS:"C",ASN:"N",VAL:"V",GLY:"G",SER:"S",GLN:"Q",TYR:"Y",ASP:"D",GLU:"E",THR:"T",SEC:"U",PYL:"O",HSD:"H",HSE:"H",HSP:"H",LSN:"K",ASPP:"D",GLUP:"E",HID:"H",HIE:"H",HIP:"H",LYN:"K",ASH:"D",GLH:"E"},HBe={DA:"A",DC:"C",DG:"G",DT:"T",DU:"U"},jBe={A:"A",C:"C",G:"G",T:"T",U:"U"};function hZ(e){return zBe[e]||"X"}function vZ(e){return jBe[e]||"X"}function gZ(e){return HBe[e]||"X"}function ft(e,t){var r=t||{},n=r.description,i=r.isOptional,s=r.isRest,c=r.defaultValue;return{type:e,isOptional:void 0!==i&&i,isRest:void 0!==s&&s,defaultValue:void 0===c?void 0:c,description:void 0===n?void 0:n}}function $S(e,t,r,n){var a=function(i){return $i.Apply($i.Symbol(a.id),i)};return a.info={namespace:"",name:e,description:n},a.id="",a.args=t,a.type=r,a}function yZ(e,t,r,n){var a=function(i){return $i.Apply($i.Symbol(a.id),i)};return a.info={namespace:e,name:t,description:n},a.id="".concat(e,".").concat(t),a.args=Gt.None,a.type=r,a}function FA(e){return"function"==typeof e&&!!e.info&&!!e.args&&"string"==typeof e.info.namespace&&!!e.type}function Kt(e,t,r){return $S("",e,t,r)}function bZ(e){xZ("","",e)}function SZ(e){var t=[];return _Z(e,t),t}function CZ(e){var t=/([a-z])([A-Z])([a-z]|$)/g;return e.replace(t,function(r,n,a,i){return"".concat(n,"-").concat(a.toLocaleLowerCase()).concat(i)}).replace(t,function(r,n,a,i){return"".concat(n,"-").concat(a.toLocaleLowerCase()).concat(i)})}function xZ(e,t,r){if(FA(r))return r.info.namespace=e,r.info.name=r.info.name||CZ(t),void(r.id="".concat(r.info.namespace,".").concat(r.info.name));for(var n="".concat(r["@namespace"]||CZ(t)),a=e?"".concat(e,".").concat(n):n,i=0,o=Object.keys(r);i0?function(f){var p=d(f);return"X"===p&&l.has(f)?d(l.get(f)):p}:d}(l),m=[],h=[],v=[],g=new Map,y=0,S=new Map,C=0,_=f.rowCount;C<_;++C){var x=f.value(C);if(S.has(x))g.has(x)?g.get(x).push(d.value(C)):g.set(x,[h[S.get(x)],d.value(C)]);else{S.set(x,y);var D=d.value(C);h[y]=D,v[y]=x,m[y]=p(D),y+=1}}var w=[];for(C=0,_=y;C<_;++C){var A=g.get(v[C]);if(A){var E=A.map(function(F){var N=p(F);return"X"===N?F:N});w[C]="(".concat(E.join("|"),")")}else w[C]="X"===m[C]?h[C]:m[C]}this.length=y,this.code=ie.ofStringArray(m),this.compId=ie.ofStringArray(h),this.seqId=ie.ofIntArray(v),this.label=ie.ofStringArray(w),this.microHet=g,this.indexMap=S}return c.prototype.index=function(l){return this.indexMap.get(l)},c}();e.ofSequenceRanges=function s(c,l){return new u(t.Generic,c,l)};var u=function(){function c(l,d,f){this.kind=l,this.seqIdStart=d,this.seqIdEnd=f,this.microHet=new Map;for(var p=0,m=Number.MAX_SAFE_INTEGER,h=0,v=this.seqIdStart.rowCount;h= 2nd and <= 3rd.")},math:{"@header":"Math",add:mm(Te.Num),sub:mm(Te.Num),mult:mm(Te.Num),div:Pc(Te.Num,Te.Num),pow:Pc(Te.Num,Te.Num),mod:Pc(Te.Num,Te.Num),min:mm(Te.Num),max:mm(Te.Num),cantorPairing:Pc(Te.Num,Te.Num),sortedCantorPairing:Pc(Te.Num,Te.Num),invertCantorPairing:Kt(Gt.Dictionary({0:ft(Te.Num)}),zr.List(Te.Num)),floor:Fi(Te.Num),ceil:Fi(Te.Num),roundInt:Fi(Te.Num),trunc:Fi(Te.Num),abs:Fi(Te.Num),sign:Fi(Te.Num),sqrt:Fi(Te.Num),cbrt:Fi(Te.Num),sin:Fi(Te.Num),cos:Fi(Te.Num),tan:Fi(Te.Num),asin:Fi(Te.Num),acos:Fi(Te.Num),atan:Fi(Te.Num),sinh:Fi(Te.Num),cosh:Fi(Te.Num),tanh:Fi(Te.Num),exp:Fi(Te.Num),log:Fi(Te.Num),log10:Fi(Te.Num),atan2:Pc(Te.Num,Te.Num)},str:{"@header":"Strings",concat:mm(Te.Str),match:Kt(Gt.Dictionary({0:ft(zr.Regex),1:ft(Te.Str)}),Te.Bool)},list:{"@header":"Lists",getAt:Kt(Gt.Dictionary({0:ft(zr.List()),1:ft(Te.Num)}),zr.AnyVar),equal:Kt(Gt.Dictionary({0:ft(zr.List()),1:ft(zr.List())}),Te.Bool)},set:{"@header":"Sets",has:Kt(Gt.Dictionary({0:ft(zr.Set(zr.ConstrainedVar)),1:ft(zr.ConstrainedVar)}),Te.Bool,"Check if the the 1st argument includes the value of the 2nd."),isSubset:Kt(Gt.Dictionary({0:ft(zr.Set(zr.ConstrainedVar)),1:ft(zr.Set(zr.ConstrainedVar))}),Te.Bool,"Check if the the 1st argument is a subset of the 2nd.")},flags:{"@header":"Flags",hasAny:Kt(Gt.Dictionary({0:ft(zr.Flags(zr.ConstrainedVar)),1:ft(zr.Flags(zr.ConstrainedVar))}),Te.Bool,"Check if the the 1st argument has at least one of the 2nd one's flags."),hasAll:Kt(Gt.Dictionary({0:ft(zr.Flags(zr.ConstrainedVar)),1:ft(zr.Flags(zr.ConstrainedVar))}),Te.Bool,"Check if the the 1st argument has all 2nd one's flags.")}};bZ(E4);var Tt,eNe=SZ(E4);function Nr(e,t){return Kt(Gt.Dictionary({0:ft(Tt.ElementReference,{isOptional:!0,defaultValue:"slot.current-atom"})}),e,t)}function ty(e,t){return Kt(Gt.None,e,t)}!function(){for(var e=Object.create(null),t=0,r=eNe;t0?a:t<0?r:(r+n)/1.95}var bNe=P4.H;function $f(e){return e===bNe}var SNe=new Map([["HIS|CD2|CG",2],["HIS|CE1|ND1",2],["ARG|CZ|NH2",2],["PHE|CE1|CZ",2],["PHE|CD2|CE2",2],["PHE|CD1|CG",2],["TRP|CD1|CG",2],["TRP|CD2|CE2",2],["TRP|CE3|CZ3",2],["TRP|CH2|CZ2",2],["ASN|CG|OD1",2],["GLN|CD|OE1",2],["TYR|CD1|CG",2],["TYR|CD2|CE2",2],["TYR|CE1|CZ",2],["ASP|CG|OD1",2],["GLU|CD|OE1",2],["G|C8|N7",2],["G|C4|C5",2],["G|C2|N3",2],["G|C6|O6",2],["C|C4|N3",2],["C|C5|C6",2],["C|C2|O2",2],["A|C2|N3",2],["A|C6|N1",2],["A|C4|C5",2],["A|C8|N7",2],["U|C5|C6",2],["U|C2|O2",2],["U|C4|O4",2],["DG|C8|N7",2],["DG|C4|C5",2],["DG|C2|N3",2],["DG|C6|O6",2],["DC|C4|N3",2],["DC|C5|C6",2],["DC|C2|O2",2],["DA|C2|N3",2],["DA|C6|N1",2],["DA|C4|C5",2],["DA|C8|N7",2],["DT|C5|C6",2],["DT|C2|O2",2],["DT|C4|O4",2]]);function CNe(e,t,r){var n;return t=(n=tr&&(e=(a=[r,e])[0],r=a[1],t=(i=[n,t])[0],n=i[1]),xNe.get("".concat(e,"|").concat(t,"|").concat(r,"|").concat(n))||1}function O4(e){return function(t,r){return r[e].value(t)}}function _Ne(e){return function(t,r){return r[e].value(t).join(r[e].schema.separator)}}function F4(e){for(var t=[],r=1;r 3 or rank 0 are currently not supported.");var d=t.dimensions[0],f=t.dimensions[1],p=t.dimensions[2];for(o=0;o0});return n.length?{instance:r,rowCount:n.reduce(function(o,s){return o+s.rowCount},0),source:n.map(function(o){return{data:o.data,keys:function(){return o.keys?o.keys():nA.Range(0,o.rowCount-1)},rowCount:o.rowCount}})}:{instance:r,rowCount:0,source:[]}}!function(e){function r(s,u,c){return{name:s,type:1,value:u,valueKind:c&&c.valueKind,defaultFormat:c?{encoder:c.encoder,typedArray:c.typedArray}:void 0,shouldInclude:c&&c.shouldInclude}}e.str=function t(s,u,c){return{name:s,type:0,value:u,valueKind:c&&c.valueKind,defaultFormat:c&&c.encoder?{encoder:c.encoder}:void 0,shouldInclude:c&&c.shouldInclude}},e.int=r,e.float=function n(s,u,c){return{name:s,type:2,value:u,valueKind:c&&c.valueKind,defaultFormat:c?{encoder:c.encoder,typedArray:c.typedArray,digitCount:typeof c.digitCount<"u"?c.digitCount:void 0}:void 0,shouldInclude:c&&c.shouldInclude}},e.index=function a(s){return r(s,function(u,c,l){return l+1},{typedArray:Int32Array,encoder:Fr.by(Fr.delta).and(Fr.runLength).and(Fr.integerPacking)})};var i=function(){function s(){this.fields=[]}return s.prototype.index=function(u){return this.fields.push(e.index(u)),this},s.prototype.str=function(u,c,l){return this.fields.push(e.str(u,c,l)),this},s.prototype.int=function(u,c,l){return this.fields.push(e.int(u,c,l)),this},s.prototype.vec=function(u,c,l){for(var d=0;d=0}(u)?(NA(e,u),!0):function FNe(e,t){if(!t)return tn.writeSafe(e,". "),!1;for(var r=t.charCodeAt(0),n=!1,a=0,i=!1,o=!1,s=0,u=t.length-1;s<=u;s++)switch(t.charCodeAt(s)){case 9:case 32:n=!0;break;case 10:return NA(e,t),!0;case 34:if(s&&s===u)break;if(i)return NA(e,t),!0;o=!0,n=!0,a=0;break;case 39:if(s&&s===u)break;if(o)return NA(e,t),!0;i=!0,n=!0,a=1}return!n&&(35===r||36===r||59===r||91===r||93===r||95===r)&&(n=!0),n?(tn.writeSafe(e,a?'"':"'"),tn.writeSafe(e,t),tn.writeSafe(e,a?'" ':"' ")):(tn.writeSafe(e,t),tn.writeSafe(e," ")),!1}(e,u);1===c?function PNe(e,t){tn.writeInteger(e,t),tn.whitespace1(e)}(e,u):function MNe(e,t,r){tn.writeFloat(e,t,r),tn.whitespace1(e)}(e,u,a)}return!1}function MZ(e,t,r){for(var n=[],a=0,i=t;a=0){if(e<128)return 1;if(e<256)return 2;if(e<65536)return 3;if(e<4294967296)return 5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return 1;if(e>=-128)return 2;if(e>=-32768)return 3;if(e>=-2147483648)return 5;throw new Error("Number too small -0x"+e.toString(16).substr(1))}if("boolean"===t||null==e)return 1;if("object"===t){var a,i=0;if(Array.isArray(e)){a=e.length;for(var o=0;o=0){if(e<128)return t.setUint8(n,e),1;if(e<256)return t.setUint8(n,204),t.setUint8(n+1,e),2;if(e<65536)return t.setUint8(n,205),t.setUint16(n+1,e),3;if(e<4294967296)return t.setUint8(n,206),t.setUint32(n+1,e),5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return t.setInt8(n,e),1;if(e>=-128)return t.setUint8(n,208),t.setInt8(n+1,e),2;if(e>=-32768)return t.setUint8(n,209),t.setInt16(n+1,e),3;if(e>=-2147483648)return t.setUint8(n,210),t.setInt32(n+1,e),5;throw new Error("Number too small -0x"+(-e).toString(16).substr(1))}if(null==e)return t.setUint8(n,192),1;if("boolean"===a)return t.setUint8(n,e?195:194),1;if("object"===a){var u,c=0,l=Array.isArray(e),d=void 0;if((u=l?e.length:(d=Object.keys(e)).length)<16?(t.setUint8(n,u|(l?144:128)),c=1):u<65536?(t.setUint8(n,l?220:222),t.setUint16(n+1,u),c=3):u<4294967296&&(t.setUint8(n,l?221:223),t.setUint32(n+1,u),c=5),l)for(var f=0;f=0)return!0;return!1}e.Descriptor={name:"struct_conn",cifExport:{prefix:"",categories:[{name:"struct_conn",instance:function(i){var o=e.Provider.get(i.firstModel);if(!o||0===o.entries.length)return Pa.Category.Empty;for(var s=i.structures[0],u=[],c=0,l=o.entries;c.95},e.getAtomIndexFromEntries=function n(i){for(var o=new Map,s=0,u=i;sne)){if(!r.forceCompute&&N){for(var K=N.maxDistance,q=N.bonds,V=q.offset,ee=q.b,ae=q.edgeProps,pe=ae.order,me=ae.distance,de=ae.flag,re=ae.key,te=ae.operatorA,le=ae.operatorB,ge=j.value($),xe=_d(h.value($)),Ge=V[ge],je=V[ge+1];Ge=0&&ye!==Y&&ye!==k||we>=0&&we!==k&&we!==Y)){var De=_d(h.value(L)),Oe=me[Ge],Ne=LZ(e,$,t,L),Ue=!1;Oe>=0?Ue=ea(Ne,Oe,.3):K>=0?Ue=Nea||(n.add(W,Q,{order:ut.order,flag:ut.flags,key:ut.rowIndex}),He=!0)}if(He)continue}if(!H){var it=E.value($),bt=t.lookup3d.find(tv[0],tv[1],tv[2],a),Mt=bt.indices,Rt=bt.count,oe=bt.squaredDistances;if(0!==Rt)for(var be=_d(h.value($)),Ce=$f(be),Qe=hm(be),Et=v.value($),At=e2.has(be),Zt=g.value($),Dr=y.value(o[$]),tr=0;tr=t.elements.length?e:t).elements,s=Ye.indexOf,u=0,c=i.length;u=0)return!0}}return!1}(a,i)}}))}function UZ(e){e.count=e.endVertex-e.startVertex;for(var t=e.isRingAtom,r=e.pred,n=e.color,a=e.depth,i=e.marked,o=0;o=0;l--)v[g++]=e.startVertex+s[l],n[s[l]]=1;bc(v);for(var y=0,S=e.currentRings.length;yC.length&&Ye.isSubset(v,C))return!1}return e.currentRings.push(Ye.ofSortedArray(v)),!0}function zZ(e,t,r){var n=e.bonds,a=e.startVertex,i=e.endVertex,o=e.isRingAtom,s=e.marked,u=e.queue,c=e.pred,l=e.depth,d=e.unit.elements,f=n.b,p=n.edgeProps.flags,m=n.offset;s[t]=r,l[t]=0,u[0]=t;for(var h=0,v=1;h=i)&&Gr.isCovalent(p[x])){if(e.hasAltLoc){var w=e.altLoc.value(d[D]);if(w&&e.currentAltLoc!==w)continue}var A=D-a;if(s[A]===r){if(c[A]!==g&&c[g]!==A&&cke(e,g,A,o))return r+1;continue}var E=Math.min(l[A],y+1);E>5||(l[A]=E,s[A]=r,u[v++]=A,c[A]=g)}}return r+1}function HZ(e){for(var t=e.length,r=new Int32Array(2*t),n=0;n=v||f.addEdge(a,v)}}}var g=fu.connectedComponents(f.getGraph()),y=g.componentIndex,S=[];for(s=0;s=0&&(r.has(s)?r.get(s).push(o):r.set(s,[o]))}}(function(e){function r(s){return function lke(e){for(var t=e.length,r=new Array(t),n=0;n0)return!1;var w=gl.calculateMomentsAxes(WZ(s,u));return b.magnitude(w.dirC)<.05},e.getAltId=function o(s,u){for(var c=s.model.atomicHierarchy.atoms.label_alt_id,l=s.elements,d=0,f=u.length;dke.max(_)||i(C)25e4)return k4(e);var s=function Dke(e){return e>1e4?Ake:Tke}(o);s.reset();for(var u=0;u=2){d(f,m[0],m[1]);for(var y=1,S=m.length;y=j)){var U=Ye.indexOf(e.elements,j);if(!(U<0)){var H=m[F],z=h[F];if(!(H>=0&&H!==D||z>=0&&z!==D)){var G=_d(n.value(j)),J=d[F],X=jNe(e,A,j),Z=!1;J>=0?Z=ea(X,J,.3):i>=0?Z=X1&&(U=!1)}}}}}}}}return OZ(D,w,E,A,I,s,N||j&&U)}(e,r)}(this),G.set(this.elements,J)),this.props.bonds=J,this.props.bonds},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"rings",{get:function(){return this.props.rings||(this.props.rings=UA.create(this)),this.props.rings},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"resonance",{get:function(){return this.props.resonance||(this.props.resonance=function Ike(e){return{delocalizedTriplets:Pke(e)}}(this)),this.props.resonance},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"polymerElements",{get:function(){return this.props.polymerElements||(this.props.polymerElements=function yke(e){for(var t=[],r=e.elements,a=e.model.atomicHierarchy.residueAtomSegments,i=e.model.atomicHierarchy.derived.residue.traceElementIndex,o=Cn.transientSegments(e.model.atomicRanges.polymerRanges,r),s=pr.transientSegments(a,r);o.hasNext;){var u=o.move();for(s.setSegment(u);s.hasNext;){var c=s.move(),f=c.index;if(ke.areIntersecting(_e.ofRange(r[c.start],r[c.end-1]),r)){var p=i[f];t.push(-1===p?a.offsets[f]:p)}}}return Ye.ofSortedArray(t)}(this)),this.props.polymerElements},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"gapElements",{get:function(){return this.props.gapElements||(this.props.gapElements=function Ske(e){for(var t=[],r=e.elements,a=e.residueIndex,i=e.model.atomicHierarchy.residueAtomSegments,o=e.model.atomicHierarchy.derived.residue.traceElementIndex,s=Cn.transientSegments(e.model.atomicRanges.gapRanges,e.elements);s.hasNext;){var u=s.move(),c=a[r[u.start]],l=a[r[u.end-1]],d=o[c],f=o[l];t.push(-1===d?i.offsets[c]:d),t.push(-1===f?i.offsets[l]:f)}return Ye.ofSortedArray(t)}(this)),this.props.gapElements},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"nucleotideElements",{get:function(){return this.props.nucleotideElements||(this.props.nucleotideElements=function xke(e){for(var t=[],r=e.elements,n=e.model,a=n.atomicHierarchy,o=a.residueAtomSegments,s=n.atomicHierarchy.derived.residue,u=s.moleculeType,c=s.traceElementIndex,l=pr.transientSegments(a.chainAtomSegments,r),d=pr.transientSegments(o,r);l.hasNext;)for(d.setSegment(l.move());d.hasNext;){var f=d.move().index;if(xd(u[f])){var p=c[f];t.push(-1===p?o.offsets[f]:p)}}return Ye.ofSortedArray(t)}(this)),this.props.nucleotideElements},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"proteinElements",{get:function(){return this.props.proteinElements||(this.props.proteinElements=function _ke(e){for(var t=[],r=e.elements,n=e.model,a=n.atomicHierarchy,o=a.residueAtomSegments,s=n.atomicHierarchy.derived.residue,u=s.moleculeType,c=s.traceElementIndex,l=pr.transientSegments(a.chainAtomSegments,r),d=pr.transientSegments(o,r);l.hasNext;)for(d.setSegment(l.move());d.hasNext;){var f=d.move().index;if(cZ(u[f])){var p=c[f];t.push(-1===p?o.offsets[f]:p)}}return Ye.ofSortedArray(t)}(this)),this.props.proteinElements},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"residueCount",{get:function(){if(void 0!==this.props.residueCount)return this.props.residueCount;for(var G=0,J=pr.transientSegments(this.model.atomicHierarchy.residueAtomSegments,this.elements);J.hasNext;)J.move(),G+=1;return this.props.residueCount=G,this.props.residueCount},enumerable:!1,configurable:!0}),z.prototype.getResidueIndex=function(G){return this.residueIndex[this.elements[G]]},z}();e.Atomic=g;var S=function(){function z(G,J,X,Z,ne,Y,k,W,$){this.kind=Y,this.objectPrimitive=1===Y?"sphere":"gaussian",this.id=G,this.invariantId=J,this.chainGroupId=X,this.traits=Z,this.model=ne,this.elements=k,this.conformation=W,this.coarseElements=1===Y?ne.coarseHierarchy.spheres:ne.coarseHierarchy.gaussians,this.coarseConformation=1===Y?ne.coarseConformation.spheres:ne.coarseConformation.gaussians,this.props=$}return z.prototype.getChild=function(G){return G.length===this.elements.length?this:w(this.id,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,G,this.conformation,{})},z.prototype.applyOperator=function(G,J,X){void 0===X&&(X=!1);var Z=X?J:ra.compose(this.conformation.operator,J);return w(G,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,this.elements,ra.createMapping(Z,this.getCoarseConformation(),this.conformation.r),this.props)},z.prototype.remapModel=function(G,J,X){var Z=this.getCoarseConformation(),ne=C(this.kind,G);X||(X=R({},this.props),e.isSameConformation(this,G)||(X.boundary=void 0,X.lookup3d=void 0,X.principalAxes=void 0));var Y=Z!==ne?ra.createMapping(this.conformation.operator,ne):this.conformation;return new z(this.id,this.invariantId,this.chainGroupId,this.traits,G,this.kind,this.elements,Y,X)},Object.defineProperty(z.prototype,"boundary",{get:function(){if(this.props.boundary)return this.props.boundary;var G=this.getCoarseConformation(),J=G.x,X=G.y,Z=G.z;return this.props.boundary=p.is(this.traits,f.FastBoundary)?k4({x:J,y:X,z:Z,indices:this.elements}):Jf({x:J,y:X,z:Z,indices:this.elements}),this.props.boundary},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"lookup3d",{get:function(){if(this.props.lookup3d)return this.props.lookup3d;var G=this.getCoarseConformation();return this.props.lookup3d=Df({x:G.x,y:G.y,z:G.z,indices:this.elements},this.boundary),this.props.lookup3d},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"principalAxes",{get:function(){return this.props.principalAxes||(this.props.principalAxes=XZ(this)),this.props.principalAxes},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"polymerElements",{get:function(){return this.props.polymerElements||(this.props.polymerElements=function bke(e){for(var t=[],r=e.elements,a=e.model.coarseHierarchy,i=a.spheres,o=a.gaussians,s=Fe.isSpheres(e)?i.polymerRanges:o.polymerRanges,u=Cn.transientSegments(s,r);u.hasNext;)for(var c=u.move(),d=c.end,f=c.start;f=a},i.closeUnitsResult);if(0===l.count)return o;for(var d=0,f=-Number.MAX_VALUE,p=0,m=l.count;p=a&&fo||u.addElement(y[g.indices[S]])}u.commitUnit()}}},e.prototype.check=function(t,r,n,a){var i=this.structure.units,o=this.unitLookup.find(t,r,n,a);if(0===o.count)return!1;for(var s=0,u=o.count;s0&&(a[a.length]=s.getChild(c))}else a[a.length]=s}return Ze.create(a,{parent:e.parent||t.parent})}function U4(e){return Gr.isCovalent(e.atomicBond.type)}function Fke(){return function(t){for(var r=t.inputStructure,n=at.create(r),a=[],i=0,o=r.units;i=8)continue}a.push(s)}}}return ht.Singletons(r,Ze.create(a,{parent:r}))}}function kke(){return function(t){for(var r=t.inputStructure,n=[],a=0,i=r.units;a2)g.push(v[_],v[x-1]);else for(var D=_;DCn.max(h.ranges)){for(Cn.forEach(h.ranges,function(U,H){return A[H]=x[U]}),I=0,M=w;IYe.max(h.set)){for(I=0,M=w;I0?this.currentAtomicBondStack.pop():void 0},e.prototype.pushCurrentStructure=function(){this.currentStructure&&this.currentStructureStack.push(this.currentStructure)},e.prototype.popCurrentStructure=function(){this.currentStructure=this.currentStructureStack.length?this.currentStructureStack.pop():void 0},e.prototype.pushInputStructure=function(t){this.inputStructureStack.push(this.inputStructure),this.inputStructure=t},e.prototype.popInputStructure=function(){if(0===this.inputStructureStack.length)throw new Error("Must push before pop.");this.inputStructure=this.inputStructureStack.pop()},e.prototype.throwIfTimedOut=function(){if(0!==this.timeoutMs&&ia()-this.timeCreated>this.timeoutMs)throw new Error("The query took too long to execute (> ".concat(this.timeoutMs/1e3,"s)."))},e.prototype.tryGetCurrentSelection=function(){if(!this.currentSelection)throw new Error("The current selection is not assigned.");return this.currentSelection},e}(),eQ=function(){function e(){this.a=at.create(void 0),this.aIndex=0,this.b=at.create(void 0),this.bIndex=0,this.type=0,this.order=0,this.key=-1,this.testFn=U4}return e.prototype.setStructure=function(t){this.a.structure=t,this.b.structure=t},e.prototype.setTestFn=function(t){this.testFn=t||U4},e.prototype.test=function(t,r){return!!this.testFn(t)||!!r&&(this.swap(),this.testFn(t))},e.prototype.swap=function(){var t=this.aIndex;this.aIndex=this.bIndex,this.bIndex=t;var r=this.a.unit;this.a.unit=this.b.unit,this.b.unit=r;var n=this.a.element;this.a.element=this.b.element,this.b.element=n},Object.defineProperty(e.prototype,"length",{get:function(){return at.distance(this.a,this.b)},enumerable:!1,configurable:!0}),e}();!function(e){e.run=function t(r,n,a){return r(new Rc(n,a))}}(tQ||(tQ={}));var V4=function(){function e(t){this.source=t,this.set=tF(Ze.hashCode,Ze.areUnitIdsAndIndicesEqual),this.structures=[],this.allSingletons=!0}return e.prototype.add=function(t){t.elementCount&&(1!==t.elementCount&&(this.allSingletons=!1),this.set.add(t)&&(this.structures[this.structures.length]=t))},e.prototype.getSelection=function(){return this.allSingletons?ht.Singletons(this.source,r2(this.source,this.structures)):ht.Sequence(this.source,this.structures)},e}(),Lke=function(){function e(t){this.source=t,this.builders=[],this.builderMap=new Map}return e.prototype.add=function(t,r,n){var a=this.builderMap.get(t);a||(a=this.source.subsetBuilder(!0),this.builders[this.builders.length]=a,this.builderMap.set(t,a)),a.addToUnit(r,n)},e.prototype.allSingletons=function(){for(var t=0,r=this.builders.length;t1)return!1;return!0},e.prototype.singletonSelection=function(){for(var t=this.source.subsetBuilder(!0),r=at.create(this.source),n=0,a=this.builders.length;n0?En.create():this.currentUnit},e.prototype.addElement=function(t){En.add(this.currentUnit,t,t)&&this.elementCount++},e.prototype.commitUnit=function(){0===this.currentUnit.array.length||this.unitMap.has(this.parentId)||(this.ids[this.ids.length]=this.parentId,this.unitMap.set(this.parentId,this.currentUnit),this.parentId=-1)},e.prototype.getStructure=function(){if(this.isEmpty)return Ze.Empty;var t=[];bc(this.ids);for(var r=wd.UnitEquivalenceBuilder(),n=0,a=this.ids.length;n1&&bc(s);var c=o.getChild(Ye.ofSortedArray(s)),l=r.add(c.id,c);c!==l&&(c=l.applyOperator(c.id,c.conformation.operator,!0)),t[t.length]=c}else t[t.length]=o,r.add(o.id,o)}return Ze.create(t,{parent:this.parent})},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.elementCount},enumerable:!1,configurable:!0}),e}(),Xke={type_symbol:ie.Schema.Aliased(Br.atom_site.type_symbol),label_atom_id:Br.atom_site.label_atom_id,auth_atom_id:Br.atom_site.auth_atom_id,label_alt_id:Br.atom_site.label_alt_id,label_comp_id:Br.atom_site.label_comp_id,auth_comp_id:Br.atom_site.auth_comp_id,pdbx_formal_charge:Br.atom_site.pdbx_formal_charge},Kke={group_PDB:Br.atom_site.group_PDB,label_seq_id:Br.atom_site.label_seq_id,auth_seq_id:Br.atom_site.auth_seq_id,pdbx_PDB_ins_code:Br.atom_site.pdbx_PDB_ins_code},Zke={label_asym_id:Br.atom_site.label_asym_id,auth_asym_id:Br.atom_site.auth_asym_id,label_entity_id:Br.atom_site.label_entity_id};!function(e){e.EmptyResidueKey=function t(){return{label_entity_id:"",label_asym_id:"",auth_seq_id:0,pdbx_PDB_ins_code:void 0}}}(j4||(j4={})),function(e){function t(a,i){return a.residueAtomSegments.index[a.chainAtomSegments.offsets[i]]}function r(a,i){return a.residueAtomSegments.index[a.chainAtomSegments.offsets[i+1]-1]+1}e.chainStartResidueIndex=t,e.chainEndResidueIndexExcl=r,e.chainResidueCount=function n(a,i){return r(a,i)-t(a,i)}}(rv||(rv={}));var HA={H:1,D:1,T:1,HE:2,LI:3,BE:4,B:5,C:6,N:7,O:8,F:9,NE:10,NA:11,MG:12,AL:13,SI:14,P:15,S:16,CL:17,AR:18,K:19,CA:20,SC:21,TI:22,V:23,CR:24,MN:25,FE:26,CO:27,NI:28,CU:29,ZN:30,GA:31,GE:32,AS:33,SE:34,BR:35,KR:36,RB:37,SR:38,Y:39,ZR:40,NB:41,MO:42,TC:43,RU:44,RH:45,PD:46,AG:47,CD:48,IN:49,SN:50,SB:51,TE:52,I:53,XE:54,CS:55,BA:56,LA:57,CE:58,PR:59,ND:60,PM:61,SM:62,EU:63,GD:64,TB:65,DY:66,HO:67,ER:68,TM:69,YB:70,LU:71,HF:72,TA:73,W:74,RE:75,OS:76,IR:77,PT:78,AU:79,HG:80,TL:81,PB:82,BI:83,PO:84,AT:85,RN:86,FR:87,RA:88,AC:89,TH:90,PA:91,U:92,NP:93,PU:94,AM:95,CM:96,BK:97,CF:98,ES:99,FM:100,MD:101,NO:102,LR:103,RF:104,DB:105,SG:106,BH:107,HS:108,MT:109},Qke={1:1.1,2:1.4,3:1.81,4:1.53,5:1.92,6:1.7,7:1.55,8:1.52,9:1.47,10:1.54,11:2.27,12:1.73,13:1.84,14:2.1,15:1.8,16:1.8,17:1.75,18:1.88,19:2.75,20:2.31,21:2.3,22:2.15,23:2.05,24:2.05,25:2.05,26:2.05,27:2,28:2,29:2,30:2.1,31:1.87,32:2.11,33:1.85,34:1.9,35:1.83,36:2.02,37:3.03,38:2.49,39:2.4,40:2.3,41:2.15,42:2.1,43:2.05,44:2.05,45:2,46:2.05,47:2.1,48:2.2,49:2.2,50:1.93,51:2.17,52:2.06,53:1.98,54:2.16,55:3.43,56:2.68,57:2.5,58:2.48,59:2.47,60:2.45,61:2.43,62:2.42,63:2.4,64:2.38,65:2.37,66:2.35,67:2.33,68:2.32,69:2.3,70:2.28,71:2.27,72:2.25,73:2.2,74:2.1,75:2.05,76:2,77:2,78:2.05,79:2.1,80:2.05,81:1.96,82:2.02,83:2.07,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:2.4,91:2,92:2.3,93:2,94:2,95:2,96:2,97:2,98:2,99:2,100:2,101:2,102:2,103:2,104:2,105:2,106:2,107:2,108:2,109:2},$ke={1:1.008,2:4.0026,3:6.94,4:9.0122,5:10.81,6:10.81,7:14.007,8:15.999,9:18.998,10:20.18,11:22.99,12:24.305,13:26.982,14:28.085,15:30.974,16:32.06,17:35.45,18:39.948,19:39.098,20:40.078,21:44.956,22:47.867,23:50.942,24:51.996,25:54.938,26:55.845,27:58.933,28:58.693,29:63.546,30:65.38,31:69.723,32:72.63,33:74.922,34:78.971,35:79.904,36:83.798,37:85.468,38:87.62,39:88.906,40:91.224,41:92.906,42:95.95,43:96.906,44:101.07,45:102.91,46:106.42,47:107.87,48:112.41,49:114.82,50:118.71,51:121.76,52:127.6,53:127.6,54:131.29,55:132.91,56:137.33,57:138.91,58:140.12,59:140.91,60:144.24,61:144.912,62:150.36,63:151.96,64:157.25,65:158.93,66:162.5,67:164.93,68:167.26,69:168.93,70:173.05,71:174.97,72:178.49,73:180.95,74:183.84,75:186.21,76:190.23,77:192.22,78:195.08,79:196.97,80:200.59,81:204.38,82:207.2,83:208.98,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:232.04,91:231.04,92:238.03,93:237.048,94:244.064,95:243.061,96:247.07,97:247.07,98:251.079,99:252.083,100:257.095,101:258.098,102:259.101,103:262.11,104:267.122,105:270.131,106:271.134,107:270.133,108:270.134,109:278.156},Jke=1.7,tLe=0;function n2(e){var t=HA[e];return void 0===t?Jke:Qke[t]}function a2(e){var t=HA[e];return void 0===t?tLe:t}function nQ(e,t,r,n){return{type:e,key:t,elements:r,getIndex:n}}var mr,aLe=9,jA=-27.888,iLe=-.5,aQ=-9.9;function oLe(e,t,r,n){var a=b.distance(e,n),i=b.distance(t,n),o=b.distance(t,r),s=b.distance(e,r),l=jA/a-jA/i+(jA/o-jA/s);return l0&&(t.secondStart-e.secondEnd<6&&t.firstStart-e.firstEnd<3||t.secondStart-e.secondEnd<3)}function oQ(e){return mr.is(e,8)||mr.is(e,1)||mr.is(e,16)}var ep,nv,bLe={oldDefinition:T.Boolean(!0,{description:"Whether to use the old DSSP convention for the annotation of turns and helices, causes them to be two residues shorter"}),oldOrdering:T.Boolean(!0,{description:"Alpha-helices are preferred over 3-10 helices"})};function SLe(e,t){return ue(this,void 0,void 0,function(){var r,n,a,i,o,s,u,d,p,m,h,v,g,y,S,C,_,x;return ce(this,function(D){for(r=function yLe(e){for(var t=e.model.atomicHierarchy.index,r=e.proteinElements,n=e.residueIndex,a=r.length,i=new Uint32Array(a),o=new Int32Array(a),s=new Int32Array(a),u=new Int32Array(a),c=new Int32Array(a),l=0;liLe||(f[f.length]=w,p[p.length]=H,m[m.length]=Y)}}}}}return function uLe(e,t,r,n){for(var a=new fu.DirectedEdgeBuilder(e,t,r),i=new Float32Array(a.slotCount),o=0,s=a.edgeCount;o6.25)continue e}var w=i[o[g]],A=i[o[g+2]];c(i[o[g-2]],l),c(w,d),c(A,f),b.sub(h,l,d),b.sub(v,d,f);var E=Ru(b.angle(h,v));E&&E>70&&(r[g]|=32)}}(p),function mLe(e){for(var s,u,r=e.hbonds,n=e.flags,a=e.bridges,i=r.offset,o=r.b,c=0,l=e.proteinInfo.residueIndices.length;cp||((s=c+1)!==(u=p)&&-1!==r.getDirectedEdgeIndex(u,s+1)&&(n[s]|=2,n[u]|=2,a[a.length]=new qA(s,u,0)),(s=c)!==(u=p-1)&&-1!==r.getDirectedEdgeIndex(u-1,s)&&(n[s]|=2,n[u]|=2,a[a.length]=new qA(u,s,0)),(s=c)!==(u=p)&&-1!==r.getDirectedEdgeIndex(u,s)&&(n[s]|=2,n[u]|=2,a[a.length]=new qA(u,s,1)),(s=c+1)!==(u=p-1)&&-1!==r.getDirectedEdgeIndex(u-1,s+1)&&(n[s]|=2,n[u]|=2,a[a.length]=new qA(u,s,1)))}a.sort(function(m,h){return m.partner1>h.partner1?1:m.partner1l||v===l&&c.value(h)===d)break;h++}}function sQ(e){var t="model";if(e){t="dssp";for(var r=0,n=e.models.length;r0){if(0!==e.beg_label_seq_id.valueKind(0)||0!==e.end_label_seq_id.valueKind(0))return"auth"}else if(t&&(0!==t.beg_label_seq_id.valueKind(0)||0!==t.end_label_seq_id.valueKind(0)))return"auth";return"label"}(r,n);(function ILe(e,t,r,n){if(e._rowCount)for(var a=e.beg_label_asym_id,s=e.pdbx_beg_PDB_ins_code,l=e.pdbx_end_PDB_ins_code,d=e.pdbx_PDB_helix_class,f=e.conf_type_id,p=e.details,m="label"===t?e.beg_label_seq_id:e.beg_auth_seq_id,h="label"===t?e.end_label_seq_id:e.end_auth_seq_id,v=0,g=e._rowCount;v0&&function RLe(e,t,r,n){for(var a=e.chainAtomSegments.count,i=e.chains.label_asym_id,o=e.residues,c=o.pdbx_PDB_ins_code,l="label"===t?o.label_seq_id:o.auth_seq_id,d=0;dr&&(r=l)}}return e.throwIfTimedOut(),r}function WLe(e,t){return function(n){var a=e(n);if(t.elementRadius){var i=R(R({},t),{elementRadius:t.elementRadius,elementRadiusClosure:jLe(n,t.elementRadius),sourceMaxRadius:qLe(n,t.elementRadius)});if(ht.isSingleton(a)){var o=vQ(n,n.inputStructure,a.structure,i);return ht.Singletons(n.inputStructure,o)}for(var u=new V4(n.inputStructure),c=0,l=a.structures;c=0)w.addElementRange(v,S.start,S.end);else if(f.hasLabelAsymId(C))for(y.setSegment(S);y.hasNext;)D=y.move(),l.element=v[D.start],f.has(l)&&w.addElementRange(v,D.start,D.end);w.commitUnit(),i.throwIfTimedOut()}var I=r2(i.inputStructure,[w.getStructure(),o]);if(n){for(var M=new zA(i.inputStructure),F=i.inputStructure.lookup3d,N=0,j=I.units;N0;){var s=o.pop();a.add(s);for(var u=this.vertices.get(s),c=0,l=this.edges.get(s);c0){var a=r.structure.units[0],i=Ze.create([a.getChild(Ye.ofSingleton(a.elements[0]))],{parent:t.inputStructure});n.add(i)}}else r.structures.length>0&&n.add(r.structures[0]);return n.getSelection()}}function KA(e,t,r){var n=e.currentStructure.units,a=e.pushCurrentElement();a.structure=e.currentStructure;for(var i=0,o=n;i"u"?function m5e(e){var t=e.queryCtx,r=e.selection,a=e.maxRadius,i=e.invert,o=ht.unionStructure(e.target).lookup3d,s=ht.LinearBuilder(t.inputStructure),u=b.zero();return ht.forEach(r,function(c,l){for(var d=c.units,f=!1,p=0,m=d.length;pp}},e.gte=function o(f,p){return function(m){return f(m)>=p}},e.inSet=function c(f,p){if(function t(f){return!!f&&!!f.has}(p))return function(v){return p.has(f(v))};if(0===p.length)return u;for(var m=new Set,h=0;h=0&&t[1]<=0&&r[1]>=0&&t[2]<=0&&r[2]>=0&&(s[0]=au.getSymmetryOperator(a,0,0,0,0));for(var u=0;u0?[]:this.currentUnit},e.prototype.addElement=function(t){this.currentUnit[this.currentUnit.length]=t,this.elementCount++},e.prototype.addElementRange=function(t,r,n){for(var a=r;a1&&bc(u);var d=s.getChild(Ye.ofSortedArray(u)),f=n.add(d.id,d);d!==f&&(d=f.applyOperator(d.id,d.conformation.operator,!0)),r[r.length]=d}else r[r.length]=s,n.add(s.id,s)}return Ze.create(r,{parent:this.parent})},e.prototype.getStructure=function(){return this._getStructure(!1)},e.prototype.getStructureDeduplicate=function(){return this._getStructure(!0)},e.prototype.setSingletonLocation=function(t){var r=this.ids[0];t.unit=this.parent.unitMap.get(r),t.element=this.unitMap.get(r)[0]},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.elementCount},enumerable:!1,configurable:!0}),e}();function CQ(e,t){for(var r=1;t--;)r*=e--;return r}var R5e=function(){function e(t,r){this.array=t,this.hasNext=!1,this.index=(1<e?0:CQ(e,t)/CQ(t,t)}(t.length,r),this.maxIndex=1<0&&r<=t.length}return e.prototype.move=function(){if(this.hasNext){for(var t=0,r=0,n=this.index;n;n>>>=1,t++)1&n&&(this.value[r++]=this.array[t]);this.index=function M5e(e){var t=e&-e,r=e+t;return r|((r&-r)/t>>1)-1}(this.index),this.hasNext=this.index0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"customPropertyDescriptors",{get:function(){return this.state.customProps||(this.state.customProps=new Sl),this.state.customProps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentPropertyData",{get:function(){return this.state.propertyData||(this.state.propertyData=Object.create(null)),this.state.propertyData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inheritedPropertyData",{get:function(){return this.parent?this.parent.currentPropertyData:this.currentPropertyData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polymerResidueCount",{get:function(){return-1===this.state.polymerResidueCount&&(this.state.polymerResidueCount=function J5e(e){for(var t=e.units,r=0,n=0,a=t.length;n0&&(r+=1);return r}(this)),this.state.polymerUnitCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueElementCount",{get:function(){return-1===this.state.uniqueElementCount&&(this.state.uniqueElementCount=function $5e(e){for(var t=e.unitSymmetryGroups,r=0,n=0,a=t.length;n500?z5e:H5e}(t.length);r.reset();for(var n=0,a=t.length;n0&&ye.length>0)for(var we=Q.length,De=ye.length,Oe=0,Ne=Math.max(we,De);Oe1)throw new Error("The structure is based on multiple models and has neither a master- nor a representative-model.");return this.state.model=t[0],this.state.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"masterModel",{get:function(){return this.state.masterModel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"representativeModel",{get:function(){return this.state.representativeModel},enumerable:!1,configurable:!0}),e.prototype.hasElement=function(t){return!!this.unitMap.has(t.unit.id)&&Ye.has(this.unitMap.get(t.unit.id).elements,t.element)},e.prototype.getModelIndex=function(t){return this.models.indexOf(t)},e.prototype.remapModel=function(t){for(var r=this.state,n=r.dynamicBonds,a=r.interUnitBonds,i=r.parent,o=[],s=0,u=this.unitSymmetryGroups;s0?q[0].id:0,re=0,te=q.length;re2e5||f(q,re)?h(q,De,de,xe,te):de.addUnit(0,q,te,De,xe?Fe.Trait.MultiChain:Fe.Trait.None):de.addUnit(0,q,te,De,xe?Fe.Trait.MultiChain:Fe.Trait.None)}var Oe=q.coarseHierarchy;return Oe.isDefined&&(Oe.spheres.count>0&&v(de,q,q.coarseHierarchy.spheres,1),Oe.gaussians.count>0&&v(de,q,q.coarseHierarchy.gaussians,2)),de.getStructure()}function f(q,V){var ee=q.atomicHierarchy.index.getEntityFromChain(V);return"water"===q.entities.data.type.value(ee)}function p(q,V){var ee=q.atomicHierarchy.index.getEntityFromChain(V);return"polymer"===q.entities.data.type.value(ee)}function m(q,V,ee,ae,pe){var me=q.atomicConformation,le={x:me.x,y:me.y,z:me.z,indices:V},xe=Df(le,Jf(le),8192).buckets,Ge=xe.offset,je=xe.count,L=xe.array,Q=(ae?Fe.Trait.MultiChain:Fe.Trait.None)|(Ge.length>1?Fe.Trait.Partitioned:Fe.Trait.None);ee.beginChainGroup();for(var ye=0,we=Ge.length;ye1?Fe.Trait.Partitioned:Fe.Trait.None);ee.beginChainGroup();for(var Ie=0,He=Oe.length;Ie0,this.hasNext&&(this.elements=V.units[0].elements,this.maxIdx=this.elements.length-1,this.current.unit=V.units[0])}return q.prototype.move=function(){return this.advance(),this.current.element=this.elements[this.idx],this.current},q.prototype.advance=function(){if(this.idx=this.structure.units.length?this.hasNext=!1:(this.current.unit=this.structure.units[this.unitIndex],this.elements=this.current.unit.elements,this.maxIdx=this.elements.length-1,0===this.maxIdx&&(this.hasNext=this.unitIndex+10})}e.distance=function H(q,V){if(0===q.elementCount||0===V.elementCount)return 0;for(var ee=q.units,ae=Number.MAX_VALUE,pe=0,me=ee.length;pe=L.id||!pe(L)||!me(ge,L)||(L.elements.length>=ge.elements.length?V(ge,L):V(L,ge))}}}},e.eachAtomicHierarchyElement=function X(q,V){for(var ee=V.chain,ae=V.residue,pe=V.atom,me=at.create(q),de=0,re=q.units;de=ae.largeResidueCount*ee?function Y(q,V){var ee=Z(q);return ee.length>=1&&ee[0].units.length>V.highSymmetryUnitCount}(q,ae)?k.Huge:k.Gigantic:function ne(q,V){var ee=Z(q);return 1===ee.length&&ee[0].units.length>2&&ee[0].units[0].polymerElements.length0)return!1;return!0}function i(K){for(var q=0,V=0,ee=K.elements;V3&&Ye.isRange(K)?_e.ofRange(K[0],K[K.length-1]):Ye.ofSortedArray(K)}function _(K,q){for(var V=[],ee=new Set,ae=0,pe=K.elements;ae=0){var Ie=te.value(Ne);(!q||Oe||!Ie||ee.has(Ie))&&(Ge[Ge.length]=$e)}}}V[V.length]={unit:me.unit,indices:C(Ge)}}else V[V.length]=me}return e(K.structure,V)}function x(K){switch(K.kind){case 0:return K.model.atomicHierarchy.chainAtomSegments;case 1:return K.model.coarseHierarchy.spheres.chainElementSegments;case 2:return K.model.coarseHierarchy.gaussians.chainElementSegments}}function D(K){return K.unit.elements.length===ke.size(K.indices)}function w(K,q,V){for(var ee=x(K).index,ae=K.elements,pe=0,me=0,de=ae.length;me0&&(V[V.length]={unit:K,indices:C(le)})}else V[V.length]={unit:K,indices:_e.ofBounds(0,pe)}}function A(K,q,V,ee,ae){for(var pe=x(K.elements[0].unit).index,me=new Set,de=q;de0&&V.push({unit:ae,indices:pe})}}),e(q,V)},e.union=function h(K,q){if(K.elements.length>q.elements.length)return h(q,K);if(e.isEmpty(K))return q;for(var V=new Map,ee=0,ae=K.elements;eeq.elements.length)return y(q,K);if(e.isEmpty(K))return e.isEmpty(q);for(var V=new Map,ee=0,ae=K.elements;ee12)pe[pe.length]=q[te],pe[pe.length]=q[le-1];else for(var ge=te;ge1,me.modelLabel,me.modelIndex))}for(var ye=new Map,we=(ge=0,je.length);ge0&&(St[St.length]=fe.core.set.has([fe.core.type.set(He),ut]));for(var wt=0,Le=Ie.length/2;wt1?fe.core.logic.or(St):St[0],"chain-test":Je.length>1?fe.core.set.has([fe.core.type.set(Je),mt]):fe.core.rel.eq([mt,Je[0]]),"entity-test":fe.core.logic.and([fe.core.rel.eq([fe.struct.atomProperty.core.modelLabel(),Ct]),fe.core.rel.eq([fe.struct.atomProperty.core.modelIndex(),bt])])}))}else Ne.push(fe.struct.generator.atomGroups({"atom-test":St.length>1?fe.core.logic.or(St):St[0],"chain-test":Je.length>1?fe.core.set.has([fe.core.type.set(Je),mt]):fe.core.rel.eq([mt,Je[0]])}))}),fe.struct.modifier.union([1===Ne.length?Ne[0]:fe.struct.combinator.merge(Ne.map(function(Ue){return fe.struct.modifier.union([Ue])}))])}}(Re||(Re={})),function(e){function t(){return{elementCount:0,conformationCount:0,residueCount:0,chainCount:0,unitCount:0,structureCount:0,firstElementLoc:at.create(void 0),firstConformationLoc:at.create(void 0),firstResidueLoc:at.create(void 0),firstChainLoc:at.create(void 0),firstUnitLoc:at.create(void 0),firstStructureLoc:at.create(void 0)}}function r(u,c,l){var d=u.get(c)||0;u.set(c,d+l)}function n(u,c,l){var d=l.indices,f=l.unit,p=f.elements,m=ke.size(d),h=new Map,v=new Map;if(m>0&&at.set(u.firstElementLoc,c,f,p[ke.start(d)]),m===p.length)u.unitCount+=1,1===u.unitCount&&at.set(u.firstUnitLoc,c,f,p[ke.start(d)]);else if(1===m){if(Fe.Traits.is(f.traits,Fe.Trait.MultiChain))return;u.elementCount+=1,1===u.elementCount&&at.set(u.firstElementLoc,c,f,p[ke.start(d)])}else if(Fe.isAtomic(f))for(var g=f.model.atomicHierarchy.residueAtomSegments,y=g.index,S=g.offsets,C=f.model.atomicHierarchy.atoms.label_alt_id,_=0,x=function(){h.clear();var D=0,w=p[ke.getAt(d,_)],A=y[w];for(r(h,C.value(w),1),++_,++D;_"u"?1:0},Z4=function(e,t){return-1===t[e].operator.spgrOp?1:0};Pa.fields().str("label_asym_id",function(e,t){return t[e].label_asym_id}).str("auth_asym_id",function(e,t){return t[e].auth_asym_id}).str("operator_name",function(e,t){return t[e].operator.name}).str("suffix",function(e,t){return t[e].operator.suffix}).str("assembly_id",function(e,t){var r;return(null===(r=t[e].operator.assembly)||void 0===r?void 0:r.id)||""},{valueKind:MQ}).int("assembly_operator_id",function(e,t){var r;return(null===(r=t[e].operator.assembly)||void 0===r?void 0:r.operId)||0},{valueKind:MQ}).int("symmetry_operator_index",function(e,t){return t[e].operator.spgrOp},{valueKind:Z4}).vec("symmetry_hkl",[function(e,t){return t[e].operator.hkl[0]},function(e,t){return t[e].operator.hkl[1]},function(e,t){return t[e].operator.hkl[2]}],{valueKind:Z4}).int("ncs_id",function(e,t){return t[e].operator.ncsId},{valueKind:Z4}).getFields();var Q4;!function(e){e.create=function t(r){var n=Array.isArray(r)?r:[r];return{structures:n,firstModel:n[0].model,cache:Object.create(null)}}}(Q4||(Q4={}));var eB,OQ;function $4(e){return e.units.every(function(t){return t.conformation.operator.isIdentity})}function J4(e){return $4(e)&&e.units.every(function(t){return!t.conformation.operator.assembly&&!t.conformation.operator.suffix})}function tB(e){for(var t=new Map,r=0,n=e.length;r0)for(var c=parseInt(s.substring(0,u)),l=parseInt(s.substr(u+1)),d=c;d<=l;d++)o[o.length]=d.toString();else o[o.length]=s.trim()}),n[n.length]=o}),n}function YUe(e){if(0!==e._rowCount){for(var t=e.id,r=e.matrix,n=e.vector,a=Br.struct_ncs_oper.matrix.space,i=Br.struct_ncs_oper.vector.space,o=[],s=0;s0||(S[S.length]=C);return x=ie.ofConst("A",_=S.length,ie.Schema.str),D=ie.ofConst(1,_,ie.Schema.int),w=ie.ofConst("1",_,ie.Schema.str),A=ie.ofConst(1,_,ie.Schema.float),E=ie.ofConst(1,_,ie.Schema.int),I=ie.view(p,S),M=ie.view(h,S),F=ie.view(i[u],S),N=ie.view(i[c],S),j=ie.view(i[l],S),U=ie.view(v,S),H=ie.view(g,S),z=ie.view(m,S),G=Xr.ofPartialColumns(To.atom_site,{auth_asym_id:x,auth_atom_id:I,auth_comp_id:M,auth_seq_id:D,Cartn_x:F,Cartn_y:N,Cartn_z:j,id:U,label_asym_id:x,label_atom_id:I,label_comp_id:M,label_seq_id:D,label_entity_id:w,occupancy:A,type_symbol:H,pdbx_PDB_model_num:E,pdbx_formal_charge:z},_),(J=new xl).setNames([[f,"".concat(d," (").concat(s,")")]]),J.getEntityId(f,0,"A"),(X=new Cl(D,g)).setNames([[f,"".concat(d," (").concat(s,")")]]),X.add(f,0),[4,Ed(Ic({entity:J.getEntityTable(),chem_comp:X.getChemCompTable(),atom_site:G}),t,n)];case 1:return(ne=W.sent()).representative?(Y=ne.representative,k=ev.getEntriesFromChemCompBond(o),ev.Provider.set(Y,{data:o,entries:k}),c2.CoordinateType.set(Y,s),[2,ne.representative]):[2]}})})}function iy(e,t){return t?1===t.length?Ou(t.charCodeAt(0),e):2===t.length?Ou(t.charCodeAt(0),Ou(t.charCodeAt(1),e)):"".concat(e," ").concat(t):e}function a6e(e,t,r,n){var a;e.has(t)?(a=e.get(t)).has(r)||a.set(r,n):(e.set(t,a=new Map),a.set(r,n))}function i6e(e){throw new Error("Missing entity entry for entity id '".concat(e,"'."))}!function(e){e.Schema=XUe,e.Descriptor={name:"atom_site_anisotrop",cifExport:{prefix:"",categories:[{name:"atom_site_anisotrop",instance:function(n){return e.Provider.get(n.firstModel)&&Dn.is(n.firstModel.sourceData)?Pa.Category.ofTable(n.firstModel.sourceData.data.db.atom_site_anisotrop):Pa.Category.Empty}}]}},e.Provider=_l.create(e.Descriptor),e.getElementToAnsiotrop=function t(n,a){var i=new Int32Array(n.rowCount);i.fill(-1);for(var o=0,s=n.rowCount;o0},e.writeMmCif=function s(u,c){u.writeCategory({name:r,instance:function(){var l=Xr.ofRows(e.Schema.molstar_global_model_transform_info,[{matrix:c}]);return Pa.Category.ofTable(l)}})}}(ov||(ov={})),Ja.Provider.formatRegistry.add("mmCIF",function KUe(e){if(Dn.is(e.sourceData))return Ja.fromData(e.sourceData.data.db)}),nv.Provider.formatRegistry.add("mmCIF",function ZUe(e){if(Dn.is(e.sourceData)){var t=e.sourceData.data.db;return nv.fromStruct(t.struct_conf,t.struct_sheet_range,e.atomicHierarchy)}}),Dd.Provider.formatRegistry.add("mmCIF",function QUe(e){if(Dn.is(e.sourceData)){var t=e.sourceData.data.db.atom_site_anisotrop;return{data:Xr.ofColumns(Dd.Schema,t),elementToAnsiotrop:Dd.getElementToAnsiotrop(e.atomicConformation.atomId,t.id)}}},function $Ue(e){return!!Dn.is(e.sourceData)&&e.sourceData.data.db.atom_site_anisotrop.U.isDefined}),ev.Provider.formatRegistry.add("mmCIF",function JUe(e){if(Dn.is(e.sourceData)){var t=e.sourceData.data.db.chem_comp_bond;if(0!==t._rowCount)return{data:t,entries:ev.getEntriesFromChemCompBond(t)}}}),Yu.Provider.formatRegistry.add("mmCIF",function e6e(e){if(Dn.is(e.sourceData)){var t=e.sourceData.data.db.struct_conn;if(0!==t._rowCount){var r=Yu.getEntriesFromStructConn(t,e);return{data:t,byAtomIndex:Yu.getAtomIndexFromEntries(r),entries:r}}}}),ov.Provider.formatRegistry.add("mmCIF",ov.fromMmCif,ov.hasData),function(e){e.is=function t(n){return"mmCIF"===n?.kind},e.fromFrame=function r(n,a,i,o){return a||(a=hl.schema.mmCIF(n)),{kind:"mmCIF",name:a._name,data:{db:a,file:o,frame:n,source:i}}}}(Dn||(Dn={})),function(e){var t="__CcdCoordinateType__";e.CoordinateType={get:function(a){return a._staticPropertyData[t]},set:function(a,i){return a._staticPropertyData[t]=i}},e.is=function r(a){return"CCD"===a?.kind},e.fromFrame=function n(a,i){return i||(i=hl.schema.CCD(a)),{kind:"CCD",name:i._name,data:{db:i,frame:a}}}}(c2||(c2={})),function(e){function t(U,H){for(var z=[],G=H.frames,J=U.atomicHierarchy.atomSourceIndex,Z=ie.isIdentity(J)?void 0:J.toArray({array:Int32Array}),ne=h(U),Y=U.atomicHierarchy.atoms._rowCount,k=0,W=G.length;k0},e.hasProtein=function g(U){for(var H=U.entities.subtype,z=0,G=H.rowCount;z=0)return!0;return!1}function E(U){if(!Dn.is(U.sourceData))return!1;for(var H=U.sourceData.data.db,z=0;z=0)return!0;return!1}function M(U){if(!Dn.is(U.sourceData)||!A(U))return!1;var z=U.sourceData.data.db.pdbx_database_status.status_code_sf;return z.isDefined&&"REL"===z.value(0)}function F(U){if(!Dn.is(U.sourceData))return!1;for(var H=U.sourceData.data.db,z=H.pdbx_database_related,G=z.db_name,J=z.content_type,X=0,Z=H.pdbx_database_related._rowCount;X=0)return!0;return!1},e.hasXrayMap=M,e.hasEmMap=F,e.hasDensityMap=N,e.probablyHasDensityMap=function j(U){if(!Dn.is(U.sourceData))return!1;var H=U.sourceData.data.db;return N(U)||C(U)&&(!H.exptl.method.isDefined||A(U)&&(!H.pdbx_database_status.status_code_sf.isDefined||2===H.pdbx_database_status.status_code_sf.valueKind(0))||E(U)&&!H.pdbx_database_related.db_name.isDefined)}}(ar||(ar={}));var l2=j4.EmptyResidueKey(),s6e=function(){function e(t){this.map=t,this.entityIndex=t.entities.getEntityIndex,this.residueOffsets=this.map.segments.residueAtomSegments.offsets}return e.prototype.getEntityFromChain=function(t){return this.map.chain_index_entity_index[t]},e.prototype.findEntity=function(t){var r=this.map.label_asym_id.get(t);return void 0!==r?r:-1},e.prototype.findChainLabel=function(t){var r=this.entityIndex(t.label_entity_id);if(r<0||!this.map.entity_index_label_asym_id.has(r))return-1;var n=this.map.entity_index_label_asym_id.get(r);return n&&n.has(t.label_asym_id)?n.get(t.label_asym_id):-1},e.prototype.findChainAuth=function(t){if(!this.map.auth_asym_id_auth_seq_id.has(t.auth_asym_id))return-1;var r=this.map.auth_asym_id_auth_seq_id.get(t.auth_asym_id);return r.has(t.auth_seq_id)?r.get(t.auth_seq_id):-1},e.prototype.findResidue=function(t,r,n,a){var i;1===arguments.length?i=t:(l2.label_entity_id=t,l2.label_asym_id=r,l2.auth_seq_id=n,l2.pdbx_PDB_ins_code=a,i=l2);var o=this.findChainLabel(i);if(o<0)return-1;var s=this.map.chain_index_auth_seq_id.get(o),u=iy(i.auth_seq_id,i.pdbx_PDB_ins_code||"");return s.has(u)?s.get(u):-1},e.prototype.findResidueLabel=function(t){var r=this.findChainLabel(t);if(r<0)return-1;var n=this.map.chain_index_label_seq_id.get(r),a=iy(t.label_seq_id,t.pdbx_PDB_ins_code||"");return n.has(a)?n.get(a):-1},e.prototype.findResidueAuth=function(t){var r=this.findChainAuth(t);if(r<0)return-1;var n=this.map.chain_index_auth_seq_id.get(r),a=iy(t.auth_seq_id,t.pdbx_PDB_ins_code||"");return n.has(a)?n.get(a):-1},e.prototype.findResidueInsertion=function(t){var r=this.findChainLabel(t);if(r<0)return-1;var n=this.map.chain_index_label_seq_id.get(r),a=iy(t.label_seq_id,t.pdbx_PDB_ins_code||"");if(n.has(a))return n.get(a);var i=Ye.findPredecessorIndex(this.map.label_seq_id,t.label_seq_id),o=rv.chainStartResidueIndex(this.map.segments,r);if(i=s?s:i},e.prototype.findAtom=function(t){var r=this.findResidue(t);return r<0?-1:typeof t.label_alt_id>"u"?nB(this.residueOffsets[r],this.residueOffsets[r+1],this.map.label_atom_id,t.label_atom_id):aB(this.residueOffsets[r],this.residueOffsets[r+1],this.map.label_atom_id,this.map.label_alt_id,t.label_atom_id,t.label_alt_id)},e.prototype.findAtomAuth=function(t){var r=this.findResidueAuth(t);return r<0?-1:typeof t.label_alt_id>"u"?nB(this.residueOffsets[r],this.residueOffsets[r+1],this.map.auth_atom_id,t.auth_atom_id):aB(this.residueOffsets[r],this.residueOffsets[r+1],this.map.auth_atom_id,this.map.label_alt_id,t.auth_atom_id,t.label_alt_id)},e.prototype.findAtomOnResidue=function(t,r,n){return typeof n>"u"?nB(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,r):aB(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,this.map.label_alt_id,r,n)},e.prototype.findAtomsOnResidue=function(t,r){return function u6e(e,t,r,n){for(var a=e;a=u[c+1]&&(c+=1,l=0),o[d]=++l;a.label_seq_id=ie.ofIntArray(o)}return Xr.columnToArray(a,"label_seq_id",Int32Array),Xr.columnToArray(a,"auth_seq_id",Int32Array),{atoms:n,residues:a,chains:i,atomSourceIndex:t}}(e,t,o),u=function h6e(e,t){var r=new Map;if(!Dn.is(t))return r;var n=cd(DUe,t.data.frame).molstar_atom_site_operator_mapping;if(0===n._rowCount)return r;for(var a=new Map,i=new Map,o=0;o1&&(r.push(l,f-1),n.push(f-1,f),l=f),f===c-1&&r.push(l,f),d=p}return{polymerRanges:Cn.ofSortedRanges(r),gapRanges:Cn.ofSortedRanges(n)}}var zQ={hierarchy:UQ.Empty,conformation:void 0};function HQ(e){var t=e.entity_id,a=e.asym_id;return R({count:t.rowCount,entity_id:t,asym_id:a,seq_id_begin:e.seq_id_begin,seq_id_end:e.seq_id_end},function w6e(e,t,r){for(var n=[0],a=1,i=e.rowCount;a0)for(var r=e.chem_comp.id,n=0,a=r.rowCount;n0)for(var r=e.pdbx_chem_comp_identifier,n=r.comp_id,a=r.type,i=r.identifier,o=0,s=n.rowCount;o0){var l=e.chem_comp,d=l.id;for(a=l.type,o=0,s=d.rowCount;o0?[4,O6e(r,e,n,t)]:[3,2];case 1:return i=s.sent(),[3,4];case 2:return[4,R6e(r,e,n,t)];case 3:i=s.sent(),s.label=4;case 4:for(a=i,o=0;o0?a[a.length-1]:void 0),a.push(f),s=u,[3,1];case 3:return[2,a]}})})}function iB(e,t){for(var r=new Map,n=e._rowCount,a=0;a=66?Xe.addToken(e.B_iso_or_equiv,lt.trim(r,n+60,n+66)):Xe.add(e.B_iso_or_equiv,0,0),i&&Xe.addToken(e.partial_charge,lt.trim(r,n+70,n+76)),s>=78&&!i?(lt.trim(r,n+76,n+78),r.tokenStart=78?(lt.trim(r,n+76,n+78),r.tokenStartI||void 0===w[I]&&(u.push("covale".concat(_)),c.push("covale"),l.push(n.label_asym_id.str(D)),d.push(n.auth_seq_id.int(D)),f.push(n.label_atom_id.str(D)),p.push(n.label_alt_id.str(D)),m.push(n.pdbx_PDB_ins_code.str(D)),h.push(n.label_asym_id.str(I)),v.push(n.auth_seq_id.int(I)),g.push(n.label_atom_id.str(I)),y.push(n.label_alt_id.str(I)),S.push(n.pdbx_PDB_ins_code.str(I)),_+=1))}}}var F,M={id:pt.ofStrings(u),conn_type_id:pt.ofStrings(c),ptnr1_label_asym_id:pt.ofStrings(l),ptnr1_auth_seq_id:pt.ofNumbers(d),ptnr1_label_atom_id:pt.ofStrings(f),pdbx_ptnr1_label_alt_id:pt.ofStrings(p),pdbx_ptnr1_PDB_ins_code:pt.ofStrings(m),ptnr2_label_asym_id:pt.ofStrings(h),ptnr2_auth_seq_id:pt.ofNumbers(v),ptnr2_label_atom_id:pt.ofStrings(g),pdbx_ptnr2_label_alt_id:pt.ofStrings(y),pdbx_ptnr2_PDB_ins_code:pt.ofStrings(S)};return Zi.ofFields("struct_conn",M)}(t,v[0],v[1],G)),J={entity:Zi.ofTable("entity",d.getEntityTable()),chem_comp:Zi.ofTable("chem_comp",N.getChemCompTable()),atom_site:Zi.ofFields("atom_site",G),atom_site_anisotrop:Zi.ofFields("atom_site_anisotrop",K6e(l))},X=0,Z=f;X"),tt(Se.core.rel.gre,"gre",">="),tt(Se.core.rel.inRange,"in-range"),tt(Se.core.str.concat,"concat"),tt(Se.core.str.match,"regex.match"),tt(Se.core.list.getAt,"list.get"),tt(Se.core.set.has,"set.has"),tt(Se.core.set.isSubset,"set.subset")],["Structure",["Types",tt(Se.structureQuery.type.entityType,"ent-type"),tt(Se.structureQuery.type.authResidueId,"auth-resid"),tt(Se.structureQuery.type.labelResidueId,"label-resid"),tt(Se.structureQuery.type.ringFingerprint,"ringfp"),tt(Se.structureQuery.type.bondFlags,"bond-flags")],["Slots",tt(Se.structureQuery.slot.elementSetReduce,"atom.set.reduce.value")],["Generators",tt(Se.structureQuery.generator.atomGroups,"sel.atom.atom-groups"),tt(Se.structureQuery.generator.queryInSelection,"sel.atom.query-in-selection"),tt(Se.structureQuery.generator.rings,"sel.atom.rings"),tt(Se.structureQuery.generator.empty,"sel.atom.empty"),tt(Se.structureQuery.generator.all,"sel.atom.all"),tt(Se.structureQuery.generator.bondedAtomicPairs,"sel.atom.bonded-pairs"),eT($S("sel.atom.atoms",Gt.Dictionary({0:ft(Te.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to each atom."})}),Tt.ElementSelection,"A selection of singleton atom sets."),function(e){return fe.struct.generator.atomGroups({"atom-test":cB(e,0,!0)})}),eT($S("sel.atom.res",Gt.Dictionary({0:ft(Te.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each residue."})}),Tt.ElementSelection,"A selection of atom sets grouped by residue."),function(e){return fe.struct.generator.atomGroups({"residue-test":cB(e,0,!0),"group-by":fe.ammp("residueKey")})}),eT($S("sel.atom.chains",Gt.Dictionary({0:ft(Te.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each chain."})}),Tt.ElementSelection,"A selection of atom sets grouped by chain."),function(e){return fe.struct.generator.atomGroups({"chain-test":cB(e,0,!0),"group-by":fe.ammp("chainKey")})})],["Modifiers",tt(Se.structureQuery.modifier.queryEach,"sel.atom.query-each"),tt(Se.structureQuery.modifier.intersectBy,"sel.atom.intersect-by"),tt(Se.structureQuery.modifier.exceptBy,"sel.atom.except-by"),tt(Se.structureQuery.modifier.unionBy,"sel.atom.union-by"),tt(Se.structureQuery.modifier.union,"sel.atom.union"),tt(Se.structureQuery.modifier.cluster,"sel.atom.cluster"),tt(Se.structureQuery.modifier.includeSurroundings,"sel.atom.include-surroundings"),tt(Se.structureQuery.modifier.surroundingLigands,"sel.atom.surrounding-ligands"),tt(Se.structureQuery.modifier.includeConnected,"sel.atom.include-connected"),tt(Se.structureQuery.modifier.expandProperty,"sel.atom.expand-property")],["Filters",tt(Se.structureQuery.filter.pick,"sel.atom.pick"),tt(Se.structureQuery.filter.first,"sel.atom.first"),tt(Se.structureQuery.filter.withSameAtomProperties,"sel.atom.with-same-atom-properties"),tt(Se.structureQuery.filter.intersectedBy,"sel.atom.intersected-by"),tt(Se.structureQuery.filter.within,"sel.atom.within"),tt(Se.structureQuery.filter.isConnectedTo,"sel.atom.is-connected-to")],["Combinators",tt(Se.structureQuery.combinator.intersect,"sel.atom.intersect"),tt(Se.structureQuery.combinator.merge,"sel.atom.merge"),tt(Se.structureQuery.combinator.distanceCluster,"sel.atom.dist-cluster")],["Atom Set Properties",tt(Se.structureQuery.atomSet.atomCount,"atom.set.atom-count"),tt(Se.structureQuery.atomSet.countQuery,"atom.set.count-query"),tt(Se.structureQuery.atomSet.reduce,"atom.set.reduce"),tt(Se.structureQuery.atomSet.propertySet,"atom.set.property")],["Atom Properties",tt(Se.structureQuery.atomProperty.core.elementSymbol,"atom.el"),tt(Se.structureQuery.atomProperty.core.vdw,"atom.vdw"),tt(Se.structureQuery.atomProperty.core.mass,"atom.mass"),tt(Se.structureQuery.atomProperty.core.atomicNumber,"atom.atomic-number"),tt(Se.structureQuery.atomProperty.core.x,"atom.x"),tt(Se.structureQuery.atomProperty.core.y,"atom.y"),tt(Se.structureQuery.atomProperty.core.z,"atom.z"),tt(Se.structureQuery.atomProperty.core.sourceIndex,"atom.src-index"),tt(Se.structureQuery.atomProperty.core.operatorName,"atom.op-name"),tt(Se.structureQuery.atomProperty.core.operatorKey,"atom.op-key"),tt(Se.structureQuery.atomProperty.core.modelIndex,"atom.model-index"),tt(Se.structureQuery.atomProperty.core.modelLabel,"atom.model-label"),tt(Se.structureQuery.atomProperty.core.atomKey,"atom.key"),tt(Se.structureQuery.atomProperty.core.bondCount,"atom.bond-count"),tt(Se.structureQuery.atomProperty.topology.connectedComponentKey,"atom.key.molecule"),tt(Se.structureQuery.atomProperty.macromolecular.authResidueId,"atom.auth-resid"),tt(Se.structureQuery.atomProperty.macromolecular.labelResidueId,"atom.label-resid"),tt(Se.structureQuery.atomProperty.macromolecular.residueKey,"atom.key.res"),tt(Se.structureQuery.atomProperty.macromolecular.chainKey,"atom.key.chain"),tt(Se.structureQuery.atomProperty.macromolecular.entityKey,"atom.key.entity"),tt(Se.structureQuery.atomProperty.macromolecular.isHet,"atom.is-het"),tt(Se.structureQuery.atomProperty.macromolecular.id,"atom.id"),tt(Se.structureQuery.atomProperty.macromolecular.label_atom_id,"atom.label_atom_id"),tt(Se.structureQuery.atomProperty.macromolecular.label_alt_id,"atom.label_alt_id","atom.altloc"),tt(Se.structureQuery.atomProperty.macromolecular.label_comp_id,"atom.label_comp_id"),tt(Se.structureQuery.atomProperty.macromolecular.label_asym_id,"atom.label_asym_id"),tt(Se.structureQuery.atomProperty.macromolecular.label_entity_id,"atom.label_entity_id"),tt(Se.structureQuery.atomProperty.macromolecular.label_seq_id,"atom.label_seq_id"),tt(Se.structureQuery.atomProperty.macromolecular.auth_atom_id,"atom.auth_atom_id","atom.name"),tt(Se.structureQuery.atomProperty.macromolecular.auth_comp_id,"atom.auth_comp_id","atom.resname"),tt(Se.structureQuery.atomProperty.macromolecular.auth_asym_id,"atom.auth_asym_id","atom.chain"),tt(Se.structureQuery.atomProperty.macromolecular.auth_seq_id,"atom.auth_seq_id","atom.resno"),tt(Se.structureQuery.atomProperty.macromolecular.pdbx_PDB_ins_code,"atom.pdbx_PDB_ins_code","atom.inscode"),tt(Se.structureQuery.atomProperty.macromolecular.pdbx_formal_charge,"atom.pdbx_formal_charge"),tt(Se.structureQuery.atomProperty.macromolecular.occupancy,"atom.occupancy"),tt(Se.structureQuery.atomProperty.macromolecular.B_iso_or_equiv,"atom.B_iso_or_equiv","atom.bfactor"),tt(Se.structureQuery.atomProperty.macromolecular.entityType,"atom.entity-type"),tt(Se.structureQuery.atomProperty.macromolecular.entitySubtype,"atom.entity-subtype"),tt(Se.structureQuery.atomProperty.macromolecular.entityPrdId,"atom.entity-prd-id"),tt(Se.structureQuery.atomProperty.macromolecular.entityDescription,"atom.entity-description"),tt(Se.structureQuery.atomProperty.macromolecular.objectPrimitive,"atom.object-primitive"),tt(Se.structureQuery.atomProperty.macromolecular.chemCompType,"atom.chem-comp-type"),tt(Se.structureQuery.atomProperty.macromolecular.secondaryStructureKey,"atom.key.sec-struct"),tt(Se.structureQuery.atomProperty.macromolecular.isModified,"atom.is-modified"),tt(Se.structureQuery.atomProperty.macromolecular.modifiedParentName,"atom.modified-parent")],["Bond Properties",tt(Se.structureQuery.bondProperty.order,"bond.order"),tt(Se.structureQuery.bondProperty.length,"bond.length"),tt(Se.structureQuery.bondProperty.key,"bond.key"),tt(Se.structureQuery.bondProperty.atomA,"bond.atom-a"),tt(Se.structureQuery.bondProperty.atomB,"bond.atom-b"),eT($S("bond.is",Gt.List(Tt.BondFlag),Te.Bool,"Test if the current bond has at least one (or all if partial = false) of the specified flags: ".concat(Te.oneOfValues(Tt.BondFlag).join(", "))),function(e){return fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.struct.type.bondFlags(n8e(e))])})]]],t$=[];!function r$(e){for(var t=0,r=e;t0?"'...":"'",i=e.length-n>12?"...'":"'";return" at line ".concat(r.line," column ").concat(r.column,", got ").concat(a).concat(e.slice(n,n+12)).concat(i)}(e,t))}(t,r);throw new Error(n)},e.prototype.or=function(t){return e.alt(this,t)},e.prototype.trim=function(t){return this.wrap(t,t)},e.prototype.wrap=function(t,r){return lB(1,"string"==typeof t?e.string(t):t,this,"string"==typeof r?e.string(r):r)},e.prototype.thru=function(t){return t(this)},e.prototype.then=function(t){return lB(1,this,t)},e.prototype.many=function(){var t=this;return new e(function(r,n){for(var a=[],i=void 0;;){if(!(i=Nc(t._(r,n),i)).status)return Nc(os(n,a),i);if(n===i.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");n=i.index,a.push(i.value)}})},e.prototype.times=function(t,r){var n=this,a=typeof r>"u"?t:r;return new e(function(i,o){var l,s=[],u=void 0,c=void 0;for(l=0;lt.furthest)return e;var r=e.furthest===t.furthest?function l8e(e,t){var r=e.length,n=t.length;if(0===r)return t;if(0===n)return e;for(var a=new Set,i=[],o=0;o=0})},e.noneOf=function g(w){return h(function(A){return w.indexOf(A)<0})},e.range=function y(w,A){return h(function(E){return w<=E&&E<=A}).desc(w+"-"+A)},e.takeWhile=function S(w){return new e(function(A,E){for(var I=E;I=w.length?np(A,"any character"):os(A+1,w.charAt(A))}),e.all=new e(function(w,A){return os(w.length,w.slice(A))}),e.eof=new e(function(w,A){return A1)switch(_.charAt(0)){case".":return fe.atomName(_.substr(1));case"_":return fe.struct.type.elementSymbol([_.substr(1)])}return"true"===_||"false"!==_&&(function y(C){return/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/.test(C)&&!isNaN(+C)}(_)?+_:$i.Symbol(_));case"list":switch(C.bracket){case"[":return fe.core.type.list(g(C.nodes).map(m));case"{":return fe.core.type.set(g(C.nodes).map(m));case"(":if("comment"===C.nodes[0].kind)throw new Error("Invalid expression");var D=m(C.nodes[0]);return $i.Apply(D,function h(C){if(!(C.length<=1)){if(!function v(C){for(var _=1,x=C.length;_1&&":"===D.value.charAt(0))return!0}return!1}(C)){for(var _=[],x=1,D=C.length;x1&&":"===w.value.charAt(0)){var M=w.value.substr(1);for(++x;x=D)throw new Error("There must be a value foolowed a named arg ':".concat(M,"'."));if("comment"===C[x].kind)throw new Error("Invalid expression");A[M]=m(C[x]),isNaN(+M)&&(E=!1)}else A[I++]=m(w)}if(E){var F=Object.keys(A).map(function(U){return+U}).sort(function(U,H){return U-H}),N=!0;for(x=0,D=F.length;x1?Vn.core.logic.and(e):void 0}function mB(e,t){if(!t||void 0===t.op||void 0===t.val)return t&&void 0!==t.flags?Vn.core.flags.hasAny([e,t.flags]):t&&void 0!==t.min&&void 0!==t.max?Vn.core.rel.inRange([e,t.min,t.max]):Array.isArray(t)?t.length>1?Vn.core.set.has([Vn.core.type.set(t),e]):Vn.core.rel.eq([e,t[0]]):Vn.core.rel.eq([e,t]);var r=[e,t.val];switch(t.op){case"=":return Vn.core.rel.eq(r);case"!=":return Vn.core.rel.neq(r);case">":return Vn.core.rel.gr(r);case"<":return Vn.core.rel.lt(r);case">=":return Vn.core.rel.gre(r);case"<=":return Vn.core.rel.lte(r);default:throw new Error("operator '".concat(t.op,"' not supported"))}}function Zu(e){return Vn.struct.generator.queryInSelection({0:e,query:Vn.struct.generator.all(),"in-complement":!0})}function Id(e,t){return e.length=|<=|=|!=|>| 10"],abbr:["Z"],isNumeric:!0,regex:kc,map:function(e){return parseFloat(e)},level:"atom-test",property:oi.acp("z")},bondcount:{"@desc":"covalent bond count","@examples":["bondcount = 0"],isNumeric:!0,regex:m2,map:function(e){return parseInt(e)},level:"atom-test",property:oi.acp("bondCount")},bondingRadius:{"@desc":"radius used for auto bonding; synonymous with ionic and ionicRadius","@examples":[""],abbr:["ionic","ionicRadius"],isUnsupported:!0,regex:kc,map:function(e){return parseFloat(e)},level:"atom-test"},cell:{"@desc":'crystallographic unit cell, expressed either in lattice integer notation (111-999) or as a coordinate in ijk space, where {1 1 1} is the same as 555. ANDing two cells, for example select cell=555 and cell=556, selects the atoms on the common face. (Note: in the specifc case of CELL, only "=" is allowed as a comparator.)',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},configuration:{"@desc":'Only in the context {configuration=n}, this option selects the set of atoms with either no ALTLOC specified or those atoms having this index into the array of altlocs within its model. So, for example, if the model has altloc "A" and "B", select configuration=1 is equivalent to select altloc="" or altloc="A", and print {configuration=2} is equivalent to print {altloc="" or altloc="B"}. Configuration 0 is "all atoms in a model having configurations", and an invalid configuration number gives no atoms. (Note: in the specifc case of CONFIGURATION, only "=" is allowed as a comparator.)',"@examples":[""],isUnsupported:!0,regex:m2,map:function(e){return parseInt(e)},level:"atom-test"},chain:{"@desc":'protein chain. For newer CIF files allowing multicharacter chain specifications, use quotations marks: select chain="AA". For these multicharacter desigations, case is not checked unless the CIF file has lower-case chain designations.',"@examples":["chain = A",'chain = "AA"'],regex:/[a-zA-Z0-9]+/,map:Jt,level:"chain-test",property:oi.ammp("auth_asym_id")},chainNo:{"@desc":'chain number; sequentially counted from 1 for each model; chainNo == 0 means"no chain" or PDB chain identifier indicated as a blank (Jmol 14.0).',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},color:{"@desc":"the atom color","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},covalentRadius:{"@desc":"covalent bonding radius, synonymous with covalent. Not used by Jmol, but could be used, for example, in {*}.spacefill={*}.covalentRadius.all.","@examples":[""],abbr:["covalent"],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},cs:{"@desc":"chemical shift calculated using computational results that include magnetic shielding tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},element:{"@desc":'element symbol. The value of this parameter depends upon the context. Used with select structure=x, x can be either the quoted element symbol, "H", "He", "Li", etc. or atomic number. In all other contexts, the value is the element symbol. When the atom is a specific isotope, the string will contain the isotope number -- "13C", for example.',"@examples":["element=Fe"],regex:/[a-zA-Z]+/,map:function(e){return oi.es(e)},level:"atom-test",property:oi.acp("elementSymbol")},elemno:{"@desc":"atomic element number","@examples":["elemno=8"],regex:/[0-9\s{}-]+/,map:function(e){return parseInt(e)},level:"atom-test",property:oi.acp("atomicNumber")},eta:{"@desc":"Based on Carlos M. Duarte, Leven M. Wadley, and Anna Marie Pyle, RNA structure comparison, motif search and discovery using a reduced representation of RNA conformational space, Nucleic Acids Research, 2003, Vol. 31, No. 16 4755-4761. The parameter eta is the C4'[i-1]-P[i]-C4'[i]-P[i+1] dihedral angle; theta is the P[i]-C4'[i]-P[i+1]-C4'[i+1] dihedral angle. Both are measured on a 0-360 degree scale because they are commonly near 180 degrees. Using the commands plot PROPERTIES eta theta resno; select visible;wireframe only one can create these authors' \"RNA worm\" graph.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},theta:{"@desc":"Based on Carlos M. Duarte, Leven M. Wadley, and Anna Marie Pyle, RNA structure comparison, motif search and discovery using a reduced representation of RNA conformational space, Nucleic Acids Research, 2003, Vol. 31, No. 16 4755-4761. The parameter eta is the C4'[i-1]-P[i]-C4'[i]-P[i+1] dihedral angle; theta is the P[i]-C4'[i]-P[i+1]-C4'[i+1] dihedral angle. Both are measured on a 0-360 degree scale because they are commonly near 180 degrees. Using the commands plot PROPERTIES eta theta resno; select visible;wireframe only one can create these authors' \"RNA worm\" graph.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},file:{"@desc":"file number containing this atom","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},formalCharge:{"@desc":"formal charge","@examples":["formalCharge=1"],regex:kc,map:function(e){return parseFloat(e)},level:"atom-test",property:oi.ammp("pdbx_formal_charge")},format:{"@desc":"format (label) of the atom.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fXyz:{"@desc":"fractional XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fX:{"@desc":"fractional X coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fY:{"@desc":"fractional Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fZ:{"@desc":"fractional Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fuxyz:{"@desc":"fractional XYZ coordinates in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fux:{"@desc":"fractional X coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fuy:{"@desc":"fractional Y coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fuz:{"@desc":"fractional Z coordinate in the unit cell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},group:{"@desc":"3-letter residue code","@examples":["group = ALA"],regex:/[a-zA-Z0-9]{1,3}/,map:Jt,level:"residue-test",property:oi.ammp("label_comp_id")},group1:{"@desc":"single-letter residue code (amino acids only)","@examples":["group1 = G"],regex:/[a-zA-Z]/,map:Jt,level:"residue-test",property:oi.ammp("label_comp_id")},groupID:{"@desc":"group ID number: A unique ID for each amino acid or nucleic acid residue in a PDB file. 0 noGroup 1-5 ALA, ARG, ASN, ASP, CYS 6-10 GLN, GLU, GLY, HIS, ILE 11-15 LEU, LYS, MET, PHE, PRO 16-20 SER, THR, TRP, TYR, VAL 21-23 ASX, GLX, UNK 24-29 A, +A, G, +G, I, +I 30-35 C, +C, T, +T, U, +U Additional unique numbers are assigned arbitrarily by Jmol and cannot be used reproducibly.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},groupindex:{"@desc":"overall group index","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},hydrophobicity:{"@desc":"Aminoacid residue scale of hydrophobicity based on Rose, G. D., Geselowitz, A. R., Lesser, G. J., Lee, R. H., and Zehfus, M. H. (1985). Hydrophobicity of amino acid residues in globular proteins, Science, 229(4716):834-838.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},identify:{"@desc":"for a PDB/mmCIF file, a label such as [ILE]7^1:A.CD1%A/3 #47, which includes the group ([ILE]), residue number with optional insertion code (7^1), chain (:A), atom name (CD1), alternate location if present (%A), PDB model number (/3, for NMR models when one file is loaded; /file.model such as /2.3 if more than one file is loaded), and atom number (#47). For non-PDB data, the information is shorter -- for example, H15/2.1 #6, indicating atom name (H15), full file.model number (/2.1), and atom number (#6). If only a single model is loaded, %[identify] does not include the model number.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},insertion:{"@desc":"protein residue insertion code","@examples":["insertion=A"],regex:/[a-zA-Z0-9]/,map:Jt,level:"atom-test",property:oi.ammp("pdbx_PDB_ins_code")},label:{"@desc":"current atom label (same as format)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},mass:{"@desc":"atomic mass -- especially useful with appended .max or .sum","@examples":["mass > 13"],regex:kc,map:function(e){return parseFloat(e)},level:"atom-test",property:oi.acp("mass")},model:{"@desc":"model number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},modelindex:{"@desc":"a unique number for each model, starting with 0 and spanning all models in all files","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},modO:{"@desc":"currently calculated occupancy from modulation (0 to 100; NaN if atom has no occupancy modulation)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},modXYZ:{"@desc":"currently calculated displacement modulation (for incommensurately modulated structures). Also modX, modY, modZ for individual components. For atoms without modultion, {xx}.modXYZ is -1 and {xx}.modX is NaN, and in a label %[modXYZ] and %[modX] are blank.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},molecule:{"@desc":"molecule number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},monomer:{"@desc":"monomer number (group number) in a polymer (usually a chain), starting with 1, or 0 if not part of a biopolymer -- that is, not a connected carbohydrate, amino acid, or nucleic acid (Jmol 14.3.15)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},ms:{"@desc":"magnetic shielding calculated from file-loaded tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},occupancy:{"@desc":'CIF file site occupancy. In SELECT command comparisons ("select occupancy < 90"), an integer n implies measurement on a 0-100 scale; also, in the context %[occupancy] or %q for a label, the reported number is a percentage. In all other cases, such as when %Q is used in a label or when a decimal number is used in a comparison, the scale is 0.0 - 1.0.',"@examples":["occupancy < 1"],regex:kc,map:function(e){return parseFloat(e)},level:"atom-test",property:oi.ammp("occupancy")},partialCharge:{"@desc":"partial charge","@examples":[""],isUnsupported:!0,regex:kc,map:function(e){return parseFloat(e)},level:"atom-test"},phi:{"@desc":"protein group PHI angle for atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},polymer:{"@desc":"sequential polymer number in a model, starting with 1.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},polymerLength:{"@desc":"polymer length","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},property_xx:{"@desc":"a property created using the DATA command","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},psi:{"@desc":"protein group PSI angle for the atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},radius:{"@desc":'currently displayed radius -- In SELECT command comparisons ("select radius=n"), integer n implies Rasmol units 1/250 Angstroms; in all other cases or when a decimal number is used, the units are Angstroms.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},resno:{"@desc":"PDB residue number, not including insertion code (see also seqcode, below)","@examples":["resno = 100"],regex:/-?[0-9]+/,map:function(e){return parseInt(e)},level:"residue-test",property:oi.ammp("auth_seq_id")},selected:{"@desc":"1.0 if atom is selected; 0.0 if not","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},sequence:{"@desc":'PDB one-character sequence code, as a string of characters, with "?" indicated where single-character codes are not available',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},seqcode:{"@desc":'PDB residue number, including insertion code (for example, 234^2; "seqcode" option added in Jmol 14.3.16)',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},seqid:{"@desc":"(mmCIF only) the value from _atom_site.label_seq_id; a pointer to _entity_poly_seq.num in the ENTITY_POLY_SEQ category specifying the sequence of monomers in a polymer. Allowance is made for the possibility of microheterogeneity in a sample by allowing a given sequence number to be correlated with more than one monomer id. (Jmol 14.2.3)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},shape:{"@desc":'hybridization geometry such as "tetrahedral"',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},site:{"@desc":"crystallographic site number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},spacefill:{"@desc":"currently displayed radius","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},straightness:{"@desc":'quaternion-derived straightness (second derivative of the quaternion describing the orientation of the residue. This quantity will have different values depending upon the setting of quaternionFrame as "A" (alpha-carbon/phosphorus atom only), "C" (alpha-carbon/pyrimidine or purine base based), "P" (carbonyl-carbon peptide plane/phosphorus tetrahedron based), or "N" (amide-nitrogen based). The default is alpha-carbon based, which corresponds closely to the following combination of Ramachandran angles involving three consecutive residues i-1, i, and i+1: -psii-1 - phii + psii + phii+1.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},strucno:{"@desc":"a unique number for each helix, sheet, or turn in a model, starting with 1.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},structure:{"@desc":'The value of this parameter depends upon the context. Used with select structure=x, x can be either the quoted keyword "none", "turn", "sheet", "helix", "dna", "rna", or "carbohydrate" or a respective number 0-6. In the context {*}.structure, the return value is a number; in the context label %[structure], the return is one of the six keywords.',"@examples":['structure="helix"',"structure=3"],regex:/none|turn|sheet|helix|dna|rna|carbohydrate|[0-6]/i,map:Jt,level:"residue-test",property:"structure"},substructure:{"@desc":'like structure, the value of this parameter depends upon the context. Used with select substructure=x, x can be either the quoted keyword "none", "turn", "sheet", "helix", "dna", "rna", "carbohydrate", "helix310", "helixalpha", or "helixpi", or the respective number 0-9. In the context {*}.substructure, the return value is a number; in the context label %[substructure], the return is one of the nine keywords.',"@examples":['substructure = "alphahelix"',"substructure =9"],regex:/none|turn|sheet|helix|dna|rna|carbohydrate|helix310|helixalpha|helixpi|[0-9]/i,map:Jt,level:"residue-test",property:"structure"},surfacedistance:{"@desc":"A value related to the distance of an atom to a nominal molecular surface. 0 indicates at the surface. Positive numbers are minimum distances in Angstroms from the given atom to the surface.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},symop:{"@desc":'the first symmetry operation code that generated this atom by Jmol; an integer starting with 1. See also symmetry, below. This operator is only present if the file contains space group information and the file was loaded using the {i, j, k} option so as to generate symmetry-based atoms. To select only the original atoms prior to application of symmetry, you can either use "SYMOP=n", where n is the symmetry operator corresponding to "x,y,z", or you can specify instead simply "NOT symmetry" the way you might specify "NOT hydrogen". Note that atoms in special positions will have multiple operator matches. These atoms can be selected using the keyword SPECIALPOSITION. The special form select SYMOP=nijk selects a specific translation of atoms from the given crystallographic symmetry operation. Comparators <, <=, >, >=, and != can be used and only apply to the ijk part of the designation. The ijk are relative, not absolute. Thus, symop=2555 selects for atoms that have been transformed by symop=2 but not subjected to any further translation. select symop=1555 is identical to select not symmetry. All other ijk are relative to these selections for 555. If the model was loaded using load "filename.cif" {444 666 1}, where the 1 indicates that all symmetry-generated atoms are to be packed within cell 555 and then translated to fill the other 26 specified cells, then select symop=3555 is nearly the same as select symop=3 and cell=555. (The difference being that cell=555 selects for all atoms that are on any edge of the cell, while symop=3555 does not.) However, the situation is different if instead the model was loaded using load "filename.cif" {444 666 0}, where the 0 indicates that symmetry-generated atoms are to be placed exactly where their symmetry operator would put them (x,-y,z being different then from x, 1-y, z). In that case, select symop=3555 is for all atoms that have been generated using symmetry operation 3 but have not had any additional translations applied to the x,y,z expression found in the CIF file. If, for example, symmetry operation 3 is -x,-y,-z, then load "filename.cif" {444 666 0} will place an atom originally at {1/2, 1/2, 1/2} at positions {-1/2, -1/2, -1/2} (symop=3555) and {-3/2, -3/2, -3/2} (symop=3444) and 24 other sites.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},symmetry:{"@desc":'as "symmetry" or in a label as lower-case "o" gives list of crystallographic symmetry operators generating this atom with lattice designations,such as 3555; upper-case "%O" in a label gives a list without the lattice designations. See also symop, above.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},temperature:{"@desc":"yes yes temperature factor (B-factor)","@examples":["temperature >= 20"],regex:kc,map:function(e){return parseFloat(e)},level:"atom-test",property:oi.ammp("B_iso_or_equiv")},unitXyz:{"@desc":"unit cell XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},uX:{"@desc":"unit cell X coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},uY:{"@desc":"unit cell Y coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},uZ:{"@desc":"unit cell Z coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},valence:{"@desc":"the valence of an atom (sum of bonds, where double bond counts as 2 and triple bond counts as 3","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vanderwaals:{"@desc":"van der Waals radius","@examples":["vanderwaals >2"],regex:kc,map:function(e){return parseFloat(e)},level:"atom-test",property:oi.acp("vdw")},vectorScale:{"@desc":"vibration vector scale","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},volume:{"@desc":"approximate van der Waals volume for this atom. Note, {*}.volume gives an average; use {*}.volume.sum to get total volume.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vXyz:{"@desc":"vibration vector, or individual components as %vx %vy %vz. For atoms without vibration vectors, {xx}.vXyz is -1; in a label, %[vxyz] is blank.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vX:{"@desc":"vibration vector X coordinate; for atoms without vibration vector, {xx}.vX is NaN (same for vY and vZ)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vY:{"@desc":"vibration vector Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vZ:{"@desc":"vibration vector Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},xyz:{"@desc":"Cartesian XYZ coordinates; select xyz > 1.0 selects atoms more than one Angstrom from the origin.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"}},u$=fe,c$=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not ARG"],name:"not",type:ss,rule:We.alt(We.regex(/NOT/i).skip(We.whitespace),We.string("!").skip(We.optWhitespace)),map:function(e,t){return Zu(t)}},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["ASP and .CA"],name:"and",type:Us,rule:ap(/AND|&/i),map:function(e,t,r){return u$.struct.modifier.intersectBy({0:t,by:r})}},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["ASP or GLU"],name:"or",type:Us,rule:ap(/OR|\||,/i),map:function(e,t,r){return u$.struct.combinator.merge([t,r])}}],Me=fe,fa={acidic:["ASP","GLU"],aliphatic:["ALA","GLY","ILE","LEU","VAL"],amino:["ALA","ARG","ASN","ASP","CYS","GLN","GLU","GLY","HIS","ILE","LEU","LYS","MET","PHE","PRO","SER","THR","TRP","TYR","VAL","ASX","GLX","UNK"],aromatic:["HIS","PHE","TRP","TYR"],basic:["ARG","HIS","LYS"],buried:["ALA","CYS","ILE","LEU","MET","PHE","TRP","VAL"],cg:["CYT","C","GUA","G"],cyclic:["HIS","PHE","PRO","TRP","TYR"],hydrophobic:["ALA","GLY","ILE","LEU","MET","PHE","PRO","TRP","TYR","VAL"],large:["ARG","GLU","GLN","HIS","ILE","LEU","LYS","MET","PHE","TRP","TYR"],medium:["ASN","ASP","CYS","PRO","THR","VAL"],small:["ALA","GLY","SER"],nucleic:["G","C","A","T","U","I","DG","DC","DA","DT","DU","DI","+G","+C","+A","+T","+U","+I"]},l$_nucleic=["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],l$_protein=["C","N","CA"];function h2(){return Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,fa.nucleic),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.and([Me.core.rel.eq([Me.struct.atomSet.atomCount(),1]),Me.core.rel.eq([Me.ammp("label_atom_id"),Me.atomName("P")])])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.or([Me.core.set.isSubset([Pd(["C1'","C2'","O3'","C3'","C4'","C5'","O5'"]),Me.ammpSet("label_atom_id")]),Me.core.set.isSubset([Pd(["C1*","C2*","O3*","C3*","C4*","C5*","O5*"]),Me.ammpSet("label_atom_id")])])})])}var d$={all:{"@desc":"all atoms; same as *",abbr:["*"],map:function(){return Me.struct.generator.all()}},bonded:{"@desc":"covalently bonded",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.gr([Me.struct.atomProperty.core.bondCount({flags:Me.struct.type.bondFlags(["covalent","metallic","sulfide"])}),0])})}},clickable:{"@desc":"actually visible -- having some visible aspect such as wireframe, spacefill, or a label showing, or the alpha-carbon or phosphorus atom in a biomolecule that is rendered with only cartoon, rocket, or other biomolecule-specific shape."},connected:{"@desc":"bonded in any way, including hydrogen bonds",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.gr([Me.struct.atomProperty.core.bondCount({flags:Me.struct.type.bondFlags()}),0])})}},displayed:{"@desc":"displayed using the display or hide command; not necessarily visible"},hidden:{"@desc":"hidden using the display or hide command"},none:{"@desc":"no atoms",map:function(){return Me.struct.generator.empty()}},selected:{"@desc":"atoms that have been selected; defaults to all when a file is first loaded"},thisModel:{"@desc":'atoms in the current frame set, as defined by frame, model, or animation commands. If more than one model is in this set, "thisModel" refers to all of them, regardless of atom displayed/hidden status.'},visible:{"@desc":"visible in any way, including PDB residue atoms for which a cartoon or other such rendering makes their group visible, even if they themselves are not visible."},subset:{"@desc":"the currently defined subset. Note that if a subset is currently defined, then select/display all is the same as select/display subset, restrict none is the same as restrict not subset. In addition, select not subset selects nothing."},specialPosition:{"@desc":"atoms in crystal structures that are at special positions - that is, for which there is more than one operator that leads to them."},unitcell:{"@desc":"atoms within the current unitcell, which may be offset. This includes atoms on the faces and at the vertices of the unitcell."},polyhedra:{"@desc":"all central atoms for which polyhedra have been created. See also polyhera(n), below. (Jmol 14.4)"},nonmetal:{"@desc":"_H,_He,_B,_C,_N,_O,_F,_Ne,_Si,_P,_S,_Cl,_Ar,_As,_Se,_Br,_Kr,_Te,_I,_Xe,_At,_Rn",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map(Me.es)),Me.acp("elementSymbol")])})}},metal:{"@desc":"!nonmetal",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.logic.not([Me.core.set.has([Me.set.apply(Me,["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map(Me.es)),Me.acp("elementSymbol")])])})}},alkaliMetal:{"@desc":"_Li,_Na,_K,_Rb,_Cs,_Fr",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["Li","Na","K","Rb","Cs","Fr"].map(Me.es)),Me.acp("elementSymbol")])})}},alkalineEarth:{"@desc":"_Be,_Mg,_Ca,_Sr,_Ba,_Ra",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["Be","Mg","Ca","Sr","Ba","Ra"].map(Me.es)),Me.acp("elementSymbol")])})}},nobleGas:{"@desc":"_He,_Ne,_Ar,_Kr,_Xe,_Rn",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["He","Ne","Ar","Kr","Xe","Rn"].map(Me.es)),Me.acp("elementSymbol")])})}},metalloid:{"@desc":"_B,_Si,_Ge,_As,_Sb,_Te",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["B","Si","Ge","As","Sb","Te"].map(Me.es)),Me.acp("elementSymbol")])})}},transitionMetal:{"@desc":"(includes La and Ac) elemno>=21 and elemno<=30, elemno=57, elemno=89, elemno>=39 and elemno<=48, elemno>=72 and elemno<=80, elemno>=104 and elemno<=112",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.logic.or([Me.core.rel.inRange([Me.acp("atomicNumber"),21,30]),Me.core.rel.inRange([Me.acp("atomicNumber"),39,48]),Me.core.rel.inRange([Me.acp("atomicNumber"),72,80]),Me.core.rel.inRange([Me.acp("atomicNumber"),104,112]),Me.core.set.has([Me.set(57,89),Me.acp("atomicNumber")])])})}},lanthanide:{"@desc":"(does not include La) elemno>57 and elemno<=71",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.inRange([Me.acp("atomicNumber"),57,71])})}},actinide:{"@desc":"(does not include Ac) elemno>89 and elemno<=103",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.inRange([Me.acp("atomicNumber"),89,103])})}},isaromatic:{"@desc":"atoms connected with the AROMATIC, AROMATICSINGLE, or AROMATICDOUBLE bond types",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.gr([Me.struct.atomProperty.core.bondCount({flags:Me.struct.type.bondFlags(["aromatic"])}),0])})}},carbohydrate:{"@desc":""},ions:{"@desc":'(specifically the PDB designations "PO4" and "SO4")'},ligand:{"@desc":'(originally "hetero and not solvent"; changed to "!(protein,nucleic,water,UREA)" for Jmol 12.2)'},nucleic:{"@desc":'any group that (a) has one of the following group names: G, C, A, T, U, I, DG, DC, DA, DT, DU, DI, +G, +C, +A, +T, +U, +I; or (b) can be identified as a group that is only one atom, with name "P"; or (c) has all of the following atoms (prime, \', can replace * here): C1*, C2*, C3*, O3*, C4*, C5*, and O5*.',map:function(){return h2()}},purine:{"@desc":"any nucleic group that (a) has one of the following group names: A, G, I, DA, DG, DI, +A, +G, or +I; or (b) also has atoms N7, C8, and N9.",map:function(){return Me.struct.modifier.intersectBy({0:h2(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["A","G","I","DA","DG","DI","+A","+G","+I"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.set.isSubset([Pd(["N7","C8","N9"]),Me.ammpSet("label_atom_id")])})])})}},pyrimidine:{"@desc":"any nucleic group that (a) has one of the following group names: C, T, U, DC, DT, DU, +C, +T, +U; or (b) also has atom O2.",map:function(){return Me.struct.modifier.intersectBy({0:h2(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["C","T","U","DC","DT","DU","+C","+T","+U"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.or([Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2*")]),Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2'")])])})])})}},dna:{"@desc":"any nucleic group that (a) has one of the following group names: DG, DC, DA, DT, DU, DI, T, +G, +C, +A, +T; or (b) has neither atom O2* or O2'.",map:function(){return Me.struct.modifier.intersectBy({0:h2(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["DG","DC","DA","DT","DU","DI","T","+G","+C","+A","+T"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.not([Me.core.logic.or([Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2*")]),Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2'")])])])})])})}},rna:{"@desc":"any nucleic group that (a) has one of the following group names: G, C, A, U, I, +U, +I; or (b) has atom O2* or O2'.",map:function(){return Me.struct.modifier.intersectBy({0:h2(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["G","C","A","U","I","+U","+I"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.or([Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2*")]),Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2'")])])})])})}},protein:{"@desc":'defined as a group that (a) has one of the following group names: ALA, ARG, ASN, ASP, CYS, GLN, GLU, GLY, HIS, ILE, LEU, LYS, MET, PHE, PRO, SER, THR, TRP, TYR, VAL, ASX, GLX, or UNK; or (b) contains PDB atom designations [C, O, CA, and N] bonded correctly; or (c) does not contain "O" but contains [C, CA, and N] bonded correctly; or (d) has only one atom, which has name CA and does not have the group name CA (indicating a calcium atom).',map:function(){return function w8e(){return Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,fa.amino),Me.ammp("label_comp_id")])})}()}},acidic:{"@desc":"ASP GLU",map:function(){return Qr(fa.acidic)}},acyclic:{"@desc":"amino and not cyclic",map:function(){return Me.struct.modifier.intersectBy({0:Qr(fa.amino),by:Zu(Qr(fa.cyclic))})}},aliphatic:{"@desc":"ALA GLY ILE LEU VAL",map:function(){return Qr(fa.aliphatic)}},amino:{"@desc":"all twenty standard amino acids, plus ASX, GLX, UNK",map:function(){return Qr(fa.amino)}},aromatic:{"@desc":'HIS PHE TRP TYR (see also "isaromatic" for aromatic bonds)',map:function(){return Qr(fa.aromatic)}},basic:{"@desc":"ARG HIS LYS",map:function(){return Qr(fa.basic)}},buried:{"@desc":"ALA CYS ILE LEU MET PHE TRP VAL",map:function(){return Qr(fa.buried)}},charged:{"@desc":"same as acidic or basic -- ASP GLU, ARG HIS LYS",map:function(){return Qr(fa.acidic.concat(fa.basic))}},cyclic:{"@desc":"HIS PHE PRO TRP TYR",map:function(){return Qr(fa.cyclic)}},helix:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["helix"]),Me.ammp("secondaryStructureFlags")])})}},helixalpha:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["alpha"]),Me.ammp("secondaryStructureFlags")])})}},helix310:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["3-10"]),Me.ammp("secondaryStructureFlags")])})}},helixpi:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["pi"]),Me.ammp("secondaryStructureFlags")])})}},hetero:{"@desc":"PDB atoms designated as HETATM",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.ammp("isHet")})}},hydrophobic:{"@desc":"ALA GLY ILE LEU MET PHE PRO TRP TYR VAL",map:function(){return Qr(fa.hydrophobic)}},large:{"@desc":"ARG GLU GLN HIS ILE LEU LYS MET PHE TRP TYR",map:function(){return Qr(fa.large)}},medium:{"@desc":"ASN ASP CYS PRO THR VAL",map:function(){return Qr(fa.medium)}},negative:{"@desc":"same as acidic -- ASP GLU",map:function(){return Qr(fa.acidic)}},neutral:{"@desc":"amino and not (acidic or basic)",map:function(){return Me.struct.modifier.intersectBy({0:Qr(fa.amino),by:Zu(Qr(fa.acidic.concat(fa.basic)))})}},polar:{"@desc":"amino and not hydrophobic",map:function(){return Me.struct.modifier.intersectBy({0:Qr(fa.amino),by:Zu(Qr(fa.hydrophobic))})}},positive:{"@desc":"same as basic -- ARG HIS LYS",map:function(){return Qr(fa.basic)}},sheet:{"@desc":"secondary structure-related",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["sheet"]),Me.ammp("secondaryStructureFlags")])})}},small:{"@desc":"ALA GLY SER",map:function(){return Qr(fa.small)}},surface:{"@desc":"amino and not buried",map:function(){return Me.struct.modifier.intersectBy({0:Qr(fa.amino),by:Zu(Qr(fa.buried))})}},turn:{"@desc":"secondary structure-related",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["turn"]),Me.ammp("secondaryStructureFlags")])})}},alpha:{"@desc":"(*.CA)",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.eq([Me.atomName("CA"),Me.ammp("label_atom_id")])})}},base:{"@desc":"(nucleic bases)"},backbone:{"@desc":"(*.C, *.CA, *.N, and all nucleic other than the bases themselves)",abbr:["mainchain"],map:function(){return function A8e(){return Me.struct.combinator.merge([Me.struct.modifier.intersectBy({0:Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.core.type.set(fa.amino),Me.ammp("label_comp_id")])}),by:Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.core.type.set(l$_protein),Me.ammp("label_atom_id")])})}),Me.struct.modifier.intersectBy({0:Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.core.type.set(fa.nucleic),Me.ammp("label_comp_id")])}),by:Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.core.type.set(l$_nucleic),Me.ammp("label_atom_id")])})})])}()}},sidechain:{"@desc":"((protein or nucleic) and not backbone)"},spine:{"@desc":"(*.CA, *.N, *.C for proteins; *.P, *.O3', *.O5', *.C3', *.C4', *.C5 for nucleic acids)"},leadatom:{"@desc":"(*.CA, *.P, and terminal *.O5')"},solvent:{"@desc":'PDB "HOH", water, also the connected set of H-O-H in any model'}},_r=fe,T8e=[{"@desc":"value comparisons","@examples":[],name:"=",abbr:["=="],type:Us,rule:We.regexp(/\s*(LIKE|>=|<=|=|!=|>|<)\s*/i,1),map:function(e,t,r){var n;if("structure"===t?n=_r.core.flags.hasAny([_r.ammp("secondaryStructureFlags"),o$(r)]):"structure"===r?n=_r.core.flags.hasAny([_r.ammp("secondaryStructureFlags"),o$(t)]):void 0!==t.head?"core.type.regex"===t.head.name&&(n=_r.core.str.match([t,_r.core.type.str([r])])):void 0!==r.head?"core.type.regex"===r.head.name&&(n=_r.core.str.match([r,_r.core.type.str([t])])):"LIKE"===e.toUpperCase()&&(n=_r.core.str.match(t.head?[_r.core.type.regex(["^".concat(r,"$"),"i"]),_r.core.type.str([t])]:[_r.core.type.regex(["^".concat(t,"$"),"i"]),_r.core.type.str([r])])),!n)switch(t.head&&(r=p2(t,r)),r.head&&(t=p2(r,t)),e){case"=":n=_r.core.rel.eq([t,r]);break;case"!=":n=_r.core.rel.neq([t,r]);break;case">":n=_r.core.rel.gr([t,r]);break;case"<":n=_r.core.rel.lt([t,r]);break;case">=":n=_r.core.rel.gre([t,r]);break;case"<=":n=_r.core.rel.lte([t,r]);break;default:throw new Error("value operator '".concat(e,"' not supported"))}return _r.struct.generator.atomGroups({"atom-test":n})}}];function D8e(e){var t=e[1],r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c={};o&&(c["chain-test"]=_r.core.rel.eq([_r.ammp("auth_asym_id"),o]));var l=[];r&&l.push(_r.core.rel.eq([_r.ammp("label_comp_id"),r])),n&&l.push(_r.core.logic.and([_r.core.rel.gre([_r.ammp("auth_seq_id"),n[0]]),_r.core.rel.lte([_r.ammp("auth_seq_id"),n[1]])])),a&&l.push(_r.core.rel.eq([_r.ammp("auth_seq_id"),a])),i&&l.push(_r.core.rel.eq([_r.ammp("pdbx_PDB_ins_code"),i])),l.length&&(c["residue-test"]=pB(l));var d=[];return s&&d.push(_r.core.rel.eq([_r.ammp("auth_atom_id"),s])),u&&d.push(_r.core.rel.eq([_r.ammp("label_alt_id"),u])),d.length&&(c["atom-test"]=pB(d)),_r.struct.generator.atomGroups(c)}var E8e=We.createLanguage({Integer:function(){return We.regexp(/-?[0-9]+/).map(Number).desc("integer")},Parens:function(e){return We.alt(e.Parens,e.Operator,e.Expression).wrap(We.regexp(/\(\s*/),We.regexp(/\s*\)/))},Expression:function(e){return We.alt(e.Keywords,e.AtomExpression.map(D8e),e.Within.map(function(t){return _r.struct.modifier.includeSurroundings({0:t[1],radius:t[0]})}),e.ValueQuery,e.Element.map(function(t){return _r.struct.generator.atomGroups({"atom-test":_r.core.rel.eq([_r.acp("elementSymbol"),_r.struct.type.elementSymbol(t)])})}),e.Resname.map(function(t){return _r.struct.generator.atomGroups({"residue-test":_r.core.rel.eq([_r.ammp("label_comp_id"),t])})}))},Operator:function(e){return f2(c$,We.alt(e.Parens,e.Expression))},AtomExpression:function(e){return We.seq(We.lookahead(e.AtomPrefix),We.seq(e.BracketedResname.or(We.of(null)),e.ResnoRange.or(We.of(null)),e.Resno.or(We.of(null)),e.Inscode.or(We.of(null)),e.Chainname.or(We.of(null)),e.Atomname.or(We.of(null)),e.Altloc.or(We.of(null)),e.Model.or(We.of(null)))).desc("expression")},AtomPrefix:function(){return We.regexp(/[\[0-9:^%/.-]/).desc("atom-prefix")},Chainname:function(){return We.regexp(/:([A-Za-z]{1,3})/,1).desc("chainname")},Model:function(){return We.regexp(/\/([0-9]+)/,1).map(Number).desc("model")},Element:function(){return We.regexp(/_([A-Za-z]{1,3})/,1).desc("element")},Atomname:function(){return We.regexp(/\.([a-zA-Z0-9]{1,4})/,1).map(_r.atomName).desc("atomname")},Resname:function(){return We.regexp(/[a-zA-Z0-9]{1,4}/).desc("resname")},Resno:function(e){return e.Integer.desc("resno")},Altloc:function(){return We.regexp(/%([a-zA-Z0-9])/,1).desc("altloc")},Inscode:function(){return We.regexp(/\^([a-zA-Z0-9])/,1).desc("inscode")},BracketedResname:function(){return We.regexp(/\[([a-zA-Z0-9]{1,4})\]/,1).desc("bracketed-resname")},ResnoRange:function(e){return We.seq(e.Integer.skip(We.seq(We.optWhitespace,We.string("-"),We.optWhitespace)),e.Integer).desc("resno-range")},Within:function(e){return We.regexp(/within/i).skip(We.regexp(/\s*\(\s*/)).then(We.seq(e.Integer.skip(We.regexp(/\s*,\s*/)),e.Query)).skip(We.regexp(/\)/))},Keywords:function(){var e;return(e=We).alt.apply(e,vB(d$)).desc("keyword")},Query:function(e){return We.alt(e.Operator,e.Parens,e.Expression).trim(We.optWhitespace)},Number:function(){return We.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){var e=yB(s$,d$,c$).sort(Id).map(aS).join("|");return We.alt(We.regexp(new RegExp("(?!(".concat(e,"))[A-Z0-9_]+"),"i")),We.regexp(/'((?:[^"\\]|\\.)*)'/,1),We.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(function(t){return _r.core.type.regex(["^".concat(t,"$"),"i"])})).desc("string")},Value:function(e){return We.alt(e.Number,e.String)},ValueParens:function(e){return We.alt(e.ValueParens,e.ValueOperator,e.ValueExpressions).wrap(We.string("("),We.string(")"))},ValuePropertyNames:function(){var e;return(e=We).alt.apply(e,gB(s$,/LIKE|>=|<=|=|!=|>|<|\)|\s/i))},ValueOperator:function(e){return f2(T8e,We.alt(e.ValueParens,e.ValueExpressions))},ValueExpressions:function(e){return We.alt(e.Value,e.ValuePropertyNames)},ValueQuery:function(e){return We.alt(e.ValueOperator.map(function(t){if(t.head){if(t.head.name.startsWith("structure-query.generator"))return t}else if("string"==typeof t&&t.length<=4)return _r.struct.generator.atomGroups({"residue-test":_r.core.rel.eq([_r.ammp("label_comp_id"),t])});throw new Error("values must be part of an comparison, value '".concat(t,"'"))}))}}),Eo=fe,aT=/[-+]?[0-9]*\.?[0-9]+/;function uy(e){return e.split("+").map(function(t){return t.replace(/^["']|["']$/g,"")})}function bB(e){if(e.includes("-")&&e.includes("+")){var t=e.split("+").map(function(u){return u.replace(/^["']|["']$/g,"")}),r=[];return t.forEach(function(u){if(u.includes("-")&&!u.startsWith("-"))for(var c=u.split("-").map(function(p){return parseInt(p)}),d=c[1],f=l=c[0];f<=d;f++)r.push(f);else if(u.includes("-")&&u.startsWith("-")&&u.match(/[0-9]+-[-0-9]+/)){var l=-parseInt(u.split("-")[1]);for(d=void 0,d=u.includes("--")?-parseInt(u.split("-")[3]):parseInt(u.split("-")[2]),f=l;f<=d;f++)r.push(f)}else u.includes("-")&&u.startsWith("-")&&u.match(/[0-9]+-[-0-9]+/),r.push(parseInt(u))}),r}if(e.includes("-")&&!e.includes("+")){var n=[];if(e.startsWith("-"))if(e.startsWith("-")&&e.match(/[0-9]+-[-0-9]+/)){var i=-parseInt(e.split("-")[1]),o=void 0;o=e.includes("--")?-parseInt(e.split("-")[3]):parseInt(e.split("-")[2]);for(var s=i;s<=o;s++)n.push(s)}else e.startsWith("-")&&e.match(/[0-9]+-[-0-9]+/),n.push(parseInt(e));else{var a=e.split("-").map(function(u){return parseInt(u)});for(o=a[1],s=i=a[0];s<=o;s++)n.push(s)}return n}return!e.includes("-")&&e.includes("+")?uy(e).map(function(u){return parseInt(u)}):[parseInt(e)]}var R8e={H:"helix",S:"beta",L:"none"},iT={symbol:{"@desc":"chemical-symbol-list: list of 1- or 2-letter chemical symbols from the periodic table","@examples":["symbol O+N"],abbr:["e."],regex:/[a-zA-Z'"+]+/,map:function M8e(e){return e.split("+").map(Eo.struct.type.elementSymbol)},level:"atom-test",property:Eo.acp("elementSymbol")},name:{"@desc":"atom-name-list: list of up to 4-letter codes for atoms in proteins or nucleic acids","@examples":["name CA+CB+CG+CD"],abbr:["n."],regex:/[a-zA-Z0-9'"+]+/,map:function P8e(e){return e.split("+").map(Eo.atomName)},level:"atom-test",property:Eo.ammp("label_atom_id")},resn:{"@desc":"residue-name-list: list of 3-letter codes for amino acids or list of up to 2-letter codes for nucleic acids","@examples":["resn ASP+GLU+ASN+GLN","resn A+G"],abbr:["resname","r."],regex:/[a-zA-Z0-9'"+]+/,map:uy,level:"residue-test",property:Eo.ammp("label_comp_id")},resi:{"@desc":"residue-identifier-list list of up to 4-digit residue numbers or residue-identifier-range","@examples":["resi 1+10+100+1000","resi 1-10"],abbr:["resident","residue","resid","i."],regex:/[0-9+-]+/,map:bB,level:"residue-test",property:Eo.ammp("auth_seq_id")},alt:{"@desc":"alternate-conformation-identifier-list list of single letters","@examples":["alt A+B",'alt ""','alt ""+A'],abbr:[],regex:/[a-zA-Z0-9'"+]+/,map:uy,level:"atom-test",property:Eo.ammp("label_alt_id")},chain:{"@desc":"chain-identifier-list list of single letters or sometimes numbers","@examples":["chain A"],abbr:["c."],regex:/[a-zA-Z0-9'"+]+/,map:uy,level:"chain-test",property:Eo.ammp("auth_asym_id")},segi:{"@desc":"segment-identifier-list list of up to 4 letter identifiers","@examples":["segi lig"],abbr:["segid","s."],regex:/[a-zA-Z0-9'"+]+/,map:uy,level:"chain-test",property:Eo.ammp("label_asym_id")},flag:{"@desc":"flag-number a single integer from 0 to 31","@examples":["flag 0"],isUnsupported:!0,abbr:["f."],regex:/[0-9]+/,map:function(e){return parseInt(e)},level:"atom-test"},numeric_type:{"@desc":"type-number a single integer","@examples":["nt. 5"],isUnsupported:!0,abbr:["nt."],regex:/[0-9]+/,map:function(e){return parseInt(e)},level:"atom-test"},text_type:{"@desc":"type-string a list of up to 4 letter codes","@examples":["text_type HA+HC"],isUnsupported:!0,abbr:["tt."],regex:/[a-zA-Z0-9'"+]+/,map:uy,level:"atom-test"},id:{"@desc":"external-index-number a single integer","@examples":["id 23"],regex:/[0-9+-]+/,map:bB,level:"atom-test",property:Eo.ammp("id")},index:{"@desc":"internal-index-number a single integer","@examples":["index 11"],regex:/[0-9+-]+/,map:bB,level:"atom-test",property:Eo.ammp("id")},ss:{"@desc":"secondary-structure-type list of single letters. Helical regions should be assigned H and sheet regions S. Loop regions can either be assigned L or be blank.","@examples":["ss H+S+L",'ss S+""'],abbr:[],regex:/[a-zA-Z'"+]+/,map:function O8e(e){return{flags:Eo.struct.type.secondaryStructureFlags(e.toUpperCase().split("+").map(function(t){return R8e[t]||"none"}))}},level:"residue-test",property:Eo.ammp("secondaryStructureFlags")},b:{"@desc":"comparison-operator b-factor-value a real number","@examples":["b > 10"],isNumeric:!0,abbr:[],regex:aT,map:function(e){return parseFloat(e)},level:"atom-test",property:Eo.ammp("B_iso_or_equiv")},q:{"@desc":"comparison-operator occupancy-value a real number","@examples":["q <0.50"],isNumeric:!0,abbr:[],regex:aT,map:function(e){return parseFloat(e)},level:"atom-test",property:Eo.ammp("occupancy")},formal_charge:{"@desc":"comparison-operator formal charge-value an integer","@examples":["fc. = -1"],isNumeric:!0,abbr:["fc."],regex:aT,map:function(e){return parseFloat(e)},level:"atom-test",property:Eo.ammp("pdbx_formal_charge")},partial_charge:{"@desc":"comparison-operator partial charge-value a real number","@examples":["pc. > 1"],isUnsupported:!0,isNumeric:!0,abbr:["pc."],regex:aT,map:function(e){return parseFloat(e)},level:"atom-test"},elem:{"@desc":'str atomic element symbol string ("X" if undefined)',"@examples":["elem N"],regex:/[a-zA-Z0-9]{1,3}/,map:function(e){return Eo.es(e)},level:"atom-test",property:Eo.acp("elementSymbol")}},cr=fe,f$=[{"@desc":"Selects atoms that are not included in s1.","@examples":["NOT resn ALA","not (resi 42 or chain A)","!resi 42 or chain A"],name:"not",type:ss,rule:We.alt(We.regexp(/NOT/i).skip(We.whitespace),We.string("!").skip(We.optWhitespace)),map:function(e,t){return Zu(t)}},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["chain A AND name CA"],name:"and",type:Us,rule:ap(/AND|&/i),map:function(e,t,r){return cr.struct.modifier.intersectBy({0:t,by:r})}},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["chain A OR chain B"],name:"or",type:Us,rule:ap(/OR|\|/i),map:function(e,t,r){return cr.struct.combinator.merge([t,r])}},{"@desc":"Selects atoms in s1 whose identifiers name, resi, resn, chain and segi all match atoms in s2.","@examples":["chain A IN chain B"],name:"in",type:Us,rule:ap(/IN/i),map:function(e,t,r){return cr.struct.filter.withSameAtomProperties({0:t,source:r,property:cr.core.type.compositeKey([cr.ammp("label_atom_id"),cr.ammp("label_seq_id"),cr.ammp("label_comp_id"),cr.ammp("auth_asym_id"),cr.ammp("label_asym_id")])})}},{"@desc":"Selects atoms in s1 whose identifiers name and resi match atoms in s2.","@examples":["chain A LIKE chain B"],name:"like",type:Us,rule:ap(/LIKE|l\./i),map:function(e,t,r){return cr.struct.filter.withSameAtomProperties({0:t,source:r,property:cr.core.type.compositeKey([cr.ammp("label_atom_id"),cr.ammp("label_seq_id")])})}},{"@desc":"Selects all atoms whose van der Waals radii are separated from the van der Waals radii of s1 by a minimum of X Angstroms.","@examples":["solvent GAP 2"],name:"gap",type:rT,rule:nT(/GAP\s+([-+]?[0-9]*\.?[0-9]+)/i,1).map(function(e){return parseFloat(e)}),map:function(e,t){return cr.struct.filter.within({0:cr.struct.generator.all(),target:t,"atom-radius":cr.acp("vdw"),"max-radius":e,invert:!0})}},{"@desc":"Selects atoms with centers within X Angstroms of the center of any atom in s1.","@examples":["resname LIG AROUND 1"],name:"around",abbr:["a."],type:rT,rule:nT(/(AROUND|a\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(function(e){return parseFloat(e)}),map:function(e,t){return cr.struct.modifier.exceptBy({0:cr.struct.filter.within({0:cr.struct.generator.all(),target:t,"max-radius":e}),by:t})}},{"@desc":"Expands s1 by all atoms within X Angstroms of the center of any atom in s1.","@examples":["chain A EXPAND 3"],name:"expand",abbr:["x."],type:rT,rule:nT(/(EXPAND|x\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(function(e){return parseFloat(e)}),map:function(e,t){return cr.struct.modifier.includeSurroundings({0:t,radius:e})}},{"@desc":"Selects atoms in s1 that are within X Angstroms of any atom in s2.","@examples":["chain A WITHIN 3 OF chain B"],name:"within",abbr:["w."],type:Us,rule:fB("WITHIN","w."),map:function(e,t,r){return cr.struct.filter.within({0:t,target:r,"max-radius":e})}},{"@desc":"Same as within, but excludes s2 from the selection (and thus is identical to s1 and s2 around X).","@examples":["chain A NEAR_TO 3 OF chain B"],name:"near_to",abbr:["nto."],type:Us,rule:fB("NEAR_TO","nto."),map:function(e,t,r){return cr.struct.modifier.exceptBy({0:cr.struct.filter.within({0:t,target:r,"max-radius":e}),by:r})}},{"@desc":"Selects atoms in s1 that are at least X Anstroms away from s2.","@examples":["solvent BEYOND 2 OF chain A"],name:"beyond",abbr:["be."],type:Us,rule:fB("BEYOND","be."),map:function(e,t,r){return cr.struct.modifier.exceptBy({0:cr.struct.filter.within({0:t,target:r,"max-radius":e,invert:!0}),by:r})}},{"@desc":"Expands selection to complete residues.","@examples":["BYRESIDUE name N"],name:"byresidue",abbr:["byresi","byres","br."],type:ss,rule:Ku(/BYRESIDUE|byresi|byres|br\./i),map:function(e,t){return Md(cr.struct.modifier.expandProperty({0:cr.struct.modifier.union({0:t}),property:cr.ammp("residueKey")}))}},{"@desc":"Completely selects all alpha carbons in all residues covered by a selection.","@examples":["BYCALPHA chain A"],name:"bycalpha",abbr:["bca."],type:ss,rule:Ku(/BYCALPHA|bca\./i),map:function(e,t){return cr.struct.generator.queryInSelection({0:cr.struct.modifier.expandProperty({0:cr.struct.modifier.union({0:t}),property:cr.ammp("residueKey")}),query:cr.struct.generator.atomGroups({"atom-test":cr.core.rel.eq([cr.atomName("CA"),cr.ammp("label_atom_id")])})})}},{"@desc":"Expands selection to complete molecules.","@examples":["BYMOLECULE resi 20-30"],name:"bymolecule",isUnsupported:!0,abbr:["bymol","bm."],type:ss,rule:Ku(/BYMOLECULE|bymol|bm\./i),map:function(e,t){return Md(cr.struct.modifier.expandProperty({0:cr.struct.modifier.union({0:t}),property:cr.atp("connectedComponentKey")}))}},{"@desc":"Expands selection to complete fragments.","@examples":["BYFRAGMENT resi 10"],name:"byfragment",abbr:["byfrag","bf."],isUnsupported:!0,type:ss,rule:Ku(/BYFRAGMENT|byfrag|bf\./i),map:function(e,t){return[e,t]}},{"@desc":"Expands selection to complete segments.","@examples":["BYSEGMENT resn CYS"],name:"bysegment",abbr:["bysegi","byseg","bs."],type:ss,rule:Ku(/BYSEGMENT|bysegi|byseg|bs\./i),map:function(e,t){return Md(cr.struct.modifier.expandProperty({0:cr.struct.modifier.union({0:t}),property:cr.ammp("chainKey")}))}},{"@desc":"Expands selection to complete objects.","@examples":["BYOBJECT chain A"],name:"byobject",abbr:["byobj","bo."],isUnsupported:!0,type:ss,rule:Ku(/BYOBJECT|byobj|bo\./i),map:function(e,t){return[e,t]}},{"@desc":"Expands selection to unit cell.","@examples":["BYCELL chain A"],name:"bycell",isUnsupported:!0,type:ss,rule:Ku(/BYCELL/i),map:function(e,t){return[e,t]}},{"@desc":"All rings of size \u2264 7 which have at least one atom in s1.","@examples":["BYRING resn HEM"],name:"byring",type:ss,rule:Ku(/BYRING/i),map:function(e,t){return Md(cr.struct.modifier.intersectBy({0:cr.struct.filter.pick({0:cr.struct.generator.rings(),test:cr.core.logic.and([cr.core.rel.lte([cr.struct.atomSet.atomCount(),7]),cr.core.rel.gr([cr.struct.atomSet.countQuery([t]),1])])}),by:t}))}},{"@desc":"Selects atoms directly bonded to s1, excludes s1.","@examples":["NEIGHBOR resn CYS"],name:"neighbor",type:ss,abbr:["nbr."],rule:Ku(/NEIGHBOR|nbr\./i),map:function(e,t){return cr.struct.modifier.exceptBy({0:Md(cr.struct.modifier.includeConnected({0:cr.struct.modifier.union({0:t}),"bond-test":!0})),by:t})}},{"@desc":"Selects atoms directly bonded to s1, may include s1.","@examples":["BOUND_TO name CA"],name:"bound_to",abbr:["bto."],type:ss,rule:Ku(/BOUND_TO|bto\./i),map:function(e,t){return Md(cr.struct.modifier.includeConnected({0:cr.struct.modifier.union({0:t})}))}},{"@desc":"Extends s1 by X bonds connected to atoms in s1.","@examples":["resname LIG EXTEND 3"],name:"extend",abbr:["xt."],type:rT,rule:nT(/(EXTEND|xt\.)\s+([0-9]+)/i,2).map(function(e){return parseInt(e)}),map:function(e,t){return Md(cr.struct.modifier.includeConnected({0:cr.struct.modifier.union({0:t}),"bond-test":!0,"layer-count":e}))}}],Pt=fe,us={nucleic:["A","C","T","G","U","DA","DC","DT","DG","DU"],protein:["ALA","ARG","ASN","ASP","CYS","CYX","GLN","GLU","GLY","HIS","HID","HIE","HIP","ILE","LEU","LYS","MET","MSE","PHE","PRO","SER","THR","TRP","TYR","VAL"],solvent:["HOH","WAT","H20","TIP","SOL"]},p$_nucleic=["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],p$_protein=["C","N","CA","O"];function m$(){return Pt.struct.combinator.merge([Pt.struct.modifier.intersectBy({0:Pt.struct.generator.atomGroups({"residue-test":Pt.core.set.has([Pt.core.type.set(us.protein),Pt.ammp("label_comp_id")])}),by:Pt.struct.generator.atomGroups({"atom-test":Pt.core.set.has([Pt.core.type.set(p$_protein),Pt.ammp("label_atom_id")])})}),Pt.struct.modifier.intersectBy({0:Pt.struct.generator.atomGroups({"residue-test":Pt.core.set.has([Pt.core.type.set(us.nucleic),Pt.ammp("label_comp_id")])}),by:Pt.struct.generator.atomGroups({"atom-test":Pt.core.set.has([Pt.core.type.set(p$_nucleic),Pt.ammp("label_atom_id")])})})])}var h$={all:{"@desc":"All atoms currently loaded into PyMOL",abbr:["*"],map:function(){return Pt.struct.generator.all()}},none:{"@desc":"No atoms (empty selection)",map:function(){return Pt.struct.generator.empty()}},hydrogens:{"@desc":"All hydrogen atoms currently loaded into PyMOL",abbr:["hydro","h."],map:function(){return Pt.struct.generator.atomGroups({"atom-test":Pt.core.rel.eq([Pt.acp("elementSymbol"),Pt.es("H")])})}},hetatm:{"@desc":"All atoms loaded from Protein Data Bank HETATM records",abbr:["het"],map:function(){return Pt.struct.generator.atomGroups({"atom-test":Pt.core.rel.eq([Pt.ammp("isHet"),!0])})}},visible:{"@desc":"All atoms in enabled objects with at least one visible representation",abbr:["v."]},polymer:{"@desc":"All atoms on the polymer (not het). Finds atoms with residue identifiers matching a known polymer, such a peptide and DNA.",abbr:["pol."],map:function(){return Pt.struct.generator.atomGroups({"residue-test":Pt.core.set.has([Pt.core.type.set(us.nucleic.concat(us.protein)),Pt.ammp("label_comp_id")])})}},sidechain:{"@desc":"Polymer non-backbone atoms (new in PyMOL 1.6.1)",abbr:["sc."],map:function(){return Pt.struct.modifier.exceptBy({0:Pt.struct.generator.atomGroups({"residue-test":Pt.core.set.has([Pt.core.type.set(us.nucleic.concat(us.protein)),Pt.ammp("label_comp_id")])}),by:m$()})}},present:{"@desc":"All atoms with defined coordinates in the current state (used in creating movies)",abbr:["pr."]},center:{"@desc":"Pseudo-atom at the center of the scene"},origin:{"@desc":"Pseudo-atom at the origin of rotation"},enabled:{"@desc":"All enabled objects or selections from the object list."},masked:{"@desc":"All masked atoms.",abbr:["msk."]},protected:{"@desc":"All protected atoms.",abbr:["pr."]},bonded:{"@desc":"All bonded atoms",map:function(){return Pt.struct.generator.atomGroups({"atom-test":Pt.core.rel.gr([Pt.struct.atomProperty.core.bondCount({flags:Pt.struct.type.bondFlags(["covalent","metallic","sulfide"])}),0])})}},donors:{"@desc":"All hydrogen bond donor atoms.",abbr:["don."]},acceptors:{"@desc":"All hydrogen bond acceptor atoms.",abbr:["acc."]},fixed:{"@desc":"All fixed atoms.",abbr:["fxd."]},restrained:{"@desc":"All restrained atoms.",abbr:["rst."]},organic:{"@desc":"All atoms in non-polymer organic compounds (e.g. ligands, buffers). Finds carbon-containing molecules that do not match known polymers.",abbr:["org."],map:function(){return Md(Pt.struct.modifier.expandProperty({0:Pt.struct.modifier.union([Pt.struct.generator.queryInSelection({0:Pt.struct.generator.atomGroups({"residue-test":Pt.core.logic.not([Pt.core.set.has([Pt.core.type.set(us.nucleic.concat(us.protein)),Pt.ammp("label_comp_id")])])}),query:Pt.struct.generator.atomGroups({"atom-test":Pt.core.rel.eq([Pt.es("C"),Pt.acp("elementSymbol")])})})]),property:Pt.ammp("residueKey")}))}},inorganic:{"@desc":"All non-polymer inorganic atoms/ions. Finds atoms in molecules that do not contain carbon and do not match any known solvent residues.",abbr:["ino."],map:function(){return Md(Pt.struct.modifier.expandProperty({0:Pt.struct.modifier.union([Pt.struct.filter.pick({0:Pt.struct.generator.atomGroups({"residue-test":Pt.core.logic.not([Pt.core.set.has([Pt.core.type.set(us.nucleic.concat(us.protein).concat(us.solvent)),Pt.ammp("label_comp_id")])]),"group-by":Pt.ammp("residueKey")}),test:Pt.core.logic.not([Pt.core.set.has([Pt.struct.atomSet.propertySet([Pt.acp("elementSymbol")]),Pt.es("C")])])})]),property:Pt.ammp("residueKey")}))}},solvent:{"@desc":"All water molecules. The hardcoded solvent residue identifiers are currently: HOH, WAT, H20, TIP, SOL.",abbr:["sol."],map:function(){return Pt.struct.generator.atomGroups({"residue-test":Pt.core.set.has([Pt.core.type.set(us.solvent),Pt.ammp("label_comp_id")])})}},guide:{"@desc":"All protein CA and nucleic acid C4*/C4",map:function(){return Pt.struct.combinator.merge([Pt.struct.generator.atomGroups({"atom-test":Pt.core.rel.eq([Pt.atomName("CA"),Pt.ammp("label_atom_id")]),"residue-test":Pt.core.set.has([Pt.core.type.set(us.protein),Pt.ammp("label_comp_id")])}),Pt.struct.generator.atomGroups({"atom-test":Pt.core.set.has([Pd(["C4*","C4'"]),Pt.ammp("label_atom_id")]),"residue-test":Pt.core.set.has([Pt.core.type.set(us.nucleic),Pt.ammp("label_comp_id")])})])}},metals:{"@desc":"All metal atoms (new in PyMOL 1.6.1)"},backbone:{"@desc":"Polymer backbone atoms (new in PyMOL 1.6.1)",abbr:["bb."],map:function(){return m$()}},"polymer.protein":{"@desc":"Protein (New in PyMOL 2.1)",abbr:["polymer.protein"],map:function(){return Pt.struct.generator.atomGroups({"residue-test":Pt.core.set.has([Pt.core.type.set(us.protein),Pt.ammp("label_comp_id")])})}},"polymer.nucleic":{"@desc":"Nucleic Acid (New in PyMOL 2.1)",abbr:["polymer.nucleic"],map:function(){return Pt.struct.generator.atomGroups({"residue-test":Pt.core.set.has([Pt.core.type.set(us.nucleic),Pt.ammp("label_comp_id")])})}}},F8e=fe,si=function h8e(e){var t={};return Object.keys(e).sort(Id).forEach(function(r){var n=e[r],a=Sm("property '".concat(r,"' not supported")),i=We.regexp(n.regex).map(function(o){return n.isUnsupported&&a(),mB(n.property,n.map(o))});n.isNumeric||(t[r]=i)}),t}(iT),Si=We.string("/");function ua(e){return e.or(We.of(null))}function B8e(e){var t={},r={};for(var n in e){var a=iT[n];if(!a)throw new Error("property '".concat(n,"' not supported, value '").concat(e[n],"'"));null!==e[n]&&(r[a.level]||(r[a.level]=[]),r[a.level].push(e[n]))}for(var i in r)t[i]=pB(r[i]);return F8e.struct.generator.atomGroups(t)}var N8e=We.createLanguage({Parens:function(e){return We.alt(e.Parens,e.Operator,e.Expression).wrap(We.string("("),We.string(")"))},Expression:function(e){return We.alt(e.Keywords,e.AtomSelectionMacro.map(B8e),e.NamedAtomProperties,e.Pepseq,e.Rep,e.Object)},AtomSelectionMacro:function(e){return We.alt(Si.then(We.alt(We.seq(ua(e.ObjectProperty).skip(Si),ua(si.segi).skip(Si),ua(si.chain).skip(Si),ua(si.resi).skip(Si),ua(si.name)).map(function(t){return{object:t[0],segi:t[1],chain:t[2],resi:t[3],name:t[4]}}),We.seq(ua(e.ObjectProperty).skip(Si),ua(si.segi).skip(Si),ua(si.chain).skip(Si),ua(si.resi)).map(function(t){return{object:t[0],segi:t[1],chain:t[2],resi:t[3]}}),We.seq(ua(e.ObjectProperty).skip(Si),ua(si.segi).skip(Si),ua(si.chain)).map(function(t){return{object:t[0],segi:t[1],chain:t[2]}}),We.seq(ua(e.ObjectProperty).skip(Si),ua(si.segi)).map(function(t){return{object:t[0],segi:t[1]}}),We.seq(ua(e.ObjectProperty)).map(function(t){return{object:t[0]}}))),We.alt(We.seq(ua(e.ObjectProperty).skip(Si),ua(si.segi).skip(Si),ua(si.chain).skip(Si),ua(si.resi).skip(Si),ua(si.name)).map(function(t){return{object:t[0],segi:t[1],chain:t[2],resi:t[3],name:t[4]}}),We.seq(ua(si.segi).skip(Si),ua(si.chain).skip(Si),ua(si.resi).skip(Si),ua(si.name)).map(function(t){return{segi:t[0],chain:t[1],resi:t[2],name:t[3]}}),We.seq(ua(si.chain).skip(Si),ua(si.resi).skip(Si),ua(si.name)).map(function(t){return{chain:t[0],resi:t[1],name:t[2]}}),We.seq(ua(si.resi).skip(Si),ua(si.name)).map(function(t){return{resi:t[0],name:t[1]}})))},NamedAtomProperties:function(){var e;return(e=We).alt.apply(e,a$(iT))},Keywords:function(){var e;return(e=We).alt.apply(e,vB(h$))},ObjectProperty:function(){var e=yB(iT,h$,f$).sort(Id).map(aS).join("|");return We.regexp(new RegExp("(?!(".concat(e,"))[A-Z0-9_]+"),"i"))},Object:function(e){return e.ObjectProperty.notFollowedBy(Si).map(function(t){throw new Error("property 'object' not supported, value '".concat(t,"'"))})},Pepseq:function(){return We.regexp(/(PEPSEQ|ps\.)\s+([a-z]+)/i,2).map(Sm("operator 'pepseq' not supported"))},Rep:function(){return We.regexp(/REP\s+(lines|spheres|mesh|ribbon|cartoon|sticks|dots|surface|labels|extent|nonbonded|nb_spheres|slice|extent|slice|dashes|angles|dihedrals|cgo|cell|callback|everything)/i,1).map(Sm("operator 'rep' not supported"))},Operator:function(e){return f2(f$,We.alt(e.Parens,e.Expression,e.Operator))},Query:function(e){return We.alt(e.Operator,e.Parens,e.Expression).trim(We.optWhitespace)}}),ei=fe,pu=/[-+]?[0-9]*\.?[0-9]+/,oT=/[+]?[0-9]+/,v2=/[-+]?[0-9]+/;function sv(e){return e}var v$={T:"turn",E:"sheet",B:"strand",H:"alpha",G:"3-10",I:"pi",C:"none"};function SB(e){return ei.struct.type.secondaryStructureFlags([v$[e.toUpperCase()]||"none"])}var uv={name:{"@desc":"str atom name","@examples":["name CA"],regex:/[a-zA-Z0-9]+/,map:ei.atomName,level:"atom-test",property:ei.ammp("label_atom_id")},type:{"@desc":"str atom type","@examples":["type C3"],isUnsupported:!0,regex:/[a-zA-Z0-9]+/,map:sv,level:"atom-test"},index:{"@desc":"num the atom number, starting at 0","@examples":["index 10"],isNumeric:!0,regex:oT,map:function(e){return parseInt(e)-1},level:"atom-test",property:ei.ammp("id")},serial:{"@desc":"num the atom number, starting at 1","@examples":["serial 11"],isNumeric:!0,regex:oT,map:function(e){return parseInt(e)},level:"atom-test",property:ei.ammp("id")},atomicnumber:{"@desc":"num atomic number (0 if undefined)","@examples":["atomicnumber 13"],isNumeric:!0,regex:oT,map:function(e){return parseInt(e)},level:"atom-test",property:ei.acp("atomicNumber")},element:{"@desc":'str atomic element symbol string ("X" if undefined)',"@examples":["element N"],regex:/[a-zA-Z0-9]{1,3}/,map:function(e){return ei.es(e)},level:"atom-test",property:ei.acp("elementSymbol")},altloc:{"@desc":"str alternate location/conformation identifier","@examples":["altloc C"],regex:/[a-zA-Z0-9]+/,map:sv,level:"atom-test",property:ei.ammp("label_alt_id")},chain:{"@desc":"str the one-character chain identifier","@examples":["chain A"],regex:/[a-zA-Z0-9]+/,map:sv,level:"residue-test",property:ei.ammp("auth_asym_id")},residue:{"@desc":"num a set of connected atoms with the same residue number","@examples":["residue < 11","residue 11"],isNumeric:!0,regex:v2,map:function(e){return parseInt(e)},level:"residue-test",property:ei.ammp("auth_seq_id")},fragment:{"@desc":"num a set of connected residues","@examples":["fragment 42"],isUnsupported:!0,isNumeric:!0,regex:v2,map:function(e){return parseInt(e)},level:"residue-test"},pfrag:{"@desc":"num a set of connected protein residues","@examples":["pfrag 42"],isUnsupported:!0,isNumeric:!0,regex:v2,map:function(e){return parseInt(e)},level:"residue-test"},nfrag:{"@desc":"num a set of connected nucleic residues","@examples":["nfrag 42"],isUnsupported:!0,isNumeric:!0,regex:v2,map:function(e){return parseInt(e)},level:"residue-test"},sequence:{"@desc":"str a sequence given by one letter names","@examples":["sequence PGATTACA"],isUnsupported:!0,regex:/[a-zA-Z0-9]+/,map:sv,level:"residue-test"},numbonds:{"@desc":"num number of bonds","@examples":["numbonds = 2","numbonds >= 3"],isNumeric:!0,regex:oT,map:function(e){return parseInt(e)},level:"atom-test",property:ei.acp("bondCount")},resname:{"@desc":"str residue name","@examples":["resname ALA"],regex:/[a-zA-Z0-9]+/,map:sv,level:"residue-test",property:ei.ammp("auth_comp_id")},resid:{"@desc":"num residue id","@examples":["resid 42"],isNumeric:!0,regex:v2,map:function(e){return parseInt(e)},level:"residue-test",property:ei.ammp("auth_seq_id")},segname:{"@desc":"str segment name","@examples":["segname B"],regex:/[a-zA-Z0-9]+/,map:sv,level:"residue-test",property:ei.ammp("label_asym_id")},x:{"@desc":"float x coordinate","@examples":["x 42"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.acp("x")},y:{"@desc":"float y coordinate","@examples":["y > 1.7"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.acp("y")},z:{"@desc":"float z coordinate","@examples":["z < 11","z > -21"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.acp("z")},radius:{"@desc":"float atomic radius","@examples":["radius > 1.3"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.acp("vdw")},mass:{"@desc":"float atomic mass","@examples":["mass > 2"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.acp("mass")},charge:{"@desc":"float atomic charge","@examples":["charge > 0","charge 1"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.ammp("pdbx_formal_charge")},beta:{"@desc":"float temperature factor","@examples":["beta < 20","beta > 35"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.ammp("B_iso_or_equiv")},occupancy:{"@desc":"float occupancy","@examples":["occupancy 1","occupancy < 1"],isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test",property:ei.ammp("occupancy")},user:{"@desc":"float time-varying user-specified value","@examples":["user < 0.1"],isUnsupported:!0,isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"atom-test"},rasmol:{"@desc":"str translates Rasmol selection string to VMD","@examples":["rasmol 'all'"],isUnsupported:!0,regex:/[^']*/,map:sv,level:"atom-test"},structure:{"@desc":"str single letter name for the secondary structure","@examples":["structure H","structure H E"],regex:/T|E|B|H|G|I|C/i,map:SB,level:"atom-test",property:ei.ammp("secondaryStructureFlags")},phi:{"@desc":"float phi backbone conformational angles","@examples":["phi < 160"],isUnsupported:!0,isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"residue-test"},psi:{"@desc":"float psi backbone conformational angles","@examples":["psi < 160"],isUnsupported:!0,isNumeric:!0,regex:pu,map:function(e){return parseFloat(e)},level:"residue-test"},ufx:{"@desc":"num force to apply in the x coordinate","@examples":["ufx 1"],isUnsupported:!0,isNumeric:!0,regex:pu,map:function(e){return parseInt(e)},level:"atom-test"},ufy:{"@desc":"num force to apply in the y coordinate","@examples":["ufy 1"],isUnsupported:!0,isNumeric:!0,regex:pu,map:function(e){return parseInt(e)},level:"atom-test"},ufz:{"@desc":"num force to apply in the z coordinate","@examples":["ufz 1"],isUnsupported:!0,isNumeric:!0,regex:pu,map:function(e){return parseInt(e)},level:"atom-test"}},cv=fe,L8e=Object.keys(uv).sort(Id).filter(function(e){return!uv[e].isUnsupported}).join("|"),g$=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not protein"],name:"not",type:ss,rule:We.regexp(/NOT/i).skip(We.whitespace),map:function(e,t){return Zu(t)}},{"@desc":"Selects atoms within a specified distance of a selection","@examples":["within 5 of name FE"],name:"within",type:ss,rule:Ku(/WITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(function(e){return parseFloat(e)}),map:function(e,t){return cv.struct.modifier.includeSurroundings({0:t,radius:e})}},{"@desc":"Exclusive within, equivalent to (within 3 of X) and not X","@examples":["exwithin 10 of resname HEM"],name:"exwithin",type:ss,rule:Ku(/EXWITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(function(e){return parseFloat(e)}),map:function(e,t){return cv.struct.modifier.exceptBy({0:cv.struct.modifier.includeSurroundings({0:t,radius:e}),by:t})}},{"@desc":"Selects atoms which have the same keyword as the atoms in a given selection","@examples":["same resid as name FE"],name:"same",type:ss,rule:Ku(new RegExp("SAME\\s+(".concat(L8e,")\\s+AS"),"i"),1).map(function(e){return uv[e].property}),map:function(e,t){return cv.struct.filter.withSameAtomProperties({0:cv.struct.generator.all(),source:t,property:e})}},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["backbone and protein"],name:"and",type:Us,rule:We.alt(ap(/AND/i),We.whitespace),map:function(e,t,r){return cv.struct.modifier.intersectBy({0:t,by:r})}},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["water or protein"],name:"or",type:Us,rule:ap(/OR/i),map:function(e,t,r){return cv.struct.combinator.merge([t,r])}}],Tr=fe;function ip(){return Tr.struct.filter.pick({0:Tr.struct.generator.atomGroups({"group-by":Tr.ammp("residueKey")}),test:Tr.core.set.isSubset([Pd(["C","N","CA","O"]),Tr.ammpSet("label_atom_id")])})}function CB(){return Tr.struct.filter.pick({0:Tr.struct.generator.atomGroups({"group-by":Tr.ammp("residueKey")}),test:Tr.core.logic.and([Tr.core.set.isSubset([Pd(["P"]),Tr.ammpSet("label_atom_id")]),Tr.core.logic.or([Tr.core.set.isSubset([Pd(["O3'","C3'","C4'","C5'","O5'"]),Tr.ammpSet("label_atom_id")]),Tr.core.set.isSubset([Pd(["O3*","C3*","C4*","C5*","O5*"]),Tr.ammpSet("label_atom_id")])])])})}function y$(){return Tr.struct.combinator.merge([Tr.struct.generator.queryInSelection({0:ip(),query:Tr.struct.generator.atomGroups({"atom-test":Tr.core.set.has([Pd(b$.protein),Tr.ammp("label_atom_id")])})}),Tr.struct.generator.queryInSelection({0:CB(),query:Tr.struct.generator.atomGroups({"atom-test":Tr.core.set.has([Pd(b$.nucleic),Tr.ammp("label_atom_id")])})})])}function Rd(e){return Tr.struct.generator.atomGroups({"residue-test":Tr.core.flags.hasAll([Tr.ammp("secondaryStructureFlags"),Tr.struct.type.secondaryStructureFlags(e)])})}var C$,lv,g2,cy,b$={nucleic:["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*"],protein:["C","N","CA","O"]},Ci={acidic:["ASP","GLU"],aliphatic:["ALA","GLY","ILE","LEU","VAL"],aromatic:["HIS","PHE","TRP","TYR"],at:["ADA","A","THY","T"],basic:["ARG","HIS","LYS"],buried:["ALA","LEU","VAL","ILE","PHE","CYS","MET","TRP"],cg:["CYT","C","GUA","G"],cyclic:["HIS","PHE","PRO","TRP","TYR"],hydrophobic:["ALA","LEU","VAL","ILE","PRO","PHE","MET","TRP"],medium:["VAL","THR","ASP","ASN","PRO","CYS","ASX","PCA","HYP"],neutral:["VAL","PHE","GLN","TYR","HIS","CYS","MET","TRP","ASX","GLX","PCA","HYP"],purine:["ADE","A","GUA","G"],pyrimidine:["CYT","C","THY","T","URI","U"],small:["ALA","GLY","SER"],water:["H2O","HH0","OHH","HOH","OH2","SOL","WAT","TIP","TIP2","TIP3","TIP4"]},S$={all:{"@desc":"everything",map:function(){return Tr.struct.generator.all()}},none:{"@desc":"nothing",map:function(){return Tr.struct.generator.empty()}},protein:{"@desc":"a residue with atoms named C, N, CA, and O",map:function(){return ip()}},nucleic:{"@desc":"a residue with atoms named P, O1P, O2P and either O3', C3', C4', C5', O5' or O3*, C3*, C4*, C5*, O5*. This definition assumes that the base is phosphorylated, an assumption which will be corrected in the future.",map:function(){return CB()}},backbone:{"@desc":"the C, N, CA, and O atoms of a protein and the equivalent atoms in a nucleic acid.",map:function(){return y$()}},sidechain:{"@desc":"non-backbone atoms and bonds",map:function(){return Zu(y$())}},water:{"@desc":"all atoms with the resname H2O, HH0, OHH, HOH, OH2, SOL, WAT, TIP, TIP2, TIP3 or TIP4",abbr:["waters"],map:function(){return Qr(Ci.water)}},at:{"@desc":"residues named ADA A THY T",map:function(){return Qr(Ci.at)}},acidic:{"@desc":"residues named ASP GLU",map:function(){return Qr(Ci.acidic)}},acyclic:{"@desc":'"protein and not cyclic"',map:function(){return Tr.struct.modifier.intersectBy({0:ip(),by:Zu(Qr(Ci.cyclic))})}},aliphatic:{"@desc":"residues named ALA GLY ILE LEU VAL",map:function(){return Qr(Ci.aliphatic)}},alpha:{"@desc":"atom's residue is an alpha helix",map:function(){return Rd(["alpha"])}},amino:{"@desc":"a residue with atoms named C, N, CA, and O",map:function(){return ip()}},aromatic:{"@desc":"residues named HIS PHE TRP TYR",map:function(){return Qr(Ci.aromatic)}},basic:{"@desc":"residues named ARG HIS LYS",map:function(){return Qr(Ci.basic)}},bonded:{"@desc":"atoms for which numbonds > 0",map:function(){return Md(Tr.struct.filter.pick({0:Tr.struct.modifier.includeConnected({0:Tr.struct.generator.all(),"bond-test":Tr.core.flags.hasAny([Tr.struct.bondProperty.flags(),Tr.struct.type.bondFlags(["covalent","metallic","sulfide"])])}),test:Tr.core.rel.gr([Tr.struct.atomSet.atomCount(),1])}))}},buried:{"@desc":"residues named ALA LEU VAL ILE PHE CYS MET TRP",map:function(){return Qr(Ci.buried)}},cg:{"@desc":"residues named CYT C GUA G",map:function(){return Qr(Ci.cg)}},charged:{"@desc":'"basic or acidic"',map:function(){return Qr(Ci.basic.concat(Ci.acidic))}},cyclic:{"@desc":"residues named HIS PHE PRO TRP TYR",map:function(){return Qr(Ci.cyclic)}},hetero:{"@desc":'"not (protein or nucleic)"',map:function(){return Zu(Tr.struct.combinator.merge([ip(),CB()]))}},hydrogen:{"@desc":'name "[0-9]?H.*"',map:function(){return Tr.struct.generator.atomGroups({"atom-test":Tr.core.str.match([Tr.core.type.regex(["^[0-9]?[H].*$","i"]),Tr.core.type.str([Tr.ammp("label_atom_id")])])})}},large:{"@desc":'"protein and not (small or medium)"',map:function(){return Tr.struct.modifier.intersectBy({0:ip(),by:Zu(Qr(Ci.small.concat(Ci.medium)))})}},medium:{"@desc":"residues named VAL THR ASP ASN PRO CYS ASX PCA HYP",map:function(){return Qr(Ci.medium)}},neutral:{"@desc":"residues named VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP",map:function(){return Qr(Ci.neutral)}},hydrophobic:{"@desc":"hydrophobic resname ALA LEU VAL ILE PRO PHE MET TRP",map:function(){return Qr(Ci.hydrophobic)}},polar:{"@desc":'"protein and not hydrophobic"',map:function(){return Tr.struct.modifier.intersectBy({0:ip(),by:Zu(Qr(Ci.hydrophobic))})}},purine:{"@desc":"residues named ADE A GUA G",map:function(){return Qr(Ci.purine)}},pyrimidine:{"@desc":"residues named CYT C THY T URI U",map:function(){return Qr(Ci.pyrimidine)}},small:{"@desc":"residues named ALA GLY SER",map:function(){return Qr(Ci.small)}},surface:{"@desc":'"protein and not buried"',map:function(){return Tr.struct.modifier.intersectBy({0:ip(),by:Zu(Qr(Ci.buried))})}},alpha_helix:{"@desc":"atom's residue is in an alpha helix",map:function(){return Rd(["alpha"])}},pi_helix:{"@desc":"atom's residue is in a pi helix",map:function(){return Rd(["pi"])}},helix_3_10:{"@desc":"atom's residue is in a 3-10 helix",map:function(){return Rd(["3-10"])}},helix:{"@desc":"atom's residue is in an alpha or pi or 3-10 helix",map:function(){return Rd(["helix"])}},extended_beta:{"@desc":"atom's residue is a beta sheet",map:function(){return Rd(["sheet"])}},bridge_beta:{"@desc":"atom's residue is a beta sheet",map:function(){return Rd(["strand"])}},sheet:{"@desc":"atom's residue is a beta sheet",map:function(){return Rd(["beta"])}},turn:{"@desc":"atom's residue is in a turn conformation",map:function(){return Rd(["turn"])}},coil:{"@desc":"atom's residue is in a coil conformation",map:function(){return Tr.struct.modifier.intersectBy({0:ip(),by:Rd(["none"])})}}},jo=fe,U8e={sqr:{"@desc":"square of x","@examples":["sqr(2)"],map:function(e){return jo.core.math.pow([e,2])}},sqrt:{"@desc":"square root of x","@examples":["sqrt(2)"],map:function(e){return jo.core.math.sqrt([e])}},abs:{"@desc":"absolute value of x","@examples":["abs(2)"],map:function(e){return jo.core.math.abs([e])}},floor:{"@desc":"largest integer not greater than x","@examples":["floor(2)"],map:function(e){return jo.core.math.floor([e])}},ceil:{"@desc":"smallest integer not less than x","@examples":["ceil(2)"],map:function(e){return jo.core.math.ceil([e])}},sin:{"@desc":"sine of x","@examples":["sin(2)"],map:function(e){return jo.core.math.sin([e])}},cos:{"@desc":"cosine of x","@examples":["cos(2)"],map:function(e){return jo.core.math.cos([e])}},tan:{"@desc":"tangent of x","@examples":["tan(2)"],map:function(e){return jo.core.math.tan([e])}},atan:{"@desc":"arctangent of x","@examples":["atan(2)"],map:function(e){return jo.core.math.atan([e])}},asin:{"@desc":"arcsin of x","@examples":["asin(2)"],map:function(e){return jo.core.math.asin([e])}},acos:{"@desc":"arccos of x","@examples":["acos(2)"],map:function(e){return jo.core.math.acos([e])}},sinh:{"@desc":"hyperbolic sine of x","@examples":["sinh(2)"],map:function(e){return jo.core.math.sinh([e])}},cosh:{"@desc":"hyperbolic cosine of x","@examples":["cosh(2)"],map:function(e){return jo.core.math.cosh([e])}},tanh:{"@desc":"hyperbolic tangent of x","@examples":["tanh(2)"],map:function(e){return jo.core.math.tanh([e])}},exp:{"@desc":"e to the power x","@examples":["exp(2)"],map:function(e){return jo.core.math.exp([e])}},log:{"@desc":"natural log of x","@examples":["log(2)"],map:function(e){return jo.core.math.log([e])}},log10:{"@desc":"log base 10 of x","@examples":["log10(2)"],map:function(e){return jo.core.math.log10([e])}}},Sa=fe,V8e=[{"@desc":"multiplication, division","@examples":[],name:"mul-div",type:Us,rule:We.regexp(/\s*(\*|\/)\s*/,1),map:function(e,t,r){switch(e){case"*":return Sa.core.math.mult([t,r]);case"/":return Sa.core.math.div([t,r]);default:throw new Error("value operator '".concat(e,"' not supported"))}}},{"@desc":"addition, substraction","@examples":[],name:"add-sub",type:Us,rule:We.regexp(/\s*(-|\+)\s*/,1),map:function(e,t,r){switch(e){case"-":return Sa.core.math.sub([t,r]);case"+":return Sa.core.math.add([t,r]);default:throw new Error("value operator '".concat(e,"' not supported"))}}},{"@desc":"value comparisons","@examples":[],name:"comparison",type:Us,rule:We.alt(We.regexp(/\s*(=~|==|>=|<=|=|!=|>|<)\s*/,1),We.whitespace.result("=")),map:function(e,t,r){var n;if(void 0!==t.head?("structure-query.atom-property.macromolecular.secondary-structure-flags"===t.head.name&&(n=Sa.core.flags.hasAny([t,SB(r)])),"core.type.regex"===t.head.name&&(n=Sa.core.str.match([t,Sa.core.type.str([r])]))):void 0!==r.head?("structure-query.atom-property.macromolecular.secondary-structure-flags"===r.head.name&&(n=Sa.core.flags.hasAny([r,SB(t)])),"core.type.regex"===r.head.name&&(n=Sa.core.str.match([r,Sa.core.type.str([t])]))):"=~"===e&&(n=Sa.core.str.match(t.head?[Sa.core.type.regex(["^".concat(r,"$"),"i"]),Sa.core.type.str([t])]:[Sa.core.type.regex(["^".concat(t,"$"),"i"]),Sa.core.type.str([r])])),!n)switch(t.head&&(r=p2(t,r)),r.head&&(t=p2(r,t)),e){case"=":case"==":n=Sa.core.rel.eq([t,r]);break;case"!=":n=Sa.core.rel.neq([t,r]);break;case">":n=Sa.core.rel.gr([t,r]);break;case"<":n=Sa.core.rel.lt([t,r]);break;case">=":n=Sa.core.rel.gre([t,r]);break;case"<=":n=Sa.core.rel.lte([t,r]);break;default:throw new Error("value operator '".concat(e,"' not supported"))}return Sa.struct.generator.atomGroups({"atom-test":n})}}],G8e=We.createLanguage({Parens:function(e){return We.alt(e.Parens,e.Operator,e.Expression).wrap(We.string("("),We.string(")"))},Expression:function(e){return We.alt(e.RangeListProperty,e.ValueQuery,e.Keywords)},NamedAtomProperties:function(){var e;return(e=We).alt.apply(e,a$(uv))},Keywords:function(){var e;return(e=We).alt.apply(e,vB(S$))},ValueRange:function(e){return We.seq(e.Value.skip(We.regexp(/\s+TO\s+/i)),e.Value).map(function(t){return{range:t}})},RangeListProperty:function(e){var t;return We.seq((t=We).alt.apply(t,gB(uv,/\s/)).skip(We.whitespace),We.alt(e.ValueRange,e.Value).sepBy1(We.whitespace)).map(function(r){var n,a=r[0],o=[],s=[];r[1].forEach(function(d){d.range?s.push(Sa.core.rel.inRange([a,d.range[0],d.range[1]])):o.push(p2(a,d,v$))});var l,u=function m8e(e){return 1===e.length?e[0]:e.length>1?Vn.core.logic.or(e):void 0}(s),c=function x8e(e,t){if(C8e.includes(e.head.name)){var r=t[0].head,n=[];return t.forEach(function(a){return n.push.apply(n,a.args[0])}),Vn.core.flags.hasAny([e,{head:r,args:n}])}return 1===t.length?Vn.core.rel.eq([e,t[0]]):t.length>1?Vn.core.set.has([Vn.core.type.set(t),e]):void 0}(a,o);return l=u&&c?Sa.core.logic.or([u,c]):u||c,Sa.struct.generator.atomGroups(((n={})[function S8e(e){if(e.head.name.startsWith("structure-query.atom-property.macromolecular.")){var t=e.head.name.substr(45);if(g8e.includes(t))return"entity-test";if(y8e.includes(t))return"chain-test";if(b8e.includes(t))return"residue-test"}return"atom-test"}(a)]=l,n))})},Operator:function(e){return f2(g$,We.alt(e.Parens,e.Expression,e.ValueQuery))},Query:function(e){return We.alt(e.Operator,e.Parens,e.Expression).trim(We.optWhitespace)},Number:function(){return We.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){var e=yB(uv,S$,g$).sort(Id).map(aS).join("|");return We.alt(We.regexp(new RegExp("(?!(".concat(e,"))[A-Z0-9_]+"),"i")),We.regexp(/'((?:[^"\\]|\\.)*)'/,1),We.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(function(t){return Sa.core.type.regex(["^".concat(t,"$"),"i"])})).desc("string")},Value:function(e){return We.alt(e.Number,e.String)},ValueParens:function(e){return We.alt(e.ValueParens,e.ValueOperator,e.ValueExpressions).wrap(We.string("("),We.string(")"))},ValuePropertyNames:function(){var e;return(e=We).alt.apply(e,gB(uv,/=~|==|>=|<=|=|!=|>|<|\)|\s|\+|-|\*|\//i))},ValueOperator:function(e){return f2(V8e,We.alt(e.ValueParens,e.ValueExpressions))},ValueExpressions:function(e){return We.alt(e.ValueFunctions,e.Value,e.ValuePropertyNames)},ValueFunctions:function(e){var t;return(t=We).alt.apply(t,function v8e(e,t){var r=[],n=We.regexp(/\(\s*/),a=We.regexp(/\s*\)/);return Object.keys(e).sort(Id).forEach(function(i){var o=e[i],s=o.map?o.map:Sm("function '".concat(i,"' not supported")),u=We.regexp(new RegExp(i,"i")).skip(n).then(t).skip(a).map(s);r.push(u)}),r}(U8e,e.ValueOperator))},ValueQuery:function(e){return We.alt(e.ValueOperator.map(function(t){if(!t.head.name||!t.head.name.startsWith("structure-query.generator"))throw new Error("values must be part of an comparison, value '".concat(t,"'"));return t}))}}),H8e={pymol:function(e){return N8e.Query.tryParse(e)},vmd:function(e){return G8e.Query.tryParse(e)},jmol:function(e){return E8e.Query.tryParse(e)}},j8e=H8e,W8e=function(){function e(){this.map=new Map}return e.prototype.removeSymbol=function(t){this.map.delete(t.symbol.id)},e.prototype.addSymbol=function(t){this.map.has(t.symbol.id)&&console.warn("Symbol '".concat(t.symbol.id,"' already added. Call removeSymbol/removeCustomProps re-adding the symbol.")),this.map.set(t.symbol.id,t)},e.prototype.addCustomProp=function(t){if(t.symbols)for(var r=0,n=Object.keys(t.symbols);rt[1](e)}),rr(Se.core.rel.gre,function(e,t){return t[0](e)>=t[1](e)}),rr(Se.core.rel.inRange,function(e,t){var r=t[0](e);return r>=t[1](e)&&r<=t[2](e)}),rr(Se.core.math.add,function(e,t){var r=0;if("number"==typeof t.length)for(var n=0,a=t.length;n0&&S.push(["assembly","Assembly"]),f&&(S.push(["symmetry-mates","Symmetry Mates"]),S.push(["symmetry","Symmetry (indices)"]),S.push(["symmetry-assembly","Symmetry (assembly)"])),{type:T.MappedStatic(c||"model",y,{options:S})}},e.canAutoUpdate=function r(u,c){return!("symmetry-assembly"===c.name||"symmetry"===c.name&&"symmetry"===u.name)},e.create=function s(u,c,l,d){return ue(this,void 0,void 0,function(){var f,p,m;return ce(this,function(h){return f=d?.params,(p=Ja.Provider.get(l))&&d&&"model"!==d.name?"auto"===d.name?0===p.assemblies.length?(m=Ze.ofModel(l,f),[2,new ve.Molecule.Structure(m,{label:"Model",description:Ze.elementDescription(m)})]):[2,n(u,c,l,void 0,f)]:"assembly"===d.name?[2,n(u,c,l,d.params.id,f)]:"symmetry"===d.name?[2,a(c,l,d.params.ijkMin,d.params.ijkMax,f)]:"symmetry-mates"===d.name?[2,i(c,l,d.params.radius,f)]:"symmetry-assembly"===d.name?[2,o(c,l,d.params.generators,p,f)]:(Sn(),[2]):(m=Ze.ofModel(l,f),[2,new ve.Molecule.Structure(m,{label:"Model",description:Ze.elementDescription(m)})])})})}}(dv||(dv={})),function(e){function r(s,u){var c=Ni.is(u)?u:void 0,l=Ni.is(u)?Ni.toExpression(u):u;return{script:c,expression:l,compiled:y2(l),originalStructure:s,currentStructure:s}}function n(s,u){return s.compiled(new Rc(u))}e.isUnchanged=function t(s,u,c){return s.currentStructure===c&&(Ni.is(u)?!!s.script&&Ni.areEqual(s.script,u):s.expression===u)},e.create=r,e.run=n,e.createAndRun=function a(s,u){var c=r(s,u);return{entry:c,selection:n(c,s)}},e.updateStructure=function i(s,u){return s.currentStructure=u,s.compiled(new Rc(u))},e.updateStructureObject=function o(s,u,c){var l=ht.unionStructure(u);s.label="".concat(c||"Selection"),s.description=Ze.elementDescription(l),s.data=l}}(cs||(cs={}));var Z8e=new Set(["LI","NA","K","RB","CS","FR"]),$8e=new Set(["BE","MG","CA","SR","BA","RA"]),oVe=new Set(["ZN","GA","CD","IN","SN","HG","TI","PB","BI","PO","CN"]),cVe=new Set(["F","CL","BR","I","AT"]);function lVe(e){return cVe.has(e)}function T$(e){var t=a2(e);return t>=21&&t<=29||t>=39&&t<=47||t>=72&&t<=79||t>=104&&t<=108}function pVe(e){return function Q8e(e){return Z8e.has(e)}(e)||function J8e(e){return $8e.has(e)}(e)||function dVe(e){var t=a2(e);return t>=57&&t<=71}(e)||function fVe(e){var t=a2(e);return t>=89&&t<=103}(e)||T$(e)||function sVe(e){return oVe.has(e)}(e)}var ln=function(e){return e.Type="Type",e.Structure="Structure Property",e.Atom="Atom Property",e.Bond="Bond Property",e.Residue="Residue Property",e.AminoAcid="Amino Acid",e.NucleicBase="Nucleic Base",e.Manipulate="Manipulate Selection",e.Validation="Validation",e.Misc="Miscellaneous",e.Internal="Internal",e}(ln||{});function un(e,t,r){var n,a;return void 0===r&&(r={}),{label:e,expression:t,description:r.description||"",category:null!==(n=r.category)&&void 0!==n?n:ln.Misc,isHidden:!!r.isHidden,priority:r.priority||0,referencesCurrent:!!r.referencesCurrent,get query(){return a||(a=y2(t)),a},ensureCustomProperties:r.ensureCustomProperties,getSelection:function(i,o,s){return ue(this,void 0,void 0,function(){var u,c;return ce(this,function(l){switch(l.label){case 0:return u=i.managers.structure.selection.getStructure(s),c=u?ht.Sequence(s,[u]):ht.Empty(s),r.ensureCustomProperties?[4,r.ensureCustomProperties({runtime:o,assetManager:i.managers.asset},s)]:[3,2];case 1:l.sent(),l.label=2;case 2:return a||(a=y2(t)),[2,a(new Rc(s,{currentSelection:c}))]}})})}}}var mVe=un("All",fe.struct.generator.all(),{category:"",priority:1e3}),hVe=un("Current Selection",fe.internal.generator.current(),{category:"",referencesCurrent:!0}),vVe=un("Polymer",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),fe.core.str.match([fe.re("(polypeptide|cyclic-pseudo-peptide|peptide-like|nucleotide|peptide nucleic acid)","i"),fe.ammp("entitySubtype")])])})]),{category:ln.Type}),gVe=un("Trace",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.set.has([fe.set("sphere","gaussian"),fe.ammp("objectPrimitive")])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"atom-test":fe.core.set.has([fe.set("CA","P"),fe.ammp("label_atom_id")])})])])]),{category:ln.Structure}),dy=fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),fe.core.str.match([fe.re("(polypeptide|cyclic-pseudo-peptide|peptide-like)","i"),fe.ammp("entitySubtype")])]),uT=fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),fe.core.str.match([fe.re("(nucleotide|peptide nucleic acid)","i"),fe.ammp("entitySubtype")])]),fv=fe.core.str.match([fe.re("non-polymer|(amino|carboxy) terminus|peptide-like","i"),fe.ammp("chemCompType")]),yVe=un("Backbone",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":dy,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fv]),"atom-test":fe.core.set.has([fe.set.apply(fe,sa.toArray(Qf)),fe.ammp("label_atom_id")])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":uT,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fv]),"atom-test":fe.core.set.has([fe.set.apply(fe,sa.toArray(IA)),fe.ammp("label_atom_id")])})])])]),{category:ln.Structure}),bVe=un("Sidechain",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":dy,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fv]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,sa.toArray(Qf)),fe.ammp("label_atom_id")])])])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":uT,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fv]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,sa.toArray(IA)),fe.ammp("label_atom_id")])])])})])])]),{category:ln.Structure}),SVe=un("Sidechain with Trace",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":dy,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fv]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,sa.toArray(Qf)),fe.ammp("label_atom_id")])]),fe.core.rel.eq([fe.ammp("label_atom_id"),"CA"]),fe.core.logic.and([fe.core.rel.eq([fe.ammp("auth_comp_id"),"PRO"]),fe.core.rel.eq([fe.ammp("label_atom_id"),"N"])])])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":uT,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fv]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,sa.toArray(IA)),fe.ammp("label_atom_id")])]),fe.core.rel.eq([fe.ammp("label_atom_id"),"P"])])})])])]),{category:ln.Structure}),CVe=un("Protein",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":dy})]),{category:ln.Type}),xVe=un("Nucleic",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":uT})]),{category:ln.Type}),_Ve=un("Helix",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":dy,"residue-test":fe.core.flags.hasAny([fe.ammp("secondaryStructureFlags"),fe.core.type.bitflags([2])])})]),{category:ln.Structure,ensureCustomProperties:function(e,t){return Oc.attach(e,t)}}),wVe=un("Beta Strand/Sheet",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":dy,"residue-test":fe.core.flags.hasAny([fe.ammp("secondaryStructureFlags"),fe.core.type.bitflags([4])])})]),{category:ln.Structure,ensureCustomProperties:function(e,t){return Oc.attach(e,t)}}),AVe=un("Water",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"water"])})]),{category:ln.Type}),TVe=un("Ion",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entitySubtype"),"ion"])})]),{category:ln.Type}),DVe=un("Lipid",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entitySubtype"),"lipid"])})]),{category:ln.Type}),cT=un("Carbohydrate",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.logic.or([fe.core.rel.eq([fe.ammp("entityType"),"branched"]),fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"non-polymer"]),fe.core.str.match([fe.re("oligosaccharide","i"),fe.ammp("entitySubtype")])])])})]),{category:ln.Type}),D$=un("Carbohydrate with Connected",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:cT.expression,"layer-count":1,"as-whole-residues":!0})]),{category:ln.Internal,isHidden:!0}),E$=un("Connected to Carbohydrate",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:D$.expression,by:cT.expression})]),{category:ln.Internal,isHidden:!0}),_B=un("Ligand",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.logic.and([fe.core.logic.or([fe.core.rel.eq([fe.ammp("entityType"),"non-polymer"]),fe.core.rel.neq([fe.ammp("entityPrdId"),""])]),fe.core.logic.not([fe.core.str.match([fe.re("(oligosaccharide|lipid|ion)","i"),fe.ammp("entitySubtype")])])]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fe.core.str.match([fe.re("saccharide","i"),fe.ammp("chemCompType")])])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fv})])])]),by:fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.set.has([fe.set.apply(fe,sa.toArray(ey)),fe.ammp("label_comp_id")])})]),fe.struct.generator.atomGroups({"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.set.has([fe.set.apply(fe,sa.toArray(_Be)),fe.ammp("label_comp_id")])})])})]),{category:ln.Type}),I$=un("Ligand with Connected",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:_B.expression,"layer-count":1,"as-whole-residues":!0,"bond-test":fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.core.type.bitflags([3])])})]),by:cT.expression})]),{category:ln.Internal,isHidden:!0}),P$=un("Connected to Ligand",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:I$.expression,by:_B.expression})]),{category:ln.Internal,isHidden:!0}),EVe=un("Connected to Ligand or Carbohydrate",fe.struct.modifier.union([fe.struct.combinator.merge([E$.expression,P$.expression])]),{category:ln.Internal,isHidden:!0}),IVe=un("Disulfide Bridges",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.modifier.wholeResidues([fe.struct.filter.isConnectedTo({0:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("SG"),fe.ammp("label_atom_id")])}),target:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("SG"),fe.ammp("label_atom_id")])}),"bond-test":!0})])]),fe.struct.modifier.union([fe.struct.modifier.wholeResidues([fe.struct.modifier.union([fe.struct.generator.bondedAtomicPairs({0:fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.core.type.bitflags([8])])})])])])])]),{category:ln.Bond}),PVe=un("NOS Bridges",fe.struct.modifier.union([fe.struct.modifier.wholeResidues([fe.struct.filter.isConnectedTo({0:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CSO","LYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("OD","NZ"),fe.ammp("label_atom_id")])}),target:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CSO","LYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("OD","NZ"),fe.ammp("label_atom_id")])}),"bond-test":!0})])]),{category:ln.Bond}),MVe=un("Non-standard Residues in Polymers",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.ammp("isNonStandard")})]),{category:ln.Residue}),RVe=un("Coarse Elements",fe.struct.modifier.union([fe.struct.generator.atomGroups({"chain-test":fe.core.set.has([fe.set("sphere","gaussian"),fe.ammp("objectPrimitive")])})]),{category:ln.Type}),OVe=un("Rings in Residues",fe.struct.modifier.union([fe.struct.generator.rings()]),{category:ln.Residue}),FVe=un("Aromatic Rings in Residues",fe.struct.modifier.union([fe.struct.generator.rings({"only-aromatic":!0})]),{category:ln.Residue}),BVe=un("Surrounding Residues (5 \u212b) of Selection",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.includeSurroundings({0:fe.internal.generator.current(),radius:5,"as-whole-residues":!0}),by:fe.internal.generator.current()})]),{description:"Select residues within 5 \u212b of the current selection.",category:ln.Manipulate,referencesCurrent:!0}),NVe=un("Surrounding Ligands (5 \u212b) of Selection",fe.struct.modifier.union([fe.struct.modifier.surroundingLigands({0:fe.internal.generator.current(),radius:5,"include-water":!0})]),{description:"Select ligand components within 5 \u212b of the current selection.",category:ln.Manipulate,referencesCurrent:!0}),kVe=un("Surrounding Atoms (5 \u212b) of Selection",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.includeSurroundings({0:fe.internal.generator.current(),radius:5,"as-whole-residues":!1}),by:fe.internal.generator.current()})]),{description:"Select atoms within 5 \u212b of the current selection.",category:ln.Manipulate,referencesCurrent:!0}),LVe=un("Inverse / Complement of Selection",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.generator.all(),by:fe.internal.generator.current()})]),{description:"Select everything not in the current selection.",category:ln.Manipulate,referencesCurrent:!0}),UVe=un("Residues Covalently Bonded to Selection",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:fe.internal.generator.current(),"layer-count":1,"as-whole-residues":!0})]),{description:"Select residues covalently bonded to current selection.",category:ln.Manipulate,referencesCurrent:!0}),VVe=un("Covalently Bonded Component",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:fe.internal.generator.current(),"fixed-point":!0})]),{description:"Select covalently bonded component based on current selection.",category:ln.Manipulate,referencesCurrent:!0}),GVe=un("Residues with Cov. or Metallic Bond to Selection",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:fe.internal.generator.current(),"layer-count":1,"as-whole-residues":!0,"bond-test":fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.core.type.bitflags([3])])})]),{description:"Select residues with covalent or metallic bond to current selection.",category:ln.Manipulate,referencesCurrent:!0}),zVe=un("Whole Residues of Selection",fe.struct.modifier.union([fe.struct.modifier.wholeResidues({0:fe.internal.generator.current()})]),{description:"Expand current selection to whole residues.",category:ln.Manipulate,referencesCurrent:!0}),HVe=[[["HIS"],"Histidine"],[["ARG"],"Arginine"],[["LYS"],"Lysine"],[["ILE"],"Isoleucine"],[["PHE"],"Phenylalanine"],[["LEU"],"Leucine"],[["TRP"],"Tryptophan"],[["ALA"],"Alanine"],[["MET"],"Methionine"],[["PRO"],"Proline"],[["CYS"],"Cysteine"],[["ASN"],"Asparagine"],[["VAL"],"Valine"],[["GLY"],"Glycine"],[["SER"],"Serine"],[["GLN"],"Glutamine"],[["TYR"],"Tyrosine"],[["ASP"],"Aspartic Acid"],[["GLU"],"Glutamic Acid"],[["THR"],"Threonine"],[["SEC"],"Selenocysteine"],[["PYL"],"Pyrrolysine"],[["UNK"],"Unknown"]].sort(function(e,t){return e[1]t[1]?1:0}),jVe=[[["A","DA"],"Adenosine"],[["C","DC"],"Cytidine"],[["T","DT"],"Thymidine"],[["G","DG"],"Guanosine"],[["I","DI"],"Inosine"],[["U","DU"],"Uridine"],[["N","DN"],"Unknown"]].sort(function(e,t){return e[1]t[1]?1:0});function wB(e,t,r){var n=e[0],a=e[1];void 0===r&&(r=0);var i=1!==n.length||M$.has(n[0])?"".concat(a," (").concat(n.join(", "),")"):"[".concat(n[0],"] ").concat(a);return un(i,fe.struct.modifier.union([fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set.apply(fe,n),fe.ammp("auth_comp_id")])})]),{category:t,priority:r,description:i})}var AB,b2,TB,M$=sa.unionMany(x4,WS,YS,PA),xi={all:mVe,current:hVe,polymer:vVe,trace:gVe,backbone:yVe,sidechain:bVe,sidechainWithTrace:SVe,protein:CVe,nucleic:xVe,helix:_Ve,beta:wVe,water:AVe,ion:TVe,lipid:DVe,branched:cT,branchedPlusConnected:D$,branchedConnectedOnly:E$,ligand:_B,ligandPlusConnected:I$,ligandConnectedOnly:P$,connectedOnly:EVe,disulfideBridges:IVe,nosBridges:PVe,nonStandardPolymer:MVe,coarse:RVe,ring:OVe,aromaticRing:FVe,surroundings:BVe,surroundingLigands:NVe,surroundingAtoms:kVe,complement:LVe,covalentlyBonded:UVe,covalentlyOrMetallicBonded:GVe,covalentlyBondedComponent:VVe,wholeResidues:zVe},YVe=function(){function e(){var t,r;this.list=[],this.options=[],this.version=1,(t=this.list).push.apply(t,or(or(or([],Object.values(xi),!1),HVe.map(function(n){return wB(n,ln.AminoAcid)}),!1),jVe.map(function(n){return wB(n,ln.NucleicBase)}),!1)),(r=this.options).push.apply(r,this.list.map(function(n){return[n,n.label,n.category]}))}return e.prototype.add=function(t){this.list.push(t),this.options.push([t,t.label,t.category]),this.version+=1},e.prototype.remove=function(t){var r=this.list.indexOf(t);-1!==r&&(this.list.splice(r,1),this.options.splice(r,1),this.version+=1)},e}();function QVe(e){switch(e){case 7:return-3;case 6:return-2;case 5:return-1;case 0:case 4:return 0;case 3:return 1;case 2:return 2;case 1:return 3;default:return console.error("Value ".concat(e," is outside the 0-7 range, defaulting to 0.")),0}}function R$(e,t){for(var r=Xe.create(e.data,2*t),n=Xe.create(e.data,2*t),a=Xe.create(e.data,2*t),i=Xe.create(e.data,2*t),o=Xe.create(e.data,2*t),s=0;s0)for(d=0;d0&&(g=ie.ofIntArray(ie.mapToArray(a.atomIdxA,function(x){return x-1},Int32Array)),y=ie.ofIntArray(ie.mapToArray(a.atomIdxB,function(x){return x-1},Int32Array)),S=ie.asArrayColumn(a.order,Int32Array),C=Do.fromData({pairs:{indexA:g,indexB:y,order:S},count:n.count},{maxDistance:1/0}),Do.Provider.set(v.representative,C)),[2,v]}})})}function tGe(e){return Ve.create("Parse MOL",function(t){return B$(e,void 0,t)})}function sGe(e){var t=b2.fromFrame(e);return Ve.create("Parse CIF Core",function(r){return function aGe(e,t,r){var n;return ue(this,void 0,void 0,function(){var a,i,o,s,u,c,l,d,f,p,m,h,v,g,y,S,C,_,x,D,w,A,E,I,M,F,N,U,H,z,G,J,X,Z,ne,Y,k,W,$,K,q,V,ee,ae,pe,me,de,re,te,le,ge;return ce(this,function(xe){switch(xe.label){case 0:for(i=ie.ofConst("MOL",a=e.atom_site._rowCount,ie.Schema.str),o=ie.ofConst("A",a,ie.Schema.str),s=ie.ofConst(1,a,ie.Schema.int),u=function nGe(e){var t=e.cell,n=function rGe(e){var t=e.it_number.value(0),r=e["name_h-m_full"].value(0).replace("-"," ");return e.it_number.isDefined?t:r}(e.space_group),a=ns.create(n,b.create(t.length_a.value(0),t.length_b.value(0),t.length_c.value(0)),b.scale(b(),b.create(t.angle_alpha.value(0),t.angle_beta.value(0),t.angle_gamma.value(0)),Math.PI/180));return{spacegroup:au.create(a),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}(e),c=u.spacegroup.cell.fromFractional,d=(l=e.atom_site).fract_x,f=l.fract_y,p=l.fract_z,m=new Float32Array(a),h=new Float32Array(a),v=new Float32Array(a),g=b(),de=0;de0&&(Ja.Provider.set(H=U.representative,u),(z=e.geom_bond._rowCount)>0)){for(G={},de=0,X=(J=e.atom_site.label).rowCount;deATOM"!==Uc(t)&&t.position5?er(p)(ie.Schema.str):C,subst_id:s>6?er(m)(ie.Schema.int):S,subst_name:s>7?er(h)(ie.Schema.str):C,charge:s>8?er(v)(ie.Schema.float):y,status_bit:s>9?er(g)(ie.Schema.str):C}]}})})}function mGe(e){return ue(this,void 0,void 0,function(){var t,r,n,a,i,o,s,u,c,l,d,f,p,m;return ce(this,function(v){switch(v.label){case 0:for(t=e.tokenizer,r=e.molecule;"@BOND"!==Uc(t)&&t.position4?er(f)(ie.Schema.str):ie.Undefined(r.num_bonds,ie.Schema.str)}]}})})}function vGe(e,t,r){return ue(this,void 0,void 0,function(){var n,a,i,o,s,u;return ce(this,function(l){switch(l.label){case 0:n=lt(t),e.update({message:"Parsing...",current:0,max:t.length}),a=[],l.label=1;case 1:return n.positionMOLECULE"!==Uc(t)&&t.position")){r.mol_type=a,Lc(t);var i=Uc(t);if(!i.startsWith("@")){r.charge_type=i,Lc(t);var o=Uc(t);if(!o.startsWith("@")){r.status_bits=o,Lc(t);var s=Uc(t);s.startsWith("@")||(r.mol_comment=s)}}}}(i),[4,pGe(i)]):[3,4];case 2:return o=l.sent(),[4,mGe(i)];case 3:for(s=l.sent(),u=function hGe(e){for(var t=e.tokenizer;t.positionMOLECULE"===r)return;if("@CRYSIN"===r)break;Lc(t)}if(!(t.position>=t.data.length)){Lc(t);var n=Uc(t).trim().split(L$);return{a:parseFloat(n[0]),b:parseFloat(n[1]),c:parseFloat(n[2]),alpha:parseFloat(n[3]),beta:parseFloat(n[4]),gamma:parseFloat(n[5]),spaceGroup:parseInt(n[6],10),setting:parseInt(n[7],10)}}}(i),a.push({molecule:i.molecule,atoms:o,bonds:s,crysin:u}),DB(n);"@MOLECULE"!==Uc(n)&&n.position0&&(x=ie.ofIntArray(ie.mapToArray(u.origin_atom_id,function(j){return j-1},Int32Array)),D=ie.ofIntArray(ie.mapToArray(u.target_atom_id,function(j){return j-1},Int32Array)),w=u.bond_id,A=ie.ofIntArray(ie.mapToArray(u.bond_type,function(j){switch(j){case"ar":case"am":case"un":return 1;case"du":case"nc":return 0;default:return parseInt(j)}},Int8Array)),E=ie.ofIntArray(ie.mapToArray(u.bond_type,function(j){switch(j){case"ar":case"am":return 17;case"du":case"nc":return 0;default:return 1}},Int8Array)),I=Do.fromData({pairs:{key:w,indexA:x,indexB:D,order:A,flag:E},count:s.count},{maxDistance:c?-1:1/0}),Do.Provider.set(M=_.representative,I),oy.Provider.set(M,{data:s.charge,type:o.charge_type}),c&&(F=function bGe(e){if(1===e.setting){var t=ns.create(e.spaceGroup,b.create(e.a,e.b,e.c),b.scale(b(),b.create(e.alpha,e.beta,e.gamma),Math.PI/180));return{spacegroup:au.create(t),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}}(c),F&&Ja.Provider.set(M,F)),r.push(M)),N.label=3;case 3:return++n,[3,1];case 4:return[2,new rp(r)]}})})}(e,t)})}!function(e){e.is=function t(n){return"mol2"===n?.kind},e.create=function r(n){return{kind:"mol2",name:n.name,data:n}}}(EB||(EB={}));var mu,PB,fy=new Uint32Array([0,0,0,0,0,0,0,0,0,8,10,12,16,20,25,32,40,50,64,80,101,128,161,203,256,322,406,512,645,812,1024,1290,1625,2048,2580,3250,4096,5060,6501,8192,10321,13003,16384,20642,26007,32768,41285,52015,65536,82570,104031,131072,165140,208063,262144,330280,416127,524287,660561,832255,1048576,1321122,1664510,2097152,2642245,3329021,4194304,5284491,6658042,8388607,10568983,13316085,16777216]),IB=9;function CGe(){throw new Error("(xdrfile error) Undefined error.")}function xGe(e,t){return ue(this,void 0,void 0,function(){var r,n,a,i,o,s,u,c,l,d,f,p,m,h,v,g,y,S,C,_,x,D,w,A,E,I,M,F,N,j,U,H,z;return ce(this,function(G){switch(G.label){case 0:r=new DataView(t.buffer,t.byteOffset),a=(n={frames:[],boxes:[],times:[],timeOffset:0,deltaTime:0}).frames,i=n.boxes,o=n.times,s=[0,0,0,0,0,0],u=[0,0,0],c=[0,0,0],l=[0,0,0],d=[.1,.1,.1],f=[.1,.1,.1],p=0,m=mu.buf,G.label=1;case 1:for(h=void 0,v=r.getInt32(p+4),o.push(r.getFloat32(p+=12)),p+=4,g=new Float32Array(9),F=0;F<9;++F)g[F]=10*r.getFloat32(p),p+=4;if(i.push(g),v<=9)for(h={count:v/3,x:new Float32Array(v/3),y:new Float32Array(v/3),z:new Float32Array(v/3)},F=0;F16777215?(c[0]=mu.sizeOfInt(u[0]),c[1]=mu.sizeOfInt(u[1]),c[2]=mu.sizeOfInt(u[2]),_=0):_=mu.sizeOfInts(3,u),x=r.getInt32(p),p+=4,w=fy[D=IB>(D=x-1)?IB:D]/2|0,A=fy[x]/2|0,l[0]=l[1]=l[2]=fy[x],E=4*Math.ceil(r.getInt32(p)/4),p+=4,I=1/C,M=0,F=0,d[0]=d[1]=d[2]=0;F0)for(d[0]=d[1]=d[2]=0,U=0;UIB?fy[x-1]/2|0:0):j>0&&(w=A,A=fy[x]/2|0),l[0]=l[1]=l[2]=fy[x],(0===l[0]||0===l[1]||0===l[2])&&CGe()}p+=E}for(z=0;z=t.length?[3,4]:[3,1];case 4:return o.length>=1&&(n.timeOffset=o[0]),o.length>=2&&(n.deltaTime=o[1]-o[0]),[2,n]}})})}function _Ge(e){var t=this;return Ve.create("Parse XTC",function(r){return ue(t,void 0,void 0,function(){var n,a;return ce(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r.update({canAbort:!0,message:"Parsing trajectory..."}),[4,xGe(r,e)];case 1:return n=i.sent(),[2,In.success(n)];case 2:return a=i.sent(),[2,In.error(""+a)];case 3:return[2]}})})})}function wGe(e){var t=this;return Ve.create("Parse XTC",function(r){return ue(t,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d;return ce(this,function(f){switch(f.label){case 0:return[4,r.update("Converting to coordinates")];case 1:for(f.sent(),n=cu(e.deltaTime,"step"),a=cu(e.timeOffset,n.unit),i=[],o=0,s=e.frames.length;o=e.data.length-1?0:+lt.readLine(e);isNaN(t)&&(t=0);for(var r=lt.readLine(e),n=new Float64Array(t),a=new Float64Array(t),i=new Float64Array(t),o=new Array(t),s=0;s=d&&f<32;)f++,d<<=1;return f};var r=new Uint8Array(32);e.sizeOfInts=function n(l,d){var f=1,p=0;r[0]=1;for(var m=0;m>=8;for(;0!==v;)r[h++]=255&v,v>>=8;f=h}var g=1;for(f--;r[f]>=g;)p++,g*=2;return p+8*f};var a=new ArrayBuffer(24);e.buf=new Int32Array(a);var i=new Uint32Array(a);function o(l,d,f){for(var p=f,m=(1<=8;)y|=(v=v<<8|l[d+g++])>>h<0&&(h>(h-=p)&(1<>i[1]&255}e.decodeBits=o;var u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];e.decodeInts=function c(l,d,f,p,m){var h=f,v=0;for(u[0]=0,u[1]=0,u[2]=0,u[3]=0;h>8;)u[v++]=s(l,d),h-=8;h>0&&(u[v++]=o(l,d,h));for(var g=2;g>0;g--){for(var y=0,S=p[g],C=v-1;C>=0;C--){var _=(y=y<<8|u[C])/S|0;u[C]=_,y-=_*S}m[g]=y}m[0]=u[0]|u[1]<<8|u[2]<<16|u[3]<<24}}(mu||(mu={})),function(e){e.is=function t(n){return"xyz"===n?.kind},e.create=function r(n){return{kind:"xyz",name:"xyz",data:n}}}(PB||(PB={}));var RB,MB="$$$$";function NGe(e){var t=lt.readLine(e).trim(),r=lt.readLine(e).trim(),n=lt.readLine(e).trim(),a=lt.readLine(e),i=function PGe(e){return e.trim().endsWith("V3000")}(a),o=i?function MGe(e){var t=Xe.create(e.data,1),r=Xe.create(e.data,1);return lt.eatLine(e),op(e),op(e),op(e),sp(e,t),sp(e,r),lt.eatLine(e),{atomCount:er(t)(ie.Schema.int).value(0),bondCount:er(r)(ie.Schema.int).value(0)}}(e):function BGe(e){return{atomCount:+e.substr(0,3),bondCount:+e.substr(3,3)}}(a),s=o.atomCount,u=o.bondCount;if(!Number.isNaN(s)&&!Number.isNaN(u)){var l={atomIdx:ie.ofConst(0,s,ie.Schema.int),charge:ie.ofConst(0,s,ie.Schema.int)},d=i?function RGe(e,t){for(var r=Xe.create(e.data,2*t),n=Xe.create(e.data,2*t),a=Xe.create(e.data,2*t),i=Xe.create(e.data,2*t),o=0;o ")){Xe.add(t,e.tokenStart+2,e.tokenEnd),lt.markLine(e);for(var a=e.tokenStart,i=e.tokenEnd,o=!1;e.position ")){Xe.add(r,a,i),o=!0;break}i=e.tokenEnd}o||Xe.add(r,a,i)}}return{dataHeader:er(t)(ie.Schema.str),data:er(r)(ie.Schema.str)}}(e);return{molFile:{title:t,program:r,comment:n,atoms:d,bonds:f,formalCharges:p},dataItems:m}}for(;e.position>8&65280|x>>24&255;for(D=new Float32Array(e.buffer,o,v),w=0;w=e.byteLength)break}return i.length>=1&&(r.timeOffset=i[0]),i.length>=2&&(r.deltaTime=i[1]-i[0]),[2,r]})})}function GGe(e){var t=this;return Ve.create("Parse TRR",function(r){return ue(t,void 0,void 0,function(){var n,a;return ce(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r.update({canAbort:!0,message:"Parsing trajectory..."}),[4,VGe(e)];case 1:return n=i.sent(),[2,In.success(n)];case 2:return a=i.sent(),[2,In.error(""+a)];case 3:return[2]}})})})}function zGe(e){var t=this;return Ve.create("Parse TRR",function(r){return ue(t,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d;return ce(this,function(f){switch(f.label){case 0:return[4,r.update("Converting to coordinates")];case 1:for(f.sent(),n=cu(e.deltaTime,"step"),a=cu(e.timeOffset,n.unit),i=[],o=0,s=e.frames.length;o>>0:0,i=t.byteLength-a,o=a;t instanceof ArrayBuffer||(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+a),t=t.buffer),this._lastWrittenByte=n?i:0,this.buffer=t,this.length=i,this.byteLength=i,this.byteOffset=o,this._data=new DataView(this.buffer,o,i)}return e.prototype.available=function(t){return void 0===t&&(t=1),this.offset+t<=this.length},e.prototype.isLittleEndian=function(){return this.littleEndian},e.prototype.setLittleEndian=function(){return this.littleEndian=!0,this},e.prototype.isBigEndian=function(){return!this.littleEndian},e.prototype.setBigEndian=function(){return this.littleEndian=!1,this},e.prototype.skip=function(t){return void 0===t&&(t=1),this.offset+=t,this},e.prototype.seek=function(t){return this.offset=t,this},e.prototype.mark=function(){return this._mark=this.offset,this},e.prototype.reset=function(){return this.offset=this._mark,this},e.prototype.pushMark=function(){return this._marks.push(this.offset),this},e.prototype.popMark=function(){var t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this},e.prototype.rewind=function(){return this.offset=0,this},e.prototype.ensureAvailable=function(t){if(void 0===t&&(t=1),!this.available(t)){var n=2*(this.offset+t),a=new Uint8Array(n);a.set(new Uint8Array(this.buffer)),this.buffer=a.buffer,this.length=this.byteLength=n,this._data=new DataView(this.buffer)}return this},e.prototype.readBoolean=function(){return 0!==this.readUint8()},e.prototype.readInt8=function(){return this._data.getInt8(this.offset++)},e.prototype.readUint8=function(){return this._data.getUint8(this.offset++)},e.prototype.readByte=function(){return this.readUint8()},e.prototype.readBytes=function(t){void 0===t&&(t=1);for(var r=new Uint8Array(t),n=0;nthis._lastWrittenByte&&(this._lastWrittenByte=this.offset)},e}();function Vc(e,t){if(e)throw new TypeError("Not a valid NetCDF v3.x file: "+t)}function U$(e){e.offset%4!=0&&e.skip(4-e.offset%4)}function FB(e){var t=e.readUint32(),r=e.readChars(t);return U$(e),r}var ti={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function V$(e){switch(Number(e)){case ti.BYTE:return"byte";case ti.CHAR:return"char";case ti.SHORT:return"short";case ti.INT:return"int";case ti.FLOAT:return"float";case ti.DOUBLE:return"double";default:return"undefined"}}function G$(e){switch(Number(e)){case ti.BYTE:case ti.CHAR:return 1;case ti.SHORT:return 2;case ti.INT:case ti.FLOAT:return 4;case ti.DOUBLE:return 8;default:return-1}}function z$(e){switch(String(e)){case"byte":return ti.BYTE;case"char":return ti.CHAR;case"short":return ti.SHORT;case"int":return ti.INT;case"float":return ti.FLOAT;case"double":return ti.DOUBLE;default:return-1}}function lT(e,t){if(1!==e){for(var r=new Array(e),n=0;n6,"non valid type "+o);var s=e.readUint32(),u=BB(e,o,s);U$(e),t[a]={name:i,type:V$(o),value:u}}return t}var NB,kB,eze=function(){function e(t){var r=new jGe(t);r.setBigEndian(),Vc("CDF"!==r.readChars(3),"should start with CDF");var n=r.readByte();Vc(n>2,"unknown version"),this.header=function QGe(e,t){var r={recordDimension:{length:e.readUint32()}};r.version=t;var n=function $Ge(e){var t,r,n,a=e.readUint32();if(a===py)return Vc(e.readUint32()!==py,"wrong empty tag for list of dimensions"),[];Vc(10!==a,"wrong tag for list of dimensions");var i=e.readUint32();t=new Array(i);for(var o=0;o6,"non valid type "+p);var m=e.readUint32(),h=e.readUint32();2===r&&(Vc(h>0,"offsets larger than 4GB not supported"),h=e.readUint32()),l[0]===t&&(a+=m),i[s]={name:u,dimensions:l,attributes:f,type:V$(p),size:m,offset:h,record:l[0]===t}}return{variables:i,recordStep:a}}(e,n.recordId,t);return r.variables=a.variables,r.recordDimension.recordStep=a.recordStep,r}(r,n),this.buffer=r}return Object.defineProperty(e.prototype,"version",{get:function(){return 1===this.header.version?"classic format":"64-bit offset format"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recordDimension",{get:function(){return this.header.recordDimension},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dimensions",{get:function(){return this.header.dimensions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalAttributes",{get:function(){return this.header.globalAttributes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.header.variables},enumerable:!1,configurable:!0}),e.prototype.hasDataVariable=function(t){return this.header.variables&&-1!==this.header.variables.findIndex(function(r){return r.name===t})},e.prototype.getDataVariable=function(t){var r,n;if(void 0===(n="string"==typeof t?null===(r=this.header.variables)||void 0===r?void 0:r.find(function(a){return a.name===t}):t))throw new Error("variable not found");return this.buffer.seek(n.offset),n.record?function YGe(e,t,r){for(var n=z$(t.type),a=t.size?t.size/G$(n):1,i=r.length,o=new Array(i),s=r.recordStep,u=0;u=1&&(r.timeOffset=r.time[0]),r.time.length>=2&&(r.deltaTime=r.time[1]-r.time[0])),[2,r]})})}function rze(e){var t=this;return Ve.create("Parse NCTRAJ",function(r){return ue(t,void 0,void 0,function(){var n,a;return ce(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r.update({canAbort:!0,message:"Parsing trajectory..."}),[4,tze(e)];case 1:return n=i.sent(),[2,In.success(n)];case 2:return a=i.sent(),[2,In.error(""+a)];case 3:return[2]}})})})}function nze(e){var t=this;return Ve.create("Parse NCTRAJ",function(r){return ue(t,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d,f,p,m,h,v,g,y,S;return ce(this,function(C){switch(C.label){case 0:return[4,r.update("Converting to coordinates")];case 1:for(C.sent(),n=cu(e.deltaTime,"step"),a=cu(e.timeOffset,n.unit),i=[],o=0,s=e.coordinates.length;o0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Parse mmCIF",function(a){return ue(t,void 0,void 0,function(){var i,o,s,u,c,l,d,f,p,m,v,g,y;return ce(this,function(S){switch(S.label){case 0:if(!n.loadAllBlocks)return[3,10];o=[],s=0,u=r.data.blocks,S.label=1;case 1:return s0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Model from Trajectory",function(a){return ue(t,void 0,void 0,function(){var i,o,s,u;return ce(this,function(c){switch(c.label){case 0:return(i=n.modelIndex%r.data.frameCount)<0&&(i+=r.data.frameCount),[4,Ve.resolveInContext(r.data.getFrameAtIndex(i),a)];case 1:return o=c.sent(),s="Model ".concat(i+1),u=1===r.data.frameCount?void 0:"of ".concat(r.data.frameCount),[2,new ve.Molecule.Model(o,{label:s,description:u})]}})})})},interpolate:function(e,t,r){return{modelIndex:r>=1?t.modelIndex:e.modelIndex+Math.floor((t.modelIndex-e.modelIndex+1)*r)}},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),Ize=Bt.BuiltIn({name:"structure-from-trajectory",display:{name:"Structure from Trajectory",description:"Create a molecular structure from a trajectory."},from:ve.Molecule.Trajectory,to:ve.Molecule.Structure})({apply:function(e){var t=this,r=e.a;return Ve.create("Build Structure",function(n){return ue(t,void 0,void 0,function(){var a,i;return ce(this,function(o){switch(o.label){case 0:return[4,Ze.ofTrajectory(r.data,n)];case 1:return a=o.sent(),i={label:"Ensemble",description:Ze.elementDescription(a)},[2,new ve.Molecule.Structure(a,i)]}})})})},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),Pze=Bt.BuiltIn({name:"structure-from-model",display:{name:"Structure",description:"Create a molecular structure (model, assembly, or symmetry) from the specified model."},from:ve.Molecule.Model,to:ve.Molecule.Structure,params:function(e){return dv.getParams(e&&e.data)}})({canAutoUpdate:function(e){return dv.canAutoUpdate(e.oldParams.type,e.newParams.type)},apply:function(e,t){var r=this,n=e.a,a=e.params;return Ve.create("Build Structure",function(i){return ue(r,void 0,void 0,function(){return ce(this,function(o){return[2,dv.create(t,i,n.data,a&&a.type)]})})})},update:function(e){var t=e.a,r=e.b;return rd(e.oldParams,e.newParams)?r.data.model===t.data?rt.UpdateResult.Unchanged:ar.areHierarchiesEqual(t.data,r.data.model)?(r.data=r.data.remapModel(t.data),rt.UpdateResult.Updated):rt.UpdateResult.Recreate:rt.UpdateResult.Recreate},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),q$=b(),W$=he(),Y$=he(),Mze=Bt.BuiltIn({name:"transform-structure-conformation",display:{name:"Transform Conformation"},isDecorator:!0,from:ve.Molecule.Structure,to:ve.Molecule.Structure,params:{transform:T.MappedStatic("components",{components:T.Group({axis:T.Vec3(b.create(1,0,0)),angle:T.Numeric(0,{min:-180,max:180,step:.1}),translation:T.Vec3(b.create(0,0,0))},{isFlat:!0}),matrix:T.Group({data:T.Mat4(he.identity()),transpose:T.Boolean(!1)},{isFlat:!0})},{label:"Kind"})}})({canAutoUpdate:function(e){return"matrix"!==e.newParams.transform.name},apply:function(e){var t=e.a,r=e.params,n=he();if("components"===r.transform.name){var a=r.transform.params,i=a.axis,o=a.angle,s=a.translation,u=t.data.boundary.sphere.center;he.fromTranslation(W$,b.negate(q$,u)),he.fromTranslation(Y$,b.add(q$,u,s));var c=he.fromRotation(he(),Math.PI/180*o,b.normalize(b(),i));he.mul3(n,Y$,c,W$)}else"matrix"===r.transform.name&&(he.copy(n,r.transform.params.data),r.transform.params.transpose&&he.transpose(n,n));var l=Ze.transform(t.data,n);return new ve.Molecule.Structure(l,{label:t.label,description:"".concat(t.description," [Transformed]")})},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),Rze=Bt.BuiltIn({name:"structure-selection-from-expression",display:{name:"Selection",description:"Create a molecular structure from the specified expression."},from:ve.Molecule.Structure,to:ve.Molecule.Structure,params:function(){return{expression:T.Value(fe.struct.generator.all,{isHidden:!0}),label:T.Optional(T.Text("",{isHidden:!0}))}}})({apply:function(e){var r=e.params,n=e.cache,a=cs.createAndRun(e.a.data,r.expression),i=a.selection;if(n.entry=a.entry,ht.isEmpty(i))return Jn.Null;var s=ht.unionStructure(i),u={label:"".concat(r.label||"Selection"),description:Ze.elementDescription(s)};return new ve.Molecule.Structure(s,u)},update:function(e){var t=e.a,r=e.b,a=e.newParams;if(e.oldParams.expression!==a.expression)return rt.UpdateResult.Recreate;var o=e.cache.entry;if(o.currentStructure===t.data)return rt.UpdateResult.Unchanged;var s=cs.updateStructure(o,t.data);return ht.isEmpty(s)?rt.UpdateResult.Null:(cs.updateStructureObject(r,s,a.label),rt.UpdateResult.Updated)},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),Oze=Bt.BuiltIn({name:"structure-multi-selection-from-expression",display:{name:"Multi-structure Measurement Selection",description:"Create selection object from multiple structures."},from:ve.Root,to:ve.Molecule.Structure.Selections,params:function(){return{selections:T.ObjectList({key:T.Text(void 0,{description:"A unique key."}),ref:T.Text(),groupId:T.Optional(T.Text()),expression:T.Value(fe.struct.generator.empty)},function(e){return e.ref},{isHidden:!0}),isTransitive:T.Optional(T.Boolean(!1,{isHidden:!0,description:"Remap the selections from the original structure if structurally equivalent."})),label:T.Optional(T.Text("",{isHidden:!0}))}}})({apply:function(e){for(var t=e.params,r=e.cache,n=e.dependencies,a=new Map,i=[],o=0,s=0,u=t.selections;s65536?0:a.ISPG)||"P 1",o,s),l=b.create(a.MAPC-1,a.MAPR-1,a.MAPS-1),d=Sr.convertToCanonicalAxisIndicesFastToSlow(l),f=[a.NX,a.NY,a.NZ],p=d([a.NC,a.NR,a.NS]),m=function Vze(e){return 0===e.originX&&0===e.originY&&0===e.originZ?b.create(e.NCSTART,e.NRSTART,e.NSSTART):b.create(e.originX/(e.xLength/e.NX),e.originY/(e.yLength/e.NY),e.originZ/(e.zLength/e.NZ))}(a),t?.offset&&b.add(m,m,t.offset),h=d(m),v=b.create(h[0]/f[0],h[1]/f[1],h[2]/f[2]),g=b.create(p[0]/f[0],p[1]/f[1],p[2]/f[2]),y=Sr.Space(p,Sr.invertAxisOrder(l),function Gze(e){var t=YW(e);switch(t){case Ki.Float32:return Float32Array;case Ki.Int8:return Int8Array;case Ki.Int16:return Int16Array;case Ki.Uint16:return Uint16Array}throw Error("".concat(t," is not a supported value format."))}(a)),S=Sr.create(y,Sr.Data1(i)),C=0===a.AMIN&&0===a.AMAX&&0===a.AMEAN&&0===a.ARMS,[2,{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"spacegroup",cell:c,fractionalBox:Nt.create(v,b.add(b.zero(),v,g))},cells:S,stats:{min:isNaN(a.AMIN)||C?Aw(i):a.AMIN,max:isNaN(a.AMAX)||C?id(i):a.AMAX,mean:isNaN(a.AMEAN)||C?Tw(i):a.AMEAN,sigma:isNaN(a.ARMS)||0===a.ARMS?Dw(i):a.ARMS}},sourceData:UB.create(e),customProperties:new Sl,_propertyData:Object.create(null)}]})})})}function Hze(e,t){var r=this;return Ve.create("Create Volume",function(n){return ue(r,void 0,void 0,function(){var a,i,o,s,u,c,l,d,f,p,m,h;return ce(this,function(v){return i=e.values,o=b.create((a=e.header).xlen,a.ylen,a.zlen),t&&t.voxelSize&&b.mul(o,o,t.voxelSize),s=b.create(Yr(a.alpha),Yr(a.beta),Yr(a.gamma)),u=ns.create("P 1",o,s),l=[a.xExtent,a.yExtent,a.zExtent],f=b.create((d=[a.xStart,a.yStart,a.zStart])[0]/(c=[a.xRate,a.yRate,a.zRate])[0],d[1]/c[1],d[2]/c[2]),p=b.create(l[0]/c[0],l[1]/c[1],l[2]/c[2]),m=Sr.Space(l,[0,1,2],Float32Array),h=Sr.create(m,Sr.Data1(i)),[2,{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"spacegroup",cell:u,fractionalBox:Nt.create(f,b.add(b.zero(),f,p))},cells:h,stats:{min:Aw(i),max:id(i),mean:Tw(i),sigma:void 0!==a.sigma?a.sigma:Dw(i)}},sourceData:VB.create(e),customProperties:new Sl,_propertyData:Object.create(null)}]})})})}function jze(e,t){var r=this;return Ve.create("Create Volume",function(){return ue(r,void 0,void 0,function(){var n,a,i,o,s,u;return ce(this,function(c){return a=e.values,i=Sr.Space((n=e.header).dim,[0,1,2],Float64Array),o=Sr.create(i,Sr.Data1(a)),s=he.fromTranslation(he(),n.min),u=he.fromScaling(he(),n.h),he.mul(s,s,u),[2,{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"matrix",matrix:s},cells:o,stats:{min:Aw(a),max:id(a),mean:Tw(a),sigma:Dw(a)}},sourceData:GB.create(e),customProperties:new Sl,_propertyData:Object.create(null)}]})})})}function qze(e,t){var r=this;return Ve.create("Create Segmentation Volume",function(n){return ue(r,void 0,void 0,function(){var a,i,o,s,u,c,l,d,f,p,m,h,v,g,y,S,C,_,x,D,w,A,F,N,j,U,H,z,G,J,X,Z;return ce(this,function(ne){for(i=e.segmentation_data_3d,o=ns.create((a=e.volume_data_3d_info).spacegroup_number.value(0),b.ofArray(a.spacegroup_cell_size.value(0)),b.scale(b(),b.ofArray(a.spacegroup_cell_angles.value(0)),Math.PI/180)),s=a.axis_order.value(0),u=Sr.convertToCanonicalAxisIndicesFastToSlow(s),c=u(a.sample_count.value(0)),l=Sr.Space(c,Sr.invertAxisOrder(s),Float32Array),d=Sr.create(l,Sr.Data1(i.values.toArray({array:Float32Array}))),f=b.ofArray(u(a.origin.value(0))),p=b.ofArray(u(a.dimensions.value(0))),m={label:t?.label,entryId:void 0,grid:{transform:{kind:"spacegroup",cell:o,fractionalBox:Nt.create(f,b.add(b(),f,p))},cells:d,stats:{min:0,max:1,mean:0,sigma:1}},sourceData:zB.create(e),customProperties:new Sl,_propertyData:{ownerId:t?.ownerId}},nt.PickingGranularity.set(m,"object"),h=new Map,v=new Map,S=(g=e.segmentation_data_table).set_id,H=0,z=(y=g.segment_id).rowCount;HJ[3]&&(J[3]=x[0]),x[1]>J[4]&&(J[4]=x[1]),x[2]>J[5]&&(J[5]=x[2]));return X={},h.forEach(function(Y,k){X[k]=Nt.create(b.create(F,N,j),b.create(-1,-1,-1))}),Fs(U,function(Y,k){v.get(parseInt(k)).forEach(function(W){var $=X[W];Y[0]<$.min[0]&&($.min[0]=Y[0]),Y[1]<$.min[1]&&($.min[1]=Y[1]),Y[2]<$.min[2]&&($.min[2]=Y[2]),Y[3]>$.max[0]&&($.max[0]=Y[3]),Y[4]>$.max[1]&&($.max[1]=Y[4]),Y[5]>$.max[2]&&($.max[2]=Y[5])})}),nt.Segmentation.set(m,{segments:h,sets:v,bounds:X,labels:null!==(Z=t?.segmentLabels)&&void 0!==Z?Z:{}}),[2,m]})})})}!function(e){e.is=function t(n){return"ccp4"===n?.kind},e.create=function r(n){return{kind:"ccp4",name:n.name,data:n}}}(UB||(UB={})),function(e){e.is=function t(n){return"dsn6"===n?.kind},e.create=function r(n){return{kind:"dsn6",name:n.name,data:n}}}(VB||(VB={})),function(e){e.is=function t(n){return"dx"===n?.kind},e.create=function r(n){return{kind:"dx",name:n.name,data:n}}}(GB||(GB={})),function(e){e.is=function t(n){return"segcif"===n?.kind},e.create=function r(n){return{kind:"segcif",name:n._name,data:n}}}(zB||(zB={}));var Wze=Bt.BuiltIn({name:"volume-from-ccp4",display:{name:"Volume from CCP4/MRC/MAP",description:"Create Volume from CCP4/MRC/MAP data"},from:ve.Format.Ccp4,to:ve.Volume.Data,params:function(e){return{voxelSize:T.Vec3(b.create(1,1,1)),offset:T.Vec3(b.create(0,0,0)),entryId:T.Text("")}}})({apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Create volume from CCP4/MRC/MAP",function(a){return ue(t,void 0,void 0,function(){var i,o;return ce(this,function(s){switch(s.label){case 0:return[4,zze(r.data,R(R({},n),{label:r.data.name||r.label})).runInContext(a)];case 1:return i=s.sent(),o={label:i.label||"Volume",description:"Volume ".concat(r.data.header.NX,"\xd7").concat(r.data.header.NX,"\xd7").concat(r.data.header.NX)},[2,new ve.Volume.Data(i,o)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),Yze=Bt.BuiltIn({name:"volume-from-dsn6",display:{name:"Volume from DSN6/BRIX",description:"Create Volume from DSN6/BRIX data"},from:ve.Format.Dsn6,to:ve.Volume.Data,params:function(e){return{voxelSize:T.Vec3(b.create(1,1,1)),entryId:T.Text("")}}})({apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Create volume from DSN6/BRIX",function(a){return ue(t,void 0,void 0,function(){var i,o;return ce(this,function(s){switch(s.label){case 0:return[4,Hze(r.data,R(R({},n),{label:r.data.name||r.label})).runInContext(a)];case 1:return i=s.sent(),o={label:i.label||"Volume",description:"Volume ".concat(r.data.header.xExtent,"\xd7").concat(r.data.header.yExtent,"\xd7").concat(r.data.header.zExtent)},[2,new ve.Volume.Data(i,o)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),Xze=Bt.BuiltIn({name:"volume-from-cube",display:{name:"Volume from Cube",description:"Create Volume from Cube data"},from:ve.Format.Cube,to:ve.Volume.Data,params:function(e){return{dataIndex:e?T.Select(0,e.data.header.dataSetIds.map(function(r,n){return[n,"".concat(r)]})):T.Numeric(0),entryId:T.Text("")}}})({apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Create volume from Cube",function(a){return ue(t,void 0,void 0,function(){var i,o;return ce(this,function(s){switch(s.label){case 0:return[4,YFe(r.data,R(R({},n),{label:r.data.name||r.label})).runInContext(a)];case 1:return i=s.sent(),o={label:i.label||"Volume",description:"Volume ".concat(r.data.header.dim[0],"\xd7").concat(r.data.header.dim[1],"\xd7").concat(r.data.header.dim[2])},[2,new ve.Volume.Data(i,o)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),Kze=Bt.BuiltIn({name:"volume-from-dx",display:{name:"Parse DX",description:"Create volume from DX data."},from:ve.Format.Dx,to:ve.Volume.Data})({apply:function(e){var t=this,r=e.a;return Ve.create("Parse DX",function(n){return ue(t,void 0,void 0,function(){var a,i;return ce(this,function(o){switch(o.label){case 0:return[4,jze(r.data,{label:r.data.name||r.label}).runInContext(n)];case 1:return a=o.sent(),i={label:a.label||"Volume",description:"Volume ".concat(r.data.header.dim[0],"\xd7").concat(r.data.header.dim[1],"\xd7").concat(r.data.header.dim[2])},[2,new ve.Volume.Data(a,i)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),Zze=Bt.BuiltIn({name:"volume-from-density-server-cif",display:{name:"Volume from density-server CIF",description:"Identify and create all separate models in the specified CIF data block"},from:ve.Format.Cif,to:ve.Volume.Data,params:function(e){if(!e)return{blockHeader:T.Optional(T.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),entryId:T.Text("")};var t=e.data.blocks.slice(1);return{blockHeader:T.Optional(T.Select(t[0]&&t[0].header,t.map(function(r){return[r.header,r.header]}),{description:"Header of the block to parse"})),entryId:T.Text("")}}})({isApplicable:function(e){return e.data.blocks.length>0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Parse density-server CIF",function(a){return ue(t,void 0,void 0,function(){var i,o,s,u,c,l,d,f,p,m;return ce(this,function(h){switch(h.label){case 0:if(i=n.blockHeader||r.data.blocks[1].header,!(o=r.data.blocks.find(function(v){return v.header===i})))throw new Error("Data block '".concat([i],"' not found."));return[4,FK(s=hl.schema.densityServer(o),{entryId:n.entryId}).runInContext(a)];case 1:return u=h.sent(),l=(c=u.grid.cells.space.dimensions)[0],d=c[1],f=c[2],p={label:null!==(m=n.entryId)&&void 0!==m?m:s.volume_data_3d_info.name.value(0),description:"Volume ".concat(l,"\xd7").concat(d,"\xd7").concat(f)},[2,new ve.Volume.Data(u,p)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),Qze=Bt.BuiltIn({name:"volume-from-segmentation-cif",display:{name:"Volume from Segmentation CIF"},from:ve.Format.Cif,to:ve.Volume.Data,params:function(e){var t=e?.data.blocks.slice(1);return{blockHeader:T.Optional(t?T.Select(t[0]&&t[0].header,t.map(function(n){return[n.header,n.header]}),{description:"Header of the block to parse"}):T.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),segmentLabels:T.ObjectList({id:T.Numeric(-1),label:T.Text("")},function(n){return"".concat(n.id," = ").concat(n.label)},{description:"Mapping of segment IDs to segment labels"}),ownerId:T.Text("",{isHidden:!0,description:"Reference to the object which manages this volume"})}}})({isApplicable:function(e){return e.data.blocks.length>0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Parse segmentation CIF",function(a){return ue(t,void 0,void 0,function(){var i,o,s,u,c,l,d,f,p,m,h,v,g;return ce(this,function(y){switch(y.label){case 0:if(i=n.blockHeader||r.data.blocks[1].header,!(o=r.data.blocks.find(function(S){return S.header===i})))throw new Error("Data block '".concat([i],"' not found."));for(s=hl.schema.segmentation(o),u={},c=0,l=n.segmentLabels;c0?a[c[0]].component.color:dT};r=function(s,u){return u?15854817:at.is(s)?o(s.unit,s.element):zt.isLocation(s)?o(s.aUnit,s.aUnit.elements[s.aIndex]):dT}}else r=function(){return dT};return{factory:eJ,granularity:"group",color:r,props:t,description:"Assigns colors according to the Symbol Nomenclature for Glycans (SNFG).",legend:sm(uBe)}},getParams:function eHe(e){return J$},defaultValues:T.getDefaultValues(J$),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return ar.hasCarbohydrate(t)})}},tJ={hue:T.Interval([1,360],{min:0,max:360,step:1}),chroma:T.Interval([40,70],{min:0,max:100,step:1}),luminance:T.Interval([15,85],{min:0,max:100,step:1}),sort:T.Select("contrast",T.arrayToOptions(["none","contrast"]),{description:"no sorting leaves colors approximately ordered by hue"}),clusteringStepCount:T.Numeric(50,{min:10,max:200,step:1},{isHidden:!0}),minSampleCount:T.Numeric(800,{min:100,max:5e3,step:100},{isHidden:!0}),sampleCountFactor:T.Numeric(5,{min:1,max:100,step:1},{isHidden:!0})},my=2,pv=[0,0,0],mv=[0,0,0];function rHe(e,t){return Ii.toHcl(pv,e),Ii.fromColor(mv,Ii.toColor(e)),pv[0]>=t.hue[0]&&pv[0]<=t.hue[1]&&pv[1]>=t.chroma[0]&&pv[1]<=t.chroma[1]&&pv[2]>=t.luminance[0]&&pv[2]<=t.luminance[1]&&mv[0]>=e[0]-my&&mv[0]<=e[0]+my&&mv[1]>=e[1]-my&&mv[1]<=e[1]+my&&mv[2]>=e[2]-my&&mv[2]<=e[2]+my}function rJ(e,t){for(var r=1/0,n=0,a=0;a=e));s+=o);for(var u=1;u<=r.clusteringStepCount;++u){var c=fl(i),l=fl(n);for(s=0;s0;){for(var n=r[r.length-1],a=0,i=Number.NEGATIVE_INFINITY,o=0;oi&&(i=s,a=o)}r.push(t.splice(a,1)[0])}return r}(a):a;return A.map(function(E){return Ii.toColor(E)})}(e,t.palette.params));for(var m=null!==(n=r.valueLabel)&&void 0!==n?n:aJ.valueLabel,h=p.length,v=[],g=0;g1?sJ(e.unit.model,r):r}function sJ(e,t){return"".concat(t,"|").concat((ar.Index.get(e).value||0)+1)}function C2(e,t){var r,n;if(e.structure){var a=at.create(e.structure.root),i=function lHe(e,t){for(var r=new Map,n=function(s){var u=ar.AsymIdOffset.get(s).value,c=("auth"===t?u?.auth:u?.label)||0,l=0;s.properties.structAsymMap.forEach(function(d,f){var m="auth"===t?d.auth_id:f,h=e.models.length>1?sJ(s,m):m;r.has(h)||(r.set(h,l+c),++l)})},a=0,i=e.models;aru[WB].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:pf(WB).list}})),t},defaultValues:T.getDefaultValues(A2),isApplicable:function(e){return!!e.structure}},gJ=dt(13421772),EHe="Gives every model a unique color based on its index.",D2=R({},ls({type:"colors",colorList:"many-distinct"}));function E2(e,t){var r,n,a;if(e.structure){var o=Vs((null!==(r=ar.MaxIndex.get(e.structure.models[0]).value)&&void 0!==r?r:-1)+1,t);a=o.legend,n=function(s){return at.is(s)?o.color(ar.Index.get(s.unit.model).value||0):zt.isLocation(s)?o.color(ar.Index.get(s.aUnit.model).value||0):gJ}}else n=function(){return gJ};return{factory:E2,granularity:"instance",color:n,props:t,description:EHe,legend:a}}var PHe={name:"model-index",label:"Model Index",category:Xn.Chain,factory:E2,getParams:function IHe(e){return T.clone(D2)},defaultValues:T.getDefaultValues(D2),isApplicable:function(e){return!!e.structure&&e.structure.elementCount>0}},yJ=dt(13421772),MHe="Gives every structure a unique color based on its index.",I2=R({},ls({type:"colors",colorList:"many-distinct"}));function P2(e,t){var r,n,a;if(e.structure){var o=Vs((null!==(r=Ze.MaxIndex.get(e.structure).value)&&void 0!==r?r:-1)+1,t);a=o.legend,n=function(s){return at.is(s)?o.color(Ze.Index.get(s.structure).value||0):zt.isLocation(s)?o.color(Ze.Index.get(s.aStructure).value||0):yJ}}else n=function(){return yJ};return{factory:P2,granularity:"instance",color:n,props:t,description:MHe,legend:a}}var OHe={name:"structure-index",label:"Structure Index",category:Xn.Chain,factory:P2,getParams:function RHe(e){return T.clone(I2)},defaultValues:T.getDefaultValues(I2),isApplicable:function(e){return!!e.structure&&e.structure.elementCount>0}},XB="dark-2",bJ=dt(13421772),FHe="Gives every chain instance (single chain or collection of single elements) a unique color based on the position (index) of the chain in the list of chains in the structure.",KB=R({},ls({type:"colors",colorList:XB}));function ZB(e,t){var r,n;if(e.structure){var a=e.structure.root.units,i=Vs(a.length,t);n=i.legend;for(var o=new Map,s=0,u=a.length;sru[XB].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:pf(XB).list}})),t},defaultValues:T.getDefaultValues(KB),isApplicable:function(e){return!!e.structure}},SJ={H:16777215,D:16777152,T:16777120,HE:14286847,LI:13402367,BE:12779264,B:16758197,C:9474192,N:3166456,O:16715021,F:9494608,NE:11789301,NA:11230450,MG:9109248,AL:12560038,SI:1578e4,P:16744448,S:16777008,CL:2093087,AR:8442339,K:9388244,CA:4062976,SC:15132390,TI:12567239,V:10921643,CR:9083335,MN:10255047,FE:14706227,CO:15765664,NI:5296208,CU:13140019,ZN:8224944,GA:12750735,GE:6721423,AS:12419299,SE:16752896,BR:10889513,KR:6076625,RB:7351984,SR:65280,Y:9764863,ZR:9756896,NB:7586505,MO:5551541,TC:3907230,RU:2396047,RH:687500,PD:27013,AG:12632256,CD:16767375,IN:10909043,SN:6717568,SB:10380213,TE:13924864,I:9699476,XE:9699476,CS:5707663,BA:51456,LA:7394559,CE:16777159,PR:14286791,ND:13107143,PM:10747847,SM:9437127,EU:6422471,GD:4587463,TB:3211207,DY:2097095,HO:65436,ER:58997,TM:54354,YB:48952,LU:43812,HF:5096191,TA:5089023,W:2200790,RE:2522539,OS:2516630,IR:1528967,PT:13684960,AU:16765219,HG:12105936,TL:10900557,PB:5724513,BI:10375093,PO:11230208,AT:7688005,RN:4358806,FR:4325478,RA:32e3,AC:7384058,TH:47871,PA:41471,U:36863,NP:33023,PU:27647,AM:5528818,CM:7888099,BK:9064419,CF:10565332,ES:11739092,FM:11739066,MD:11734438,NO:12389767,LR:13041766,RF:13369433,DB:13697103,SG:14221381,BH:14680120,HS:15073326,MT:15400998,DS:16777215,RG:16777215,CN:16777215,UUT:16777215,FL:16777215,UUP:16777215,LV:16777215,UUH:16777215},CJ=dt(16777215),QB={carbonColor:T.MappedStatic("chain-id",{"chain-id":T.Group(S2),"unit-index":T.Group(KB,{label:"Chain Instance"}),"entity-id":T.Group(x2),"entity-source":T.Group(A2),"operator-name":T.Group(HB),"model-index":T.Group(D2),"structure-index":T.Group(I2),uniform:T.Group(z0),"element-symbol":T.EmptyGroup()},{description:"Use chain-id coloring for carbon atoms."}),saturation:T.Numeric(0,{min:-6,max:6,step:.1}),lightness:T.Numeric(.2,{min:-6,max:6,step:.1}),colors:T.MappedStatic("default",{default:T.EmptyGroup(),custom:T.Group(fT(SJ))})};function $B(e,t){var r,n=vw("default"===t.colors.name?SJ:t.colors.params,t.saturation,t.lightness),a=null===(r=function VHe(e,t){switch(t.name){case"chain-id":return C2(e,t.params);case"unit-index":return ZB(e,t.params);case"entity-id":return w2(e,t.params);case"entity-source":return T2(e,t.params);case"operator-name":return jB(e,t.params);case"model-index":return E2(e,t.params);case"structure-index":return P2(e,t.params);case"uniform":return Kh(0,t.params);case"element-symbol":return;default:Sn()}}(e,t.carbonColor))||void 0===r?void 0:r.color;function i(u,c){return a&&"C"===u?a(c,!1):function UHe(e,t){var r=e[t];return void 0===r?CJ:r}(n,u)}return{factory:$B,granularity:"operator-name"===t.carbonColor.name||"unit-index"===t.carbonColor.name?"groupInstance":"group",preferSmoothing:!0,color:function o(u){if(at.is(u)){if(Fe.isAtomic(u.unit))return i(u.unit.model.atomicHierarchy.atoms.type_symbol.value(u.element),u)}else if(zt.isLocation(u)&&Fe.isAtomic(u.aUnit))return i(u.aUnit.model.atomicHierarchy.atoms.type_symbol.value(u.aUnit.elements[u.aIndex]),u);return CJ},props:t,description:"Assigns a color to every atom according to its chemical element.",legend:sm(Object.keys(n).map(function(u){return[u,n[u]]}))}}var GHe={name:"element-symbol",label:"Element Symbol",category:Xn.Atom,factory:$B,getParams:function LHe(e){return T.clone(QB)},defaultValues:T.getDefaultValues(QB),isApplicable:function(e){return!!e.structure}},xJ={water:3697840,ion:15729279,protein:12496596,RNA:16629894,DNA:12540695,PNA:4367514,saccharide:8374655},JB=dt(16777113),mT={saturation:T.Numeric(0,{min:-6,max:6,step:.1}),lightness:T.Numeric(0,{min:-6,max:6,step:.1}),colors:T.MappedStatic("default",{default:T.EmptyGroup(),custom:T.Group(fT(xJ))})};function _J(e,t,r){switch(N4(t,r)){case 2:return e.water;case 3:return e.ion;case 5:return e.protein;case 6:return e.RNA;case 7:return e.DNA;case 8:return e.PNA;case 9:return e.saccharide}return JB}function hT(e,t){var r=vw("default"===t.colors.name?xJ:t.colors.params,t.saturation,t.lightness);return{factory:hT,granularity:"group",color:function n(a){return at.is(a)?_J(r,a.unit,a.element):zt.isLocation(a)?_J(r,a.aUnit,a.aUnit.elements[a.aIndex]):JB},props:t,description:"Assigns a color based on the molecule type of a residue.",legend:sm(Object.keys(r).map(function(a){return[a,r[a]]}).concat([["Other/unknown",JB]]))}}var jHe={name:"molecule-type",label:"Molecule Type",category:Xn.Residue,factory:hT,getParams:function HHe(e){return mT},defaultValues:T.getDefaultValues(mT),isApplicable:function(e){return!!e.structure}},eN="dark-2",wJ=dt(16448250),AJ=R({},ls({type:"colors",colorList:eN}));function TJ(e){switch(e.kind){case 0:return ot.chain.label_asym_id;case 1:case 2:return ot.coarse.asym_id}}function DJ(e){for(var t=new Map,r=0,n=e.unitSymmetryGroups.length;rru[eN].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:pf(eN).list}})),t},defaultValues:T.getDefaultValues(AJ),isApplicable:function(e){return!!e.structure}},tN="dark-2",IJ=dt(13421772),PJ=R({},ls({type:"colors",colorList:tN}));function MJ(e){for(var t=0,r=e.units,n=0,a=r.length;n0&&++t;return t}var ZHe={name:"polymer-index",label:"Polymer Chain Instance",category:Xn.Chain,factory:function RJ(e,t){var r,n;if(e.structure){var a=Vs(MJ(e.structure.root),t);n=a.legend;for(var i=e.structure.root.units,o=new Map,s=0,u=0,c=i.length;s0&&(o.set(i[s].id,a.color(u)),++u);r=function(l){var d;return at.is(l)?d=o.get(l.unit.id):zt.isLocation(l)&&(d=o.get(l.aUnit.id)),void 0!==d?d:IJ}}else r=function(){return IJ};return{factory:RJ,granularity:"instance",color:r,props:t,description:"Gives every polymer chain instance a unique color based on the position (index) of the polymer in the list of polymers in the structure.",legend:n}},getParams:function KHe(e){var t=T.clone(PJ);return e.structure&&MJ(e.structure.root)>ru[tN].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:pf(tN).list}})),t},defaultValues:T.getDefaultValues(PJ),isApplicable:function(e){return!!e.structure}},OJ={ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:15658734,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,A:14423100,G:3329330,I:10145074,C:16766720,T:4286945,U:4251856,DA:14423100,DG:3329330,DI:10145074,DC:16766720,DT:4286945,DU:4251856,APN:14423100,GPN:3329330,CPN:16766720,TPN:4286945},rN=dt(16711935),nN={saturation:T.Numeric(0,{min:-6,max:6,step:.1}),lightness:T.Numeric(1,{min:-6,max:6,step:.1}),colors:T.MappedStatic("default",{default:T.EmptyGroup(),custom:T.Group(fT(OJ))})};function FJ(e,t){return e.model.atomicHierarchy.atoms.label_comp_id.value(t)}function BJ(e,t){var r=e.coarseElements.seq_id_begin.value(t);if(r===e.coarseElements.seq_id_end.value(t))return e.model.sequence.byEntityKey[e.coarseElements.entityKey[t]].sequence.compId.value(r-1)}function vT(e,t){var r=e[t];return void 0===r?rN:r}function aN(e,t){var r=vw("default"===t.colors.name?OJ:t.colors.params,t.saturation,t.lightness);return{factory:aN,granularity:"group",preferSmoothing:!0,color:function n(a){if(at.is(a)){if(Fe.isAtomic(a.unit)){var i=FJ(a.unit,a.element);return vT(r,i)}if(i=BJ(a.unit,a.element))return vT(r,i)}else if(zt.isLocation(a)){if(Fe.isAtomic(a.aUnit))return i=FJ(a.aUnit,a.aUnit.elements[a.aIndex]),vT(r,i);if(i=BJ(a.aUnit,a.aUnit.elements[a.aIndex]))return vT(r,i)}return rN},props:t,description:"Assigns a color to every residue according to its name.",legend:sm(Object.keys(r).map(function(a){return[a,r[a]]}).concat([["Unknown",rN]]))}}var JHe={name:"residue-name",label:"Residue Name",category:Xn.Residue,factory:aN,getParams:function $He(e){return nN},defaultValues:T.getDefaultValues(nN),isApplicable:function(e){return!!e.structure}},NJ={alphaHelix:16711808,threeTenHelix:10485888,piHelix:6291584,betaTurn:6324479,betaStrand:16762880,coil:16777215,bend:6740169,turn:45670,dna:11403518,rna:16580962,carbohydrate:10921722},iN=dt(8421504),oN={saturation:T.Numeric(-1,{min:-6,max:6,step:.1}),lightness:T.Numeric(0,{min:-6,max:6,step:.1}),colors:T.MappedStatic("default",{default:T.EmptyGroup(),custom:T.Group(fT(NJ))})};function kJ(e,t,r,n){var a=sn.create(0);if(n&&Fe.isAtomic(t)){var i=n.get(t.invariantId);i&&(a=i.type[i.getIndex(t.residueIndex[r])])}if(sn.is(a,2))return sn.is(a,2048)?e.threeTenHelix:sn.is(a,32768)?e.piHelix:e.alphaHelix;if(sn.is(a,4))return e.betaStrand;if(sn.is(a,8))return e.bend;if(sn.is(a,16))return e.turn;var o=N4(t,r);return 7===o?e.dna:6===o?e.rna:9===o?e.carbohydrate:5===o?e.coil:iN}function sN(e,t){var r=e.structure&&Oc.get(e.structure),n=r?Oh(r.id,r.version):-1,a=vw("default"===t.colors.name?NJ:t.colors.params,t.saturation,t.lightness);return{factory:sN,granularity:"group",preferSmoothing:!0,color:function i(o){return at.is(o)?kJ(a,o.unit,o.element,r?.value):zt.isLocation(o)?kJ(a,o.aUnit,o.aUnit.elements[o.aIndex],r?.value):iN},props:t,contextHash:n,description:"Assigns a color based on the type of secondary structure and basic molecule type.",legend:sm(Object.keys(a).map(function(o){return[o,a[o]]}).concat([["Other",iN]]))}}var r7e={name:"secondary-structure",label:"Secondary Structure",category:Xn.Residue,factory:sN,getParams:function t7e(e){return oN},defaultValues:T.getDefaultValues(oN),isApplicable:function(e){return!!e.structure},ensureCustomProperties:{attach:function(e,t){return t.structure?Oc.attach(e,t.structure,void 0,!0):Promise.resolve()},detach:function(e){return e.structure&&Oc.ref(e.structure,!1)}}},n7e=dt(13421772),LJ={list:T.ColorList("turbo",{presetKind:"scale"})};function UJ(e,t){var r=e.model;switch(e.kind){case 0:return r.atomicHierarchy.residues.label_seq_id.value(r.atomicHierarchy.residueAtomSegments.index[t]);case 1:return Math.round((r.coarseHierarchy.spheres.seq_id_begin.value(t)+r.coarseHierarchy.spheres.seq_id_end.value(t))/2);case 2:return Math.round((r.coarseHierarchy.gaussians.seq_id_begin.value(t)+r.coarseHierarchy.gaussians.seq_id_end.value(t))/2)}}function VJ(e,t){var r=e.model,n="";switch(e.kind){case 0:n=r.atomicHierarchy.chains.label_entity_id.value(r.atomicHierarchy.chainAtomSegments.index[t]);break;case 1:n=r.coarseHierarchy.spheres.entity_id.value(t);break;case 2:n=r.coarseHierarchy.gaussians.entity_id.value(t)}if(""===n)return 0;var i=r.entities.getEntityIndex(n);if(-1===i)return 0;var o=r.sequence.byEntityKey[i];return void 0===o?0:o.sequence.length}var o7e={name:"sequence-id",label:"Sequence Id",category:Xn.Residue,factory:function GJ(e,t){var r=_c.create({listOrName:t.list.colors,minLabel:"Start",maxLabel:"End"});return{factory:GJ,granularity:"group",preferSmoothing:!0,color:function(a){if(at.is(a)){var i=a.unit,o=a.element;if((s=UJ(i,o))>0&&(u=VJ(i,o)))return r.setDomain(0,u-1),r.color(s)}else if(zt.isLocation(a)){var s,u,c=a.aUnit,l=a.aIndex;if((s=UJ(c,c.elements[l]))>0&&(u=VJ(c,c.elements[l])))return r.setDomain(0,u-1),r.color(s)}return n7e},props:t,description:"Gives every polymer residue a color based on its `seq_id` value.",legend:r?r.legend:void 0}},getParams:function i7e(e){return LJ},defaultValues:T.getDefaultValues(LJ),isApplicable:function(e){return!!e.structure}},s7e=dt(16777113),zJ={domain:T.Interval([0,100]),list:T.ColorList("red-white-blue",{presetKind:"scale"})};function HJ(e,t){return Fe.isAtomic(e)?e.model.atomicConformation.B_iso_or_equiv.value(t):Fe.isSpheres(e)?e.model.coarseConformation.spheres.rmsf[t]:0}var l7e={name:"uncertainty",label:"Uncertainty/Disorder",category:Xn.Atom,factory:function jJ(e,t){var r=_c.create({reverse:!0,domain:t.domain,listOrName:t.list.colors});return{factory:jJ,granularity:"group",preferSmoothing:!0,color:function n(a){return at.is(a)?r.color(HJ(a.unit,a.element)):zt.isLocation(a)?r.color(HJ(a.aUnit,a.aUnit.elements[a.aIndex])):s7e},props:t,description:"Assigns a color based on the uncertainty or disorder of an element's position, e.g. B-factor or RMSF, depending on the data availability and experimental technique.",legend:r?r.legend:void 0}},getParams:function c7e(e){return zJ},defaultValues:T.getDefaultValues(zJ),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return t.atomicConformation.B_iso_or_equiv.isDefined||t.coarseHierarchy.isDefined})}},d7e=dt(15658734),qJ={style:T.MappedStatic("entity-id",{uniform:T.Group(z0),"chain-id":T.Group(S2),"entity-id":T.Group(x2),"entity-source":T.Group(A2),"molecule-type":T.Group(mT),"model-index":T.Group(D2),"structure-index":T.Group(I2)}),carbonLightness:T.Numeric(.8,{min:-6,max:6,step:.1})},h7e={name:"illustrative",label:"Illustrative",category:Xn.Misc,factory:function WJ(e,t){var r=function m7e(e,t){switch(t.name){case"uniform":return Kh(0,t.params);case"chain-id":return C2(e,t.params);case"entity-id":return w2(e,t.params);case"entity-source":return T2(e,t.params);case"molecule-type":return hT(0,t.params);case"model-index":return E2(e,t.params);case"structure-index":return P2(e,t.params);default:Sn()}}(e,t.style),n=r.color;function i(s,u){var c=n(s,!1);return"C"===u?dt.lighten(c,t.carbonLightness):c}return{factory:WJ,granularity:"group",preferSmoothing:!0,color:function o(s){if(at.is(s)&&Fe.isAtomic(s.unit)){var u=s.unit.model.atomicHierarchy.atoms.type_symbol.value(s.element);return i(s,u)}return zt.isLocation(s)&&Fe.isAtomic(s.aUnit)?(u=s.aUnit.model.atomicHierarchy.atoms.type_symbol.value(s.aUnit.elements[s.aIndex]),i(s,u)):d7e},props:t,description:"Assigns an illustrative color that gives every chain a color based on the chosen style but with lighter carbons (inspired by David Goodsell's Molecule of the Month style).",legend:r.legend}},getParams:function p7e(e){return T.clone(qJ)},defaultValues:T.getDefaultValues(qJ),isApplicable:function(e){return!!e.structure}},YJ={list:T.ColorList("red-yellow-green",{presetKind:"scale"}),scale:T.Select("DGwif",[["DGwif","DG water-membrane"],["DGwoct","DG water-octanol"],["Oct-IF","DG difference"]])},y7e={DGwif:0,DGwoct:1,"Oct-IF":2};function XJ(e,t){return e.model.atomicHierarchy.atoms.label_comp_id.value(t)}function KJ(e,t){var r=e.coarseElements.seq_id_begin.value(t);if(r===e.coarseElements.seq_id_end.value(t))return e.model.sequence.byEntityKey[e.coarseElements.entityKey[t]].sequence.compId.value(r-1)}var S7e={name:"hydrophobicity",label:"Hydrophobicity",category:Xn.Residue,factory:function ZJ(e,t){var r=y7e[t.scale],n=1/0,a=-1/0;for(var i in w4){var o=w4[i][r];n=Math.min(n,o),a=Math.max(a,o)}var s=_c.create({listOrName:t.list.colors,domain:[a,n],minLabel:"Hydrophilic",maxLabel:"Hydrophobic"});return{factory:ZJ,granularity:"group",preferSmoothing:!0,color:function u(c){var l;return at.is(c)?l=Fe.isAtomic(c.unit)?XJ(c.unit,c.element):KJ(c.unit,c.element):zt.isLocation(c)&&(l=Fe.isAtomic(c.aUnit)?XJ(c.aUnit,c.aUnit.elements[c.aIndex]):KJ(c.aUnit,c.aUnit.elements[c.aIndex])),s.color(l?function b7e(e,t){var r=w4[e];return void 0===r?0:r[t]}(l,r):0)},props:t,description:'Assigns a color to every amino acid according to the "Experimentally determined hydrophobicity scale for proteins at membrane interfaces" by Wimely and White (doi:10.1038/nsb1096-842).',legend:s?s.legend:void 0}},getParams:function g7e(e){return YJ},defaultValues:T.getDefaultValues(YJ),isApplicable:function(e){return!!e.structure}},QJ=dt(13421772),$J=R({},ls({type:"colors",colorList:"purples"})),_7e={name:"trajectory-index",label:"Trajectory Index",category:Xn.Chain,factory:function JJ(e,t){var r,n,a,i;if(e.structure){for(var o=e.structure.root.models,s=0,u=0,c=o;u0&&ar.TrajectoryInfo.get(e.structure.models[0]).size>1}},w7e=dt(13421772),eee={domain:T.Interval([0,1]),list:T.ColorList("purples",{presetKind:"scale"})};function tee(e,t){return Fe.isAtomic(e)?e.model.atomicConformation.occupancy.value(t):0}var D7e={name:"occupancy",label:"Occupancy",category:Xn.Atom,factory:function ree(e,t){var r=_c.create({reverse:!1,domain:t.domain,listOrName:t.list.colors});return{factory:ree,granularity:"group",preferSmoothing:!0,color:function n(a){return at.is(a)?r.color(tee(a.unit,a.element)):zt.isLocation(a)?r.color(tee(a.aUnit,a.aUnit.elements[a.aIndex])):w7e},props:t,description:"Assigns a color based on the occupancy of an atom.",legend:r?r.legend:void 0}},getParams:function T7e(e){return eee},defaultValues:T.getDefaultValues(eee),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return t.atomicConformation.occupancy.isDefined})}},uN="dark-2",nee=dt(13421772),aee=R({},ls({type:"colors",colorList:uN})),M2=1e4;function cN(e){return e.map(function(t){return"".concat(t+M2).padStart(5,"0")}).join("")}function lN(e){var t=function tDe(e,t){return Math.abs(e)ru[uN].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:pf(uN).list}})),t},defaultValues:T.getDefaultValues(aee),isApplicable:function(e){return!!e.structure}},fN=dt(16777113),see={domain:T.Interval([-1,1]),list:T.ColorList("red-white-blue",{presetKind:"scale"})};function uee(e,t){var r;return null===(r=oy.Provider.get(e.model))||void 0===r?void 0:r.data.value(t)}var hu,O7e={name:"partial-charge",label:"Partial Charge",category:Xn.Atom,factory:function cee(e,t){var r=_c.create({domain:t.domain,listOrName:t.list.colors});return{factory:cee,granularity:"group",preferSmoothing:!0,color:function n(a){var i;return at.is(a)?void 0!==(i=uee(a.unit,a.element))?r.color(i):fN:zt.isLocation(a)&&void 0!==(i=uee(a.aUnit,a.aUnit.elements[a.aIndex]))?r.color(i):fN},props:t,description:"Assigns a color based on the partial charge of an atom.",legend:r?r.legend:void 0}},getParams:function R7e(e){return see},defaultValues:T.getDefaultValues(see),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return void 0!==oy.Provider.get(t)})}},lee=dt(16448250),dee=R({},ls({type:"colors",colorList:"many-distinct"})),L7e={name:"atom-id",label:"Atom Id",category:Xn.Atom,factory:function fee(e,t){var r,n;if(e.structure){var a=at.create(e.structure.root),i=function k7e(e){for(var t=new Map,r=0,n=e.models;r"]})},function(e,t){return t(e)}),coloring:T.MappedStatic("absolute-value",{"absolute-value":T.Group({domain:T.MappedStatic("auto",{custom:T.Interval([-1,1]),auto:T.Group({symmetric:T.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:T.ColorList("red-white-blue",{presetKind:"scale"})}),"relative-value":T.Group({domain:T.MappedStatic("auto",{custom:T.Interval([-1,1]),auto:T.Group({symmetric:T.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:T.ColorList("red-white-blue",{presetKind:"scale"})})}),defaultColor:T.Color(dt(13421772))},W7e={name:"external-volume",label:"External Volume",category:Xn.Misc,factory:function bee(e,t){var r,n;try{r=t.volume.getValue()}catch{}if(r){var a=t.coloring.params,i=r.grid.stats,o="custom"===a.domain.name?a.domain.params:[i.min,i.max],s="relative-value"===t.coloring.name;if("auto"===a.domain.name&&s&&(o[0]=(o[0]-i.mean)/i.sigma,o[1]=(o[1]-i.mean)/i.sigma),"auto"===t.coloring.params.domain.name&&t.coloring.params.domain.params.symmetric){var u=Math.max(Math.abs(o[0]),Math.abs(o[1]));o[0]=-u,o[1]=u}var c=_c.create({domain:o,listOrName:a.list.colors}),l=Ri.getGridToCartesianTransform(r.grid);he.invert(l,l);var d=b(),f=r.grid.cells.space,p=f.dimensions,m=f.get,h=r.grid.cells.data,v=p[0],g=p[1],y=p[2];n=function(S){if(!function APe(e){return!!e&&"position-location"===e.kind}(S))return t.defaultColor;b.copy(d,S.position),b.transformMat4(d,d,l);var C=Math.floor(d[0]),_=Math.floor(d[1]),x=Math.floor(d[2]);if(C<0||C>=v||_<0||_>=g||x<0||x>=y)return t.defaultColor;var D=d[0]-C,w=d[1]-_,A=d[2]-x,E=Math.min(C+1,v-1),I=Math.min(_+1,g-1),M=Math.min(x+1,y-1),F=m(h,C,_,x),N=m(h,E,_,x),j=m(h,C,I,x),U=m(h,E,I,x),H=ta(ta(F,N,D),ta(j,U,D),w);F=m(h,C,_,M),N=m(h,E,_,M),j=m(h,C,I,M),U=m(h,E,I,M);var z=ta(ta(F,N,D),ta(j,U,D),w),G=ta(H,z,A);return s&&(G=(G-i.mean)/i.sigma),c.color(G)}}else n=function(){return t.defaultColor};return{factory:bee,granularity:"vertex",preferSmoothing:!0,color:n,props:t,description:"Assigns a color based volume value at a given vertex."}},getParams:function(){return yee},defaultValues:T.getDefaultValues(yee),isApplicable:function(e){return!0}},See={mainchain:T.MappedStatic("molecule-type",{uniform:T.Group(z0),"chain-id":T.Group(S2),"entity-id":T.Group(x2),"entity-source":T.Group(A2),"molecule-type":T.Group(mT),"model-index":T.Group(D2),"structure-index":T.Group(I2),"secondary-structure":T.Group(oN)}),sidechain:T.MappedStatic("residue-name",{uniform:T.Group(z0),"residue-name":T.Group(nN),"element-symbol":T.Group(QB)})},Q7e={name:"cartoon",label:"Cartoon",category:Xn.Misc,factory:function Cee(e,t){var r,n,a=function K7e(e,t){switch(t.name){case"uniform":return Kh(0,t.params);case"chain-id":return C2(e,t.params);case"entity-id":return w2(e,t.params);case"entity-source":return T2(e,t.params);case"molecule-type":return hT(0,t.params);case"model-index":return E2(e,t.params);case"structure-index":return P2(e,t.params);case"secondary-structure":return sN(e,t.params);default:Sn()}}(e,t.mainchain),i=function Z7e(e,t){switch(t.name){case"uniform":return Kh(0,t.params);case"residue-name":return aN(0,t.params);case"element-symbol":return $B(e,t.params);default:Sn()}}(e,t.sidechain),s=a.legend;return"table-legend"===(null===(r=a.legend)||void 0===r?void 0:r.kind)&&"table-legend"===(null===(n=i.legend)||void 0===n?void 0:n.kind)&&(s={kind:"table-legend",table:or(or([],a.legend.table,!0),i.legend.table,!0)}),{factory:Cee,granularity:"group",preferSmoothing:!1,color:function o(u,c){return c?a.color(u,!1):i.color(u,!1)},props:t,description:"Uses separate themes for coloring mainchain and sidechain visuals.",legend:s}},getParams:function X7e(e){return T.clone(See)},defaultValues:T.getDefaultValues(See),isApplicable:function(e){return!!e.structure}};!function(e){e.Category=Xn,e.PaletteScale=16777215,e.EmptyFactory=function(){return e.Empty};var t=dt(13421772);e.Empty={factory:e.EmptyFactory,granularity:"uniform",color:function(){return t},props:{}},e.areEqual=function r(a,i){return a.contextHash===i.contextHash&&a.factory===i.factory&&rd(a.props,i.props)},e.EmptyProvider={name:"",label:"",category:"",factory:e.EmptyFactory,getParams:function(){return{}},defaultValues:{},isApplicable:function(){return!0}},e.createRegistry=function n(){return new Eee(e.BuiltIn,e.EmptyProvider)},e.BuiltIn={"atom-id":L7e,"carbohydrate-symbol":tHe,cartoon:Q7e,"chain-id":uJ,"element-index":pHe,"element-symbol":GHe,"entity-id":xHe,"entity-source":DHe,hydrophobicity:S7e,illustrative:h7e,"model-index":PHe,"molecule-type":jHe,occupancy:D7e,"operator-hkl":P7e,"operator-name":qB,"partial-charge":O7e,"polymer-id":YHe,"polymer-index":ZHe,"residue-name":JHe,"secondary-structure":r7e,"sequence-id":o7e,"shape-group":T4e,"structure-index":OHe,"trajectory-index":_7e,uncertainty:l7e,"unit-index":NHe,uniform:XOe,"volume-segment":j7e,"volume-value":G7e,"external-volume":W7e}}(hu||(hu={}));var xee={scale:T.Numeric(1,{min:.1,max:5,step:.1})};function pN(e,t){return Fe.isAtomic(e)?n2(e.model.atomicHierarchy.atoms.type_symbol.value(t)):Fe.isSpheres(e)?e.model.coarseConformation.spheres.radius[t]:0}var t9e={name:"physical",label:"Physical",category:"",factory:function _ee(e,t){var r=void 0===t.scale?1:t.scale;return{factory:_ee,granularity:"group",size:function n(a){return at.is(a)?r*pN(a.unit,a.element):zt.isLocation(a)?r*Math.min(pN(a.aUnit,a.aUnit.elements[a.aIndex]),pN(a.bUnit,a.bUnit.elements[a.bIndex])):1*r},props:t,description:"Assigns a physical size, i.e. vdW radius for atoms or given radius for coarse spheres."}},getParams:function e9e(e){return xee},defaultValues:T.getDefaultValues(xee),isApplicable:function(e){return!!e.structure}},wee={bfactorFactor:T.Numeric(.1,{min:0,max:1,step:.01}),rmsfFactor:T.Numeric(.05,{min:0,max:1,step:.01}),baseSize:T.Numeric(.2,{min:0,max:2,step:.1})};function Aee(e,t,r){return Fe.isAtomic(e)?e.model.atomicConformation.B_iso_or_equiv.value(t)*r.bfactorFactor:Fe.isSpheres(e)?e.model.coarseConformation.spheres.rmsf[t]*r.rmsfFactor:0}var ki,_i,a9e={name:"uncertainty",label:"Uncertainty/Disorder",category:"",factory:function Tee(e,t){return{factory:Tee,granularity:"group",size:function r(n){var a=t.baseSize;return at.is(n)?a+=Aee(n.unit,n.element,t):zt.isLocation(n)&&(a+=Aee(n.aUnit,n.aUnit.elements[n.aIndex],t)),a},props:t,description:"Assigns a size reflecting the uncertainty or disorder of an element's position, e.g. B-factor or RMSF, depending on the data availability and experimental technique."}},getParams:function n9e(e){return wee},defaultValues:T.getDefaultValues(wee),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return t.atomicConformation.B_iso_or_equiv.isDefined||t.coarseHierarchy.isDefined})}};function Dee(e){return e.map(function(t){return[t.name,t.provider.label,t.provider.category]})}!function(e){e.EmptyFactory=function(){return e.Empty},e.Empty={factory:e.EmptyFactory,granularity:"uniform",size:function(){return 1},props:{}},e.areEqual=function t(n,a){return n.contextHash===a.contextHash&&n.factory===a.factory&&rd(n.props,a.props)},e.EmptyProvider={name:"",label:"",category:"",factory:e.EmptyFactory,getParams:function(){return{}},defaultValues:{},isApplicable:function(){return!0}},e.createRegistry=function r(){return new Eee(e.BuiltIn,e.EmptyProvider)},e.BuiltIn={physical:t9e,"shape-group":x4e,uncertainty:a9e,uniform:QOe}}(ki||(ki={})),function(e){function r(){return{color:hu.Empty,size:ki.Empty}}e.create=function t(i,o,s,u){u=u||r();var c=s.colorTheme,l=s.sizeTheme;return u.color=i.colorThemeRegistry.create(c.name,o,c.params),u.size=i.sizeThemeRegistry.create(l.name,o,l.params),u},e.createEmpty=r,e.ensureDependencies=function n(i,o,s,u){var c,l;return ue(this,void 0,void 0,function(){return ce(this,function(d){switch(d.label){case 0:return[4,null===(c=o.colorThemeRegistry.get(u.colorTheme.name).ensureCustomProperties)||void 0===c?void 0:c.attach(i,s)];case 1:return d.sent(),[4,null===(l=o.sizeThemeRegistry.get(u.sizeTheme.name).ensureCustomProperties)||void 0===l?void 0:l.attach(i,s)];case 2:return d.sent(),[2]}})})},e.releaseDependencies=function a(i,o,s){var u,c;null===(u=i.colorThemeRegistry.get(s.colorTheme.name).ensureCustomProperties)||void 0===u||u.detach(o),null===(c=i.sizeThemeRegistry.get(s.sizeTheme.name).ensureCustomProperties)||void 0===c||c.detach(o)}}(_i||(_i={}));var ds,Eee=function(){function e(t,r){var n=this;this.emptyProvider=r,this._list=[],this._map=new Map,this._name=new Map,Fs(t,function(a,i){if(a.name!==i)throw new Error("Fix build in themes to have matching names. ".concat(a.name," ").concat(i));n.add(a)})}return Object.defineProperty(e.prototype,"default",{get:function(){return this._list[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"list",{get:function(){return this._list},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"types",{get:function(){return Dee(this._list)},enumerable:!1,configurable:!0}),e.prototype.sort=function(){this._list.sort(function(t,r){return t.provider.category===r.provider.category?t.provider.labelr.provider.label?1:0:t.provider.category>2,o=i+(a-4*i>>2);if(o<=i){for(var s=n;s>2),c=n,l=Math.min(4*i,a),d=Math.max(n,4*o),f=a;switch(r){case Ut.Highlight:for(s=i;sr.lowestElementCount?"lowest":n>r.lowerElementCount?"lower":n>r.lowElementCount?"low":n>r.mediumElementCount?"medium":n>r.highElementCount?"high":"higher"}function vN(e,t){var r=po(e.quality,"auto"),n=po(e.detail,1),a=po(e.radialSegments,12),i=po(e.linearSegments,8),o=po(e.resolution,2),s=po(e.probePositions,12),u=po(e.doubleSided,!0),c=0;if("auto"===r)if(t instanceof Ze)r=Iee(t.root),c=function d9e(e){if(1===e.root.models.length){var t=Ja.Provider.get(e.root.model);if(t&&"P 1"===t.spacegroup.name&&!ns.isZero(t.spacegroup.cell))return t.spacegroup.cell.volume}return Nt.volume(e.root.boundary.box)}(t);else if(nt.is(t)){var l=t.grid.cells.space.dimensions;r=(c=l[0]*l[1]*l[2])<1e7?"medium":"low"}switch(r){case"highest":n=3,a=36,i=18,o=.1,s=72,u=!0;break;case"higher":n=3,a=28,i=14,o=.3,s=48,u=!0;break;case"high":n=2,a=20,i=10,o=.5,s=36,u=!0;break;case"medium":n=1,a=12,i=8,o=.8,s=24,u=!0;break;case"low":n=0,a=8,i=3,o=1.3,s=24,u=!1;break;case"lower":n=0,a=4,i=2,o=3,s=12,u=!1;break;case"lowest":n=0,a=2,i=1,o=8,s=12,u=!1}return o=Math.max(o,c/5e8),o=Math.min(o,20),"off"===e.transparentBackfaces&&(void 0!==e.alpha&&e.alpha<1||e.xrayShaded)&&(u=!1),{detail:n,radialSegments:a,linearSegments:i,resolution:o,probePositions:s,doubleSided:u}}var bT=b.set,Pee=b.normalize,Mee=b.sub,Ree=b.addScalar,ST=b.scale,Oee=b.toArray;function CT(e,t,r,n){var a=!1;if(nt.isLoci(e)){if(!nt.areEquivalent(e.volume,t))return!1;n(_e.ofLength(t.grid.cells.data.length))&&(a=!0)}else if(nt.Isosurface.isLoci(e)){if(!nt.areEquivalent(e.volume,t))return!1;if(r?.isoValue){if(!nt.IsoValue.areSame(e.isoValue,r.isoValue,t.grid.stats))return!1;n(_e.ofLength(t.grid.cells.data.length))&&(a=!0)}else for(var i=t.grid,o=i.stats,s=i.cells.data,u=o.sigma,c=nt.IsoValue.toAbsolute(e.isoValue,o).absoluteValue,l=0,d=s.length;l2)){for(var L=2-je,Q=(Je=re,mt=le,ut=xe,void 0,void 0,St=Math.floor(ut*C%D/C),d*(Math.floor(ut*C/D)*_*D+mt*D+(St*C+Je))),ye=0;yec)throw new Error("outputStride + itemOffset must NOT be larger than colorStride");var f=e.colorType.endsWith("Instance"),p=f?e.instanceCount:1,m=gi(Math.max(1,p*t),d,Uint8Array),h=m.array,v=i[0],g=i[1],y=o[0],S=b.fromArray(b(),s,0),C=s[3];function _(ye,we,De){var Oe=Math.floor(De*v%y/v),Ne=Math.floor(De*v/y);return c*(Ne*g*y+we*y+(Oe*v+ye))}for(var x=b(),D=b(),w=b(),A=b(),E=0;Eo.drawCount.ref.value||a!==o.stride.ref.value)&&O.update(o.aSample,Bee(s,a)),O.updateIfChanged(o.drawCount,s),O.updateIfChanged(o.instanceCount,t.instanceCount),O.updateIfChanged(o.stride,a),O.updateIfChanged(o.uGroupCount,t.groupCount),O.update(o.aTransform,t.transformBuffer),O.update(o.aInstance,t.instanceBuffer),O.update(o.uGeoTexDim,Be.set(o.uGeoTexDim.ref.value,t.positionTexture.getWidth(),t.positionTexture.getHeight())),O.update(o.tPosition,t.positionTexture),O.update(o.tGroup,t.groupTexture),O.update(o.uColorTexDim,Be.set(o.uColorTexDim.ref.value,t.colorData.getWidth(),t.colorData.getHeight())),O.update(o.tColor,t.colorData),O.updateIfChanged(o.dColorType,t.colorType),O.updateIfChanged(o.uCurrentSlice,0),O.updateIfChanged(o.uCurrentX,0),O.updateIfChanged(o.uCurrentY,0),O.update(o.uBboxMin,r.min),O.update(o.uBboxSize,i),O.updateIfChanged(o.uResolution,n),e.namedComputeRenderables[Qu].update()}else e.namedComputeRenderables[Qu]=function D9e(e,t,r,n,a){var i=b.sub(b(),r.max,r.min),o=Math.round(t.vertexCount/a),s={drawCount:O.create(o),instanceCount:O.create(t.instanceCount),stride:O.create(a),uGroupCount:O.create(t.groupCount),aTransform:O.create(t.transformBuffer),aInstance:O.create(t.instanceBuffer),aSample:O.create(Bee(o,a)),uGeoTexDim:O.create(Be.create(t.positionTexture.getWidth(),t.positionTexture.getHeight())),tPosition:O.create(t.positionTexture),tGroup:O.create(t.groupTexture),uColorTexDim:O.create(Be.create(t.colorData.getWidth(),t.colorData.getHeight())),tColor:O.create(t.colorData),dColorType:O.create(t.colorType),uCurrentSlice:O.create(0),uCurrentX:O.create(0),uCurrentY:O.create(0),uBboxMin:O.create(r.min),uBboxSize:O.create(i),uResolution:O.create(n)},u=R({},A9e);return Va(Ua(e,"points",Fn("accumulate",w9e,_9e,{drawBuffers:"required"}),u,s),s)}(e,t,r,n,a);return e.namedComputeRenderables[Qu]}(n,e,h,t,r);u.currentRenderItemId=-1,I.bind(),i.drawBuffers([i.COLOR_ATTACHMENT0,i.COLOR_ATTACHMENT1]);var j=N.values,U=j.uCurrentSlice,H=j.uCurrentX,z=j.uCurrentY;xt&&n.timer.mark("ColorAccumulate.render"),function E9e(e){var t=e.gl,r=e.state;r.disable(t.CULL_FACE),r.enable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.clearColor(0,0,0,0),r.blendFunc(t.ONE,t.ONE),r.blendEquation(t.FUNC_ADD)}(n),u.viewport(0,0,w,A),u.scissor(0,0,w,A),o.clear(o.COLOR_BUFFER_BIT),O.update(z,0);for(var G=0,J=0,X=0,Z=0;Z=E&&(G-=E,X=0,O.update(z,J+=_)),O.update(H,X),O.update(U,Z),u.viewport(X,J,C,_),u.scissor(X,J,C,_),N.render(),++G,X+=C;M.detachFramebuffer(I,0),F.detachFramebuffer(I,1),i.drawBuffers([o.COLOR_ATTACHMENT0,o.NONE]),xt&&n.timer.markEnd("ColorAccumulate.render"),xt&&n.timer.mark("ColorNormalize.render"),(!a||function FOe(e){return e.format===zX}(a))&&(a=s.texture("image-uint8","rgba","ubyte","linear")),a.define(w,A);var ne=function P9e(e,t,r){if(e.namedComputeRenderables[F2]){var n=e.namedComputeRenderables[F2].values;O.update(n.tColor,t),O.update(n.tCount,r),O.update(n.uTexSize,Be.set(n.uTexSize.ref.value,t.getWidth(),t.getHeight())),e.namedComputeRenderables[F2].update()}else e.namedComputeRenderables[F2]=function M9e(e,t,r){var n=R(R({},bi),{tColor:O.create(t),tCount:O.create(r),uTexSize:O.create(Be.create(t.getWidth(),t.getHeight()))}),a=R({},I9e);return Va(Ua(e,"triangles",Fn("normalize",bo,x9e),a,n),n)}(e,t,r);return e.namedComputeRenderables[F2]}(n,M,F);u.currentRenderItemId=-1,function R9e(e){var t=e.gl,r=e.state;r.disable(t.CULL_FACE),r.enable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.clearColor(0,0,0,0),r.blendFunc(t.ONE,t.ONE),r.blendEquation(t.FUNC_ADD)}(n),a.attachFramebuffer(I,0),u.viewport(0,0,w,A),u.scissor(0,0,w,A),o.clear(o.COLOR_BUFFER_BIT),ne.render(),xt&&n.timer.markEnd("ColorNormalize.render");var Y=dr.create(S[0],S[1],S[2],v),k=f?"volumeInstance":"volume";return xt&&n.timer.markEnd("calcTextureMeshColorSmoothing"),{texture:a,gridDim:y,gridTexDim:Be.create(w,A),gridTransform:Y,type:k}}var gr,kee,gN="color-smoothing-rgb",hy="color-smoothing-rgba",yN="color-smoothing-alpha";function Nee(e,t,r,n,a){if(function F9e(e){return"group"===e||"groupInstance"===e}(e.dColorType.ref.value)){r*=3,n.namedTextures[gN]||(n.namedTextures[gN]=n.resources.texture("image-uint8","rgb","ubyte","nearest"));var i=n.namedTextures[gN];i.load(e.tColor.ref.value);var o=wT({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dColorType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);O.updateIfChanged(e.dColorType,o.type),O.update(e.tColorGrid,o.texture),O.update(e.uColorTexDim,o.gridTexDim),O.update(e.uColorGridDim,o.gridDim),O.update(e.uColorGridTransform,o.gridTransform)}}function Gn(e,t){return{kind:e,layers:t}}function Mo(e,t){return{kind:e,layers:t}}!function(e){e.setVisibility=function t(f,p){f&&(f.state.visible=p)},e.setAlphaFactor=function r(f,p){f&&(f.state.alphaFactor=p)},e.setPickable=function n(f,p){f&&(f.state.pickable=p)},e.setColorOnly=function a(f,p){f&&(f.state.colorOnly=p)},e.mark=function i(f,p,m,h,v){if(!f||fs(p))return!1;var g=f.values,y=g.tMarker,S=g.uMarker,C=g.markerAverage,_=g.markerStatus,D=g.instanceCount,A=g.instanceGranularity.ref.value?D.ref.value:g.uGroupCount.ref.value*D.ref.value,E=y.ref.value.array,I=_.ref.value;if(!vu(p)){var M=0;if(h(p,function(H){return M+=_e.size(H),!0},!0),0===M)return!1;M===A&&(p=gT)}var F=!1,N=-1,j=-1;if(vu(p)){var U=function o9e(e,t){var r=-1,n=-1;switch(e){case Ut.Highlight:0===t||1===t?(r=1,n=1):2===t||3===t?(r=1,n=3):r=1;break;case Ut.RemoveHighlight:0===t||1===t?(r=0,n=0):(2===t||3===t)&&(r=1,n=2);break;case Ut.Select:1===t||3===t?(r=1,n=3):0===t||2===t?(r=1,n=2):r=1;break;case Ut.Deselect:1===t||3===t?(r=1,n=1):(0===t||2===t)&&(r=0,n=0);break;case Ut.Toggle:1===t?(r=1,n=3):2===t?(r=0,n=0):3===t?(r=1,n=1):0===t&&(r=1,n=2);break;case Ut.Clear:r=0,n=0}return{average:r,status:n}}(m,I);-1!==U.status?(F=I!==U.status)&&function i9e(e,t,r){e.fill(t,0,r)}(E,U.status,A):F=hN(E,_e.ofLength(A),m),N=U.average,j=U.status}else(F=h(p,function(H){return hN(E,H,m)},!0))&&(N=function s9e(e,t){switch(e){case Ut.Highlight:return.5;case Ut.RemoveHighlight:return 0===t?0:2===t||3===t?.5:-1;case Ut.Select:return.5;case Ut.Deselect:return 1===t||3===t?.5:0===t?0:-1;case Ut.Toggle:return-1===t?-1:.5;case Ut.Clear:return-1===t?-1:0===t?0:.5;case Ut.None:return-1;default:Sn()}}(m,I),v&&-1!==v.status&&-1===N&&ds.isReverse(v.action,m)&&fr.areEqual(p,v.loci)&&(N=0===(j=v.status)?0:.5));return F&&(-1===N&&0===(N=aX(E,A))&&(j=0),v&&(v.action=m,v.loci=p,v.status=I),O.updateIfChanged(S,j),-1===j&&O.update(y,y.ref.value),O.updateIfChanged(C,N),O.updateIfChanged(_,j)),F},e.setOverpaint=function o(f,p,m,h,v){if(f){var g=f.values,y=g.tOverpaint,S=g.dOverpaintType,C=g.dOverpaint,x=g.instanceCount,D=g.instanceGranularity,w=D.ref.value?x.ref.value:g.uGroupCount.ref.value*x.ref.value,A=D.ref.value?"instance":"groupInstance";!function tFe(e,t,r){var n=gi(Math.max(1,e),4,Uint8Array,r&&r.tOverpaint.ref.value.array);r?(O.update(r.tOverpaint,n),O.update(r.uOverpaintTexDim,Be.create(n.width,n.height)),O.updateIfChanged(r.dOverpaint,e>0),O.updateIfChanged(r.dOverpaintType,t)):(O.create(n),O.create(Be.create(n.width,n.height)),O.create(e>0),O.create(Ao()),O.create(b.create(1,1,1)),O.create(dr.create(0,0,0,1)),O.create(t),O.create(1))}(p.layers.length?w:0,A,f.values);var E=y.ref.value.array;h&&ZX(E,0,w);for(var I=function(Z,ne){var Y=p.layers[Z],W=Y.color,$=Y.clear;m(Y.loci,function(q){var V=_e.start(q),ee=_e.end(q);return $?ZX(E,V,ee):function eFe(e,t,r,n){for(var a=t;a0),0!==p.layers.length&&"instance"!==A&&v&&If(v.props)){var N=v.geometry,j=v.props,U=v.webgl;if("mesh"===N.kind){var H=N.meta,G=H.overpaintTexture;(J=Tc(j.smoothColors,!0,H.resolution))&&(function g9e(e,t,r,n,a){if(function v9e(e){return"groupInstance"===e}(e.dOverpaintType.ref.value)){var i=xT({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionBuffer:e.aPosition.ref.value,groupBuffer:e.aGroup.ref.value,colorData:e.tOverpaint.ref.value,colorType:e.dOverpaintType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value,itemSize:4},t,r,n,a);"volume"===i.kind?(O.updateIfChanged(e.dOverpaintType,i.type),O.update(e.tOverpaintGrid,i.texture),O.update(e.uOverpaintTexDim,i.gridTexDim),O.update(e.uOverpaintGridDim,i.gridDim),O.update(e.uOverpaintGridTransform,i.gridTransform)):"vertex"===i.kind&&(O.updateIfChanged(e.dOverpaintType,i.type),O.update(e.tOverpaint,i.texture),O.update(e.uOverpaintTexDim,i.texDim))}}(f.values,J.resolution,J.stride,U,G),N.meta.overpaintTexture=f.values.tOverpaintGrid.ref.value)}else if(U&&"texture-mesh"===N.kind){var J,X=N.meta;G=X.overpaintTexture,(J=Tc(j.smoothColors,!0,X.resolution))&&(function N9e(e,t,r,n,a){if(function B9e(e){return"groupInstance"===e}(e.dOverpaintType.ref.value)){r*=3,n.namedTextures[hy]||(n.namedTextures[hy]=n.resources.texture("image-uint8","rgba","ubyte","nearest"));var i=n.namedTextures[hy];i.load(e.tOverpaint.ref.value);var o=wT({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dOverpaintType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);O.updateIfChanged(e.dOverpaintType,o.type),O.update(e.tOverpaintGrid,o.texture),O.update(e.uOverpaintTexDim,o.gridTexDim),O.update(e.uOverpaintGridDim,o.gridDim),O.update(e.uOverpaintGridTransform,o.gridTransform)}}(f.values,J.resolution,J.stride,U,G),N.meta.overpaintTexture=f.values.tOverpaintGrid.ref.value)}}}},e.setTransparency=function s(f,p,m,h,v){if(f){var g=f.values,y=g.tTransparency,S=g.dTransparencyType,C=g.transparencyAverage,_=g.dTransparency,D=g.instanceCount,w=g.instanceGranularity,A=w.ref.value?D.ref.value:g.uGroupCount.ref.value*D.ref.value,E=w.ref.value?"instance":"groupInstance";!function aFe(e,t,r){var n=gi(Math.max(1,e),1,Uint8Array,r&&r.tTransparency.ref.value.array);r?(O.update(r.tTransparency,n),O.update(r.uTransparencyTexDim,Be.create(n.width,n.height)),O.updateIfChanged(r.dTransparency,e>0),O.updateIfChanged(r.transparencyAverage,$X(n.array,e)),O.updateIfChanged(r.dTransparencyType,t)):(O.create(n),O.create(Be.create(n.width,n.height)),O.create(e>0),O.create(0),O.create(Ao()),O.create(b.create(1,1,1)),O.create(dr.create(0,0,0,1)),O.create(t),O.create(1))}(p.layers.length?A:0,E,f.values);var I=y.ref.value.array;h&&function nFe(e,t,r){e.fill(0,t,r)}(I,0,A);for(var M=function(ne,Y){var k=p.layers[ne],$=k.value;m(k.loci,function(q){var V=_e.start(q),ee=_e.end(q);return function rFe(e,t,r,n){for(var a=t;a0),0!==p.layers.length&&"instance"!==E&&v&&If(v.props)){var j=v.geometry,U=v.props,H=v.webgl;if("mesh"===j.kind){var z=j.meta,J=z.transparencyTexture;(X=Tc(U.smoothColors,!0,z.resolution))&&(function b9e(e,t,r,n,a){if(function y9e(e){return"groupInstance"===e}(e.dTransparencyType.ref.value)){var i=xT({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionBuffer:e.aPosition.ref.value,groupBuffer:e.aGroup.ref.value,colorData:e.tTransparency.ref.value,colorType:e.dTransparencyType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value,itemSize:1},t,r,n,a);"volume"===i.kind?(O.updateIfChanged(e.dTransparencyType,i.type),O.update(e.tTransparencyGrid,i.texture),O.update(e.uTransparencyTexDim,i.gridTexDim),O.update(e.uTransparencyGridDim,i.gridDim),O.update(e.uTransparencyGridTransform,i.gridTransform)):"vertex"===i.kind&&(O.updateIfChanged(e.dTransparencyType,i.type),O.update(e.tTransparency,i.texture),O.update(e.uTransparencyTexDim,i.texDim))}}(f.values,X.resolution,X.stride,H,J),j.meta.transparencyTexture=f.values.tTransparencyGrid.ref.value)}else if(H&&"texture-mesh"===j.kind){var X,Z=j.meta;J=Z.transparencyTexture,(X=Tc(U.smoothColors,!0,Z.resolution))&&(function L9e(e,t,r,n,a){if(function k9e(e){return"groupInstance"===e}(e.dTransparencyType.ref.value)){r*=3,n.namedTextures[yN]||(n.namedTextures[yN]=n.resources.texture("image-uint8","alpha","ubyte","nearest"));var i=n.namedTextures[yN];i.load(e.tTransparency.ref.value);var o=wT({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dTransparencyType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);O.updateIfChanged(e.dTransparencyType,o.type),O.update(e.tTransparencyGrid,o.texture),O.update(e.uTransparencyTexDim,o.gridTexDim),O.update(e.uTransparencyGridDim,o.gridDim),O.update(e.uTransparencyGridTransform,o.gridTransform)}}(f.values,X.resolution,X.stride,H,J),j.meta.transparencyTexture=f.values.tTransparencyGrid.ref.value)}}}},e.setSubstance=function u(f,p,m,h,v){if(f){var g=f.values,y=g.tSubstance,S=g.dSubstanceType,C=g.dSubstance,x=g.instanceCount,D=g.instanceGranularity,w=D.ref.value?x.ref.value:g.uGroupCount.ref.value*x.ref.value,A=D.ref.value?"instance":"groupInstance";!function cFe(e,t,r){var n=gi(Math.max(1,e),4,Uint8Array,r&&r.tSubstance.ref.value.array);r?(O.update(r.tSubstance,n),O.update(r.uSubstanceTexDim,Be.create(n.width,n.height)),O.updateIfChanged(r.dSubstance,e>0),O.updateIfChanged(r.dSubstanceType,t)):(O.create(n),O.create(Be.create(n.width,n.height)),O.create(e>0),O.create(Ao()),O.create(b.create(1,1,1)),O.create(dr.create(0,0,0,1)),O.create(t),O.create(1))}(p.layers.length?w:0,A,f.values);var E=y.ref.value.array;h&&tK(E,0,w);for(var I=function(Z,ne){var Y=p.layers[Z],W=Y.material,$=Y.clear;m(Y.loci,function(q){var V=_e.start(q),ee=_e.end(q);return $?tK(E,V,ee):function uFe(e,t,r,n){for(var a=t;a0),0!==p.layers.length&&"instance"!==A&&v&&If(v.props)){var N=v.geometry,j=v.props,U=v.webgl;if("mesh"===N.kind){var H=N.meta,G=H.substanceTexture;(J=Tc(j.smoothColors,!0,H.resolution))&&(function C9e(e,t,r,n,a){if(function S9e(e){return"groupInstance"===e}(e.dSubstanceType.ref.value)){var i=xT({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionBuffer:e.aPosition.ref.value,groupBuffer:e.aGroup.ref.value,colorData:e.tSubstance.ref.value,colorType:e.dSubstanceType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value,itemSize:4},t,r,n,a);"volume"===i.kind?(O.updateIfChanged(e.dSubstanceType,i.type),O.update(e.tSubstanceGrid,i.texture),O.update(e.uSubstanceTexDim,i.gridTexDim),O.update(e.uSubstanceGridDim,i.gridDim),O.update(e.uSubstanceGridTransform,i.gridTransform)):"vertex"===i.kind&&(O.updateIfChanged(e.dSubstanceType,i.type),O.update(e.tSubstance,i.texture),O.update(e.uSubstanceTexDim,i.texDim))}}(f.values,J.resolution,J.stride,U,G),N.meta.substanceTexture=f.values.tSubstanceGrid.ref.value)}else if(U&&"texture-mesh"===N.kind){var J,X=N.meta;G=X.substanceTexture,(J=Tc(j.smoothColors,!0,X.resolution))&&(function V9e(e,t,r,n,a){if(function U9e(e){return"groupInstance"===e}(e.dSubstanceType.ref.value)){r*=3,n.namedTextures[hy]||(n.namedTextures[hy]=n.resources.texture("image-uint8","rgba","ubyte","nearest"));var i=n.namedTextures[hy];i.load(e.tSubstance.ref.value);var o=wT({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dSubstanceType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);O.updateIfChanged(e.dSubstanceType,o.type),O.update(e.tSubstanceGrid,o.texture),O.update(e.uSubstanceTexDim,o.gridTexDim),O.update(e.uSubstanceGridDim,o.gridDim),O.update(e.uSubstanceGridTransform,o.gridTransform)}}(f.values,J.resolution,J.stride,U,G),N.meta.substanceTexture=f.values.tSubstanceGrid.ref.value)}}}},e.setClipping=function c(f,p,m,h){if(f){var v=f.values,g=v.tClipping,y=v.dClippingType,S=v.dClipping,_=v.instanceCount,x=v.instanceGranularity,D=x.ref.value?_.ref.value:v.uGroupCount.ref.value*_.ref.value,A=x.ref.value?"instance":"groupInstance";!function sFe(e,t,r){var n=gi(Math.max(1,e),1,Uint8Array,r&&r.tClipping.ref.value.array);r?(O.update(r.tClipping,n),O.update(r.uClippingTexDim,Be.create(n.width,n.height)),O.updateIfChanged(r.dClipping,e>0),O.updateIfChanged(r.dClippingType,t)):(O.create(n),O.create(Be.create(n.width,n.height)),O.create(e>0),O.create(t))}(p.layers.length?D:0,A,f.values);var E=g.ref.value.array;h&&function oFe(e,t,r){e.fill(0,t,r)}(E,0,D);for(var I=function(N,j){var U=p.layers[N],z=U.groups;m(U.loci,function(J){var X=_e.start(J),Z=_e.end(J);return function iFe(e,t,r,n){return e.fill(n,t,r),!0}(E,X,Z,z)},!1)},M=0,F=p.layers.length;M0)}},e.setThemeStrength=function l(f,p){f&&(O.updateIfChanged(f.values.uOverpaintStrength,p.overpaint),O.updateIfChanged(f.values.uTransparencyStrength,p.transparency),O.updateIfChanged(f.values.uSubstanceStrength,p.substance))},e.setTransform=function d(f,p,m){if(f&&(p||m)){var h=f.values;p&&(he.copy(h.matrix.ref.value,p),O.update(h.matrix,h.matrix.ref.value)),m?(h.extraTransform.ref.value.set(m),O.update(h.extraTransform,h.extraTransform.ref.value)):null===m&&(hA(h.extraTransform.ref.value,h.instanceCount.ref.value),O.update(h.extraTransform,h.extraTransform.ref.value)),WX(h);var v=Qi(h.invariantBoundingSphere.ref.value,h.aTransform.ref.value,h.instanceCount.ref.value,0);O.update(h.boundingSphere,v)}}}(gr||(gr={})),function(e){function n(l){return 0===l.layers.length}e.Empty={kind:"empty-loci",layers:[]},function(l){var d,g;function m(g){switch(g){case"one":return d.One;case"two":return d.Two;case"three":return d.Three;case"four":return d.Four;case"five":return d.Five;case"six":return d.Six}}l.is=Vo.has,(g=d=l.Flag||(l.Flag={}))[g.None=0]="None",g[g.One=1]="One",g[g.Two=2]="Two",g[g.Three=4]="Three",g[g.Four=8]="Four",g[g.Five=16]="Five",g[g.Six=32]="Six",l.create=function f(g){return Vo.create(g)},l.Names={one:d.One,two:d.Two,three:d.Three,four:d.Four,five:d.Five,six:d.Six},l.isName=function p(g){return g in l.Names},l.fromName=m,l.fromNames=function h(g){for(var y=d.None,S=0,C=g.length;S[+ ").concat(by(e-1,"other ".concat(Mh(r))),"]")}function ET(e,t){void 0===t&&(t={});var r=R(R({},yy),t),n=function eje(e,t,r,n,a){void 0===t&&(t=!1),void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===a&&(a=!1);var i=e.structureCount,o=e.chainCount,s=e.residueCount,u=e.conformationCount,c=e.elementCount;if(!t&&1===c&&0===s&&0===o)return cp(e.firstElementLoc,{hidePrefix:r,condensed:n,granularity:"element",reverse:a});if(!t&&0===c&&1===s&&0===o)return cp(e.firstResidueLoc,{hidePrefix:r,condensed:n,granularity:"residue",reverse:a});if(t||0!==c||0!==s||1!==o){if(t){var f=[];return i>0&&f.push(by(i,"Structure")),o>0&&f.push(by(o,"Chain")),s>0&&f.push(by(s,"Residue")),u>0&&f.push(by(u,"Conformation")),c>0&&f.push(by(c,"Element")),f.join(" + ")}return f=[],i>0&&f.push(1===i?cp(e.firstStructureLoc,{hidePrefix:r,condensed:n,granularity:"structure",reverse:a}):B2(i,e.firstStructureLoc,"structure",r,a,n)),o>0&&(f.push(1===o?cp(e.firstChainLoc,{condensed:n,granularity:"chain",hidePrefix:r,reverse:a}):B2(o,e.firstChainLoc,"chain",r,a,n)),r=!0),s>0&&(f.push(1===s?cp(e.firstResidueLoc,{condensed:n,granularity:"residue",hidePrefix:r,reverse:a}):B2(s,e.firstResidueLoc,"residue",r,a,n)),r=!0),u>0&&(f.push(1===u?cp(e.firstConformationLoc,{condensed:n,granularity:"conformation",hidePrefix:r,reverse:a}):B2(u,e.firstConformationLoc,"conformation",r,a,n)),r=!0),c>0&&f.push(1===c?cp(e.firstElementLoc,{condensed:n,granularity:"element",hidePrefix:r,reverse:a}):B2(c,e.firstElementLoc,"element",r,a,n)),f.join(" + ")}var l=e.firstChainLoc.unit,d=Fe.isAtomic(l)&&1===function J9e(e){var t=e.elements,n=e.model.atomicHierarchy,a=n.chainAtomSegments,i=n.residueAtomSegments;return i.index[a.offsets[a.index[t[t.length-1]]+1]-1]-i.index[a.offsets[a.index[t[0]]]]+1}(l)||Fe.Traits.is(l.traits,Fe.Trait.MultiChain)?"residue":"chain";return cp(e.firstChainLoc,{hidePrefix:r,condensed:n,granularity:d,reverse:a})}(e,r.countsOnly,r.hidePrefix,r.condensed,r.reverse);return r.htmlStyling?n:yO(n)}function IT(e,t){void 0===t&&(t={});for(var r=Ad.create(),n=0,a=e;n0){var y=[d[0].join(" | ")];for(v=1,g=d.length;v")}return(d=e.loci.map(function(C){return DT(C,t)})).filter(function(C){return!!C}).join(i?" \u2014 ":"
")}(e,r);return r.htmlStyling?n:yO(n)}function cp(e,t){var r,n;void 0===t&&(t={});var a=R(R({},yy),t),i=Jee(e,a.granularity,a.hidePrefix,a.reverse||a.condensed),o=a.condensed?null!==(n=null===(r=i[0])||void 0===r?void 0:r.replace(/\[.*\]/g,"").trim())&&void 0!==n?n:"":i.filter(function(s){return!!s}).join(" | ");return a.htmlStyling?o:yO(o)}function Jee(e,t,r,n){void 0===t&&(t="element"),void 0===r&&(r=!1),void 0===n&&(n=!1);var a=[];if(!r){var i=e.unit.model.entry;i.length>30&&(i=i.substr(0,27)+"\u2026"),a.push("".concat(i,"")),"structure"!==t&&(a.push("Model ".concat(e.unit.model.modelNum,"")),a.push("Instance ".concat(e.unit.conformation.operator.name,"")))}return Fe.isAtomic(e.unit)?a.push.apply(a,function rje(e,t,r){void 0===r&&(r=!1);var n=at.residueIndex(e),a=ot.chain.label_asym_id(e),i=ot.chain.auth_asym_id(e),o=0===e.unit.model.atomicHierarchy.residues.label_seq_id.valueKind(n),s=ot.residue.label_seq_id(e),u=ot.residue.auth_seq_id(e),c=ot.residue.pdbx_PDB_ins_code(e),l=ot.atom.label_comp_id(e),d=ot.atom.label_atom_id(e),f=ot.atom.label_alt_id(e),p=ot.atom.occupancy(e),m=ot.residue.microheterogeneityCompIds(e),h="residue"===t&&m.length>1?"(".concat(m.join("|"),")"):l,v=[];switch(t){case"element":v.push("".concat(d,"").concat(f?"%".concat(f):""));case"conformation":"conformation"===t&&f&&v.push("Conformation ".concat(f,""));case"residue":var g=s!==u&&o?s:u;v.push("".concat(h," ").concat(g,"").concat(g!==u?" [auth ".concat(u,"]"):"","").concat(c||"",""));case"chain":a===i?v.push("".concat(a,"")):"chain"===t&&Fe.Traits.is(e.unit.traits,Fe.Trait.MultiChain)?v.push("[auth ".concat(i,"]")):v.push("".concat(a," [auth ").concat(i,"]"))}return v.length>0&&1!==p&&!r&&(v[0]="".concat(v[0]," [occupancy ").concat(Math.round(100*p)/100,"]")),v.reverse()}(e,t,n)):Fe.isCoarse(e.unit)?a.push.apply(a,function nje(e,t){var r=ot.coarse.asym_id(e),n=ot.coarse.seq_id_begin(e),a=ot.coarse.seq_id_end(e),i=[];switch(t){case"element":case"conformation":case"residue":if(n===a){var o=ot.coarse.entityKey(e),u=e.unit.model.sequence.byEntityKey[o].sequence.compId.value(n-1);i.push("".concat(u," ").concat(n,""))}else i.push("".concat(n,"-").concat(a,""));case"chain":i.push("".concat(r,""))}return i.reverse()}(e,t)):a.push("Unknown"),n?a.reverse():a}function SN(e,t){void 0===t&&(t={});var r=R(R(R({},yy),{measureOnly:!1,unitLabel:"\u212b"}),t),n=e.loci.map(function(u){return fr.getCenter(u)}),o="".concat(b.distance(n[0],n[1]).toFixed(2)," ").concat(r.unitLabel);if(r.measureOnly)return o;var s=PT(e,r);return r.condensed?"".concat(o," | ").concat(s):"Distance ".concat(o,"
").concat(s)}function CN(e,t){void 0===t&&(t={});var r=R(R(R({},yy),{measureOnly:!1}),t),n=e.loci.map(function(d){return fr.getCenter(d)}),a=n[0],i=n[1],o=n[2],s=b.sub(b(),a,i),u=b.sub(b(),o,i),c="".concat(Ru(b.angle(s,u)).toFixed(2),"\xb0");if(r.measureOnly)return c;var l=PT(e,r);return r.condensed?"".concat(c," | ").concat(l):"Angle ".concat(c,"
").concat(l)}function xN(e,t){void 0===t&&(t={});var r=R(R(R({},yy),{measureOnly:!1}),t),n=e.loci.map(function(l){return fr.getCenter(l)}),u="".concat(Ru(b.dihedralAngle(n[0],n[1],n[2],n[3])).toFixed(2),"\xb0");if(r.measureOnly)return u;var c=PT(e,r);return r.condensed?"".concat(u," | ").concat(c):"Dihedral ".concat(u,"
").concat(c)}var ete={customText:T.Text("",{label:"Text",description:"Override the label with custom value.",isEssential:!0}),textColor:T.Color(vr.black,{isEssential:!0}),textSize:T.Numeric(.5,{min:.1,max:10,step:.1},{isEssential:!0})},MT=R(R(R({},zu.Params),ete),{borderWidth:T.Numeric(.2,{min:0,max:.5,step:.01})}),tte={unitLabel:T.Text("\u212b",{isEssential:!0})},aje=R(R(R({},na.Params),tte),{lineSizeAttenuation:T.Boolean(!0),linesColor:T.Color(vr.lightgreen,{isEssential:!0}),linesSize:T.Numeric(.075,{min:.01,max:5,step:.01}),dashLength:T.Numeric(.2,{min:.01,max:.2,step:.01})}),ije=R(R({},MT),tte),rte={lines:function(e,t){return Li(uje,na.Utils,{modifyState:function(r){return R(R({},r),{markerActions:ds.Highlighting})}})},text:function(e,t){return Li(lje,zu.Utils,{modifyState:function(r){return R(R({},r),{markerActions:Ut.None})}})}},nte=R(R(R({},aje),ije),{visuals:T.MultiSelect(["lines","text"],T.objectToOptions(rte))});function ate(e,t){var r=t.sphereA,n=t.sphereB,a=t.center,i=e.loci,s=i[1];return fr.getBoundingSphere(i[0],r),fr.getBoundingSphere(s,n),b.add(a,r.center,n.center),b.scale(a,a,.5),t.distance=b.distance(r.center,n.center),t}var xm=function oje(){return{sphereA:Pe(),sphereB:Pe(),center:b(),distance:0}}();function ite(e,t){return 1===e.pairs.length?"Distance ".concat(SN(e.pairs[0],{unitLabel:t,measureOnly:!0})):"".concat(e.pairs.length," Distances")}function uje(e,t,r,n){var a=function sje(e,t,r){for(var n=uu.create(128,64,r),a=0,i=e.pairs.length;a0}},getDuration:function(e){return{kind:"fixed",durationMs:e.durationInMs}},initialState:function(){return{t:0}},setup:function(e,t,r){for(var n=r.state.data,i=n.select(xr.Generators.ofType(ve.Molecule.Structure.Representation3D,e.target&&"all"!==e.target?e.target:on.RootRef)),o=n.build(),s=!1,u=0,c=i;u0||(s=!0,o.to(l).apply(et.Representation.UnwindStructureAssemblyRepresentation3D,{t:0},{tags:"animate-assembly-unwind"}))}if(s)return o.commit({doNotUpdateCurrent:!0})},teardown:function(e,t,r){var n=r.state.data,a=n.select(xr.Generators.ofType(ve.Molecule.Structure.Representation3DState).withTag("animate-assembly-unwind"));if(0!==a.length){for(var i=n.build(),o=0,s=a;o=1?(c=!0,u=1):u%=1,l=0,d=i;l=.99999?[2,{kind:"finished"}]:[2,{kind:"next",state:e}])})})}}),rWe=lf.create({name:"built-in.animate-model-index",display:{name:"Animate Trajectory"},isExportable:!0,params:function(){return{mode:T.MappedStatic("loop",{palindrome:T.Group({}),loop:T.Group({direction:T.Select("forward",[["forward","Forward"],["backward","Backward"]])}),once:T.Group({direction:T.Select("forward",[["forward","Forward"],["backward","Backward"]])},{isFlat:!0})},{options:[["palindrome","Palindrome"],["loop","Loop"],["once","Once"]]}),duration:T.MappedStatic("fixed",{fixed:T.Group({durationInS:T.Numeric(5,{min:1,max:120,step:.1},{description:"Duration in seconds"})},{isFlat:!0}),computed:T.Group({targetFps:T.Numeric(30,{min:5,max:250,step:1},{label:"Target FPS"})},{isFlat:!0}),sequential:T.Group({maxFps:T.Numeric(30,{min:5,max:60,step:1})},{isFlat:!0})})}},canApply:function(e){for(var t=e.state.data,n=0,a=t.select(xr.Generators.ofTransformer(et.Model.ModelFromTrajectory));n1)return{canApply:!0}}return{canApply:!1,reason:"No trajectory to animate"}},getDuration:function(e,t){var r;if("fixed"===(null===(r=e.duration)||void 0===r?void 0:r.name))return{kind:"fixed",durationMs:1e3*e.duration.params.durationInS};if("computed"===e.duration.name){for(var n=t.state.data,i=0,o=0,s=n.select(xr.Generators.ofTransformer(et.Model.ModelFromTrajectory));o0&&t.current-t.lastApplied<1e3/r.params.duration.params.maxFps)return[2,{kind:"skip"}];if(0===(a=(n=r.plugin.state.data).select(xr.Generators.ofTransformer(et.Model.ModelFromTrajectory))).length)return[2,{kind:"finished"}];for(i=n.build(),o=r.params,s=e.palindromeDirections||{},u=!1,c=!0,l=function(h){var v=xr.findAncestorOfType(n.tree,n.cells,h.transform.ref,ve.Molecule.Trajectory);if(!v||!v.obj)return"continue";var g=v.obj;if(g.data.frameCount<=1)return"continue";i.to(h).update(function(y){var S=g.data.frameCount;if(1===S)return y;if(c=!1,"sequential"===o.duration.name){var C=1;if("once"===o.mode.name){if(-1==(C="backward"===o.mode.params.direction?-1:1)&&0===y.modelIndex||1===C&&y.modelIndex===S-1)return u=!0,y}else"palindrome"===o.mode.name&&(C=0===y.modelIndex?1:y.modelIndex===S-1?-1:s[h.transform.ref]||1);return s[h.transform.ref]=C,(_=(y.modelIndex+C)%S)<0&&(_+=S),u=u||-1===C&&0===_||1===C&&_===S-1,{modelIndex:_}}var x="fixed"===o.duration.name?1e3*o.duration.params.durationInS:Math.ceil(1e3*g.data.frameCount/o.duration.params.targetFps);if("once"===o.mode.name&&t.current>=x)return u=!0,{modelIndex:g.data.frameCount-1};var _,D=t.current%x/x;return"loop"===o.mode.name&&"backward"===o.mode.params.direction&&(D=1-D),"palindrome"===o.mode.name&&(D*=2)>1&&(D=2-D),{modelIndex:_=Math.min(Math.floor(g.data.frameCount*D),g.data.frameCount-1)}})},d=0,f=a;d1}},setup:function(e,t,r){var n=r.managers.snapshot.state.entries.get(0);Ote(r,n,!0)},getDuration:function(e,t){return{kind:"fixed",durationMs:t.managers.snapshot.state.entries.toArray().reduce(function(r,n){var a;return r+(null!==(a=n.snapshot.durationInMs)&&void 0!==a?a:0)},0)}},initialState:function(e,t){var r=t.managers.snapshot.state.entries.toArray();return{totalDuration:r.reduce(function(n,a){var i;return n+(null!==(i=a.snapshot.durationInMs)&&void 0!==i?i:0)},0),snapshots:r,currentIndex:0}},apply:function(e,t,r){var n;return ue(this,void 0,void 0,function(){var a,i,o,s;return ce(this,function(c){if(t.current>=e.totalDuration)return[2,{kind:"finished"}];for(a=0,i=0,o=0,s=e.snapshots;o=e.snapshots.length?[2,{kind:"finished"}]:i===e.currentIndex?[2,{kind:"skip"}]:(Ote(r.plugin,e.snapshots[i]),[2,{kind:"next",state:R(R({},e),{currentIndex:i})}])})})}});!function(e){var t=function(l){function d(){return null!==l&&l.apply(this,arguments)||this}return jt(d,l),d}(ve.Create({name:"Root",typeClass:"Root"}));e.Root=t;var r=function(l){function d(){return null!==l&&l.apply(this,arguments)||this}return jt(d,l),d}(ve.Create({name:"Category",typeClass:"Object"}));e.Category=r;var n=function(l){function d(){return null!==l&&l.apply(this,arguments)||this}return jt(d,l),d}(ve.CreateBehavior({name:"Behavior"}));e.Behavior=n,e.Categories={common:"Common",representation:"Representation",interaction:"Interaction","custom-props":"Custom Properties",misc:"Miscellaneous"},e.CreateCategory=Bt.BuiltIn({name:"create-behavior-category",display:{name:"Behavior Category"},from:t,to:r,params:{label:T.Text("",{isHidden:!0})}})({apply:function(l){return new r({},{label:l.params.label})}});var a=new Map;e.getCategoryId=function i(l){return a.get(l.id)},e.create=function o(l){var d=Bt.CreateBuiltIn({name:l.name,display:l.display,from:[t],to:[n],params:l.params,apply:function(f,p){var m=f.params,h=l.label?l.label(m):{label:l.display.name,description:l.display.description};return new n(new l.ctor(p,m),h)},update:function(f){var p=this,m=f.b,h=f.newParams;return Ve.create("Update Behavior",function(){return ue(p,void 0,void 0,function(){return ce(this,function(g){switch(g.label){case 0:return m.data.update?[4,m.data.update(h)]:[2,rt.UpdateResult.Unchanged];case 1:return[2,g.sent()?rt.UpdateResult.Updated:rt.UpdateResult.Unchanged]}})})})},canAutoUpdate:l.canAutoUpdate});return a.set(d.id,l.category),d},e.simpleCommandHandler=function s(l,d){return function(){function f(p){this.ctx=p,this.sub=void 0}return f.prototype.register=function(){var p=this;this.sub=l.subscribe(this.ctx,function(m){return d(m,p.ctx)})},f.prototype.dispose=function(){this.sub&&this.sub.unsubscribe(),this.sub=void 0},f}()};var u=function(){function l(d,f){this.ctx=d,this.params=f,this.subs=[]}return l.prototype.subscribeCommand=function(d,f){this.subs.push(d.subscribe(this.ctx,f))},l.prototype.subscribeObservable=function(d,f){this.subs.push(d.subscribe(f))},l.prototype.track=function(d){this.subs.push(d)},l.prototype.dispose=function(){for(var d=0,f=this.subs;d=0&&(p.subs.splice(h,1),m.unsubscribe())}}},l.prototype.dispose=function(){for(var d=0,f=this.subs;d"u"&&(this.subs=[]);var a=t.subscribe(r);return this.subs.push(a),{unsubscribe:function(){a&&n.subs&&Lh(n.subs,a)&&(a.unsubscribe(),a=void 0)}}},Object.defineProperty(e.prototype,"ev",{get:function(){return this._ev||(this._ev=bf.create())},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){if(this._ev&&this._ev.dispose(),this.subs){for(var t=0,r=this.subs;t>2,s=new Uint8Array(i),u=new Uint32Array(s.buffer,0,o),c=0,l=0;l0?r.entries[0].snapshot.id:void 0,entries:n.asImmutable(),isPlaying:!1,nextSnapshotDelayInMs:r.playback?r.playback.nextSnapshotDelayInMs:t.DefaultNextSnapshotDelayInMs}),this.events.changed.next(void 0),s?(u=this.getEntry(s),(c=u&&u.snapshot)?[4,this.plugin.state.setSnapshot(c)]:[2]):[2];case 1:return l.sent(),r.playback&&r.playback.isPlaying&&this.play(!0),[2,c]}})})},t.prototype.syncCurrent=function(r){var n,a;return ue(this,void 0,void 0,function(){var i,o,s,u,c,l;return ce(this,function(d){switch(d.label){case 0:return o=1===this.state.entries.size&&this.state.current&&this.state.current===this.defaultSnapshotId,(i=0===this.state.entries.size)||o?(s=this.plugin.state.getSnapshot(r?.params),(null!==(a=null===(n=r?.params)||void 0===n?void 0:n.image)&&void 0!==a?a:this.plugin.state.snapshotParams.value.image)?[4,t.getCanvasImageAsset(this.plugin,"".concat(s.id,"-image.png"))]:[3,2]):[2];case 1:return c=d.sent(),[3,3];case 2:c=void 0,d.label=3;case 3:return u=c,i?this.add(t.Entry(s,{name:r?.name,description:r?.description,image:u})):o&&(l=this.getEntry(this.state.current),l?.image&&this.plugin.managers.asset.delete(l.image),this.replace(this.state.current,s,{image:u})),this.defaultSnapshotId=s.id,[2]}})})},t.prototype.getStateSnapshot=function(r){return ue(this,void 0,void 0,function(){return ce(this,function(n){switch(n.label){case 0:return[4,this.syncCurrent(r)];case 1:return n.sent(),[2,{timestamp:+new Date,version:"3.43.0",name:r&&r.name,description:r&&r.description,current:this.state.current,playback:{isPlaying:!(!r||!r.playOnLoad),nextSnapshotDelayInMs:this.state.nextSnapshotDelayInMs},entries:this.state.entries.valueSeq().toArray()}]}})})},t.prototype.serialize=function(r){return ue(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d,f,p,m,h,v,g,y,S;return ce(this,function(C){switch(C.label){case 0:return i=(a=JSON).stringify,[4,this.getStateSnapshot({params:r?.params})];case 1:return n=i.apply(a,[C.sent(),null,2]),r?.type&&"json"!==r.type&&"molj"!==r.type?[3,2]:[2,new Blob([n],{type:"application/json;charset=utf-8"})];case 2:I0(o=new Uint8Array(xw(n)),0,n),s={"state.json":o},u=[],c=0,l=this.plugin.managers.asset.assets,C.label=3;case 3:return c0&&(g=JSON.stringify(u,null,2),I0(y=new Uint8Array(xw(g)),0,g),s["assets.json"]=y),[4,this.plugin.runTask(Jwe(s))];case 7:return S=C.sent(),[2,new Blob([S],{type:"application/zip"})]}})})},t.prototype.open=function(r){return ue(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,d,f,p,m,v,g,y;return ce(this,function(S){switch(S.label){case 0:return S.trys.push([0,15,,16]),(n=r.name.toLowerCase()).endsWith("json")||n.endsWith("molj")?[4,this.plugin.runTask(yf(r,"string"))]:[3,8];case 1:return a=S.sent(),g=JSON.parse(a),t.isStateSnapshot(g)?[4,this.setStateSnapshot(g)]:[3,3];case 2:return S.sent(),[3,7];case 3:return t.isStateSnapshot(g.data)?[4,this.setStateSnapshot(g.data)]:[3,5];case 4:return S.sent(),[3,7];case 5:return[4,this.plugin.state.setSnapshot(g)];case 6:S.sent(),S.label=7;case 7:return[3,14];case 8:return[4,this.plugin.runTask(yf(r,"zip"))];case 9:return a=S.sent(),i=Object.create(null),Fs(a,function(C,_){if("state.json"!==_&&"assets.json"!==_){var x=_.substring(_.indexOf("/")+1);i[x]=C}}),o=new File([a["state.json"]],"state.json"),[4,this.plugin.runTask(yf(o,"string"))];case 10:return s=S.sent(),a["assets.json"]?(u=new File([a["assets.json"]],"assets.json"),d=(l=JSON).parse,[4,this.plugin.runTask(yf(u,"string"))]):[3,12];case 11:for(c=d.apply(l,[S.sent()]),f=0,p=c;f"u"||typeof window>"u")return!1;if(["Version/15.1 Safari","Version/15.2 Safari","Version/15.3 Safari"].some(function(a){return navigator.userAgent.indexOf(a)>0}))return!0;var t=/iPad|iPhone|iPod/.test(navigator.userAgent),r=navigator.userAgent.includes("Macintosh"),n=navigator.maxTouchPoints>=4;return!window.MSStream&&(t||r&&n)}},dWe=function(){function e(t,r){this.key=t,this.defaultValue=r}return e.prototype.toString=function(){return this.key},e.prototype.valueOf=function(){return this.key},e}();function Hn(e,t){return new dWe(e,t)}var pa={item:Hn,General:{IsBusyTimeoutMs:Hn("plugin-config.is-busy-timeout",750),DisableAntialiasing:Hn("plugin-config.disable-antialiasing",!1),DisablePreserveDrawingBuffer:Hn("plugin-config.disable-preserve-drawing-buffer",!1),PixelScale:Hn("plugin-config.pixel-scale",1),PickScale:Hn("plugin-config.pick-scale",.25),PickPadding:Hn("plugin-config.pick-padding",3),EnableWboit:Hn("plugin-config.enable-wboit",!0),EnableDpoit:Hn("plugin-config.enable-dpoit",!1),PreferWebGl1:Hn("plugin-config.prefer-webgl1",lWe.preferWebGl1),AllowMajorPerformanceCaveat:Hn("plugin-config.allow-major-performance-caveat",!1),PowerPreference:Hn("plugin-config.power-preference","high-performance")},State:{DefaultServer:Hn("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),CurrentServer:Hn("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),HistoryCapacity:Hn("history-capacity.server",5)},VolumeStreaming:{Enabled:Hn("volume-streaming.enabled",!0),DefaultServer:Hn("volume-streaming.server","https://ds.litemol.org"),CanStream:Hn("volume-streaming.can-stream",function(e,t){return 1===e.models.length&&ar.probablyHasDensityMap(e.models[0])}),EmdbHeaderServer:Hn("volume-streaming.emdb-header-server","https://files.wwpdb.org/pub/emdb/structures")},Viewport:{ShowExpand:Hn("viewer.show-expand-button",!0),ShowControls:Hn("viewer.show-controls-button",!0),ShowSettings:Hn("viewer.show-settings-button",!0),ShowSelectionMode:Hn("viewer.show-selection-model-button",!0),ShowAnimation:Hn("viewer.show-animation-button",!0),ShowTrajectoryControls:Hn("viewer.show-trajectory-controls",!0)},Download:{DefaultPdbProvider:Hn("download.default-pdb-provider","pdbe"),DefaultEmdbProvider:Hn("download.default-emdb-provider","pdbe")},Structure:{SizeThresholds:Hn("structure.size-thresholds",Ze.DefaultSizeThresholds),DefaultRepresentationPreset:Hn("structure.default-representation-preset","auto"),DefaultRepresentationPresetParams:Hn("structure.default-representation-preset-params",{}),SaccharideCompIdMapType:Hn("structure.saccharide-comp-id-map-type","default")},Background:{Styles:Hn("background.styles",[])}},fWe=function(){function e(t){var r=this;this._config=new Map,t&&t.forEach(function(n){return r._config.set(n[0],n[1])})}return e.prototype.get=function(t){return this._config.has(t)?this._config.get(t):t.defaultValue},e.prototype.set=function(t,r){this._config.set(t,r)},e.prototype.delete=function(t){this._config.delete(t)},e}();function pWe(e){Nte(e),kte(e),Lte(e),Ute(e),Vte(e),Gte(e),zte(e),Hte(e),jte(e),qte(e)}function Nte(e){e.state.events.object.created.subscribe(function(t){ve.isBehavior(t.obj)&&t.obj.data.register(t.ref)}),e.state.events.object.removed.subscribe(function(t){var r,n,a,i;ve.isBehavior(t.obj)&&(null===(n=(r=t.obj.data).unregister)||void 0===n||n.call(r),null===(i=(a=t.obj.data).dispose)||void 0===i||i.call(a))}),e.state.events.object.updated.subscribe(function(t){var r,n,a,i;"recreate"===t.action&&(t.oldObj&&ve.isBehavior(t.oldObj)&&(null===(n=(r=t.oldObj.data).unregister)||void 0===n||n.call(r),null===(i=(a=t.oldObj.data).dispose)||void 0===i||i.call(a)),t.obj&&ve.isBehavior(t.obj)&&t.obj.data.register(t.ref))})}function kte(e){yr.State.SetCurrentObject.subscribe(e,function(t){return t.state.setCurrent(t.ref)})}function Lte(e){yr.State.Update.subscribe(e,function(t){return e.runTask(t.state.updateTree(t.tree,t.options))})}function Ute(e){yr.State.ApplyAction.subscribe(e,function(t){var n=t.action;return e.runTask(t.state.applyAction(n.action,n.params,t.ref))})}function Vte(e){function t(r,n){var a=r.build().delete(n);return e.runTask(r.updateTree(a))}yr.State.RemoveObject.subscribe(e,function(r){var n=r.state,a=r.ref;if(!r.removeParentGhosts)return t(n,a);var o=n.tree,s=o.transforms.get(a);if(s.parent===a)return t(n,a);for(;;){var u=o.children.get(s.parent);if(s.parent===s.ref||u.size>1)return t(n,s.ref);var c=o.transforms.get(s.parent);if(!c.state.isGhost)return t(n,s.ref);s=c}})}function Gte(e){yr.State.ToggleExpanded.subscribe(e,function(t){return t.state.updateCellState(t.ref,function(a){return{isCollapsed:!a.isCollapsed}})})}function zte(e){yr.State.ToggleVisibility.subscribe(e,function(t){var r=t.state,n=t.ref;return Cy(r,n,!r.cells.get(n).state.isHidden)})}function Cy(e,t,r){ii.doPreOrder(e.tree,e.transforms.get(t),{state:e,value:r},mWe)}function mWe(e,t,r){r.state.updateCellState(e.ref,{isHidden:r.value})}function Hte(e){yr.Interactivity.Object.Highlight.subscribe(e,function(t){var r=t.state,n=t.ref;if(e.canvas3d&&!e.isBusy){e.managers.interactivity.lociHighlights.clearHighlights();for(var i=0,o="string"==typeof n?[n]:n;i0)return 1<=0)return 1<=4&&(G=!0),Z.next({x:ca,y:xa,dx:D[0],dy:D[1],pageX:Wt,pageY:wr,buttons:U,button:H,modifiers:M(),isStart:xp}),Be.copy(_,x),N=Sv.Moving)}}function Rt(ze){if(d(ze.clientX,ze.clientY)){Qn(x,ze);var Ke=ao(ze),gt=Ke.pageX,Wt=Ke.pageY,wr=x[0],ca=x[1];o&&ze.preventDefault();var xa=function bWe(e){var a=0,i=0,o=0,s=0,u=0;return"detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(a=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(a=i,i=0),o=10*a,s=10*i,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(o=e.deltaX),"deltaZ"in e&&(u=e.deltaZ),(o||s||u)&&e.deltaMode&&(1===e.deltaMode?(o*=40,s*=40,u*=40):(o*=800,s*=800,u*=800)),o&&!a&&(a=o<1?-1:1),s&&!i&&(i=s<1?-1:1),{spinX:a,spinY:i,dx:o,dy:s,dz:u}}(ze);U=H=Ga.Flag.Auxilary,(xa.dx||xa.dy||xa.dz)&&Y.next(R(R({x:wr,y:ca,pageX:gt,pageY:Wt},xa),{buttons:U,button:H,modifiers:M()}))}}function oe(ze){var Ke,gt;p&&(ze.preventDefault(),null===(Ke=ze.stopImmediatePropagation)||void 0===Ke||Ke.call(ze),null===(gt=ze.stopPropagation)||void 0===gt||gt.call(ze))}var be=0,Ce=0;function Qe(ze){oe(ze),be=ze.scale,Ce=ze.rotation,W.next({scale:ze.scale,rotation:ze.rotation,deltaRotation:0,deltaScale:0,isStart:!0})}function Et(ze,Ke){W.next({scale:ze.scale,rotation:ze.rotation,deltaRotation:Ce-ze.rotation,deltaScale:be-ze.scale,isEnd:Ke}),Ce=ze.rotation,be=ze.scale}function At(ze){oe(ze),Et(ze)}function Zt(ze){oe(ze),Et(ze,!0)}function Dr(){ee.next({})}function tr(ze){if(n instanceof Window||n instanceof Document||n===document.body)return!0;var Ke=n.getBoundingClientRect();return ze[0]>=0&&ze[1]>=0&&ze[0]0)&&(null!==(pe=le.values.uDoubleSided)&&void 0!==pe&&pe.ref.value?("opaque"!==(null===(me=le.values.dTransparentBackfaces)||void 0===me?void 0:me.ref.value)&&M(le,"colorBlended",2),M(le,"colorBlended",1)):M(le,"colorBlended",0))}xt&&r.timer.markEnd("Renderer.renderBlendedTransparent")};return{clear:function(V,ee){i.enable(a.SCISSOR_TEST),i.enable(a.DEPTH_TEST),i.colorMask(!0,!0,!0,!0),i.depthMask(!0),f&&!ee?i.clearColor(0,0,0,0):V?i.clearColor(d[0],d[1],d[2],1):i.clearColor(1,1,1,1),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},clearDepth:function(V){void 0===V&&(V=!1),i.enable(a.SCISSOR_TEST),V?(i.colorMask(!0,!0,!0,!0),i.clearColor(1,1,1,1),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)):(i.enable(a.DEPTH_TEST),i.depthMask(!0),a.clear(a.DEPTH_BUFFER_BIT))},update:function(V,ee){O.update(A.uView,V.view),O.update(A.uInvView,he.invert(v,V.view)),O.update(A.uProjection,V.projection),O.update(A.uInvProjection,he.invert(S,V.projection)),O.updateIfChanged(A.uIsOrtho,"orthographic"===V.state.mode?1:0),O.update(A.uViewOffset,V.viewOffset.enabled?Be.set(D,16*V.viewOffset.offsetX,16*V.viewOffset.offsetY):Be.set(D,0,0)),O.update(A.uCameraPosition,V.state.position),O.update(A.uCameraDir,b.normalize(x,b.sub(x,V.state.target,V.state.position))),O.updateIfChanged(A.uFar,V.far),O.updateIfChanged(A.uNear,V.near),O.updateIfChanged(A.uFogFar,V.fogFar),O.updateIfChanged(A.uFogNear,V.fogNear),O.updateIfChanged(A.uTransparentBackground,f),O.updateIfChanged(A.uMarkerAverage,ee.markerAverage)},renderPick:function(V,ee,ae,pe,me){xt&&r.timer.mark("Renderer.renderPick"),i.disable(a.BLEND),i.enable(a.DEPTH_TEST),i.depthMask(!0),N(V,ee,pe,0,!1),O.updateIfChanged(A.uPickType,me);for(var de=V.renderables,re=0,te=de.length;re0||ge)&&M(le,"depth",0)}xt&&r.timer.markEnd("Renderer.renderDepthTransparent")},renderMarkingDepth:function(V,ee,ae){xt&&r.timer.mark("Renderer.renderMarkingDepth"),i.disable(a.BLEND),i.enable(a.DEPTH_TEST),i.depthMask(!0),N(V,ee,ae,0,!1),O.updateIfChanged(A.uMarkingType,LT.Depth);for(var pe=V.renderables,me=0,de=pe.length;me0&&M(pe[me],"marking",0);xt&&r.timer.markEnd("Renderer.renderMarkingMask")},renderBlended:function(V,ee){V.hasOpaque&&Z(V,ee,null),V.opacityAverage<1&&ne(V,ee,null)},renderBlendedOpaque:Z,renderBlendedTransparent:ne,renderBlendedVolume:function(V,ee,ae){xt&&r.timer.mark("Renderer.renderBlendedVolume"),i.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),i.enable(a.BLEND),N(V,ee,ae,2,!1);for(var pe=V.renderables,me=0,de=pe.length;me0||"directVolume"===ge.values.dGeometryType.ref.value||"fuzzy"===(null===(de=ge.values.dPointStyle)||void 0===de?void 0:de.ref.value)||"text"===ge.values.dGeometryType.ref.value||Ge)&&M(ge,"colorWboit",0)}xt&&r.timer.markEnd("Renderer.renderWboitTransparent")},renderDpoitOpaque:function(V,ee,ae){var pe,me,de,re;xt&&r.timer.mark("Renderer.renderDpoitOpaque"),i.disable(a.BLEND),i.enable(a.DEPTH_TEST),i.depthMask(!0),N(V,ee,ae,1,!1);for(var te=V.renderables,le=0,ge=te.length;le0||"fuzzy"===(null===(re=xe.values.dPointStyle)||void 0===re?void 0:re.ref.value)||"text"===xe.values.dGeometryType.ref.value||je)&&M(xe,"colorDpoit",0)}xt&&r.timer.markEnd("Renderer.renderDpoitTransparent")},renderDpoitVolume:function(V,ee,ae){xt&&r.timer.mark("Renderer.renderDpoitVolume"),i.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),i.enable(a.BLEND),N(V,ee,ae,2,!1);for(var pe=V.renderables,me=0,de=pe.length;me"+o(l)+""})},e.Trigger=u,e.TriggerKey=function c(l,d){return u.create(void 0,d,l)},(l=u=e.Trigger||(e.Trigger={})).create=function d(h,v,g){return{buttons:h,modifiers:v,code:g}},l.Empty={},l.match=function f(h,v,g){var y=h.buttons,S=h.modifiers;return void 0!==y&&(y===v||Ga.has(y,v))&&(!S||$u.areEqual(S,g))},l.matchKey=function p(h,v,g,y){var S=h.modifiers,C=h.code;return void 0!==C&&(C===v||1===C.length&&4===v.length&&v.startsWith("Key")&&!!y&&1===y.length&&y.toUpperCase()===C.toUpperCase())&&(!S||$u.areEqual(S,g))},l.format=function m(h){var v=[],g=function SWe(e,t){var r=[];return void 0!==e||t?0===e?r.push("mouse hover"):void 0!==e&&(Tm.has(e,Tm.Flag.Primary)&&r.push("left mouse button"),Tm.has(e,Tm.Flag.Secondary)&&r.push("right mouse button"),Tm.has(e,Tm.Flag.Auxilary)&&r.push("wheel/middle mouse button"),Tm.has(e,Tm.Flag.Forth)&&r.push("three fingers")):r.push("any mouse button"),r.join(" + ")}(h.buttons,h.code);g&&v.push(g);var y=function xWe(e){return e?.startsWith("Key")&&(e=e.substring(3)),e&&function R_e(e){return Mh(Gq(e))}(e).toLowerCase()}(h.code);y&&v.push(y);var S=function CWe(e,t){var r=[];return e?(e.alt&&r.push("alt key"),e.control&&r.push("control key"),e.meta&&r.push("meta/command key"),e.shift&&r.push("shift key"),t&&0===r.length&&r.push("no key")):t&&r.push("any key"),r.join(" + ")}(h.modifiers);return S&&v.push(S),v.join(" + ")}}(Dt||(Dt={}));var kN,UT,Tm=Ga,Dm=Ga,Ju=$u,Em=Dt.Trigger,gu=Dt.TriggerKey,ore={dragRotate:Dt([Em(Dm.Flag.Primary,Ju.create())],"Rotate","Drag using ${triggers}"),dragRotateZ:Dt([Em(Dm.Flag.Primary,Ju.create({shift:!0,control:!0}))],"Rotate around z-axis (roll)","Drag using ${triggers}"),dragPan:Dt([Em(Dm.Flag.Secondary,Ju.create()),Em(Dm.Flag.Primary,Ju.create({control:!0}))],"Pan","Drag using ${triggers}"),dragZoom:Dt.Empty,dragFocus:Dt([Em(Dm.Flag.Forth,Ju.create())],"Focus","Drag using ${triggers}"),dragFocusZoom:Dt([Em(Dm.Flag.Auxilary,Ju.create())],"Focus and zoom","Drag using ${triggers}"),scrollZoom:Dt([Em(Dm.Flag.Auxilary,Ju.create())],"Zoom","Scroll using ${triggers}"),scrollFocus:Dt([Em(Dm.Flag.Auxilary,Ju.create({shift:!0}))],"Clip","Scroll using ${triggers}"),scrollFocusZoom:Dt.Empty,keyMoveForward:Dt([gu("KeyW")],"Move forward","Press ${triggers}"),keyMoveBack:Dt([gu("KeyS")],"Move back","Press ${triggers}"),keyMoveLeft:Dt([gu("KeyA")],"Move left","Press ${triggers}"),keyMoveRight:Dt([gu("KeyD")],"Move right","Press ${triggers}"),keyMoveUp:Dt([gu("KeyR")],"Move up","Press ${triggers}"),keyMoveDown:Dt([gu("KeyF")],"Move down","Press ${triggers}"),keyRollLeft:Dt([gu("KeyQ")],"Roll left","Press ${triggers}"),keyRollRight:Dt([gu("KeyE")],"Roll right","Press ${triggers}"),keyPitchUp:Dt([gu("ArrowUp",Ju.create({shift:!0}))],"Pitch up","Press ${triggers}"),keyPitchDown:Dt([gu("ArrowDown",Ju.create({shift:!0}))],"Pitch down","Press ${triggers}"),keyYawLeft:Dt([gu("ArrowLeft",Ju.create({shift:!0}))],"Yaw left","Press ${triggers}"),keyYawRight:Dt([gu("ArrowRight",Ju.create({shift:!0}))],"Yaw right","Press ${triggers}"),boostMove:Dt([gu("ShiftLeft")],"Boost move","Press ${triggers}"),enablePointerLock:Dt([gu("Space",Ju.create({control:!0}))],"Enable pointer lock","Press ${triggers}")},sre={noScroll:T.Boolean(!0,{isHidden:!0}),rotateSpeed:T.Numeric(5,{min:1,max:10,step:1}),zoomSpeed:T.Numeric(7,{min:1,max:15,step:1}),panSpeed:T.Numeric(1,{min:.1,max:5,step:.1}),moveSpeed:T.Numeric(.75,{min:.1,max:3,step:.1}),boostMoveFactor:T.Numeric(5,{min:.1,max:10,step:.1}),flyMode:T.Boolean(!1),animate:T.MappedStatic("off",{off:T.EmptyGroup(),spin:T.Group({speed:T.Numeric(1,{min:-20,max:20,step:1})},{description:"Spin the 3D scene around the x-axis in view space"}),rock:T.Group({speed:T.Numeric(.3,{min:-5,max:5,step:.1}),angle:T.Numeric(10,{min:0,max:90,step:1},{description:"How many degrees to rotate in each direction."})},{description:"Rock the 3D scene around the x-axis in view space"})}),staticMoving:T.Boolean(!0,{isHidden:!0}),dynamicDampingFactor:T.Numeric(.2,{},{isHidden:!0}),minDistance:T.Numeric(.01,{},{isHidden:!0}),maxDistance:T.Numeric(1e150,{},{isHidden:!0}),gestureScaleFactor:T.Numeric(1,{},{isHidden:!0}),maxWheelDelta:T.Numeric(.02,{},{isHidden:!0}),bindings:T.Value(ore,{isHidden:!0}),autoAdjustMinMaxDistance:T.MappedStatic("on",{off:T.EmptyGroup(),on:T.Group({minDistanceFactor:T.Numeric(0),minDistancePadding:T.Numeric(5),maxDistanceFactor:T.Numeric(10),maxDistanceMin:T.Numeric(20)})},{isHidden:!0})};!function(e){e.create=function t(r,n,a,i){void 0===i&&(i={});var o=R(R(R({},T.getDefaultValues(sre)),i),{bindings:R(R({},ore),i.bindings)}),s=o.bindings,u=eo.clone(n.viewport),c=!1,l=r.drag.subscribe(function Ct(Ke){var gt=Ke.x,Wt=Ke.y,wr=Ke.pageX,ca=Ke.pageY,xa=Ke.buttons,Wo=Ke.modifiers,Zc=Ke.isStart,Yo=St(gt,Wt);if((!Zc||!Yo)&&(Zc||C)){C=!0,Qm();var xp=Dt.match(s.dragRotate,xa,Wo),$m=Dt.match(s.dragRotateZ,xa,Wo),Jm=Dt.match(s.dragPan,xa,Wo),Qy=Dt.match(s.dragZoom,xa,Wo),io=Dt.match(s.dragFocus,xa,Wo),Yd=Dt.match(s.dragFocusZoom,xa,Wo);K(wr,ca),function W(Ke,gt){Be.set(k,(Ke-u.x)/u.width,(gt-u.y)/u.height)}(wr,ca);var ys=r.pixelRatio,sE=(gt*ys-u.width/2-u.x)/u.width,uE=-(r.height-Wt*ys-u.height/2-u.y)/u.height;if(Zc&&(xp&&(Be.copy(w,$),Be.copy(D,w)),$m&&(Be.set(M,sE,uE),Be.copy(I,M)),(Qy||Yd)&&(Be.copy(U,k),Be.copy(H,U)),io&&(Be.copy(z,k),Be.copy(G,z)),Jm&&(Be.copy(J,k),Be.copy(X,J))),xp&&Be.copy(w,$),$m&&Be.set(M,sE,uE),(Qy||Yd)&&Be.copy(H,k),io&&Be.copy(G,k),Yd){var Yv=b.distance(n.state.position,n.state.target);n.setState({radius:Yv/5})}Jm&&Be.copy(X,k)}}),d=r.interactionEnd.subscribe(function bt(){C=!1}),f=r.wheel.subscribe(function Mt(Ke){var wr=Ke.spinX,ca=Ke.spinY,xa=Ke.dz,Wo=Ke.buttons,Zc=Ke.modifiers;if(!St(Ke.x,Ke.y)){var Yo=function T_e(){for(var e=[],t=0;tn&&(r=o,n=s)}return r}(.075*wr,.075*ca,1e-4*xa);Yo<-o.maxWheelDelta?Yo=-o.maxWheelDelta:Yo>o.maxWheelDelta&&(Yo=o.maxWheelDelta),Dt.match(s.scrollZoom,Wo,Zc)&&(H[1]+=Yo),Dt.match(s.scrollFocus,Wo,Zc)&&(G[1]+=Yo)}}),p=r.pinch.subscribe(function Rt(Ke){var gt=Ke.fractionDelta;Dt.match(s.scrollZoom,Ke.buttons,Ke.modifiers)&&(C=!0,H[1]+=o.gestureScaleFactor*gt)}),m=r.gesture.subscribe(function oe(Ke){C=!0,H[1]+=o.gestureScaleFactor*Ke.deltaScale}),h=r.keyDown.subscribe(function Ce(Ke){var gt=Ke.modifiers,Wt=Ke.code,wr=Ke.key;St(Ke.x,Ke.y)||(Dt.matchKey(s.keyMoveForward,Wt,gt,wr)?Ie.moveForward=1:Dt.matchKey(s.keyMoveBack,Wt,gt,wr)?Ie.moveBack=1:Dt.matchKey(s.keyMoveLeft,Wt,gt,wr)?Ie.moveLeft=1:Dt.matchKey(s.keyMoveRight,Wt,gt,wr)?Ie.moveRight=1:Dt.matchKey(s.keyMoveUp,Wt,gt,wr)?Ie.moveUp=1:Dt.matchKey(s.keyMoveDown,Wt,gt,wr)?Ie.moveDown=1:Dt.matchKey(s.keyRollLeft,Wt,gt,wr)?Ie.rollLeft=1:Dt.matchKey(s.keyRollRight,Wt,gt,wr)?Ie.rollRight=1:Dt.matchKey(s.keyPitchUp,Wt,gt,wr)?Ie.pitchUp=1:Dt.matchKey(s.keyPitchDown,Wt,gt,wr)?Ie.pitchDown=1:Dt.matchKey(s.keyYawLeft,Wt,gt,wr)?Ie.yawLeft=1:Dt.matchKey(s.keyYawRight,Wt,gt,wr)&&(Ie.yawRight=1),Dt.matchKey(s.boostMove,Wt,gt,wr)&&(Ie.boostMove=1),Dt.matchKey(s.enablePointerLock,Wt,gt,wr)&&r.requestPointerLock(u))}),v=r.keyUp.subscribe(function Qe(Ke){var gt,Wt,wr,ca,xa,Wo,Zc,Yo,xp,$m,Jm,Qy,io=Ke.modifiers,Yd=Ke.code,ys=Ke.key;if(!St(Ke.x,Ke.y)){var Yv=!1;Yd.startsWith("Alt")?(Yv=!0,io.alt=!0):Yd.startsWith("Shift")?(Yv=!0,io.shift=!0):Yd.startsWith("Control")?(Yv=!0,io.control=!0):Yd.startsWith("Meta")&&(Yv=!0,io.meta=!0);var xu=[];Yv?(Ie.moveForward&&xu.push((null===(gt=s.keyMoveForward.triggers[0])||void 0===gt?void 0:gt.code)||""),Ie.moveBack&&xu.push((null===(Wt=s.keyMoveBack.triggers[0])||void 0===Wt?void 0:Wt.code)||""),Ie.moveLeft&&xu.push((null===(wr=s.keyMoveLeft.triggers[0])||void 0===wr?void 0:wr.code)||""),Ie.moveRight&&xu.push((null===(ca=s.keyMoveRight.triggers[0])||void 0===ca?void 0:ca.code)||""),Ie.moveUp&&xu.push((null===(xa=s.keyMoveUp.triggers[0])||void 0===xa?void 0:xa.code)||""),Ie.moveDown&&xu.push((null===(Wo=s.keyMoveDown.triggers[0])||void 0===Wo?void 0:Wo.code)||""),Ie.rollLeft&&xu.push((null===(Zc=s.keyRollLeft.triggers[0])||void 0===Zc?void 0:Zc.code)||""),Ie.rollRight&&xu.push((null===(Yo=s.keyRollRight.triggers[0])||void 0===Yo?void 0:Yo.code)||""),Ie.pitchUp&&xu.push((null===(xp=s.keyPitchUp.triggers[0])||void 0===xp?void 0:xp.code)||""),Ie.pitchDown&&xu.push((null===($m=s.keyPitchDown.triggers[0])||void 0===$m?void 0:$m.code)||""),Ie.yawLeft&&xu.push((null===(Jm=s.keyYawLeft.triggers[0])||void 0===Jm?void 0:Jm.code)||""),Ie.yawRight&&xu.push((null===(Qy=s.keyYawRight.triggers[0])||void 0===Qy?void 0:Qy.code)||"")):xu.push(Yd);for(var x5=0,tue=xu;x5Ke*Ke&&(b.setMagnitude(x,x,Ke),b.add(n.position,n.target,x),Be.copy(U,H),Be.copy(z,G)),b.squaredMagnitude(x)u.x+u.width||r.height-gt>u.y+u.height||Ke0&&("spin"===o.animate.name?function ao(Ke){if("spin"===o.animate.name&&0!==o.animate.params.speed&&!C){var gt=o.animate.params.speed/1e3;Qn[0]=60*Math.min(Math.abs(Ke),125)/1e3*gt,Be.add(w,D,Qn)}}(gt):"rock"===o.animate.name&&function Wd(Ke){if("rock"===o.animate.name&&0!==o.animate.params.speed&&!C){var gt=Ke/1e3*o.animate.params.speed,Wt=Yr(o.animate.params.angle)/q(),wr=Math.sin(ja*Math.PI*2)*Wt,ca=Math.sin((ja+gt)*Math.PI*2)*Wt;Gi[0]=ca-wr,Be.add(w,D,Gi),(ja+=gt)>=1&&(ja=0)}}(gt)),b.sub(x,n.position,n.target),function re(){var Ke=w[0]-D[0],gt=w[1]-D[1];b.set(de,Ke,gt,0);var Wt=b.magnitude(de)*q();Wt?(b.sub(x,n.position,n.target),b.normalize(ae,x),b.normalize(pe,n.up),b.normalize(me,b.cross(me,pe,ae)),b.setMagnitude(pe,pe,gt),b.setMagnitude(me,me,Ke),b.add(de,pe,me),b.normalize(V,b.cross(V,de,x)),hn.setAxisAngle(ee,V,Wt),b.transformQuat(x,x,ee),b.transformQuat(n.up,n.up,ee),b.copy(A,V),E=Wt):!o.staticMoving&&E&&(E*=Math.sqrt(1-o.dynamicDampingFactor),b.sub(x,n.position,n.target),hn.setAxisAngle(ee,A,E),b.transformQuat(x,x,ee),b.transformQuat(n.up,n.up,ee)),Be.copy(D,w)}(),function ge(){var Ke=(Ie.rollRight-Ie.rollLeft)/45,gt=(M[0]-I[0])*-Math.sign(M[1]),Wt=(M[1]-I[1])*-Math.sign(M[0]),wr=-o.rotateSpeed*(-gt+Wt)+Ke;wr?(b.normalize(le,x),hn.setAxisAngle(te,le,wr),b.transformQuat(n.up,n.up,te),F=wr):!o.staticMoving&&F&&(F*=Math.sqrt(1-o.dynamicDampingFactor),b.normalize(le,x),hn.setAxisAngle(te,le,F),b.transformQuat(n.up,n.up,te)),Be.copy(I,M)}(),function je(){var gt=(Ie.pitchUp-Ie.pitchDown)/(o.flyMode?360:90)*-o.rotateSpeed;gt?(b.cross(Ge,x,n.up),b.normalize(Ge,Ge),hn.setAxisAngle(xe,Ge,gt),b.transformQuat(x,x,xe),b.transformQuat(n.up,n.up,xe),N=gt):!o.staticMoving&&N&&(N*=Math.sqrt(1-o.dynamicDampingFactor),b.cross(Ge,x,n.up),b.normalize(Ge,Ge),hn.setAxisAngle(xe,Ge,N),b.transformQuat(x,x,xe),b.transformQuat(n.up,n.up,xe))}(),function ye(){var gt=(Ie.yawRight-Ie.yawLeft)/(o.flyMode?360:90)*-o.rotateSpeed;gt?(b.normalize(Q,n.up),hn.setAxisAngle(L,Q,gt),b.transformQuat(x,x,L),b.transformQuat(n.up,n.up,L),j=gt):!o.staticMoving&&j&&(j*=Math.sqrt(1-o.dynamicDampingFactor),b.normalize(Q,n.up),hn.setAxisAngle(L,Q,j),b.transformQuat(x,x,L),b.transformQuat(n.up,n.up,L))}(),function we(){var Ke=1+(H[1]-U[1])*o.zoomSpeed;1!==Ke&&Ke>0&&b.scale(x,x,Ke),o.staticMoving?Be.copy(U,H):U[1]+=(H[1]-U[1])*o.dynamicDampingFactor}(),function De(){var Ke=(G[1]-z[1])*o.zoomSpeed;if(0!==Ke){var gt=Math.max(1,n.state.radius+n.state.radius*Ke);n.setState({radius:gt})}o.staticMoving?Be.copy(z,G):z[1]+=(G[1]-z[1])*o.dynamicDampingFactor}(),function $e(){if(Be.sub(Oe,Be.copy(Oe,X),J),Be.squaredMagnitude(Oe)){var Ke=r.pixelRatio*o.panSpeed;Oe[0]*=1/n.zoom*n.viewport.width*Ke,Oe[1]*=1/n.zoom*n.viewport.height*Ke,b.cross(Ue,b.copy(Ue,x),n.up),b.setMagnitude(Ue,Ue,Oe[0]),b.setMagnitude(Ne,n.up,Oe[1]),b.add(Ue,Ue,Ne),b.add(n.position,n.position,Ue),b.add(n.target,n.target,Ue),o.staticMoving?Be.copy(J,X):(Be.sub(Oe,X,J),Be.scale(Oe,Oe,o.dynamicDampingFactor),Be.add(J,J,Oe))}}(),b.add(n.position,n.target,x),ut(),wt>0&&function mt(Ke){b.sub(Je,n.position,n.target);var gt=Math.max(n.state.minNear,o.minDistance);b.setMagnitude(Je,Je,gt);var Wt=.06*Ke*o.moveSpeed*(1===Ie.boostMove?o.boostMoveFactor:1);if(1===Ie.moveForward&&(b.normalize(He,Je),b.scaleAndSub(n.position,n.position,He,Wt),(o.flyMode||r.pointerLock)&&b.sub(n.target,n.position,Je)),1===Ie.moveBack&&(b.normalize(He,Je),b.scaleAndAdd(n.position,n.position,He,Wt),(o.flyMode||r.pointerLock)&&b.sub(n.target,n.position,Je)),1===Ie.moveLeft&&(b.cross(He,Je,n.up),b.normalize(He,He),o.flyMode||r.pointerLock?(b.scaleAndAdd(n.position,n.position,He,Wt),b.sub(n.target,n.position,Je)):(b.scaleAndSub(n.position,n.position,He,Wt),b.sub(n.target,n.position,x))),1===Ie.moveRight&&(b.cross(He,Je,n.up),b.normalize(He,He),o.flyMode||r.pointerLock?(b.scaleAndSub(n.position,n.position,He,Wt),b.sub(n.target,n.position,Je)):(b.scaleAndAdd(n.position,n.position,He,Wt),b.sub(n.target,n.position,x))),1===Ie.moveUp&&(b.normalize(He,n.up),o.flyMode||r.pointerLock?(b.scaleAndAdd(n.position,n.position,He,Wt),b.sub(n.target,n.position,Je)):(b.scaleAndSub(n.position,n.position,He,Wt),b.sub(n.target,n.position,x))),1===Ie.moveDown&&(b.normalize(He,n.up),o.flyMode||r.pointerLock?(b.scaleAndSub(n.position,n.position,He,Wt),b.sub(n.target,n.position,Je)):(b.scaleAndAdd(n.position,n.position,He,Wt),b.sub(n.target,n.position,x))),o.flyMode||r.pointerLock){var wr=b.distance(n.position,a.boundingSphereVisible.center);n.setState({minFar:wr+a.boundingSphereVisible.radius})}}(Math.min(gt,250)),b.sub(x,n.position,n.target),ut(),b.squaredDistance(_,n.position)>mn&&b.copy(_,n.position),wt=Ke}}function Et(){b.sub(Je,n.position,n.target);var Ke=Math.max(n.state.minNear,o.minDistance);b.setMagnitude(Je,Je,Ke),b.sub(n.target,n.position,Je);var gt=b.distance(n.position,a.boundingSphereVisible.center);n.setState({minFar:gt+a.boundingSphereVisible.radius})}function At(){var Ke=a.boundingSphereVisible,gt=Ke.center,Wt=Ke.radius;if(b.distance(n.position,gt)>Wt){var ca=n.getFocus(gt,Wt);n.setState(R(R({},ca),{minFar:0}))}else n.setState({minFar:0,radius:a.boundingSphereVisible.radius})}var Qn=Be.create(.005,0),ja=0,Gi=Be.create(.005,0);function Qm(){ja=0}return{viewport:u,get isAnimating(){return"off"!==o.animate.name},get isMoving(){return 1===Ie.moveForward||1===Ie.moveBack||1===Ie.moveLeft||1===Ie.moveRight||1===Ie.moveUp||1===Ie.moveDown||1===Ie.rollLeft||1===Ie.rollRight||1===Ie.pitchUp||1===Ie.pitchDown||1===Ie.yawLeft||1===Ie.yawRight},get props(){return o},setProps:function(Ke){var gt;"rock"===(null===(gt=Ke.animate)||void 0===gt?void 0:gt.name)&&"rock"!==o.animate.name&&Qm(),void 0!==Ke.flyMode&&Ke.flyMode!==o.flyMode&&(Ke.flyMode?Et():At()),Object.assign(o,Ke),Object.assign(s,Ke.bindings)},start:function ze(Ke){wt=-1,Le(Ke)},update:Le,reset:function it(){b.copy(n.target,Z),b.copy(n.position,ne),b.copy(n.up,Y),b.sub(x,n.position,n.target),b.copy(_,n.position)},dispose:function fn(){c||(c=!0,l.unsubscribe(),f.unsubscribe(),p.unsubscribe(),m.unsubscribe(),d.unsubscribe(),h.unsubscribe(),v.unsubscribe(),g.unsubscribe(),y.unsubscribe(),S.unsubscribe())}}}}(kN||(kN={})),function(e){e.create=function t(){return{view:he.identity(),position:b.create(0,0,0),direction:b.create(0,0,-1),up:b.create(0,1,0)}};var r=b.zero();e.update=function n(a){b.add(r,a.position,a.direction),he.lookAt(a.view,a.position,r,a.up)}}(UT||(UT={}));var xy,_We=function(){function e(){this.removeList=rF(),this.removeMap=new Map,this.addList=rF(),this.addMap=new Map}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.removeList.count&&0===this.addList.count},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.removeMap.size+this.addMap.size},enumerable:!1,configurable:!0}),e.prototype.add=function(t){if(this.removeMap.has(t)){var r=this.removeMap.get(t);this.removeMap.delete(t),this.removeList.remove(r)}if(!this.addMap.has(t)){var n=this.addList.addLast(t);this.addMap.set(t,n)}},e.prototype.remove=function(t){if(this.addMap.has(t)){var r=this.addMap.get(t);this.addMap.delete(t),this.addList.remove(r)}if(!this.removeMap.has(t)){var n=this.removeList.addLast(t);this.removeMap.set(t,n)}},e.prototype.tryGetRemove=function(){var t=this.removeList.removeFirst();return t&&this.removeMap.delete(t),t},e.prototype.tryGetAdd=function(){var t=this.addList.removeFirst();return t&&this.addMap.delete(t),t},e}(),U2=new Lu("98");function ure(e,t,r){U2.reset();for(var n=0,a=e.length;nz)return!1;for(;;){var X;if(!(X=I.tryGetAdd()))break;if(D(X),++J%100==0&&ia()-G>z)return!1}return i.sort(wWe),f=!0,p=!0,m=!0,!0}(z)},get commitQueueSize(){return I.size},get needsCommit(){return!I.isEmpty},has:function(z){return a.has(z)},clear:function(){for(var z=0,G=i.length;z0?G/z:0}(),f=!1),h},get opacityAverage(){return p&&(v=function U(){var z,G;if(0===u.length)return 0;for(var J=0,X=0,Z=0,ne=u.length;Z0?X/J:0}(),p=!1),v},get hasOpaque(){return m&&(g=function H(){var z;if(0===u.length)return!1;for(var G=0,J=u.length;G0)&&za.copySnapshot(this._source,this.camera.state),this.inTransition||za.copySnapshot(this._target,this.camera.state),za.copySnapshot(this._target,t),this._target.radius>this._target.radiusMax&&(this._target.radius=this._target.radiusMax),this._target.radius<.01&&(this._target.radius=.01),this._target.radiusMax<.01&&(this._target.radiusMax=.01),!this.inTransition&&r<=0||typeof t.mode<"u"&&t.mode!==this.camera.state.mode?this.finish(this._target):(this.inTransition=!0,this.func=n||e.defaultTransition,(!this.inTransition||r>0)&&(this.start=this.t,this.durationMs=r))},e.prototype.tick=function(t){this.t=t,this.update()},e.prototype.finish=function(t){za.copySnapshot(this.camera.state,t),this.inTransition=!1},e.prototype.update=function(){if(this.inTransition){var t=Math.min((this.t-this.start)/this.durationMs,1);if(1===t)return void this.finish(this._target);this.func(this._current,t,this._source,this._target),za.copySnapshot(this.camera.state,this._current)}},e}();!function(e){var t=hn.identity();e.defaultTransition=function r(n,a,i,o){za.copySnapshot(n,o),hn.slerp(t,hn.Identity,hn.rotationTo(t,i.up,o.up),a),b.transformQuat(n.up,i.up,t),b.lerp(n.target,i.target,o.target,a),b.lerp(n.position,i.position,o.position,a),n.radius=ta(i.radius,o.radius,a),n.radiusMax=ta(i.radiusMax,o.radiusMax,a),n.fov=ta(i.fov,o.fov,a),n.fog=ta(i.fog,o.fog,a)}}(LN||(LN={}));var cre=b(),lre=b(),VT=dr(),za=function(){function e(t,r,n){void 0===r&&(r=eo.create(0,0,128,128)),void 0===n&&(n={}),this.view=he.identity(),this.projection=he.identity(),this.projectionView=he.identity(),this.inverseProjectionView=he.identity(),this.state=e.createDefaultSnapshot(),this.viewOffset=e.ViewOffset(),this.near=1,this.far=1e4,this.fogNear=5e3,this.fogFar=1e4,this.zoom=1,this.transition=new LN(this),this.stateChanged=new Ai(this.state),this.prevProjection=he.identity(),this.prevView=he.identity(),this.deltaDirection=b(),this.newPosition=b(),this.viewport=r,this.pixelScale=n.pixelScale||1,e.copySnapshot(this.state,t)}return Object.defineProperty(e.prototype,"pixelRatio",{get:function(){return(typeof window<"u"?window.devicePixelRatio:1)*this.pixelScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.state.position},set:function(t){b.copy(this.state.position,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"up",{get:function(){return this.state.up},set:function(t){b.copy(this.state.up,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this.state.target},set:function(t){b.copy(this.state.target,t)},enumerable:!1,configurable:!0}),e.prototype.update=function(){var t=this.state;if(0===t.radiusMax)return!1;var r=2*Math.tan(t.fov/2)*b.distance(t.position,t.target);switch(this.zoom=this.viewport.height/r,function DWe(e){var t=e.state,r=t.radius,n=t.radiusMax,i=t.fog,s=t.minNear;r<.01&&(r=.01);var c=Math.max(t.clipFar?r:n,t.minFar),l=b.distance(e.position,e.target),d=l-r,f=l+c;(d=Math.max(Math.min(n,s),d))===(f=Math.max(s,f))&&(f=d+.01);var m=l-c*(-(50-i)/50),h=f;e.near=d,e.far=f,e.fogNear=m,e.fogFar=h}(this),this.state.mode){case"orthographic":!function AWe(e){var t=e.viewport,r=e.zoom,i=e.viewOffset,o=-t.width/2,s=t.width/2,u=t.height/2,c=-t.height/2,l=(s-o)/(2*r),d=(u-c)/(2*r),f=(s+o)/2,p=(u+c)/2,m=f-l,h=f+l,v=p+d,g=p-d;if(i.enabled){var y=r/(i.width/i.fullWidth),S=r/(i.height/i.fullHeight),C=(s-o)/i.width,_=(u-c)/i.height;h=(m+=C*(i.offsetX/y))+C*(i.width/y),g=(v-=_*(i.offsetY/S))-_*(i.height/S)}he.ortho(e.projection,m,h,v,g,e.near,e.far),he.lookAt(e.view,e.position,e.target,e.up)}(this);break;case"perspective":!function TWe(e){var t=e.viewport.width/e.viewport.height,r=e.near,n=e.far,a=e.viewOffset,i=r*Math.tan(.5*e.state.fov),o=2*i,s=t*o,u=-.5*s;a.enabled&&(u+=a.offsetX*s/a.fullWidth,i-=a.offsetY*o/a.fullHeight,s*=a.width/a.fullWidth,o*=a.height/a.fullHeight),he.perspective(e.projection,u,u+s,i,i-o,r,n),he.lookAt(e.view,e.position,e.target,e.up)}(this);break;default:Sn()}var n=!he.areEqual(this.projection,this.prevProjection,mn)||!he.areEqual(this.view,this.prevView,mn);if(n){if(he.mul(this.projectionView,this.projection,this.view),!he.tryInvert(this.inverseProjectionView,this.projectionView))return he.copy(this.view,this.prevView),he.copy(this.projection,this.prevProjection),he.mul(this.projectionView,this.projection,this.view),!1;he.copy(this.prevView,this.view),he.copy(this.prevProjection,this.projection)}return n},e.prototype.setState=function(t,r){this.transition.apply(t,r),this.stateChanged.next(t)},e.prototype.getSnapshot=function(){return e.copySnapshot(e.createDefaultSnapshot(),this.state)},e.prototype.getTargetDistance=function(t){return e.targetDistance(t,this.state.mode,this.state.fov,this.viewport.width,this.viewport.height)},e.prototype.getFocus=function(t,r,n,a,i){var o,s,u=Math.max(r,.01),c=this.getTargetDistance(u);b.sub(this.deltaDirection,null!==(o=i?.target)&&void 0!==o?o:this.target,null!==(s=i?.position)&&void 0!==s?s:this.position),a&&b.matchDirection(this.deltaDirection,a,this.deltaDirection),b.setMagnitude(this.deltaDirection,this.deltaDirection,c),b.sub(this.newPosition,t,this.deltaDirection);var l=e.copySnapshot(e.createDefaultSnapshot(),this.state);return l.target=b.clone(t),l.radius=u,l.position=b.clone(this.newPosition),n&&b.matchDirection(l.up,n,l.up),l},e.prototype.getCenter=function(t,r){b.sub(this.deltaDirection,this.target,this.position),b.sub(this.newPosition,t,this.deltaDirection);var n=e.copySnapshot(e.createDefaultSnapshot(),this.state);return n.target=b.clone(t),n.position=b.clone(this.newPosition),r&&(n.radius=Math.max(r,.01)),n},e.prototype.getInvariantFocus=function(t,r,n,a){var i=Math.max(r,.01),o=this.getTargetDistance(i);b.copy(this.deltaDirection,a),b.setMagnitude(this.deltaDirection,this.deltaDirection,o),b.sub(this.newPosition,t,this.deltaDirection);var s=e.copySnapshot(e.createDefaultSnapshot(),this.state);return s.target=b.clone(t),s.radius=i,s.position=b.clone(this.newPosition),b.copy(s.up,n),s},e.prototype.focus=function(t,r,n,a,i){r>0&&this.setState(this.getFocus(t,r,a,i),n)},e.prototype.center=function(t,r){this.setState(this.getCenter(t),r)},e.prototype.project=function(t,r){return function gWe(e,t,r,n){var a=r.x,i=r.y,o=r.width,s=r.height;dr.set(Nd,t[0],t[1],t[2],1),dr.transformMat4(Nd,Nd,n);var u=Nd[3];return 0!==u&&(Nd[0]/=u,Nd[1]/=u,Nd[2]/=u),e[0]=(Nd[0]+1)*o*.5+a,e[1]=(Nd[1]+1)*s*.5+i,e[2]=.5*(Nd[2]+1),e[3]=0===u?0:1/u,e}(t,r,this.viewport,this.projectionView)},e.prototype.unproject=function(t,r){return kT(t,r,this.viewport,this.inverseProjectionView)},e.prototype.getPixelSize=function(t){return this.project(VT,t),this.unproject(cre,VT),VT[0]+=1,this.unproject(lre,VT),b.distance(cre,lre)},e}();!function(e){e.ViewOffset=function t(){return{enabled:!1,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}},e.setViewOffset=function r(u,c,l,d,f,p,m){u.fullWidth=c,u.fullHeight=l,u.offsetX=d,u.offsetY=f,u.width=p,u.height=m},e.copyViewOffset=function n(u,c){u.enabled=c.enabled,u.fullWidth=c.fullWidth,u.fullHeight=c.fullHeight,u.offsetX=c.offsetX,u.offsetY=c.offsetY,u.width=c.width,u.height=c.height},e.targetDistance=function a(u,c,l,d,f){var p=Math.max(u,.01),h=f1e3/this.props.maxFps&&(this.prevT=t,this.currentIdentifyT=t,this.identify(this.isInteracting?xv.Drag:xv.Move,t))},e.prototype.leave=function(){this.inside=!1,lr.Loci.isEmpty(this.prevLoci)||(this.prevLoci=lr.Loci.Empty,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers}))},e.prototype.move=function(t,r,n,a,i){this.inside=!0,this.buttons=n,this.button=a,this.modifiers=i,this.endX=t,this.endY=r},e.prototype.click=function(t,r,n,a,i){this.endX=t,this.endY=r,this.buttons=n,this.button=a,this.modifiers=i,this.identify(xv.Click,0)},e.prototype.drag=function(t,r,n,a,i){this.endX=t,this.endY=r,this.buttons=n,this.button=a,this.modifiers=i,this.identify(xv.Drag,0)},e.prototype.modify=function(t){$u.areEqual(t,this.modifiers)||(this.modifiers=t,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:Be.create(this.endX,this.endY),position:this.position}))},e.prototype.outsideViewport=function(t,r){var a=this.input,i=this.camera.viewport;return r*=a.pixelRatio,(t*=a.pixelRatio)>i.x+i.width||a.height-r>i.y+i.height||t 5 ? ((q) < 10 ? 2.0 : ((q) < 11 ? 4.0 : 8.0)) : 1.5))\n\nfloat rgb2luma(vec3 rgb){\n return sqrt(dot(rgb, vec3(0.299, 0.587, 0.114)));\n}\n\nfloat sampleLuma(vec2 uv) {\n return rgb2luma(texture2D(tColor, uv).rgb);\n}\n\nfloat sampleLuma(vec2 uv, float uOffset, float vOffset) {\n uv += uTexSizeInv * vec2(uOffset, vOffset);\n return sampleLuma(uv);\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy * uTexSizeInv;\n vec2 inverseScreenSize = uTexSizeInv;\n\n vec4 colorCenter = texture2D(tColor, coords);\n\n // Luma at the current fragment\n float lumaCenter = rgb2luma(colorCenter.rgb);\n\n // Luma at the four direct neighbours of the current fragment.\n float lumaDown = sampleLuma(coords, 0.0, -1.0);\n float lumaUp = sampleLuma(coords, 0.0, 1.0);\n float lumaLeft = sampleLuma(coords, -1.0, 0.0);\n float lumaRight = sampleLuma(coords, 1.0, 0.0);\n\n // Find the maximum and minimum luma around the current fragment.\n float lumaMin = min(lumaCenter, min(min(lumaDown, lumaUp), min(lumaLeft, lumaRight)));\n float lumaMax = max(lumaCenter, max(max(lumaDown, lumaUp), max(lumaLeft, lumaRight)));\n\n // Compute the delta.\n float lumaRange = lumaMax - lumaMin;\n\n // If the luma variation is lower that a threshold (or if we are in a really dark area),\n // we are not on an edge, don't perform any AA.\n if (lumaRange < max(dEdgeThresholdMin, lumaMax * dEdgeThresholdMax)) {\n gl_FragColor = colorCenter;\n return;\n }\n\n // Query the 4 remaining corners lumas.\n float lumaDownLeft = sampleLuma(coords, -1.0, -1.0);\n float lumaUpRight = sampleLuma(coords, 1.0, 1.0);\n float lumaUpLeft = sampleLuma(coords, -1.0, 1.0);\n float lumaDownRight = sampleLuma(coords, 1.0, -1.0);\n\n // Combine the four edges lumas (using intermediary variables for future computations\n // with the same values).\n float lumaDownUp = lumaDown + lumaUp;\n float lumaLeftRight = lumaLeft + lumaRight;\n\n // Same for corners\n float lumaLeftCorners = lumaDownLeft + lumaUpLeft;\n float lumaDownCorners = lumaDownLeft + lumaDownRight;\n float lumaRightCorners = lumaDownRight + lumaUpRight;\n float lumaUpCorners = lumaUpRight + lumaUpLeft;\n\n // Compute an estimation of the gradient along the horizontal and vertical axis.\n float edgeHorizontal = abs(-2.0 * lumaLeft + lumaLeftCorners) + abs(-2.0 * lumaCenter + lumaDownUp) * 2.0 + abs(-2.0 * lumaRight + lumaRightCorners);\n float edgeVertical = abs(-2.0 * lumaUp + lumaUpCorners) + abs(-2.0 * lumaCenter + lumaLeftRight) * 2.0 + abs(-2.0 * lumaDown + lumaDownCorners);\n\n // Is the local edge horizontal or vertical ?\n bool isHorizontal = (edgeHorizontal >= edgeVertical);\n\n // Choose the step size (one pixel) accordingly.\n float stepLength = isHorizontal ? inverseScreenSize.y : inverseScreenSize.x;\n\n // Select the two neighboring texels lumas in the opposite direction to the local edge.\n float luma1 = isHorizontal ? lumaDown : lumaLeft;\n float luma2 = isHorizontal ? lumaUp : lumaRight;\n // Compute gradients in this direction.\n float gradient1 = luma1 - lumaCenter;\n float gradient2 = luma2 - lumaCenter;\n\n // Which direction is the steepest ?\n bool is1Steepest = abs(gradient1) >= abs(gradient2);\n\n // Gradient in the corresponding direction, normalized.\n float gradientScaled = 0.25 * max(abs(gradient1), abs(gradient2));\n\n // Average luma in the correct direction.\n float lumaLocalAverage = 0.0;\n if(is1Steepest){\n // Switch the direction\n stepLength = -stepLength;\n lumaLocalAverage = 0.5 * (luma1 + lumaCenter);\n } else {\n lumaLocalAverage = 0.5 * (luma2 + lumaCenter);\n }\n\n // Shift UV in the correct direction by half a pixel.\n vec2 currentUv = coords;\n if(isHorizontal){\n currentUv.y += stepLength * 0.5;\n } else {\n currentUv.x += stepLength * 0.5;\n }\n\n // Compute offset (for each iteration step) in the right direction.\n vec2 offset = isHorizontal ? vec2(inverseScreenSize.x, 0.0) : vec2(0.0, inverseScreenSize.y);\n // Compute UVs to explore on each side of the edge, orthogonally.\n // The QUALITY allows us to step faster.\n vec2 uv1 = currentUv - offset * QUALITY(0);\n vec2 uv2 = currentUv + offset * QUALITY(0);\n\n // Read the lumas at both current extremities of the exploration segment,\n // and compute the delta wrt to the local average luma.\n float lumaEnd1 = sampleLuma(uv1);\n float lumaEnd2 = sampleLuma(uv2);\n lumaEnd1 -= lumaLocalAverage;\n lumaEnd2 -= lumaLocalAverage;\n\n // If the luma deltas at the current extremities is larger than the local gradient,\n // we have reached the side of the edge.\n bool reached1 = abs(lumaEnd1) >= gradientScaled;\n bool reached2 = abs(lumaEnd2) >= gradientScaled;\n bool reachedBoth = reached1 && reached2;\n\n // If the side is not reached, we continue to explore in this direction.\n if(!reached1){\n uv1 -= offset * QUALITY(1);\n }\n if(!reached2){\n uv2 += offset * QUALITY(1);\n }\n\n // If both sides have not been reached, continue to explore.\n if(!reachedBoth){\n for(int i = 2; i < dIterations; i++){\n // If needed, read luma in 1st direction, compute delta.\n if(!reached1){\n lumaEnd1 = sampleLuma(uv1);\n lumaEnd1 = lumaEnd1 - lumaLocalAverage;\n }\n // If needed, read luma in opposite direction, compute delta.\n if(!reached2){\n lumaEnd2 = sampleLuma(uv2);\n lumaEnd2 = lumaEnd2 - lumaLocalAverage;\n }\n // If the luma deltas at the current extremities is larger than the local gradient,\n // we have reached the side of the edge.\n reached1 = abs(lumaEnd1) >= gradientScaled;\n reached2 = abs(lumaEnd2) >= gradientScaled;\n reachedBoth = reached1 && reached2;\n\n // If the side is not reached, we continue to explore in this direction,\n // with a variable quality.\n if(!reached1){\n uv1 -= offset * QUALITY(i);\n }\n if(!reached2){\n uv2 += offset * QUALITY(i);\n }\n\n // If both sides have been reached, stop the exploration.\n if(reachedBoth){\n break;\n }\n }\n }\n\n // Compute the distances to each side edge of the edge (!).\n float distance1 = isHorizontal ? (coords.x - uv1.x) : (coords.y - uv1.y);\n float distance2 = isHorizontal ? (uv2.x - coords.x) : (uv2.y - coords.y);\n\n // In which direction is the side of the edge closer ?\n bool isDirection1 = distance1 < distance2;\n float distanceFinal = min(distance1, distance2);\n\n // Thickness of the edge.\n float edgeThickness = (distance1 + distance2);\n\n // Is the luma at center smaller than the local average ?\n bool isLumaCenterSmaller = lumaCenter < lumaLocalAverage;\n\n // If the luma at center is smaller than at its neighbour,\n // the delta luma at each end should be positive (same variation).\n bool correctVariation1 = (lumaEnd1 < 0.0) != isLumaCenterSmaller;\n bool correctVariation2 = (lumaEnd2 < 0.0) != isLumaCenterSmaller;\n\n // Only keep the result in the direction of the closer side of the edge.\n bool correctVariation = isDirection1 ? correctVariation1 : correctVariation2;\n\n // UV offset: read in the direction of the closest side of the edge.\n float pixelOffset = - distanceFinal / edgeThickness + 0.5;\n\n // If the luma variation is incorrect, do not offset.\n float finalOffset = correctVariation ? pixelOffset : 0.0;\n\n // Sub-pixel shifting\n // Full weighted average of the luma over the 3x3 neighborhood.\n float lumaAverage = (1.0 / 12.0) * (2.0 * (lumaDownUp + lumaLeftRight) + lumaLeftCorners + lumaRightCorners);\n // Ratio of the delta between the global average and the center luma,\n // over the luma range in the 3x3 neighborhood.\n float subPixelOffset1 = clamp(abs(lumaAverage - lumaCenter) / lumaRange, 0.0, 1.0);\n float subPixelOffset2 = (-2.0 * subPixelOffset1 + 3.0) * subPixelOffset1 * subPixelOffset1;\n // Compute a sub-pixel offset based on this delta.\n float subPixelOffsetFinal = subPixelOffset2 * subPixelOffset2 * float(dSubpixelQuality);\n\n // Pick the biggest of the two offsets.\n finalOffset = max(finalOffset, subPixelOffsetFinal);\n\n // Compute the final UV coordinates.\n vec2 finalUv = coords;\n if(isHorizontal){\n finalUv.y += finalOffset * stepLength;\n } else {\n finalUv.x += finalOffset * stepLength;\n }\n\n // Read the color at the new UV coordinates, and use it.\n gl_FragColor = texture2D(tColor, finalUv);\n}\n"),$We={edgeThreshold:T.Numeric(.1,{min:.05,max:.15,step:.01}),maxSearchSteps:T.Numeric(16,{min:0,max:32,step:1})},JWe=function(){function e(t,r){if(this.webgl=t,this._supported=!1,typeof HTMLImageElement>"u")Cr&&console.log('Missing "HTMLImageElement" required for "SMAA"');else{var n=r.getWidth(),a=r.getHeight();this.edgesTarget=t.createRenderTarget(n,a,!1,"uint8","linear"),this.weightsTarget=t.createRenderTarget(n,a,!1,"uint8","linear"),this.edgesRenderable=function rYe(e,t){var r=t.getWidth(),n=t.getHeight(),a=R(R({},bi),{tColor:O.create(t),uTexSizeInv:O.create(Be.create(1/r,1/n)),uViewport:O.create(dr()),dEdgeThreshold:O.create(.1)}),i=R({},eYe);return Va(Ua(e,"triangles",tYe,i,a),a)}(t,r),this.weightsRenderable=function iYe(e,t){var r=t.getWidth(),n=t.getHeight(),a=e.resources.texture("image-uint8","rgb","ubyte","linear"),i=e.resources.texture("image-uint8","rgba","ubyte","nearest"),o=R(R({},bi),{tEdges:O.create(t),tArea:O.create(a),tSearch:O.create(i),uTexSizeInv:O.create(Be.create(1/r,1/n)),uViewport:O.create(dr()),dMaxSearchSteps:O.create(16)});GX("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/ko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Jcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII=",o.tArea,a),GX("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII=",o.tSearch,i);var s=R({},nYe);return Va(Ua(e,"triangles",aYe,s,o),o)}(t,this.edgesTarget.texture),this.blendRenderable=function uYe(e,t,r){var n=t.getWidth(),a=t.getHeight(),i=R(R({},bi),{tColor:O.create(t),tWeights:O.create(r),uTexSizeInv:O.create(Be.create(1/n,1/a)),uViewport:O.create(dr())}),o=R({},oYe);return Va(Ua(e,"triangles",sYe,o,i),i)}(t,r,this.weightsTarget.texture),this._supported=!0}}return Object.defineProperty(e.prototype,"supported",{get:function(){return this._supported},enumerable:!1,configurable:!0}),e.prototype.updateState=function(t){var r=this.webgl,n=r.gl,a=r.state;a.enable(n.SCISSOR_TEST),a.disable(n.BLEND),a.disable(n.DEPTH_TEST),a.depthMask(!1);var i=t.x,o=t.y,s=t.width,u=t.height;a.viewport(i,o,s,u),a.scissor(i,o,s,u),a.colorMask(!0,!0,!0,!0),a.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),O.update(this.edgesRenderable.values.uViewport,eo.toVec4(this.edgesRenderable.values.uViewport.ref.value,t)),O.update(this.weightsRenderable.values.uViewport,eo.toVec4(this.weightsRenderable.values.uViewport.ref.value,t)),O.update(this.blendRenderable.values.uViewport,eo.toVec4(this.blendRenderable.values.uViewport.ref.value,t))},e.prototype.setSize=function(t,r){var n=this.edgesTarget.getWidth(),a=this.edgesTarget.getHeight();(t!==n||r!==a)&&(this.edgesTarget.setSize(t,r),this.weightsTarget.setSize(t,r),O.update(this.edgesRenderable.values.uTexSizeInv,Be.set(this.edgesRenderable.values.uTexSizeInv.ref.value,1/t,1/r)),O.update(this.weightsRenderable.values.uTexSizeInv,Be.set(this.weightsRenderable.values.uTexSizeInv.ref.value,1/t,1/r)),O.update(this.blendRenderable.values.uTexSizeInv,Be.set(this.blendRenderable.values.uTexSizeInv.ref.value,1/t,1/r)))},e.prototype.update=function(t,r){var n=!1;this.edgesRenderable.values.tColor.ref.value!==t&&(O.update(this.edgesRenderable.values.tColor,t),n=!0),this.edgesRenderable.values.dEdgeThreshold.ref.value!==r.edgeThreshold&&(O.update(this.edgesRenderable.values.dEdgeThreshold,r.edgeThreshold),n=!0),n&&this.edgesRenderable.update(),this.weightsRenderable.values.dMaxSearchSteps.ref.value!==r.maxSearchSteps&&(O.update(this.weightsRenderable.values.dMaxSearchSteps,r.maxSearchSteps),this.weightsRenderable.update()),this.blendRenderable.values.tColor.ref.value!==t&&(O.update(this.blendRenderable.values.tColor,t),this.blendRenderable.update())},e.prototype.render=function(t,r){xt&&this.webgl.timer.mark("SmaaPass.render"),this.edgesTarget.bind(),this.updateState(t),this.edgesRenderable.render(),this.weightsTarget.bind(),this.updateState(t),this.weightsRenderable.render(),r?r.bind():this.webgl.unbindFramebuffer(),this.updateState(t),this.blendRenderable.render(),xt&&this.webgl.timer.markEnd("SmaaPass.render")},e}(),eYe=R(R({},yi),{tColor:Xt("texture","rgba","ubyte","linear"),uTexSizeInv:Ae("v2"),uViewport:Ae("v4"),dEdgeThreshold:Lt("number")}),tYe=Fn("smaa-edges","\nprecision highp float;\n\nattribute vec2 aPosition;\nuniform vec2 uQuadScale;\n\nuniform vec2 uTexSizeInv;\nuniform vec4 uViewport;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\n\nvoid SMAAEdgeDetectionVS(vec2 texCoord) {\n vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-1.0, 0.0, 0.0, 1.0); // WebGL port note: Changed sign in W component\n vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // WebGL port note: Changed sign in W component\n vOffset[2] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-2.0, 0.0, 0.0, 2.0); // WebGL port note: Changed sign in W component\n}\n\nvoid main() {\n vec2 scale = uViewport.zw * uTexSizeInv;\n vec2 shift = uViewport.xy * uTexSizeInv;\n vUv = (aPosition + 1.0) * 0.5 * scale + shift;\n SMAAEdgeDetectionVS(vUv);\n vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale;\n gl_Position = vec4(position, 0.0, 1.0);\n}\n","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform vec2 uTexSizeInv;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\n\nvec4 SMAAColorEdgeDetectionPS(vec2 texcoord, vec4 offset[3], sampler2D colorTex) {\n vec2 threshold = vec2(dEdgeThreshold, dEdgeThreshold);\n\n // Calculate color deltas:\n vec4 delta;\n vec3 C = texture2D(colorTex, texcoord).rgb;\n\n vec3 Cleft = texture2D(colorTex, offset[0].xy).rgb;\n vec3 t = abs(C - Cleft);\n delta.x = max(max(t.r, t.g), t.b);\n\n vec3 Ctop = texture2D(colorTex, offset[0].zw).rgb;\n t = abs(C - Ctop);\n delta.y = max(max(t.r, t.g), t.b);\n\n // We do the usual threshold:\n vec2 edges = step(threshold, delta.xy);\n\n // Then discard if there is no edge:\n if (dot(edges, vec2(1.0, 1.0 )) == 0.0)\n discard;\n\n // Calculate right and bottom deltas:\n vec3 Cright = texture2D(colorTex, offset[1].xy).rgb;\n t = abs( C - Cright );\n delta.z = max(max(t.r, t.g), t.b);\n\n vec3 Cbottom = texture2D(colorTex, offset[1].zw).rgb;\n t = abs(C - Cbottom);\n delta.w = max(max(t.r, t.g), t.b);\n\n // Calculate the maximum delta in the direct neighborhood:\n float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w );\n\n // Calculate left-left and top-top deltas:\n vec3 Cleftleft = texture2D(colorTex, offset[2].xy).rgb;\n t = abs( C - Cleftleft );\n delta.z = max(max(t.r, t.g), t.b);\n\n vec3 Ctoptop = texture2D(colorTex, offset[2].zw).rgb;\n t = abs(C - Ctoptop);\n delta.w = max(max(t.r, t.g), t.b);\n\n // Calculate the final maximum delta:\n maxDelta = max(max(maxDelta, delta.z), delta.w);\n\n // Local contrast adaptation in action:\n edges.xy *= step(0.5 * maxDelta, delta.xy);\n\n return vec4(edges, 0.0, 0.0);\n}\n\nvoid main() {\n gl_FragColor = SMAAColorEdgeDetectionPS(vUv, vOffset, tColor);\n}\n"),nYe=R(R({},yi),{tEdges:Xt("texture","rgba","ubyte","linear"),tArea:Xt("texture","rgb","ubyte","linear"),tSearch:Xt("texture","rgba","ubyte","nearest"),uTexSizeInv:Ae("v2"),uViewport:Ae("v4"),dMaxSearchSteps:Lt("number")}),aYe=Fn("smaa-weights","\nprecision highp float;\n\nattribute vec2 aPosition;\nuniform vec2 uQuadScale;\n\nuniform vec2 uTexSizeInv;\nuniform vec4 uViewport;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\nvarying vec2 vPixCoord;\n\nvoid SMAABlendingWeightCalculationVS(vec2 texCoord) {\n vPixCoord = texCoord / uTexSizeInv;\n\n // We will use these offsets for the searches later on (see @PSEUDO_GATHER4):\n vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-0.25, 0.125, 1.25, 0.125); // WebGL port note: Changed sign in Y and W components\n vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-0.125, 0.25, -0.125, -1.25); // WebGL port note: Changed sign in Y and W components\n\n // And these for the searches, they indicate the ends of the loops:\n vOffset[2] = vec4(vOffset[0].xz, vOffset[1].yw) + vec4(-2.0, 2.0, -2.0, 2.0) * uTexSizeInv.xxyy * float(dMaxSearchSteps);\n}\n\nvoid main() {\n vec2 scale = uViewport.zw * uTexSizeInv;\n vec2 shift = uViewport.xy * uTexSizeInv;\n vUv = (aPosition + 1.0) * 0.5 * scale + shift;\n SMAABlendingWeightCalculationVS(vUv);\n vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale;\n gl_Position = vec4(position, 0.0, 1.0);\n}\n","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#define SMAASampleLevelZeroOffset(tex, coord, offset) texture2D(tex, coord + float(offset) * uTexSizeInv, 0.0)\n\n#define SMAA_AREATEX_MAX_DISTANCE 16\n#define SMAA_AREATEX_PIXEL_SIZE (1.0 / vec2(160.0, 560.0))\n#define SMAA_AREATEX_SUBTEX_SIZE (1.0 / 7.0)\n\nuniform sampler2D tEdges;\nuniform sampler2D tArea;\nuniform sampler2D tSearch;\nuniform vec2 uTexSizeInv;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\nvarying vec2 vPixCoord;\n\n#if __VERSION__ == 100\n vec2 round(vec2 x) {\n return sign(x) * floor(abs(x) + 0.5);\n }\n#endif\n\nfloat SMAASearchLength(sampler2D searchTex, vec2 e, float bias, float scale) {\n // Not required if searchTex accesses are set to point:\n // float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);\n // e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +\n // e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;\n e.r = bias + e.r * scale;\n return 255.0 * texture2D(searchTex, e, 0.0).r;\n}\n\nfloat SMAASearchXLeft(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n /**\n * @PSEUDO_GATHER4\n * This texCoord has been offset by (-0.25, -0.125) in the vertex shader to\n * sample between edge, thus fetching four edges in a row.\n * Sampling with different offsets in each direction allows to disambiguate\n * which edges are active from the four fetched ones.\n */\n vec2 e = vec2(0.0, 1.0);\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D( edgesTex, texCoord, 0.0).rg;\n texCoord -= vec2(2.0, 0.0) * uTexSizeInv;\n if (!(texCoord.x > end && e.g > 0.8281 && e.r == 0.0)) break;\n }\n\n // We correct the previous (-0.25, -0.125) offset we applied:\n texCoord.x += 0.25 * uTexSizeInv.x;\n\n // The searches are bias by 1, so adjust the coords accordingly:\n texCoord.x += uTexSizeInv.x;\n\n // Disambiguate the length added by the last step:\n texCoord.x += 2.0 * uTexSizeInv.x; // Undo last step\n texCoord.x -= uTexSizeInv.x * SMAASearchLength(searchTex, e, 0.0, 0.5);\n\n return texCoord.x;\n}\n\nfloat SMAASearchXRight(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n vec2 e = vec2( 0.0, 1.0 );\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D(edgesTex, texCoord, 0.0).rg;\n texCoord += vec2(2.0, 0.0) * uTexSizeInv;\n if (!(texCoord.x < end && e.g > 0.8281 && e.r == 0.0)) break;\n }\n\n texCoord.x -= 0.25 * uTexSizeInv.x;\n texCoord.x -= uTexSizeInv.x;\n texCoord.x -= 2.0 * uTexSizeInv.x;\n texCoord.x += uTexSizeInv.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );\n\n return texCoord.x;\n}\n\nfloat SMAASearchYUp(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n vec2 e = vec2( 1.0, 0.0 );\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D(edgesTex, texCoord, 0.0).rg;\n texCoord += vec2(0.0, 2.0) * uTexSizeInv; // WebGL port note: Changed sign\n if (!(texCoord.y > end && e.r > 0.8281 && e.g == 0.0)) break;\n }\n\n texCoord.y -= 0.25 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y -= uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y -= 2.0 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y += uTexSizeInv.y * SMAASearchLength(searchTex, e.gr, 0.0, 0.5); // WebGL port note: Changed sign\n\n return texCoord.y;\n}\n\nfloat SMAASearchYDown(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n vec2 e = vec2( 1.0, 0.0 );\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D(edgesTex, texCoord, 0.0).rg;\n texCoord -= vec2( 0.0, 2.0 ) * uTexSizeInv; // WebGL port note: Changed sign\n if (!(texCoord.y < end && e.r > 0.8281 && e.g == 0.0)) break;\n }\n\n texCoord.y += 0.25 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y += uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y += 2.0 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y -= uTexSizeInv.y * SMAASearchLength(searchTex, e.gr, 0.5, 0.5); // WebGL port note: Changed sign\n\n return texCoord.y;\n}\n\nvec2 SMAAArea(sampler2D areaTex, vec2 dist, float e1, float e2, float offset) {\n // Rounding prevents precision errors of bilinear filtering:\n vec2 texCoord = float(SMAA_AREATEX_MAX_DISTANCE) * round(4.0 * vec2(e1, e2)) + dist;\n\n // We do a scale and bias for mapping to texel space:\n texCoord = SMAA_AREATEX_PIXEL_SIZE * texCoord + (0.5 * SMAA_AREATEX_PIXEL_SIZE);\n\n // Move to proper place, according to the subpixel offset:\n texCoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;\n\n return texture2D(areaTex, texCoord, 0.0).rg;\n}\n\nvec4 SMAABlendingWeightCalculationPS(vec2 texCoord, vec2 pixCoord, vec4 offset[3], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices) {\n vec4 weights = vec4(0.0, 0.0, 0.0, 0.0);\n\n vec2 e = texture2D(edgesTex, texCoord).rg;\n\n if (e.g > 0.0) { // Edge at north\n vec2 d;\n\n // Find the distance to the left:\n vec2 coords;\n coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x );\n coords.y = offset[1].y; // offset[1].y = texCoord.y - 0.25 * uTexSizeInv.y (@CROSSING_OFFSET)\n d.x = coords.x;\n\n // Now fetch the left crossing edges, two at a time using bilinear\n // filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to\n // discern what value each edge has:\n float e1 = texture2D(edgesTex, coords, 0.0).r;\n\n // Find the distance to the right:\n coords.x = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y);\n d.y = coords.x;\n\n // We want the distances to be in pixel units (doing this here allow to\n // better interleave arithmetic and memory accesses):\n d = d / uTexSizeInv.x - pixCoord.x;\n\n // SMAAArea below needs a sqrt, as the areas texture is compressed\n // quadratically:\n vec2 sqrt_d = sqrt(abs(d));\n\n // Fetch the right crossing edges:\n coords.y -= 1.0 * uTexSizeInv.y; // WebGL port note: Added\n float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, ivec2(1, 0)).r;\n\n // Ok, we know how this pattern looks like, now it is time for getting\n // the actual area:\n weights.rg = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.y));\n }\n\n if (e.r > 0.0) { // Edge at west\n vec2 d;\n\n // Find the distance to the top:\n vec2 coords;\n\n coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z );\n coords.x = offset[0].x; // offset[1].x = texCoord.x - 0.25 * uTexSizeInv.x;\n d.x = coords.y;\n\n // Fetch the top crossing edges:\n float e1 = texture2D(edgesTex, coords, 0.0).g;\n\n // Find the distance to the bottom:\n coords.y = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w);\n d.y = coords.y;\n\n // We want the distances to be in pixel units:\n d = d / uTexSizeInv.y - pixCoord.y;\n\n // SMAAArea below needs a sqrt, as the areas texture is compressed\n // quadratically:\n vec2 sqrt_d = sqrt(abs(d));\n\n // Fetch the bottom crossing edges:\n coords.y -= 1.0 * uTexSizeInv.y; // WebGL port note: Added\n float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, ivec2(0, 1)).g;\n\n // Get the area for this direction:\n weights.ba = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.x));\n }\n\n return weights;\n}\n\nvoid main() {\n gl_FragColor = SMAABlendingWeightCalculationPS(vUv, vPixCoord, vOffset, tEdges, tArea, tSearch, ivec4(0.0));\n}\n"),oYe=R(R({},yi),{tColor:Xt("texture","rgba","ubyte","linear"),tWeights:Xt("texture","rgba","ubyte","linear"),uTexSizeInv:Ae("v2"),uViewport:Ae("v4")}),sYe=Fn("smaa-blend","\nprecision highp float;\n\nattribute vec2 aPosition;\nuniform vec2 uQuadScale;\n\nuniform vec2 uTexSizeInv;\nuniform vec4 uViewport;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[2];\n\nvoid SMAANeighborhoodBlendingVS(vec2 texCoord) {\n vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-1.0, 0.0, 0.0, 1.0); // WebGL port note: Changed sign in W component\n vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // WebGL port note: Changed sign in W component\n}\n\nvoid main() {\n vec2 scale = uViewport.zw * uTexSizeInv;\n vec2 shift = uViewport.xy * uTexSizeInv;\n vUv = (aPosition + 1.0) * 0.5 * scale + shift;\n SMAANeighborhoodBlendingVS(vUv);\n vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale;\n gl_Position = vec4(position, 0.0, 1.0);\n}\n","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tWeights;\nuniform sampler2D tColor;\nuniform vec2 uTexSizeInv;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[2];\n\nvec4 SMAANeighborhoodBlendingPS(vec2 texCoord, vec4 offset[2], sampler2D colorTex, sampler2D blendTex) {\n // Fetch the blending weights for current pixel:\n vec4 a;\n a.xz = texture2D(blendTex, texCoord).xz;\n a.y = texture2D(blendTex, offset[1].zw).g;\n a.w = texture2D(blendTex, offset[1].xy).a;\n\n // Is there any blending weight with a value greater than 0.0?\n if (dot(a, vec4(1.0, 1.0, 1.0, 1.0)) < 1e-5) {\n return texture2D(colorTex, texCoord, 0.0);\n } else {\n // Up to 4 lines can be crossing a pixel (one through each edge). We\n // favor blending by choosing the line with the maximum weight for each\n // direction:\n vec2 offset;\n offset.x = a.a > a.b ? a.a : -a.b; // left vs. right\n offset.y = a.g > a.r ? -a.g : a.r; // top vs. bottom // WebGL port note: Changed signs\n\n // Then we go in the direction that has the maximum weight:\n if (abs(offset.x) > abs(offset.y)) { // horizontal vs. vertical\n offset.y = 0.0;\n } else {\n offset.x = 0.0;\n }\n\n // Fetch the opposite color and lerp by hand:\n vec4 C = texture2D(colorTex, texCoord, 0.0);\n texCoord += sign(offset) * uTexSizeInv;\n vec4 Cop = texture2D(colorTex, texCoord, 0.0);\n float s = abs(offset.x) > abs(offset.y) ? abs(offset.x) : abs(offset.y);\n\n // WebGL port note: Added gamma correction\n C.xyz = pow(C.xyz, vec3(2.2));\n Cop.xyz = pow(Cop.xyz, vec3(2.2));\n vec4 mixed = mix(C, Cop, s);\n mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));\n\n return mixed;\n }\n}\n\nvoid main() {\n gl_FragColor = SMAANeighborhoodBlendingPS(vUv, vOffset, tColor, tWeights);\n}\n"),pre={opacity:T.Numeric(1,{min:0,max:1,step:.01}),saturation:T.Numeric(0,{min:-1,max:1,step:.01}),lightness:T.Numeric(0,{min:-1,max:1,step:.01})},pYe=R({faces:T.MappedStatic("urls",{urls:T.Group({nx:T.Text("",{label:"Negative X / Left"}),ny:T.Text("",{label:"Negative Y / Bottom"}),nz:T.Text("",{label:"Negative Z / Back"}),px:T.Text("",{label:"Positive X / Right"}),py:T.Text("",{label:"Positive Y / Top"}),pz:T.Text("",{label:"Positive Z / Front"})},{isExpanded:!0,label:"URLs"}),files:T.Group({nx:T.File({label:"Negative X / Left",accept:"image/*"}),ny:T.File({label:"Negative Y / Bottom",accept:"image/*"}),nz:T.File({label:"Negative Z / Back",accept:"image/*"}),px:T.File({label:"Positive X / Right",accept:"image/*"}),py:T.File({label:"Positive Y / Top",accept:"image/*"}),pz:T.File({label:"Positive Z / Front",accept:"image/*"})},{isExpanded:!0,label:"Files"})}),blur:T.Numeric(0,{min:0,max:1,step:.01},{description:'Note, this only works in WebGL2 or when "EXT_shader_texture_lod" is available.'})},pre),mYe=R(R({source:T.MappedStatic("url",{url:T.Text(""),file:T.File({accept:"image/*"})}),blur:T.Numeric(0,{min:0,max:1,step:.01},{description:'Note, this only works in WebGL2 or with power-of-two images and when "EXT_shader_texture_lod" is available.'})},pre),{coverage:T.Select("viewport",T.arrayToOptions(["viewport","canvas"]))}),hYe={topColor:T.Color(dt(14540253)),bottomColor:T.Color(dt(15658734)),ratio:T.Numeric(.5,{min:0,max:1,step:.01}),coverage:T.Select("viewport",T.arrayToOptions(["viewport","canvas"]))},vYe={centerColor:T.Color(dt(14540253)),edgeColor:T.Color(dt(15658734)),ratio:T.Numeric(.5,{min:0,max:1,step:.01}),coverage:T.Select("viewport",T.arrayToOptions(["viewport","canvas"]))},gYe={variant:T.MappedStatic("off",{off:T.EmptyGroup(),skybox:T.Group(pYe,{isExpanded:!0}),image:T.Group(mYe,{isExpanded:!0}),horizontalGradient:T.Group(hYe,{isExpanded:!0}),radialGradient:T.Group(vYe,{isExpanded:!0})},{label:"Environment"})},yYe=function(){function e(t,r,n,a){this.webgl=t,this.assetManager=r,this.camera=new za,this.target=b(),this.position=b(),this.dir=b(),this.renderable=function DYe(e,t,r){var n={drawCount:O.create(6),instanceCount:O.create(1),aPosition:O.create(v4),tSkybox:O.create(Ao()),tImage:O.create(Ao()),uImageScale:O.create(Be()),uImageOffset:O.create(Be()),uTexSize:O.create(Be.create(t,r)),uViewport:O.create(dr()),uViewportAdjusted:O.create(!0),uViewDirectionProjectionInverse:O.create(he()),uGradientColorA:O.create(b()),uGradientColorB:O.create(b()),uGradientRatio:O.create(.5),uBlur:O.create(0),uOpacity:O.create(1),uSaturation:O.create(0),uLightness:O.create(0),dVariant:O.create("skybox")},a=R({},AYe);return Va(Ua(e,"triangles",TYe,a,n),n)}(t,n,a)}return e.prototype.setSize=function(t,r){var n=this.renderable.values.uTexSize.ref.value;(t!==n[0]||r!==n[1])&&O.update(this.renderable.values.uTexSize,Be.set(this.renderable.values.uTexSize.ref.value,t,r))},e.prototype.clearSkybox=function(){var t=this;void 0!==this.skybox&&(this.skybox.texture.destroy(),this.skybox.assets.forEach(function(r){return t.assetManager.release(r)}),this.skybox=void 0)},e.prototype.updateSkybox=function(t,r,n){var i,a=this,o=null===(i=this.skybox)||void 0===i?void 0:i.props.faces,s=r.faces.params;if(!(s.nx&&s.ny&&s.nz&&s.px&&s.py&&s.pz))return this.clearSkybox(),void n?.(!1);if(this.skybox&&o&&function CYe(e,t){return hre(e)===hre(t)}(r.faces,this.skybox.props.faces))n?.(!1);else{this.clearSkybox();var u=function xYe(e,t,r,n){var a=function bYe(e,t){return"urls"===t.name?{nx:dn.getUrlAsset(e,t.params.nx),ny:dn.getUrlAsset(e,t.params.ny),nz:dn.getUrlAsset(e,t.params.nz),px:dn.getUrlAsset(e,t.params.px),py:dn.getUrlAsset(e,t.params.py),pz:dn.getUrlAsset(e,t.params.pz)}:{nx:t.params.nx,ny:t.params.ny,nz:t.params.nz,px:t.params.px,py:t.params.py,pz:t.params.pz}}(t,r),i=function SYe(e,t){var r=function(n){return e.resolve(n,"binary").run().then(function(a){return new Blob([a.data])})};return{nx:r(t.nx),ny:r(t.ny),nz:r(t.nz),px:r(t.px),py:r(t.py),pz:r(t.pz)}}(t,a),o=[a.nx,a.ny,a.nz,a.px,a.py,a.pz];return typeof HTMLImageElement>"u"?(console.error('Missing "HTMLImageElement" required for background skybox'),n?.(!0),{texture:Ao(),assets:o}):{texture:e.resources.cubeTexture(i,!0,n),assets:o}}(this.webgl,this.assetManager,r.faces,function(p){a.skybox&&(a.skybox.loaded=!p),n?.(!0)}),c=u.texture,l=u.assets;this.skybox={texture:c,props:R({},r),assets:l,loaded:!1},O.update(this.renderable.values.tSkybox,c),this.renderable.update()}if(this.skybox){var d=t;"orthographic"===t.state.mode&&(this.camera.setState(R(R({},t.state),{mode:"perspective"})),this.camera.update(),d=this.camera);var f=this.renderable.values.uViewDirectionProjectionInverse.ref.value;b.sub(this.dir,d.state.position,d.state.target),b.setMagnitude(this.dir,this.dir,.1),b.copy(this.position,this.dir),he.lookAt(f,this.position,this.target,d.state.up),he.mul(f,d.projection,f),he.invert(f,f),O.update(this.renderable.values.uViewDirectionProjectionInverse,f),O.updateIfChanged(this.renderable.values.uBlur,r.blur),O.updateIfChanged(this.renderable.values.uOpacity,r.opacity),O.updateIfChanged(this.renderable.values.uSaturation,r.saturation),O.updateIfChanged(this.renderable.values.uLightness,r.lightness),O.updateIfChanged(this.renderable.values.dVariant,"skybox"),this.renderable.update()}},e.prototype.clearImage=function(){void 0!==this.image&&(this.image.texture.destroy(),this.assetManager.release(this.image.asset),this.image=void 0)},e.prototype.updateImage=function(t,r){var n=this;if(!t.source.params)return this.clearImage(),void r?.(!1);if(this.image&&this.image.props.source.params&&function _Ye(e,t){return gre(e)===gre(t)}(t.source,this.image.props.source))r?.(!1);else{this.clearImage();var a=function wYe(e,t,r,n){var a="url"===r.name?dn.getUrlAsset(t,r.params):r.params;if(typeof HTMLImageElement>"u")return console.error('Missing "HTMLImageElement" required for background image'),n?.(!0),{texture:Ao(),asset:a};var i=e.resources.texture("image-uint8","rgba","ubyte","linear"),o=new Image;return o.onload=function(){i.load(o),(e.isWebGL2||nS(o.width)&&nS(o.height))&&i.mipmap(),n?.()},o.onerror=function(){n?.(!0)},t.resolve(a,"binary").run().then(function(s){var u=new Blob([s.data]);o.src=URL.createObjectURL(u)}),{texture:i,asset:a}}(this.webgl,this.assetManager,t.source,function(s){n.image&&(n.image.loaded=!s),r?.(!0)}),i=a.texture,o=a.asset;this.image={texture:i,props:R({},t),asset:o,loaded:!1},O.update(this.renderable.values.tImage,i),this.renderable.update()}this.image&&(O.updateIfChanged(this.renderable.values.uBlur,t.blur),O.updateIfChanged(this.renderable.values.uOpacity,t.opacity),O.updateIfChanged(this.renderable.values.uSaturation,t.saturation),O.updateIfChanged(this.renderable.values.uLightness,t.lightness),O.updateIfChanged(this.renderable.values.uViewportAdjusted,"viewport"===t.coverage),O.updateIfChanged(this.renderable.values.dVariant,"image"),this.renderable.update())},e.prototype.updateImageScaling=function(){var t,r,n=this.renderable.values,a=n.uTexSize.ref.value,i=a[0],o=a[1],s=(null===(t=this.image)||void 0===t?void 0:t.texture.getWidth())||0,u=(null===(r=this.image)||void 0===r?void 0:r.texture.getHeight())||0,c=i/o;O.update(n.uImageScale,cc?Be.set(n.uImageOffset.ref.value,(1-c/m)/2,0):Be.set(n.uImageOffset.ref.value,0,(1-m/c)/2))},e.prototype.updateGradient=function(t,r,n,a,i){O.update(this.renderable.values.uGradientColorA,dt.toVec3Normalized(this.renderable.values.uGradientColorA.ref.value,t)),O.update(this.renderable.values.uGradientColorB,dt.toVec3Normalized(this.renderable.values.uGradientColorB.ref.value,r)),O.updateIfChanged(this.renderable.values.uGradientRatio,n),O.updateIfChanged(this.renderable.values.uViewportAdjusted,i),O.updateIfChanged(this.renderable.values.dVariant,a),this.renderable.update()},e.prototype.update=function(t,r,n){if("off"===r.variant.name)return this.clearSkybox(),this.clearImage(),void n?.(!1);"skybox"===r.variant.name?(this.clearImage(),this.updateSkybox(t,r.variant.params,n)):"image"===r.variant.name?(this.clearSkybox(),this.updateImage(r.variant.params,n)):"horizontalGradient"===r.variant.name?(this.clearSkybox(),this.clearImage(),this.updateGradient(r.variant.params.topColor,r.variant.params.bottomColor,r.variant.params.ratio,r.variant.name,"viewport"===r.variant.params.coverage),n?.(!1)):"radialGradient"===r.variant.name&&(this.clearSkybox(),this.clearImage(),this.updateGradient(r.variant.params.centerColor,r.variant.params.edgeColor,r.variant.params.ratio,r.variant.name,"viewport"===r.variant.params.coverage),n?.(!1));var a=t.viewport;O.update(this.renderable.values.uViewport,dr.set(this.renderable.values.uViewport.ref.value,a.x,a.y,a.width,a.height))},e.prototype.isEnabled=function(t){return!!(this.skybox&&this.skybox.loaded||this.image&&this.image.loaded||"horizontalGradient"===t.variant.name||"radialGradient"===t.variant.name)},e.prototype.isReady=function(){return!!(this.skybox&&this.skybox.loaded||this.image&&this.image.loaded||"horizontalGradient"===this.renderable.values.dVariant.ref.value||"radialGradient"===this.renderable.values.dVariant.ref.value)},e.prototype.render=function(){this.isReady()&&("image"===this.renderable.values.dVariant.ref.value&&this.updateImageScaling(),xt&&this.webgl.timer.mark("BackgroundPass.render"),this.renderable.render(),xt&&this.webgl.timer.markEnd("BackgroundPass.render"))},e.prototype.dispose=function(){this.clearSkybox(),this.clearImage()},e}(),mre="background-skybox";function hre(e){var t,r,n,a,i,o;return"urls"===e.name?"".concat(mre,"_").concat(e.params.nx,"|").concat(e.params.ny,"|").concat(e.params.nz,"|").concat(e.params.px,"|").concat(e.params.py,"|").concat(e.params.pz):"".concat(mre,"_").concat(null===(t=e.params.nx)||void 0===t?void 0:t.id,"|").concat(null===(r=e.params.ny)||void 0===r?void 0:r.id,"|").concat(null===(n=e.params.nz)||void 0===n?void 0:n.id,"|").concat(null===(a=e.params.px)||void 0===a?void 0:a.id,"|").concat(null===(i=e.params.py)||void 0===i?void 0:i.id,"|").concat(null===(o=e.params.pz)||void 0===o?void 0:o.id)}var vre="background-image";function gre(e){var t;return"url"===e.name?"".concat(vre,"_").concat(e.params):"".concat(vre,"_").concat(null===(t=e.params)||void 0===t?void 0:t.id)}var AYe={drawCount:oa("number"),instanceCount:oa("number"),aPosition:Tn("float32",2,0),tSkybox:Xt("texture","rgba","ubyte","linear"),tImage:Xt("texture","rgba","ubyte","linear"),uImageScale:Ae("v2"),uImageOffset:Ae("v2"),uTexSize:Ae("v2"),uViewport:Ae("v4"),uViewportAdjusted:Ae("b"),uViewDirectionProjectionInverse:Ae("m4"),uGradientColorA:Ae("v3"),uGradientColorB:Ae("v3"),uGradientRatio:Ae("f"),uBlur:Ae("f"),uOpacity:Ae("f"),uSaturation:Ae("f"),uLightness:Ae("f"),dVariant:Lt("string",["skybox","image","verticalGradient","horizontalGradient","radialGradient"])},TYe=Fn("background","\nprecision mediump float;\n\nattribute vec2 aPosition;\n\nvarying vec4 vPosition;\n\nvoid main() {\n vPosition = vec4(aPosition, 1.0, 1.0);\n gl_Position = vec4(aPosition, 1.0, 1.0);\n}\n","\nprecision mediump float;\nprecision mediump samplerCube;\nprecision mediump sampler2D;\n\n#if defined(dVariant_skybox)\n uniform samplerCube tSkybox;\n uniform mat4 uViewDirectionProjectionInverse;\n uniform float uBlur;\n uniform float uOpacity;\n uniform float uSaturation;\n uniform float uLightness;\n#elif defined(dVariant_image)\n uniform sampler2D tImage;\n uniform vec2 uImageScale;\n uniform vec2 uImageOffset;\n uniform float uBlur;\n uniform float uOpacity;\n uniform float uSaturation;\n uniform float uLightness;\n#elif defined(dVariant_horizontalGradient) || defined(dVariant_radialGradient)\n uniform vec3 uGradientColorA;\n uniform vec3 uGradientColorB;\n uniform float uGradientRatio;\n#endif\n\nuniform vec2 uTexSize;\nuniform vec4 uViewport;\nuniform bool uViewportAdjusted;\nvarying vec4 vPosition;\n\n// TODO: add as general pp option to remove banding?\n// Iestyn's RGB dither from http://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf\nvec3 ScreenSpaceDither(vec2 vScreenPos) {\n vec3 vDither = vec3(dot(vec2(171.0, 231.0), vScreenPos.xy));\n vDither.rgb = fract(vDither.rgb / vec3(103.0, 71.0, 97.0));\n return vDither.rgb / 255.0;\n}\n\nvec3 saturateColor(vec3 c, float amount) {\n // https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(c, W));\n return mix(intensity, c, 1.0 + amount);\n}\n\nvec3 lightenColor(vec3 c, float amount) {\n return c + amount;\n}\n\nvoid main() {\n #if defined(dVariant_skybox)\n vec4 t = uViewDirectionProjectionInverse * vPosition;\n #ifdef enabledShaderTextureLod\n gl_FragColor = textureCubeLodEXT(tSkybox, normalize(t.xyz / t.w), uBlur * 8.0);\n #else\n gl_FragColor = textureCube(tSkybox, normalize(t.xyz / t.w));\n #endif\n gl_FragColor.a = uOpacity;\n gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);\n #elif defined(dVariant_image)\n vec2 coords;\n if (uViewportAdjusted) {\n coords = ((gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uImageScale) + uImageOffset;\n } else {\n coords = (gl_FragCoord.xy / uImageScale) + uImageOffset;\n }\n #ifdef enabledShaderTextureLod\n gl_FragColor = texture2DLodEXT(tImage, vec2(coords.x, 1.0 - coords.y), uBlur * 8.0);\n #else\n gl_FragColor = texture2D(tImage, vec2(coords.x, 1.0 - coords.y));\n #endif\n gl_FragColor.a = uOpacity;\n gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);\n #elif defined(dVariant_horizontalGradient)\n float d;\n if (uViewportAdjusted) {\n d = ((gl_FragCoord.y - uViewport.y) * (uTexSize.y / uViewport.w) / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);\n } else {\n d = (gl_FragCoord.y / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);\n }\n gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, clamp(d, 0.0, 1.0)), 1.0);\n gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);\n #elif defined(dVariant_radialGradient)\n float d;\n if (uViewportAdjusted) {\n d = distance(vec2(0.5), (gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uTexSize) + uGradientRatio - 0.5;\n } else {\n d = distance(vec2(0.5), gl_FragCoord.xy / uTexSize) + uGradientRatio - 0.5;\n }\n gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, 1.0 - clamp(d, 0.0, 1.0)), 1.0);\n gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);\n #endif\n}\n",{shaderTextureLod:"optional"}),PYe={sharpness:T.Numeric(.5,{min:0,max:1,step:.05}),denoise:T.Boolean(!0)},MYe=function(){function e(t,r){this.webgl=t,this.renderable=function FYe(e,t){var r=t.getWidth(),n=t.getHeight(),a=R(R({},bi),{tColor:O.create(t),uTexSizeInv:O.create(Be.create(1/r,1/n)),uSharpness:O.create(.5),dDenoise:O.create(!0)}),i=R({},RYe);return Va(Ua(e,"triangles",OYe,i,a),a)}(t,r)}return e.prototype.updateState=function(t){var r=this.webgl,n=r.gl,a=r.state;a.enable(n.SCISSOR_TEST),a.disable(n.BLEND),a.disable(n.DEPTH_TEST),a.depthMask(!1);var i=t.x,o=t.y,s=t.width,u=t.height;a.viewport(i,o,s,u),a.scissor(i,o,s,u),a.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT)},e.prototype.setSize=function(t,r){O.update(this.renderable.values.uTexSizeInv,Be.set(this.renderable.values.uTexSizeInv.ref.value,1/t,1/r))},e.prototype.update=function(t,r){var n=this.renderable.values,a=r.sharpness,i=r.denoise,o=!1;n.tColor.ref.value!==t&&(O.update(this.renderable.values.tColor,t),o=!0),O.updateIfChanged(n.uSharpness,2-2*Math.pow(a,.25)),n.dDenoise.ref.value!==i&&(o=!0),O.updateIfChanged(n.dDenoise,i),o&&this.renderable.update()},e.prototype.render=function(t,r){xt&&this.webgl.timer.mark("CasPass.render"),r?r.bind():this.webgl.unbindFramebuffer(),this.updateState(t),this.renderable.render(),xt&&this.webgl.timer.markEnd("CasPass.render")},e}(),RYe=R(R({},yi),{tColor:Xt("texture","rgba","ubyte","linear"),uTexSizeInv:Ae("v2"),uSharpness:Ae("f"),dDenoise:Lt("boolean")}),OYe=Fn("cas",bo,"\nprecision mediump float;\nprecision mediump sampler2D;\n\nuniform sampler2D tColor;\nuniform vec2 uTexSizeInv;\n\nuniform float uSharpness;\n\n// adapted from https://www.shadertoy.com/view/stXSWB\n\n/*\n* FidelityFX Super Resolution scales up a low resolution\n* image, while adding fine detail.\n*\n* MIT Open License\n*\n* https://gpuopen.com/fsr\n*\n* Left: FSR processed\n* Right: Original texture, bilinear interpolation\n*\n* Mouse at top: Sharpness 0 stops (maximum)\n* Mouse at bottom: Sharpness 2 stops (minimum)\n*\n* It works in two passes-\n* EASU upsamples the image with a clamped Lanczos kernel.\n* RCAS sharpens the image at the target resolution.\n*\n* I needed to make a few changes to improve readability and\n* WebGL compatibility in an algorithm I don't fully understand.\n* Expect bugs.\n*\n* Shader not currently running for WebGL1 targets (eg. mobile Safari)\n*\n* There is kind of no point to using FSR in Shadertoy, as it renders buffers\n* at full target resolution. But this might be useful for WebGL based demos\n* running smaller-than-target render buffers.\n*\n* For sharpening with a full resolution render buffer,\n* FidelityFX CAS is a better option.\n* https://www.shadertoy.com/view/ftsXzM\n*\n* For readability and compatibility, these optimisations have been removed:\n* * Fast approximate inverse and inversesqrt\n* * textureGather fetches (not WebGL compatible)\n* * Multiplying by reciprocal instead of division\n*\n* Apologies to AMD for the numerous slowdowns and errors I have introduced.\n*\n*/\n\n/***** RCAS *****/\n#define FSR_RCAS_LIMIT (0.25-(1.0/16.0))\n\n// Input callback prototypes that need to be implemented by calling shader\nvec4 FsrRcasLoadF(vec2 p);\n//------------------------------------------------------------------------------------------------------------------------------\nvoid FsrRcasCon(\n out float con,\n // The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}.\n float sharpness\n) {\n // Transform from stops to linear value.\n con = exp2(-sharpness);\n}\n\nvec3 FsrRcasF(\n vec2 ip, // Integer pixel position in output.\n float con\n) {\n // Constant generated by RcasSetup().\n // Algorithm uses minimal 3x3 pixel neighborhood.\n // b\n // d e f\n // h\n vec2 sp = vec2(ip);\n vec3 b = FsrRcasLoadF(sp + vec2( 0,-1)).rgb;\n vec3 d = FsrRcasLoadF(sp + vec2(-1, 0)).rgb;\n vec3 e = FsrRcasLoadF(sp).rgb;\n vec3 f = FsrRcasLoadF(sp + vec2( 1, 0)).rgb;\n vec3 h = FsrRcasLoadF(sp + vec2( 0, 1)).rgb;\n\n // Luma times 2.\n float bL = b.g + .5 * (b.b + b.r);\n float dL = d.g + .5 * (d.b + d.r);\n float eL = e.g + .5 * (e.b + e.r);\n float fL = f.g + .5 * (f.b + f.r);\n float hL = h.g + .5 * (h.b + h.r);\n\n // Noise detection.\n #ifdef dDenoise\n float nz = .25 * (bL + dL + fL + hL) - eL;\n nz=clamp(\n abs(nz)\n /(\n max(max(bL,dL),max(eL,max(fL,hL)))\n -min(min(bL,dL),min(eL,min(fL,hL)))\n ),\n 0., 1.\n );\n nz=1.-.5*nz;\n #endif\n\n // Min and max of ring.\n vec3 mn4 = min(b, min(f, h));\n vec3 mx4 = max(b, max(f, h));\n\n // Immediate constants for peak range.\n vec2 peakC = vec2(1., -4.);\n\n // Limiters, these need to be high precision RCPs.\n vec3 hitMin = mn4 / (4. * mx4);\n vec3 hitMax = (peakC.x - mx4) / (4.* mn4 + peakC.y);\n vec3 lobeRGB = max(-hitMin, hitMax);\n float lobe = max(\n -FSR_RCAS_LIMIT,\n min(max(lobeRGB.r, max(lobeRGB.g, lobeRGB.b)), 0.)\n )*con;\n\n // Apply noise removal.\n #ifdef dDenoise\n lobe *= nz;\n #endif\n\n // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.\n return (lobe * (b + d + h + f) + e) / (4. * lobe + 1.);\n}\n\n\nvec4 FsrRcasLoadF(vec2 p) {\n return texture2D(tColor, p * uTexSizeInv);\n}\n\nvoid main() {\n // Set up constants\n float con;\n FsrRcasCon(con, uSharpness);\n\n // Perform RCAS pass\n vec3 col = FsrRcasF(gl_FragCoord.xy, con);\n\n gl_FragColor = vec4(col, FsrRcasLoadF(gl_FragCoord.xy).a);\n}\n"),BYe=R(R({},yi),{tDepthOpaque:Xt("texture","rgba","ubyte","nearest"),tDepthTransparent:Xt("texture","rgba","ubyte","nearest"),uTexSize:Ae("v2"),dOrthographic:Lt("number"),uNear:Ae("f"),uFar:Ae("f"),uInvProjection:Ae("m4"),uOutlineThreshold:Ae("f"),dTransparentOutline:Lt("boolean")}),kYe=R(R({},yi),{tDepth:Xt("texture","rgba","ubyte","nearest"),uTexSize:Ae("v2"),uProjection:Ae("m4"),uInvProjection:Ae("m4"),uBounds:Ae("v4"),dOrthographic:Lt("number"),uNear:Ae("f"),uFar:Ae("f"),dSteps:Lt("number"),uMaxDistance:Ae("f"),uTolerance:Ae("f"),uBias:Ae("f"),uLightDirection:Ae("v3[]"),uLightColor:Ae("v3[]"),dLightCount:Lt("number")}),UYe=R(R({},yi),{tDepth:Xt("texture","rgba","ubyte","nearest"),tDepthHalf:Xt("texture","rgba","ubyte","nearest"),tDepthQuarter:Xt("texture","rgba","ubyte","nearest"),uSamples:Ae("v3[]"),dNSamples:Lt("number"),uProjection:Ae("m4"),uInvProjection:Ae("m4"),uBounds:Ae("v4"),uTexSize:Ae("v2"),uRadius:Ae("f"),uBias:Ae("f"),dMultiScale:Lt("boolean"),dLevels:Lt("number"),uLevelRadius:Ae("f[]"),uLevelBias:Ae("f[]"),uNearThreshold:Ae("f"),uFarThreshold:Ae("f")}),GYe=R(R({},yi),{tSsaoDepth:Xt("texture","rgba","ubyte","nearest"),uTexSize:Ae("v2"),uKernel:Ae("f[]"),dOcclusionKernelSize:Lt("number"),uBlurDirectionX:Ae("f"),uBlurDirectionY:Ae("f"),uInvProjection:Ae("m4"),uNear:Ae("f"),uFar:Ae("f"),uBounds:Ae("v4"),dOrthographic:Lt("number")});function yre(e,t,r){var n=R(R({},bi),{tSsaoDepth:O.create(t),uTexSize:O.create(Be.create(t.getWidth(),t.getHeight())),uKernel:O.create(bre(15)),dOcclusionKernelSize:O.create(15),uBlurDirectionX:O.create("horizontal"===r?1:0),uBlurDirectionY:O.create("vertical"===r?1:0),uInvProjection:O.create(he.identity()),uNear:O.create(0),uFar:O.create(1e4),uBounds:O.create(dr()),dOrthographic:O.create(0)}),a=R({},GYe);return Va(Ua(e,"triangles",Fn("ssao_blur",bo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tSsaoDepth;\nuniform vec2 uTexSize;\nuniform vec4 uBounds;\n\nuniform float uKernel[dOcclusionKernelSize];\n\nuniform float uBlurDirectionX;\nuniform float uBlurDirectionY;\n\nuniform mat4 uInvProjection;\nuniform float uNear;\nuniform float uFar;\n\n#include common\n\nfloat getViewZ(const in float depth) {\n #if dOrthographic == 1\n return orthographicDepthToViewZ(depth, uNear, uFar);\n #else\n return perspectiveDepthToViewZ(depth, uNear, uFar);\n #endif\n}\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nbool outsideBounds(const in vec2 p) {\n return p.x < uBounds.x || p.y < uBounds.y || p.x > uBounds.z || p.y > uBounds.w;\n}\n\nfloat getPixelSize(const in vec2 coords, const in float depth) {\n vec3 viewPos0 = screenSpaceToViewSpace(vec3(coords, depth), uInvProjection);\n vec3 viewPos1 = screenSpaceToViewSpace(vec3(coords + vec2(1.0, 0.0) / uTexSize, depth), uInvProjection);\n return distance(viewPos0, viewPos1);\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n\n vec2 packedDepth = texture2D(tSsaoDepth, coords).zw;\n\n if (outsideBounds(coords)) {\n gl_FragColor = vec4(packUnitIntervalToRG(1.0), packedDepth);\n return;\n }\n\n float selfDepth = unpackRGToUnitInterval(packedDepth);\n // if background and if second pass\n if (isBackground(selfDepth) && uBlurDirectionY != 0.0) {\n gl_FragColor = vec4(packUnitIntervalToRG(1.0), packedDepth);\n return;\n }\n\n float selfViewZ = getViewZ(selfDepth);\n float pixelSize = getPixelSize(coords, selfDepth);\n float maxDiffViewZ = pixelSize * 10.0;\n\n vec2 offset = vec2(uBlurDirectionX, uBlurDirectionY) / uTexSize;\n\n float sum = 0.0;\n float kernelSum = 0.0;\n // only if kernelSize is odd\n for (int i = -dOcclusionKernelSize / 2; i <= dOcclusionKernelSize / 2; i++) {\n if (abs(float(i)) > 1.0 && abs(float(i)) * pixelSize > 0.8) continue;\n\n vec2 sampleCoords = coords + float(i) * offset;\n if (outsideBounds(sampleCoords)) {\n continue;\n }\n\n vec4 sampleSsaoDepth = texture2D(tSsaoDepth, sampleCoords);\n\n float sampleDepth = unpackRGToUnitInterval(sampleSsaoDepth.zw);\n if (isBackground(sampleDepth)) {\n continue;\n }\n\n if (abs(float(i)) > 1.0) {\n float sampleViewZ = getViewZ(sampleDepth);\n if (abs(selfViewZ - sampleViewZ) > maxDiffViewZ) {\n continue;\n }\n }\n\n float kernel = uKernel[int(abs(float(i)))]; // abs is not defined for int in webgl1\n float sampleValue = unpackRGToUnitInterval(sampleSsaoDepth.xy);\n\n sum += kernel * sampleValue;\n kernelSum += kernel;\n }\n\n gl_FragColor = vec4(packUnitIntervalToRG(sum / kernelSum), packedDepth);\n}\n"),a,n),n)}function bre(e){for(var t=e/3,r=Math.floor((e+1)/2),n=[],a=0;a pixelSizeOpaque && selfDepthOpaque > sampleDepthOpaque && sampleDepthOpaque <= bestDepth) {\n outline = 0.0;\n bestDepth = sampleDepthOpaque;\n }\n\n if (sampleDepthTransparent < sampleDepthOpaque) {\n float sampleViewZTransparent = isBackground(sampleDepthTransparent) ? backgroundViewZ : getViewZ(sampleDepthTransparent);\n if (abs(selfViewZTransparent - sampleViewZTransparent) > pixelSizeTransparent && selfDepthTransparent > sampleDepthTransparent && sampleDepthTransparent <= bestDepth) {\n outline = 0.0;\n bestDepth = sampleDepthTransparent;\n transparentFlag = 1.0;\n }\n }\n }\n }\n\n gl_FragColor = vec4(outline, packUnitIntervalToRG(bestDepth), transparentFlag);\n}\n"),s,o),o)}(t,o,i,!0),this.shadowsTarget=t.createRenderTarget(s,u,!1),this.shadowsRenderable=function LYe(e,t){var r=t.getWidth(),n=t.getHeight(),a=R(R({},bi),{tDepth:O.create(t),uTexSize:O.create(Be.create(r,n)),uProjection:O.create(he.identity()),uInvProjection:O.create(he.identity()),uBounds:O.create(dr()),dOrthographic:O.create(0),uNear:O.create(1),uFar:O.create(1e4),dSteps:O.create(1),uMaxDistance:O.create(3),uTolerance:O.create(1),uBias:O.create(.6),uLightDirection:O.create([]),uLightColor:O.create([]),dLightCount:O.create(0)}),i=R({},kYe);return Va(Ua(e,"triangles",Fn("shadows",bo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#include common\n\nuniform sampler2D tDepth;\nuniform vec2 uTexSize;\nuniform vec4 uBounds;\n\nuniform float uNear;\nuniform float uFar;\n\n#if dLightCount != 0\n uniform vec3 uLightDirection[dLightCount];\n uniform vec3 uLightColor[dLightCount];\n#endif\n\nuniform mat4 uProjection;\nuniform mat4 uInvProjection;\n\nuniform float uMaxDistance;\nuniform float uTolerance;\nuniform float uBias;\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nbool outsideBounds(const in vec2 p) {\n return p.x < uBounds.x || p.y < uBounds.y || p.x > uBounds.z || p.y > uBounds.w;\n}\n\nfloat getViewZ(const in float depth) {\n #if dOrthographic == 1\n return orthographicDepthToViewZ(depth, uNear, uFar);\n #else\n return perspectiveDepthToViewZ(depth, uNear, uFar);\n #endif\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nfloat screenFade(const in vec2 coords) {\n vec2 c = (coords - uBounds.xy) / (uBounds.zw - uBounds.xy);\n vec2 fade = max(12.0 * abs(c - 0.5) - 5.0, vec2(0.0));\n return saturate(1.0 - dot(fade, fade));\n}\n\n// based on https://panoskarabelas.com/posts/screen_space_shadows/\nfloat screenSpaceShadow(const in vec3 position, const in vec3 lightDirection, const in float stepLength) {\n // Ray position and direction (in view-space)\n vec3 rayPos = position;\n vec3 rayDir = -lightDirection;\n\n // Compute ray step\n vec3 rayStep = rayDir * stepLength;\n\n // Ray march towards the light\n float occlusion = 0.0;\n vec4 rayCoords = vec4(0.0);\n for (int i = 0; i < dSteps; ++i) {\n // Step the ray\n rayPos += rayStep;\n\n rayCoords = uProjection * vec4(rayPos, 1.0);\n rayCoords.xyz = (rayCoords.xyz / rayCoords.w) * 0.5 + 0.5;\n\n if (outsideBounds(rayCoords.xy))\n return 1.0;\n\n // Compute the difference between the ray's and the camera's depth\n float depth = getDepth(rayCoords.xy);\n float viewZ = getViewZ(depth);\n float zDelta = rayPos.z - viewZ;\n\n if (zDelta < uTolerance) {\n occlusion = 1.0;\n\n // Fade out as we approach the edges of the screen\n occlusion *= screenFade(rayCoords.xy);\n\n break;\n }\n }\n\n return 1.0 - (uBias * occlusion);\n}\n\nvoid main(void) {\n vec2 invTexSize = 1.0 / uTexSize;\n vec2 selfCoords = gl_FragCoord.xy * invTexSize;\n\n float selfDepth = getDepth(selfCoords);\n\n if (isBackground(selfDepth)) {\n gl_FragColor = vec4(0.0);\n return;\n }\n\n vec3 selfViewPos = screenSpaceToViewSpace(vec3(selfCoords, selfDepth), uInvProjection);\n float stepLength = uMaxDistance / float(dSteps);\n\n float o = 1.0;\n #if dLightCount != 0\n float sh[dLightCount];\n #pragma unroll_loop_start\n for (int i = 0; i < dLightCount; ++i) {\n sh[i] = screenSpaceShadow(selfViewPos, uLightDirection[i], stepLength);\n o = min(o, sh[i]);\n }\n #pragma unroll_loop_end\n #endif\n\n gl_FragColor = vec4(o);\n}\n"),i,a),a)}(t,o),this.ssaoFramebuffer=t.resources.framebuffer(),this.ssaoBlurFirstPassFramebuffer=t.resources.framebuffer(),this.ssaoBlurSecondPassFramebuffer=t.resources.framebuffer();var c=Math.floor(s*this.ssaoScale),l=Math.floor(u*this.ssaoScale),d=Math.max(1,Math.floor(.5*c)),f=Math.max(1,Math.floor(.5*l)),p=Math.max(1,Math.floor(.25*c)),m=Math.max(1,Math.floor(.25*l));this.downsampledDepthTarget=n.packedDepth?t.createRenderTarget(c,l,!1,"uint8","linear","rgba"):t.createRenderTarget(c,l,!1,"float32","linear",t.isWebGL2?"alpha":"rgba"),this.downsampleDepthRenderable=K0(t,o);var h=1===this.ssaoScale?o:this.downsampledDepthTarget.texture;this.depthHalfTarget=n.packedDepth?t.createRenderTarget(d,f,!1,"uint8","linear","rgba"):t.createRenderTarget(d,f,!1,"float32","linear",t.isWebGL2?"alpha":"rgba"),this.depthHalfRenderable=K0(t,h),this.depthQuarterTarget=n.packedDepth?t.createRenderTarget(p,m,!1,"uint8","linear","rgba"):t.createRenderTarget(p,m,!1,"float32","linear",t.isWebGL2?"alpha":"rgba"),this.depthQuarterRenderable=K0(t,this.depthHalfTarget.texture),this.ssaoDepthTexture=t.resources.texture("image-uint8","rgba","ubyte","linear"),this.ssaoDepthTexture.define(c,l),this.ssaoDepthTexture.attachFramebuffer(this.ssaoFramebuffer,"color0"),this.ssaoDepthBlurProxyTexture=t.resources.texture("image-uint8","rgba","ubyte","linear"),this.ssaoDepthBlurProxyTexture.define(c,l),this.ssaoDepthBlurProxyTexture.attachFramebuffer(this.ssaoBlurFirstPassFramebuffer,"color0"),this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer,"color0"),this.ssaoRenderable=function VYe(e,t,r,n){var a=R(R({},bi),{tDepth:O.create(t),tDepthHalf:O.create(r),tDepthQuarter:O.create(n),uSamples:O.create(Cre(32)),dNSamples:O.create(32),uProjection:O.create(he.identity()),uInvProjection:O.create(he.identity()),uBounds:O.create(dr()),uTexSize:O.create(Be.create(e.gl.drawingBufferWidth,e.gl.drawingBufferHeight)),uRadius:O.create(Math.pow(2,5)),uBias:O.create(.8),dMultiScale:O.create(!1),dLevels:O.create(3),uLevelRadius:O.create([Math.pow(2,2),Math.pow(2,5),Math.pow(2,8)]),uLevelBias:O.create([.8,.8,.8]),uNearThreshold:O.create(10),uFarThreshold:O.create(1500)}),i=R({},UYe);return Va(Ua(e,"triangles",Fn("ssao",bo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#include common\n\nuniform sampler2D tDepth;\nuniform sampler2D tDepthHalf;\nuniform sampler2D tDepthQuarter;\nuniform vec2 uTexSize;\nuniform vec4 uBounds;\n\nuniform vec3 uSamples[dNSamples];\n\nuniform mat4 uProjection;\nuniform mat4 uInvProjection;\n\n#ifdef dMultiScale\n uniform float uLevelRadius[dLevels];\n uniform float uLevelBias[dLevels];\n uniform float uNearThreshold;\n uniform float uFarThreshold;\n#else\n uniform float uRadius;\n#endif\nuniform float uBias;\n\nfloat smootherstep(float edge0, float edge1, float x) {\n x = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n return x * x * x * (x * (x * 6.0 - 15.0) + 10.0);\n}\n\nfloat noise(const in vec2 coords) {\n float a = 12.9898;\n float b = 78.233;\n float c = 43758.5453;\n float dt = dot(coords, vec2(a,b));\n float sn = mod(dt, PI);\n return abs(fract(sin(sn) * c)); // is abs necessary?\n}\n\nvec2 getNoiseVec2(const in vec2 coords) {\n return vec2(noise(coords), noise(coords + vec2(PI, 2.71828)));\n}\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nfloat getDepth(const in vec2 coords) {\n vec2 c = vec2(clamp(coords.x, uBounds.x, uBounds.z), clamp(coords.y, uBounds.y, uBounds.w));\n #ifdef depthTextureSupport\n return texture2D(tDepth, c).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, c));\n #endif\n}\n\n#define dQuarterThreshold 0.1\n#define dHalfThreshold 0.05\n\nfloat getMappedDepth(const in vec2 coords, const in vec2 selfCoords) {\n vec2 c = vec2(clamp(coords.x, uBounds.x, uBounds.z), clamp(coords.y, uBounds.y, uBounds.w));\n float d = distance(coords, selfCoords);\n #ifdef depthTextureSupport\n if (d > dQuarterThreshold) {\n return texture2D(tDepthQuarter, c).r;\n } else if (d > dHalfThreshold) {\n return texture2D(tDepthHalf, c).r;\n } else {\n return texture2D(tDepth, c).r;\n }\n #else\n if (d > dQuarterThreshold) {\n return unpackRGBAToDepth(texture2D(tDepthQuarter, c));\n } else if (d > dHalfThreshold) {\n return unpackRGBAToDepth(texture2D(tDepthHalf, c));\n } else {\n return unpackRGBAToDepth(texture2D(tDepth, c));\n }\n #endif\n}\n\nvec3 normalFromDepth(const in float depth, const in float depth1, const in float depth2, vec2 offset1, vec2 offset2) {\n vec3 p1 = vec3(offset1, depth1 - depth);\n vec3 p2 = vec3(offset2, depth2 - depth);\n\n vec3 normal = cross(p1, p2);\n normal.z = -normal.z;\n\n return normalize(normal);\n}\n\nfloat getPixelSize(const in vec2 coords, const in float depth) {\n vec3 viewPos0 = screenSpaceToViewSpace(vec3(coords, depth), uInvProjection);\n vec3 viewPos1 = screenSpaceToViewSpace(vec3(coords + vec2(1.0, 0.0) / uTexSize, depth), uInvProjection);\n return distance(viewPos0, viewPos1);\n}\n\n// StarCraft II Ambient Occlusion by [Filion and McNaughton 2008]\nvoid main(void) {\n vec2 invTexSize = 1.0 / uTexSize;\n vec2 selfCoords = gl_FragCoord.xy * invTexSize;\n\n float selfDepth = getDepth(selfCoords);\n vec2 selfPackedDepth = packUnitIntervalToRG(selfDepth);\n\n if (isBackground(selfDepth)) {\n gl_FragColor = vec4(packUnitIntervalToRG(1.0), selfPackedDepth);\n return;\n }\n\n vec2 offset1 = vec2(0.0, invTexSize.y);\n vec2 offset2 = vec2(invTexSize.x, 0.0);\n\n float selfDepth1 = getDepth(selfCoords + offset1);\n float selfDepth2 = getDepth(selfCoords + offset2);\n\n vec3 selfViewNormal = normalFromDepth(selfDepth, selfDepth1, selfDepth2, offset1, offset2);\n vec3 selfViewPos = screenSpaceToViewSpace(vec3(selfCoords, selfDepth), uInvProjection);\n\n vec3 randomVec = normalize(vec3(getNoiseVec2(selfCoords) * 2.0 - 1.0, 0.0));\n vec3 tangent = normalize(randomVec - selfViewNormal * dot(randomVec, selfViewNormal));\n vec3 bitangent = cross(selfViewNormal, tangent);\n mat3 TBN = mat3(tangent, bitangent, selfViewNormal);\n\n float occlusion = 0.0;\n #ifdef dMultiScale\n float pixelSize = getPixelSize(selfCoords, selfDepth);\n\n for(int l = 0; l < dLevels; l++) {\n // TODO: smooth transition\n if (pixelSize * uNearThreshold > uLevelRadius[l]) continue;\n if (pixelSize * uFarThreshold < uLevelRadius[l]) continue;\n\n float levelOcclusion = 0.0;\n for(int i = 0; i < dNSamples; i++) {\n vec3 sampleViewPos = TBN * uSamples[i];\n sampleViewPos = selfViewPos + sampleViewPos * uLevelRadius[l];\n\n vec4 offset = vec4(sampleViewPos, 1.0);\n offset = uProjection * offset;\n offset.xyz = (offset.xyz / offset.w) * 0.5 + 0.5;\n\n float sampleDepth = getMappedDepth(offset.xy, selfCoords);\n float sampleViewZ = screenSpaceToViewSpace(vec3(offset.xy, sampleDepth), uInvProjection).z;\n\n levelOcclusion += step(sampleViewPos.z + 0.025, sampleViewZ) * smootherstep(0.0, 1.0, uLevelRadius[l] / abs(selfViewPos.z - sampleViewZ)) * uLevelBias[l];\n }\n occlusion = max(occlusion, levelOcclusion);\n }\n #else\n for(int i = 0; i < dNSamples; i++) {\n vec3 sampleViewPos = TBN * uSamples[i];\n sampleViewPos = selfViewPos + sampleViewPos * uRadius;\n\n vec4 offset = vec4(sampleViewPos, 1.0);\n offset = uProjection * offset;\n offset.xyz = (offset.xyz / offset.w) * 0.5 + 0.5;\n\n float sampleDepth = getMappedDepth(offset.xy, selfCoords);\n float sampleViewZ = screenSpaceToViewSpace(vec3(offset.xy, sampleDepth), uInvProjection).z;\n\n occlusion += step(sampleViewPos.z + 0.025, sampleViewZ) * smootherstep(0.0, 1.0, uRadius / abs(selfViewPos.z - sampleViewZ));\n }\n #endif\n occlusion = 1.0 - (uBias * occlusion / float(dNSamples));\n\n vec2 packedOcclusion = packUnitIntervalToRG(clamp(occlusion, 0.01, 1.0));\n\n gl_FragColor = vec4(packedOcclusion, selfPackedDepth);\n}\n"),i,a),a)}(t,h,this.depthHalfTarget.texture,this.depthQuarterTarget.texture),this.ssaoBlurFirstPassRenderable=yre(t,this.ssaoDepthTexture,"horizontal"),this.ssaoBlurSecondPassRenderable=yre(t,this.ssaoDepthBlurProxyTexture,"vertical"),this.renderable=function HYe(e,t,r,n,a,i,o,s){var u=R(R({},bi),{tSsaoDepth:O.create(o),tColor:O.create(t),tDepthOpaque:O.create(r),tDepthTransparent:O.create(n),tShadows:O.create(a),tOutlines:O.create(i),uTexSize:O.create(Be.create(t.getWidth(),t.getHeight())),dOrthographic:O.create(0),uNear:O.create(1),uFar:O.create(1e4),uFogNear:O.create(1e4),uFogFar:O.create(1e4),uFogColor:O.create(b.create(1,1,1)),uOutlineColor:O.create(b.create(0,0,0)),uOcclusionColor:O.create(b.create(0,0,0)),uTransparentBackground:O.create(!1),dOcclusionEnable:O.create(!0),uOcclusionOffset:O.create(Be.create(0,0)),dShadowEnable:O.create(!1),dOutlineEnable:O.create(!1),dOutlineScale:O.create(1),dTransparentOutline:O.create(s)}),c=R({},zYe);return Va(Ua(e,"triangles",Fn("postprocessing",bo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tSsaoDepth;\nuniform sampler2D tColor;\nuniform sampler2D tDepthOpaque;\nuniform sampler2D tDepthTransparent;\nuniform sampler2D tShadows;\nuniform sampler2D tOutlines;\nuniform vec2 uTexSize;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\nuniform vec3 uOutlineColor;\nuniform vec3 uOcclusionColor;\nuniform bool uTransparentBackground;\nuniform vec2 uOcclusionOffset;\n\n#include common\n\nfloat getViewZ(const in float depth) {\n #if dOrthographic == 1\n return orthographicDepthToViewZ(depth, uNear, uFar);\n #else\n return perspectiveDepthToViewZ(depth, uNear, uFar);\n #endif\n}\n\nfloat getDepthOpaque(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepthOpaque, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepthOpaque, coords));\n #endif\n}\n\nfloat getDepthTransparent(const in vec2 coords) {\n #ifdef dTransparentOutline\n return unpackRGBAToDepth(texture2D(tDepthTransparent, coords));\n #else\n return 1.0;\n #endif\n}\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nfloat getOutline(const in vec2 coords, const in float opaqueDepth, out float closestTexel) {\n float backgroundViewZ = 2.0 * uFar;\n vec2 invTexSize = 1.0 / uTexSize;\n\n float transparentDepth = getDepthTransparent(coords);\n float opaqueSelfViewZ = isBackground(opaqueDepth) ? backgroundViewZ : getViewZ(opaqueDepth);\n float transparentSelfViewZ = isBackground(transparentDepth) ? backgroundViewZ : getViewZ(transparentDepth);\n float selfDepth = min(opaqueDepth, transparentDepth);\n\n float outline = 1.0;\n closestTexel = 1.0;\n for (int y = -dOutlineScale; y <= dOutlineScale; y++) {\n for (int x = -dOutlineScale; x <= dOutlineScale; x++) {\n if (x * x + y * y > dOutlineScale * dOutlineScale) {\n continue;\n }\n\n vec2 sampleCoords = coords + vec2(float(x), float(y)) * invTexSize;\n\n vec4 sampleOutlineCombined = texture2D(tOutlines, sampleCoords);\n float sampleOutline = sampleOutlineCombined.r;\n float sampleOutlineDepth = unpackRGToUnitInterval(sampleOutlineCombined.gb);\n float sampleOutlineViewZ = isBackground(sampleOutlineDepth) ? backgroundViewZ : getViewZ(sampleOutlineDepth);\n\n float selfViewZ = sampleOutlineCombined.a == 0.0 ? opaqueSelfViewZ : transparentSelfViewZ;\n if (sampleOutline == 0.0 && sampleOutlineDepth < closestTexel) {\n outline = 0.0;\n closestTexel = sampleOutlineDepth;\n }\n }\n }\n return closestTexel < opaqueDepth ? outline : 1.0;\n}\n\nfloat getSsao(vec2 coords) {\n float rawSsao = unpackRGToUnitInterval(texture2D(tSsaoDepth, coords).xy);\n if (rawSsao > 0.999) {\n return 1.0;\n } else if (rawSsao > 0.001) {\n return rawSsao;\n }\n // treat values close to 0.0 as errors and return no occlusion\n return 1.0;\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n vec4 color = texture2D(tColor, coords);\n\n float viewDist;\n float fogFactor;\n float opaqueDepth = getDepthOpaque(coords);\n\n #ifdef dOcclusionEnable\n if (!isBackground(opaqueDepth)) {\n viewDist = abs(getViewZ(opaqueDepth));\n fogFactor = smoothstep(uFogNear, uFogFar, viewDist);\n float occlusionFactor = getSsao(coords + uOcclusionOffset);\n if (!uTransparentBackground) {\n color.rgb = mix(mix(uOcclusionColor, uFogColor, fogFactor), color.rgb, occlusionFactor);\n } else {\n color.rgb = mix(uOcclusionColor * (1.0 - fogFactor), color.rgb, occlusionFactor);\n }\n }\n #endif\n\n #ifdef dShadowEnable\n if (!isBackground(opaqueDepth)) {\n viewDist = abs(getViewZ(opaqueDepth));\n fogFactor = smoothstep(uFogNear, uFogFar, viewDist);\n vec4 shadow = texture2D(tShadows, coords);\n if (!uTransparentBackground) {\n color.rgb = mix(mix(vec3(0), uFogColor, fogFactor), color.rgb, shadow.a);\n } else {\n color.rgb = mix(vec3(0) * (1.0 - fogFactor), color.rgb, shadow.a);\n }\n }\n #endif\n\n // outline needs to be handled after occlusion and shadow to keep them clean\n #ifdef dOutlineEnable\n float closestTexel;\n float outline = getOutline(coords, opaqueDepth, closestTexel);\n if (outline == 0.0) {\n viewDist = abs(getViewZ(closestTexel));\n fogFactor = smoothstep(uFogNear, uFogFar, viewDist);\n if (!uTransparentBackground) {\n color.rgb = mix(uOutlineColor, uFogColor, fogFactor);\n } else {\n color.a = 1.0 - fogFactor;\n color.rgb = mix(uOutlineColor, color.rgb, fogFactor);\n }\n }\n #endif\n\n gl_FragColor = color;\n}\n"),c,u),u)}(t,a.texture,o,i,this.shadowsTarget.texture,this.outlinesTarget.texture,this.ssaoDepthTexture,!0),this.background=new yYe(t,r,s,u)}return e.isEnabled=function(t){return"on"===t.occlusion.name||"on"===t.shadow.name||"on"===t.outline.name||"off"!==t.background.variant.name},e.isTransparentOutlineEnabled=function(t){return"on"===t.outline.name&&t.outline.params.includeTransparent},e.prototype.calcSsaoScale=function(t){return Math.min(1,1/this.webgl.pixelRatio)*t},e.prototype.setSize=function(t,r){var n=this.renderable.values.uTexSize.ref.value,a=n[0],i=n[1],o=this.calcSsaoScale(1);if(t!==a||r!==i||this.ssaoScale!==o){this.ssaoScale=o,this.target.setSize(t,r),this.outlinesTarget.setSize(t,r),this.shadowsTarget.setSize(t,r);var s=Math.floor(t*this.ssaoScale),u=Math.floor(r*this.ssaoScale);this.downsampledDepthTarget.setSize(s,u),this.ssaoDepthTexture.define(s,u),this.ssaoDepthBlurProxyTexture.define(s,u);var c=Math.max(1,Math.floor(.5*s)),l=Math.max(1,Math.floor(.5*u));this.depthHalfTarget.setSize(c,l);var d=Math.max(1,Math.floor(.25*s)),f=Math.max(1,Math.floor(.25*u));this.depthQuarterTarget.setSize(d,f),O.update(this.renderable.values.uTexSize,Be.set(this.renderable.values.uTexSize.ref.value,t,r)),O.update(this.outlinesRenderable.values.uTexSize,Be.set(this.outlinesRenderable.values.uTexSize.ref.value,t,r)),O.update(this.shadowsRenderable.values.uTexSize,Be.set(this.shadowsRenderable.values.uTexSize.ref.value,t,r)),O.update(this.downsampleDepthRenderable.values.uTexSize,Be.set(this.downsampleDepthRenderable.values.uTexSize.ref.value,s,u)),O.update(this.depthHalfRenderable.values.uTexSize,Be.set(this.depthHalfRenderable.values.uTexSize.ref.value,c,l)),O.update(this.depthQuarterRenderable.values.uTexSize,Be.set(this.depthQuarterRenderable.values.uTexSize.ref.value,d,f)),O.update(this.ssaoRenderable.values.uTexSize,Be.set(this.ssaoRenderable.values.uTexSize.ref.value,s,u)),O.update(this.ssaoBlurFirstPassRenderable.values.uTexSize,Be.set(this.ssaoBlurFirstPassRenderable.values.uTexSize.ref.value,s,u)),O.update(this.ssaoBlurSecondPassRenderable.values.uTexSize,Be.set(this.ssaoBlurSecondPassRenderable.values.uTexSize.ref.value,s,u));var p=1===this.ssaoScale?this.drawPass.depthTextureOpaque:this.downsampledDepthTarget.texture;O.update(this.depthHalfRenderable.values.tColor,p),O.update(this.ssaoRenderable.values.tDepth,p),this.depthHalfRenderable.update(),this.ssaoRenderable.update(),this.background.setSize(t,r)}},e.prototype.updateState=function(t,r,n,a,i){var o,s=!1,u=!1,c=!1,l=!1,d=!1,f=!1,p="orthographic"===t.state.mode?1:0,m="on"===a.outline.name,h="on"===a.shadow.name,v="on"===a.occlusion.name,g=he.identity();he.invert(g,t.projection);var y=this.renderable.values.uTexSize.ref.value,S=y[0],C=y[1],_=t.viewport;if("on"===a.occlusion.name){O.update(this.ssaoRenderable.values.uProjection,t.projection),O.update(this.ssaoRenderable.values.uInvProjection,g);var x=this.ssaoRenderable.values.uBounds,D=this.ssaoScale;dr.set(x.ref.value,Math.floor(_.x*D)/(S*D),Math.floor(_.y*D)/(C*D),Math.ceil((_.x+_.width)*D)/(S*D),Math.ceil((_.y+_.height)*D)/(C*D)),O.update(x,x.ref.value),O.update(this.ssaoBlurFirstPassRenderable.values.uBounds,x.ref.value),O.update(this.ssaoBlurSecondPassRenderable.values.uBounds,x.ref.value),O.updateIfChanged(this.ssaoBlurFirstPassRenderable.values.uNear,t.near),O.updateIfChanged(this.ssaoBlurSecondPassRenderable.values.uNear,t.near),O.updateIfChanged(this.ssaoBlurFirstPassRenderable.values.uFar,t.far),O.updateIfChanged(this.ssaoBlurSecondPassRenderable.values.uFar,t.far),O.update(this.ssaoBlurFirstPassRenderable.values.uInvProjection,g),O.update(this.ssaoBlurSecondPassRenderable.values.uInvProjection,g),this.ssaoBlurFirstPassRenderable.values.dOrthographic.ref.value!==p&&(l=!0,O.update(this.ssaoBlurFirstPassRenderable.values.dOrthographic,p),O.update(this.ssaoBlurSecondPassRenderable.values.dOrthographic,p)),this.nSamples!==a.occlusion.params.samples&&(c=!0,this.nSamples=a.occlusion.params.samples,O.update(this.ssaoRenderable.values.uSamples,Cre(this.nSamples)),O.updateIfChanged(this.ssaoRenderable.values.dNSamples,this.nSamples));var w="on"===a.occlusion.params.multiScale.name;if(this.ssaoRenderable.values.dMultiScale.ref.value!==w&&(c=!0,O.update(this.ssaoRenderable.values.dMultiScale,w)),"on"===a.occlusion.params.multiScale.name){var A=a.occlusion.params.multiScale.params;if(!rd(this.levels,A.levels)){c=!0,this.levels=A.levels;var E=function jYe(e,t){var r=e.length,n=t||{radius:new Array(3*r).fill(0),bias:new Array(3*r).fill(0)},a=n.radius,i=n.bias;e=e.slice().sort(function(u,c){return u.radius-c.radius});for(var o=0;o=m.length)return-2;var h=i.viewport,v=h.x,g=h.y,y=h.width,S=h.height,C=1/m.length;if(-1===t)l.render(r,n,!1),O.update(s.values.uWeight,1),O.update(s.values.tColor,l.getColorTarget(n.postprocessing).texture),s.update(),c.bind(),p.disable(f.BLEND),p.disable(f.DEPTH_TEST),p.depthMask(!1),p.viewport(v,g,y,S),p.scissor(v,g,y,S),s.render(),t+=1;else{i.viewOffset.enabled=!0,O.update(s.values.tColor,l.getColorTarget(n.postprocessing).texture),O.update(s.values.uWeight,C),s.update();for(var _=Math.pow(2,Math.max(0,n.multiSample.sampleLevel-2)),x=0;x<_;++x){var D=m[t];if(za.setViewOffset(i.viewOffset,y,S,D[0],D[1],y,S),i.update(),0===t?l.postprocessing.setOcclusionOffset(0,0):l.postprocessing.setOcclusionOffset(D[0]/y,D[1]/S),l.render(r,n,!1),u.bind(),p.enable(f.BLEND),p.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),p.blendFuncSeparate(f.ONE,f.ONE,f.ONE,f.ONE),p.disable(f.DEPTH_TEST),p.depthMask(!1),p.viewport(v,g,y,S),p.scissor(v,g,y,S),0===t&&(p.clearColor(0,0,0,0),f.clear(f.COLOR_BUFFER_BIT)),s.render(),(t+=1)>=m.length)break}}l.postprocessing.setOcclusionOffset(0,0),this.bindOutputTarget(a),p.viewport(v,g,y,S),p.scissor(v,g,y,S);var w=t*C;return w>0&&(O.update(s.values.uWeight,1),O.update(s.values.tColor,u.texture),s.update(),p.disable(f.BLEND),s.render()),w<1&&(O.update(s.values.uWeight,1-w),O.update(s.values.tColor,c.texture),s.update(),0===w?p.disable(f.BLEND):p.enable(f.BLEND),s.render()),i.viewOffset.enabled=!1,i.update(),xt&&d.timer.markEnd("MultiSamplePass.renderTemporalMultiSample"),t>=m.length?-2:t},e}(),HN=[[[0,0]],[[0,0],[-4,-4]],[[0,0],[6,-2],[-6,2],[2,6]],[[0,0],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[0,0],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[0,0],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];HN.forEach(function(e){e.forEach(function(t){t[0]*=.0625,t[1]*=.0625})});var wre=function(){function e(t){this.multiSamplePass=t,this.sampleIndex=-2}return e.prototype.update=function(t,r){return t&&(this.sampleIndex=-1),"temporal"===r.mode&&-2!==this.sampleIndex},e.prototype.render=function(t,r,n,a){return this.sampleIndex=this.multiSamplePass.render(this.sampleIndex,t,r,n,!!a),this.sampleIndex<0},e}(),Are={eyeSeparation:T.Numeric(.062,{min:.02,max:.1,step:.001},{description:"Distance between left and right camera."}),focus:T.Numeric(10,{min:1,max:20,step:.1},{description:"Apparent object distance."})},KYe=T.getDefaultValues(Are),_y=function(){function e(t,r){void 0===r&&(r={}),this.parent=t,this.left=new Tre,this.right=new Tre,this.props=R(R({},KYe),r)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this.parent.viewport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewOffset",{get:function(){return this.parent.viewOffset},enumerable:!1,configurable:!0}),e.prototype.setProps=function(t){Object.assign(this.props,t)},e.prototype.update=function(){this.parent.update(),function ZYe(e,t,r,n){eo.copy(r.viewport,e.viewport),he.copy(r.view,e.view),he.copy(r.projection,e.projection),za.copySnapshot(r.state,e.state),za.copyViewOffset(r.viewOffset,e.viewOffset),r.far=e.far,r.near=e.near,r.fogFar=e.fogFar,r.fogNear=e.fogNear,eo.copy(n.viewport,e.viewport),he.copy(n.view,e.view),he.copy(n.projection,e.projection),za.copySnapshot(n.state,e.state),za.copyViewOffset(n.viewOffset,e.viewOffset),n.far=e.far,n.near=e.near,n.fogFar=e.fogFar,n.fogNear=e.fogNear;var a=Math.floor(e.viewport.width/2),i=a/e.viewport.height;r.viewport.width=a,n.viewport.x+=a,n.viewport.width-=a;var c,l,o=t.eyeSeparation/2,s=o*e.near/t.focus,u=e.near*Math.tan(.5*e.state.fov);Dre[12]=-o,Ere[12]=o,r.projection[0]=2*e.near/((l=u*i+s)-(c=-u*i+s)),r.projection[8]=(l+c)/(l-c),he.mul(r.view,r.view,Dre),he.mul(r.projectionView,r.projection,r.view),he.invert(r.inverseProjectionView,r.projectionView),n.projection[0]=2*e.near/((l=u*i-s)-(c=-u*i-s)),n.projection[8]=(l+c)/(l-c),he.mul(n.view,n.view,Ere),he.mul(n.projectionView,n.projection,n.view),he.invert(n.inverseProjectionView,n.projectionView)}(this.parent,this.props,this.left,this.right)},e}();!function(e){e.is=function t(r){return"left"in r&&"right"in r}}(_y||(_y={}));var Tre=function e(){this.viewport=eo.create(0,0,0,0),this.view=he(),this.projection=he(),this.projectionView=he(),this.inverseProjectionView=he(),this.state=za.createDefaultSnapshot(),this.viewOffset=za.ViewOffset(),this.far=0,this.near=0,this.fogFar=0,this.fogNear=0},Dre=he.identity(),Ere=he.identity(),jN=Math.pow(2,24)-2,QYe=function(){function e(t,r,n){this.webgl=t,this.drawPass=r,this.pickBaseScale=n;var a=n/t.pixelRatio;this.pickWidth=Math.ceil(r.colorTarget.getWidth()*a),this.pickHeight=Math.ceil(r.colorTarget.getHeight()*a);var i=t.resources,o=t.extensions.drawBuffers,s=t.gl;o?(this.objectPickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.objectPickTexture.define(this.pickWidth,this.pickHeight),this.instancePickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.instancePickTexture.define(this.pickWidth,this.pickHeight),this.groupPickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.groupPickTexture.define(this.pickWidth,this.pickHeight),this.depthPickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.depthPickTexture.define(this.pickWidth,this.pickHeight),this.framebuffer=i.framebuffer(),this.objectPickFramebuffer=i.framebuffer(),this.instancePickFramebuffer=i.framebuffer(),this.groupPickFramebuffer=i.framebuffer(),this.depthPickFramebuffer=i.framebuffer(),this.framebuffer.bind(),o.drawBuffers([o.COLOR_ATTACHMENT0,o.COLOR_ATTACHMENT1,o.COLOR_ATTACHMENT2,o.COLOR_ATTACHMENT3]),this.objectPickTexture.attachFramebuffer(this.framebuffer,"color0"),this.instancePickTexture.attachFramebuffer(this.framebuffer,"color1"),this.groupPickTexture.attachFramebuffer(this.framebuffer,"color2"),this.depthPickTexture.attachFramebuffer(this.framebuffer,"color3"),this.depthRenderbuffer=$t(s)?i.renderbuffer("depth32f","depth",this.pickWidth,this.pickHeight):i.renderbuffer("depth16","depth",this.pickWidth,this.pickHeight),this.depthRenderbuffer.attachFramebuffer(this.framebuffer),this.objectPickTexture.attachFramebuffer(this.objectPickFramebuffer,"color0"),this.instancePickTexture.attachFramebuffer(this.instancePickFramebuffer,"color0"),this.groupPickTexture.attachFramebuffer(this.groupPickFramebuffer,"color0"),this.depthPickTexture.attachFramebuffer(this.depthPickFramebuffer,"color0")):(this.objectPickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight),this.instancePickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight),this.groupPickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight),this.depthPickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight))}return e.prototype.bindObject=function(){this.webgl.extensions.drawBuffers?this.objectPickFramebuffer.bind():this.objectPickTarget.bind()},e.prototype.bindInstance=function(){this.webgl.extensions.drawBuffers?this.instancePickFramebuffer.bind():this.instancePickTarget.bind()},e.prototype.bindGroup=function(){this.webgl.extensions.drawBuffers?this.groupPickFramebuffer.bind():this.groupPickTarget.bind()},e.prototype.bindDepth=function(){this.webgl.extensions.drawBuffers?this.depthPickFramebuffer.bind():this.depthPickTarget.bind()},Object.defineProperty(e.prototype,"drawingBufferHeight",{get:function(){return this.drawPass.colorTarget.getHeight()},enumerable:!1,configurable:!0}),e.prototype.syncSize=function(){var t=this.pickBaseScale/this.webgl.pixelRatio,r=Math.ceil(this.drawPass.colorTarget.getWidth()*t),n=Math.ceil(this.drawPass.colorTarget.getHeight()*t);(r!==this.pickWidth||n!==this.pickHeight)&&(this.pickWidth=r,this.pickHeight=n,this.webgl.extensions.drawBuffers?(this.objectPickTexture.define(this.pickWidth,this.pickHeight),this.instancePickTexture.define(this.pickWidth,this.pickHeight),this.groupPickTexture.define(this.pickWidth,this.pickHeight),this.depthPickTexture.define(this.pickWidth,this.pickHeight),this.depthRenderbuffer.setSize(this.pickWidth,this.pickHeight)):(this.objectPickTarget.setSize(this.pickWidth,this.pickHeight),this.instancePickTarget.setSize(this.pickWidth,this.pickHeight),this.groupPickTarget.setSize(this.pickWidth,this.pickHeight),this.depthPickTarget.setSize(this.pickWidth,this.pickHeight)))},e.prototype.renderVariant=function(t,r,n,a,i,o){t.clear(!1),t.update(r,n),t.renderPick(n.primitives,r,i,null,o),a.handle.isEnabled&&t.renderPick(a.handle.scene,r,i,null,o),a.camera.isEnabled&&(a.camera.update(r),t.update(a.camera.camera,a.camera.scene),t.renderPick(a.camera.scene,a.camera.camera,i,null,o))},e.prototype.render=function(t,r,n,a){this.webgl.extensions.drawBuffers?(this.framebuffer.bind(),this.renderVariant(t,r,n,a,"pick",Cv.None)):(this.objectPickTarget.bind(),this.renderVariant(t,r,n,a,"pick",Cv.Object),this.instancePickTarget.bind(),this.renderVariant(t,r,n,a,"pick",Cv.Instance),this.groupPickTarget.bind(),this.renderVariant(t,r,n,a,"pick",Cv.Group),this.depthPickTarget.bind(),this.renderVariant(t,r,n,a,"depth",Cv.None))},e}(),$Ye=function(){function e(t,r,n,a,i,o,s){void 0===s&&(s=1),this.webgl=t,this.renderer=r,this.scene=n,this.helper=a,this.pickPass=i,this.pickPadding=s,this.dirty=!0,this.viewport=eo(),this.setViewport(o.x,o.y,o.width,o.height)}return e.prototype.setupBuffers=function(){var t=this.pickWidth*this.pickHeight*4;(!this.objectBuffer||this.objectBuffer.length!==t)&&(this.objectBuffer=new Uint8Array(t),this.instanceBuffer=new Uint8Array(t),this.groupBuffer=new Uint8Array(t),this.depthBuffer=new Uint8Array(t))},e.prototype.setViewport=function(t,r,n,a){eo.set(this.viewport,t,r,n,a),this.pickScale=this.pickPass.pickBaseScale/this.webgl.pixelRatio,this.pickX=Math.ceil(t*this.pickScale),this.pickY=Math.ceil(r*this.pickScale);var i=Math.floor(n*this.pickScale),o=Math.floor(a*this.pickScale);(i!==this.pickWidth||o!==this.pickHeight)&&(this.pickWidth=i,this.pickHeight=o,this.halfPickWidth=Math.floor(this.pickWidth/2),this.setupBuffers()),this.spiral=function D_e(e){for(var t,r=0,n=0,a=[0,-1],i=2*e+1,o=i/2,s=[],u=Math.pow(i,2);u>0;--u)-o0&&r===1-n)&&(a[0]=(t=[-a[1],a[0]])[0],a[1]=t[1]),r+=a[0],n+=a[1];return s}(Math.round(this.pickScale*this.pickPadding))},e.prototype.syncBuffers=function(){xt&&this.webgl.timer.mark("PickHelper.syncBuffers");var t=this,r=t.pickX,n=t.pickY,a=t.pickWidth,i=t.pickHeight;this.pickPass.bindObject(),this.webgl.readPixels(r,n,a,i,this.objectBuffer),this.pickPass.bindInstance(),this.webgl.readPixels(r,n,a,i,this.instanceBuffer),this.pickPass.bindGroup(),this.webgl.readPixels(r,n,a,i,this.groupBuffer),this.pickPass.bindDepth(),this.webgl.readPixels(r,n,a,i,this.depthBuffer),xt&&this.webgl.timer.markEnd("PickHelper.syncBuffers")},e.prototype.getBufferIdx=function(t,r){return 4*(r*this.pickWidth+t)},e.prototype.getDepth=function(t,r){var n=this.getBufferIdx(t,r),a=this.depthBuffer;return function FFe(e,t,r,n){return dr.set(_K,e/255,t/255,r/255,n/255),dr.dot(_K,OFe)}(a[n],a[n+1],a[n+2],a[n+3])},e.prototype.getId=function(t,r,n){var a=this.getBufferIdx(t,r);return s4(n[a],n[a+1],n[a+2])},e.prototype.render=function(t){xt&&this.webgl.timer.mark("PickHelper.render",!0);var r=this,n=r.pickX,a=r.pickY,i=r.pickWidth,o=r.pickHeight,s=r.halfPickWidth,u=this,c=u.renderer,l=u.scene,d=u.helper;c.setTransparentBackground(!1),c.setDrawingBufferSize(i,o),c.setPixelRatio(this.pickScale),_y.is(t)?(c.setViewport(n,a,s,o),this.pickPass.render(c,t.left,l,d),c.setViewport(n+s,a,i-s,o),this.pickPass.render(c,t.right,l,d)):(c.setViewport(n,a,i,o),this.pickPass.render(c,t,l,d)),this.dirty=!1,xt&&this.webgl.timer.markEnd("PickHelper.render")},e.prototype.identifyInternal=function(t,r,n){var i=this.webgl,o=this.pickScale;if(!i.isContextLost){r=this.pickPass.drawingBufferHeight-(r*=i.pixelRatio);var s=this.viewport;if(!((t*=i.pixelRatio)s.x+s.width||r>s.y+s.height)){this.dirty&&(xt&&this.webgl.timer.mark("PickHelper.identify"),this.render(n),this.syncBuffers(),xt&&this.webgl.timer.markEnd("PickHelper.identify"));var u=t-s.x,c=r-s.y,l=Math.floor(u*o),d=Math.floor(c*o),f=this.getId(l,d,this.objectBuffer);if(-1!==f&&f!==jN){var p=this.getId(l,d,this.instanceBuffer);if(-1!==p&&p!==jN){var m=this.getId(l,d,this.groupBuffer);if(-1!==m&&m!==jN){var h=this.getDepth(l,d),v=b.create(t,r,h);if(_y.is(n)){var g=Math.floor(s.width/2);t>s.x+g?(v[0]=s.x+2*(u-g),kT(v,v,s,n.right.inverseProjectionView)):(v[0]=s.x+2*u,kT(v,v,s,n.left.inverseProjectionView))}else kT(v,v,s,n.inverseProjectionView);return{id:{objectId:f,instanceId:p,groupId:m},position:v}}}}}}},e.prototype.identify=function(t,r,n){for(var a=0,i=this.spiral;a